Hi Nicolas,<br>
<br>
I didn't quite follow the tips in the "Closing Coutour" thread but got
some inspiration from it (I think it's a bit complicated for my PostGIS
level).<br>
<br>
I can now snap lines but some of them (see attached file) don't snap at
the right place. In the attached image, I want the last point of the
line in the southern area (the un-numbered point closest to the north
area in grey) to snap to point 26. Unfortunately, it is point 27 that
snapped to 26. The second image shows another case where the snap didn't
do as I expected (multi snaps on the same line..). In some other cases
however, it did work alright.<br>
<br>
I'm sure this has to do with the conditions in my query below but I don't understand what. Maybe you have some clues about it?<br>
<br>
DROP TABLE IF EXISTS hydrology.snappedlines;<br>
SELECT b.gid, ST_Snap(a.geom_intersections, b.geom_intersections, 50) geom<br>
INTO TABLE hydrology.snappedlines<br>
FROM hydrology.nhn_coursdeau_merge_test a, -- lines in the north area<br>
hydrology.bdtq_20k_hydro_lo_merge_test b, -- lines in the south area<br>
hydrology.test_north c, -- north area polygon<br>
hydrology.test_south d -- south area polygon<br>
WHERE ST_DWithin(a.geom_intersections, b.geom_intersections, 50) -- units in meters<br>
AND ST_DWithin(a.geom_intersections, c.geom, 0.001) <br>
AND ST_DWithin(a.geom_intersections, d.geom, 0.001)<br>
AND ST_DWithin(b.geom_intersections, c.geom, 0.001)<br>
AND ST_DWithin(b.geom_intersections, d.geom, 0.001);<br>
<br>
Thanks for helping,<br>
<br>
Guillaume