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?
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
(SELECT ST_Transform(ST_SetSRID(geom, 27700), 4326) AS geom FROM road_lines) AS roads
Answer
Some hints:
- You could use the ST_Polygonize processing of PostGIS.
- You could have a look at this QGIS plugin (I have not tested it myself...)
- If you speak Java, you could use the polygoniser of JTS.
No comments:
Post a Comment