[geos-commits] [SCM] GEOS branch master updated. 859dc941be742e2b0c58dcf2395285dfc5e2e71f

git at osgeo.org git at osgeo.org
Fri Apr 12 15:36:04 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  859dc941be742e2b0c58dcf2395285dfc5e2e71f (commit)
      from  1b24aed3c5ef4f972dd46ca46b6b389d02f38136 (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 859dc941be742e2b0c58dcf2395285dfc5e2e71f
Author: Martin Davis <mtnclimb at gmail.co>
Date:   Fri Apr 12 15:36:00 2019 -0700

    Reverting problematic fix for CascadedPolygonUnion

diff --git a/src/operation/union/CascadedPolygonUnion.cpp b/src/operation/union/CascadedPolygonUnion.cpp
index 70572d6..a456095 100644
--- a/src/operation/union/CascadedPolygonUnion.cpp
+++ b/src/operation/union/CascadedPolygonUnion.cpp
@@ -273,7 +273,7 @@ CascadedPolygonUnion::unionUsingEnvelopeIntersection(geom::Geometry* g0,
     check_valid(*g1Int, "unionUsingEnvelopeIntersection g1Int");
 #endif
 
-    std::unique_ptr<geom::Geometry> unionCommon(unionActual(g0Int.get(), g1Int.get()));
+    std::unique_ptr<geom::Geometry> u(unionActual(g0Int.get(), g1Int.get()));
 
 #if GEOS_DEBUG_CASCADED_UNION
     if(! check_valid(*u, "unionUsingEnvelopeIntersection unionActual return")) {
@@ -291,7 +291,7 @@ CascadedPolygonUnion::unionUsingEnvelopeIntersection(geom::Geometry* g0,
 #endif
 
     if(disjointPolys.empty()) {
-        return unionCommon.release();
+        return u.release();
     }
 
 #if GEOS_DEBUG_CASCADED_UNION
@@ -302,39 +302,30 @@ CascadedPolygonUnion::unionUsingEnvelopeIntersection(geom::Geometry* g0,
     }
 #endif
 
-    geom::Envelope const* unionCommonEnv = unionCommon->getEnvelopeInternal(); // TODO: check for EMPTY ?
+    // TODO: find, in disjointPolys, those which now have their
+    // environment intersect the environment of the union "u"
+    // and collect them in another vector to be unioned
 
     std::vector<geom::Geometry*> polysOn;
     std::vector<geom::Geometry*> polysOff;
-    extractByEnvelope(*unionCommonEnv, disjointPolys, polysOn, polysOff);
+    geom::Envelope const* uEnv = u->getEnvelopeInternal(); // TODO: check for EMPTY ?
+    extractByEnvelope(*uEnv, 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) {
-        disjointPolys.push_back(unionCommon.get());
+    if(polysOn.empty()) {
+        disjointPolys.push_back(u.get());
         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(), u.get()));
     }
 
 #if GEOS_DEBUG_CASCADED_UNION

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

Summary of changes:
 src/operation/union/CascadedPolygonUnion.cpp | 31 ++++++++++------------------
 1 file changed, 11 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list