[geos-commits] [SCM] GEOS branch master updated. 7ed0c824b76e2127a16597546e507900fe6816ef

git at osgeo.org git at osgeo.org
Sun Dec 1 19:19:44 PST 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  7ed0c824b76e2127a16597546e507900fe6816ef (commit)
      from  fbb180464035f2dd573cbbe3aa722d5dec159ea2 (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 7ed0c824b76e2127a16597546e507900fe6816ef
Author: Daniel Baston <dbaston at gmail.com>
Date:   Wed Nov 27 21:17:07 2019 -0500

    Avoid MonotoneChain self-compare in SimpleMCSweepLineIntersector
    
    This is a hotspot in validity profiling. This commit reduces the runtime
    of GEOSisValid from 3.7s to 2.0s for the 5,489 polygons in the
    HydroBASINS level 5 dataset, and from 610ms to 360ms for the individual
    polygon components of the boundary of Australia in the GADM country
    dataset.

diff --git a/NEWS b/NEWS
index c60ee6b..ba45097 100644
--- a/NEWS
+++ b/NEWS
@@ -2,10 +2,11 @@ Changes in 3.9.0
 2020-xx-xx
 
 - New things:
-  - 
+  -
 
 - Improvements:
   - Stack allocate segments in OverlapUnion (Paul Ramsey)
+  - Improve performance of GEOSisValid (Dan Baston)
 
 
 Changes in 3.8.0
diff --git a/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp b/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
index b635ad7..f5749c9 100644
--- a/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
+++ b/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
@@ -143,6 +143,14 @@ SimpleMCSweepLineIntersector::processOverlaps(size_t start, size_t end,
         auto& ev1 = events[i];
         if(ev1->isInsert()) {
             MonotoneChain* mc1 = (MonotoneChain*) ev1->getObject();
+
+            if (mc1 == mc0) {
+                // Don't try to compute intersections between a MonotoneChain
+                // and itself. SegmentIntersector::addIntersections will just
+                // ignore them anyway.
+                continue;
+            }
+
             // don't compare edges in same group
             // null group indicates that edges should be compared
             if(ev0->edgeSet == nullptr || (ev0->edgeSet != ev1->edgeSet)) {

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

Summary of changes:
 NEWS                                                 | 3 ++-
 src/geomgraph/index/SimpleMCSweepLineIntersector.cpp | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list