[geos-commits] r4304 - in branches/3.6: . capi

Sandro Santilli strk at kbt.io
Thu Nov 10 08:12:36 PST 2016


Author: strk
Date: 2016-11-10 08:12:36 -0800 (Thu, 10 Nov 2016)
New Revision: 4304

Modified:
   branches/3.6/NEWS
   branches/3.6/capi/geos_c.cpp
   branches/3.6/capi/geos_c.h.in
   branches/3.6/capi/geos_ts_c.cpp
Log:
Fix GEOSSTRtree_nearest_r signature and add missing implementation

Closes #796

Modified: branches/3.6/NEWS
===================================================================
--- branches/3.6/NEWS	2016-11-10 16:11:25 UTC (rev 4303)
+++ branches/3.6/NEWS	2016-11-10 16:12:36 UTC (rev 4304)
@@ -2,6 +2,7 @@
 2016-MM-DD
 
 - Bug fixes / improvements
+  - Fix GEOSSTRtree_nearest_r signature and add implementation (#796)
 
 Changes in 3.6.0
 2016-10-25

Modified: branches/3.6/capi/geos_c.cpp
===================================================================
--- branches/3.6/capi/geos_c.cpp	2016-11-10 16:11:25 UTC (rev 4303)
+++ branches/3.6/capi/geos_c.cpp	2016-11-10 16:12:36 UTC (rev 4304)
@@ -717,7 +717,7 @@
     return GEOSSetSRID_r( handle, g, srid );
 }
 
-void * 
+void *
 GEOSGeom_getUserData(const Geometry *g)
 {
     return GEOSGeom_getUserData_r( handle, g );
@@ -1174,7 +1174,7 @@
 GEOSSTRtree_nearest (geos::index::strtree::STRtree *tree,
                      const geos::geom::Geometry *g)
 {
-    return (const GEOSGeometry*) GEOSSTRtree_nearest_generic( tree, g, g, NULL, NULL);
+    return GEOSSTRtree_nearest_r( handle, tree, g);
 }
 
 const void* GEOSSTRtree_nearest_generic(GEOSSTRtree *tree,

Modified: branches/3.6/capi/geos_c.h.in
===================================================================
--- branches/3.6/capi/geos_c.h.in	2016-11-10 16:11:25 UTC (rev 4303)
+++ branches/3.6/capi/geos_c.h.in	2016-11-10 16:12:36 UTC (rev 4304)
@@ -823,7 +823,7 @@
                                          GEOSQueryCallback callback,
                                          void *userdata);
 
-extern const void GEOS_DLL *GEOSSTRtree_nearest_r(GEOSContextHandle_t handle,
+extern const GEOSGeometry GEOS_DLL *GEOSSTRtree_nearest_r(GEOSContextHandle_t handle,
                                                   GEOSSTRtree *tree,
                                                   const GEOSGeometry* geom);
 

Modified: branches/3.6/capi/geos_ts_c.cpp
===================================================================
--- branches/3.6/capi/geos_ts_c.cpp	2016-11-10 16:11:25 UTC (rev 4303)
+++ branches/3.6/capi/geos_ts_c.cpp	2016-11-10 16:12:36 UTC (rev 4304)
@@ -6066,6 +6066,14 @@
     }
 }
 
+const GEOSGeometry *
+GEOSSTRtree_nearest_r(GEOSContextHandle_t extHandle,
+                      geos::index::strtree::STRtree *tree,
+                      const geos::geom::Geometry* geom)
+{
+    return (const GEOSGeometry*) GEOSSTRtree_nearest_generic_r( extHandle, tree, geom, geom->getEnvelope(), NULL, NULL);
+}
+
 const void *
 GEOSSTRtree_nearest_generic_r(GEOSContextHandle_t extHandle,
                               geos::index::strtree::STRtree *tree,



More information about the geos-commits mailing list