From: Sandro Santilli Date: Tue, 18 Aug 2015 10:56:13 +0000 (+0000) Subject: Fix getNodeWithinDistance2D callback implementation X-Git-Tag: 2.2.0rc1~156 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3863f3711d0bff10baec239cc503d8b2b99d0840;p=postgis Fix getNodeWithinDistance2D callback implementation git-svn-id: http://svn.osgeo.org/postgis/trunk@13924 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c index dc4cb19b2..363f15e95 100644 --- a/topology/postgis_topology.c +++ b/topology/postgis_topology.c @@ -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 ) {