[postgis-users] Chaining segments into polylines or polygons

Stephen Woodbridge woodbri at swoodbridge.com
Fri Mar 25 20:37:37 PST 2005


Hi all,

I wondering how I take a set of line segments and change them into a 
polyline(s) or into a polygon.

I think about two specific scenarios:

1) selecting a group of road segments based on a name attribute and then 
chaining them together.

I saw Paul's example of collecting road segments for labeling but that 
does do the chain of the segments. Also it is entirely possible that any 
given collection would actually contain multiple descrete chains.

I'm not sure if this is possible or how to construct the command(s).

2) Working with Tiger data it is easy to identify all the segments that 
of a polygon. So is this the correct syntax:

SELECT Polygonize(geom) FROM tigerdata GROUP BY concat(cenid, polyid);

Does Polygonize() automatically recognize holes or is there something 
else that needs to be done for that.

-Steve W.




More information about the postgis-users mailing list