[geos-commits] [SCM] GEOS branch master updated. 4c70abae2c76eacd6d30d0c503066556a5067b42

git at osgeo.org git at osgeo.org
Fri Aug 16 13:07:18 PDT 2019


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  4c70abae2c76eacd6d30d0c503066556a5067b42 (commit)
      from  3133734b73aec52c70643c41fc43f19cfb5f680f (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 4c70abae2c76eacd6d30d0c503066556a5067b42
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 16 13:06:57 2019 -0700

    Port https://github.com/locationtech/jts/pull/441

diff --git a/src/noding/snapround/MCIndexPointSnapper.cpp b/src/noding/snapround/MCIndexPointSnapper.cpp
index b798eaa..c6be26b 100644
--- a/src/noding/snapround/MCIndexPointSnapper.cpp
+++ b/src/noding/snapround/MCIndexPointSnapper.cpp
@@ -51,28 +51,39 @@ public:
         isNodeAddedVar(false)
     {}
 
+    /**
+    * Reports whether the HotPixel caused a node to be added in any target
+    * segmentString (including its own). If so, the HotPixel must be added as a
+    * node as well.
+    *
+    * @return true if a node was added in any target segmentString.
+    */
     bool
     isNodeAdded() const
     {
         return isNodeAddedVar;
     }
 
+    /**
+    * Check if a segment of the monotone chain intersects
+    * the hot pixel vertex and introduce a snap node if so.
+    * Optimized to avoid noding segments which
+    * contain the vertex (which otherwise
+    * would cause every vertex to be noded).
+    */
     void
     select(chain::MonotoneChain& mc, size_t startIndex) override
     {
         // This is casting away 'constness'!
         NodedSegmentString& ss = *(static_cast<NodedSegmentString*>(mc.getContext()));
 
-        // don't snap a vertex to itself
-        if(parentEdge) {
-            if(&ss == parentEdge && startIndex == vertexIndex) {
+        if (parentEdge == &ss) {
+            // exit if hotpixel is equal to endpoint of target segment
+            if (startIndex == vertexIndex || startIndex + 1 == vertexIndex)
                 return;
-            }
         }
-
-        //isNodeAddedVar = SimpleSnapRounder::addSnappedNode(hotPixel, ss, startIndex);
-
-        isNodeAddedVar = hotPixel.addSnappedNode(ss, startIndex);
+        // snap and record if a node was created
+        isNodeAddedVar |= hotPixel.addSnappedNode(ss, startIndex);
     }
 
     void

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

Summary of changes:
 src/noding/snapround/MCIndexPointSnapper.cpp | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list