[geos-commits] [SCM] GEOS branch 3.10 updated. 27279ce1b7efc69a665f8bf6cc257856ae3263f4
git at osgeo.org
git at osgeo.org
Mon Jun 17 11:45:43 PDT 2024
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.10 has been updated
via 27279ce1b7efc69a665f8bf6cc257856ae3263f4 (commit)
via 32b27536225c768384ed55ec8f7040b427ecb6de (commit)
via 49e7965ab3c2b132f36ef0095f5cdf7bdc852a7f (commit)
via 16d443a702daddf076355e960f466b57ad8dbca2 (commit)
from c91cb2e6094028d13b3e77d11406c1ad21c1d280 (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 27279ce1b7efc69a665f8bf6cc257856ae3263f4
Author: Daniel Baston <dbaston at gmail.com>
Date: Mon Jun 17 14:42:39 2024 -0400
NEWS updates
diff --git a/NEWS b/NEWS
index 9c3e38b9e..9745dfc4d 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@
- Fix IsSimpleOp for MultiPoint with empty element (GH-1005, Martin Davis)
- Fix PreparedPolygonContains for GC with MultiPoint (GH-1008, Martin Davis)
- Fix reading WKT with EMPTY token with white space (GH-1025, Mike Taves)
+ - Centroid: Fix crash on polygons with empty holes (GH-1075, Dan Baston)
+ - MinimumClearance: Fix crash on NaN inputs (GH-1082, Dan Baston)
+ - GEOSRelatePatternMatch: Fix crash on invalid DE-9IM pattern (GH-1089, Dan Baston)
## Changes in 3.10.6
2023-11-11
commit 32b27536225c768384ed55ec8f7040b427ecb6de
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Apr 30 18:37:19 2024 -0400
IntersectionMatrix: Ignore patterns longer than 9 characters
Fixes https://github.com/libgeos/geos/issues/1084
diff --git a/src/geom/IntersectionMatrix.cpp b/src/geom/IntersectionMatrix.cpp
index 82acfcf4e..f7ace8a9e 100644
--- a/src/geom/IntersectionMatrix.cpp
+++ b/src/geom/IntersectionMatrix.cpp
@@ -144,7 +144,7 @@ IntersectionMatrix::set(Location row, Location col, int dimensionValue)
void
IntersectionMatrix::set(const std::string& dimensionSymbols)
{
- auto limit = dimensionSymbols.length();
+ auto limit = std::min(dimensionSymbols.length(), static_cast<std::size_t>(9));
for(std::size_t i = 0; i < limit; i++) {
auto row = i / firstDim;
diff --git a/tests/unit/capi/GEOSRelatePatternMatchTest.cpp b/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
index c5f34a40b..b60ab1e18 100644
--- a/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
+++ b/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
@@ -78,5 +78,18 @@ void object::test<5>
ensure_equals(ret, char(0));
}
+// invalid DE-9IM argument
+// https://github.com/libgeos/geos/issues/1084
+template<>
+template<>
+void object::test<6>
+()
+{
+ const char* mat = "0000000000";
+ ensure_equals(strlen(mat), 10u); // not a valid DE-9IM!
+
+ GEOSRelatePatternMatch(mat, "111111111");
+}
+
} // namespace tut
commit 49e7965ab3c2b132f36ef0095f5cdf7bdc852a7f
Author: Daniel Baston <dbaston at gmail.com>
Date: Sat Apr 20 17:53:03 2024 -0400
MinimumClearance: Avoid crash on NaN inputs
Resolves https://github.com/libgeos/geos/issues/1079
diff --git a/src/precision/MinimumClearance.cpp b/src/precision/MinimumClearance.cpp
index 532d11195..120e41414 100644
--- a/src/precision/MinimumClearance.cpp
+++ b/src/precision/MinimumClearance.cpp
@@ -178,6 +178,10 @@ MinimumClearance::compute()
MinClearanceDistance mcd;
auto nearest = tree->nearestNeighbour(mcd);
+ if (nearest.first == nullptr || nearest.second == nullptr) {
+ throw util::GEOSException("Failed to find nearest items");
+ }
+
minClearance = mcd.distance(nearest.first, nearest.second);
const std::vector<Coordinate>* minClearancePtsVec = mcd.getCoordinates();
diff --git a/tests/unit/capi/GEOSMinimumClearanceTest.cpp b/tests/unit/capi/GEOSMinimumClearanceTest.cpp
index f683145da..e0c777afd 100644
--- a/tests/unit/capi/GEOSMinimumClearanceTest.cpp
+++ b/tests/unit/capi/GEOSMinimumClearanceTest.cpp
@@ -120,4 +120,14 @@ void object::test<5>
geos::DoubleInfinity);
}
+template<>
+template<>
+void object::test<6>
+()
+{
+ input_ = GEOSGeom_createPointFromXY(std::numeric_limits<double>::quiet_NaN(), 1);
+ double d;
+ ensure_equals(GEOSMinimumClearance(input_, &d), 2);
+}
+
} // namespace tut
commit 16d443a702daddf076355e960f466b57ad8dbca2
Author: Daniel Baston <dbaston at gmail.com>
Date: Fri Apr 19 19:49:55 2024 -0400
Centroid: Avoid crash with empty hole
Resolves https://github.com/libgeos/geos/issues/1073
diff --git a/src/algorithm/Centroid.cpp b/src/algorithm/Centroid.cpp
index 6dec14cf5..236d892dc 100644
--- a/src/algorithm/Centroid.cpp
+++ b/src/algorithm/Centroid.cpp
@@ -124,6 +124,10 @@ Centroid::addShell(const CoordinateSequence& pts)
void
Centroid::addHole(const CoordinateSequence& pts)
{
+ if (pts.isEmpty()) {
+ return;
+ }
+
bool isPositiveArea = Orientation::isCCW(&pts);
for(std::size_t i = 0, e = pts.size() - 1; i < e; ++i) {
addTriangle(*areaBasePt, pts[i], pts[i + 1], isPositiveArea);
diff --git a/tests/unit/algorithm/CentroidTest.cpp b/tests/unit/algorithm/CentroidTest.cpp
index 2cf3fab55..be3dcc05e 100644
--- a/tests/unit/algorithm/CentroidTest.cpp
+++ b/tests/unit/algorithm/CentroidTest.cpp
@@ -123,5 +123,11 @@ void object::test<5>() {
"POLYGON EMPTY");
}
+template<>
+template<>
+void object::test<6>() {
+ checkCentroid("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0), EMPTY)", 0.5, 0.5);
+}
+
} // namespace tut
-----------------------------------------------------------------------
Summary of changes:
NEWS | 3 +++
src/algorithm/Centroid.cpp | 4 ++++
src/geom/IntersectionMatrix.cpp | 2 +-
src/precision/MinimumClearance.cpp | 4 ++++
tests/unit/algorithm/CentroidTest.cpp | 6 ++++++
tests/unit/capi/GEOSMinimumClearanceTest.cpp | 10 ++++++++++
tests/unit/capi/GEOSRelatePatternMatchTest.cpp | 13 +++++++++++++
7 files changed, 41 insertions(+), 1 deletion(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list