[geos-commits] [SCM] GEOS branch main updated. 59af84e97112b4bae89b16cacf3550cb56fd8e5c

git at osgeo.org git at osgeo.org
Thu May 18 14:43:55 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  59af84e97112b4bae89b16cacf3550cb56fd8e5c (commit)
       via  3b50997eaee84413eb568d29f4ba5ced3e969e4f (commit)
       via  abf77347868e16972add4bf498c7e6caf1e84f8f (commit)
      from  b18c7aa44b9c46dd04b60071962bd369b36c787e (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 59af84e97112b4bae89b16cacf3550cb56fd8e5c
Author: Mike Taves <mwtoews at gmail.com>
Date:   Fri May 19 09:42:50 2023 +1200

    docs: add USE_CCACHE; a few corrections/improvements related to CMake

diff --git a/.gitignore b/.gitignore
index 7049138ce..1fb0485a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -84,4 +84,5 @@ authors.git
 .idea/
 .project
 out/
+.ccache/
 web/public/
diff --git a/web/content/usage/download.md b/web/content/usage/download.md
index 83d264711..be8076feb 100644
--- a/web/content/usage/download.md
+++ b/web/content/usage/download.md
@@ -51,7 +51,7 @@ make install
 ### Build Options
 
 The GEOS build can be customized using build options.
-Options are specified via [`cmake` variables](https://cmake.org/cmake/help/v2.8.8/cmake.html#section_Variables).
+Options are specified via [`cmake` variables](https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html).
 They are specified on the `cmake` cmdline as `-DVAR=VALUE`.
 
 {{< hint warning >}}
@@ -61,10 +61,11 @@ They are specified on the `cmake` cmdline as `-DVAR=VALUE`.
 | Option               | Default    | Note  |
 | :------------------: | :--------: | :---: |
 | CMAKE_BUILD_TYPE     | Release    | Use `Debug` to build with debug flags and optimizations off. Use `Release` for packaging and production installs. Use `RelWithDebInfo` for optimized build with debug symbols. |
-| CMAKE_INSTALL_PREFIX | /usr/local | Set to install root. Librarys end up in `./libs` headers in `./include` |
+| CMAKE_INSTALL_PREFIX | /usr/local | Set to install root. Libraries end up in `./lib` or `./lib64`, headers in `./include`, executables in `./bin` |
 | BUILD_DOCUMENTATION  | ON         | Attempt to find `doxygen` executable and build API docs |
 | BUILD_SHARED_LIBS    | ON         | Build dynamically linkable libraries. |
 | BUILD_TESTING        | ON         | Build unit tests. |
+| USE_CCACHE           | OFF        | Use [`ccache`](https://ccache.dev/) to compile C/C++ objects, making subsequent builds quicker. |
 
 
 ## Testing
@@ -73,6 +74,7 @@ It is possible to run `ctest` directly. This gives access to ctest command line
 
 ```bash
 ctest
+ctest --output-on-failure
 ctest --verbose
 ```
 

commit 3b50997eaee84413eb568d29f4ba5ced3e969e4f
Author: Mike Taves <mwtoews at gmail.com>
Date:   Thu May 18 12:50:22 2023 +1200

    Change MultiPoint WKT to use parentheses in sub-members (#903)
    
    * Switch WKT output from (e.g.) "MULTIPOINT (2 8, 3 9)" to "MULTIPOINT ((2 8), (3 9))"
    * Change WKT MultiPoint form for most tests to use parentheses
    * Add a few other invalid multipoint examples that should raise ParseException

diff --git a/NEWS.md b/NEWS.md
index 1e34e3e07..2b6e5e104 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -70,6 +70,7 @@ xxxx-xx-xx
 
 - Changes:
   - Remove Orientation.isCCW exception to simplify logic and align with JTS (GH-878, Martin Davis)
+  - Change MultiPoint WKT to use parentheses in sub-members (GH-903, Mike Taves)
 
 ## Changes in 3.11.0
 2022-07-01
diff --git a/src/io/WKTWriter.cpp b/src/io/WKTWriter.cpp
index 7f1552240..90847c0d1 100644
--- a/src/io/WKTWriter.cpp
+++ b/src/io/WKTWriter.cpp
@@ -481,8 +481,10 @@ WKTWriter::appendMultiPointText(const MultiPoint& multiPoint, OrdinateSet output
             }
             else {
                 CoordinateXYZM coord;
+                writer.write("(");
                 seq->getAt(0, coord);
                 appendCoordinate(coord, outputOrdinates, writer);
+                writer.write(")");
             }
         }
         writer.write(")");
diff --git a/tests/unit/algorithm/ConvexHullTest.cpp b/tests/unit/algorithm/ConvexHullTest.cpp
index 5f56fb14d..95ddf0e34 100644
--- a/tests/unit/algorithm/ConvexHullTest.cpp
+++ b/tests/unit/algorithm/ConvexHullTest.cpp
@@ -77,7 +77,7 @@ template<>
 void object::test<2>
 ()
 {
-    checkHull("MULTIPOINT (130 240, 130 240, 130 240, 570 240, 570 240, 570 240, 650 240)",
+    checkHull("MULTIPOINT ((130 240), (130 240), (130 240), (570 240), (570 240), (570 240), (650 240))",
         "LINESTRING (130 240, 650 240)");
 }
 
@@ -87,7 +87,7 @@ template<>
 void object::test<3>
 ()
 {
-    checkHull("MULTIPOINT (0 0, 0 0, 10 0)",
+    checkHull("MULTIPOINT ((0 0), (0 0), (10 0))",
             "LINESTRING (0 0, 10 0)");
 }
 
@@ -97,7 +97,7 @@ template<>
 void object::test<4>
 ()
 {
-    checkHull("MULTIPOINT (0 0, 10 0, 10 0)",
+    checkHull("MULTIPOINT ((0 0), (10 0), (10 0))",
         "LINESTRING (0 0, 10 0)");
 }
 
@@ -107,7 +107,7 @@ template<>
 void object::test<5>
 ()
 {
-    checkHull("MULTIPOINT (0 0, 5 0, 10 0)",
+    checkHull("MULTIPOINT ((0 0), (5 0), (10 0))",
         "LINESTRING (0 0, 10 0)");
 }
 
@@ -117,7 +117,7 @@ template<>
 void object::test<6>
 ()
 {
-    checkHull("MULTIPOINT (0 0, 5 1, 10 0)",
+    checkHull("MULTIPOINT ((0 0), (5 1), (10 0))",
         "POLYGON ((0 0, 5 1, 10 0, 0 0))");
 }
 
@@ -127,7 +127,7 @@ template<>
 void object::test<7>
 ()
 {
-    checkHull("MULTIPOINT (0 0, 0 0, 5 0, 5 0, 10 0, 10 0)",
+    checkHull("MULTIPOINT ((0 0), (0 0), (5 0), (5 0), (10 0), (10 0))",
         "LINESTRING (0 0, 10 0)");
 }
 
diff --git a/tests/unit/algorithm/distance/DiscreteFrechetDistanceTest.cpp b/tests/unit/algorithm/distance/DiscreteFrechetDistanceTest.cpp
index 6a2aee41d..9e0be782e 100644
--- a/tests/unit/algorithm/distance/DiscreteFrechetDistanceTest.cpp
+++ b/tests/unit/algorithm/distance/DiscreteFrechetDistanceTest.cpp
@@ -138,7 +138,7 @@ template<>
 void object::test<3>
 ()
 {
-    runTest("LINESTRING (0 0, 2 0)", "MULTIPOINT (0 1, 1 0, 2 1)", 1.0);
+    runTest("LINESTRING (0 0, 2 0)", "MULTIPOINT ((0 1), (1 0), (2 1))", 1.0);
 }
 
 // 4 - testLinesShowingDiscretenessEffect
diff --git a/tests/unit/algorithm/distance/DiscreteHausdorffDistanceTest.cpp b/tests/unit/algorithm/distance/DiscreteHausdorffDistanceTest.cpp
index 188cd35e9..5f21fe420 100644
--- a/tests/unit/algorithm/distance/DiscreteHausdorffDistanceTest.cpp
+++ b/tests/unit/algorithm/distance/DiscreteHausdorffDistanceTest.cpp
@@ -146,7 +146,7 @@ void object::test<3>
 ()
 {
     runTest("LINESTRING (0 0, 2 0)",
-            "MULTIPOINT (0 1, 1 0, 2 1)", 1.0);
+            "MULTIPOINT ((0 1), (1 0), (2 1))", 1.0);
 }
 
 // 4 - testLinesShowingDiscretenessEffect
diff --git a/tests/unit/capi/GEOSConvexHullTest.cpp b/tests/unit/capi/GEOSConvexHullTest.cpp
index 24b9b6002..f4a162744 100644
--- a/tests/unit/capi/GEOSConvexHullTest.cpp
+++ b/tests/unit/capi/GEOSConvexHullTest.cpp
@@ -34,7 +34,7 @@ template<>
 void object::test<1>
 ()
 {
-    input_ = GEOSGeomFromWKT("MULTIPOINT (130 240, 130 240, 570 240, 570 290, 650 240)");
+    input_ = GEOSGeomFromWKT("MULTIPOINT ((130 240), (130 240), (570 240), (570 290), (650 240))");
     ensure(nullptr != input_);
 
     expected_ = GEOSGeomFromWKT("POLYGON ((130 240, 570 290, 650 240, 130 240))");
diff --git a/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp b/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
index f8e98727c..35c1e0502 100644
--- a/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
+++ b/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
@@ -80,7 +80,7 @@ template<>
 void object::test<3>
 ()
 {
-    geom1_ = GEOSGeomFromWKT("MULTIPOINT(0 0, 5 0, 10 0)");
+    geom1_ = GEOSGeomFromWKT("MULTIPOINT((0 0), (5 0), (10 0))");
 
     geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 0);
     ensure_equals(GEOSisEmpty(geom2_), 1);
@@ -100,7 +100,7 @@ template<>
 void object::test<4>
 ()
 {
-    geom1_ = GEOSGeomFromWKT("MULTIPOINT(0 0, 5 0, 10 10)");
+    geom1_ = GEOSGeomFromWKT("MULTIPOINT((0 0), (5 0), (10 10))");
 
     geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 0);
     ensure(geom2_ != nullptr);
@@ -138,7 +138,7 @@ template<>
 void object::test<6>
 ()
 {
-    geom1_ = GEOSGeomFromWKT("MULTIPOINT(0 0, 10 0, 10 10, 11 10)");
+    geom1_ = GEOSGeomFromWKT("MULTIPOINT((0 0), (10 0), (10 10), (11 10))");
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSDelaunayTriangulation(geom1_, 2, 1);
diff --git a/tests/unit/capi/GEOSGeomFromWKBTest.cpp b/tests/unit/capi/GEOSGeomFromWKBTest.cpp
index 84b061e2a..93aa07f49 100644
--- a/tests/unit/capi/GEOSGeomFromWKBTest.cpp
+++ b/tests/unit/capi/GEOSGeomFromWKBTest.cpp
@@ -99,7 +99,7 @@ template<>
 void object::test<5>
 ()
 {
-    std::string wkt("MULTIPOINT (1.123 1.456, 2.123 2.456, 3.123 3.456)");
+    std::string wkt("MULTIPOINT ((1.123 1.456), (2.123 2.456), (3.123 3.456))");
     std::string
     ewkb("01040000000300000001010000002b8716d9cef7f13fb29defa7c64bf73f010100000096438b6ce7fb0040d9cef753e3a50340010100000096438b6ce7fb0840d9cef753e3a50b40");
     test_wkb(ewkb, wkt);
diff --git a/tests/unit/capi/GEOSGeomToWKBTest.cpp b/tests/unit/capi/GEOSGeomToWKBTest.cpp
index 5a349e9ec..e9679ad25 100644
--- a/tests/unit/capi/GEOSGeomToWKBTest.cpp
+++ b/tests/unit/capi/GEOSGeomToWKBTest.cpp
@@ -149,7 +149,7 @@ template<>
 void object::test<10>
 ()
 {
-    test_wkb("MULTIPOINT (0 0, 5 5, 10 10, 15 15, 20 20)");
+    test_wkb("MULTIPOINT ((0 0), (5 5), (10 10), (15 15), (20 20))");
 }
 
 template<>
diff --git a/tests/unit/capi/GEOSGeomToWKTTest.cpp b/tests/unit/capi/GEOSGeomToWKTTest.cpp
index f3dc83995..72f3941de 100644
--- a/tests/unit/capi/GEOSGeomToWKTTest.cpp
+++ b/tests/unit/capi/GEOSGeomToWKTTest.cpp
@@ -136,7 +136,7 @@ template<>
 void object::test<10>
 ()
 {
-    test_wkt("MULTIPOINT (0 0, 5 5, 10 10, 15 15, 20 20)", 13);
+    test_wkt("MULTIPOINT ((0 0), (5 5), (10 10), (15 15), (20 20))", 13);
 }
 
 template<>
diff --git a/tests/unit/capi/GEOSGeom_createCollectionTest.cpp b/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
index 11d640874..da1d355c4 100644
--- a/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
+++ b/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
@@ -188,7 +188,7 @@ template<>
 void object::test<7>
 ()
 {
-    const char *wkt = "MULTIPOINT(0 0, 1 1)";
+    const char *wkt = "MULTIPOINT((0 0), (1 1))";
     geom_ = read(wkt);
     ensure(geom_ != nullptr);
 
diff --git a/tests/unit/capi/GEOSGeom_extractUniquePointsTest.cpp b/tests/unit/capi/GEOSGeom_extractUniquePointsTest.cpp
index e3bd6d76a..afd99076e 100644
--- a/tests/unit/capi/GEOSGeom_extractUniquePointsTest.cpp
+++ b/tests/unit/capi/GEOSGeom_extractUniquePointsTest.cpp
@@ -81,8 +81,8 @@ template<>
 void object::test<2>
 ()
 {
-    geom1_ = GEOSGeomFromWKT_r(handle_, "MULTIPOINT(0 0, 0 0, 1 1)");
-    geom2_ = GEOSGeomFromWKT_r(handle_, "MULTIPOINT(0 0, 1 1)");
+    geom1_ = GEOSGeomFromWKT_r(handle_, "MULTIPOINT((0 0), (0 0), (1 1))");
+    geom2_ = GEOSGeomFromWKT_r(handle_, "MULTIPOINT((0 0), (1 1))");
     /* ensure_equals(GEOSGetNumGeometries_r(handle_, geom2_), 0); */
     geom3_ = GEOSGeom_extractUniquePoints_r(handle_, geom1_);
     ensure(0 != GEOSEquals_r(handle_, geom3_, geom2_));
@@ -94,8 +94,8 @@ void object::test<3>
 ()
 {
     geom1_ = GEOSGeomFromWKT_r(handle_,
-                               "GEOMETRYCOLLECTION(MULTIPOINT(0 0, 0 0, 1 1),LINESTRING(1 1, 2 2, 2 2, 0 0),POLYGON((5 5, 0 0, 0 2, 2 2, 5 5)))");
-    geom2_ = GEOSGeomFromWKT_r(handle_, "MULTIPOINT(0 0, 1 1, 2 2, 5 5, 0 2)");
+                               "GEOMETRYCOLLECTION(MULTIPOINT((0 0), (0 0), (1 1)),LINESTRING(1 1, 2 2, 2 2, 0 0),POLYGON((5 5, 0 0, 0 2, 2 2, 5 5)))");
+    geom2_ = GEOSGeomFromWKT_r(handle_, "MULTIPOINT((0 0), (1 1), (2 2), (5 5), (0 2))");
     geom3_ = GEOSGeom_extractUniquePoints_r(handle_, geom1_);
     /* ensure_equals(GEOSGetNumGeometries_r(handle_, geom2_), 0); */
     ensure(0 != GEOSEquals_r(handle_, geom3_, geom2_));
diff --git a/tests/unit/capi/GEOSGetGeometryNTest.cpp b/tests/unit/capi/GEOSGetGeometryNTest.cpp
index 87d0f4e12..92665cbc1 100644
--- a/tests/unit/capi/GEOSGetGeometryNTest.cpp
+++ b/tests/unit/capi/GEOSGetGeometryNTest.cpp
@@ -20,7 +20,7 @@ template<>
 template<>
 void object::test<1>()
 {
-    geom1_ = fromWKT("MULTIPOINT (1 1, 2 2, 3 3)");
+    geom1_ = fromWKT("MULTIPOINT ((1 1), (2 2), (3 3))");
     ensure(nullptr != geom1_);
 
     GEOSGeometry* result = const_cast<GEOSGeometry*>(GEOSGetGeometryN(geom1_, 0));
diff --git a/tests/unit/capi/GEOSSnapTest.cpp b/tests/unit/capi/GEOSSnapTest.cpp
index 89a4a4f59..c3ccdf2fb 100644
--- a/tests/unit/capi/GEOSSnapTest.cpp
+++ b/tests/unit/capi/GEOSSnapTest.cpp
@@ -130,7 +130,7 @@ void object::test<6>
 ()
 {
     geom1_ = GEOSGeomFromWKT("LINESTRING(0 3,4 1,0 1)");
-    geom2_ = GEOSGeomFromWKT("MULTIPOINT(5 0,4 1)");
+    geom2_ = GEOSGeomFromWKT("MULTIPOINT((5 0),(4 1))");
     geom3_ = GEOSSnap(geom1_, geom2_, 2);
 
     char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
@@ -149,7 +149,7 @@ void object::test<7>
 ()
 {
     geom1_ = GEOSGeomFromWKT("LINESTRING(0 3,4 1,0 1)");
-    geom2_ = GEOSGeomFromWKT("MULTIPOINT(4 1,5 0)");
+    geom2_ = GEOSGeomFromWKT("MULTIPOINT((4 1),(5 0))");
     geom3_ = GEOSSnap(geom1_, geom2_, 2);
 
     char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
@@ -167,7 +167,7 @@ void object::test<8>
 ()
 {
     geom1_ = GEOSGeomFromWKT("LINESTRING(0 0,10 0,10 10,0 10,0 0)");
-    geom2_ = GEOSGeomFromWKT("MULTIPOINT(0 0,-1 0)");
+    geom2_ = GEOSGeomFromWKT("MULTIPOINT((0 0),(-1 0))");
     geom3_ = GEOSSnap(geom1_, geom2_, 3);
 
     char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
@@ -200,7 +200,7 @@ void object::test<10>
 ()
 {
     geom1_ = GEOSGeomFromWKT("LINESTRING(-71.1317 42.2511,-71.1317 42.2509)");
-    geom2_ = GEOSGeomFromWKT("MULTIPOINT(-71.1261 42.2703,-71.1257 42.2703,-71.1261 42.2702)");
+    geom2_ = GEOSGeomFromWKT("MULTIPOINT((-71.1261 42.2703),(-71.1257 42.2703),(-71.1261 42.2702))");
     geom3_ = GEOSSnap(geom1_, geom2_, 0.5);
 
     char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
diff --git a/tests/unit/capi/GEOSUnaryUnionPrecTest.cpp b/tests/unit/capi/GEOSUnaryUnionPrecTest.cpp
index 355b588d1..21a33de25 100644
--- a/tests/unit/capi/GEOSUnaryUnionPrecTest.cpp
+++ b/tests/unit/capi/GEOSUnaryUnionPrecTest.cpp
@@ -43,14 +43,14 @@ template<>
 void object::test<1>
 ()
 {
-    geom1_ = GEOSGeomFromWKT("MULTIPOINT (4 5, 6 7, 4 5, 6 5, 6 7)");
+    geom1_ = GEOSGeomFromWKT("MULTIPOINT ((4 5), (6 7), (4 5), (6 5), (6 7))");
     ensure(nullptr != geom1_);
 
     geom2_ = GEOSUnaryUnionPrec(geom1_, 2);
     ensure(nullptr != geom2_);
 
-    ensure_equals(toWKT(geom2_), std::string("MULTIPOINT (4 6, 6 6, 6 8)"));
+    ensure_equals(toWKT(geom2_), std::string("MULTIPOINT ((4 6), (6 6), (6 8))"));
 }
 
 
-} // namespace tut
\ No newline at end of file
+} // namespace tut
diff --git a/tests/unit/capi/GEOSUnaryUnionTest.cpp b/tests/unit/capi/GEOSUnaryUnionTest.cpp
index 56ebe2676..095e16c3e 100644
--- a/tests/unit/capi/GEOSUnaryUnionTest.cpp
+++ b/tests/unit/capi/GEOSUnaryUnionTest.cpp
@@ -88,13 +88,13 @@ template<>
 void object::test<4>
 ()
 {
-    geom1_ = GEOSGeomFromWKT("MULTIPOINT (4 5, 6 7, 4 5, 6 5, 6 7)");
+    geom1_ = GEOSGeomFromWKT("MULTIPOINT ((4 5), (6 7), (4 5), (6 5), (6 7))");
     ensure(nullptr != geom1_);
 
     geom2_ = GEOSUnaryUnion(geom1_);
     ensure(nullptr != geom2_);
 
-    ensure_equals(toWKT(geom2_), std::string("MULTIPOINT (4 5, 6 5, 6 7)"));
+    ensure_equals(toWKT(geom2_), std::string("MULTIPOINT ((4 5), (6 5), (6 7))"));
 }
 
 // Self-union a collection of puntal and lineal geometries
@@ -103,7 +103,7 @@ template<>
 void object::test<5>
 ()
 {
-    geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT(6 7, 6 5, 6 7), LINESTRING(0 5, 10 5), LINESTRING(4 -10, 4 10))");
+    geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT((6 7), (6 5), (6 7)), LINESTRING(0 5, 10 5), LINESTRING(4 -10, 4 10))");
     ensure(nullptr != geom1_);
 
     geom2_ = GEOSUnaryUnion(geom1_);
@@ -122,7 +122,7 @@ template<>
 void object::test<6>
 ()
 {
-    geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT(6 7, 6 5, 6 7), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)))");
+    geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT((6 7), (6 5), (6 7)), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)))");
     ensure(nullptr != geom1_);
 
     geom2_ = GEOSUnaryUnion(geom1_);
@@ -160,7 +160,7 @@ template<>
 void object::test<8>
 ()
 {
-    geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (MULTILINESTRING((5 7, 12 7), (4 5, 6 5), (5.5 7.5, 6.5 7.5)), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)), MULTIPOINT(6 6.5, 6 1, 12 2, 6 1))");
+    geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (MULTILINESTRING((5 7, 12 7), (4 5, 6 5), (5.5 7.5, 6.5 7.5)), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)), MULTIPOINT((6 6.5), (6 1), (12 2), (6 1)))");
     ensure(nullptr != geom1_);
 
     geom2_ = GEOSUnaryUnion(geom1_);
diff --git a/tests/unit/capi/GEOSUnionCascadedTest.cpp b/tests/unit/capi/GEOSUnionCascadedTest.cpp
index b48522347..f0909282e 100644
--- a/tests/unit/capi/GEOSUnionCascadedTest.cpp
+++ b/tests/unit/capi/GEOSUnionCascadedTest.cpp
@@ -28,7 +28,7 @@ void object::test<1>()
     geom3_ = GEOSUnion(geom1_, geom2_);
     ensure(nullptr != geom3_);
 
-     ensure_equals("MULTIPOINT (2 8, 3 9)", toWKT(geom3_));
+     ensure_equals("MULTIPOINT ((2 8), (3 9))", toWKT(geom3_));
 }
 
 } // namespace tut
diff --git a/tests/unit/capi/GEOSUnionPrecTest.cpp b/tests/unit/capi/GEOSUnionPrecTest.cpp
index 11cb58131..cf636509d 100644
--- a/tests/unit/capi/GEOSUnionPrecTest.cpp
+++ b/tests/unit/capi/GEOSUnionPrecTest.cpp
@@ -29,7 +29,7 @@ void object::test<1>()
     GEOSSetSRID(a, 4326);
 
     GEOSGeometry* result = GEOSUnionPrec(a, b, 2);
-    GEOSGeometry* expected = GEOSGeomFromWKT("MULTIPOINT (2 8, 4 10)");
+    GEOSGeometry* expected = GEOSGeomFromWKT("MULTIPOINT ((2 8), (4 10))");
 
     ensure(result);
     ensure(expected);
diff --git a/tests/unit/capi/GEOSUnionTest.cpp b/tests/unit/capi/GEOSUnionTest.cpp
index fa52a7d94..1053ec7a6 100644
--- a/tests/unit/capi/GEOSUnionTest.cpp
+++ b/tests/unit/capi/GEOSUnionTest.cpp
@@ -29,7 +29,7 @@ void object::test<1>()
     GEOSSetSRID(a, 4326);
 
     GEOSGeometry* result = GEOSUnion(a, b);
-    GEOSGeometry* expected = GEOSGeomFromWKT("MULTIPOINT (2 8, 3 9)");
+    GEOSGeometry* expected = GEOSGeomFromWKT("MULTIPOINT ((2 8), (3 9))");
 
     ensure(result);
     ensure(expected);
diff --git a/tests/unit/geom/Geometry/cloneTest.cpp b/tests/unit/geom/Geometry/cloneTest.cpp
index ff0545c24..6d215cd9d 100644
--- a/tests/unit/geom/Geometry/cloneTest.cpp
+++ b/tests/unit/geom/Geometry/cloneTest.cpp
@@ -96,7 +96,7 @@ void object::test<4>
 ()
 {
     GeomPtr g1(reader.read(
-                   "MULTIPOINT (0 100, 5 6)"
+                   "MULTIPOINT ((0 100), (5 6))"
                ));
     g1->setSRID(66);
     GeomPtr g2(g1->clone());
diff --git a/tests/unit/geom/Geometry/normalizeTest.cpp b/tests/unit/geom/Geometry/normalizeTest.cpp
index 71b6c4b9d..cfe33c01f 100644
--- a/tests/unit/geom/Geometry/normalizeTest.cpp
+++ b/tests/unit/geom/Geometry/normalizeTest.cpp
@@ -120,13 +120,13 @@ void object::test<4>
 {
     const char* inp =
         "MULTIPOINT ("
-        "0 100," // leftmost
-        "5 6"    // rightmost
+        "(0 100)," // leftmost
+        "(5 6)"    // rightmost
         ")";
     const char* exp =
         "MULTIPOINT ("
-        "5 6,"   // rightmost
-        "0 100"  // leftmost
+        "(5 6),"   // rightmost
+        "(0 100)"  // leftmost
         ")";
     runTest(inp, exp);
 }
@@ -175,8 +175,8 @@ void object::test<7>
     const char* inp =
         "GEOMETRYCOLLECTION("
         "MULTIPOINT ("
-        "0 100," // leftmost
-        "5 6"    // rightmost
+        "(0 100)," // leftmost
+        "(5 6)"    // rightmost
         "),"
         "POINT(10 4)," // more on the right than the multipoint
         "MULTILINESTRING("
@@ -211,8 +211,8 @@ void object::test<7>
         "),"
         "LINESTRING (0 0, 0 100, 100 100, 100 0),"
         "MULTIPOINT ("
-        "5 6,"   // rightmost
-        "0 100"  // leftmost
+        "(5 6),"   // rightmost
+        "(0 100)"  // leftmost
         "),"
         "POINT(10 4)" // more on the right than the multipoint
         ")";
diff --git a/tests/unit/geom/GeometryFactoryTest.cpp b/tests/unit/geom/GeometryFactoryTest.cpp
index 30b01ae11..9cc8b659a 100644
--- a/tests/unit/geom/GeometryFactoryTest.cpp
+++ b/tests/unit/geom/GeometryFactoryTest.cpp
@@ -1308,10 +1308,10 @@ void object::test<41>
     ensure(mg1->isEmpty());
     ensure(mg2->isEmpty());
     g1 = reader_.read("POINT(1 1)");
-    g2 = reader_.read("MULTIPOINT(1 1)");
+    g2 = reader_.read("MULTIPOINT((1 1))");
     mg1 = factory_->createMulti(std::move(g1));
     mg2 = factory_->createMulti(std::move(g2));
-    g2 = reader_.read("MULTIPOINT(1 1)");
+    g2 = reader_.read("MULTIPOINT((1 1))");
     ensure_equals_geometry(g2.get(), mg1.get());
     ensure_equals_geometry(g2.get(), mg2.get());
 }
diff --git a/tests/unit/geom/MultiPointTest.cpp b/tests/unit/geom/MultiPointTest.cpp
index 3f5c10373..5899f1cfe 100644
--- a/tests/unit/geom/MultiPointTest.cpp
+++ b/tests/unit/geom/MultiPointTest.cpp
@@ -40,7 +40,7 @@ struct test_multipoint_data {
         , empty_mp_(factory_->createMultiPoint()), mp_size_(5)
     {
         // Create non-empty MultiPoint
-        auto geo = reader_.read("MULTIPOINT(0 0, 5 5, 10 10, 15 15, 20 20)");
+        auto geo = reader_.read("MULTIPOINT((0 0), (5 5), (10 10), (15 15), (20 20))");
         mp_ = dynamic_cast<MultiPointPtr>(geo.release());
     }
 
@@ -373,15 +373,26 @@ template<>
 void object::test<28>
 ()
 {
-    try {
-        auto geo = reader_.read("MULTIPOINT(0 0, 5)");
-        ensure(geo != nullptr);
-
-        fail("ParseException expected.");
-    }
-    catch(geos::io::ParseException const& e) {
-        const char* msg = e.what(); // ok
-        ensure(msg != nullptr);
+    std::vector<std::string> variants{
+        "MULTIPOINT(0 0, 5)",
+        "MULTIPOINT((0 0), (5))",
+        "MULTIPOINT((0 0), 5 0)",
+        "MULTIPOINT(0 0, (5 0))",
+        "MULTIPOINT(0, 5)",
+        "MULTIPOINT((0, 5))",
+    };
+
+    for (const auto& wkt : variants) {
+        try {
+            auto geo = reader_.read(wkt);
+            ensure(geo != nullptr);
+
+            fail("ParseException expected.");
+        }
+        catch(geos::io::ParseException const& e) {
+            const char* msg = e.what(); // ok
+            ensure(msg != nullptr);
+        }
     }
 }
 
diff --git a/tests/unit/geom/prep/PreparedGeometryFactoryTest.cpp b/tests/unit/geom/prep/PreparedGeometryFactoryTest.cpp
index 40c8d6147..34ec47ec6 100644
--- a/tests/unit/geom/prep/PreparedGeometryFactoryTest.cpp
+++ b/tests/unit/geom/prep/PreparedGeometryFactoryTest.cpp
@@ -416,7 +416,7 @@ template<>
 void object::test<24>
 ()
 {
-    g_ = reader_.read("MULTIPOINT(0 0, 5 5, 10 10, 15 15, 20 20)");
+    g_ = reader_.read("MULTIPOINT((0 0), (5 5), (10 10), (15 15), (20 20))");
     ensure(nullptr != g_);
 
     pg_ = prep::PreparedGeometryFactory::prepare(g_.get());
@@ -431,7 +431,7 @@ template<>
 void object::test<25>
 ()
 {
-    g_ = reader_.read("MULTIPOINT(0 0, 5 5, 10 10, 15 15, 20 20)");
+    g_ = reader_.read("MULTIPOINT((0 0), (5 5), (10 10), (15 15), (20 20))");
     ensure(nullptr != g_);
 
     prep::PreparedGeometryFactory pgf;
diff --git a/tests/unit/io/GeoJSONReaderTest.cpp b/tests/unit/io/GeoJSONReaderTest.cpp
index 245a73126..230d6349f 100644
--- a/tests/unit/io/GeoJSONReaderTest.cpp
+++ b/tests/unit/io/GeoJSONReaderTest.cpp
@@ -100,7 +100,7 @@ void object::test<5>
 {
     std::string geojson { "{\"type\":\"MultiPoint\",\"coordinates\":[[10, 40], [40, 30], [20, 20], [30, 10]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
-    ensure_equals("MULTIPOINT (10.000 40.000, 40.000 30.000, 20.000 20.000, 30.000 10.000)", geom->toText());
+    ensure_equals("MULTIPOINT ((10.000 40.000), (40.000 30.000), (20.000 20.000), (30.000 10.000))", geom->toText());
     ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
diff --git a/tests/unit/io/WKBReaderTest.cpp b/tests/unit/io/WKBReaderTest.cpp
index d3156727c..1485b6262 100644
--- a/tests/unit/io/WKBReaderTest.cpp
+++ b/tests/unit/io/WKBReaderTest.cpp
@@ -223,7 +223,7 @@ void object::test<4>
     testInputOutput(
 
         // WKT
-        "MULTIPOINT(0 0, 10 0, 10 10, 0 10, 0 0)",
+        "MULTIPOINT((0 0), (10 0), (10 10), (0 10), (0 0))",
 
         // NDR HEXWKB
         "010400000005000000010100000000000000000000000000000000000000010100000000000000000024400000000000000000010100000000000000000024400000000000002440010100000000000000000000000000000000002440010100000000000000000000000000000000000000",
@@ -289,7 +289,7 @@ void object::test<7>
     testInputOutput(
 
         // WKT
-        "GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(1 2,3 4),POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,2 6,6 4,2 2)),MULTIPOINT(0 0,10 0,10 10,0 10,0 0),MULTILINESTRING((0 0,10 0,10 10,0 10,10 20),(2 2,2 6,6 4,20 2)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(2 2,2 6,6 4,2 2)),((60 60,60 50,70 40,60 60))))",
+        "GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(1 2,3 4),POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,2 6,6 4,2 2)),MULTIPOINT((0 0),(10 0),(10 10),(0 10),(0 0)),MULTILINESTRING((0 0,10 0,10 10,0 10,10 20),(2 2,2 6,6 4,20 2)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(2 2,2 6,6 4,2 2)),((60 60,60 50,70 40,60 60))))",
 
         // NDR HEXWKB
         "010700000006000000010100000000000000000000000000000000000000010200000002000000000000000000F03F000000000000004000000000000008400000000000001040010300000002000000050000000000000000000000000000000000000000000000000024400000000000000000000000000000244000000000000024400000000000000000000000000000244000000000000000000000000000000000040000000000000000000040000000000000004000000000000000400000000000001840000000000000184000000000000010400000000000000040000000000000004001040000000500000001010000000000000000000000000000000000000001010000000000000000002440000000000000000001010000000000000000002440000000000000244001010000000000000000000000000000000000244001010000000000000000000000000000000000000001050000000200000001020000000500000000000000000000000000000000000000000000000000244000000000000000000000000000002440000000000000244000000000000000000000000000002440000000000000244000000000000034400102000000040000000000000000000040000000000000004000000000000000400000000000001840000000000000184000
 00000000001040000000000000344000000000000000400106000000020000000103000000020000000500000000000000000000000000000000000000000000000000244000000000000000000000000000002440000000000000244000000000000000000000000000002440000000000000000000000000000000000400000000000000000000400000000000000040000000000000004000000000000018400000000000001840000000000000104000000000000000400000000000000040010300000001000000040000000000000000004E400000000000004E400000000000004E400000000000004940000000000080514000000000000044400000000000004E400000000000004E40",
@@ -389,7 +389,7 @@ void object::test<13>
 {
     testInputNdr(
         // WKT
-        "MULTIPOINT Z(0 1 2, 3 4 5)",
+        "MULTIPOINT Z((0 1 2), (3 4 5))",
         // NDR HEXWKB
         "01040000A0E61000000200000001010000800000000000000000000000000000F03F00000000000000400101000080000000000000084000000000000010400000000000001440"
     );
diff --git a/tests/unit/io/WKTWriterTest.cpp b/tests/unit/io/WKTWriterTest.cpp
index d12227232..c22853be2 100644
--- a/tests/unit/io/WKTWriterTest.cpp
+++ b/tests/unit/io/WKTWriterTest.cpp
@@ -201,7 +201,7 @@ void object::test<6>
     wktwriter.setRoundingPrecision(2);
     wktwriter.setTrim(true);
     std::string result = wktwriter.write(col.get());
-    ensure_equals(result, std::string("MULTIPOINT (EMPTY, 1 2)"));
+    ensure_equals(result, std::string("MULTIPOINT (EMPTY, (1 2))"));
 }
 
 
diff --git a/tests/unit/operation/cluster/DisjointOperationTest.cpp b/tests/unit/operation/cluster/DisjointOperationTest.cpp
index ac8c73436..019ec7345 100644
--- a/tests/unit/operation/cluster/DisjointOperationTest.cpp
+++ b/tests/unit/operation/cluster/DisjointOperationTest.cpp
@@ -27,7 +27,7 @@ void object::test<1>
 {
     using geos::operation::cluster::GeometryDistanceClusterFinder;
 
-    auto g = reader_.read("MULTIPOINT (0 0, 1 0, 1 1, 2 2, 3 2, 3 3)");
+    auto g = reader_.read("MULTIPOINT ((0 0), (1 0), (1 1), (2 2), (3 2), (3 3))");
 
     GeometryDistanceClusterFinder finder(1.0);
 
diff --git a/tests/unit/operation/cluster/GeometryFlattenerTest.cpp b/tests/unit/operation/cluster/GeometryFlattenerTest.cpp
index c59630275..151b022a6 100644
--- a/tests/unit/operation/cluster/GeometryFlattenerTest.cpp
+++ b/tests/unit/operation/cluster/GeometryFlattenerTest.cpp
@@ -64,7 +64,7 @@ template<>
 void object::test<3>()
 {
     checkFlattener("GEOMETRYCOLLECTION (POINT (1 1))", "POINT (1 1)");
-    checkFlattener("MULTIPOINT (1 1)", "POINT (1 1)");
+    checkFlattener("MULTIPOINT ((1 1))", "POINT (1 1)");
 }
 
 // most narrow representation used
@@ -72,7 +72,7 @@ template<>
 template<>
 void object::test<4>()
 {
-    checkFlattener("GEOMETRYCOLLECTION (POINT (1 1), MULTIPOINT (1 2, 1 3), GEOMETRYCOLLECTION (POINT (1 4), POINT EMPTY))",
+    checkFlattener("GEOMETRYCOLLECTION (POINT (1 1), MULTIPOINT ((1 2), (1 3)), GEOMETRYCOLLECTION (POINT (1 4), POINT EMPTY))",
                    "MULTIPOINT ((1 1), (1 2), (1 3), (1 4), EMPTY)");
     checkFlattener("GEOMETRYCOLLECTION(MULTILINESTRING ((1 1, 2 2)), MULTIPOINT ((3 3), (4 4)))",
                    "GEOMETRYCOLLECTION(LINESTRING (1 1, 2 2), POINT (3 3), POINT (4 4))");
diff --git a/tests/unit/operation/distance/DistanceOpTest.cpp b/tests/unit/operation/distance/DistanceOpTest.cpp
index 08b926a16..9b862e377 100644
--- a/tests/unit/operation/distance/DistanceOpTest.cpp
+++ b/tests/unit/operation/distance/DistanceOpTest.cpp
@@ -78,7 +78,7 @@ void object::test<2>
     using geos::geom::Coordinate;
 
     std::string wkt0("POINT(0 0)");
-    std::string wkt1("MULTIPOINT(10 0, 50 30)");
+    std::string wkt1("MULTIPOINT((10 0), (50 30))");
     GeomPtr g0(wktreader.read(wkt0));
     GeomPtr g1(wktreader.read(wkt1));
 
@@ -197,7 +197,7 @@ void object::test<7>
 
     // This is an invalid geom... anyway
     std::string
-    wkt1("GEOMETRYCOLLECTION(MULTIPOLYGON(((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)),( (100 100, 150 100, 150 150, 100 150, 100 100),(120 120, 120 130, 130 130, 130 120, 120 120)) ), POLYGON((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)), MULTILINESTRING((34 54, 60 34),(0 10, 50 10, 100 50)), LINESTRING(0 10, 50 10, 100 50), MULTIPOINT(10 0, 50 30), POINT(10 0))");
+    wkt1("GEOMETRYCOLLECTION(MULTIPOLYGON(((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)),( (100 100, 150 100, 150 150, 100 150, 100 100),(120 120, 120 130, 130 130, 130 120, 120 120)) ), POLYGON((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)), MULTILINESTRING((34 54, 60 34),(0 10, 50 10, 100 50)), LINESTRING(0 10, 50 10, 100 50), MULTIPOINT((10 0), (50 30)), POINT(10 0))");
 
     GeomPtr g0(wktreader.read(wkt0));
     GeomPtr g1(wktreader.read(wkt1));
@@ -242,7 +242,7 @@ void object::test<9>
     using geos::operation::distance::DistanceOp;
     using geos::geom::Coordinate;
 
-    std::string wkt0("MULTIPOINT(10 0, 50 30)");
+    std::string wkt0("MULTIPOINT((10 0), (50 30))");
     std::string wkt1("POINT(10 0)");
     GeomPtr g0(wktreader.read(wkt0));
     GeomPtr g1(wktreader.read(wkt1));
@@ -265,8 +265,8 @@ void object::test<10>
     using geos::operation::distance::DistanceOp;
     using geos::geom::Coordinate;
 
-    std::string wkt0("MULTIPOINT(10 0, 50 30)");
-    std::string wkt1("MULTIPOINT(0 0, 150 30)");
+    std::string wkt0("MULTIPOINT((10 0), (50 30))");
+    std::string wkt1("MULTIPOINT((0 0), (150 30))");
     GeomPtr g0(wktreader.read(wkt0));
     GeomPtr g1(wktreader.read(wkt1));
 
@@ -288,7 +288,7 @@ void object::test<11>
     using geos::operation::distance::DistanceOp;
     using geos::geom::Coordinate;
 
-    std::string wkt0("MULTIPOINT(3 0, 200 30)");
+    std::string wkt0("MULTIPOINT((3 0), (200 30))");
     std::string wkt1("LINESTRING(0 10, 50 10, 100 50)");
     GeomPtr g0(wktreader.read(wkt0));
     GeomPtr g1(wktreader.read(wkt1));
@@ -311,7 +311,7 @@ void object::test<12>
     using geos::operation::distance::DistanceOp;
     using geos::geom::Coordinate;
 
-    std::string wkt0("MULTIPOINT(3 0, -50 30)");
+    std::string wkt0("MULTIPOINT((3 0), (-50 30))");
     std::string wkt1("MULTILINESTRING((34 54, 60 34),(0 10, 50 10, 100 50))");
     GeomPtr g0(wktreader.read(wkt0));
     GeomPtr g1(wktreader.read(wkt1));
@@ -334,7 +334,7 @@ void object::test<13>
     using geos::operation::distance::DistanceOp;
     using geos::geom::Coordinate;
 
-    std::string wkt0("MULTIPOINT(-100 0, 35 60)");
+    std::string wkt0("MULTIPOINT((-100 0), (35 60))");
     std::string wkt1("POLYGON((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50))");
     GeomPtr g0(wktreader.read(wkt0));
     GeomPtr g1(wktreader.read(wkt1));
@@ -357,7 +357,7 @@ void object::test<14>
     using geos::operation::distance::DistanceOp;
     using geos::geom::Coordinate;
 
-    std::string wkt0("MULTIPOINT(-100 0, 35 60)");
+    std::string wkt0("MULTIPOINT((-100 0), (35 60))");
     std::string
     wkt1("MULTIPOLYGON(((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)),( (100 100, 150 100, 150 150, 100 150, 100 100),(120 120, 120 130, 130 130, 130 120, 120 120)))");
     GeomPtr g0(wktreader.read(wkt0));
@@ -380,11 +380,11 @@ void object::test<15>
     using geos::operation::distance::DistanceOp;
     using geos::geom::Coordinate;
 
-    std::string wkt0("MULTIPOINT(-100 0, 35 60)");
+    std::string wkt0("MULTIPOINT((-100 0), (35 60))");
 
     // This is an invalid geom... anyway
     std::string
-    wkt1("GEOMETRYCOLLECTION(MULTIPOLYGON(((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)),( (100 100, 150 100, 150 150, 100 150, 100 100),(120 120, 120 130, 130 130, 130 120, 120 120)) ), POLYGON((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)), MULTILINESTRING((34 54, 60 34),(0 10, 50 10, 100 50)), LINESTRING(0 10, 50 10, 100 50), MULTIPOINT(10 0, 50 30), POINT(10 0))");
+    wkt1("GEOMETRYCOLLECTION(MULTIPOLYGON(((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)),( (100 100, 150 100, 150 150, 100 150, 100 100),(120 120, 120 130, 130 130, 130 120, 120 120)) ), POLYGON((34 54, 60 34, 60 54, 34 54),(50 50, 52 50, 52 48, 50 48, 50 50)), MULTILINESTRING((34 54, 60 34),(0 10, 50 10, 100 50)), LINESTRING(0 10, 50 10, 100 50), MULTIPOINT((10 0), (50 30)), POINT(10 0))");
 
     GeomPtr g0(wktreader.read(wkt0));
     GeomPtr g1(wktreader.read(wkt1));
@@ -407,7 +407,7 @@ void object::test<16>
     using geos::operation::distance::DistanceOp;
     using geos::geom::Coordinate;
 
-    std::string wkt0("MULTIPOINT(-100 0, 35 60)");
+    std::string wkt0("MULTIPOINT((-100 0), (35 60))");
 
     // This is an invalid geom... anyway
     std::string wkt1("GEOMETRYCOLLECTION EMPTY");
diff --git a/tests/unit/simplify/DouglasPeuckerSimplifierTest.cpp b/tests/unit/simplify/DouglasPeuckerSimplifierTest.cpp
index 75c987403..e2b4ab415 100644
--- a/tests/unit/simplify/DouglasPeuckerSimplifierTest.cpp
+++ b/tests/unit/simplify/DouglasPeuckerSimplifierTest.cpp
@@ -237,7 +237,7 @@ template<>
 void object::test<9>
 ()
 {
-    std::string wkt_in("MULTIPOINT(80 200, 240 200, 240 60, 80 60, 80 200, 140 199, 120 120)");
+    std::string wkt_in("MULTIPOINT((80 200), (240 200), (240 60), (80 60), (80 200), (140 199), (120 120))");
 
     GeomPtr g(wktreader.read(wkt_in));
 
@@ -278,7 +278,7 @@ void object::test<11>
 ()
 {
     std::string wkt_in("GEOMETRYCOLLECTION ( \
-					MULTIPOINT (80 200, 240 200, 240 60, 80 60, 80 200, 140 199, 120 120), \
+					MULTIPOINT ((80 200), (240 200), (240 60), (80 60), (80 200), (140 199), (120 120)), \
 					POLYGON ((80 200, 240 200, 240 60, 80 60, 80 200)), \
 					LINESTRING (80 200, 240 200, 240 60, 80 60, 80 200, 140 199, 120 120) )");
 
diff --git a/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp b/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp
index ba4a90039..3342f3417 100644
--- a/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp
+++ b/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp
@@ -286,8 +286,8 @@ template<>
 void object::test<13>
 ()
 {
-    std::string wkt("MULTIPOINT(80 200, 240 200, 240 60, \
-                    80 60, 80 200, 140 199, 120 120)");
+    std::string wkt("MULTIPOINT((80 200), (240 200), (240 60), \
+                    (80 60), (80 200), (140 199), (120 120))");
 
     GeomPtr g(wktreader.read(wkt));
     GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 10.0);
@@ -328,7 +328,7 @@ void object::test<15>
 ()
 {
     std::string wkt("GEOMETRYCOLLECTION ( \
-                    MULTIPOINT (80 200, 240 200, 240 60, 80 60, 80 200, 140 199, 120 120), \
+                    MULTIPOINT ((80 200), (240 200), (240 60), (80 60), (80 200), (140 199), (120 120)), \
                     POLYGON ((80 200, 240 200, 240 60, 80 60, 80 200)), \
                     LINESTRING (80 200, 240 200, 240 60, 80 60, 80 200, 140 199, 120 120))");
 
diff --git a/tests/unit/triangulate/VoronoiTest.cpp b/tests/unit/triangulate/VoronoiTest.cpp
index 16bc9199d..b5ce4104e 100644
--- a/tests/unit/triangulate/VoronoiTest.cpp
+++ b/tests/unit/triangulate/VoronoiTest.cpp
@@ -317,7 +317,7 @@ template<>
 void object::test<14>
 ()
 {
-    const char* wkt = "MULTIPOINT (0 0, 1 1, 1 1, 2 2)";
+    const char* wkt = "MULTIPOINT ((0 0), (1 1), (1 1), (2 2))";
 
     try {
         runVoronoi(wkt, "", 0, false, true);

commit abf77347868e16972add4bf498c7e6caf1e84f8f
Author: Mike Taves <mwtoews at gmail.com>
Date:   Thu May 18 12:20:50 2023 +1200

    GeoJSONReader: Fix 2D empty geometry creation (#909)

diff --git a/NEWS.md b/NEWS.md
index 82ac7c79d..1e34e3e07 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -66,6 +66,7 @@ xxxx-xx-xx
   - GEOSHasZ: Fix handling with empty geometries (GH-887, Mike Taves)
   - OffsetCurve: fix EndCap parameter handling (GH-899, Martin Davis)
   - Reduce artifacts in single-sided Buffers: (GH-665 #810 and #712, Sandro Santilli)
+  - GeoJSONReader: Fix 2D empty geometry creation (GH-909, Mike Taves)
 
 - Changes:
   - Remove Orientation.isCCW exception to simplify logic and align with JTS (GH-878, Martin Davis)
diff --git a/src/io/GeoJSONReader.cpp b/src/io/GeoJSONReader.cpp
index 3feb1cce7..444905b0c 100644
--- a/src/io/GeoJSONReader.cpp
+++ b/src/io/GeoJSONReader.cpp
@@ -233,7 +233,7 @@ std::unique_ptr<geom::LineString> GeoJSONReader::readLineString(
     const geos_nlohmann::json& j) const
 {
     const auto& coords = j.at("coordinates").get<std::vector<std::vector<double>>>();
-    auto coordinates = detail::make_unique<CoordinateSequence>();
+    auto coordinates = detail::make_unique<CoordinateSequence>(0u, 2u);
     coordinates->reserve(coords.size());
     for (const auto& coord : coords) {
         const geom::Coordinate& c = readCoordinate(coord);
@@ -256,7 +256,7 @@ std::unique_ptr<geom::Polygon> GeoJSONReader::readPolygon(
     std::vector<std::unique_ptr<geom::LinearRing>> rings;
     rings.reserve(polygonCoords.size());
     for (const auto& ring : polygonCoords) {
-    auto coordinates = detail::make_unique<CoordinateSequence>();
+    auto coordinates = detail::make_unique<CoordinateSequence>(0u, 2u);
         coordinates->reserve(ring.size());
         for (const auto& coord : ring) {
             const geom::Coordinate& c = readCoordinate(coord);
@@ -300,7 +300,7 @@ std::unique_ptr<geom::MultiLineString> GeoJSONReader::readMultiLineString(
     std::vector<std::unique_ptr<geom::LineString>> lines;
     lines.reserve(listOfCoords.size());
     for (const auto& coords :  listOfCoords) {
-        auto coordinates = detail::make_unique<geom::CoordinateSequence>();
+        auto coordinates = detail::make_unique<geom::CoordinateSequence>(0u, 2u);
         coordinates->reserve(coords.size());
         for (const auto& coord : coords) {
             const geom::Coordinate& c = readCoordinate(coord);
diff --git a/tests/unit/io/GeoJSONReaderTest.cpp b/tests/unit/io/GeoJSONReaderTest.cpp
index b51291df3..245a73126 100644
--- a/tests/unit/io/GeoJSONReaderTest.cpp
+++ b/tests/unit/io/GeoJSONReaderTest.cpp
@@ -53,6 +53,7 @@ void object::test<1>
     std::string geojson { "{\"type\":\"Point\",\"coordinates\":[-117.0,33.0]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("POINT (-117.000 33.000)", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON LineString
@@ -64,6 +65,7 @@ void object::test<2>
     std::string geojson { "{\"type\":\"LineString\",\"coordinates\":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("LINESTRING (102.000 0.000, 103.000 1.000, 104.000 0.000, 105.000 1.000)", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON Polygon with only an outer ring
@@ -75,6 +77,7 @@ void object::test<3>
     std::string geojson { "{\"type\":\"Polygon\",\"coordinates\":[[[30,10],[40,40],[20,40],[10,20],[30,10]]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("POLYGON ((30.000 10.000, 40.000 40.000, 20.000 40.000, 10.000 20.000, 30.000 10.000))", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON Point with an outer ring and an inner ring
@@ -86,6 +89,7 @@ void object::test<4>
     std::string geojson { "{\"type\":\"Polygon\",\"coordinates\":[[[35,10],[45,45],[15,40],[10,20],[35,10]],[[20,30],[35,35],[30,20],[20,30]]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("POLYGON ((35.000 10.000, 45.000 45.000, 15.000 40.000, 10.000 20.000, 35.000 10.000), (20.000 30.000, 35.000 35.000, 30.000 20.000, 20.000 30.000))", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON MultiPoint
@@ -97,6 +101,7 @@ void object::test<5>
     std::string geojson { "{\"type\":\"MultiPoint\",\"coordinates\":[[10, 40], [40, 30], [20, 20], [30, 10]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("MULTIPOINT (10.000 40.000, 40.000 30.000, 20.000 20.000, 30.000 10.000)", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON MultiLineString
@@ -108,6 +113,7 @@ void object::test<6>
     std::string geojson { "{\"type\":\"MultiLineString\",\"coordinates\":[[[10, 10], [20, 20], [10, 40]],[[40, 40], [30, 30], [40, 20], [30, 10]]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("MULTILINESTRING ((10.000 10.000, 20.000 20.000, 10.000 40.000), (40.000 40.000, 30.000 30.000, 40.000 20.000, 30.000 10.000))", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON MultiPolygon
@@ -119,6 +125,7 @@ void object::test<7>
     std::string geojson { "{\"type\": \"MultiPolygon\", \"coordinates\": [[[[40, 40], [20, 45], [45, 30], [40, 40]]], [[[20, 35], [10, 30], [10, 10], [30, 5], [45, 20], [20, 35]], [[30, 20], [20, 15], [20, 25], [30, 20]]]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("MULTIPOLYGON (((40.000 40.000, 20.000 45.000, 45.000 30.000, 40.000 40.000)), ((20.000 35.000, 10.000 30.000, 10.000 10.000, 30.000 5.000, 45.000 20.000, 20.000 35.000), (30.000 20.000, 20.000 15.000, 20.000 25.000, 30.000 20.000)))", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON GeometryCollection
@@ -130,6 +137,7 @@ void object::test<8>
     std::string geojson { "{\"type\": \"GeometryCollection\",\"geometries\": [{\"type\": \"Point\",\"coordinates\": [40, 10]},{\"type\": \"LineString\",\"coordinates\": [[10, 10], [20, 20], [10, 40]]},{\"type\": \"Polygon\",\"coordinates\": [[[40, 40], [20, 45], [45, 30], [40, 40]]]}]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("GEOMETRYCOLLECTION (POINT (40.000 10.000), LINESTRING (10.000 10.000, 20.000 20.000, 10.000 40.000), POLYGON ((40.000 40.000, 20.000 45.000, 45.000 30.000, 40.000 40.000)))", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON Feature with a Point and no properties
@@ -141,7 +149,7 @@ void object::test<9>
     std::string geojson { "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-117.0,33.0]}}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("POINT (-117.000 33.000)", geom->toText());
-
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON FeatureCollection with two Feature with Points and no properties
@@ -153,7 +161,7 @@ void object::test<10>
     std::string geojson { "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-117.0,33.0]}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-122.0,45.0]}}]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("GEOMETRYCOLLECTION (POINT (-117.000 33.000), POINT (-122.000 45.000))", geom->toText());
-
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON empty Point
@@ -165,6 +173,7 @@ void object::test<11>
     std::string geojson { "{\"type\":\"Point\",\"coordinates\":[]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("POINT EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON empty LineString
@@ -176,6 +185,7 @@ void object::test<12>
     std::string geojson { "{\"type\":\"LineString\",\"coordinates\":[]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("LINESTRING EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON empty Polygon
@@ -187,6 +197,7 @@ void object::test<13>
     std::string geojson { "{\"type\":\"Polygon\",\"coordinates\":[]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("POLYGON EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON empty MultiPoint
@@ -198,6 +209,7 @@ void object::test<14>
     std::string geojson { "{\"type\":\"MultiPoint\",\"coordinates\":[]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("MULTIPOINT EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON empty MultiLineString
@@ -209,6 +221,7 @@ void object::test<15>
     std::string geojson { "{\"type\":\"MultiLineString\",\"coordinates\":[]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("MULTILINESTRING EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON empty MultiPolygon
@@ -220,6 +233,7 @@ void object::test<16>
     std::string geojson { "{\"type\": \"MultiPolygon\", \"coordinates\": []}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("MULTIPOLYGON EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read an empty GeometryCollection
@@ -231,6 +245,7 @@ void object::test<17>
     std::string geojson { "{\"type\": \"GeometryCollection\",\"geometries\": []}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("GEOMETRYCOLLECTION EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a Simple Feature
@@ -242,6 +257,7 @@ void object::test<18>
     std::string geojson { "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-117.0,33.0]}, \"properties\": {\"id\": 1, \"name\": \"one\", \"required\": true} }" };
     geos::io::GeoJSONFeatureCollection features(geojsonreader.readFeatures(geojson));
     ensure_equals(static_cast<size_t>(1), features.getFeatures().size());
+    ensure_equals(static_cast<size_t>(features.getFeatures()[0].getGeometry()->getCoordinateDimension()), 2u);
     ensure_equals("POINT (-117.000 33.000)", features.getFeatures()[0].getGeometry()->toText());
     ensure_equals(1.0, features.getFeatures()[0].getProperties().at("id").getNumber());
     ensure_equals("one", features.getFeatures()[0].getProperties().at("name").getString());
@@ -257,6 +273,7 @@ void object::test<19>
     std::string geojson { "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-117.0,33.0]}, \"properties\": {\"id\": 1, \"name\": \"one\", \"items\": [1,2,3,4], \"nested\": {\"id\":2, \"name\":\"two\"}}}" };
     geos::io::GeoJSONFeatureCollection features(geojsonreader.readFeatures(geojson));
     ensure_equals(static_cast<size_t>(1), features.getFeatures().size());
+    ensure_equals(static_cast<size_t>(features.getFeatures()[0].getGeometry()->getCoordinateDimension()), 2u);
     ensure_equals("POINT (-117.000 33.000)", features.getFeatures()[0].getGeometry()->toText());
     ensure_equals(1.0, features.getFeatures()[0].getProperties().at("id").getNumber());
     ensure_equals("one", features.getFeatures()[0].getProperties().at("name").getString());
@@ -281,6 +298,7 @@ void object::test<20>
      "]}" };
     geos::io::GeoJSONFeatureCollection features(geojsonreader.readFeatures(geojson));
     ensure_equals(static_cast<size_t>(3), features.getFeatures().size());
+    ensure_equals(static_cast<size_t>(features.getFeatures()[0].getGeometry()->getCoordinateDimension()), 2u);
     ensure_equals("POLYGON ((87.890 64.923, 76.992 55.178, 102.656 46.558, 115.312 60.413, 94.570 58.447, 87.890 64.923))", features.getFeatures()[0].getGeometry()->toText());
     ensure_equals(1.0, features.getFeatures()[0].getProperties().at("id").getNumber());
     ensure_equals("LINESTRING (1.406 48.690, 41.835 34.016, 22.500 13.923)", features.getFeatures()[1].getGeometry()->toText());
@@ -298,6 +316,7 @@ void object::test<21>
     std::string geojson { "{\"type\":\"Polygon\",\"coordinates\":[[]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("POLYGON EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON Point with only one coordinate
@@ -404,6 +423,7 @@ void object::test<27>
     std::string geojson { "{\"type\":\"Polygon\",\"coordinates\":[[],[]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("POLYGON EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON empty MultiLineString with empty LineStrings
@@ -415,6 +435,7 @@ void object::test<28>
     std::string geojson { "{\"type\":\"MultiLineString\",\"coordinates\":[[],[],[]]}" };
     GeomPtr geom(geojsonreader.read(geojson));
     ensure_equals("MULTILINESTRING EMPTY", geom->toText());
+    ensure_equals(static_cast<size_t>(geom->getCoordinateDimension()), 2u);
 }
 
 // Read a GeoJSON Point with too many coordinates

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

Summary of changes:
 .gitignore                                         |  1 +
 NEWS.md                                            |  2 ++
 src/io/GeoJSONReader.cpp                           |  6 ++---
 src/io/WKTWriter.cpp                               |  2 ++
 tests/unit/algorithm/ConvexHullTest.cpp            | 12 ++++-----
 .../distance/DiscreteFrechetDistanceTest.cpp       |  2 +-
 .../distance/DiscreteHausdorffDistanceTest.cpp     |  2 +-
 tests/unit/capi/GEOSConvexHullTest.cpp             |  2 +-
 tests/unit/capi/GEOSDelaunayTriangulationTest.cpp  |  6 ++---
 tests/unit/capi/GEOSGeomFromWKBTest.cpp            |  2 +-
 tests/unit/capi/GEOSGeomToWKBTest.cpp              |  2 +-
 tests/unit/capi/GEOSGeomToWKTTest.cpp              |  2 +-
 tests/unit/capi/GEOSGeom_createCollectionTest.cpp  |  2 +-
 .../unit/capi/GEOSGeom_extractUniquePointsTest.cpp |  8 +++---
 tests/unit/capi/GEOSGetGeometryNTest.cpp           |  2 +-
 tests/unit/capi/GEOSSnapTest.cpp                   |  8 +++---
 tests/unit/capi/GEOSUnaryUnionPrecTest.cpp         |  6 ++---
 tests/unit/capi/GEOSUnaryUnionTest.cpp             | 10 +++----
 tests/unit/capi/GEOSUnionCascadedTest.cpp          |  2 +-
 tests/unit/capi/GEOSUnionPrecTest.cpp              |  2 +-
 tests/unit/capi/GEOSUnionTest.cpp                  |  2 +-
 tests/unit/geom/Geometry/cloneTest.cpp             |  2 +-
 tests/unit/geom/Geometry/normalizeTest.cpp         | 16 +++++------
 tests/unit/geom/GeometryFactoryTest.cpp            |  4 +--
 tests/unit/geom/MultiPointTest.cpp                 | 31 +++++++++++++++-------
 .../unit/geom/prep/PreparedGeometryFactoryTest.cpp |  4 +--
 tests/unit/io/GeoJSONReaderTest.cpp                | 27 ++++++++++++++++---
 tests/unit/io/WKBReaderTest.cpp                    |  6 ++---
 tests/unit/io/WKTWriterTest.cpp                    |  2 +-
 .../operation/cluster/DisjointOperationTest.cpp    |  2 +-
 .../operation/cluster/GeometryFlattenerTest.cpp    |  4 +--
 tests/unit/operation/distance/DistanceOpTest.cpp   | 24 ++++++++---------
 .../unit/simplify/DouglasPeuckerSimplifierTest.cpp |  4 +--
 .../simplify/TopologyPreservingSimplifierTest.cpp  |  6 ++---
 tests/unit/triangulate/VoronoiTest.cpp             |  2 +-
 web/content/usage/download.md                      |  6 +++--
 36 files changed, 131 insertions(+), 92 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list