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

git at osgeo.org git at osgeo.org
Tue Jun 27 08:30:49 PDT 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  eca8bc67e7767b30610b357f10a4fcd96480e655 (commit)
      from  aad507317fee68dbd85ae1c0c4f632a603ae67b8 (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 eca8bc67e7767b30610b357f10a4fcd96480e655
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Jun 19 14:56:42 2023 -0700

    Catch Mixed-Dimension case and handle (#926)
    
    Catch mixed-dim exception and dump to old overlay code, add test for old mixed-dim behaviour

diff --git a/src/geom/HeuristicOverlay.cpp b/src/geom/HeuristicOverlay.cpp
index c5cbbff01..62064b497 100644
--- a/src/geom/HeuristicOverlay.cpp
+++ b/src/geom/HeuristicOverlay.cpp
@@ -424,6 +424,13 @@ HeuristicOverlay(const Geometry* g0, const Geometry* g1, int opCode)
     catch(const geos::util::TopologyException& ex) {
         ::geos::ignore_unused_variable_warning(ex);
 
+#if GEOS_DEBUG_HEURISTICOVERLAY
+        std::cerr << "OverlayNGRobust: " << ex.what() << std::endl;
+#endif
+    }
+    catch(const geos::util::IllegalArgumentException& ex) {
+        ::geos::ignore_unused_variable_warning(ex);
+
 #if GEOS_DEBUG_HEURISTICOVERLAY
         std::cerr << "OverlayNGRobust: " << ex.what() << std::endl;
 #endif
diff --git a/tests/unit/geom/Geometry/differenceTest.cpp b/tests/unit/geom/Geometry/differenceTest.cpp
index 51a834c82..0aee2f0bd 100644
--- a/tests/unit/geom/Geometry/differenceTest.cpp
+++ b/tests/unit/geom/Geometry/differenceTest.cpp
@@ -57,4 +57,25 @@ void object::test<1>
 }
 
 
+// https://github.com/libgeos/geos/issues/924
+template<>
+template<>
+void object::test<2>
+()
+{
+    std::string wkt1("GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0)), LINESTRING(20 20, 30 30))");
+    std::unique_ptr<geos::geom::Geometry> g1(wktreader.read(wkt1));
+
+    std::string wkt2("GEOMETRYCOLLECTION(POLYGON((9 9, 21 9, 21 21, 9 21, 9 9)), POINT(5 5))");
+    std::unique_ptr<geos::geom::Geometry> g2(wktreader.read(wkt2));
+
+    auto result = g1->difference(g2.get());
+    result->normalize();
+
+    std::string wktExpected("GEOMETRYCOLLECTION (LINESTRING (21 21, 30 30), POLYGON ((10 0, 0 0, 0 10, 9 10, 9 9, 10 9, 10 0)))");
+    std::unique_ptr<geos::geom::Geometry> expected(wktreader.read(wktExpected));
+
+    ensure_equals_geometry(expected.get(), result.get());
+}
+
 } // namespace tut

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

Summary of changes:
 src/geom/HeuristicOverlay.cpp               |  7 +++++++
 tests/unit/geom/Geometry/differenceTest.cpp | 21 +++++++++++++++++++++
 2 files changed, 28 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list