How can I create polygons of the area surrounded by roads / lines?

I'm currently trying to create polygons that represent the areas surrounded by roads. The roads are stored in PostGIS as points / lines so I have flexibility over what I can do with them.

I'm basically trying to turn the white areas of this example line output into polygons:

Any ideas?

Update

Here is the PostGIS to achieve this (assuming you have a road table full of lines):

``````SELECT (ST_Dump(ST_Polygonize(roads.geom))).geom AS the_geom FROM
``````
-
Similar question here, less direct, about city-blocks construction. – Peter Krauss Sep 21 '14 at 9:53

Some hints:

1. You could use the ST_Polygonize processing of PostGIS.
2. You could have a look at this QGIS plugin (I have not tested it myself...)
3. If you speak Java, you could use the polygoniser of JTS.
-
Thank you! ST_Polygonize did the trick. I've updated the question with the code that worked. – Robin Hawkes Feb 15 '13 at 18:51

The method would depend on the actual outcome that you would like. One thing that comes to mind is to calculate a density raster, find a threshold that represents the approximate road density that you are interested in, create a binary raster based on this threshold and turn the resulting raster into a polygon feature class. You could incorporate a multiscale assessment by varying the kernel size and integrating across multiple density estimates. You could also weight the density estimate(s) by an attribute in the road data (e.g, road class, size, ...). This would allow you to incorporate characteristics of the observed structure and allow for a "zone of influence" surrounding your linear feature class.

-

If you have access to ArcInfo then have a look at the geo-processing tool Feature To Polygon (Data Management)

-

You could try creating a buffer layer of your roads, so that it is a polygon. Then create a polygon layer delineating your area of interest, and use the union tool on both polygon layers. You should be able to differentiate the polygons inside the roads (white areas) from the transportation lines from the union results.

-
I notice that qgis has a lines to polygons tool under the vector menu – lewis Feb 15 '13 at 16:53