[geos-commits] [SCM] GEOS branch master updated. 995b5574dc7117a1367393c4e1cf2eeb1387b2fc

git at osgeo.org git at osgeo.org
Tue Jan 12 20:02: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  995b5574dc7117a1367393c4e1cf2eeb1387b2fc (commit)
      from  f107c5b20bf5f1359e01a6a8a0265f3f99c64c9d (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 995b5574dc7117a1367393c4e1cf2eeb1387b2fc
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Tue Jan 12 20:03:33 2021 -0800

    Add geosop normalize operation

diff --git a/util/geosop/GeomFunction.cpp b/util/geosop/GeomFunction.cpp
index 9e8d407..c818711 100644
--- a/util/geosop/GeomFunction.cpp
+++ b/util/geosop/GeomFunction.cpp
@@ -145,6 +145,12 @@ GeomFunction::init()
             auto res = factory->createLineString( std::move(cs) );
             return new Result( std::move(res) );
         });
+    add("normalize", "normalizes geometry A", 1, 0,
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            auto res = geom->clone();
+            res->normalize();
+            return new Result( std::move(res) );
+        });
 
     add("delaunay", "computes the Delaunay Triangulation of geometry A vertices", 1, 0,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
@@ -189,10 +195,28 @@ GeomFunction::init()
             return new Result( std::move(geoms) ) ;
         });
 
+    add("reducePrecision", "reduces precision of geometry to a precision scale factor", 1, 1,
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            PrecisionModel pm(d);
+            return new Result( geos::precision::GeometryPrecisionReducer::reduce( *geom, pm ) );
+        });
+    add("relate", "computes DE-9IM matrix for geometry A and B", 2, 0,
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            std::unique_ptr<geom::IntersectionMatrix> im(geom->relate( geomB.get() ));
+            return new Result( im->toString() );
+        });
     add("reverse", "reverses geometry A", 1, 0,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             return new Result( geom->reverse() );
         });
+    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("containsPrep", "tests if geometry A contains geometry B, using PreparedGeometry", 2, 0,
@@ -261,25 +285,6 @@ GeomFunction::init()
         });
 
 
-    add("reducePrecision", "reduces precision of geometry to a precision scale factor", 1, 1,
-        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
-            PrecisionModel pm(d);
-            return new Result( geos::precision::GeometryPrecisionReducer::reduce( *geom, pm ) );
-        });
-    add("relate", "computes DE-9IM matrix for geometry A and B", 2, 0,
-        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
-            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,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {

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

Summary of changes:
 util/geosop/GeomFunction.cpp | 43 ++++++++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list