[geos-commits] [SCM] GEOS branch main updated. c985b1ccc4babd9f7500ccf84d50d3bfcc60fc40
git at osgeo.org
git at osgeo.org
Thu Aug 15 13:33:39 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, main has been updated
via c985b1ccc4babd9f7500ccf84d50d3bfcc60fc40 (commit)
via 8405fcb5225da4e9a269f643473bb26695920f3b (commit)
from 3f9a70ac74e3c605ff6612f3d87a94d6c04c589c (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 c985b1ccc4babd9f7500ccf84d50d3bfcc60fc40
Merge: 8405fcb52 3f9a70ac7
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Thu Aug 15 13:33:01 2024 -0700
Merge branch 'main' of github.com:libgeos/geos
commit 8405fcb5225da4e9a269f643473bb26695920f3b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Thu Aug 15 13:32:45 2024 -0700
Use TemplateSTRTree for pair finding in tree, per @dbaston
diff --git a/include/geos/index/chain/MonotoneChain.h b/include/geos/index/chain/MonotoneChain.h
index d6b1b1ad6..a5172f9d7 100644
--- a/include/geos/index/chain/MonotoneChain.h
+++ b/include/geos/index/chain/MonotoneChain.h
@@ -151,9 +151,6 @@ public:
return context;
}
- void setId(int p_id) { id = p_id; }
- int getId() const { return id; }
-
private:
void computeSelect(const geom::Envelope& searchEnv,
@@ -201,9 +198,6 @@ private:
/// Owned by this class
mutable geom::Envelope env;
- /// Useful for optimizing chain comparisons
- int id = 0;
-
};
} // namespace geos::index::chain
diff --git a/include/geos/operation/relateng/EdgeSetIntersector.h b/include/geos/operation/relateng/EdgeSetIntersector.h
index 70b6cb315..35028b5bd 100644
--- a/include/geos/operation/relateng/EdgeSetIntersector.h
+++ b/include/geos/operation/relateng/EdgeSetIntersector.h
@@ -59,7 +59,7 @@ private:
// HPRtree index = new HPRtree();
const Envelope* envelope = nullptr;
std::deque<MonotoneChain> monoChains;
- int idCounter = 0;
+ std::size_t overlapCounter = 0;
// Methods
@@ -76,7 +76,6 @@ public:
std::vector<const SegmentString*>& edgesB,
const Envelope* env)
: envelope(env)
- , idCounter(0)
{
addEdges(edgesA);
addEdges(edgesB);
diff --git a/src/operation/relateng/EdgeSetIntersector.cpp b/src/operation/relateng/EdgeSetIntersector.cpp
index 37b3600b8..63332acf1 100644
--- a/src/operation/relateng/EdgeSetIntersector.cpp
+++ b/src/operation/relateng/EdgeSetIntersector.cpp
@@ -22,6 +22,7 @@
#include <geos/operation/relateng/RelateSegmentString.h>
#include <geos/index/chain/MonotoneChain.h>
#include <geos/index/chain/MonotoneChainBuilder.h>
+#include <geos/util/Interrupt.h>
using geos::geom::Geometry;
@@ -54,7 +55,7 @@ EdgeSetIntersector::addToIndex(const SegmentString* segStr)
for (MonotoneChain& mc : segChains) {
if (envelope == nullptr || envelope->intersects(mc.getEnvelope())) {
- mc.setId(idCounter++);
+ // mc.setId(idCounter++);
monoChains.push_back(mc);
MonotoneChain* mcPtr = &(monoChains.back());
index.insert(mcPtr->getEnvelope(), mcPtr);
@@ -68,26 +69,19 @@ EdgeSetIntersector::process(EdgeSegmentIntersector& intersector)
{
EdgeSegmentOverlapAction overlapAction(intersector);
- for (const MonotoneChain& queryChain : monoChains) {
+ // Replaces JTS implementation that manually iterates on the
+ // monoChains with the automatic queryPairs method in TemplateSTRTree
+ index.queryPairs([this, &overlapAction, &intersector](const MonotoneChain* queryChain, const MonotoneChain* testChain) {
- std::vector<const MonotoneChain*> overlapChains;
- index.query(queryChain.getEnvelope(), [&overlapChains](const MonotoneChain* mc) {
- overlapChains.push_back(mc);
- });
+ if (overlapCounter++ % 100000 == 0)
+ GEOS_CHECK_FOR_INTERRUPTS();
- for (const MonotoneChain* testChain : overlapChains) {
- /**
- * following test makes sure we only compare each pair of chains once
- * and that we don't compare a chain to itself
- */
- if (testChain->getId() <= queryChain.getId())
- continue;
+ testChain->computeOverlaps(queryChain, &overlapAction);
+
+ if (intersector.isDone())
+ return;
+ });
- testChain->computeOverlaps(&queryChain, &overlapAction);
- if (intersector.isDone())
- return;
- }
- }
}
-----------------------------------------------------------------------
Summary of changes:
include/geos/index/chain/MonotoneChain.h | 6 -----
.../geos/operation/relateng/EdgeSetIntersector.h | 3 +--
src/operation/relateng/EdgeSetIntersector.cpp | 30 +++++++++-------------
3 files changed, 13 insertions(+), 26 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list