[geos-commits] [SCM] GEOS branch master updated. 0eb1c4cfce5ce66c3cd9e6924cf56b1364f1bbfc

git at osgeo.org git at osgeo.org
Tue Sep 8 14:50:48 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  0eb1c4cfce5ce66c3cd9e6924cf56b1364f1bbfc (commit)
      from  40e89b9f4d0c2caf35b433d3df823d423eddc932 (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 0eb1c4cfce5ce66c3cd9e6924cf56b1364f1bbfc
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Sep 8 14:14:35 2020 -0700

    Port https://github.com/dr-jts/jts/commit/ea45557987f4e992094842e7badde65811ea75cd, Cleanup of mixed result logic

diff --git a/include/geos/operation/overlayng/OverlayNG.h b/include/geos/operation/overlayng/OverlayNG.h
index d25a6f0..96ff5fc 100644
--- a/include/geos/operation/overlayng/OverlayNG.h
+++ b/include/geos/operation/overlayng/OverlayNG.h
@@ -126,7 +126,7 @@ public:
     static constexpr int UNION          = overlay::OverlayOp::opUNION;
     static constexpr int DIFFERENCE     = overlay::OverlayOp::opDIFFERENCE;
     static constexpr int SYMDIFFERENCE  = overlay::OverlayOp::opSYMDIFFERENCE;
-    static constexpr bool ALLOW_INT_MIXED_INT_RESULT = true;
+    static constexpr bool ALLOW_INT_MIXED_RESULT = true;
 
     /**
     * Creates an overlay operation on the given geometries,
diff --git a/src/operation/overlayng/LineBuilder.cpp b/src/operation/overlayng/LineBuilder.cpp
index ea0773b..f2fdd86 100644
--- a/src/operation/overlayng/LineBuilder.cpp
+++ b/src/operation/overlayng/LineBuilder.cpp
@@ -76,7 +76,7 @@ LineBuilder::isResultLine(const OverlayLabel* lbl) const
         return false;
 
 
-    if (OverlayNG::ALLOW_INT_MIXED_INT_RESULT &&
+    if (OverlayNG::ALLOW_INT_MIXED_RESULT &&
         opCode == OverlayNG::INTERSECTION &&
         lbl->isBoundaryTouch()) {
         return true;
diff --git a/src/operation/overlayng/OverlayNG.cpp b/src/operation/overlayng/OverlayNG.cpp
index 096f07e..96da319 100644
--- a/src/operation/overlayng/OverlayNG.cpp
+++ b/src/operation/overlayng/OverlayNG.cpp
@@ -234,25 +234,25 @@ OverlayNG::extractResult(int p_opCode, OverlayGraph* graph)
     std::vector<OverlayEdge*> resultAreaEdges = graph->getResultAreaEdges();
     PolygonBuilder polyBuilder(resultAreaEdges, geomFact);
     std::vector<std::unique_ptr<Polygon>> resultPolyList = polyBuilder.getPolygons();
-    bool hasResultComponents = resultPolyList.size() > 0;
+    bool hasResultAreaComponents = resultPolyList.size() > 0;
 
     //--- Build lines
-    bool allowMixedIntResult = ! hasResultComponents || ALLOW_INT_MIXED_INT_RESULT;
     std::vector<std::unique_ptr<LineString>> resultLineList;
-    if (p_opCode != INTERSECTION || allowMixedIntResult) {
-        LineBuilder lineBuilder(&inputGeom, graph, hasResultComponents, p_opCode, geomFact);
+    bool allowResultLines = ! hasResultAreaComponents || ALLOW_INT_MIXED_RESULT;
+    if(allowResultLines) {
+        LineBuilder lineBuilder(&inputGeom, graph, hasResultAreaComponents, p_opCode, geomFact);
         resultLineList = lineBuilder.getLines();
     }
 
-    hasResultComponents = hasResultComponents || resultLineList.size() > 0;
+    bool hasResultComponents = hasResultAreaComponents || resultLineList.size() > 0;
     /**
-     * Since operations with point inputs are handled elsewhere,
-     * this only handles the case where non-point inputs
-     * intersect in points.
+     * Operations with point inputs are handled elsewhere.
+     * Only an intersection op can produce point results
+     * from non-point inputs.
      */
     std::vector<std::unique_ptr<Point>> resultPointList;
-    allowMixedIntResult = ! hasResultComponents || ALLOW_INT_MIXED_INT_RESULT;
-    if (opCode == INTERSECTION && allowMixedIntResult) {
+    bool allowResultPoints = ! hasResultComponents || ALLOW_INT_MIXED_RESULT;
+    if (opCode == INTERSECTION && allowResultPoints) {
         IntersectionPointBuilder pointBuilder(graph, geomFact);
         resultPointList = pointBuilder.getPoints();
     }

-----------------------------------------------------------------------

Summary of changes:
 include/geos/operation/overlayng/OverlayNG.h |  2 +-
 src/operation/overlayng/LineBuilder.cpp      |  2 +-
 src/operation/overlayng/OverlayNG.cpp        | 20 ++++++++++----------
 3 files changed, 12 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list