[geos-commits] [SCM] GEOS branch master updated. 675a2905e3cac127b8795ea0dde586e06096f32a
git at osgeo.org
git at osgeo.org
Tue Sep 8 17:44:19 PDT 2020
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, master has been updated
via 675a2905e3cac127b8795ea0dde586e06096f32a (commit)
from 0eb1c4cfce5ce66c3cd9e6924cf56b1364f1bbfc (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 675a2905e3cac127b8795ea0dde586e06096f32a
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Sep 8 17:22:29 2020 -0700
Port https://github.com/dr-jts/jts/commit/959a61dcf5c5bb993e9de462f316b14e5c564ed7, Add optimization for line building
diff --git a/include/geos/operation/overlayng/OverlayLabel.h b/include/geos/operation/overlayng/OverlayLabel.h
index a184fcc..73077b7 100644
--- a/include/geos/operation/overlayng/OverlayLabel.h
+++ b/include/geos/operation/overlayng/OverlayLabel.h
@@ -194,6 +194,12 @@ public:
bool isLineLocationUnknown(int index) const;
/**
+ * Tests whether a label is for an edge which is a boundary of one geometry
+ * and not part of the other.
+ */
+ bool isBoundarySingleton() const;
+
+ /**
* Tests if a line edge is inside
* @param index
* @return
diff --git a/src/operation/overlayng/LineBuilder.cpp b/src/operation/overlayng/LineBuilder.cpp
index f2fdd86..3306a04 100644
--- a/src/operation/overlayng/LineBuilder.cpp
+++ b/src/operation/overlayng/LineBuilder.cpp
@@ -68,6 +68,13 @@ bool
LineBuilder::isResultLine(const OverlayLabel* lbl) const
{
/**
+ * An edge which is a boundary of a single geometry cannot form a line result.
+ * This is a short-circuit for area edges if no collapses or lines are present.
+ */
+ if (lbl->isBoundarySingleton())
+ return false;
+
+ /**
* Edges which are collapses along boundaries are not output.
* I.e a result line edge must be from a input line
* or two coincident area boundaries.
diff --git a/src/operation/overlayng/MaximalEdgeRing.cpp b/src/operation/overlayng/MaximalEdgeRing.cpp
index b42862c..cba6577 100644
--- a/src/operation/overlayng/MaximalEdgeRing.cpp
+++ b/src/operation/overlayng/MaximalEdgeRing.cpp
@@ -93,11 +93,11 @@ MaximalEdgeRing::attachEdges(OverlayEdge* p_startEdge)
OverlayEdge* edge = p_startEdge;
do {
if (edge == nullptr)
- throw util::TopologyException("Found null edge in ring");
+ throw util::TopologyException("Ring edge is null");
if (edge->getEdgeRingMax() == this)
- throw util::TopologyException("Edge visited twice during ring-building", edge->getCoordinate());
+ throw util::TopologyException("Ring edge visited twice", edge->getCoordinate());
if (edge->nextResultMax() == nullptr) {
- throw util::TopologyException("Found null edge in ring", edge->dest());
+ throw util::TopologyException("Ring edge missing", edge->dest());
}
edge->setEdgeRingMax(this);
edge = edge->nextResultMax();
diff --git a/src/operation/overlayng/OverlayLabel.cpp b/src/operation/overlayng/OverlayLabel.cpp
index c3ce312..385dab3 100644
--- a/src/operation/overlayng/OverlayLabel.cpp
+++ b/src/operation/overlayng/OverlayLabel.cpp
@@ -206,6 +206,21 @@ OverlayLabel::isBoundary(int index) const
/*public*/
bool
+OverlayLabel::isBoundarySingleton() const
+{
+ if (aDim == DIM_BOUNDARY && bDim == DIM_NOT_PART) {
+ return true;
+ }
+
+ if (bDim == DIM_BOUNDARY && aDim == DIM_NOT_PART) {
+ return true;
+ }
+
+ return false;
+}
+
+/*public*/
+bool
OverlayLabel::isLineLocationUnknown(int index) const
{
if (index == 0) {
-----------------------------------------------------------------------
Summary of changes:
include/geos/operation/overlayng/OverlayLabel.h | 6 ++++++
src/operation/overlayng/LineBuilder.cpp | 7 +++++++
src/operation/overlayng/MaximalEdgeRing.cpp | 6 +++---
src/operation/overlayng/OverlayLabel.cpp | 15 +++++++++++++++
4 files changed, 31 insertions(+), 3 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list