[geos-commits] [SCM] GEOS branch main updated. dbb5ced87a4032b7493cfce63b03a2aa3395f99e
git at osgeo.org
git at osgeo.org
Tue Sep 29 07:13:20 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 dbb5ced87a4032b7493cfce63b03a2aa3395f99e (commit)
via 4f1be197934d552d6c5dbe40e382fc92639fb679 (commit)
from ae9cdd98be4e0bae552b918d4d14c94a9ce99c58 (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 dbb5ced87a4032b7493cfce63b03a2aa3395f99e
Author: Daniel Baston <dbaston at gmail.com>
Date: Mon Sep 28 21:14:03 2026 -0400
Remove header for unimplemented ConsistentAreaTester
diff --git a/include/geos/operation/valid/ConsistentAreaTester.h b/include/geos/operation/valid/ConsistentAreaTester.h
deleted file mode 100644
index 1addfdf21..000000000
--- a/include/geos/operation/valid/ConsistentAreaTester.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/**********************************************************************
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.osgeo.org
- *
- * Copyright (C) 2005-2006 Refractions Research Inc.
- * Copyright (C) 2001-2002 Vivid Solutions Inc.
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Public Licence as published
- * by the Free Software Foundation.
- * See the COPYING file for more information.
- *
- **********************************************************************
- *
- * Last port: operation/valid/ConsistentAreaTester.java rev. 1.14 (JTS-1.10)
- *
- **********************************************************************/
-
-#pragma once
-
-#include <geos/export.h>
-
-#include <geos/geom/Coordinate.h> // for composition
-#include <geos/algorithm/LineIntersector.h> // for composition
-#include <geos/operation/relate/RelateNodeGraph.h> // for composition
-
-// Forward declarations
-namespace geos {
-namespace algorithm {
-class LineIntersector;
-}
-namespace geomgraph {
-class GeometryGraph;
-}
-namespace operation {
-namespace relate {
-class RelateNodeGraph;
-}
-}
-}
-
-namespace geos {
-namespace operation { // geos::operation
-namespace valid { // geos::operation::valid
-
-/** \brief
- * Checks that a geomgraph::GeometryGraph representing an area
- * (a geom::Polygon or geom::MultiPolygon)
- * has consistent semantics for area geometries.
- * This check is required for any reasonable polygonal model
- * (including the OGC-SFS model, as well as models which allow ring
- * self-intersection at single points)
- *
- * Checks include:
- *
- * - test for rings which properly intersect
- * (but not for ring self-intersection, or intersections at vertices)
- * - test for consistent labelling at all node points
- * (this detects vertex intersections with invalid topology,
- * i.e. where the exterior side of an edge lies in the interior of the area)
- * - test for duplicate rings
- *
- * If an inconsistency is found the location of the problem
- * is recorded and is available to the caller.
- *
- */
-class GEOS_DLL ConsistentAreaTester {
-private:
-
- algorithm::LineIntersector li;
-
- /// Not owned
- geomgraph::GeometryGraph* geomGraph;
-
- relate::RelateNodeGraph nodeGraph;
-
- /// the intersection point found (if any)
- geom::Coordinate invalidPoint;
-
- /**
- * Check all nodes to see if their labels are consistent.
- * If any are not, return false
- */
- bool isNodeEdgeAreaLabelsConsistent();
-
-public:
-
- /**
- * Creates a new tester for consistent areas.
- *
- * @param newGeomGraph the topology graph of the area geometry.
- * Caller keeps responsibility for its deletion
- */
- ConsistentAreaTester(geomgraph::GeometryGraph* newGeomGraph);
-
- ~ConsistentAreaTester() = default;
-
- /**
- * @return the intersection point, or <code>null</code>
- * if none was found
- */
- geom::Coordinate& getInvalidPoint();
-
- /** \brief
- * Check all nodes to see if their labels are consistent with
- * area topology.
- *
- * @return <code>true</code> if this area has a consistent node
- * labelling
- */
- bool isNodeConsistentArea();
-
- /**
- * Checks for two duplicate rings in an area.
- * Duplicate rings are rings that are topologically equal
- * (that is, which have the same sequence of points up to point order).
- * If the area is topologically consistent (determined by calling the
- * <code>isNodeConsistentArea</code>,
- * duplicate rings can be found by checking for EdgeBundles which contain
- * more than one geomgraph::EdgeEnd.
- * (This is because topologically consistent areas cannot have two rings sharing
- * the same line segment, unless the rings are equal).
- * The start point of one of the equal rings will be placed in
- * invalidPoint.
- *
- * @return true if this area Geometry is topologically consistent but has two duplicate rings
- */
- bool hasDuplicateRings();
-};
-
-
-
-} // namespace geos::operation::valid
-} // namespace geos::operation
-} // namespace geos
-
commit 4f1be197934d552d6c5dbe40e382fc92639fb679
Author: Daniel Baston <dbaston at gmail.com>
Date: Mon Sep 28 21:13:17 2026 -0400
IsValidOp: Apply const/static where possible
diff --git a/include/geos/operation/valid/IndexedNestedHoleTester.h b/include/geos/operation/valid/IndexedNestedHoleTester.h
index c52e977a0..7e197ea64 100644
--- a/include/geos/operation/valid/IndexedNestedHoleTester.h
+++ b/include/geos/operation/valid/IndexedNestedHoleTester.h
@@ -18,8 +18,6 @@
#include <geos/export.h>
#include <geos/index/strtree/TemplateSTRtree.h>
-#include <memory>
-
// Forward declarations
namespace geos {
namespace geom {
@@ -61,7 +59,7 @@ public:
*
* @return a point on a nested hole, or null if none are nested
*/
- const CoordinateXY& getNestedPoint() { return nestedPt; }
+ const CoordinateXY& getNestedPoint() const { return nestedPt; }
/**
* Tests if any hole is nested (contained) within another hole.
diff --git a/include/geos/operation/valid/IndexedNestedPolygonTester.h b/include/geos/operation/valid/IndexedNestedPolygonTester.h
index 22650be44..f1d7d87d2 100644
--- a/include/geos/operation/valid/IndexedNestedPolygonTester.h
+++ b/include/geos/operation/valid/IndexedNestedPolygonTester.h
@@ -19,7 +19,6 @@
#include <geos/index/strtree/TemplateSTRtree.h>
#include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
-#include <memory>
#include <map>
// Forward declarations
@@ -65,11 +64,11 @@ private:
/**
* Finds a point of a shell segment which lies inside a polygon, if any.
- * The shell is assume to touch the polyon only at shell vertices,
+ * The shell is assumed to touch the polygon only at shell vertices,
* and does not cross the polygon.
*
- * @param the shell to test
- * @param the polygon to test against
+ * @param shell the shell to test
+ * @param poly the polygon to test against
* @param coordNested return parameter for found coordinate
* @return an interior segment point, or null if the shell is nested correctly
*/
diff --git a/include/geos/operation/valid/IsValidOp.h b/include/geos/operation/valid/IsValidOp.h
index 27c6fe4c4..e2d4b71f1 100644
--- a/include/geos/operation/valid/IsValidOp.h
+++ b/include/geos/operation/valid/IsValidOp.h
@@ -148,9 +148,9 @@ private:
* @param minSize the minimum line size
* @return true if the line has the required number of non-repeated points
*/
- bool isNonRepeatedSizeAtLeast(const geom::LineString* line, std::size_t minSize);
+ static bool isNonRepeatedSizeAtLeast(const geom::LineString* line, std::size_t minSize);
- void checkAreaIntersections(PolygonTopologyAnalyzer& areaAnalyzer);
+ void checkAreaIntersections(const PolygonTopologyAnalyzer& areaAnalyzer);
/**
* Check whether a ring self-intersects (except at its endpoints).
@@ -183,7 +183,7 @@ private:
* @param shell the polygon shell to test against
* @return a hole point outside the shell, or null if it is inside
*/
- const CoordinateXY* findHoleOutsideShellPoint(
+ static const CoordinateXY* findHoleOutsideShellPoint(
const geom::LinearRing* hole,
const geom::LinearRing* shell);
diff --git a/include/geos/operation/valid/PolygonIntersectionAnalyzer.h b/include/geos/operation/valid/PolygonIntersectionAnalyzer.h
index 4a2eed919..153cb9d6a 100644
--- a/include/geos/operation/valid/PolygonIntersectionAnalyzer.h
+++ b/include/geos/operation/valid/PolygonIntersectionAnalyzer.h
@@ -23,8 +23,6 @@
#include <geos/export.h>
-#include <memory>
-
// Forward declarations
namespace geos {
namespace noding {
@@ -53,7 +51,7 @@ private:
const SegmentString* ss0, std::size_t segIndex0,
const SegmentString* ss1, std::size_t segIndex1);
- bool addDoubleTouch(
+ static bool addDoubleTouch(
const SegmentString* ss0, const SegmentString* ss1,
const CoordinateXY& intPt);
@@ -62,11 +60,11 @@ private:
const CoordinateXY* e00, const CoordinateXY* e01,
const CoordinateXY* e10, const CoordinateXY* e11);
- const CoordinateXY& prevCoordinateInRing(
- const SegmentString* ringSS, std::size_t segIndex) const;
+ static const CoordinateXY& prevCoordinateInRing(
+ const SegmentString* ringSS, std::size_t segIndex);
- bool isAdjacentInRing(const SegmentString* ringSS,
- std::size_t segIndex0, std::size_t segIndex1) const;
+ static bool isAdjacentInRing(const SegmentString* ringSS,
+ std::size_t segIndex0, std::size_t segIndex1);
public:
@@ -74,7 +72,7 @@ public:
/**
* Creates a new finder, allowing for the mode where inverted rings are valid.
*
- * @param isInvertedRingValid true if inverted rings are valid.
+ * @param p_isInvertedRingValid true if inverted rings are valid.
*/
PolygonIntersectionAnalyzer(bool p_isInvertedRingValid)
: isInvertedRingValid(p_isInvertedRingValid)
diff --git a/include/geos/operation/valid/PolygonRing.h b/include/geos/operation/valid/PolygonRing.h
index b1447c18a..bd74812f9 100644
--- a/include/geos/operation/valid/PolygonRing.h
+++ b/include/geos/operation/valid/PolygonRing.h
@@ -21,7 +21,6 @@
#include <geos/export.h>
-#include <memory>
#include <map>
// Forward declarations
@@ -77,7 +76,7 @@ private:
* Tests if this ring touches a given ring at
* the single point specified.
*
- * @param ring the other PolygonRing
+ * @param polyRing the other PolygonRing
* @param pt the touch point
* @return true if the rings touch only at the given point
*/
@@ -93,7 +92,7 @@ private:
*/
const CoordinateXY* findHoleCycleLocation();
- void init(PolygonRing* root, std::stack<PolygonRingTouch*>& touchStack);
+ static void init(PolygonRing* root, std::stack<PolygonRingTouch*>& touchStack);
/**
* Scans for a hole cycle starting at a given touch.
@@ -103,7 +102,7 @@ private:
* @param touchStack the stack of touches to scan
* @return a vertex in a hole cycle if found, or null
*/
- const CoordinateXY* scanForHoleCycle(PolygonRingTouch* currentTouch,
+ static const CoordinateXY* scanForHoleCycle(const PolygonRingTouch* currentTouch,
PolygonRing* root,
std::stack<PolygonRingTouch*>& touchStack);
@@ -183,7 +182,7 @@ public:
* @param polyRings the list of rings to check
* @return a vertex contained in a ring cycle, or null if none is found
*/
- static const CoordinateXY* findHoleCycleLocation(std::vector<PolygonRing*> polyRings);
+ static const CoordinateXY* findHoleCycleLocation(const std::vector<PolygonRing*>& polyRings);
/**
* Finds a location of an interior self-touch in a list of rings,
@@ -194,7 +193,7 @@ public:
* @param polyRings the list of rings to check
* @return the location of an interior self-touch node, or null if there are none
*/
- static const CoordinateXY* findInteriorSelfNode(std::vector<PolygonRing*> polyRings);
+ static const CoordinateXY* findInteriorSelfNode(const std::vector<PolygonRing*>& polyRings);
bool isSamePolygon(const PolygonRing* polyRing) const
{
@@ -216,7 +215,7 @@ public:
*
* @return the location of an interior self-touch node, or null if there are none
*/
- const CoordinateXY* findInteriorSelfNode();
+ const CoordinateXY* findInteriorSelfNode() const;
};
diff --git a/include/geos/operation/valid/PolygonRingSelfNode.h b/include/geos/operation/valid/PolygonRingSelfNode.h
index 2b95eebdb..5803fb437 100644
--- a/include/geos/operation/valid/PolygonRingSelfNode.h
+++ b/include/geos/operation/valid/PolygonRingSelfNode.h
@@ -19,8 +19,6 @@
#include <geos/geom/Coordinate.h>
-#include <memory>
-
namespace geos { // geos.
namespace operation { // geos.operation
diff --git a/include/geos/operation/valid/PolygonRingTouch.h b/include/geos/operation/valid/PolygonRingTouch.h
index b59e64bbe..c7d9b58f0 100644
--- a/include/geos/operation/valid/PolygonRingTouch.h
+++ b/include/geos/operation/valid/PolygonRingTouch.h
@@ -19,8 +19,6 @@
#include <geos/geom/Coordinate.h>
-#include <memory>
-
// Forward declarations
namespace geos {
namespace operation {
diff --git a/include/geos/operation/valid/PolygonTopologyAnalyzer.h b/include/geos/operation/valid/PolygonTopologyAnalyzer.h
index 91beba6bb..4ab9c5237 100644
--- a/include/geos/operation/valid/PolygonTopologyAnalyzer.h
+++ b/include/geos/operation/valid/PolygonTopologyAnalyzer.h
@@ -22,8 +22,6 @@
#include <geos/operation/valid/PolygonRing.h>
#include <geos/noding/BasicSegmentString.h>
-#include <memory>
-
// Forward declarations
namespace geos {
namespace geom {
@@ -102,7 +100,7 @@ private:
std::vector<SegmentString*> createSegmentStrings(const Geometry* geom, bool isInvertedRingValid);
- std::vector<PolygonRing*> getPolygonRings(const std::vector<SegmentString*>& segStrings);
+ static std::vector<PolygonRing*> getPolygonRings(const std::vector<SegmentString*>& segStrings);
SegmentString* createSegString(const LinearRing* ring, const PolygonRing* polyRing);
@@ -145,15 +143,15 @@ public:
isRingNested(const LinearRing* test,
const LinearRing* target);
- bool hasInvalidIntersection() {
+ bool hasInvalidIntersection() const {
return segInt.isInvalid();
}
- int getInvalidCode() {
+ int getInvalidCode() const {
return segInt.getInvalidCode();
}
- const CoordinateXY& getInvalidLocation() {
+ const CoordinateXY& getInvalidLocation() const {
return segInt.getInvalidLocation();
}
diff --git a/src/operation/valid/IndexedNestedHoleTester.cpp b/src/operation/valid/IndexedNestedHoleTester.cpp
index c4b9d49af..5d57ac328 100644
--- a/src/operation/valid/IndexedNestedHoleTester.cpp
+++ b/src/operation/valid/IndexedNestedHoleTester.cpp
@@ -44,7 +44,7 @@ bool
IndexedNestedHoleTester::isNested()
{
for (std::size_t i = 0; i < polygon->getNumInteriorRing(); i++) {
- const LinearRing* hole = static_cast<const LinearRing*>(polygon->getInteriorRingN(i));
+ const LinearRing* hole = polygon->getInteriorRingN(i);
std::vector<const LinearRing*> results;
index.query(*(hole->getEnvelopeInternal()), results);
diff --git a/src/operation/valid/IsValidOp.cpp b/src/operation/valid/IsValidOp.cpp
index 454d9a18c..625aafa54 100644
--- a/src/operation/valid/IsValidOp.cpp
+++ b/src/operation/valid/IsValidOp.cpp
@@ -346,7 +346,7 @@ IsValidOp::checkTooFewPoints(const LineString* line, std::size_t minSize)
if (! isNonRepeatedSizeAtLeast(line, minSize) ) {
CoordinateXY pt = line->getNumPoints() >= 1
? line->getCoordinatesRO()->getAt<CoordinateXY>(0)
- : Coordinate();
+ : CoordinateXY();
logInvalid(TopologyValidationError::eTooFewPoints, pt);
}
}
@@ -372,7 +372,7 @@ IsValidOp::isNonRepeatedSizeAtLeast(const LineString* line, std::size_t minSize)
/* private */
void
-IsValidOp::checkAreaIntersections(PolygonTopologyAnalyzer& areaAnalyzer)
+IsValidOp::checkAreaIntersections(const PolygonTopologyAnalyzer& areaAnalyzer)
{
if (areaAnalyzer.hasInvalidIntersection()) {
logInvalid(areaAnalyzer.getInvalidCode(),
diff --git a/src/operation/valid/PolygonIntersectionAnalyzer.cpp b/src/operation/valid/PolygonIntersectionAnalyzer.cpp
index 7f71f0f08..e7ab16071 100644
--- a/src/operation/valid/PolygonIntersectionAnalyzer.cpp
+++ b/src/operation/valid/PolygonIntersectionAnalyzer.cpp
@@ -191,7 +191,7 @@ PolygonIntersectionAnalyzer::addSelfTouch(
/* private */
const CoordinateXY&
PolygonIntersectionAnalyzer::prevCoordinateInRing(
- const SegmentString* ringSS, std::size_t segIndex) const
+ const SegmentString* ringSS, std::size_t segIndex)
{
std::size_t prevIndex;
if (segIndex == 0) {
@@ -206,7 +206,7 @@ PolygonIntersectionAnalyzer::prevCoordinateInRing(
/* private */
bool
PolygonIntersectionAnalyzer::isAdjacentInRing(const SegmentString* ringSS,
- std::size_t segIndex0, std::size_t segIndex1) const
+ std::size_t segIndex0, std::size_t segIndex1)
{
std::size_t delta = segIndex0 > segIndex1
? segIndex0 - segIndex1
diff --git a/src/operation/valid/PolygonRing.cpp b/src/operation/valid/PolygonRing.cpp
index 5a0c583da..5ff972592 100644
--- a/src/operation/valid/PolygonRing.cpp
+++ b/src/operation/valid/PolygonRing.cpp
@@ -14,7 +14,6 @@
**********************************************************************/
#include <geos/algorithm/Orientation.h>
-#include <geos/algorithm/PolygonNodeTopology.h>
#include <geos/geom/Coordinate.h>
#include <geos/geom/LinearRing.h>
#include <geos/operation/valid/PolygonRing.h>
@@ -59,7 +58,7 @@ PolygonRing::addTouch(PolygonRing* ring0, PolygonRing* ring1, const CoordinateXY
/* public static */
const CoordinateXY*
-PolygonRing::findHoleCycleLocation(std::vector<PolygonRing*> polyRings)
+PolygonRing::findHoleCycleLocation(const std::vector<PolygonRing*>& polyRings)
{
for (PolygonRing* polyRing : polyRings) {
if (! polyRing->isInTouchSet()) {
@@ -73,9 +72,9 @@ PolygonRing::findHoleCycleLocation(std::vector<PolygonRing*> polyRings)
/* public static */
const CoordinateXY*
-PolygonRing::findInteriorSelfNode(std::vector<PolygonRing*> polyRings)
+PolygonRing::findInteriorSelfNode(const std::vector<PolygonRing*>& polyRings)
{
- for (PolygonRing* polyRing : polyRings) {
+ for (const PolygonRing* polyRing : polyRings) {
const CoordinateXY* interiorSelfNode = polyRing->findInteriorSelfNode();
if (interiorSelfNode != nullptr) {
return interiorSelfNode;
@@ -161,7 +160,7 @@ PolygonRing::findHoleCycleLocation()
init(root, touchStack);
while (! touchStack.empty()) {
- PolygonRingTouch* touch = touchStack.top();
+ const PolygonRingTouch* touch = touchStack.top();
touchStack.pop();
const CoordinateXY* holeCyclePt = scanForHoleCycle(touch, root, touchStack);
if (holeCyclePt != nullptr) {
@@ -185,11 +184,11 @@ PolygonRing::init(PolygonRing* root, std::stack<PolygonRingTouch*>& touchStack)
/* private */
const CoordinateXY*
-PolygonRing::scanForHoleCycle(PolygonRingTouch* currentTouch,
+PolygonRing::scanForHoleCycle(const PolygonRingTouch* currentTouch,
PolygonRing* root,
std::stack<PolygonRingTouch*>& touchStack)
{
- PolygonRing* polyRing = currentTouch->getRing();
+ const PolygonRing* polyRing = currentTouch->getRing();
const CoordinateXY* currentPt = currentTouch->getCoordinate();
/**
@@ -229,7 +228,7 @@ PolygonRing::scanForHoleCycle(PolygonRingTouch* currentTouch,
/* public */
const CoordinateXY*
-PolygonRing::findInteriorSelfNode()
+PolygonRing::findInteriorSelfNode() const
{
if (selfNodes.empty()) return nullptr;
diff --git a/src/operation/valid/PolygonTopologyAnalyzer.cpp b/src/operation/valid/PolygonTopologyAnalyzer.cpp
index 2a65cbc16..3e719fdab 100644
--- a/src/operation/valid/PolygonTopologyAnalyzer.cpp
+++ b/src/operation/valid/PolygonTopologyAnalyzer.cpp
@@ -43,7 +43,7 @@ namespace valid { // geos.operation.valid
PolygonTopologyAnalyzer::PolygonTopologyAnalyzer(const Geometry* geom, bool p_isInvertedRingValid)
: isInvertedRingValid(p_isInvertedRingValid)
, segInt(p_isInvertedRingValid)
- , disconnectionPt(Coordinate::getNull())
+ , disconnectionPt(CoordinateXY::getNull())
{
if (geom->isEmpty()){
return;
@@ -68,7 +68,7 @@ PolygonTopologyAnalyzer::findSelfIntersection(const LinearRing* ring)
PolygonTopologyAnalyzer ata(ring, false);
if (ata.hasInvalidIntersection())
return ata.getInvalidLocation();
- return Coordinate::getNull();
+ return CoordinateXY::getNull();
}
/* public static */
@@ -178,7 +178,6 @@ std::size_t
PolygonTopologyAnalyzer::intersectingSegIndex(const CoordinateSequence* ringPts,
const CoordinateXY* pt)
{
- algorithm::LineIntersector li;
for (std::size_t i = 0; i < ringPts->size() - 1; i++) {
if ( algorithm::PointLocation::isOnSegment(*pt, ringPts->getAt<CoordinateXY>(i), ringPts->getAt<CoordinateXY>(i+1)) ) {
//-- check if pt is the start point of the next segment
-----------------------------------------------------------------------
Summary of changes:
.../geos/operation/valid/ConsistentAreaTester.h | 137 ---------------------
.../geos/operation/valid/IndexedNestedHoleTester.h | 4 +-
.../operation/valid/IndexedNestedPolygonTester.h | 7 +-
include/geos/operation/valid/IsValidOp.h | 6 +-
.../operation/valid/PolygonIntersectionAnalyzer.h | 14 +--
include/geos/operation/valid/PolygonRing.h | 13 +-
include/geos/operation/valid/PolygonRingSelfNode.h | 2 -
include/geos/operation/valid/PolygonRingTouch.h | 2 -
.../geos/operation/valid/PolygonTopologyAnalyzer.h | 10 +-
src/operation/valid/IndexedNestedHoleTester.cpp | 2 +-
src/operation/valid/IsValidOp.cpp | 4 +-
.../valid/PolygonIntersectionAnalyzer.cpp | 4 +-
src/operation/valid/PolygonRing.cpp | 15 ++-
src/operation/valid/PolygonTopologyAnalyzer.cpp | 5 +-
14 files changed, 37 insertions(+), 188 deletions(-)
delete mode 100644 include/geos/operation/valid/ConsistentAreaTester.h
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list