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

git at osgeo.org git at osgeo.org
Thu Oct 14 15:40:06 PDT 2021


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  cc0446eaa29200dd6046e1c9def2688559e87e52 (commit)
      from  dd1be7331e5b9c3665f58679b6968a3890ea385d (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 cc0446eaa29200dd6046e1c9def2688559e87e52
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Oct 14 15:39:52 2021 -0700

    Add some demo tests of the reducePrecision options for all combos

diff --git a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
index 25016c5..06f4148 100644
--- a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
+++ b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
@@ -118,5 +118,45 @@ void object::test<5>
     ensure_equals(toWKT(geom3_), "LINESTRING (0 0, 0 0)");
 }
 
+// Retain (or not) collapsed elements
+template<>
+template<>
+void object::test<6> ()
+{
+    geom1_ = fromWKT("LINESTRING (0 0, 0.1 0.1)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, 0);
+    ensure_geometry_equals(geom2_, "LINESTRING EMPTY");
+}
+
+// Retain (or not) collapsed elements
+template<>
+template<>
+void object::test<7> ()
+{
+    geom1_ = fromWKT("LINESTRING (0 0, 0.1 0.1)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, GEOS_PREC_NO_TOPO);
+    ensure_geometry_equals(geom2_, "LINESTRING (0 0, 0 0)");
+}
+
+// Retain (or not) collapsed elements
+template<>
+template<>
+void object::test<8> ()
+{
+    geom1_ = fromWKT("LINESTRING (0 0, 0.1 0.1)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, GEOS_PREC_KEEP_COLLAPSED);
+    ensure_geometry_equals(geom2_, "LINESTRING (0 0, 0 0)");
+}
+
+// Retain (or not) collapsed elements
+template<>
+template<>
+void object::test<9> ()
+{
+    geom1_ = fromWKT("LINESTRING (0 0, 0.1 0.1)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, GEOS_PREC_KEEP_COLLAPSED | GEOS_PREC_NO_TOPO);
+    ensure_geometry_equals(geom2_, "LINESTRING (0 0, 0 0)");
+}
+
 } // namespace tut
 

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

Summary of changes:
 tests/unit/capi/GEOSGeom_setPrecisionTest.cpp | 40 +++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list