[geos-commits] [SCM] GEOS branch 3.9 updated. acefb04aac1352add0449bc7e6f38af5093134ce

git at osgeo.org git at osgeo.org
Mon Feb 8 19:28:25 PST 2021


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.9 has been updated
       via  acefb04aac1352add0449bc7e6f38af5093134ce (commit)
      from  4bbcd9cecf435d4fe3a14f7042cd3386deed9dfb (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 acefb04aac1352add0449bc7e6f38af5093134ce
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Mon Feb 8 17:15:58 2021 -0800

    Fix OverlayNG handling of flat interior line

diff --git a/src/operation/overlayng/OverlayUtil.cpp b/src/operation/overlayng/OverlayUtil.cpp
index b424933..eb6f3a8 100644
--- a/src/operation/overlayng/OverlayUtil.cpp
+++ b/src/operation/overlayng/OverlayUtil.cpp
@@ -48,6 +48,10 @@ OverlayUtil::safeExpandDistance(const Envelope* env, const PrecisionModel* pm)
     if (isFloating(pm)) {
         // if PM is FLOAT then there is no scale factor, so add 10%
         double minSize = std::min(env->getHeight(), env->getWidth());
+        // heuristic to ensure zero-width envelopes don't cause total clipping
+        if (minSize <= 0.0) {
+            minSize = std::max(env->getHeight(), env->getWidth());
+        }
         envExpandDist = SAFE_ENV_BUFFER_FACTOR * minSize;
     }
     else {
diff --git a/tests/unit/operation/overlayng/OverlayNGTest.cpp b/tests/unit/operation/overlayng/OverlayNGTest.cpp
index b753159..ce73231 100644
--- a/tests/unit/operation/overlayng/OverlayNGTest.cpp
+++ b/tests/unit/operation/overlayng/OverlayNGTest.cpp
@@ -553,10 +553,33 @@ template<>
 template<>
 void object::test<43> ()
 {
+    set_test_name("testPolygonLineIntersectionOrder");
     std::string a = "POLYGON ((1 1, 1 9, 9 9, 9 7, 3 7, 3 3, 9 3, 9 1, 1 1))";
     std::string b = "MULTILINESTRING ((2 10, 2 0), (4 10, 4 0))";
     std::string exp = "MULTILINESTRING ((2 9, 2 1), (4 9, 4 7), (4 3, 4 1))";
     testOverlay(a, b, exp, OverlayNG::INTERSECTION, 0);
 }
 
+template<>
+template<>
+void object::test<44> ()
+{
+    set_test_name("testPolygonLineVerticalntersection");
+    std::string a = "POLYGON ((-200 -200, 200 -200, 200 200, -200 200, -200 -200))";
+    std::string b = "LINESTRING (-100 100, -100 -100)";
+    std::string exp = "LINESTRING (-100 100, -100 -100)";
+    testOverlay(a, b, exp, OverlayNG::INTERSECTION, 0);
+}
+
+template<>
+template<>
+void object::test<45> ()
+{
+    set_test_name("testPolygonLineHorizontalIntersection");
+    std::string a = "POLYGON ((10 90, 90 90, 90 10, 10 10, 10 90))";
+    std::string b = "LINESTRING (20 50, 80 50)";
+    std::string exp = "LINESTRING (20 50, 80 50)";
+    testOverlay(a, b, exp, OverlayNG::INTERSECTION, 0);
+}
+
 } // namespace tut
diff --git a/tests/xmltester/tests/general/TestNGOverlayL.xml b/tests/xmltester/tests/general/TestNGOverlayL.xml
index a928edf..4ec2fab 100644
--- a/tests/xmltester/tests/general/TestNGOverlayL.xml
+++ b/tests/xmltester/tests/general/TestNGOverlayL.xml
@@ -205,6 +205,31 @@ MULTILINESTRING ((150 150, 200 200, 300 300, 400 200), (100 100, 150 150), (190
 </case>
 
 <case>
+  <desc>LA - vertical Line</desc>
+  <a>
+    LINESTRING (50 50, 50 20)
+  </a>
+  <b>
+    POLYGON ((10 60, 90 60, 90 10, 10 10, 10 60))
+  </b>
+<test>  <op name="intersectionNG" arg1="A" arg2="B">
+LINESTRING (50 50, 50 20)
+  </op></test>
+<test>  <op name="unionNG" arg1="A" arg2="B">
+POLYGON ((90 60, 90 10, 10 10, 10 60, 90 60))
+  </op></test>
+<test>  <op name="differenceNG" arg1="A" arg2="B">
+LINESTRING EMPTY
+  </op></test>
+<test>  <op name="differenceNG" arg1="B" arg2="A">
+POLYGON ((90 60, 90 10, 10 10, 10 60, 90 60))
+  </op></test>
+<test>  <op name="symdifferenceNG" arg1="A" arg2="B">
+POLYGON ((90 60, 90 10, 10 10, 10 60, 90 60))
+  </op></test>
+</case>
+
+<case>
   <desc>mLmA - disjoint and overlaps in lines and points</desc>
   <a>
 MULTILINESTRING ((50 150, 150 150), (100 350, 200 350), (320 350, 350 350), (300 150, 400 150), (150 300, 400 300))

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

Summary of changes:
 src/operation/overlayng/OverlayUtil.cpp          |  4 ++++
 tests/unit/operation/overlayng/OverlayNGTest.cpp | 23 ++++++++++++++++++++++
 tests/xmltester/tests/general/TestNGOverlayL.xml | 25 ++++++++++++++++++++++++
 3 files changed, 52 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list