[postgis-users] Writing (SF)CGAL geometry to PostGIS

Zac Goldstein goldzz at gmail.com
Fri Dec 2 00:45:08 PST 2016


I realize this is a mailing list for PostGIS, but I couldn't find support
for SFCGAL so I'm hoping someone here has some insight.  I'm trying to
write CGAL geometry to postgis, but the loss of precision from exact
geometry to double precision is causing my points to no longer be
coplanar.  This results in an error when I try to use SFCGAL functions on
such geometry in PostGIS.  Is there a common workaround?

In the event that there is no workaround:

For maintainability reasons, I would prefer to not have to edit SFCGAL
source directly, but there are a couple solutions on that end that come to
mind.   The easiest might be to simply reduce the tolerance variable in the
IsPlane3D check.  Does this risk causing other problems for algorithms that
expect coplanar points to 1e-9 tolerance though?

My second idea is to construct the SFCGAL object by projecting the points
from the database geometry onto a best-fit plane.  While computationally
more intensive, this second approach might be more robust.

Any thoughts or suggestions for better solutions that don't require editing
SFCGAL directly?

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

More information about the postgis-users mailing list