[geos-commits] [SCM] GEOS branch main updated. 09463aeb954524fb11318e1d9934e37b563ddf4b

git at osgeo.org git at osgeo.org
Fri Mar 20 12:41:15 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  09463aeb954524fb11318e1d9934e37b563ddf4b (commit)
       via  a4fd2b4bd05a868fb19791cb9dcb0135857a5797 (commit)
      from  f1c154d67d6f0a71e76b7ced2f014d74b4f64b19 (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 09463aeb954524fb11318e1d9934e37b563ddf4b
Author: Daniel Baston <dbaston at gmail.com>
Date:   Mon Mar 9 18:16:58 2026 -0400

    geos_unit: handle (Curve)Polygons in ensure_equals_exact_geometry

diff --git a/tests/unit/utility.h b/tests/unit/utility.h
index bdd50cfcc..21825988b 100644
--- a/tests/unit/utility.h
+++ b/tests/unit/utility.h
@@ -540,17 +540,19 @@ template <typename T> inline void ensure_equals_exact_geometry(const T *lhs_in,
 template <>
 inline void
 ensure_equals_exact_geometry(const geos::geom::Geometry *lhs_in,
-                                 const geos::geom::Geometry *rhs_in,
-                                 double tolerance)
+                             const geos::geom::Geometry *rhs_in,
+                             double tolerance)
 {
     assert(nullptr != lhs_in);
     assert(nullptr != rhs_in);
 
     using geos::geom::CoordinateSequence;
+    using geos::geom::Curve;
     using geos::geom::GeometryCollection;
     using geos::geom::Point;
     using geos::geom::Polygon;
     using geos::geom::SimpleCurve;
+    using geos::geom::Surface;
 
     ensure_equals("type id do not match",
                   lhs_in->getGeometryTypeId(), rhs_in->getGeometryTypeId());
@@ -563,6 +565,23 @@ ensure_equals_exact_geometry(const geos::geom::Geometry *lhs_in,
       const SimpleCurve *gln2 = static_cast<const SimpleCurve *>(rhs_in);
       return ensure_equals_dims( gln1->getCoordinatesRO(), gln2->getCoordinatesRO(), 2, tolerance);
     }
+    else if (const Surface* gply1 = dynamic_cast<const Surface*>(lhs_in)) {
+        const Surface* gply2 = static_cast<const Surface*>(rhs_in);
+        const Geometry* extRing1 = gply1->getExteriorRing();
+        const Geometry* extRing2 = gply2->getExteriorRing();
+
+        ensure_equals_exact_geometry(extRing1, extRing2, tolerance);
+
+        ensure_equals("number of holes does not match",
+                      gply1->getNumInteriorRing(),
+                      gply2->getNumInteriorRing());
+
+        for (std::size_t i = 0; i < gply1->getNumInteriorRing(); i++) {
+            ensure_equals_exact_geometry(static_cast<const Geometry*>(gply1->getInteriorRingN(i)),
+                                         static_cast<const Geometry*>(gply2->getInteriorRingN(i)),
+                                         tolerance);
+        }
+    }
     else if (const GeometryCollection* gc1 = dynamic_cast<const GeometryCollection *>(lhs_in)) {
         const GeometryCollection *gc2 = static_cast<const GeometryCollection *>(rhs_in);
         for (unsigned int i = 0; i < gc1->getNumGeometries(); i++) {

commit a4fd2b4bd05a868fb19791cb9dcb0135857a5797
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Jan 30 13:30:14 2026 -0500

    geos_unit: use specified tolerance for Z/M in ensure_equals_exact_geometry_xyzm

diff --git a/tests/unit/utility.h b/tests/unit/utility.h
index 7736d6de6..bdd50cfcc 100644
--- a/tests/unit/utility.h
+++ b/tests/unit/utility.h
@@ -177,13 +177,13 @@ ensure_equals_xyzm(geos::geom::CoordinateXYZM const& actual,
     }
 }
 
-inline void ensure_same(const char* msg, double a, double b)
+inline void ensure_same(const char* msg, double a, double b, double tol = std::numeric_limits<double>::epsilon())
 {
     if (std::isnan(a) && std::isnan(b)) {
         return;
     }
 
-    ensure_equals(msg, a, b);
+    ensure_equals(msg, a, b, tol);
 }
 
 inline void ensure_same(double a, double b)
@@ -431,8 +431,8 @@ ensure_equals_exact_xyzm(const geos::geom::CoordinateSequence* seq1,
         seq2->getAt(i, c2);
 
         ensure("xy not in tolerance", c1.distance(c2) <= tol);
-        ensure_same(("index " + std::to_string(i) + "/" + std::to_string(seq1->getSize() - 1) + " z not same").c_str(), c1.z, c2.z);
-        ensure_same(("index " + std::to_string(i) + "/" + std::to_string(seq1->getSize() - 1) + " m not same").c_str(), c1.m, c2.m);
+        ensure_same(("index " + std::to_string(i) + "/" + std::to_string(seq1->getSize() - 1) + " z not same").c_str(), c1.z, c2.z, tol);
+        ensure_same(("index " + std::to_string(i) + "/" + std::to_string(seq1->getSize() - 1) + " m not same").c_str(), c1.m, c2.m, tol);
     }
 }
 

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

Summary of changes:
 tests/unit/utility.h | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list