[geos-commits] [SCM] GEOS branch master updated. b77182f363505ccca3969a1f0a4d3e27a69e80b1

git at osgeo.org git at osgeo.org
Tue Jan 12 14:18:36 PST 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, master has been updated
       via  b77182f363505ccca3969a1f0a4d3e27a69e80b1 (commit)
      from  cc3dfc922408565fcda955882232b21a0c8e2220 (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 b77182f363505ccca3969a1f0a4d3e27a69e80b1
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Tue Jan 12 14:18:29 2021 -0800

    Add geosop simplifyDP and simplifyTP

diff --git a/util/geosop/GeomFunction.cpp b/util/geosop/GeomFunction.cpp
index 9c55d22..9e8d407 100644
--- a/util/geosop/GeomFunction.cpp
+++ b/util/geosop/GeomFunction.cpp
@@ -31,6 +31,8 @@
 #include <geos/operation/overlayng/OverlayNG.h>
 #include <geos/operation/polygonize/Polygonizer.h>
 #include <geos/precision/GeometryPrecisionReducer.h>
+#include <geos/simplify/DouglasPeuckerSimplifier.h>
+#include <geos/simplify/TopologyPreservingSimplifier.h>
 #include <geos/triangulate/DelaunayTriangulationBuilder.h>
 #include <geos/triangulate/VoronoiDiagramBuilder.h>
 
@@ -269,6 +271,14 @@ GeomFunction::init()
             std::unique_ptr<geom::IntersectionMatrix> im(geom->relate( geomB.get() ));
             return new Result( im->toString() );
         });
+    add("simplifyDP", "simplifies geometry A using Douglas-Peucker with a distance tolerance", 1, 1,
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            return new Result( geos::simplify::DouglasPeuckerSimplifier::simplify(geom.get(), d) );
+         });
+    add("simplifyTP", "simplifies geometry A using Douglas-Peucker with a distance tolerance, preserving topology", 1, 1,
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            return new Result( geos::simplify::TopologyPreservingSimplifier::simplify(geom.get(), d) );
+         });
 
 
     add("difference", "computes difference of geometry A from B", 2, 0,
diff --git a/util/geosop/GeosOp.cpp b/util/geosop/GeosOp.cpp
index 5f04bb0..108f076 100644
--- a/util/geosop/GeosOp.cpp
+++ b/util/geosop/GeosOp.cpp
@@ -77,10 +77,10 @@ int main(int argc, char** argv) {
         ("b", "source for B geometries (WKT, WKB, file, stdin, stdin.wkb)", cxxopts::value<std::string>( cmdArgs.srcB ))
         ("alimit", "Limit nunber of A geometries read", cxxopts::value<int>( cmdArgs.limitA ))
         ("c,collect", "Collect input into single geometry", cxxopts::value<bool>( cmdArgs.isCollect ))
-        ("e,explode", "Explode result", cxxopts::value<bool>( cmdArgs.isExplode))
-        ("f,format", "Output format", cxxopts::value<std::string>( ))
+        ("e,explode", "Explode results into conponent geometris", cxxopts::value<bool>( cmdArgs.isExplode))
+        ("f,format", "Output format (wkt, wkb or txt)", cxxopts::value<std::string>( ))
         ("h,help", "Print help")
-        ("p,precision", "Sets number of decimal places in WKT output", cxxopts::value<int>( cmdArgs.precision ) )
+        ("p,precision", "Sets number of decimal places in output coordinates", cxxopts::value<int>( cmdArgs.precision ) )
         ("t,time", "Print execution time", cxxopts::value<bool>( cmdArgs.isShowTime ) )
         ("v,verbose", "Verbose output", cxxopts::value<bool>( cmdArgs.isVerbose )->default_value("false"))
 
@@ -92,9 +92,7 @@ int main(int argc, char** argv) {
     auto result = options.parse(argc, argv);
 
     if (argc <= 1 || result.count("help")) {
-        if (result.count("help")) {
-            std::cout << "geosop - GEOS v. " << geosversion() << std::endl;
-        }
+        std::cout << "geosop - GEOS " << geosversion() << std::endl;
         options.positional_help("opName opArg");
         std::cout << options.help() << std::endl;
         //showHelp();
@@ -334,6 +332,7 @@ void GeosOp::run() {
             << "Processed " <<  opCount << " " << args.opName << " ops ( "
             << vertexCount << " vertices)"
             << "  -- " << timeFormatted( totalTime )
+            << "    (GEOS " << geosversion() << ")"
             << std::endl;
     }
 }

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

Summary of changes:
 util/geosop/GeomFunction.cpp | 10 ++++++++++
 util/geosop/GeosOp.cpp       | 11 +++++------
 2 files changed, 15 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list