[geos-commits] [SCM] GEOS branch master updated. c6774a6a48b2260a370844ffe2de13f69f6de282

git at osgeo.org git at osgeo.org
Wed Jul 29 12:54:10 PDT 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  c6774a6a48b2260a370844ffe2de13f69f6de282 (commit)
      from  a37514038231721381e57b07fcef383f09586a8d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c6774a6a48b2260a370844ffe2de13f69f6de282
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jul 29 12:44:42 2020 -0700

    Add compile-time flags to turn on OverlayNG
    In autoconf, --enable-overlayng
    In cmake, use -DDISABLE_OVERLAYNG=OFF

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0f24ca..159f465 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -166,6 +166,17 @@ else()
 endif()
 
 #-----------------------------------------------------------------------------
+# Target geos_cxx_flags: overlayng code
+#-----------------------------------------------------------------------------
+option(DISABLE_OVERLAYNG "Disable overlayng algorithms" ON)
+if(NOT DISABLE_OVERLAYNG)
+  target_compile_definitions(geos_cxx_flags INTERFACE USE_OVERLAYNG)
+else()
+  message(STATUS
+  "GEOS: DISABLING overlayng algorithms")
+endif()
+
+#-----------------------------------------------------------------------------
 # Target geos_developer_cxx_flags: developer mode compilation flags
 #-----------------------------------------------------------------------------
 # Do NOT install this target for end-users!
diff --git a/configure.ac b/configure.ac
index 3f73659..9386170 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,6 +149,26 @@ else
     AC_MSG_RESULT([no])
 fi
 
+
+dnl --------------------------------------------------------------------
+dnl - check whether user has requested overlayng
+dnl --------------------------------------------------------------------
+
+AC_ARG_ENABLE([overlayng], [  --enable-overlayng    Enable use of new overlay],
+	[case "${enableval}" in
+		yes) use_overlayng=true ;;
+		no)  use_overlayng=false ;;
+		*) AC_MSG_ERROR(bad value ${enableval} for --enable-overlayng) ;;
+	esac],
+	[use_overlayng=false]
+)
+
+if test x"$use_overlayng" = xtrue; then
+	OVERLAYNG_FLAGS="-DUSE_OVERLAYNG"
+else
+	OVERLAYNG_FLAGS=""
+fi
+
 dnl --------------------------------------------------------------------
 dnl - Append default C++ and C flags
 dnl --------------------------------------------------------------------
@@ -183,7 +203,7 @@ NUMERICFLAGS=""
 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ffloat-store], [dummy_cv_ffloat_store], [-ffloat-store], [], [NUMERICFLAGS="$NUMERICFLAGS -ffloat-store"], [])
 
 HUSHWARNING="-DUSE_UNSTABLE_GEOS_CPP_API"
-DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS} ${HUSHWARNING}"
+DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS} ${HUSHWARNING} ${OVERLAYNG_FLAGS}"
 
 AM_CXXFLAGS="${AM_CXXFLAGS} ${DEFAULTFLAGS}"
 AM_CFLAGS="${AM_CFLAGS} ${DEFAULTFLAGS}"
@@ -294,6 +314,7 @@ if test x"$use_ruby" = xtrue; then
 fi
 AM_CONDITIONAL(ENABLE_RUBY, [ test x"$use_ruby" = xtrue ])
 
+
 dnl --------------------------------------------------------------------
 dnl - do operating-system specific things
 dnl --------------------------------------------------------------------
@@ -482,5 +503,6 @@ dnl -- echo "Boost UTF: $use_boost_utf"
 echo "Swig: $use_swig"
 echo "Python bindings: $use_python"
 echo "Ruby bindings: $use_ruby"
+echo "OverlayNG: $use_overlayng"
 
 dnl -- echo "---------------------------------------"
diff --git a/src/geom/Geometry.cpp b/src/geom/Geometry.cpp
index b0f09be..93dcfaa 100644
--- a/src/geom/Geometry.cpp
+++ b/src/geom/Geometry.cpp
@@ -51,6 +51,7 @@
 #include <geos/operation/buffer/BufferOp.h>
 #include <geos/operation/distance/DistanceOp.h>
 #include <geos/operation/IsSimpleOp.h>
+#include <geos/operation/overlayng/OverlayNGSnapIfNeeded.h>
 #include <geos/io/WKBWriter.h>
 #include <geos/io/WKTWriter.h>
 #include <geos/version.h>
@@ -550,7 +551,11 @@ Geometry::intersection(const Geometry* other) const
     }
 #endif
 
+#ifdef USE_OVERLAYNG
+    return operation::overlayng::OverlayNGSnapIfNeeded::Intersection(this, other);
+#else
     return BinaryOp(this, other, overlayOp(OverlayOp::opINTERSECTION));
+#endif
 }
 
 std::unique_ptr<Geometry>
@@ -602,7 +607,11 @@ Geometry::Union(const Geometry* other) const
     }
 #endif
 
+#ifdef USE_OVERLAYNG
+    return operation::overlayng::OverlayNGSnapIfNeeded::Union(this, other);
+#else
     return BinaryOp(this, other, overlayOp(OverlayOp::opUNION));
+#endif
 }
 
 /* public */
@@ -610,7 +619,11 @@ Geometry::Ptr
 Geometry::Union() const
 {
     using geos::operation::geounion::UnaryUnionOp;
+#ifdef USE_OVERLAYNG
+    return operation::overlayng::OverlayNGSnapIfNeeded::Union(this);
+#else
     return UnaryUnionOp::Union(*this);
+#endif
 }
 
 std::unique_ptr<Geometry>
@@ -625,7 +638,11 @@ Geometry::difference(const Geometry* other) const
         return clone();
     }
 
+#ifdef USE_OVERLAYNG
+    return operation::overlayng::OverlayNGSnapIfNeeded::Difference(this, other);
+#else
     return BinaryOp(this, other, overlayOp(OverlayOp::opDIFFERENCE));
+#endif
 }
 
 std::unique_ptr<Geometry>
@@ -673,7 +690,12 @@ Geometry::symDifference(const Geometry* other) const
         return std::unique_ptr<Geometry>(_factory->buildGeometry(v));
     }
 
+#ifdef USE_OVERLAYNG
+    return operation::overlayng::OverlayNGSnapIfNeeded::SymDifference(this, other);
+#else
     return BinaryOp(this, other, overlayOp(OverlayOp::opSYMDIFFERENCE));
+#endif
+
 }
 
 int

-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt        | 11 +++++++++++
 configure.ac          | 24 +++++++++++++++++++++++-
 src/geom/Geometry.cpp | 22 ++++++++++++++++++++++
 3 files changed, 56 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list