[postgis-users] Round up coordinates?

João Paulo Hespanha jphespanha at gmx.com
Wed Jun 23 09:19:25 PDT 2010


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)));





More information about the postgis-users mailing list