[postgis-users] Confused about st_snaptogrid and precision.

strk strk at keybit.net
Tue Mar 23 05:05:52 PDT 2010


On Tue, Mar 23, 2010 at 06:57:41AM -0500, Paul Moen wrote:

> UPDATE the_control SET the_geom=st_snaptogrid(the_geom,.0000001);
> 
> After setting the precision, shouldn't I be able to find the point, POINT(1881581.0894989 638200.5564884), at that precision, in the table by using
> 
> SELECT * FROM the_control WHERE st_equals(st_geomfromewkt('POINT(1881581.0894989 638200.5564884)'),the_geom);

You are NOT snapping the return from st_geomfromewkt.

Try this:
  SELECT * FROM the_control WHERE st_equals(
  st_snaptogrid(st_geomfromewkt('POINT(1881581.08949
  89 638200.5564884)', .0000001)),the_geom);


--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-users mailing list