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

git at osgeo.org git at osgeo.org
Thu Sep 21 21:25:04 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, main has been updated
       via  d51982c6da5b7adb63ca0933ae7b53828cc8d72e (commit)
      from  e0e68f636e3b0d32dd7ae09928044699f990a447 (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 d51982c6da5b7adb63ca0933ae7b53828cc8d72e
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Thu Sep 21 19:40:08 2023 -0700

    Add PrecisionReducer test (#962)

diff --git a/tests/unit/operation/overlayng/PrecisionReducerTest.cpp b/tests/unit/operation/overlayng/PrecisionReducerTest.cpp
index 3b3f4f7eb..7d9dc6ea0 100644
--- a/tests/unit/operation/overlayng/PrecisionReducerTest.cpp
+++ b/tests/unit/operation/overlayng/PrecisionReducerTest.cpp
@@ -27,11 +27,11 @@ struct test_precisionreducer_data {
     WKTWriter w;
 
     void
-    checkReduce(const std::string& wkt, double gridSize, const std::string& wkt_expected)
+    checkReduce(const std::string& wkt, double scale, const std::string& wkt_expected)
     {
         std::unique_ptr<Geometry> geom = r.read(wkt);
         std::unique_ptr<Geometry> expected = r.read(wkt_expected);
-        PrecisionModel pm(1.0/gridSize);
+        PrecisionModel pm(scale);
         std::unique_ptr<Geometry> result = PrecisionReducer::reducePrecision(geom.get(), &pm);
         ensure_equals_geometry(result.get(), expected.get());
     }
@@ -142,7 +142,7 @@ template<>
 void object::test<11> ()
 {
     checkReduce("LINESTRING(-3 6, 9 1)",
-        2, "LINESTRING (-2 6, 10 2)");
+        0.5, "LINESTRING (-2 6, 10 2)");
 }
 
 // testCollapsedLine
@@ -170,9 +170,18 @@ void object::test<14> ()
 {
     checkReduce("POLYGON ((2 1, 3 1, 3 2, 2 1))",
     // checkReduce("POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0), (1 1, 1 2, 2 1, 1 1), (1 2, 1 3, 2 3, 1 2), (2 3, 3 3, 3 2, 2 3))",
-        1.0/10, "POLYGON ((2 1, 3 1, 3 2, 2 1))");
+        10, "POLYGON ((2 1, 3 1, 3 2, 2 1))");
+}
+
+// see https://github.com/libgeos/geos/issues/811
+template<>
+template<>
+void object::test<15> ()
+{
+    checkReduce("POLYGON ((127.117461568 34.562519572, 127.117483252 34.5624884690001, 127.117603304 34.562319127, 127.117607152 34.562312309, 127.117607012 34.562312359, 127.117254733 34.5621607510001, 127.117746661 34.5620659730001, 127.117603496 34.5623196400001, 127.117484065 34.562488982, 127.117462315 34.562520066, 127.117245225 34.562385186, 127.117461568 34.562519572))",
+        100000, 
+        "POLYGON ((127.11775 34.56207, 127.11725 34.56216, 127.11761 34.56231, 127.11775 34.56207))");
 }
 
 
-
 } // namespace tut

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

Summary of changes:
 tests/unit/operation/overlayng/PrecisionReducerTest.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list