[geos-commits] [SCM] GEOS branch master updated. 534eebc107a996b51376c25505649a273dbe96a6

git at osgeo.org git at osgeo.org
Thu Jan 7 15:57:03 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  534eebc107a996b51376c25505649a273dbe96a6 (commit)
      from  74efffbfc8487e3a8cb128e9cb5d69886482b0f7 (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 534eebc107a996b51376c25505649a273dbe96a6
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Thu Jan 7 15:56:57 2021 -0800

    Add geosop functions

diff --git a/util/geosop/GeomFunction.cpp b/util/geosop/GeomFunction.cpp
index 7ea8ed7..1779e1b 100644
--- a/util/geosop/GeomFunction.cpp
+++ b/util/geosop/GeomFunction.cpp
@@ -23,6 +23,8 @@
 #include <geos/geom/GeometryFactory.h>
 #include <geos/geom/prep/PreparedGeometry.h>
 #include <geos/geom/prep/PreparedGeometryFactory.h>
+#include <geos/algorithm/construct/MaximumInscribedCircle.h>
+#include <geos/algorithm/MinimumBoundingCircle.h>
 #include <geos/operation/distance/DistanceOp.h>
 #include <geos/operation/relate/RelateOp.h>
 #include <geos/operation/valid/MakeValid.h>
@@ -99,6 +101,11 @@ GeomFunction::init()
             return new Result( geom->intersects( geomB.get() ) );
         });
 
+    add("isSimple", "tests if geometry A is simple", 1, 0,
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            return new Result( geom->isSimple() );
+        });
+
     add("isValid", "tests if geometry A is valid", 1, 0,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             return new Result( geom->isValid() );
@@ -114,6 +121,19 @@ GeomFunction::init()
             return new Result( geos::operation::valid::MakeValid().build( geom.get() ) );
         });
 
+    add("maxInscribedCircle", "computes maximum inscribed circle radius of Polygon A up to a distance tolerance", 2, 0,
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            geos::algorithm::construct::MaximumInscribedCircle mc( geom.get(), d );
+            std::unique_ptr<Geometry> res = mc.getRadiusLine();
+            return new Result( std::move(res) );
+        });
+    add("minBoundingCircle",
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            geos::algorithm::MinimumBoundingCircle mc( geom.get() );
+            std::unique_ptr<Geometry> res = mc.getCircle();
+            return new Result( std::move(res) );
+        });
+
     add("nearestPoints", "computes nearest points of geometry A and B", 2, 0,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             std::unique_ptr<CoordinateSequence> cs = geos::operation::distance::DistanceOp::nearestPoints(geom.get(), geomB.get());
@@ -136,6 +156,11 @@ GeomFunction::init()
             Geometry * res = factory->createGeometryCollection(geoms);
             return new Result( res) ;
         });
+    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("containsPrep", "tests if geometry A contains geometry B, using PreparedGeometry", 2, 0,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
@@ -236,22 +261,22 @@ GeomFunction::init()
             return new Result( geom->Union( geomB.get() ) );
         });
 
-    add("differenceSR", "computes difference of geometry A from B rounding to a precision scale factor", 2, 0,
+    add("differenceSR", "computes difference of geometry A from B, snap-rounding to a precision scale factor", 2, 1,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             geom::PrecisionModel pm(d);
             return new Result( OverlayNG::overlay(geom.get(), geomB.get(), OverlayNG::DIFFERENCE, &pm) );
         });
-    add("intersectionSR", "computes intersection of geometry A and B", 2, 0,
+    add("intersectionSR", "computes intersection of geometry A and B, snap-rounding to a precision scale factor", 2, 1,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             geom::PrecisionModel pm(d);
             return new Result( OverlayNG::overlay(geom.get(), geomB.get(), OverlayNG::INTERSECTION, &pm) );
         });
-    add("symDifferenceSR", "computes symmetric difference of geometry A and B", 2, 0,
+    add("symDifferenceSR", "computes symmetric difference of geometry A and B, snap-rounding to a precision scale factor", 2, 1,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             geom::PrecisionModel pm(d);
             return new Result( OverlayNG::overlay(geom.get(), geomB.get(), OverlayNG::SYMDIFFERENCE, &pm) );
         });
-    add("unionSR", "computes union of geometry A and B", 2, 0,
+    add("unionSR", "computes union of geometry A and B, snap-rounding to a precision scale factor", 2, 1,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             geom::PrecisionModel pm(d);
             return new Result( OverlayNG::overlay(geom.get(), geomB.get(), OverlayNG::UNION, &pm) );

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

Summary of changes:
 util/geosop/GeomFunction.cpp | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list