[geos-commits] [SCM] GEOS branch main updated. 72c132a64e678dd1decb73fd5eafac3bd62307ce
git at osgeo.org
git at osgeo.org
Mon Dec 22 11:36:02 PST 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, main has been updated
via 72c132a64e678dd1decb73fd5eafac3bd62307ce (commit)
via f98d330e8fe14d1e1a77763423ec6dff12d369ae (commit)
via 3e4581fad3974501880e59d47a6e852f624b5a67 (commit)
via 0d2deb25cdc40c4040ea222e958b884a47a28b39 (commit)
via 0211bbebe3b7741ba8f869e5ab19d4fdd2de1530 (commit)
via fc9c1a0eda99660f1fe81a2f9a6f1151a3fbd1a1 (commit)
via 5aaa5c8c3a0a8549c874356aad94d578ba45a7da (commit)
via a3de1c7bed176836125e9f065b5018dbf2ada307 (commit)
via cf9111810586691a46beea382c8e33abb3927878 (commit)
from 88a987895022ff77fedad776d7835e5743208abb (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 72c132a64e678dd1decb73fd5eafac3bd62307ce
Author: Daniel Baston <dbaston at gmail.com>
Date: Thu Oct 23 16:42:03 2025 -0400
SegmentPointComparator: Use CoordinateXY
diff --git a/include/geos/noding/SegmentPointComparator.h b/include/geos/noding/SegmentPointComparator.h
index bd4739274..d56f78288 100644
--- a/include/geos/noding/SegmentPointComparator.h
+++ b/include/geos/noding/SegmentPointComparator.h
@@ -49,8 +49,8 @@ public:
* @return 1 node1 occurs first
*/
static int
- compare(int octant, const geom::Coordinate& p0,
- const geom::Coordinate& p1)
+ compare(int octant, const geom::CoordinateXY& p0,
+ const geom::CoordinateXY& p1)
{
// nodes can only be equal if their coordinates are equal
if(p0.equals2D(p1)) {
commit f98d330e8fe14d1e1a77763423ec6dff12d369ae
Author: Daniel Baston <dbaston at gmail.com>
Date: Thu Oct 23 16:41:51 2025 -0400
Octant.h: clarify comment
diff --git a/include/geos/noding/Octant.h b/include/geos/noding/Octant.h
index 7b96c0af1..dce4616c7 100644
--- a/include/geos/noding/Octant.h
+++ b/include/geos/noding/Octant.h
@@ -33,11 +33,11 @@ namespace noding { // geos.noding
*
* Octants are numbered as follows:
*
- * 2|1
- * 3 | 0
+ * \2|1/
+ * 3 \|/ 0
* ---+--
- * 4 | 7
- * 5|6
+ * 4 /|\ 7
+ * /5|6\
*
* If line segments lie along a coordinate axis, the octant is the lower of the two
* possible values.
commit 3e4581fad3974501880e59d47a6e852f624b5a67
Author: Daniel Baston <dbaston at gmail.com>
Date: Thu Oct 23 15:16:03 2025 -0400
SimpleNoder: Remove unnecessary virtual specifier
diff --git a/include/geos/noding/SimpleNoder.h b/include/geos/noding/SimpleNoder.h
index 95468637a..70bc4765f 100644
--- a/include/geos/noding/SimpleNoder.h
+++ b/include/geos/noding/SimpleNoder.h
@@ -48,7 +48,7 @@ namespace noding { // geos.noding
class GEOS_DLL SimpleNoder: public SinglePassNoder {
private:
std::vector<SegmentString*> nodedSegStrings;
- virtual void computeIntersects(SegmentString* e0, SegmentString* e1);
+ void computeIntersects(SegmentString* e0, SegmentString* e1);
public:
SimpleNoder(SegmentIntersector* nSegInt = nullptr)
commit 0d2deb25cdc40c4040ea222e958b884a47a28b39
Author: Daniel Baston <dbaston at gmail.com>
Date: Thu Oct 23 15:10:08 2025 -0400
SinglePassNoder: Remove unnecessary overrides
diff --git a/include/geos/noding/SinglePassNoder.h b/include/geos/noding/SinglePassNoder.h
index b36d94a60..4c3891b24 100644
--- a/include/geos/noding/SinglePassNoder.h
+++ b/include/geos/noding/SinglePassNoder.h
@@ -15,9 +15,6 @@
#pragma once
#include <geos/export.h>
-
-#include <vector>
-
#include <geos/noding/Noder.h>
// Forward declarations
@@ -42,8 +39,6 @@ namespace noding { // geos.noding
*
* Last port: noding/SinglePassNoder.java rev. 1.3 (JTS-1.7)
*
- * TODO: Noder inheritance (that's just an interface!)
- *
*/
class GEOS_DLL SinglePassNoder : public Noder { // implements Noder
@@ -74,22 +69,6 @@ public:
segInt = newSegInt;
}
- /** \brief
- * Computes the noding for a collection of {@link SegmentString}s.
- *
- * @param segStrings a collection of {@link SegmentString}s to node
- */
- void computeNodes(const std::vector<SegmentString*>& segStrings) override = 0;
-
- /** \brief
- * Returns a Collection of fully noded {@link SegmentString}s.
- *
- * The SegmentStrings have the same context as their parent.
- *
- * @return a Collection of SegmentStrings
- */
- std::vector<std::unique_ptr<SegmentString>> getNodedSubstrings() override = 0;
-
};
} // namespace geos.noding
commit 0211bbebe3b7741ba8f869e5ab19d4fdd2de1530
Author: Daniel Baston <dbaston at gmail.com>
Date: Thu Dec 4 12:04:57 2025 -0500
RobustLineIntersectorZTest: Add test for contained collinear segment
diff --git a/tests/unit/algorithm/RobustLineIntersectorZTest.cpp b/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
index 1616e0650..7d7936bc8 100644
--- a/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
+++ b/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
@@ -266,7 +266,7 @@ void object::test<10>
{
// Intersection at interior of 3D line, endpoint of 2D line
// result Z is interpolated
- set_test_name("testInteriorEndpoint2D3D");
+ set_test_name("testInteriorEndpoint3D2D");
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
@@ -424,5 +424,22 @@ void object::test<19>
xyzm(2, 2, 11, -11));
}
+template<>
+template<>
+void object::test<20>
+()
+{
+ // Collinear intersection of XYZ lines
+ // Z values in the second line do not match interpolated values in the first
+ // Result Z uses endpoint values of the second line
+ set_test_name("testCollinearContainedDifferentZ");
+
+ checkIntersection(
+ line<XYZ>({1, 1, 1}, {5, 5, 5}),
+ line<XYZ>({3, 3, 7}, {4, 4, 13}),
+ xyz(3, 3, 7),
+ xyz(4, 4, 13));
+}
+
} // namespace tut
commit fc9c1a0eda99660f1fe81a2f9a6f1151a3fbd1a1
Author: Daniel Baston <dbaston at gmail.com>
Date: Thu Nov 27 10:01:40 2025 -0500
RobustLineIntersectorZTest: Set test names, add comments
diff --git a/tests/unit/algorithm/RobustLineIntersectorZTest.cpp b/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
index d57c65b52..1616e0650 100644
--- a/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
+++ b/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
@@ -120,6 +120,10 @@ template<>
void object::test<1>
()
{
+ // XYZ intersects XYZ at interior point.
+ // Z value at the intersection point is the average of the interpolated values from each line.
+ set_test_name("testInterior");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XYZ>({1, 3, 10}, {3, 1, 30}),
@@ -133,6 +137,8 @@ template<>
void object::test<2>
()
{
+ set_test_name("testInterior2D");
+
checkIntersection(
line<XY>({1, 1}, {3, 3}),
line<XY>({1, 3}, {3, 1}),
@@ -145,6 +151,10 @@ template<>
void object::test<3>
()
{
+ // XYZ intersects XY at interior point.
+ // Z value at the intersection point is the interpolated value from the XYZ line.
+ set_test_name("testInterior3D2D");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XY>({1, 3}, {3, 1}),
@@ -157,6 +167,10 @@ template<>
void object::test<4>
()
{
+ // XY intersects XYZ at interior point.
+ // Z value at the intersection point is the interpolated value from the XZZ line.
+ set_test_name("testInterior2D3D");
+
checkIntersection(
line<XY>({1, 1}, {3, 3}),
line<XYZ>({1, 3, 10}, {3, 1, 30}),
@@ -164,12 +178,16 @@ void object::test<4>
}
// testInterior2D3DPart
-// result is average of line1 interpolated and line2 p0 Z
template<>
template<>
void object::test<5>
()
{
+ // XYZ intersects XYZ at interior point.
+ // Second line has a Z value of NaN at one point.
+ // result is average of line1 interpolated and line2 p0 Z
+ set_test_name("testInterior2D3DPart");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XYZ>({1, 3, 10}, {3, 1, geos::DoubleNotANumber}),
@@ -182,6 +200,10 @@ template<>
void object::test<6>
()
{
+ // XYZ intersects XYZ at endpoint.
+ // Result Z value at intersection point is taken from the first line.
+ set_test_name("testEndpoint");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XYZ>({3, 3, 3}, {3, 1, 30}),
@@ -194,6 +216,10 @@ template<>
void object::test<7>
()
{
+ // XY intersects XY at endpoint.
+ // Result Z value at intersection point is NaN.
+ set_test_name("testEndpoint2D");
+
checkIntersection(
line<XY>({1, 1}, {3, 3}),
line<XY>({3, 3}, {3, 1}),
@@ -206,7 +232,10 @@ template<>
void object::test<8>
()
{
+ // XYZ intersects XY at endpoint.
// result Z is from 3D point
+ set_test_name("testEndpoint2D3D");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XY>({3, 3}, {3, 1}),
@@ -219,7 +248,10 @@ template<>
void object::test<9>
()
{
- // result Z is from 3D point
+ // Intersection at interior of 3D line, endpoint of 3D line
+ // result Z is from 3D endpoint
+ set_test_name("testInteriorEndpoint");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XYZ>({2, 2, 10}, {3, 1, 30}),
@@ -232,7 +264,10 @@ template<>
void object::test<10>
()
{
+ // Intersection at interior of 3D line, endpoint of 2D line
// result Z is interpolated
+ set_test_name("testInteriorEndpoint2D3D");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XY>({2, 2}, {3, 1}),
@@ -240,12 +275,15 @@ void object::test<10>
}
// testInteriorEndpoint2D3D
-// result Z is from 3D point
template<>
template<>
void object::test<11>
()
{
+ // Intersection at interior of 2D line, endpoint of 3D line
+ // result Z is from 3D point
+ set_test_name("testInteriorEndpoint2D3D");
+
checkIntersection(
line<XY>({1, 1}, {3, 3}),
line<XYZ>({2, 2, 10}, {3, 1, 20}),
@@ -258,6 +296,10 @@ template<>
void object::test<12>
()
{
+ // Collinear intersection of two XYZ lines
+ // Z values are equivalent in both inputs
+ set_test_name("testCollinearEqual");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XYZ>({1, 1, 1}, {3, 3, 3}),
@@ -270,6 +312,10 @@ template<>
void object::test<13>
()
{
+ // Collinear intersection of XY and XYZ
+ // Z values taken from XYZ line
+ set_test_name("testCollinearEqual3D2D");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XY>({1, 1}, {3, 3}),
@@ -282,6 +328,10 @@ template<>
void object::test<14>
()
{
+ // Endpoint intersection of two collinear XYZ lines
+ // Z values of inputs are the same and are copied to output
+ set_test_name("testCollinearEndpoint");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XYZ>({3, 3, 3}, {5, 5, 5}),
@@ -295,6 +345,10 @@ template<>
void object::test<15>
()
{
+ // Endpoint intersection of collinear XY and XYZ lines
+ // Z values of result is taken from the XYZ input
+ set_test_name("testCollinearEndpoint3D2D");
+
checkIntersection(
line<XYZ>({1, 1, 1}, {3, 3, 3}),
line<XY>({3, 3}, {5, 5}),
@@ -307,6 +361,11 @@ template<>
void object::test<16>
()
{
+ // Collinear intersection of XYZ lines
+ // Z values in the second line match interpolated values in the first
+ set_test_name("testCollinearContained");
+
+
checkIntersection(
line<XYZ>({1, 1, 1}, {5, 5, 5}),
line<XYZ>({3, 3, 3}, {4, 4, 4}),
@@ -320,7 +379,11 @@ template<>
void object::test<17>
()
{
+ // Collinear intersection of XYZ line with XY line
// result Z is interpolated
+ set_test_name("testCollinearContained3D2D");
+
+
checkIntersection(
line<XYZ>({1, 1, 1}, {5, 5, 5}),
line<XY>({3, 3}, {4, 4}),
@@ -334,6 +397,11 @@ template<>
void object::test<18>
()
{
+ // Interior intersection of two XYM lines.
+ // Result M is the average of the interpolated coordinate values.
+ set_test_name("testInteriorXYM-XYM");
+
+
checkIntersection(
line<XYM>({1, 1, 1}, {3, 3, 3}),
line<XYM>({1, 3, 10}, {3, 1, 30}),
@@ -346,6 +414,10 @@ template<>
void object::test<19>
()
{
+ // Interior intersection of two XYZM lines.
+ // Result Z and M are the average of the interpolated coordinate values.
+ set_test_name("testInteriorXYZM-XYZM");
+
checkIntersection(
line<XYZM>({1, 1, 1, -1}, {3, 3, 3, -3}),
line<XYZM>({1, 3, 10, -10}, {3, 1, 30, -30}),
commit 5aaa5c8c3a0a8549c874356aad94d578ba45a7da
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Dec 16 10:42:30 2025 -0500
CircularString: validate number of points on construction
diff --git a/src/geom/CircularString.cpp b/src/geom/CircularString.cpp
index 26f74d96f..6e95aa035 100644
--- a/src/geom/CircularString.cpp
+++ b/src/geom/CircularString.cpp
@@ -97,8 +97,8 @@ CircularString::validateConstruction()
return;
}
- if (points->size() == 2) {
- throw util::IllegalArgumentException("point array must contain 0 or >2 elements\n");
+ if (points->size() > 0 && (points->size() < 3 || points->size() % 2 == 0)) {
+ throw util::IllegalArgumentException("point array size must zero or be an odd number >= 3");
}
}
diff --git a/tests/unit/capi/GEOSGeom_createCollectionTest.cpp b/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
index 626465851..c52bce50a 100644
--- a/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
+++ b/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
@@ -193,10 +193,10 @@ void object::test<9>
{
GEOSGeometry* geoms[2];
geoms[0] = fromWKT("POLYGON ((0 0, 1 0, 1 1, 0 0))");
- geoms[1] = fromWKT("CURVEPOLYGON (CIRCULARSTRING (10 10, 20 10, 15 15, 10 10))");
+ geoms[1] = fromWKT("CURVEPOLYGON (COMPOUNDCURVE (CIRCULARSTRING (10 10, 20 10, 15 15), (15 15, 10 10)))");
result_ = GEOSGeom_createCollection(GEOS_MULTISURFACE, geoms, 2);
- expected_ = fromWKT("MULTISURFACE (((0 0, 1 0, 1 1, 0 0)), CURVEPOLYGON (CIRCULARSTRING (10 10, 20 10, 15 15, 10 10)))");
+ expected_ = fromWKT("MULTISURFACE (((0 0, 1 0, 1 1, 0 0)), CURVEPOLYGON (COMPOUNDCURVE(CIRCULARSTRING (10 10, 20 10, 15 15), (15 15, 10 10))))");
ensure_geometry_equals_identical(result_, expected_);
}
diff --git a/tests/unit/geom/CircularStringTest.cpp b/tests/unit/geom/CircularStringTest.cpp
index 64bbe6524..a4a9a9d14 100644
--- a/tests/unit/geom/CircularStringTest.cpp
+++ b/tests/unit/geom/CircularStringTest.cpp
@@ -8,6 +8,8 @@
#include <geos/io/WKTReader.h>
#include <geos/util/UnsupportedOperationException.h>
+#include "utility.h"
+
using geos::geom::CoordinateSequence;
using geos::geom::CircularString;
using XY = geos::geom::CoordinateXY;
@@ -175,4 +177,26 @@ void object::test<4>()
ensure("isCoordinate", cs_->isCoordinate(pt));
}
+template<>
+template<>
+void object::test<5>()
+{
+ set_test_name("invalid number of points");
+
+ auto pts = std::make_shared<CoordinateSequence>();
+ ensure_NO_THROW(factory_->createCircularString(pts));
+
+ pts->add(0.0, 0.0);
+ ensure_THROW(factory_->createCircularString(pts), geos::util::GEOSException);
+
+ pts->add(1.0, 1.0);
+ ensure_THROW(factory_->createCircularString(pts), geos::util::GEOSException);
+
+ pts->add(2.0, 0.0);
+ ensure_NO_THROW(factory_->createCircularString(pts));
+
+ pts->add(3.0, -1.0);
+ ensure_THROW(factory_->createCircularString(pts), geos::util::GEOSException);
+}
+
}
commit a3de1c7bed176836125e9f065b5018dbf2ada307
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Dec 16 10:31:35 2025 -0500
SimpleCurve: Fix envelope calculation
diff --git a/src/geom/SimpleCurve.cpp b/src/geom/SimpleCurve.cpp
index e062c4c8b..21fd40c88 100644
--- a/src/geom/SimpleCurve.cpp
+++ b/src/geom/SimpleCurve.cpp
@@ -144,7 +144,7 @@ SimpleCurve::computeEnvelopeInternal(bool isLinear) const
}
else {
Envelope e;
- for (std::size_t i = 2; i < points->size(); i++) {
+ for (std::size_t i = 2; i < points->size(); i += 2) {
algorithm::CircularArcs::expandEnvelope(e,
points->getAt<CoordinateXY>(i-2),
points->getAt<CoordinateXY>(i-1),
commit cf9111810586691a46beea382c8e33abb3927878
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Dec 16 10:31:18 2025 -0500
CircularArcs: Fix UB in expandEnvelope
diff --git a/src/algorithm/CircularArcs.cpp b/src/algorithm/CircularArcs.cpp
index 99ddb04ff..55d7a433a 100644
--- a/src/algorithm/CircularArcs.cpp
+++ b/src/algorithm/CircularArcs.cpp
@@ -131,7 +131,7 @@ CircularArcs::expandEnvelope(geom::Envelope& e, const geom::CoordinateXY& p0, co
}
// collinear
- if (std::isnan(center.x)) {
+ if (!std::isfinite(center.x) || !std::isfinite(center.y)) {
return;
}
-----------------------------------------------------------------------
Summary of changes:
include/geos/noding/Octant.h | 8 +-
include/geos/noding/SegmentPointComparator.h | 4 +-
include/geos/noding/SimpleNoder.h | 2 +-
include/geos/noding/SinglePassNoder.h | 21 -----
src/algorithm/CircularArcs.cpp | 2 +-
src/geom/CircularString.cpp | 4 +-
src/geom/SimpleCurve.cpp | 2 +-
.../unit/algorithm/RobustLineIntersectorZTest.cpp | 95 +++++++++++++++++++++-
tests/unit/capi/GEOSGeom_createCollectionTest.cpp | 4 +-
tests/unit/geom/CircularStringTest.cpp | 24 ++++++
10 files changed, 129 insertions(+), 37 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list