[geos-commits] [SCM] GEOS branch main updated. 5936422beec01ab882b7009a142ce3b43cefc272

git at osgeo.org git at osgeo.org
Tue Jul 28 07:56:57 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  5936422beec01ab882b7009a142ce3b43cefc272 (commit)
      from  d739e315295a113c8705c8e702155d004ac5bc1e (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 5936422beec01ab882b7009a142ce3b43cefc272
Author: Joris Van den Bossche <jorisvandenbossche at gmail.com>
Date:   Tue Jul 28 16:56:30 2026 +0200

    GeometrySplitter: always raise error for point input geometry (#1491)

diff --git a/src/operation/split/GeometrySplitter.cpp b/src/operation/split/GeometrySplitter.cpp
index 0331cd033..ee0cef7e8 100644
--- a/src/operation/split/GeometrySplitter.cpp
+++ b/src/operation/split/GeometrySplitter.cpp
@@ -173,6 +173,10 @@ GeometrySplitter::splitAtPoints(const Geometry& geom, const Geometry& splitPoint
 std::unique_ptr<Geometry>
 GeometrySplitter::split(const Geometry &geom, const Geometry &splitGeom)
 {
+    if (geom.hasDimension(geom::Dimension::P)) {
+        throw util::IllegalArgumentException("Input geometry must be linear or polygonal.");
+    }
+
     if (geom.isEmpty() || splitGeom.isEmpty()) {
         std::vector<std::unique_ptr<Geometry>> geoms;
         geoms.push_back(geom.clone());
diff --git a/tests/unit/capi/GEOSSplitTest.cpp b/tests/unit/capi/GEOSSplitTest.cpp
index c6c795088..2c9387bbf 100644
--- a/tests/unit/capi/GEOSSplitTest.cpp
+++ b/tests/unit/capi/GEOSSplitTest.cpp
@@ -44,9 +44,28 @@ void object::test<2>()
 {
     geom1_ = fromWKT("POINT (3 7)");
     geom2_ = fromWKT("LINESTRING (3 7, 3 8)");
+    geom3_ = fromWKT("POINT (3 7)");
 
     result_ = GEOSSplit(geom1_, geom2_); // cannot split a point geometry
     ensure(!result_);
+
+    result_ = GEOSSplit(geom1_, geom3_); // cannot split a point geometry
+    ensure(!result_);
+}
+
+template<>
+template<>
+void object::test<3>()
+{
+    geom1_ = fromWKT("GEOMETRYCOLLECTION (POINT (3 7), LINESTRING (3 7, 3 8))");
+    geom2_ = fromWKT("LINESTRING (3 7, 3 8)");
+    geom3_ = fromWKT("POINT (3 7)");
+
+    result_ = GEOSSplit(geom1_, geom2_); // cannot split collection with a point geometry
+    ensure(!result_);
+
+    result_ = GEOSSplit(geom1_, geom3_); // cannot split collection with a point geometry
+    ensure(!result_);
 }
 
 } // namespace tut

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

Summary of changes:
 src/operation/split/GeometrySplitter.cpp |  4 ++++
 tests/unit/capi/GEOSSplitTest.cpp        | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list