[geos-commits] [SCM] GEOS branch main updated. 96292c0df9587f6a6cb9d0b00e52772db2672348

git at osgeo.org git at osgeo.org
Wed Jul 8 17:05:59 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  96292c0df9587f6a6cb9d0b00e52772db2672348 (commit)
      from  b4a4ace48b2c3fe6ac4d9a0219d6b232158ca931 (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 96292c0df9587f6a6cb9d0b00e52772db2672348
Author: Daniel Baston <dbaston at gmail.com>
Date:   Wed Jul 8 20:05:36 2026 -0400

    C API: Do not linearize inputs to overlay functions (#1471)

diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index 91ac5898e..f95c294df 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -1636,8 +1636,10 @@ extern "C" {
     Geometry*
     GEOSIntersection_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
     {
-        return convertCurvesAndExecute(extHandle, g1, g2, [](const Geometry* geom1, const Geometry* geom2) {
-            return geom1->intersection(geom2);
+        return execute(extHandle, [&]() {
+            auto g3 = g1->intersection(g2);
+            g3->setSRID(g1->getSRID());
+            return g3.release();
         });
     }
 
@@ -2028,8 +2030,10 @@ extern "C" {
     Geometry*
     GEOSUnion_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
     {
-        return convertCurvesAndExecute(extHandle, g1, g2, [&](const Geometry* input1, const Geometry* input2) {
-            return input1->Union(input2);
+        return execute(extHandle, [&]() {
+            auto g3 = g1->Union(g2);
+            g3->setSRID(g1->getSRID());
+            return g3.release();
         });
     }
 
diff --git a/tests/unit/capi/GEOSDifferenceTest.cpp b/tests/unit/capi/GEOSDifferenceTest.cpp
index c5f70196b..259376fc0 100644
--- a/tests/unit/capi/GEOSDifferenceTest.cpp
+++ b/tests/unit/capi/GEOSDifferenceTest.cpp
@@ -104,5 +104,23 @@ void object::test<4>()
     ensure_equals(fracs[0], 1.0);
 }
 
+template<>
+template<>
+void object::test<5>()
+{
+    set_test_name("curved input is not linearized when CurveToLineParams registered with a context");
+    useContext();
+
+    geom1_ = fromWKT("CIRCULARSTRING (0 0, 1 1, 2 0)");
+    geom2_ = fromWKT("POINT (2 0)");
+
+    GEOSCurveToLineParams_setMaxStepDegrees_r(ctxt_, curveToLineParams_, 45);
+    GEOSContext_setCurveToLineParams_r(ctxt_, curveToLineParams_);
+
+    result_ = GEOSDifference_r(ctxt_, geom1_, geom2_);
+
+    ensure_geometry_equals(result_, geom1_, 1e-8);
+}
+
 } // namespace tut
 
diff --git a/tests/unit/capi/GEOSIntersectionTest.cpp b/tests/unit/capi/GEOSIntersectionTest.cpp
index a4aabb439..8f4d67467 100644
--- a/tests/unit/capi/GEOSIntersectionTest.cpp
+++ b/tests/unit/capi/GEOSIntersectionTest.cpp
@@ -177,5 +177,23 @@ void object::test<9>()
     ensure("HasM", GEOSHasM(result_));
 }
 
+template<>
+template<>
+void object::test<10>()
+{
+    set_test_name("curved input is not linearized when CurveToLineParams registered with a context");
+    useContext();
+
+    geom1_ = fromWKT("CIRCULARSTRING (0 0, 1 1, 2 0)");
+    geom2_ = fromWKT("POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0))");
+
+    GEOSCurveToLineParams_setMaxStepDegrees_r(ctxt_, curveToLineParams_, 45);
+    GEOSContext_setCurveToLineParams_r(ctxt_, curveToLineParams_);
+
+    result_ = GEOSIntersection_r(ctxt_, geom1_, geom2_);
+
+    ensure_geometry_equals(result_, geom1_, 1e-8);
+}
+
 } // namespace tut
 
diff --git a/tests/unit/capi/GEOSSymDifferenceTest.cpp b/tests/unit/capi/GEOSSymDifferenceTest.cpp
index 63436e135..61d27eb9b 100644
--- a/tests/unit/capi/GEOSSymDifferenceTest.cpp
+++ b/tests/unit/capi/GEOSSymDifferenceTest.cpp
@@ -45,5 +45,23 @@ void object::test<2>()
     ensure_geometry_equals(result_, expected_, 1e-8);
 }
 
+template<>
+template<>
+void object::test<3>()
+{
+    set_test_name("curved input is not linearized when CurveToLineParams registered with a context");
+    useContext();
+
+    geom1_ = fromWKT("CIRCULARSTRING (0 0, 1 1, 2 0)");
+    geom2_ = fromWKT("POINT (2 0)");
+
+    GEOSCurveToLineParams_setMaxStepDegrees_r(ctxt_, curveToLineParams_, 45);
+    GEOSContext_setCurveToLineParams_r(ctxt_, curveToLineParams_);
+
+    result_ = GEOSSymDifference_r(ctxt_, geom1_, geom2_);
+
+    ensure_geometry_equals(result_, geom1_, 1e-8);
+}
+
 } // namespace tut
 
diff --git a/tests/unit/capi/GEOSUnionTest.cpp b/tests/unit/capi/GEOSUnionTest.cpp
index 835aaaf0f..2c0567dab 100644
--- a/tests/unit/capi/GEOSUnionTest.cpp
+++ b/tests/unit/capi/GEOSUnionTest.cpp
@@ -79,5 +79,24 @@ void object::test<3>()
     ensure_geometry_equals(result_, expected_, 1e-8);
 }
 
+template<>
+template<>
+void object::test<10>()
+{
+    set_test_name("curved input is not linearized when CurveToLineParams registered with a context");
+    useContext();
+
+    geom1_ = fromWKT("CIRCULARSTRING (0 0, 1 1, 2 0)");
+    geom2_ = fromWKT("POINT (2 0)");
+
+    GEOSCurveToLineParams_setMaxStepDegrees_r(ctxt_, curveToLineParams_, 45);
+    GEOSContext_setCurveToLineParams_r(ctxt_, curveToLineParams_);
+
+    result_ = GEOSUnion_r(ctxt_, geom1_, geom2_);
+
+    ensure_geometry_equals(result_, geom1_, 1e-8);
+}
+
+
 } // namespace tut
 

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

Summary of changes:
 capi/geos_ts_c.cpp                        | 12 ++++++++----
 tests/unit/capi/GEOSDifferenceTest.cpp    | 18 ++++++++++++++++++
 tests/unit/capi/GEOSIntersectionTest.cpp  | 18 ++++++++++++++++++
 tests/unit/capi/GEOSSymDifferenceTest.cpp | 18 ++++++++++++++++++
 tests/unit/capi/GEOSUnionTest.cpp         | 19 +++++++++++++++++++
 5 files changed, 81 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list