[postgis-users] Round up coordinates?

Nicklas Avén nicklas.aven at jordogskog.no
Thu Jun 24 00:19:36 PDT 2010


Hallo

The problem is that even if you round your coordinates with ST_SnapToGrid, the edges between the vertexes will cross "not rounded land". So the intersection will most likely fail without the buffer if the intersection is expected somewhere between the rounded vertex points.

Another way of doing it is using ST_DWithin instead. I don't know which one is most effective.

Hope That Helps
Nicklas


2010-06-23 João Paulo Hespanha  wrote:

I have a number of cadastral boundaries (in predio_polylines) and
>property beacons (in propertybeacon) in a PostGIS database. The
>coordinates have a non-default srid of 9102160 and are stored with
>double precision. 
>When I run the following topological query (boundaries crossing a
>certain beacon) without the buffer, I get no results. The data has an
>internal resolution of 0.01 meter (from original source) and quality no
>better than 0.1 meter. How can I round up the coordinates such that the
>query can run without the buffer?
>
>BTW, is it possible to build a small graphical form to run the querying,
>changing the b.gid parameter? (in uDIG? :-)
>
>
>Topo query:
>select
>	l.gid,
>	l.nfolhapred,
>	b.gid,
>	b.tipo
>from
>	predio_polylines as l,
>	propertybeacon as b
>where
>	b.gid = 1000 AND
>	(ST_Intersects(ST_Buffer(ST_EndPoint(l.the_geom), 0.01),
>ST_Buffer(b.the_geom, 0.01)) OR
>	ST_Intersects(ST_Buffer(ST_StartPoint(l.the_geom), 0.01),
>ST_Buffer(b.the_geom, 0.01)));
>
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100624/cdfb42cd/attachment.html>


More information about the postgis-users mailing list