<div dir="ltr"><div>Hey,<br></div>ST_SnapToGrid<br><br>Cheers,<br><br>Rémi-C<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-24 16:20 GMT+01:00 Gonçalo Revez <span dir="ltr"><<a href="mailto:goncalorevez@gmail.com" target="_blank">goncalorevez@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">In fact, those geometry were already derived from a previous postgis topological model. Only the the third polygon was edited.<div>
<br><div>I could try that, but shouldn't the tolerance meaning consider some kind of the trim of the values?</div>
<div><br></div><div>Is there any function in postgis to do that automatically?</div><div><br></div><div>If i'm aware there isn't any set of precision model in postgis as exists in JTS.</div><div><br></div><div>Thanks</div>

<div>Regards</div><span class="HOEnZb"><font color="#888888"><div>Gonçalo</div><div><br><div><br></div></div></font></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Feb 24, 2014 at 12:13 PM, Rémi Cura <span dir="ltr"><<a href="mailto:remi.cura@gmail.com" target="_blank">remi.cura@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I cannot test your data, but maybe you should trim your digit number :<br></div>-99095.34929557323630434 , could be <br>

99095.35<br><br></div>Cheers,<br>Rémi-C<br></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">2014-02-24 13:08 GMT+01:00 Gonçalo Revez <span dir="ltr"><<a href="mailto:goncalorevez@gmail.com" target="_blank">goncalorevez@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>
<div dir="ltr">another image explaining the error attach<br><br><div class="gmail_quote"><div>---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Gonçalo Revez</b> <span dir="ltr"><<a href="mailto:goncalorevez@gmail.com" target="_blank">goncalorevez@gmail.com</a>></span><br>


</div><div><div>
Date: Mon, Feb 24, 2014 at 12:05 PM<br>Subject: Fwd: postgis topology strange behavior<br>To: <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br><br><br><div dir="ltr">forgot to attach the files.<div>



<div><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Gonçalo Revez</b> <span dir="ltr"><<a href="mailto:goncalorevez@gmail.com" target="_blank">goncalorevez@gmail.com</a>></span><br>




Date: Mon, Feb 24, 2014 at 12:01 PM<br>Subject: postgis topology strange behavior<br>To: <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br><br><br><div dir="ltr">Hello,<div>



<br></div><div>
I'm using the postgis topology with the following example below.</div><div><br></div><div>It inserts three contiguous polygons, but the third has a strange behavior.</div><div><br>
</div><div>It seems that the polygon doesn't snap totally to the other polygon (with model tolerance of 0.1), where he should split the edges and create a node.<br></div><div><br></div><div>The problem raises two edges "overlapped". (I attach an image showing the topology error).</div>





<div><br></div><div>In fact, using the jts viewer, the third polygon overlaps the first polygon, but below the topology model tolerance. </div><div><br></div><div>How is it possible to solve this type of situation or what could be the error in example?</div>





<div><br></div><div><br></div><div>Thanks</div><div>Gonçalo</div><div><br></div><div>--x--<br></div><div><br></div><div><div><div>--drop topology</div><div>select topology.DropTopology('test_topo');</div><div><br>





</div><div>--create topology</div><div>SELECT CreateTopology('test_topo', 20791,0.1);</div><div><br></div><div>--create topo geometries table</div><div>create table test_topo.area_topo(id serial primary key, bottom boolean);</div>





<div><br></div><div>--create topo geometry column</div><div>select topology.AddTopoGeometryColumn('test_topo','test_topo', 'area_topo', 'topo_geom', 'POLYGON');</div><div><br></div>





<div>SET search_path TO topology, public, test_topo;</div><div><br></div><div>--insert polygon 1</div><div>insert into test_topo.area_topo(id,topo_geom, bottom)</div><div>select 1,topology.toTopoGeom(ST_GeomFromEWKT('SRID=20791;POLYGON((-99221.0688378750346601 -99577.07580991843133233,-99192.60793616733280942 -99686.85357364814262837,-99288.83288956005708314 -99727.51200465914735105,-99380.99199985167069826 -99768.17043567015207373,-99433.84796016597829293 -99700.4063839851442026,-99435.20324119967699517 -99571.6546857836219715,-99349.8205360765568912 -99570.29940474992326926,-99221.0688378750346601 -99577.07580991843133233))'), 'test_topo',1,0), true;</div>





<div><br></div><div>--insert polygon 2</div><div>insert into test_topo.area_topo(id,topo_geom, bottom)</div><div>select 2,topology.toTopoGeom(ST_GeomFromEWKT('SRID=20791;POLYGON((-99105.19230949365010019 -99703.11694605252705514,-99192.60793616733280942 -99686.85357364814262837,-99221.0688378750346601 -99577.07580991843133233,-99169.56815859441121574 -99535.06209787368425168,-99095.02770174089528155 -99582.49693405319703743,-99017.09904230313259177 -99629.25412971586047206,-99034.04005522439547349 -99715.99211587267927825,-99105.19230949365010019 -99703.11694605252705514))'), 'test_topo',1,0), true;</div>





<div><br></div><div>--insert polygon 3</div><div>insert into test_topo.area_topo(id,topo_geom, bottom)</div><div>select 3,topology.toTopoGeom(ST_GeomFromEWKT('SRID=20791;POLYGON((-99095.34929557323630434 -99874.08768260208307765,-99180.89702985195617657 -99864.18215547507861629,-99285.8180822192953201 -99726.23814240249339491,-99192.60793616733280942 -99686.85357364814262837,-99105.19230949365010019 -99703.11694605252705514,-99071.31028365115344059 -99810.86178823169029783,-99095.34929557323630434 -99874.08768260208307765))'), 'test_topo',1,0), true;</div>





<div><br></div><div><br></div></div><div><br></div></div></div>
</div><br></div></div></div>
</div></div></div><br></div>
<br></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="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
<br>_______________________________________________<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="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>