[geos-commits] [SCM] GEOS branch main updated. f3d2096ff11494f60a07aa7d0c44a722f3709d04

git at osgeo.org git at osgeo.org
Tue Aug 20 15:20:22 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  f3d2096ff11494f60a07aa7d0c44a722f3709d04 (commit)
      from  97a079ae411f116b946357ad5da234502417c578 (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 f3d2096ff11494f60a07aa7d0c44a722f3709d04
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Aug 20 15:19:33 2024 -0700

    Port JTS commit
    https://github.com/locationtech/jts/commit/7c2627093f7d876167d651bf132a8500d428aa5f

diff --git a/include/geos/operation/relateng/RelateGeometry.h b/include/geos/operation/relateng/RelateGeometry.h
index 936c03be0..fa3fd812f 100644
--- a/include/geos/operation/relateng/RelateGeometry.h
+++ b/include/geos/operation/relateng/RelateGeometry.h
@@ -207,7 +207,7 @@ public:
      * Indicates whether the geometry requires self-noding
      * for correct evaluation of specific spatial predicates.
      * Self-noding is required for geometries which may self-cross
-     * - i.e. lines, and overlapping polygons in GeometryCollections.
+     * - i.e. lines, and overlapping elements in GeometryCollections.
      * Self-noding is not required for polygonal geometries,
      * since they can only touch at vertices.
      * This ensures that the coordinates of nodes created by
diff --git a/include/geos/operation/relateng/TopologyComputer.h b/include/geos/operation/relateng/TopologyComputer.h
index e0a474c38..92f382c0c 100644
--- a/include/geos/operation/relateng/TopologyComputer.h
+++ b/include/geos/operation/relateng/TopologyComputer.h
@@ -155,16 +155,13 @@ public:
     /**
      * Indicates whether the input geometries require self-noding
      * for correct evaluation of specific spatial predicates.
-     * Self-noding is required for geometries which may self-cross
-     * - i.e. lines, and overlapping polygons in GeometryCollections.
-     * Self-noding is not required for polygonal geometries,
-     * since they can only touch at vertices.
-     * This ensures that the coordinates of nodes created by
-     * crossing segments are computed explicitly.
+     * Self-noding is required for geometries which may
+     * have self-crossing linework.
+     * This causes the coordinates of nodes created by
+     * crossing segments to be computed explicitly.
      * This ensures that node locations match in situations
      * where a self-crossing and mutual crossing occur at the same logical location.
-     * E.g. a self-crossing line tested against a single segment
-     * identical to one of the crossed segments.
+     * The canonical example is a self-crossing line tested against a single segment     * identical to one of the crossed segments.
      *
      * @return true if self-noding is required
      */
diff --git a/src/operation/relateng/RelateGeometry.cpp b/src/operation/relateng/RelateGeometry.cpp
index 9c3aa3e84..d7d1b0116 100644
--- a/src/operation/relateng/RelateGeometry.cpp
+++ b/src/operation/relateng/RelateGeometry.cpp
@@ -245,7 +245,7 @@ RelateGeometry::isSelfNodingRequired() const
     {
          return false;
      }
-    //-- GC with a single polygon does not need noding
+    //-- a GC with a single polygon does not need noding
     if (hasAreas && geom->getNumGeometries() == 1)
         return false;
     return true;
diff --git a/src/operation/relateng/TopologyComputer.cpp b/src/operation/relateng/TopologyComputer.cpp
index 006873a13..bcfdcbc62 100644
--- a/src/operation/relateng/TopologyComputer.cpp
+++ b/src/operation/relateng/TopologyComputer.cpp
@@ -132,9 +132,12 @@ TopologyComputer::getDimension(bool isA) const
 bool
 TopologyComputer::isSelfNodingRequired() const
 {
-    if (geomA.isSelfNodingRequired()) return true;
-    if (geomB.isSelfNodingRequired()) return true;
-    return predicate.requireSelfNoding();
+    if (predicate.requireSelfNoding()) {
+        if (geomA.isSelfNodingRequired() ||
+            geomB.isSelfNodingRequired())
+        return true;
+    }
+    return false;
 }
 
 
diff --git a/tests/xmltester/tests/misc/InvalidRelates.xml b/tests/xmltester/tests/misc/InvalidRelates.xml
index 69b80bdd6..1f17bb367 100644
--- a/tests/xmltester/tests/misc/InvalidRelates.xml
+++ b/tests/xmltester/tests/misc/InvalidRelates.xml
@@ -48,12 +48,12 @@
       LINESTRING(40 180, 140 180)
     </a>
     <b>
-      MULTIPOLYGON(
-      ((20 320, 180 320, 180 180, 20 180, 20 320)),
-      ((60 180, 60 80, 180 80, 180 180, 60 180)))
+      GEOMETRYCOLLECTION(
+      POLYGON((20 320, 180 320, 180 180, 20 180, 20 320)),
+      POLYGON((60 180, 60 80, 180 80, 180 180, 60 180)))
     </b>
     <test>
-      <op arg1="A" arg2="B" arg3="111F0F212" name="relate">true</op>
+      <op arg1="A" arg2="B" arg3="11F00F212" name="relate">true</op>
     </test>
   </case>
 

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

Summary of changes:
 include/geos/operation/relateng/RelateGeometry.h   |  2 +-
 include/geos/operation/relateng/TopologyComputer.h | 13 +++++--------
 src/operation/relateng/RelateGeometry.cpp          |  2 +-
 src/operation/relateng/TopologyComputer.cpp        |  9 ++++++---
 tests/xmltester/tests/misc/InvalidRelates.xml      |  8 ++++----
 5 files changed, 17 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list