[geos-commits] [SCM] GEOS branch 3.13 updated. 4f293e17469fe4abf6a5dcf398713c9d914377f2
git at osgeo.org
git at osgeo.org
Sun Nov 24 17:59:34 PST 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.13 has been updated
via 4f293e17469fe4abf6a5dcf398713c9d914377f2 (commit)
via 782bec075b3d0b9a2cf6df79e020356dc8eb62e6 (commit)
from 25854d3f8053fa38fbccdc6fc09e022e98ab5432 (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 4f293e17469fe4abf6a5dcf398713c9d914377f2
Author: Martin Davis <mtnclimb at gmail.com>
Date: Sun Nov 24 17:59:12 2024 -0800
Update NEWS
diff --git a/NEWS.md b/NEWS.md
index 31d66733d..ee8ab3733 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -8,6 +8,7 @@
- Fix TopologyPreservingSimplifier/TaggedLineString to avoid jumping components (JTS-1096, Martin Davis)
- Fix WKTWriter for small precisions and with trim enabled (GH-1199, Mike Taves)
- Fix BufferOp to increase length of segments removed by heuristic (GH-1200, Martin Davis)
+ - Improve RelateNG performance for A/L cases in prepared predicates (GH-1201, Martin Davis)
## Changes in 3.13.0
2024-09-06
commit 782bec075b3d0b9a2cf6df79e020356dc8eb62e6
Author: Martin Davis <mtnclimb at gmail.com>
Date: Sun Nov 24 17:55:11 2024 -0800
Improve RelateNG performance for A/L cases in prepared predicates (#1201)
diff --git a/include/geos/operation/relateng/RelateGeometry.h b/include/geos/operation/relateng/RelateGeometry.h
index 53adf01b1..9cb43797c 100644
--- a/include/geos/operation/relateng/RelateGeometry.h
+++ b/include/geos/operation/relateng/RelateGeometry.h
@@ -171,6 +171,10 @@ public:
case Dimension::A: return hasAreas;
}
return false;
+ }
+
+ bool hasAreaAndLine() const {
+ return hasAreas && hasLines;
}
/**
diff --git a/src/operation/relateng/TopologyComputer.cpp b/src/operation/relateng/TopologyComputer.cpp
index 0b6782e42..e911bc6f8 100644
--- a/src/operation/relateng/TopologyComputer.cpp
+++ b/src/operation/relateng/TopologyComputer.cpp
@@ -132,11 +132,16 @@ TopologyComputer::getDimension(bool isA) const
bool
TopologyComputer::isSelfNodingRequired() const
{
- if (predicate.requireSelfNoding()) {
- if (geomA.isSelfNodingRequired() ||
- geomB.isSelfNodingRequired())
- return true;
- }
+ if (! predicate.requireSelfNoding())
+ return false;
+
+ if (geomA.isSelfNodingRequired())
+ return true;
+
+ //-- if B is a mixed GC with A and L require full noding
+ if (geomB.hasAreaAndLine())
+ return true;
+
return false;
}
diff --git a/tests/unit/operation/relateng/RelateNGGCTest.cpp b/tests/unit/operation/relateng/RelateNGGCTest.cpp
index c8405328a..7e78401c2 100644
--- a/tests/unit/operation/relateng/RelateNGGCTest.cpp
+++ b/tests/unit/operation/relateng/RelateNGGCTest.cpp
@@ -320,6 +320,10 @@ void object::test<23> ()
std::string a = "POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))";
std::string b = "GEOMETRYCOLLECTION (POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0)), MULTIPOINT ((0 2), (0 5)))";
checkEquals(a, b, true);
+ checkContainsWithin(a, b, true);
+ checkCoversCoveredBy(a, b, true);
+ checkContainsWithin(b, a, true);
+ checkCoversCoveredBy(b, a, true);
}
@@ -331,6 +335,10 @@ void object::test<24> ()
std::string a = "POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))";
std::string b = "GEOMETRYCOLLECTION (POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0)), LINESTRING (0 2, 0 5))";
checkEquals(a, b, true);
+ checkContainsWithin(a, b, true);
+ checkCoversCoveredBy(a, b, true);
+ checkContainsWithin(b, a, true);
+ checkCoversCoveredBy(b, a, true);
}
@@ -341,7 +349,10 @@ void object::test<25> ()
std::string a = "POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))";
std::string b = "GEOMETRYCOLLECTION (POLYGON((0 0, 10 0, 10 10, 0 10, 0 0)),LINESTRING(0 2, 0 5, 5 5))";
checkEquals(a, b, true);
-}
+ checkContainsWithin(a, b, true);
+ checkCoversCoveredBy(a, b, true);
+ checkContainsWithin(b, a, true);
+ checkCoversCoveredBy(b, a, true);}
diff --git a/tests/xmltester/tests/general/TestRelateGC.xml b/tests/xmltester/tests/general/TestRelateGC.xml
index f67b789a0..a83444a01 100644
--- a/tests/xmltester/tests/general/TestRelateGC.xml
+++ b/tests/xmltester/tests/general/TestRelateGC.xml
@@ -574,6 +574,17 @@ GEOMETRYCOLLECTION (POLYGON ((1 9, 5 9, 6 6, 1 5, 1 9), (2 6, 4 8, 6 6, 2 6)), P
<test><op name="overlaps" arg1="A" arg2="B"> false </op></test>
<test><op name="touches" arg1="A" arg2="B"> false </op></test>
<test><op name="within" arg1="A" arg2="B"> true </op></test>
+
+ <test><op name="contains" arg1="B" arg2="A"> true </op></test>
+ <test><op name="coveredBy" arg1="B" arg2="A"> true </op></test>
+ <test><op name="covers" arg1="B" arg2="A"> true </op></test>
+ <test><op name="crosses" arg1="B" arg2="A"> false </op></test>
+ <test><op name="disjoint" arg1="B" arg2="A"> false </op></test>
+ <test><op name="equalsTopo" arg1="B" arg2="A"> true </op></test>
+ <test><op name="intersects" arg1="B" arg2="A"> true </op></test>
+ <test><op name="overlaps" arg1="B" arg2="A"> false </op></test>
+ <test><op name="touches" arg1="B" arg2="A"> false </op></test>
+ <test><op name="within" arg1="B" arg2="A"> true </op></test>
</case>
<case>
@@ -596,6 +607,17 @@ GEOMETRYCOLLECTION (POLYGON ((1 9, 5 9, 6 6, 1 5, 1 9), (2 6, 4 8, 6 6, 2 6)), P
<test><op name="overlaps" arg1="A" arg2="B"> false </op></test>
<test><op name="touches" arg1="A" arg2="B"> false </op></test>
<test><op name="within" arg1="A" arg2="B"> true </op></test>
+
+ <test><op name="contains" arg1="B" arg2="A"> true </op></test>
+ <test><op name="coveredBy" arg1="B" arg2="A"> true </op></test>
+ <test><op name="covers" arg1="B" arg2="A"> true </op></test>
+ <test><op name="crosses" arg1="B" arg2="A"> false </op></test>
+ <test><op name="disjoint" arg1="B" arg2="A"> false </op></test>
+ <test><op name="equalsTopo" arg1="B" arg2="A"> true </op></test>
+ <test><op name="intersects" arg1="B" arg2="A"> true </op></test>
+ <test><op name="overlaps" arg1="B" arg2="A"> false </op></test>
+ <test><op name="touches" arg1="B" arg2="A"> false </op></test>
+ <test><op name="within" arg1="B" arg2="A"> true </op></test>
</case>
</run>
-----------------------------------------------------------------------
Summary of changes:
NEWS.md | 1 +
include/geos/operation/relateng/RelateGeometry.h | 4 ++++
src/operation/relateng/TopologyComputer.cpp | 15 ++++++++++-----
tests/unit/operation/relateng/RelateNGGCTest.cpp | 13 ++++++++++++-
tests/xmltester/tests/general/TestRelateGC.xml | 22 ++++++++++++++++++++++
5 files changed, 49 insertions(+), 6 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list