Hi, I am not sure I understood your affirmation. wanting to snap to the nearest edge, its the same as using a very large tolerance.
Alexandre Neto On Wed, Jul 1, 2020 at 3:47 PM Alexandre Silva < [email protected]> wrote: > Hi, > > Thank you for your response. > > I tried the solution you provided and the result was the same, however > after increasing the tolerance the geometry did indeed snap to a nearby > node. > I thought that the snap was to the closest point on a nearby edge but it > seems that it only snaps to nodes within the tolerance. What's the best way > to snap a geometry to the closest point on a nearby edge? I cannot increase > the tolerance as it would be error prone (to make the snap on one specific > geometry I had to increase it from 0.1m to 0.5m). > > Thank you for your assistance, > Alexandre Silva > > > > > > > > ------------------------------ > *De:* postgis-users <[email protected]> em nome de > Alexandre Neto <[email protected]> > *Enviado:* 29 de junho de 2020 23:49 > *Para:* PostGIS Users Discussion <[email protected]> > *Assunto:* Re: [postgis-users] Doubt about toTopoGeom tolerance > > 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 > <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpostgis.net%2Fdocs%2Fmanual-dev%2FtoTopoGeom.html&data=02%7C01%7Camsilva%40infoportugal.impresa.pt%7C993cd4fd7266463c411908d81c7eb1b3%7Cd227b2e71c404f63b5132f3665c334e6%7C0%7C1%7C637290677762157357&sdata=V0GsN0KHhm5zLvM6S4aQRg%2F%2FFCP6jsNuWeX08aoVAjc%3D&reserved=0> > > Good luck, > > Alexandre Neto > > On Mon, Jun 29, 2020 at 5:53 PM Alexandre Silva < > [email protected]> 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 > [email protected] > https://lists.osgeo.org/mailman/listinfo/postgis-users > <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fpostgis-users&data=02%7C01%7Camsilva%40infoportugal.impresa.pt%7C993cd4fd7266463c411908d81c7eb1b3%7Cd227b2e71c404f63b5132f3665c334e6%7C0%7C1%7C637290677762167348&sdata=mFfo8W%2F%2BQ3nQJOyoE5OjvDro%2Fgrj4BgdkMapg58vs4s%3D&reserved=0> > > _______________________________________________ > postgis-users mailing list > [email protected] > https://lists.osgeo.org/mailman/listinfo/postgis-users
_______________________________________________ postgis-users mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/postgis-users
