[geos-commits] [SCM] GEOS branch main updated. 21d41a72a198b2a470b73dc83c6adfbcceffcbeb
git at osgeo.org
git at osgeo.org
Mon Jun 1 09:11:58 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 21d41a72a198b2a470b73dc83c6adfbcceffcbeb (commit)
from 5ed4cd8dce266c07f962f42fa7b8fc57288067bb (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 21d41a72a198b2a470b73dc83c6adfbcceffcbeb
Author: Daniel Baston <dbaston at gmail.com>
Date: Mon Jun 1 12:11:34 2026 -0400
RectangleIntersects: guard against curved inputs (#1442)
diff --git a/src/operation/predicate/RectangleIntersects.cpp b/src/operation/predicate/RectangleIntersects.cpp
index c31fe8ce9..04fd166a8 100644
--- a/src/operation/predicate/RectangleIntersects.cpp
+++ b/src/operation/predicate/RectangleIntersects.cpp
@@ -31,9 +31,11 @@
#include <geos/geom/Location.h>
#include <geos/algorithm/locate/SimplePointInAreaLocator.h>
+#include <geos/util.h>
#include <memory>
+
//using namespace geos::geom::util;
namespace geos {
@@ -282,6 +284,8 @@ public:
bool
RectangleIntersects::intersects(const geom::Geometry& geom)
{
+ util::ensureNoCurvedComponents(geom);
+
if(!rectEnv.intersects(geom.getEnvelopeInternal())) {
return false;
}
diff --git a/tests/unit/capi/GEOSIntersectsTest.cpp b/tests/unit/capi/GEOSIntersectsTest.cpp
index fe11fd70e..1beea562a 100644
--- a/tests/unit/capi/GEOSIntersectsTest.cpp
+++ b/tests/unit/capi/GEOSIntersectsTest.cpp
@@ -256,5 +256,18 @@ void object::test<13>()
ensure_equals(GEOSIntersects(geom2_, geom1_), 0);
}
+template<>
+template<>
+void object::test<14>()
+{
+ set_test_name("curved geometries not supported by RectangleIntersects");
+
+ geom1_ = fromWKT("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))");
+ geom2_ = fromWKT("CIRCULARSTRING (5 0, 10 5, 15 0)");
+
+ ensure_equals(GEOSIntersects(geom1_, geom2_), 2);
+ ensure_equals(GEOSIntersects(geom2_, geom1_), 2);
+}
+
} // namespace tut
-----------------------------------------------------------------------
Summary of changes:
src/operation/predicate/RectangleIntersects.cpp | 4 ++++
tests/unit/capi/GEOSIntersectsTest.cpp | 13 +++++++++++++
2 files changed, 17 insertions(+)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list