[postgis-users] Doubt about toTopoGeom tolerance

Alexandre Neto senhor.neto at gmail.com
Mon Jun 29 15:49:14 PDT 2020


Hi,

I have looked into the documentation, and it seems that there are two form
of using toTopoGeom:
1. One to add new topogeometry an existing topology layer, and another to
change an element. This is what you seem to be using.
2. The second form, with less arguments, is used ADD changes to existing
topoGeometries. But, it says you may want to use clearTopoGeom(topo) to
create a totally new shape.

My gut feeling is that since you already have the topogeometry in the
topology, when you try to add it again, it will snap to the old geometry
any way.
My first try would be something like:

UPDATE lines_table
SET topo = topology.toTopoGeom(geom, clearTopoGeom(topo), 0.1)
WHERE id = 1263;

http://postgis.net/docs/manual-dev/toTopoGeom.html

Good luck,

Alexandre Neto

On Mon, Jun 29, 2020 at 5:53 PM Alexandre Silva <
amsilva at infoportugal.impresa.pt> wrote:

> Hi,
>
> I have trying using the topology to correct some data with marginal errors
> and in some particular cases i'd like to use a higher snap tolerance than
> the defined in the topology.
> The topology has a tolerance of 0.01m (using a metric projection) and some
> lines need an higher tolerance of 0.1m to be fixed. Here's the code i used
> to create the topology and to fix the particular cases:
>
> SELECT topology.CreateTopology('a_topology', 3763, 0.01, true);
>
> UPDATE lines_table
> SET topo = topology.toTopoGeom(geom, 'a_topology', 1, 0.1)
> WHERE id = 1263;
>
> Even though the line is closer than 0.1m to another line, it isn't
> snapped. Am i thinking wrong here? Shouldn't the line be snapped? Which of
> the tolerances prevails?
> If this is the expected behaviour is there a better way to do what i'm
> trying to do?
>
> Thanks in advance,
>
> Alexandre Silva
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200629/6ad47d28/attachment.html>


More information about the postgis-users mailing list