[geos-commits] [SCM] GEOS branch main updated. 36d2dcfdea9cf2738dc5a233ee917417511e7945

git at osgeo.org git at osgeo.org
Tue Jan 13 13:56:47 PST 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  36d2dcfdea9cf2738dc5a233ee917417511e7945 (commit)
      from  2ad56c719b0155256712357aa4f8e8a6e05ce8b7 (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 36d2dcfdea9cf2738dc5a233ee917417511e7945
Author: Daniel Baston <dbaston at gmail.com>
Date:   Tue Jan 13 16:56:28 2026 -0500

    OverlayEdgeRing: Preserve M values when closing ring (#1372)
    
    Resolves https://github.com/libgeos/geos/issues/1365

diff --git a/src/operation/overlayng/OverlayEdgeRing.cpp b/src/operation/overlayng/OverlayEdgeRing.cpp
index b9ac01518..1587f9e0c 100644
--- a/src/operation/overlayng/OverlayEdgeRing.cpp
+++ b/src/operation/overlayng/OverlayEdgeRing.cpp
@@ -128,7 +128,7 @@ void
 OverlayEdgeRing::closeRing(CoordinateSequence& pts)
 {
     if(pts.size() > 0) {
-        pts.add(pts.getAt(0), false);
+        pts.closeRing(false);
     }
 }
 
diff --git a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
index 4640b19e7..4c604a183 100644
--- a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
+++ b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
@@ -326,5 +326,20 @@ void object::test<23>()
     checkPrecision(wkt,  100000, "LINESTRING ( 700000 200000,  700000 1400000)");
 }
 
+template<>
+template<>
+void object::test<24>()
+{
+    // https://github.com/libgeos/geos/issues/1365{
+    set_test_name("M value retained on last point");
+
+    input_ = fromWKT("POLYGON ZM ((0 0 0 0, 0 1 1 1, 1 1 2 3, 1 0 4 5, 0 0 6 7))");
+    expected_ = fromWKT("POLYGON ZM ((0 1 1 1, 1 1 2 3, 1 0 4 5, 0 0 6 7, 0 1 1 1))");
+
+    result_ = GEOSGeom_setPrecision(input_, 0.1, 0);
+
+    ensure(GEOSEqualsIdentical(result_, expected_));
+}
+
 } // namespace tut
 

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

Summary of changes:
 src/operation/overlayng/OverlayEdgeRing.cpp   |  2 +-
 tests/unit/capi/GEOSGeom_setPrecisionTest.cpp | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list