[geos-commits] [SCM] GEOS branch main updated. 6354193e908802263057d0ef8dcd3689f6c99a4a

git at osgeo.org git at osgeo.org
Thu Jul 9 15:52:24 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  6354193e908802263057d0ef8dcd3689f6c99a4a (commit)
      from  4fb859518f4642a0ac8b0f967d1dd54d2a2a7f02 (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 6354193e908802263057d0ef8dcd3689f6c99a4a
Author: Daniel Baston <dbaston at gmail.com>
Date:   Thu Jul 9 18:51:56 2026 -0400

    PointGeometryUnion: Avoid dropping M values (#1474)

diff --git a/src/operation/union/PointGeometryUnion.cpp b/src/operation/union/PointGeometryUnion.cpp
index 4ff569957..e997b9aab 100644
--- a/src/operation/union/PointGeometryUnion.cpp
+++ b/src/operation/union/PointGeometryUnion.cpp
@@ -43,7 +43,7 @@ PointGeometryUnion::Union() const
 
     PointLocator locater;
     // use a set to eliminate duplicates, as required for union
-    std::set<Coordinate> exteriorCoords;
+    std::set<CoordinateXYZM> exteriorCoords;
 
     for(std::size_t i = 0, n = pointGeom.getNumGeometries(); i < n; ++i) {
         const Point* point = dynamic_cast<const Point*>(pointGeom.getGeometryN(i));
@@ -53,10 +53,12 @@ PointGeometryUnion::Union() const
             continue;
         }
 
-        const Coordinate* coord = static_cast<const Coordinate*>(point->getCoordinate());
+        const CoordinateXY* coord = point->getCoordinate();
         Location loc = locater.locate(*coord, &otherGeom);
         if(loc == Location::EXTERIOR) {
-            exteriorCoords.insert(*coord);
+            CoordinateXYZM ptZM;
+            point->getCoordinatesRO()->getAt(0, ptZM);
+            exteriorCoords.insert(ptZM);
         }
     }
 
diff --git a/tests/unit/operation/geounion/UnaryUnionOpTest.cpp b/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
index 9f2023e39..e849daa93 100644
--- a/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
+++ b/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
@@ -76,7 +76,7 @@ struct test_unaryuniontest_data {
         using std::endl;
         GeomPtr a2 = normalize(a);
         GeomPtr b2 = normalize(b);
-        bool eq = a2->equalsExact(b2.get());
+        bool eq = a2->equalsIdentical(b2.get());
         if(! eq) {
             cout << "EXPECTED: " << wktwriter.write(a2.get()) << endl;
             cout << "OBTAINED: " << wktwriter.write(b2.get()) << endl;
@@ -206,5 +206,19 @@ void object::test<7>
     doTest(geoms, "LINESTRING EMPTY");
 }
 
+template<>
+template<>
+void object::test<8>() {
+    static char const* const geoms[] = {
+        "POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))",
+        "POINT M (12 13 14)",
+        "POINT Z (12 13 8)",
+        "POINT M (12 13 16)",
+        nullptr
+    };
+
+    doTest(geoms, "GEOMETRYCOLLECTION (POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0)), POINT M (12 13 14))");
+}
+
 } // namespace tut
 

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

Summary of changes:
 src/operation/union/PointGeometryUnion.cpp         |  8 +++++---
 tests/unit/operation/geounion/UnaryUnionOpTest.cpp | 16 +++++++++++++++-
 2 files changed, 20 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list