[geos-commits] [SCM] GEOS branch 3.13 updated. 071f7ee5c871167633a878e0ac072cbfe0509d34

git at osgeo.org git at osgeo.org
Fri Mar 14 14:34:23 PDT 2025


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.13 has been updated
       via  071f7ee5c871167633a878e0ac072cbfe0509d34 (commit)
       via  c5bc3d6df8c2b0c5817b574314a2bf0b25b53283 (commit)
      from  6660115369305a70c222ec2640b6d01e8d22e9db (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 071f7ee5c871167633a878e0ac072cbfe0509d34
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Mar 14 14:33:46 2025 -0700

    News entry for #1250

diff --git a/NEWS.md b/NEWS.md
index 315e69676..1ddc661ab 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,12 @@
+
+## Changes in 3.13.2
+2025-xx-xx
+
+- Fixes/Improvements:
+  - Fix GeometryCollections in coverageSimplify cause segfault (GH-1250, Paul Ramsey)
+
 ## Changes in 3.13.1
-2024-03-03
+2025-03-03
 
 - Fixes/Improvements:
   - Fix ConcaveHullOfPolygons nested shell handling (GH-1169, Martin Davis)

commit c5bc3d6df8c2b0c5817b574314a2bf0b25b53283
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Mar 14 14:04:20 2025 -0700

    Fix GeometryCollections in coverageSimplify result in segfaults, #1250

diff --git a/src/coverage/CoverageSimplifier.cpp b/src/coverage/CoverageSimplifier.cpp
index dbbd9022a..98ba1ad87 100644
--- a/src/coverage/CoverageSimplifier.cpp
+++ b/src/coverage/CoverageSimplifier.cpp
@@ -86,7 +86,8 @@ CoverageSimplifier::CoverageSimplifier(const std::vector<const Geometry*>& cover
     , m_geomFactory(coverage.empty() ? nullptr : coverage[0]->getFactory())
     {
         for (const Geometry* g: m_input) {
-            if (!g->isPolygonal())
+            auto typeId = g->getGeometryTypeId();
+            if (typeId != geom::GEOS_POLYGON && typeId != geom::GEOS_MULTIPOLYGON)
                 throw util::IllegalArgumentException("Argument is non-polygonal");
         }
     }
diff --git a/tests/unit/coverage/CoverageSimplifierTest.cpp b/tests/unit/coverage/CoverageSimplifierTest.cpp
index dfec0fa69..1973ae965 100644
--- a/tests/unit/coverage/CoverageSimplifierTest.cpp
+++ b/tests/unit/coverage/CoverageSimplifierTest.cpp
@@ -483,4 +483,24 @@ void object::test<30> ()
 }
 
 
+// Test non-polygon inputs (GH-1250)
+template<>
+template<>
+void object::test<31> ()
+{
+    auto input = readArray({
+        "GEOMETRYCOLLECTION (POLYGON ((0 10, 10 10, 10 7, 10 3, 10 0, 0 0, 0 10)), GEOMETRYCOLLECTION (POLYGON ((10 10, 20 10, 20 0, 10 0, 10 3, 10 7, 10 10))))"
+        });
+    try {
+        std::vector<std::unique_ptr<Geometry>> result =
+        CoverageSimplifier::simplify(input, 10);
+    }
+    catch (geos::util::IllegalArgumentException&) {
+        ensure("caught IllegalArgumentException", true);
+        return;
+    }
+    ensure("did not throw IllegalArgumentException", false);
+}
+
+
 } // namespace tut

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

Summary of changes:
 NEWS.md                                        |  9 ++++++++-
 src/coverage/CoverageSimplifier.cpp            |  3 ++-
 tests/unit/coverage/CoverageSimplifierTest.cpp | 20 ++++++++++++++++++++
 3 files changed, 30 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list