[geos-commits] [SCM] GEOS branch 3.13 updated. ae29bb515788dbbb3a29e9cac5642fa9b856ad0a

git at osgeo.org git at osgeo.org
Fri May 30 15:25:19 PDT 2025


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, 3.13 has been updated
       via  ae29bb515788dbbb3a29e9cac5642fa9b856ad0a (commit)
       via  ccce918f888761a23901c7bccf5c59e8b04f59f5 (commit)
      from  a04be684e14de98896b8047d7076ab2ab7030785 (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 ae29bb515788dbbb3a29e9cac5642fa9b856ad0a
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Fri May 30 15:24:48 2025 -0700

    Update NEWS

diff --git a/NEWS.md b/NEWS.md
index b08d0494a..0a6228f90 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -6,6 +6,7 @@
   - Fix GeometryCollections in coverageSimplify cause segfault (GH-1250, Paul Ramsey)
   - Fix OverlayNG coordinate dimemsion handling for EMPTY geometries (GH-1258, Martin Davis)
   - Fix DepthSegment comparison logic (really this time) (GH-1266, Martin Davis)
+  - Change CoverageGapFinder to return polygons (Martin Davis)
 
 ## Changes in 3.13.1
 2025-03-03

commit ccce918f888761a23901c7bccf5c59e8b04f59f5
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Fri May 30 15:21:39 2025 -0700

    Change CoverageGapFinder to return polygons

diff --git a/src/coverage/CoverageGapFinder.cpp b/src/coverage/CoverageGapFinder.cpp
index b4de0fc50..3cd6b6583 100644
--- a/src/coverage/CoverageGapFinder.cpp
+++ b/src/coverage/CoverageGapFinder.cpp
@@ -47,7 +47,6 @@ CoverageGapFinder::findGaps(std::vector<const Geometry*>& coverage, double gapWi
     return finder.findGaps(gapWidth);
 }
 
-
 /* public */
 std::unique_ptr<Geometry>
 CoverageGapFinder::findGaps(double gapWidth)
@@ -56,21 +55,21 @@ CoverageGapFinder::findGaps(double gapWidth)
     std::vector<const Polygon*> polygons;
     PolygonExtracter::getPolygons(*geomUnion, polygons);
 
-    std::vector<std::unique_ptr<LineString>> gapLines;
+    std::vector<std::unique_ptr<Geometry>> gapLines;
     for (const Polygon* poly : polygons) {
         for (std::size_t i = 0; i < poly->getNumInteriorRing(); i++) {
             const LinearRing* hole = poly->getInteriorRingN(i);
             if (isGap(hole, gapWidth)) {
-                auto pts = hole->getCoordinatesRO()->clone();
-                auto ls = geomUnion->getFactory()->createLineString(std::move(pts));
-                gapLines.emplace_back(ls.release());
+                //auto pts = hole->getCoordinatesRO()->clone();
+                //auto ls = geomUnion->getFactory()->createLineString(std::move(pts));
+                auto polygon = geomUnion->getFactory()->createPolygon(hole->clone());
+                gapLines.emplace_back(polygon.release());
             }
         }
     }
     return geomUnion->getFactory()->buildGeometry(std::move(gapLines));
 }
 
-
 /* private */
 bool
 CoverageGapFinder::isGap(const LinearRing* hole, double gapWidth)
diff --git a/tests/unit/coverage/CoverageGapFinderTest.cpp b/tests/unit/coverage/CoverageGapFinderTest.cpp
index 5a345e18a..2c25c4c2c 100644
--- a/tests/unit/coverage/CoverageGapFinderTest.cpp
+++ b/tests/unit/coverage/CoverageGapFinderTest.cpp
@@ -69,7 +69,7 @@ void object::test<1> ()
     checkGaps(
         "MULTIPOLYGON (((1 5, 1 9, 5 9, 5 6, 3 5, 1 5)), ((5 9, 9 9, 9 5, 7 5, 5 6, 5 9)), ((1 1, 1 5, 3 5, 7 5, 9 5, 9 1, 1 1)))",
         1,
-        "LINESTRING (3 5, 7 5, 5 6, 3 5)"
+        "POLYGON ((3 5, 7 5, 5 6, 3 5))"
         );
 }
 

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

Summary of changes:
 NEWS.md                                       |  1 +
 src/coverage/CoverageGapFinder.cpp            | 11 +++++------
 tests/unit/coverage/CoverageGapFinderTest.cpp |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list