<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thank you for your response.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
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).</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thank you for your assistance,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Alexandre Silva<br>
</div>
<div>
<div id="Signature">
<div>
<meta content="text/html; charset=UTF-8">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;">
<p style="margin-top: 0px; margin-bottom: 0px;"><span id="ms-rterangepaste-start"></span></p>
<table style="color: rgb(33, 33, 33); font-size: 15px; width: 430px;" width="430">
<tbody>
<tr>
<td><br>
</td>
<td><br>
</td>
<td><br>
</td>
<td><br>
</td>
</tr>
</tbody>
</table>
<br>
<p style="margin-top: 0px; margin-bottom: 0px;"></p>
</div>
</div>
</div>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size: 11pt;" data-ogsc="" face="Calibri, sans-serif" color="#000000"><b>De:</b> postgis-users <postgis-users-bounces@lists.osgeo.org> em nome de Alexandre Neto <senhor.neto@gmail.com><br>
<b>Enviado:</b> 29 de junho de 2020 23:49<br>
<b>Para:</b> PostGIS Users Discussion <postgis-users@lists.osgeo.org><br>
<b>Assunto:</b> Re: [postgis-users] Doubt about toTopoGeom tolerance</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>I have looked into the documentation, and it seems that there are two form of using toTopoGeom:</div>
<div>1. One to add new topogeometry an existing topology layer, and another to change an element. This is what you seem to be using.</div>
<div>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.</div>
<div><br>
</div>
<div>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. </div>
<div>My first try would be something like:</div>
<div><br>
</div>
<div><span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">UPDATE lines_table<br>
</span><span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"></span>
<div style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
SET topo = topology.toTopoGeom(geom, clearTopoGeom(topo), 0.1)<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
WHERE id = 1263;</div>
</div>
<div><br>
</div>
<div><a href="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" originalsrc="http://postgis.net/docs/manual-dev/toTopoGeom.html" shash="ZADB5Z45pm2dUHXfmciVmvF4hNmSI8zOQ9Q/rf5OZ11MuD/wcAYTJyfckLnHCZWKXDrJ91C315Hnk8tLMhXlvZHcg13ZLGJCzDw+e2xx0g9ieRyjcABq3lhCiTk+kYXu+UagdDN0h/ua36AVuBQm/s25sc3+5ke040WifDDmOlw=">http://postgis.net/docs/manual-dev/toTopoGeom.html</a><br>
</div>
<div><br>
</div>
<div>Good luck,</div>
<div><br>
</div>
<div>Alexandre Neto</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Mon, Jun 29, 2020 at 5:53 PM Alexandre Silva <<a href="mailto:amsilva@infoportugal.impresa.pt">amsilva@infoportugal.impresa.pt</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
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:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
SELECT topology.CreateTopology('a_topology', 3763, 0.01, true); <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span>UPDATE lines_table<br>
</span>
<div>SET topo = topology.toTopoGeom(geom, 'a_topology', 1, 0.1)<span><br>
</span></div>
<div><span>WHERE id = 1263;</span></div>
<div><span><br>
</span></div>
<div><span>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?</span></div>
<div><span>If this is the expected behaviour is there a better way to do what i'm trying to do?</span></div>
<div><span></span><br>
</div>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks in advance,<br>
</div>
<div id="x_gmail-m_5023270528477521244Signature">
<div>
<div id="x_gmail-m_5023270528477521244divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;">
<p style="margin-top:0px; margin-bottom:0px"><span id="x_gmail-m_5023270528477521244ms-rterangepaste-start"></span></p>
<table style="color: rgb(33, 33, 33); font-size: 15px; width: 430px;" width="430">
<tbody>
<tr>
<td>Alexandre Silva<br>
</td>
<td><br>
</td>
<td><br>
</td>
<td><br>
</td>
</tr>
</tbody>
</table>
<br>
<p style="margin-top:0px; margin-bottom:0px"></p>
</div>
</div>
</div>
</div>
<img src="http://newsletter.impresapublishing.pt/i/barra_ip.jpg"> </div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="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" originalsrc="https://lists.osgeo.org/mailman/listinfo/postgis-users" shash="lDTHh6QvEENEfKx2zjo5XVl7tcTYo1rB+K6mvJycWbqdDQlAyRLPutXKmXtKawPmLrfCF/UI7f+aSf5qIQ6VMt1REcELLyOPtZhpqgE0YKN9w3izDjeSqNFwSdocVx3Mceangq0WZVrVd9HgIboOwFakPDYOwou20sm8dome4zE=" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote>
</div>
</div>
</div>
</body>
</html>