Opened 11 years ago
Closed 11 years ago
#2611 closed defect (worksforme)
ST_SnapToGrid doesn't snap
Reported by: | geognu | Owned by: | pramsey |
---|---|---|---|
Priority: | high | Milestone: | PostGIS 2.1.2 |
Component: | postgis | Version: | 2.1.x |
Keywords: | Cc: |
Description
Hi.
Testing various ST_SnapToGrid options looks like snapping is not working for values < 0.5, e.g. running the query
UPDATE mytable SET the_geom=ST_SnapToGrid(the_geom, 1)
I get the results, whilst
UPDATE mytable SET the_geom=ST_SnapToGrid(the_geom, 0.0000001)
doesn't work at all, leaving the geometry untouched.
Attachments (3)
Change History (6)
comment:1 by , 11 years ago
by , 11 years ago
Attachment: | fatt_poly_01.zip added |
---|
fatt_poly_01 - data exported to shape after setting grid=0.0000001
by , 11 years ago
Attachment: | fatt_poly_05.zip added |
---|
fatt_poly_05 - data exported to shape after setting grid=0.5
by , 11 years ago
Attachment: | fatt_poly_50.zip added |
---|
fatt_poly_50 - data exported to shape after setting grid=50 (exxagerated for testing)
comment:2 by , 11 years ago
postgis_full_version POSTGIS="2.1.1 r12113" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.9.1"
Files attached
comment:3 by , 11 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I don't know how you're evaluating what "works" or not, but I can snap things just fine using 2.1
select st_astext(st_startpoint(st_exteriorring(st_geometryn(st_snaptogrid(geom,0.01),1)))) from fattibilita_poly_01;
Can you please state the version of PostGIS you are using and also provide sample data.