[postgis-users] Tolerance/SnapTo in Postgis Topology for meter and degrees.

Sandro Santilli strk at kbt.io
Sat Jun 8 05:06:38 PDT 2019


On Fri, Jun 07, 2019 at 10:02:23AM +0000, Lars Aksel Opsahl wrote:

> So the problem is how to use tolerances so we get a behavior equal to
> the test using meter.
> 
> 
> We can we define the layer in Postgis Topology with quite big value
> because this is just max value as it seems. So we can adjust the tolerance
> parameter as we add lines but the problem is that we need to adjust this
> parameter depending on where we are and what orientation the line has. For
> vertical lines we need a bigger tolerance than for horizontal lines in
> Norway. This makes it quite complicated to handle adding new lines.

I'm not sure if it'd help but PostGIS Topology has an internal
function (not to be relied upon, but could be copied to your own
function) to determine "min tolerance" based on absolute coordinate
values. That function is meant to deal with non-uniform floating-point
resolution. What you're after is a function to deal with non-uniform
tolerances. See
https://trac.osgeo.org/postgis/browser/trunk/liblwgeom/lwgeom_topo.c?rev=14251#L4866
It used to be done in SQL with previous versions.

Could that help ?

--strk; 


More information about the postgis-users mailing list