[postgis-users] Closing polylines

Nicolas Ribot nicolas.ribot at gmail.com
Wed May 16 11:08:08 PDT 2012


Hi George,

If the segments are touching each other, like in your sample data, indeed
topology could help a lot to rebuild closed lines.

Here, on this sample, st_polygonize is giving great results. It connects
segments of the same contour and fill it to generate a polygon.
Its exteriorRing gives the actual contour:

select elev, st_exteriorRing(st_geometryN(st_polygonize(geom), 1))
from seg
group by elev;

Do you have some gaps for some contour lines, or they are all connected ?

Nicolas

On 16 May 2012 16:35, Nicolas Ribot <nicolas.ribot at gmail.com> wrote:
> Hi,
>
> I will have a look at it.
>
> Nicolas
>
> On 15 May 2012 11:17, george wash <gws293 at hotmail.com> wrote:
>> Sorry Nicolas, the attachment is in a normal dump format, not shapefile
>> format....
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120516/96e0ce6e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2012-05-16 at 8.07.02 PM.png
Type: image/png
Size: 41680 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120516/96e0ce6e/attachment.png>


More information about the postgis-users mailing list