<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);">
Sorry, i didn't explain myself clearly. I have a node (that is the end of an edge) that is less than 0.1m from another edge. If i use a tolerance of 0.2m it doesn't snap but if i use 0.5m it snaps to a node of that edge.
<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);">
Shouldn't it snap to the closest point on that edge, which is within the tolerance?</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);">
Thanks,</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></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> 1 de julho de 2020 16:42<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 am not sure I understood your affirmation. wanting to snap to the nearest edge, its the same as using a very large tolerance.</div>
<div><br>
</div>
<div>Alexandre Neto</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Wed, Jul 1, 2020 at 3:47 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);">
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="x_gmail-m_2133870196473710605Signature">
<div>
<div id="x_gmail-m_2133870196473710605divtagdefaultwrapper" 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_2133870196473710605ms-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="x_gmail-m_2133870196473710605appendonsend"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_2133870196473710605divRplyFwdMsg" dir="ltr"><font style="font-size: 11pt;" data-ogsc="" face="Calibri, sans-serif" color="#000000"><b>De:</b> postgis-users <<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a>>
 em nome de Alexandre Neto <<a href="mailto:senhor.neto@gmail.com" target="_blank">senhor.neto@gmail.com</a>><br>
<b>Enviado:</b> 29 de junho de 2020 23:49<br>
<b>Para:</b> PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><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%7C7867de8d4278456b17d908d81dd5620b%7Cd227b2e71c404f63b5132f3665c334e6%7C0%7C0%7C637292149594408975&sdata=8J6ubjm8WNgNA%2BqDe%2BZ1YJbEJrWjlycj7dYnjs0qhM0%3D&reserved=0" originalsrc="http://postgis.net/docs/manual-dev/toTopoGeom.html" shash="b4yM6zSFdrzVD7ILaaCU2u5Y6I4cAy6oPbP78vpiy3WZASFZ4R4z2WDMZxYdyVoM/Ug/us+5VOlvKDyDFAieb4QP6FtYYbRae2GoLNxrY38VxjbX/rTxqglPZr1KeWwHbBZSmP+yxK1fyMTaOmmkgr71mmlVlBN+hairzbNST3o=" target="_blank">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>
<div dir="ltr">On Mon, Jun 29, 2020 at 5:53 PM Alexandre Silva <<a href="mailto:amsilva@infoportugal.impresa.pt" target="_blank">amsilva@infoportugal.impresa.pt</a>> wrote:<br>
</div>
<blockquote 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_2133870196473710605x_gmail-m_5023270528477521244Signature">
<div>
<div id="x_gmail-m_2133870196473710605x_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_2133870196473710605x_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%7C7867de8d4278456b17d908d81dd5620b%7Cd227b2e71c404f63b5132f3665c334e6%7C0%7C0%7C637292149594408975&sdata=c8otUEmfU76dwNXRpPxZzCqw4onRfC%2B7Ax%2BEV%2Fu43XI%3D&reserved=0" originalsrc="https://lists.osgeo.org/mailman/listinfo/postgis-users" shash="gHZkUkiITvGpKrDu0wQA4Ada0VUJSv/mXoWSJpDuActhrvPLHt4aMzlPASqrbJQzFpdbQtZ6MsaHKPtIeo/6iZ1SG2saj9CdxQV6tcN0rzpxwyhR/a4swHkIvvNmfQ79grpLTp1g9dzzThWLitCTbvtc0x2H4Xd8BPGZtl9cMIo=" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote>
</div>
</div>
</div>
</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%7C7867de8d4278456b17d908d81dd5620b%7Cd227b2e71c404f63b5132f3665c334e6%7C0%7C0%7C637292149594418969&sdata=1LfO1aB8VFc2lSS16TbXLnFZ%2BI3BO4YCkWb8JDULzQ0%3D&reserved=0" originalsrc="https://lists.osgeo.org/mailman/listinfo/postgis-users" shash="Tu+XnER2YLvSqsBzKbvBq16sO237Tv7dB5yQdT5TNb6grygH7PRqnU0OrZl5wQ0QwSrRcAsadVOdTFltl4m/FYKQOZiBlUwxxmdBgToMlnWnIeZowEl1PDzfRno4popF5uYFELcTpDvHssp0tRn5xqGlqAntdOnJohTidGqjP/U=" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote>
</div>
</div>
</div>
</body>
</html>