[geos-commits] [SCM] GEOS branch 3.10 updated. ba32d54f981ff0509cbb125d17b9a067135882dd

git at osgeo.org git at osgeo.org
Wed Nov 29 16:47:14 PST 2023


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.10 has been updated
       via  ba32d54f981ff0509cbb125d17b9a067135882dd (commit)
       via  15b81b2e6440a072d08d79a0dcf3b6ad8ab1c1da (commit)
      from  b9d9262fc3f87570889a78040b8592361fe2b9de (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 ba32d54f981ff0509cbb125d17b9a067135882dd
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Wed Nov 29 16:46:53 2023 -0800

    Update NEWS

diff --git a/NEWS b/NEWS
index 885e99ea5..d694136cd 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,8 @@
 - Fixes/Improvements:
   - Fix build on Illumus (GH-971)
   - PointOnSurface crashes with a collection containing a empty linestring (GH-1002, Paul Ramsey)
-
+  - Fix IsSimpleOp for MultiPoint with empty element (GH-1005, Martin Davis)
+  
 ## Changes in 3.10.6
 2023-11-11
 

commit 15b81b2e6440a072d08d79a0dcf3b6ad8ab1c1da
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Wed Nov 29 16:32:47 2023 -0800

    Fix IsSimpleOp for MultiPoint with empty element (#1005)

diff --git a/src/operation/valid/IsSimpleOp.cpp b/src/operation/valid/IsSimpleOp.cpp
index b9f5afd59..83ffe995b 100644
--- a/src/operation/valid/IsSimpleOp.cpp
+++ b/src/operation/valid/IsSimpleOp.cpp
@@ -146,6 +146,8 @@ IsSimpleOp::isSimpleMultiPoint(const MultiPoint& mp)
 
     for (std::size_t i = 0; i < mp.getNumGeometries(); i++) {
         const Point* pt = mp.getGeometryN(i);
+        if (pt->isEmpty())
+            continue;
         const Coordinate* p = pt->getCoordinate();
         if (points.find(*p) != points.end()) {
             nonSimplePts.push_back(*p);
diff --git a/tests/xmltester/tests/general/TestSimple.xml b/tests/xmltester/tests/general/TestSimple.xml
index e8838d124..a75cdb1f8 100644
--- a/tests/xmltester/tests/general/TestSimple.xml
+++ b/tests/xmltester/tests/general/TestSimple.xml
@@ -49,6 +49,14 @@
 </test>
 </case>
 
+<case>
+  <desc>mP - with empty element</desc>
+  <a>
+    MULTIPOINT (EMPTY, (80 220), (160 220))
+  </a>
+<test><op name="isSimple" arg1="A"> true </op></test>
+</case>
+
 <case>
   <desc>L - simple line</desc>
   <a>
@@ -246,7 +254,7 @@
   <desc>mL - intersection between elements at non-vertex</desc>
   <a>
     MULTILINESTRING(
-  (40 140, 160 40),
+  (40 140, 160 40), 
   (160 140, 40 40))
   </a>
 <test>
@@ -260,7 +268,7 @@
   <desc>mL - no intersection between elements</desc>
   <a>
     MULTILINESTRING(
-  (20 160, 20 20),
+  (20 160, 20 20), 
   (100 160, 100 20))
   </a>
 <test>
@@ -273,7 +281,7 @@
 <case>
   <desc>mL - mutual intersection at endpoints only</desc>
   <a>
-    MULTILINESTRING ((60 140, 20 80, 60 40),
+    MULTILINESTRING ((60 140, 20 80, 60 40), 
   (60 40, 100 80, 60 140))
   </a>
 <test>
@@ -286,7 +294,7 @@
 <case>
   <desc>mL - one element is non-simple</desc>
   <a>
-    MULTILINESTRING ((60 40, 140 40, 100 120, 100 0),
+    MULTILINESTRING ((60 40, 140 40, 100 120, 100 0), 
   (100 200, 200 120))
   </a>
 <test>
@@ -299,8 +307,8 @@
 <case>
   <desc>mL - proper intersection between elements at vertex</desc>
   <a>
-    MULTILINESTRING ((40 120, 100 60),
-  (160 120, 100 60),
+    MULTILINESTRING ((40 120, 100 60), 
+  (160 120, 100 60), 
   (40 60, 160 60))
   </a>
 <test>
@@ -313,7 +321,7 @@
 <case>
   <desc>mL - intersection between closed lines</desc>
   <a>
-    MULTILINESTRING ((80 160, 40 220, 40 100, 80 160),
+    MULTILINESTRING ((80 160, 40 220, 40 100, 80 160), 
   (80 160, 120 220, 120 100, 80 160))
   </a>
 <test>
@@ -326,8 +334,8 @@
 <case>
   <desc>mL - intersection between closed and open lines</desc>
   <a>
-    MULTILINESTRING ((80 160, 40 220),
-  (80 160, 120 220, 120 100, 80 160),
+    MULTILINESTRING ((80 160, 40 220), 
+  (80 160, 120 220, 120 100, 80 160), 
   (40 100, 80 160))
   </a>
 <test>
@@ -349,6 +357,14 @@
 </test>
 </case>
 
+<case>
+  <desc>mL - with empty element</desc>
+  <a>
+    MULTILINESTRING ((0 0, 100 100), EMPTY)
+  </a>
+<test><op name="isSimple" arg1="A"> true </op></test>
+</case>
+
 <case>
   <desc>LR - valid ring</desc>
   <a>
@@ -400,7 +416,7 @@
       <op name="isSimple" arg1="A"> false </op>
    </test>
 </case>
-
+  
 <case>
    <desc>A - polygon with equal segments </desc>
    <a>POLYGON ((50 90, 90 90, 90 50, 50 50, 10 10, 50 50, 50 90))</a>
@@ -408,7 +424,7 @@
       <op name="isSimple" arg1="A"> false </op>
    </test>
 </case>
-
+  
 <case>
   <desc>A - empty</desc>
   <a>
@@ -422,8 +438,8 @@
 <case>
   <desc>mA - valid polygon</desc>
   <a>
-    MULTIPOLYGON (((240 160, 140 220, 80 60, 220 40, 240 160)),
-  ((160 380, 100 240, 20 380, 160 380),
+    MULTIPOLYGON (((240 160, 140 220, 80 60, 220 40, 240 160)), 
+  ((160 380, 100 240, 20 380, 160 380), 
     (120 340, 60 360, 80 320, 120 340)))
   </a>
 <test>
@@ -434,8 +450,8 @@
 <case>
   <desc>mA - with touching elements</desc>
   <a>
-    MULTIPOLYGON (((240 160, 100 240, 80 60, 220 40, 240 160)),
-  ((160 380, 100 240, 20 380, 160 380),
+    MULTIPOLYGON (((240 160, 100 240, 80 60, 220 40, 240 160)), 
+  ((160 380, 100 240, 20 380, 160 380), 
     (120 340, 60 360, 80 320, 120 340)))
   </a>
 <test>
@@ -453,12 +469,20 @@ MULTIPOLYGON (((100 100, 100 200, 200 100, 200 200, 100 100)), ((100 400, 200 40
 </test>
 </case>
 
+<case>
+  <desc>mA - with empty element</desc>
+  <a>
+MULTIPOLYGON (((0 10, 10 10, 10 0, 0 0, 0 10)), EMPTY)
+</a>
+<test><op name="isSimple" arg1="A"> true </op></test>
+</case>
+
 <case>
   <desc>GC - all components simple</desc>
   <a>
-GEOMETRYCOLLECTION (POLYGON ((100 200, 200 200, 200 100, 100 100, 100 200)),
-  LINESTRING (100 300, 200 250),
-  POINT (250 250),
+GEOMETRYCOLLECTION (POLYGON ((100 200, 200 200, 200 100, 100 100, 100 200)), 
+  LINESTRING (100 300, 200 250), 
+  POINT (250 250), 
   POINT (250 150))</a>
 <test>
   <op name="isSimple" arg1="A"> true </op>
@@ -468,13 +492,22 @@ GEOMETRYCOLLECTION (POLYGON ((100 200, 200 200, 200 100, 100 100, 100 200)),
 <case>
   <desc>GC - one non-simple component</desc>
   <a>
-GEOMETRYCOLLECTION (POLYGON ((100 100, 100 200, 200 100, 200 200, 100 100)),
-  LINESTRING (100 300, 200 250),
-  POINT (250 250),
+GEOMETRYCOLLECTION (POLYGON ((100 100, 100 200, 200 100, 200 200, 100 100)), 
+  LINESTRING (100 300, 200 250), 
+  POINT (250 250), 
   POINT (250 150))</a>
 <test>
   <op name="isSimple" arg1="A"> false </op>
 </test>
 </case>
 
+<case>
+  <desc>GC - with empty element</desc>
+  <a>
+GEOMETRYCOLLECTION (POLYGON ((0 10, 10 10, 10 0, 0 0, 0 10)), 
+  LINESTRING (100 300, 200 250), 
+  POINT EMPTY)</a>
+<test><op name="isSimple" arg1="A"> true </op></test>
+</case>
+
 </run>

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

Summary of changes:
 NEWS                                         |  3 +-
 src/operation/valid/IsSimpleOp.cpp           |  2 +
 tests/xmltester/tests/general/TestSimple.xml | 75 ++++++++++++++++++++--------
 3 files changed, 58 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list