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

git at osgeo.org git at osgeo.org
Mon Sep 20 17:00:57 PDT 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, main has been updated
       via  f2135c8697ba3e7315a6a45871b523fba47d100f (commit)
      from  7819df9c5557cce672911d17d3a14a471e26cbe0 (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 f2135c8697ba3e7315a6a45871b523fba47d100f
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Mon Sep 20 17:00:50 2021 -0700

    Add geosop future function code

diff --git a/util/geosop/GeomFunction.cpp b/util/geosop/GeomFunction.cpp
index 0f7ad7b..c9a0e5a 100644
--- a/util/geosop/GeomFunction.cpp
+++ b/util/geosop/GeomFunction.cpp
@@ -49,6 +49,7 @@
 #include <sstream>
 
 using geos::operation::overlayng::OverlayNG;
+using geos::algorithm::distance::DiscreteFrechetDistance;
 
 /* static private */
 std::map<std::string, GeomFunction*> GeomFunction::registry;
@@ -373,6 +374,29 @@ GeomFunction::init()
             (void)d;  // prevent unused variable warning
             return new Result( geos::algorithm::distance::DiscreteFrechetDistance::distance(*geom, *geomB ) );
         });
+        /*
+        // MD - can't get this to work for now
+     add("frechetDistanceLine", 2, 0, Result::typeGeometry, catDist,
+        "computes a line indicating the discrete Frechet distance between geometry A and B",
+        [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
+            (void)d;  // prevent unused variable warning
+            DiscreteFrechetDistance dist(*geom, *geomB);
+            //--- not supported for now
+            //dist.setDensifyFraction(d);
+            const std::array<geom::Coordinate, 2> ptArray = dist.getCoordinates();
+
+            std::unique_ptr<std::vector<Coordinate>> pts(new std::vector<Coordinate>(2));
+            (*pts)[0] = ptArray[0];
+            (*pts)[1] = ptArray[1];
+            //std::cout << ptArray[0] << std::endl;
+            //std::cout << ptArray[1] << std::endl;
+            auto cs = std::unique_ptr<CoordinateSequence>(new CoordinateArraySequence(pts.release()));
+
+            auto factory = geom->getFactory();
+            auto res = factory->createLineString( std::move(cs) );
+            return new Result( std::move(res) );
+        });
+        */
     add("distancePrep", 2, 0, Result::typeDouble, catDist,
         "computes distance between geometry A and B using PreparedGeometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {

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

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


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list