[geos-commits] [SCM] GEOS branch master updated. 632c219c80d91881521e9f5fcb92de4b6cf6023d

git at osgeo.org git at osgeo.org
Thu Nov 19 08:42:33 PST 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  632c219c80d91881521e9f5fcb92de4b6cf6023d (commit)
      from  8825bd16cbbbe2154862da47be6c3c67fc511738 (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 632c219c80d91881521e9f5fcb92de4b6cf6023d
Author: Sandro Santilli <strk at kbt.io>
Date:   Thu Nov 19 17:41:57 2020 +0100

    Port new tests from JTS overlayng-z branch

diff --git a/tests/unit/algorithm/RobustLineIntersectorZTest.cpp b/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
index 08733de..baf378d 100644
--- a/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
+++ b/tests/unit/algorithm/RobustLineIntersectorZTest.cpp
@@ -1,5 +1,7 @@
 //
-// Ported from JTS junit/algorithm/RobustLineIntersectorZTest.java e85881c1c179a49976fe38f0dbbff7d9fa61e65a
+// Ported from JTS
+// junit/algorithm/RobustLineIntersectorZTest.java
+// 1ecc94caa9e188beb63bfb95089e7dd6869bab20
 
 #include <tut/tut.hpp>
 #include <utility.h>
diff --git a/tests/unit/operation/overlayng/OverlayNGZTest.cpp b/tests/unit/operation/overlayng/OverlayNGZTest.cpp
index 8ac55b4..6814b0c 100644
--- a/tests/unit/operation/overlayng/OverlayNGZTest.cpp
+++ b/tests/unit/operation/overlayng/OverlayNGZTest.cpp
@@ -4,7 +4,7 @@
 //
 // Ported from JTS
 // modules/core/src/test/java/org/locationtech/jts/operation/overlayng/OverlyNGZTest.java
-// 0524f550f76e32fb0c2f1badc3775d67a9fa9189
+// 1ecc94caa9e188beb63bfb95089e7dd6869bab20
 //
 
 #include <tut/tut.hpp>
@@ -36,7 +36,7 @@ struct test_overlayngz_data {
         std::unique_ptr<Geometry> b = r.read(wktB);
         std::unique_ptr<Geometry> expected = r.read(wktExpected);
         std::unique_ptr<Geometry> result = OverlayNG::overlay(a.get(), b.get(), opCode);
-        ensure_equals_geometry_xyz(expected.get(), result.get());
+        ensure_equals_geometry_xyz(result.get(), expected.get());
     }
 
     void checkIntersection(const std::string& wktA, const std::string& wktB, const std::string& wktExpected)
@@ -49,6 +49,11 @@ struct test_overlayngz_data {
         checkOverlay(OverlayNG::DIFFERENCE, wktA, wktB, wktExpected);
     }
 
+    void checkUnion(const std::string& wktA, const std::string& wktB, const std::string& wktExpected)
+    {
+        checkOverlay(OverlayNG::UNION, wktA, wktB, wktExpected);
+    }
+
 };
 
 typedef test_group<test_overlayngz_data> group;
@@ -80,7 +85,7 @@ void object::test<2> ()
     );
 }
 
-//  testLineDifferenceLineInterpolated
+//  testLineLineXYDifferenceLineInterpolate
 template<>
 template<>
 void object::test<3> ()
@@ -92,5 +97,68 @@ void object::test<3> ()
     );
 }
 
+// testLineLineUnionOverlay
+template<>
+template<>
+void object::test<4> ()
+{
+    checkUnion(
+        "LINESTRING (0 0 0, 10 10 10)",
+        "LINESTRING (5 5 990, 15 15 999)",
+        "MULTILINESTRING Z((0 0 0, 5 5 990), (5 5 990, 10 10 10), (10 10 10, 15 15 999))"
+    );
+}
+
+// testLinePolygonIntersectionLine
+template<>
+template<>
+void object::test<5> ()
+{
+	checkIntersection(
+		"LINESTRING Z (0 0 0, 5 5 5)",
+		"POLYGON Z ((1 9 5, 9 9 9, 9 1 5, 1 1 1, 1 9 5))",
+		"LINESTRING Z (1 1 1, 5 5 5)"
+	);
+}
+
+// testLinePolygonDifferenceLine
+template<>
+template<>
+void object::test<6> ()
+{
+	checkDifference(
+		"LINESTRING Z (0 5 0, 10 5 10)",
+		"POLYGON Z ((1 9 5, 9 9 9, 9 1 5, 1 1 1, 1 9 5))",
+		"MULTILINESTRING Z((0 5 0, 1 5 2), (9 5 8, 10 5 10))"
+	);
+}
+
+// testLinePolygonXYDifferenceLine
+template<>
+template<>
+void object::test<7> ()
+{
+	checkDifference(
+		"LINESTRING Z (0 5 0, 10 5 10)",
+		"POLYGON ((1 9, 9 9, 9 1, 1 1, 1 9))",
+		"MULTILINESTRING Z((0 5 0, 1 5 1), (9 5 9, 10 5 10))"
+	);
+}
+
+//// TODO: add Z population from model
+//// testLineXYPolygonDifferenceLine
+//template<>
+//template<>
+//void object::test<8> ()
+//{
+//	checkDifference(
+//		"LINESTRING (0 5, 10 5)",
+//		"POLYGON Z ((1 9 5, 9 9 9, 9 1 5, 1 1 1, 1 9 5))",
+//		"MULTILINESTRING Z((0 5 0, 1 5 2), (9 5 8, 10 5 10))"
+//	);
+//}
+
+
+
 
 } // namespace tut

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

Summary of changes:
 .../unit/algorithm/RobustLineIntersectorZTest.cpp  |  4 +-
 tests/unit/operation/overlayng/OverlayNGZTest.cpp  | 74 +++++++++++++++++++++-
 2 files changed, 74 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list