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

git at osgeo.org git at osgeo.org
Wed Oct 7 13:06:39 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  e2157728ed6c5a41155b8f9d69d79ab758d63ed4 (commit)
      from  23f7bbd3dd3558b17432402429f1cfb8ec0b7bf1 (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 e2157728ed6c5a41155b8f9d69d79ab758d63ed4
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Oct 7 22:03:49 2020 +0200

    Port JTS fix for very close nodes on same segment.
    
    References #1051 fixing its root cause.
    
    This commit partially reverts abb96620c275 to avoid hiding
    eventual other missing ports from JTS.

diff --git a/include/geos/noding/SegmentNode.h b/include/geos/noding/SegmentNode.h
index bf85019..204bcc8 100644
--- a/include/geos/noding/SegmentNode.h
+++ b/include/geos/noding/SegmentNode.h
@@ -12,7 +12,7 @@
  *
  **********************************************************************
  *
- *  Last port: noding/SegmentNode.java rev. 1.6 (JTS-1.9)
+ * Last port: noding/SegmentNode.java 4667170ea (JTS-1.17)
  *
  **********************************************************************/
 
diff --git a/src/noding/SegmentNode.cpp b/src/noding/SegmentNode.cpp
index b7913cb..840d518 100644
--- a/src/noding/SegmentNode.cpp
+++ b/src/noding/SegmentNode.cpp
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: noding/SegmentNode.java rev. 1.6 (JTS-1.9)
+ * Last port: noding/SegmentNode.java 4667170ea (JTS-1.17)
  *
  **********************************************************************/
 
@@ -99,6 +99,13 @@ SegmentNode::compareTo(const SegmentNode& other)
     cerr << " Coordinates do not equal!" << endl;
 #endif
 
+    // an exterior node is the segment start point,
+    // so always sorts first
+    // this guards against a robustness problem
+    // where the octants are not reliable
+    if (! isInteriorVar) return -1;
+    if (! other.isInteriorVar) return 1;
+
     return SegmentPointComparator::compare(segmentOctant, coord,
                                            other.coord);
 }
diff --git a/src/operation/overlayng/EdgeMerger.cpp b/src/operation/overlayng/EdgeMerger.cpp
index 48c1a35..605180c 100644
--- a/src/operation/overlayng/EdgeMerger.cpp
+++ b/src/operation/overlayng/EdgeMerger.cpp
@@ -16,7 +16,7 @@
 #include <geos/geom/Dimension.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
-#include <geos/util/TopologyException.h>
+#include <geos/util/Assert.h>
 
 
 namespace geos {      // geos
@@ -52,15 +52,17 @@ EdgeMerger::merge()
         }
         else {
             // found an existing edge
+            Edge *baseEdge = it->second;
             // Assert: edges are identical (up to direction)
             // this is a fast (but incomplete) sanity check
-            Edge *baseEdge = it->second;
-            /* NOTE: we throw a TopologyException here as per
-             * https://trac.osgeo.org/geos/ticket/1051#comment:7
-             */
-            if ( baseEdge->size() != edge->size() ) {
-                throw geos::util::TopologyException("Merge of edges of different sizes - probable noding error.");
-            }
+            //
+            // NOTE: we throw an exception to avoid crashing processes
+            // See https://trac.osgeo.org/geos/ticket/1051#comment:29
+            //
+            util::Assert::isTrue(
+                baseEdge->size() == edge->size(),
+                "Merge of edges of different sizes - probable noding error."
+            );
 
             baseEdge->merge(edge);
             //Debug.println("edge merged: " + existing);

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

Summary of changes:
 include/geos/noding/SegmentNode.h      |  2 +-
 src/noding/SegmentNode.cpp             |  9 ++++++++-
 src/operation/overlayng/EdgeMerger.cpp | 18 ++++++++++--------
 3 files changed, 19 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list