<div>Hi George,<br><br>If the segments are touching each other, like in your sample data, indeed topology could help a lot to rebuild closed lines.</div><div><br></div><div>Here, on this sample, st_polygonize is giving great results. It connects segments of the same contour and fill it to generate a polygon.</div>
<div>Its exteriorRing gives the actual contour:</div><div><br></div><div><div>select elev, st_exteriorRing(st_geometryN(st_polygonize(geom), 1))</div><div>from seg</div><div>group by elev;</div><br><div>Do you have some gaps for some contour lines, or they are all connected ?</div>
<div><br></div><div>Nicolas</div><div><br></div>On 16 May 2012 16:35, Nicolas Ribot <<a href="mailto:nicolas.ribot@gmail.com" target="_blank">nicolas.ribot@gmail.com</a>> wrote:<br>
> Hi,<br>><br>> I will have a look at it.<br>><br>> Nicolas<br>><br>> On 15 May 2012 11:17, george wash <<a href="mailto:gws293@hotmail.com" target="_blank">gws293@hotmail.com</a>> wrote:<br>>> Sorry Nicolas, the attachment is in a normal dump format, not shapefile<br>

>> format....<br>>><br>>> _______________________________________________<br>>> postgis-users mailing list<br>>> <a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>

>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>>><br><br></div>