[postgis-users] PostGIS layer spatial tolerance

Oxenstierna Andreas Andreas.Oxenstierna at sweco.se
Fri Aug 28 06:14:44 PDT 2009


My first question, although we have used PostGIS for more than one year for several projects and are very happy and impressed.
 
We have implemented an area topology editor for ZIP code areas, i.e. all polygons must completely cover without any holes ("Skin-of-the-Earth").
It is implemented in OpenLayers, i.e. builds and edits client topology in JavaScript, and uses PostGIS functions for merging and splitting (with a line) areas.
We encounter some problems which may be related to slightly different coordinates and number of vertices for adjacent areas. We will pin-point the problem when we receive actual examples from the customer. But we strongly suspect floating-point problems, i.e. the last decimal is random when stored to the database.
The data is imported from an ArcInfo coverage and checked with PostGIS UNION to be topologically correct (i.e. all polygons have exact the same coordinates). So the errors should have been introduced in editing operations. OpenLayers just copies the coordinates as a string so we suspect the PostGIS split/merge functions.
 
I come from the ESRI and Oracle world. Both ArcSDE and Oracle Spatial have user-defined spatial tolerance for each spatially enabled layer. This ensures that coordinates are exact, down to the last decimal (or integer for ArcSDE). 
I cannot find in the documentation or in the functionality that PostGIS has an awareness of spatial tolerance. What I can find is:
"All floating point comparisons within the SQL-MM implementation are performed to a specified tolerance, currently 1E-8"
but nothing about actual storage.
 
For me, the easiest solution would be to use a spatial tolerance. Otherwise, we may need to round all coordinates in the application code to e.g. 14 valid digits.
 
Best Regards
 
________________________________

Andreas Oxenstierna

Telefon direkt 040-16 70 17 
Mobil 0734-12 80 17 
andreas.oxenstierna at sweco.se
Sweco Position AB

Hans Michelsensgatan 2
Box 286
201 22 Malmö
Telefon 040-16 70 00
www.sweco.se

 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090828/0911b908/attachment.html>


More information about the postgis-users mailing list