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

git at osgeo.org git at osgeo.org
Tue Jun 27 14:21:56 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  ffe797845ce0d2ce717979325b9aff7169302f51 (commit)
       via  b4689def9085a2f9345424bde42266cc3615b3d3 (commit)
      from  c15b3276bb8106d87c2a953fec210b0a59659d78 (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 ffe797845ce0d2ce717979325b9aff7169302f51
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jun 27 14:20:22 2023 -0700

    Quiet some warnings in the MSVC build.
    Gets rid of all noise except the obscure issue with
    lambdas complaining when they call a method that is
    defined as both a static and non-static version with
    the same function name.
    References GH-929.

diff --git a/include/geos/precision/GeometryPrecisionReducer.h b/include/geos/precision/GeometryPrecisionReducer.h
index 5aca042af..cd8ccfed9 100644
--- a/include/geos/precision/GeometryPrecisionReducer.h
+++ b/include/geos/precision/GeometryPrecisionReducer.h
@@ -193,6 +193,8 @@ public:
 
     std::unique_ptr<geom::Geometry> reduce(const geom::Geometry& geom);
 
+
+
 };
 
 } // namespace geos.precision
diff --git a/src/precision/GeometryPrecisionReducer.cpp b/src/precision/GeometryPrecisionReducer.cpp
index 9936ef455..a4d6a3d9c 100644
--- a/src/precision/GeometryPrecisionReducer.cpp
+++ b/src/precision/GeometryPrecisionReducer.cpp
@@ -41,37 +41,6 @@ namespace geos {
 namespace precision { // geos.precision
 
 
-/* public */
-std::unique_ptr<Geometry>
-GeometryPrecisionReducer::reduce(const Geometry& geom)
-{
-    std::unique_ptr<Geometry> reduced;
-    if (isPointwise) {
-        reduced = PointwisePrecisionReducerTransformer::reduce(geom, targetPM);
-    }
-    else {
-        reduced = PrecisionReducerTransformer::reduce(geom, targetPM, removeCollapsed);
-    }
-
-    // Match the collection level of the output to the input
-    // if necessary
-    if (geom.isCollection()
-        && ! reduced->isCollection()
-        && (geom.getCoordinateDimension() == reduced->getCoordinateDimension()))
-    {
-        reduced = geom.getFactory()->createMulti(std::move(reduced));
-    }
-
-    // TODO: incorporate this in the Transformer above
-    if (changePrecisionModel &&
-        (&targetPM != geom.getFactory()->getPrecisionModel()))
-    {
-         return changePM(reduced.get(), targetPM);
-    }
-
-    return reduced;
-}
-
 
 /* private */
 std::unique_ptr<Geometry>
@@ -156,6 +125,36 @@ GeometryPrecisionReducer::createFactory(const GeometryFactory& oldGF,
     return p_newFactory;
 }
 
+/* public */
+std::unique_ptr<Geometry>
+GeometryPrecisionReducer::reduce(const Geometry& geom)
+{
+    std::unique_ptr<Geometry> reduced;
+    if (isPointwise) {
+        reduced = PointwisePrecisionReducerTransformer::reduce(geom, targetPM);
+    }
+    else {
+        reduced = PrecisionReducerTransformer::reduce(geom, targetPM, removeCollapsed);
+    }
+
+    // Match the collection level of the output to the input
+    // if necessary
+    if (geom.isCollection()
+        && ! reduced->isCollection()
+        && (geom.getCoordinateDimension() == reduced->getCoordinateDimension()))
+    {
+        reduced = geom.getFactory()->createMulti(std::move(reduced));
+    }
+
+    // TODO: incorporate this in the Transformer above
+    if (changePrecisionModel &&
+        (&targetPM != geom.getFactory()->getPrecisionModel()))
+    {
+         return changePM(reduced.get(), targetPM);
+    }
+
+    return reduced;
+}
 
 
 } // namespace geos.precision
diff --git a/tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp b/tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp
index 7a7add925..be67b9a2e 100644
--- a/tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp
+++ b/tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp
@@ -13,6 +13,7 @@
 #include <geos/geom/PrecisionModel.h>
 #include <geos/io/WKTReader.h>
 #include <geos/io/WKTWriter.h>
+#include <geos/util.h>
 // std
 #include <sstream>
 #include <string>
@@ -210,13 +211,17 @@ void object::test<8>
     try {
         MaximumInscribedCircle mic(g1.get(), 1);
         mic.getCenter();
-    } catch (const util::GEOSException & e) {}
+    } catch (const util::GEOSException & e) {
+        ::geos::ignore_unused_variable_warning(e);
+    }
 
     auto g2 = reader_.read("POLYGON ((0 0, 1 0, 2 NaN,  0 0))");
     try {
         MaximumInscribedCircle mic(g1.get(), 1);
         mic.getCenter();
-    } catch (const util::GEOSException & e) {}
+    } catch (const util::GEOSException & e) {
+        ::geos::ignore_unused_variable_warning(e);
+    }
 }
 
   /**
diff --git a/tests/unit/algorithm/distance/DiscreteFrechetDistanceTest.cpp b/tests/unit/algorithm/distance/DiscreteFrechetDistanceTest.cpp
index 9e0be782e..7ffbe62a0 100644
--- a/tests/unit/algorithm/distance/DiscreteFrechetDistanceTest.cpp
+++ b/tests/unit/algorithm/distance/DiscreteFrechetDistanceTest.cpp
@@ -11,6 +11,7 @@
 #include <geos/geom/GeometryFactory.h>
 #include <geos/geom/Geometry.h> // required for use in unique_ptr
 #include <geos/geom/Coordinate.h>
+#include <geos/util.h>
 // std
 #include <cmath>
 #include <sstream>
@@ -102,24 +103,27 @@ void object::test<1>
     try {
         runTest("LINESTRING (0 0, 2 1)", "LINESTRING EMPTY", 0.0, 0);
     }
-    catch(const geos::util::IllegalArgumentException& ) {
+    catch(const geos::util::IllegalArgumentException& e) {
         // We do expect an exception
+        ::geos::ignore_unused_variable_warning(e);
     }
 
     // too big densify factor
     try {
         runTest("LINESTRING (0 0, 2 1)", "LINESTRING EMPTY", 1 + 1e-10, 0);
     }
-    catch(const geos::util::IllegalArgumentException& ) {
+    catch(const geos::util::IllegalArgumentException& e) {
         // We do expect an exception
+        ::geos::ignore_unused_variable_warning(e);
     }
 
     // too small positive densify factor
     try {
         runTest("LINESTRING (0 0, 2 1)", "LINESTRING EMPTY", 1e-30, 0);
     }
-    catch(const geos::util::IllegalArgumentException& ) {
+    catch(const geos::util::IllegalArgumentException& e) {
         // We do expect an exception
+        ::geos::ignore_unused_variable_warning(e);
     }
 }
 
@@ -176,7 +180,7 @@ void object::test<6>
     try {
         DiscreteFrechetDistance::distance(*g1, *g2);
     } catch (const geos::util::GEOSException& e) {
-
+        ::geos::ignore_unused_variable_warning(e);
     }
 }
 
diff --git a/tests/unit/operation/overlayng/CoverageUnionNGTest.cpp b/tests/unit/operation/overlayng/CoverageUnionNGTest.cpp
index aec919b20..c6ca01fbc 100644
--- a/tests/unit/operation/overlayng/CoverageUnionNGTest.cpp
+++ b/tests/unit/operation/overlayng/CoverageUnionNGTest.cpp
@@ -6,6 +6,7 @@
 
 // geos
 #include <geos/operation/overlayng/CoverageUnion.h>
+#include <geos/util.h>
 
 // std
 #include <memory>
@@ -36,6 +37,7 @@ struct test_coverageunionng_data {
         try {
             ensure_equals_geometry_xyzm(result.get(), expected.get());
         } catch (const std::exception& e) {
+            ::geos::ignore_unused_variable_warning(e);
             std::string wkt_result = w.write(result.get());
             std::cerr << std::endl << wkt_result << std::endl;
             throw;
diff --git a/tests/unit/triangulate/VoronoiTest.cpp b/tests/unit/triangulate/VoronoiTest.cpp
index 922060295..5333de0dc 100644
--- a/tests/unit/triangulate/VoronoiTest.cpp
+++ b/tests/unit/triangulate/VoronoiTest.cpp
@@ -17,6 +17,8 @@
 #include <geos/geom/GeometryFactory.h>
 
 #include <geos/geom/CoordinateSequence.h>
+#include <geos/util.h>
+
 //#include <stdio.h>
 #include <iostream>
 using namespace geos::triangulate;
@@ -322,6 +324,7 @@ void object::test<14>
         runVoronoi(wkt, "", 0, false, true);
         fail();
     } catch (const geos::util::GEOSException & e) {
+        ::geos::ignore_unused_variable_warning(e);
     }
 }
 
diff --git a/util/geosop/GeosOp.cpp b/util/geosop/GeosOp.cpp
index 45aefbc66..dda2c2e9e 100644
--- a/util/geosop/GeosOp.cpp
+++ b/util/geosop/GeosOp.cpp
@@ -130,7 +130,7 @@ int main(int argc, char** argv) {
         auto fmt = result["format"].as<std::string>();
         // Use lowercase matching
         std::transform(fmt.begin(), fmt.end(), fmt.begin(),
-            [](unsigned char c){ return std::tolower(c); });
+            [](unsigned char c){ return (unsigned char)std::tolower(c); });
         if (fmt == "txt" || fmt == "wkt" ) {
             cmdArgs.format = GeosOpArgs::fmtText;
         }

commit b4689def9085a2f9345424bde42266cc3615b3d3
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jun 27 12:43:17 2023 -0700

    Move NaN change entries to appropriate release

diff --git a/NEWS.md b/NEWS.md
index 94a366e5a..df0b6d7d3 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -6,6 +6,8 @@
 - Breaking Changes
 
 - Fixes/Improvements:
+  - WKTReader: Points with all-NaN coordinates are not considered empty anymore (GH-927, Casper van der Wel)
+  - WKTWriter: Points with all-NaN coordinates are written as such (GH-927, Casper van der Wel)
 
 
 ## Changes in 3.12.0
@@ -39,13 +41,11 @@
   - CoverageUnion now requires valid inputs to produce valid outputs
     and may return invalid outputs silently when fed invalid inputs.
     Use CoverageValidator first if you do not know the validity of your data.
-  - WKTReader: Points with all-NaN coordinates are not considered empty anymore (#..., Casper van der Wel)
 
 - Fixes/Improvements:
   - WKTReader: Fix parsing of Z and M flags in WKTReader (#676 and GH-669, Dan Baston)
   - WKTReader: Throw exception on inconsistent geometry dimension (#1080, Dan Baston)
   - WKTReader: Throw exception if WKT contains extra text after end of geometry (#1095, Dan Baston)
-  - WKTReader: Points with all-NaN coordinates are written as such (#..., Casper van der Wel)
   - GEOSIntersects: Fix crash with empty point inputs (#1110, Dan Baston)
   - GEOSIntersects: Improve performance/robustness by using PreparedGeometry algorithm (GH-775, Dan Baston)
   - LineMerger: Recursively collect all components from GeometryCollections (#401, Dan Baston)

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

Summary of changes:
 NEWS.md                                            |  4 +-
 include/geos/precision/GeometryPrecisionReducer.h  |  2 +
 src/precision/GeometryPrecisionReducer.cpp         | 61 +++++++++++-----------
 .../construct/MaximumInscribedCircleTest.cpp       |  9 +++-
 .../distance/DiscreteFrechetDistanceTest.cpp       | 12 +++--
 .../operation/overlayng/CoverageUnionNGTest.cpp    |  2 +
 tests/unit/triangulate/VoronoiTest.cpp             |  3 ++
 util/geosop/GeosOp.cpp                             |  2 +-
 8 files changed, 55 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list