[geos-commits] [SCM] GEOS branch main updated. d635a3fecf586da19889b37ec4aa21b7cda38733

git at osgeo.org git at osgeo.org
Fri Jul 16 14:03:52 PDT 2021


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, main has been updated
       via  d635a3fecf586da19889b37ec4aa21b7cda38733 (commit)
      from  af5b9988025db9c0e778e0e50da62156b871b4dd (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 d635a3fecf586da19889b37ec4aa21b7cda38733
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Jul 16 14:03:49 2021 -0700

    Flip GEOSUnionCascaded_r over to use GEOSUnaryUnion_r

diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index cd362e1..4416ae7 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -1424,19 +1424,14 @@ extern "C" {
     Geometry*
     GEOSUnionCascaded_r(GEOSContextHandle_t extHandle, const Geometry* g1)
     {
-        using geos::operation::geounion::CascadedPolygonUnion;
-
-        return execute(extHandle, [&]() {
-            const geos::geom::MultiPolygon *p = dynamic_cast<const geos::geom::MultiPolygon *>(g1);
-
-            if (!p) {
-                throw IllegalArgumentException("Invalid argument (must be a MultiPolygon)");
-            }
-
-            auto g3 = CascadedPolygonUnion::Union(p);
-            g3->setSRID(g1->getSRID());
-            return g3.release();
-        });
+        // CascadedUnion is the same as UnaryUnion, except that
+        // CascadedUnion only works on MultiPolygon, so we just delegate
+        // now and retain a check on MultiPolygon type.
+        const geos::geom::MultiPolygon *p = dynamic_cast<const geos::geom::MultiPolygon *>(g1);
+        if (!p) {
+            throw IllegalArgumentException("Invalid argument (must be a MultiPolygon)");
+        }
+        return GEOSUnaryUnion_r(extHandle, g1);
     }
 
     Geometry*

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

Summary of changes:
 capi/geos_ts_c.cpp | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list