[geos-commits] [SCM] GEOS branch main updated. 8d904e8a1d4fb5e79deb2808987363df2dc71c12
git at osgeo.org
git at osgeo.org
Wed Mar 25 05:55:53 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, main has been updated
via 8d904e8a1d4fb5e79deb2808987363df2dc71c12 (commit)
from 4efe878b1291ccc7bb80ab976c35559a8883589d (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 8d904e8a1d4fb5e79deb2808987363df2dc71c12
Author: Daniel Baston <dbaston at gmail.com>
Date: Wed Mar 25 08:55:29 2026 -0400
GEOSNode: Avoid crash on collection with empty components (#1410)
Resolves https://github.com/libgeos/geos/issues/1406
diff --git a/src/noding/GeometryNoder.cpp b/src/noding/GeometryNoder.cpp
index cab42cb03..7580b6e07 100644
--- a/src/noding/GeometryNoder.cpp
+++ b/src/noding/GeometryNoder.cpp
@@ -66,6 +66,10 @@ public:
void
filter_ro(const geom::Geometry* g) override
{
+ if (g->isEmpty()) {
+ return;
+ }
+
if(const auto* ls = dynamic_cast<const geom::LineString*>(g)) {
auto coord = ls->getSharedCoordinates();
auto ss = std::make_unique<NodedSegmentString>(coord, _constructZ, _constructM, nullptr);
diff --git a/tests/unit/capi/GEOSNodeTest.cpp b/tests/unit/capi/GEOSNodeTest.cpp
index c5be746b5..e1356e44e 100644
--- a/tests/unit/capi/GEOSNodeTest.cpp
+++ b/tests/unit/capi/GEOSNodeTest.cpp
@@ -355,5 +355,17 @@ void object::test<16>()
reinterpret_cast<Geometry*>(expected_), 1e-4);
}
+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