[postgis-devel] Fixed precision for ST_Intersection, ST_Union, etc.

Daniel Baston dbaston at gmail.com
Wed Mar 9 16:20:57 PST 2016


I've set up a branch to allow the use of a fixed precision model with
ST_Intersection, ST_Difference, ST_SymmetricDifference, and ST_Union (all
variants), on the GEOS backend.  There are some broader design implications
to introducing a precision parameter, so I wanted to see if the group sees
any problems with this approach, which is:

* The precision is not encoded in the geometry; the user must specify the
precision when invoking the function, like ST_Intersection(a.geom, b.geom,
1e-4).  I think it's best to avoid encoding the precision into the geometry
(like we do for SRID) for the time being, mostly because the precision
we're specifying for these overlay functions refers to a GEOS feature
rather than any global concept of precision.  Since a geometry's encoded
precision would be ignored by ST_Intersects or ST_ApproximateMedialAxis, I
think it's best left as an explicit argument where it is supported for now.

* GEOS provides the ability to reduce a geometry's precision, cleaning up
topological collapses that may result from coordinate movement.  These
functions don't take advantage of this behavior; they assume that the user
is providing geometry whose coordinates are in fact precise at the level
specified.  I do think there should be a separate ST_ReducePrecision to
allow a user to take advantage of this feature.

Branch is at https://github.com/postgis/postgis/pull/100

Any thoughts?

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20160309/f6028ac5/attachment.html>


More information about the postgis-devel mailing list