[geos-commits] [SCM] GEOS branch main updated. 180fe65edcf2509d2a4766c010c0861bb3e5388f

git at osgeo.org git at osgeo.org
Wed Sep 29 13:16:07 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  180fe65edcf2509d2a4766c010c0861bb3e5388f (commit)
      from  ba10ba4508af887a1a78bbc632ab45d89ce3242c (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 180fe65edcf2509d2a4766c010c0861bb3e5388f
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Sep 29 22:15:44 2021 +0200

    Hook GEOSDistanceWithin to the Geometry::isWithinDistance method
    
    NOTE: the geometry method can still be optimized

diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index 64d44bf..cc6d9e7 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -808,9 +808,8 @@ extern "C" {
     char
     GEOSDistanceWithin_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2, double dist)
     {
-        // TODO: optimize this
         return execute(extHandle, 2, [&]() {
-            return g1->distance(g2) <= dist;
+            return g1->isWithinDistance(g2, dist);
         });
     }
 
@@ -3287,7 +3286,7 @@ extern "C" {
                          const geos::geom::prep::PreparedGeometry* pg,
                          const Geometry* g, double dist)
     {
-        // TODO: optimize this
+        // TODO: further optimize this ?
         return execute(extHandle, 2, [&]() {
             return pg->distance(g) <= dist;
         });

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

Summary of changes:
 capi/geos_ts_c.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list