]> granicus.if.org Git - postgis/commitdiff
Fix getNodeWithinDistance2D callback implementation
authorSandro Santilli <strk@keybit.net>
Tue, 18 Aug 2015 10:56:13 +0000 (10:56 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 18 Aug 2015 10:56:13 +0000 (10:56 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13924 b70326c6-7e19-0410-871a-916f4a2858ee

topology/postgis_topology.c

index dc4cb19b2df864d1bcab198256b566e602769e19..363f15e95d9127caa528e12424fa0148f7100253 100644 (file)
@@ -1196,10 +1196,10 @@ cb_getNodeWithinDistance2D(const LWT_BE_TOPOLOGY* topo,
   // TODO: use binary cursor here ?
   hexewkb = lwgeom_to_hexwkb(lwpoint_as_lwgeom(pt), WKB_EXTENDED, &hexewkb_size);
   if ( dist ) {
-    appendStringInfo(sql, " WHERE ST_DWithin(geom, '%s'::geometry, dist)",
-                     hexewkb);
+    appendStringInfo(sql, " WHERE ST_DWithin(geom, '%s'::geometry, %g)",
+                     hexewkb, dist);
   } else {
-    appendStringInfo(sql, " WHERE ST_Within(geom, '%s'::geometry)", hexewkb);
+    appendStringInfo(sql, " WHERE ST_Equals(geom, '%s'::geometry)", hexewkb);
   }
   lwfree(hexewkb);
   if ( elems_requested == -1 ) {