[geos-commits] [SCM] GEOS branch 3.11 updated. 0576a1fd2a49ef2c7b1abc7245e769565b169b02

git at osgeo.org git at osgeo.org
Wed Mar 25 06:11:27 PDT 2026


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.11 has been updated
       via  0576a1fd2a49ef2c7b1abc7245e769565b169b02 (commit)
      from  b3e1169efeb6eb02f9f442bb66226f24d346b83a (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 0576a1fd2a49ef2c7b1abc7245e769565b169b02
Author: Daniel Baston <dbaston at gmail.com>
Date:   Wed Mar 25 08:51:17 2026 -0400

    GEOSNode: Avoid crash on collection with empty components

diff --git a/src/noding/GeometryNoder.cpp b/src/noding/GeometryNoder.cpp
index 5d98cdb19..8e51a2857 100644
--- a/src/noding/GeometryNoder.cpp
+++ b/src/noding/GeometryNoder.cpp
@@ -55,6 +55,10 @@ public:
     void
     filter_ro(const geom::Geometry* g) override
     {
+        if (g->isEmpty()) {
+            return;
+        }
+
         const geom::LineString* ls = dynamic_cast<const geom::LineString*>(g);
         if(ls) {
             auto coord = ls->getCoordinates();
diff --git a/tests/unit/capi/GEOSNodeTest.cpp b/tests/unit/capi/GEOSNodeTest.cpp
index 0c280450d..0c8258989 100644
--- a/tests/unit/capi/GEOSNodeTest.cpp
+++ b/tests/unit/capi/GEOSNodeTest.cpp
@@ -124,5 +124,17 @@ void object::test<5>
     ensure_equals(out, "LINESTRING EMPTY");
 }
 
+template<>
+template<>
+void object::test<17>()
+{
+    set_test_name("GeometryCollection with empty element");
+
+    input_ = fromWKT("GEOMETRYCOLLECTION (POLYGON EMPTY, POLYGON ((0 0, 1 1, 0 1, 0 0)))");
+
+    result_ = GEOSNode(input_);
+    ensure(result_);
+}
+
 } // namespace tut
 

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

Summary of changes:
 src/noding/GeometryNoder.cpp     |  4 ++++
 tests/unit/capi/GEOSNodeTest.cpp | 12 ++++++++++++
 2 files changed, 16 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list