[geos-commits] [SCM] GEOS branch main updated. 8b2ee5e04ea2f3d9b088505cb12d270fa805c51f

git at osgeo.org git at osgeo.org
Tue Mar 31 12:20:21 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  8b2ee5e04ea2f3d9b088505cb12d270fa805c51f (commit)
      from  2841a0dc9c1931f4ca78701476c87b8cd3f41b58 (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 8b2ee5e04ea2f3d9b088505cb12d270fa805c51f
Author: Daniel Baston <dbaston at gmail.com>
Date:   Tue Mar 31 15:20:01 2026 -0400

    PlanarGraph: Avoid unnecessary use of 3D coordinates (#1417)

diff --git a/include/geos/operation/polygonize/EdgeRing.h b/include/geos/operation/polygonize/EdgeRing.h
index 18646ee5d..cbfb6fdc7 100644
--- a/include/geos/operation/polygonize/EdgeRing.h
+++ b/include/geos/operation/polygonize/EdgeRing.h
@@ -154,7 +154,7 @@ public:
      * @return a Coordinate reference from <code>testPts</code> which is
      * not in <code>pts</code>, or <code>Coordinate::nullCoord</code>
      */
-    static const geom::Coordinate& ptNotInList(
+    static const geom::CoordinateXY& ptNotInList(
         const geom::CoordinateSequence* testPts,
         const geom::CoordinateSequence* pts);
 
@@ -166,7 +166,7 @@ public:
      * @param pts an array of Coordinate to test
      * @return <code>true</code> if the point is in the array
      */
-    static bool isInList(const geom::Coordinate& pt,
+    static bool isInList(const geom::CoordinateXY& pt,
                          const geom::CoordinateSequence* pts);
 
     explicit EdgeRing(const geom::GeometryFactory* newFactory);
diff --git a/include/geos/operation/polygonize/PolygonizeDirectedEdge.h b/include/geos/operation/polygonize/PolygonizeDirectedEdge.h
index 61b9bff0c..21c61e566 100644
--- a/include/geos/operation/polygonize/PolygonizeDirectedEdge.h
+++ b/include/geos/operation/polygonize/PolygonizeDirectedEdge.h
@@ -76,7 +76,7 @@ public:
      */
     PolygonizeDirectedEdge(planargraph::Node* newFrom,
                            planargraph::Node* newTo,
-                           const geom::Coordinate& newDirectionPt,
+                           const geom::CoordinateXY& newDirectionPt,
                            bool nEdgeDirection);
 
     /*
diff --git a/include/geos/operation/polygonize/PolygonizeGraph.h b/include/geos/operation/polygonize/PolygonizeGraph.h
index 694f8fe02..e85dbba1b 100644
--- a/include/geos/operation/polygonize/PolygonizeGraph.h
+++ b/include/geos/operation/polygonize/PolygonizeGraph.h
@@ -137,7 +137,7 @@ private:
 
     const geom::GeometryFactory* factory;
 
-    planargraph::Node* getNode(const geom::Coordinate& pt);
+    planargraph::Node* getNode(const geom::CoordinateXY& pt);
 
     void computeNextCWEdges();
 
diff --git a/include/geos/planargraph/DirectedEdge.h b/include/geos/planargraph/DirectedEdge.h
index 5d1d44358..e80f9c187 100644
--- a/include/geos/planargraph/DirectedEdge.h
+++ b/include/geos/planargraph/DirectedEdge.h
@@ -104,7 +104,7 @@ public:
      *                         parent Edge (if any)
      */
     DirectedEdge(Node* newFrom, Node* newTo,
-                 const geom::Coordinate& directionPt,
+                 const geom::CoordinateXY& directionPt,
                  bool newEdgeDirection);
 
     /**
@@ -151,7 +151,7 @@ public:
      * \brief
      * Returns the coordinate of the from-node.
      */
-    geom::Coordinate& getCoordinate() const;
+    geom::CoordinateXY& getCoordinate() const;
 
     /**
      * \brief
diff --git a/include/geos/planargraph/DirectedEdgeStar.h b/include/geos/planargraph/DirectedEdgeStar.h
index 4ad9e9c3b..e58daa810 100644
--- a/include/geos/planargraph/DirectedEdgeStar.h
+++ b/include/geos/planargraph/DirectedEdgeStar.h
@@ -27,7 +27,7 @@
 // Forward declarations
 namespace geos {
 namespace geom {
-class Coordinate;
+class CoordinateXY;
 }
 namespace planargraph {
 class DirectedEdge;
@@ -104,7 +104,7 @@ public:
      * \brief Returns the coordinate for the node at which this
      * star is based
      */
-    geom::Coordinate& getCoordinate() const;
+    geom::CoordinateXY& getCoordinate() const;
 
     /**
      * \brief Returns the DirectedEdges, in ascending order
diff --git a/include/geos/planargraph/Node.h b/include/geos/planargraph/Node.h
index dccf9781d..48f3751ba 100644
--- a/include/geos/planargraph/Node.h
+++ b/include/geos/planargraph/Node.h
@@ -45,7 +45,7 @@ class GEOS_DLL Node: public GraphComponent {
 protected:
 
     /// The location of this Node
-    geom::Coordinate pt;
+    geom::CoordinateXY pt;
 
     /// The collection of DirectedEdges that leave this Node
     DirectedEdgeStar* deStar;
@@ -65,7 +65,7 @@ public:
             Node* node1);
 
     /// Constructs a Node with the given location.
-    Node(const geom::Coordinate& newPt)
+    Node(const geom::CoordinateXY& newPt)
         :
         pt(newPt)
     {
@@ -92,7 +92,7 @@ public:
     /**
      * \brief Returns the location of this Node.
      */
-    geom::Coordinate&
+    geom::CoordinateXY&
     getCoordinate()
     {
         return pt;
diff --git a/include/geos/planargraph/NodeMap.h b/include/geos/planargraph/NodeMap.h
index aa39db07b..3e4cc1ea8 100644
--- a/include/geos/planargraph/NodeMap.h
+++ b/include/geos/planargraph/NodeMap.h
@@ -46,7 +46,7 @@ namespace planargraph { // geos.planargraph
  */
 class GEOS_DLL NodeMap {
 public:
-    typedef std::map<geom::Coordinate, Node*, geom::CoordinateLessThan> container;
+    typedef std::map<geom::CoordinateXY, Node*, geom::CoordinateLessThan> container;
 private:
     container nodeMap;
 public:
@@ -72,14 +72,14 @@ public:
      * Removes the Node at the given location, and returns it
      * (or null if no Node was there).
      */
-    Node* remove(geom::Coordinate& pt);
+    Node* remove(geom::CoordinateXY& pt);
 
     /**
      * \brief
      * Returns the Node at the given location,
      * or null if no Node was there.
      */
-    Node* find(const geom::Coordinate& coord);
+    Node* find(const geom::CoordinateXY& coord);
 
     /**
      * \brief
diff --git a/include/geos/planargraph/PlanarGraph.h b/include/geos/planargraph/PlanarGraph.h
index fd3037f9e..b047e6d2c 100644
--- a/include/geos/planargraph/PlanarGraph.h
+++ b/include/geos/planargraph/PlanarGraph.h
@@ -123,7 +123,7 @@ public:
      * or null if no Node was there.
      */
     Node*
-    findNode(const geom::Coordinate& pt)
+    findNode(const geom::CoordinateXY& pt)
     {
         return nodeMap.find(pt);
     }
diff --git a/src/operation/buffer/PolygonBuilder.cpp b/src/operation/buffer/PolygonBuilder.cpp
index 893847f91..fa0dd46fd 100644
--- a/src/operation/buffer/PolygonBuilder.cpp
+++ b/src/operation/buffer/PolygonBuilder.cpp
@@ -327,7 +327,7 @@ PolygonBuilder::findEdgeRingContaining(EdgeRing* testEr,
         }
 
         const CoordinateSequence* tsrcs = tryShellRing->getCoordinatesRO();
-        const Coordinate& testPt = operation::polygonize::EdgeRing::ptNotInList(testRing->getCoordinatesRO(), tsrcs);
+        const CoordinateXY& testPt = operation::polygonize::EdgeRing::ptNotInList(testRing->getCoordinatesRO(), tsrcs);
 
         bool isContained = false;
         if(tryShell.pipLocator->locate(&testPt) != Location::EXTERIOR) {
diff --git a/src/operation/polygonize/EdgeRing.cpp b/src/operation/polygonize/EdgeRing.cpp
index 937b92497..74457d3e9 100644
--- a/src/operation/polygonize/EdgeRing.cpp
+++ b/src/operation/polygonize/EdgeRing.cpp
@@ -77,13 +77,13 @@ EdgeRing::findDirEdgesInRing(PolygonizeDirectedEdge* startDE) {
 }
 
 /*public static*/
-const Coordinate&
+const CoordinateXY&
 EdgeRing::ptNotInList(const CoordinateSequence* testPts,
                       const CoordinateSequence* pts)
 {
     const std::size_t npts = testPts->getSize();
     for(std::size_t i = 0; i < npts; ++i) {
-        const Coordinate& testPt = testPts->getAt(i);
+        const CoordinateXY& testPt = testPts->getAt<CoordinateXY>(i);
         if(!isInList(testPt, pts)) {
             return testPt;
         }
@@ -93,12 +93,12 @@ EdgeRing::ptNotInList(const CoordinateSequence* testPts,
 
 /*public static*/
 bool
-EdgeRing::isInList(const Coordinate& pt,
+EdgeRing::isInList(const CoordinateXY& pt,
                    const CoordinateSequence* pts)
 {
     const std::size_t npts = pts->getSize();
     for(std::size_t i = 0; i < npts; ++i) {
-        if(pt == pts->getAt(i)) {
+        if(pt == pts->getAt<CoordinateXY>(i)) {
             return true;
         }
     }
diff --git a/src/operation/polygonize/PolygonizeDirectedEdge.cpp b/src/operation/polygonize/PolygonizeDirectedEdge.cpp
index 92e2bc575..c349b0d77 100644
--- a/src/operation/polygonize/PolygonizeDirectedEdge.cpp
+++ b/src/operation/polygonize/PolygonizeDirectedEdge.cpp
@@ -39,7 +39,7 @@ namespace polygonize { // geos.operation.polygonize
  *        opposite to that of the parent Edge (if any)
  */
 PolygonizeDirectedEdge::PolygonizeDirectedEdge(Node* newFrom,
-        Node* newTo, const Coordinate& newDirectionPt,
+        Node* newTo, const CoordinateXY& newDirectionPt,
         bool nEdgeDirection)
     :
     DirectedEdge(newFrom, newTo,
diff --git a/src/operation/polygonize/PolygonizeGraph.cpp b/src/operation/polygonize/PolygonizeGraph.cpp
index a3c119084..b19de4749 100644
--- a/src/operation/polygonize/PolygonizeGraph.cpp
+++ b/src/operation/polygonize/PolygonizeGraph.cpp
@@ -139,14 +139,14 @@ PolygonizeGraph::addEdge(const LineString* line)
         return;
     }
 
-    const Coordinate& startPt = linePts->getAt(0);
-    const Coordinate& endPt = linePts->getAt(linePts->getSize() - 1);
+    const CoordinateXY& startPt = linePts->getAt<CoordinateXY>(0);
+    const CoordinateXY& endPt = linePts->getAt<CoordinateXY>(linePts->getSize() - 1);
     Node* nStart = getNode(startPt);
     Node* nEnd = getNode(endPt);
     DirectedEdge* de0 = new PolygonizeDirectedEdge(nStart, nEnd, linePts->getAt(1), true);
     newDirEdges.push_back(de0);
     DirectedEdge* de1 = new PolygonizeDirectedEdge(nEnd, nStart,
-            linePts->getAt(linePts->getSize() - 2), false);
+            linePts->getAt<CoordinateXY>(linePts->getSize() - 2), false);
     newDirEdges.push_back(de1);
     Edge* edge = new PolygonizeEdge(line);
     newEdges.push_back(edge);
@@ -157,7 +157,7 @@ PolygonizeGraph::addEdge(const LineString* line)
 }
 
 Node*
-PolygonizeGraph::getNode(const Coordinate& pt)
+PolygonizeGraph::getNode(const CoordinateXY& pt)
 {
     Node* node = findNode(pt);
     if(node == nullptr) {
diff --git a/src/planargraph/DirectedEdge.cpp b/src/planargraph/DirectedEdge.cpp
index 1f3bfdc36..a6a591624 100644
--- a/src/planargraph/DirectedEdge.cpp
+++ b/src/planargraph/DirectedEdge.cpp
@@ -48,7 +48,7 @@ DirectedEdge::toEdges(std::vector<DirectedEdge*>& dirEdges)
 
 /*public*/
 DirectedEdge::DirectedEdge(Node* newFrom, Node* newTo,
-                           const Coordinate& directionPt, bool newEdgeDirection)
+                           const CoordinateXY& directionPt, bool newEdgeDirection)
 {
     from = newFrom;
     to = newTo;
@@ -112,7 +112,7 @@ DirectedEdge::getToNode() const
 }
 
 /*public*/
-Coordinate&
+CoordinateXY&
 DirectedEdge::getCoordinate() const
 {
     return from->getCoordinate();
diff --git a/src/planargraph/DirectedEdgeStar.cpp b/src/planargraph/DirectedEdgeStar.cpp
index d95a2f3e4..6dfc5ebab 100644
--- a/src/planargraph/DirectedEdgeStar.cpp
+++ b/src/planargraph/DirectedEdgeStar.cpp
@@ -81,7 +81,7 @@ DirectedEdgeStar::end() const
 /*
  * Returns the coordinate for the node at which this star is based
  */
-Coordinate&
+CoordinateXY&
 DirectedEdgeStar::getCoordinate() const
 {
     if(outEdges.empty()) {
diff --git a/src/planargraph/NodeMap.cpp b/src/planargraph/NodeMap.cpp
index d889d2b86..6729a22f4 100644
--- a/src/planargraph/NodeMap.cpp
+++ b/src/planargraph/NodeMap.cpp
@@ -52,7 +52,7 @@ NodeMap::add(Node* n)
  * (or null if no Node was there).
  */
 Node*
-NodeMap::remove(geom::Coordinate& pt)
+NodeMap::remove(geom::CoordinateXY& pt)
 {
     Node* n = find(pt);
     nodeMap.erase(pt);
@@ -74,7 +74,7 @@ NodeMap::getNodes(std::vector<Node*>& values)
  * Returns the Node at the given location, or null if no Node was there.
  */
 Node*
-NodeMap::find(const geom::Coordinate& coord)
+NodeMap::find(const geom::CoordinateXY& coord)
 {
     container::iterator found = nodeMap.find(coord);
     if(found == nodeMap.end()) {

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

Summary of changes:
 include/geos/operation/polygonize/EdgeRing.h               | 4 ++--
 include/geos/operation/polygonize/PolygonizeDirectedEdge.h | 2 +-
 include/geos/operation/polygonize/PolygonizeGraph.h        | 2 +-
 include/geos/planargraph/DirectedEdge.h                    | 4 ++--
 include/geos/planargraph/DirectedEdgeStar.h                | 4 ++--
 include/geos/planargraph/Node.h                            | 6 +++---
 include/geos/planargraph/NodeMap.h                         | 6 +++---
 include/geos/planargraph/PlanarGraph.h                     | 2 +-
 src/operation/buffer/PolygonBuilder.cpp                    | 2 +-
 src/operation/polygonize/EdgeRing.cpp                      | 8 ++++----
 src/operation/polygonize/PolygonizeDirectedEdge.cpp        | 2 +-
 src/operation/polygonize/PolygonizeGraph.cpp               | 8 ++++----
 src/planargraph/DirectedEdge.cpp                           | 4 ++--
 src/planargraph/DirectedEdgeStar.cpp                       | 2 +-
 src/planargraph/NodeMap.cpp                                | 4 ++--
 15 files changed, 30 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list