[geos-commits] [SCM] GEOS branch 3.7 updated. 06e23006f944e691a4018ac0dd77dad413ebf4bd

git at osgeo.org git at osgeo.org
Wed Sep 4 15:53:10 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, 3.7 has been updated
       via  06e23006f944e691a4018ac0dd77dad413ebf4bd (commit)
      from  f249089b763ceb859e6b9b83ee28742262753b54 (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 06e23006f944e691a4018ac0dd77dad413ebf4bd
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Sep 4 15:52:34 2019 -0700

    Match 3.7 behaviour to trunk.
    There are still performance issues with cascaded union in 3.7 that
    are a regression vs 3.6. No fix has been found in JTS either
    thus far.

diff --git a/src/operation/union/CascadedPolygonUnion.cpp b/src/operation/union/CascadedPolygonUnion.cpp
index 23a1aaf..976baa4 100644
--- a/src/operation/union/CascadedPolygonUnion.cpp
+++ b/src/operation/union/CascadedPolygonUnion.cpp
@@ -263,7 +263,7 @@ CascadedPolygonUnion::unionUsingEnvelopeIntersection(geom::Geometry* g0,
     std::unique_ptr<geom::Geometry> unionCommon(unionActual(g0Int.get(), g1Int.get()));
 
 #if GEOS_DEBUG_CASCADED_UNION
-    if ( ! check_valid(*u, "unionUsingEnvelopeIntersection unionActual return") )
+    if ( ! check_valid(*unionCommon, "unionUsingEnvelopeIntersection unionActual return") )
     {
 #if GEOS_DEBUG_CASCADED_UNION_PRINT_INVALID
       std::cerr << " union between the following is invalid"
@@ -288,36 +288,24 @@ CascadedPolygonUnion::unionUsingEnvelopeIntersection(geom::Geometry* g0,
     }
 #endif
 
-    geom::Envelope const* unionCommonEnv = unionCommon->getEnvelopeInternal(); // TODO: check for EMPTY ?
-
     std::vector<geom::Geometry*> polysOn;
     std::vector<geom::Geometry*> polysOff;
+    geom::Envelope const* unionCommonEnv = unionCommon->getEnvelopeInternal(); // TODO: check for EMPTY ?
     extractByEnvelope(*unionCommonEnv, disjointPolys, polysOn, polysOff);
 #if GEOS_DEBUG_CASCADED_UNION
     std::cerr << "unionUsingEnvelopeIntersection: " << polysOn.size() << "/" << disjointPolys.size() << " polys intersect union of final thing" << std::endl;
 #endif
 
-    // If the union of the interacting geometries
-    // is contained in the envelope of the inputs
-    // (and this is highly likely unless overlay robustness failure occurs)
-    // it is safe to combine with the disjoint polygons
-    geom::Envelope beforeUnionEnv( *(g0Int->getEnvelopeInternal()) );
-    beforeUnionEnv.expandToInclude( g1Int->getEnvelopeInternal() );
-    bool isUnionSafe = beforeUnionEnv.contains(unionCommonEnv);
-    //if (! isUnionSafe) std::cerr << "Found unsafe union" << std::endl;
-
     std::unique_ptr<geom::Geometry> ret;
-    if(polysOn.empty() || isUnionSafe) {
+    if(polysOn.empty()) {
       disjointPolys.push_back(unionCommon.get());
-      ret.reset( geom::util::GeometryCombiner::combine(disjointPolys));
+      ret.reset(geom::util::GeometryCombiner::combine(disjointPolys));
     } else {
-      // The union envelope changed (e.g. due to snapping heuristics)
-      // so to be safe must union everything (which is slow, but infrequent)
       // TODO: could be further tweaked to only union with polysOn
       //       and combine with polysOff, but then it'll need again to
       //       recurse in the check for disjoint/intersecting
-      std::unique_ptr<geom::Geometry> disjointCombined( geom::util::GeometryCombiner::combine(disjointPolys) );
-      ret.reset( unionActual( disjointCombined.get(), unionCommon.get() ) );
+      ret.reset(geom::util::GeometryCombiner::combine(disjointPolys));
+      ret.reset(unionActual(ret.get(), unionCommon.get()));
     }
 
 #if GEOS_DEBUG_CASCADED_UNION

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

Summary of changes:
 src/operation/union/CascadedPolygonUnion.cpp | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list