<div dir="ltr"><img src="cid:ii_lbdhvafp0" alt="test_withgap.png" width="541" height="460"><br><br><img src="cid:ii_lbdhvag71" alt="test_withoutgap.png" width="541" height="458"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 7, 2022 at 11:13 AM Douglas Fan <<a href="mailto:douglas.mhfan@gmail.com">douglas.mhfan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px">Hi all,<br><br>Earlier I have asked a question about topology </span><a href="https://gis.stackexchange.com/questions/446736/postgis-topology-result-still-has-gaps-and-overlap?noredirect=1#comment729180_446736" rel="nofollow" style="color:rgb(26,115,232);text-decoration-line:none;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px" target="_blank">here</a><span style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px">. I still cannot understand the mechanism behind it so I hope that I may get some help here. </span><br style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px"><br style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px"><span style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px">I am trying to build topology on PostGIS with 4000+ polygons. The input are not clean, with overlaps and gaps. I have created a procedure to commit each update statement for each polygon so that I can catch the exception and continue the process. The result still contain gaps and overlaps that are smaller than the tolerance and expected to be snapped. </span><br style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px"><br style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px"><span style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px">I have also tried to run toTopoGeom in the order of the number of vertices of each polygon, with the idea that creating polygons with more vertices may help the snapping process. It doesn't solve the problem and the number of slivers is almost the same. However I have noticed that sequence of the polygon to run toTopoGeom changes the result.</span><br style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px"><br style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px"><span style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px">Use these 3 polygons as an example. When I create 3303 first, then 2451, then 944, the gap cannot be cleaned. Yet when I create it in the reversed order(944->2451->3303), the gap is gone. The gap is also gone when I run toTopoGeom with only these 3 polygons together. (not one by one)<br></span><br><div style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px"><img alt="test_withgap.png" width="534px" height="454px" src="https://groups.google.com/group/postgis-users/attach/3d3cdcbe72349/test_withgap.png?part=0.1&view=1" style="outline: 0px; border: none;"><br><br><img alt="test_withoutgap.png" width="534px" height="452px" src="https://groups.google.com/group/postgis-users/attach/3d3cdcbe72349/test_withoutgap.png?part=0.2&view=1" style="outline: 0px; border: none;"><br></div><div style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px"><br></div><div style="color:rgba(0,0,0,0.87);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px">Does anyone have experience with this issue and may have an idea to explain it? It seems to me an extra vertex on the horizontal edge of 3303 must be provided so that the corner of 944 and 2451 can be snapped to it, but I have not figured out a way to create such vertices for each T shape or ⊥ shape scenario.<br><br>Thank you for your time!<br><br>Regards,<br>Douglas</div></div>
</blockquote></div>