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

git at osgeo.org git at osgeo.org
Wed Sep 16 15:15:37 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  c4aebbbc048618e75b39f6c8d85dce8e8216cf9f (commit)
      from  2e033c754f2767be3d718b0cfcce7b1ed3290a66 (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 c4aebbbc048618e75b39f6c8d85dce8e8216cf9f
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Sep 16 15:15:28 2020 -0700

    Rename OverlayNGSnapIfNeeded to OverlayNGRobust, https://github.com/dr-jts/jts/commit/c1277b0658868bf49db0f9583255eebed7d0a757

diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index 413d154..39f3dfc 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -66,7 +66,7 @@
 #include <geos/operation/overlay/snap/GeometrySnapper.h>
 #include <geos/operation/overlayng/PrecisionReducer.h>
 #include <geos/operation/overlayng/OverlayNG.h>
-#include <geos/operation/overlayng/OverlayNGSnapIfNeeded.h>
+#include <geos/operation/overlayng/OverlayNGRobust.h>
 #include <geos/operation/overlayng/UnaryUnionNG.h>
 #include <geos/operation/intersection/Rectangle.h>
 #include <geos/operation/intersection/RectangleIntersection.h>
@@ -160,7 +160,7 @@ using geos::operation::distance::IndexedFacetDistance;
 using geos::operation::geounion::CascadedPolygonUnion;
 using geos::operation::overlayng::OverlayNG;
 using geos::operation::overlayng::UnaryUnionNG;
-using geos::operation::overlayng::OverlayNGSnapIfNeeded;
+using geos::operation::overlayng::OverlayNGRobust;
 
 using geos::precision::GeometryPrecisionReducer;
 
@@ -1065,7 +1065,7 @@ extern "C" {
             auto g3 = gridSize != 0 ?
               OverlayNG::overlay(g1, g2, OverlayNG::INTERSECTION, pm.get())
               :
-              OverlayNGSnapIfNeeded::Overlay(g1, g2, OverlayNG::INTERSECTION);
+              OverlayNGRobust::Overlay(g1, g2, OverlayNG::INTERSECTION);
             g3->setSRID(g1->getSRID());
             return g3.release();
         });
@@ -1272,7 +1272,7 @@ extern "C" {
             auto g3 = gridSize != 0 ?
                 OverlayNG::overlay(g1, g2, OverlayNG::DIFFERENCE, pm.get())
                 :
-                OverlayNGSnapIfNeeded::Overlay(g1, g2, OverlayNG::DIFFERENCE);
+                OverlayNGRobust::Overlay(g1, g2, OverlayNG::DIFFERENCE);
             g3->setSRID(g1->getSRID());
             return g3.release();
         });
@@ -1313,7 +1313,7 @@ extern "C" {
             auto g3 = gridSize != 0 ?
               OverlayNG::overlay(g1, g2, OverlayNG::SYMDIFFERENCE, pm.get())
               :
-              OverlayNGSnapIfNeeded::Overlay(g1, g2, OverlayNG::SYMDIFFERENCE);
+              OverlayNGRobust::Overlay(g1, g2, OverlayNG::SYMDIFFERENCE);
             g3->setSRID(g1->getSRID());
             return g3.release();
         });
@@ -1344,7 +1344,7 @@ extern "C" {
             auto g3 = gridSize != 0 ?
               OverlayNG::overlay(g1, g2, OverlayNG::UNION, pm.get())
               :
-              OverlayNGSnapIfNeeded::Overlay(g1, g2, OverlayNG::UNION);
+              OverlayNGRobust::Overlay(g1, g2, OverlayNG::UNION);
             g3->setSRID(g1->getSRID());
             return g3.release();
         });
@@ -1385,7 +1385,7 @@ extern "C" {
             auto g3 = gridSize != 0 ?
               UnaryUnionNG::Union(g1, *pm)
               :
-              OverlayNGSnapIfNeeded::Union(g1);
+              OverlayNGRobust::Union(g1);
             g3->setSRID(g1->getSRID());
             return g3.release();
         });
diff --git a/include/geos/operation/overlayng/Makefile.am b/include/geos/operation/overlayng/Makefile.am
index ff8b324..0dd90d8 100644
--- a/include/geos/operation/overlayng/Makefile.am
+++ b/include/geos/operation/overlayng/Makefile.am
@@ -27,7 +27,7 @@ geos_HEADERS = \
     OverlayMixedPoints.h \
     OverlayPoints.h \
     OverlayNG.h \
-    OverlayNGSnapIfNeeded.h \
+    OverlayNGRobust.h \
     OverlayUtil.h \
     PolygonBuilder.h \
     PrecisionReducer.h \
diff --git a/include/geos/operation/overlayng/OverlayNG.h b/include/geos/operation/overlayng/OverlayNG.h
index c694517..74efe8d 100644
--- a/include/geos/operation/overlayng/OverlayNG.h
+++ b/include/geos/operation/overlayng/OverlayNG.h
@@ -70,7 +70,7 @@ namespace overlayng { // geos.operation.overlayng
  * For floating precision an {@link noding::MCIndexNoder} is used.
  * This is not fully robust, so can sometimes result in
  * {@link util::TopologyException}s being thrown.
- * For robust full-precision overlay see {@link OverlayNGSnapIfNeeded}.
+ * For robust full-precision overlay see {@link OverlayNGRobust}.
  *
  * Note: If a {@link noding::snap::SnappingNoder} is used
  * it is best to specify a fairly small snap tolerance,
@@ -79,7 +79,7 @@ namespace overlayng { // geos.operation.overlayng
  *
  * @author mdavis
  *
- * @see OverlayNGSnapIfNeeded
+ * @see OverlayNGRobust
  *
  */
 class GEOS_DLL OverlayNG {
diff --git a/include/geos/operation/overlayng/OverlayNGSnapIfNeeded.h b/include/geos/operation/overlayng/OverlayNGRobust.h
similarity index 97%
rename from include/geos/operation/overlayng/OverlayNGSnapIfNeeded.h
rename to include/geos/operation/overlayng/OverlayNGRobust.h
index 1857424..bc4570b 100644
--- a/include/geos/operation/overlayng/OverlayNGSnapIfNeeded.h
+++ b/include/geos/operation/overlayng/OverlayNGRobust.h
@@ -57,7 +57,7 @@ namespace overlayng { // geos.operation.overlayng
  *
  * @author Martin Davis
  */
-class GEOS_DLL OverlayNGSnapIfNeeded {
+class GEOS_DLL OverlayNGRobust {
 
 private:
 
@@ -108,7 +108,7 @@ public:
 
         std::unique_ptr<geom::Geometry> Union(const geom::Geometry* g0, const geom::Geometry* g1) override
         {
-            return OverlayNGSnapIfNeeded::Overlay(g0, g1, OverlayNG::UNION);
+            return OverlayNGRobust::Overlay(g0, g1, OverlayNG::UNION);
         };
 
         bool isFloatingPrecision() const override
diff --git a/src/geom/Geometry.cpp b/src/geom/Geometry.cpp
index 966657c..3bb6007 100644
--- a/src/geom/Geometry.cpp
+++ b/src/geom/Geometry.cpp
@@ -51,7 +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/operation/overlayng/OverlayNGRobust.h>
 #include <geos/io/WKBWriter.h>
 #include <geos/io/WKTWriter.h>
 #include <geos/version.h>
@@ -614,7 +614,7 @@ Geometry::Union() const
 {
     using geos::operation::geounion::UnaryUnionOp;
 #ifdef USE_OVERLAYNG
-    return operation::overlayng::OverlayNGSnapIfNeeded::Union(this);
+    return operation::overlayng::OverlayNGRobust::Union(this);
 #else
     return UnaryUnionOp::Union(*this);
 #endif
diff --git a/src/geom/HeuristicOverlay.cpp b/src/geom/HeuristicOverlay.cpp
index 8ea3e0e..3704cdc 100644
--- a/src/geom/HeuristicOverlay.cpp
+++ b/src/geom/HeuristicOverlay.cpp
@@ -48,7 +48,7 @@
 #include <geos/geom/HeuristicOverlay.h>
 #include <geos/operation/overlay/OverlayOp.h>
 #include <geos/operation/overlayng/OverlayNG.h>
-#include <geos/operation/overlayng/OverlayNGSnapIfNeeded.h>
+#include <geos/operation/overlayng/OverlayNGRobust.h>
 
 #include <geos/simplify/TopologyPreservingSimplifier.h>
 #include <geos/operation/IsSimpleOp.h>
@@ -218,7 +218,7 @@ check_valid(const Geometry& g, const std::string& label, bool doThrow = false, b
 #endif
             if(doThrow) {
                 throw geos::util::TopologyException(
-                    label + " is invalid: " + err->toString(),
+                    label + " is invalid: " + err->getMessage(),
                     err->getCoordinate());
             }
             return false;
@@ -371,7 +371,7 @@ HeuristicOverlay(const Geometry* g0, const Geometry* g1, int opCode)
 /**************************************************************************/
 
 /*
-* overlayng::OverlayNGSnapIfNeeded carries out the following steps
+* overlayng::OverlayNGRobust carries out the following steps
 *
 * 1. Perform overlay operation using PrecisionModel(float).
 *    If no exception return result.
@@ -386,13 +386,13 @@ HeuristicOverlay(const Geometry* g0, const Geometry* g1, int opCode)
 *    grid, resulting in a modified geometry. The SnapRoundingNoder approach
 *    reliably produces results, assuming valid inputs.
 *
-* Running overlayng::OverlayNGSnapIfNeeded at this stage should guarantee
+* Running overlayng::OverlayNGRobust at this stage should guarantee
 * that none of the other heuristics are ever needed.
 */
 #ifdef USE_OVERLAYNG_SNAPIFNEEDED
 
 #if GEOS_DEBUG_HEURISTICOVERLAY
-    std::cerr << "Trying with OverlayNGSnapIfNeeded" << std::endl;
+    std::cerr << "Trying with OverlayNGRobust" << std::endl;
 #endif
 
     try {
@@ -403,30 +403,35 @@ HeuristicOverlay(const Geometry* g0, const Geometry* g1, int opCode)
             // Use a uniary union for the one-parameter case, as the pairwise
             // union with one parameter is very intolerant to invalid
             // collections and multi-polygons.
-            ret = operation::overlayng::OverlayNGSnapIfNeeded::Union(g1);
+            ret = operation::overlayng::OverlayNGRobust::Union(g1);
         }
         else if (g1 == nullptr) {
             // Use a uniary union for the one-parameter case, as the pairwise
             // union with one parameter is very intolerant to invalid
             // collections and multi-polygons.
-            ret = operation::overlayng::OverlayNGSnapIfNeeded::Union(g0);
+            ret = operation::overlayng::OverlayNGRobust::Union(g0);
         }
         else {
-            ret = operation::overlayng::OverlayNGSnapIfNeeded::Overlay(g0, g1, opCode);
+            ret = operation::overlayng::OverlayNGRobust::Overlay(g0, g1, opCode);
         }
 
 #if GEOS_DEBUG_HEURISTICOVERLAY
-        std::cerr << "Attempt with OverlayNGSnapIfNeeded succeeded" << std::endl;
+        std::cerr << "Attempt with OverlayNGRobust succeeded" << std::endl;
 #endif
 
         return ret;
     }
-    catch(const geos::util::TopologyException& ex) {
+    catch(const std::exception& ex) {
         ::geos::ignore_unused_variable_warning(ex);
+
 #if GEOS_DEBUG_HEURISTICOVERLAY
-        std::cerr << "OverlayNGSnapIfNeeded: " << ex.what() << std::endl;
+        std::cerr << "OverlayNGRobust: " << ex.what() << std::endl;
 #endif
     }
+
+        check_valid(*g0, "Input geom 0", true, true);
+        check_valid(*g1, "Input geom 1", true, true);
+
 #endif // USE_OVERLAYNG_SNAPIFNEEDED }
 
 
diff --git a/src/operation/overlayng/Makefile.am b/src/operation/overlayng/Makefile.am
index 853f300..205273d 100644
--- a/src/operation/overlayng/Makefile.am
+++ b/src/operation/overlayng/Makefile.am
@@ -26,7 +26,7 @@ libopoverlayng_la_SOURCES = \
     OverlayMixedPoints.cpp \
     OverlayPoints.cpp \
     OverlayNG.cpp \
-    OverlayNGSnapIfNeeded.cpp \
+    OverlayNGRobust.cpp \
     OverlayUtil.cpp \
     PolygonBuilder.cpp \
     PrecisionReducer.cpp \
diff --git a/src/operation/overlayng/OverlayNGSnapIfNeeded.cpp b/src/operation/overlayng/OverlayNGRobust.cpp
similarity index 81%
rename from src/operation/overlayng/OverlayNGSnapIfNeeded.cpp
rename to src/operation/overlayng/OverlayNGRobust.cpp
index dbcd43f..b942d1b 100644
--- a/src/operation/overlayng/OverlayNGSnapIfNeeded.cpp
+++ b/src/operation/overlayng/OverlayNGRobust.cpp
@@ -12,7 +12,7 @@
  *
  **********************************************************************/
 
-#include <geos/operation/overlayng/OverlayNGSnapIfNeeded.h>
+#include <geos/operation/overlayng/OverlayNGRobust.h>
 
 #include <geos/operation/overlayng/OverlayNG.h>
 #include <geos/operation/overlayng/OverlayUtil.h>
@@ -39,35 +39,35 @@ using namespace geos::geom;
 
 /*public static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::Intersection(const Geometry* g0, const Geometry* g1)
+OverlayNGRobust::Intersection(const Geometry* g0, const Geometry* g1)
 {
     return Overlay(g0, g1, OverlayNG::INTERSECTION);
 }
 
 /*public static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::Union(const Geometry* g0, const Geometry* g1)
+OverlayNGRobust::Union(const Geometry* g0, const Geometry* g1)
 {
     return Overlay(g0, g1, OverlayNG::UNION);
 }
 
 /*public static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::Difference(const Geometry* g0, const Geometry* g1)
+OverlayNGRobust::Difference(const Geometry* g0, const Geometry* g1)
 {
     return Overlay(g0, g1, OverlayNG::DIFFERENCE);
 }
 
 /*public static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::SymDifference(const Geometry* g0, const Geometry* g1)
+OverlayNGRobust::SymDifference(const Geometry* g0, const Geometry* g1)
 {
     return Overlay(g0, g1, OverlayNG::SYMDIFFERENCE);
 }
 
 /*public static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::Union(const Geometry* a)
+OverlayNGRobust::Union(const Geometry* a)
 {
     geounion::UnaryUnionOp op(*a);
     SRUnionStrategy unionSRFun;
@@ -77,7 +77,7 @@ OverlayNGSnapIfNeeded::Union(const Geometry* a)
 
 /*public static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::Overlay(const Geometry* geom0, const Geometry* geom1, int opCode)
+OverlayNGRobust::Overlay(const Geometry* geom0, const Geometry* geom1, int opCode)
 {
     std::unique_ptr<Geometry> result;
     std::runtime_error exOriginal("");
@@ -148,7 +148,7 @@ OverlayNGSnapIfNeeded::Overlay(const Geometry* geom0, const Geometry* geom1, int
 
 /*private static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::overlaySnapTries(const Geometry* geom0, const Geometry* geom1, int opCode)
+OverlayNGRobust::overlaySnapTries(const Geometry* geom0, const Geometry* geom1, int opCode)
 {
     std::unique_ptr<Geometry> result;
     double snapTol = snapTolerance(geom0, geom1);
@@ -178,17 +178,14 @@ OverlayNGSnapIfNeeded::overlaySnapTries(const Geometry* geom0, const Geometry* g
 
 /*private static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::overlaySnapping(const Geometry* geom0, const Geometry* geom1, int opCode, double snapTol)
+OverlayNGRobust::overlaySnapping(const Geometry* geom0, const Geometry* geom1, int opCode, double snapTol)
 {
     try {
         return overlaySnapTol(geom0, geom1, opCode, snapTol);
     }
-    catch (const geos::util::TopologyException &
-#if GEOS_DEBUG
-            ex
-#endif
-    )
+    catch (const geos::util::TopologyException& ex)
     {
+        ::geos::ignore_unused_variable_warning(ex);
         //---- ignore exception, return null result to indicate failure
 #if GEOS_DEBUG
         std::cout << std::endl << "overlaySnapping(tol " << snapTol << ") FAILURE: " << ex.what() << std::endl;
@@ -199,19 +196,16 @@ OverlayNGSnapIfNeeded::overlaySnapping(const Geometry* geom0, const Geometry* ge
 
 /*private static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::overlaySnapBoth(const Geometry* geom0, const Geometry* geom1, int opCode, double snapTol)
+OverlayNGRobust::overlaySnapBoth(const Geometry* geom0, const Geometry* geom1, int opCode, double snapTol)
 {
     try {
         std::unique_ptr<Geometry> snap0 = overlaySnapTol(geom0, nullptr, OverlayNG::UNION, snapTol);
         std::unique_ptr<Geometry> snap1 = overlaySnapTol(geom1, nullptr, OverlayNG::UNION, snapTol);
         return overlaySnapTol(snap0.get(), snap1.get(), opCode, snapTol);
     }
-    catch (const geos::util::TopologyException &
-#if GEOS_DEBUG
-      ex
-#endif
-    )
+    catch (const geos::util::TopologyException& ex)
     {
+        ::geos::ignore_unused_variable_warning(ex);
         //---- ignore this exception, just return a nullptr result to indicate failure
 #if GEOS_DEBUG
         std::cout << std::endl << "overlaySnapBoth(tol " << snapTol << ") FAILURE: " << ex.what() << std::endl;
@@ -222,7 +216,7 @@ OverlayNGSnapIfNeeded::overlaySnapBoth(const Geometry* geom0, const Geometry* ge
 
 /*private static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::overlaySnapTol(const Geometry* geom0, const Geometry* geom1, int opCode, double snapTol)
+OverlayNGRobust::overlaySnapTol(const Geometry* geom0, const Geometry* geom1, int opCode, double snapTol)
 {
     noding::snap::SnappingNoder snapNoder(snapTol);
     return OverlayNG::overlay(geom0, geom1, opCode, &snapNoder);
@@ -230,7 +224,7 @@ OverlayNGSnapIfNeeded::overlaySnapTol(const Geometry* geom0, const Geometry* geo
 
 /*public static*/
 double
-OverlayNGSnapIfNeeded::snapTolerance(const Geometry* geom0, const Geometry* geom1)
+OverlayNGRobust::snapTolerance(const Geometry* geom0, const Geometry* geom1)
 {
     double tol0 = snapTolerance(geom0);
     double tol1 = snapTolerance(geom1);
@@ -240,7 +234,7 @@ OverlayNGSnapIfNeeded::snapTolerance(const Geometry* geom0, const Geometry* geom
 
 /*private static*/
 double
-OverlayNGSnapIfNeeded::snapTolerance(const Geometry* geom)
+OverlayNGRobust::snapTolerance(const Geometry* geom)
 {
     double magnitude = ordinateMagnitude(geom);
     return magnitude / SNAP_TOL_FACTOR;
@@ -249,7 +243,7 @@ OverlayNGSnapIfNeeded::snapTolerance(const Geometry* geom)
 
 /*private static*/
 double
-OverlayNGSnapIfNeeded::ordinateMagnitude(const Geometry* geom)
+OverlayNGRobust::ordinateMagnitude(const Geometry* geom)
 {
     if (geom == nullptr) return 0;
     const Envelope* env = geom->getEnvelopeInternal();
@@ -267,7 +261,7 @@ OverlayNGSnapIfNeeded::ordinateMagnitude(const Geometry* geom)
 
 /*private static*/
 std::unique_ptr<Geometry>
-OverlayNGSnapIfNeeded::overlaySR(const Geometry* geom0, const Geometry* geom1, int opCode)
+OverlayNGRobust::overlaySR(const Geometry* geom0, const Geometry* geom1, int opCode)
 {
     std::unique_ptr<Geometry> result;
     try {
@@ -276,16 +270,12 @@ OverlayNGSnapIfNeeded::overlaySR(const Geometry* geom0, const Geometry* geom1, i
         result = OverlayNG::overlay(geom0, geom1, opCode, &pmSafe);
         return result;
     }
-    catch (const geos::util::TopologyException &
-#if GEOS_DEBUG
-        //---- ignore exception, return null result to indicate failure
-        ex
-#endif
-    )
+    catch (const geos::util::TopologyException& ex)
     {
+        ::geos::ignore_unused_variable_warning(ex);
         // ignore this exception, since the operation will be rerun
 #if GEOS_DEBUG
-        std::cout << std::endl << "OverlayNGSnapIfNeeded::overlaySR FAILURE: " << ex.what() << std::endl;
+        std::cout << std::endl << "OverlayNGRobust::overlaySR FAILURE: " << ex.what() << std::endl;
 #endif
     }
     return nullptr;
diff --git a/tests/unit/capi/GEOSMakeValidTest.cpp b/tests/unit/capi/GEOSMakeValidTest.cpp
index f50c337..05dc072 100644
--- a/tests/unit/capi/GEOSMakeValidTest.cpp
+++ b/tests/unit/capi/GEOSMakeValidTest.cpp
@@ -93,6 +93,7 @@ void object::test<2>
     const char* hex = "0103000000010000000900000062105839207df640378941e09d491c41ced67431387df640c667e7d398491c4179e92631387df640d9cef7d398491c41fa7e6abcf87df640cdcccc4c70491c41e3a59bc4527df64052b81e053f491c41cdcccccc5a7ef640e3a59bc407491c4104560e2da27df640aaf1d24dd3481c41e9263108c67bf64048e17a1437491c4162105839207df640378941e09d491c41";
     geom1_ = GEOSGeomFromHEX_buf((uint8_t*)hex, std::strlen(hex));
     geom2_ = GEOSMakeValid(geom1_);
+    std::cout << toWKT(geom2_) << std::endl;
     expect_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION(POLYGON((92114.014 463463.469,92115.5120743171 463462.206937429,92115.512 463462.207,92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.826,92092.377 463437.77,92114.014 463463.469)),MULTIPOINT(92115.5120743171 463462.206937429,92122.136 463412.826))");
     GEOSNormalize(geom2_);
     GEOSNormalize(expect_);
diff --git a/tests/xmltester/XMLTester.cpp b/tests/xmltester/XMLTester.cpp
index 1e2889a..8397278 100644
--- a/tests/xmltester/XMLTester.cpp
+++ b/tests/xmltester/XMLTester.cpp
@@ -38,7 +38,7 @@
 #include <geos/operation/overlay/OverlayOp.h>
 #include <geos/operation/overlay/snap/GeometrySnapper.h>
 #include <geos/operation/overlayng/OverlayNG.h>
-#include <geos/operation/overlayng/OverlayNGSnapIfNeeded.h>
+#include <geos/operation/overlayng/OverlayNGRobust.h>
 #include <geos/operation/overlayng/UnaryUnionNG.h>
 #include <geos/operation/buffer/BufferBuilder.h>
 #include <geos/operation/buffer/BufferParameters.h>
@@ -92,7 +92,7 @@ using namespace geos::geom::prep;
 using std::runtime_error;
 using geos::operation::overlayng::OverlayNG;
 using geos::operation::overlayng::UnaryUnionNG;
-using geos::operation::overlayng::OverlayNGSnapIfNeeded;
+using geos::operation::overlayng::OverlayNGRobust;
 
 namespace {
 
@@ -740,7 +740,7 @@ XMLTester::printGeom(const geom::Geometry* g)
         return s2.str();
     }
     else {
-        // wktwriter->setRoundingPrecision(32);
+        wktwriter->setRoundingPrecision(32);
         return wktwriter->write(g);
     }
 }
@@ -762,11 +762,11 @@ XMLTester::areaDelta(const geom::Geometry* a, const geom::Geometry* b, std::stri
     if (areaA == 0 || areaB == 0)
       return 0;
 
-    std::unique_ptr<geom::Geometry> geomU = OverlayNGSnapIfNeeded::Union(a, b);
-    std::unique_ptr<geom::Geometry> geomI = OverlayNGSnapIfNeeded::Intersection(a, b);
-    std::unique_ptr<geom::Geometry> geomDab = OverlayNGSnapIfNeeded::Difference(a, b);
-    std::unique_ptr<geom::Geometry> geomDba = OverlayNGSnapIfNeeded::Difference(b, a);
-    std::unique_ptr<geom::Geometry> geomSD = OverlayNGSnapIfNeeded::SymDifference(a, b);
+    std::unique_ptr<geom::Geometry> geomU = OverlayNGRobust::Union(a, b);
+    std::unique_ptr<geom::Geometry> geomI = OverlayNGRobust::Intersection(a, b);
+    std::unique_ptr<geom::Geometry> geomDab = OverlayNGRobust::Difference(a, b);
+    std::unique_ptr<geom::Geometry> geomDba = OverlayNGRobust::Difference(b, a);
+    std::unique_ptr<geom::Geometry> geomSD = OverlayNGRobust::SymDifference(a, b);
 
     double areaU   = geomU->getArea();
     double areaI   = geomI->getArea();
@@ -1160,7 +1160,7 @@ XMLTester::parseTest(const tinyxml2::XMLNode* node)
 
             profile.start();
             geom::PrecisionModel precMod(precision);
-            GeomPtr gRealRes = OverlayNGSnapIfNeeded::Intersection(gA, gB);
+            GeomPtr gRealRes = OverlayNGRobust::Intersection(gA, gB);
 
             profile.stop();
 
@@ -1950,7 +1950,7 @@ XMLTester::parseTest(const tinyxml2::XMLNode* node)
         else if(opName == "unionlength") {
 
             char* rest;
-            GeomPtr result = OverlayNGSnapIfNeeded::Union(gA);
+            GeomPtr result = OverlayNGRobust::Union(gA);
             double resultLength = result->getLength();
             double expectedLength = std::strtod(opRes.c_str(), &rest);
             if(rest == opRes.c_str()) {
@@ -1970,7 +1970,7 @@ XMLTester::parseTest(const tinyxml2::XMLNode* node)
         else if(opName == "unionarea") {
 
             char* rest;
-            GeomPtr result = OverlayNGSnapIfNeeded::Union(gA);
+            GeomPtr result = OverlayNGRobust::Union(gA);
             double resultArea  = result->getArea();
             double expectedArea = std::strtod(opRes.c_str(), &rest);
             if(rest == opRes.c_str()) {

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

Summary of changes:
 capi/geos_ts_c.cpp                                 | 14 +++---
 include/geos/operation/overlayng/Makefile.am       |  2 +-
 include/geos/operation/overlayng/OverlayNG.h       |  4 +-
 .../{OverlayNGSnapIfNeeded.h => OverlayNGRobust.h} |  4 +-
 src/geom/Geometry.cpp                              |  4 +-
 src/geom/HeuristicOverlay.cpp                      | 27 ++++++-----
 src/operation/overlayng/Makefile.am                |  2 +-
 ...erlayNGSnapIfNeeded.cpp => OverlayNGRobust.cpp} | 54 +++++++++-------------
 tests/unit/capi/GEOSMakeValidTest.cpp              |  1 +
 tests/xmltester/XMLTester.cpp                      | 22 ++++-----
 10 files changed, 65 insertions(+), 69 deletions(-)
 rename include/geos/operation/overlayng/{OverlayNGSnapIfNeeded.h => OverlayNGRobust.h} (97%)
 rename src/operation/overlayng/{OverlayNGSnapIfNeeded.cpp => OverlayNGRobust.cpp} (81%)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list