[geos-commits] r4303 - trunk/capi

Sandro Santilli strk at kbt.io
Thu Nov 10 08:11:26 PST 2016


Author: strk
Date: 2016-11-10 08:11:25 -0800 (Thu, 10 Nov 2016)
New Revision: 4303

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

See #796

Modified: trunk/capi/geos_c.cpp
===================================================================
--- trunk/capi/geos_c.cpp	2016-11-10 07:13:51 UTC (rev 4302)
+++ trunk/capi/geos_c.cpp	2016-11-10 16:11:25 UTC (rev 4303)
@@ -723,7 +723,7 @@
     return GEOSSetSRID_r( handle, g, srid );
 }
 
-void * 
+void *
 GEOSGeom_getUserData(const Geometry *g)
 {
     return GEOSGeom_getUserData_r( handle, g );
@@ -1180,7 +1180,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: trunk/capi/geos_c.h.in
===================================================================
--- trunk/capi/geos_c.h.in	2016-11-10 07:13:51 UTC (rev 4302)
+++ trunk/capi/geos_c.h.in	2016-11-10 16:11:25 UTC (rev 4303)
@@ -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: trunk/capi/geos_ts_c.cpp
===================================================================
--- trunk/capi/geos_ts_c.cpp	2016-11-10 07:13:51 UTC (rev 4302)
+++ trunk/capi/geos_ts_c.cpp	2016-11-10 16:11:25 UTC (rev 4303)
@@ -6102,6 +6102,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