[gdal-dev] MULTILINESTRING to MULTIPOLYGON using ogr2ogr

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon Nov 26 05:11:39 PST 2012


Hugo Benicio <hbobenicio <at> gmail.com> writes:

> 
> 
> I'm facing a similar problem when trying to convert a shapefile containing
lines to a shapefile containing polygons.
> No progress.
> If you solve it, please, let me know!
> 
> Thanks in advance.

Hi,

Converting polygons into lines and lines into polygons are not symmetric
operations. While it is always possible to snip the polygon rings and tell that
they are lines it is not the case in other direction. All lines or polylines do
not form closed rings which can be converted into polygons, they do not
necessarily even touch. Therefore I would not be surprised if ogr2ogr is missing
such a tool. I do not know, though.

There seems to be special tools for building polygons. OpenJUMP has a few and
Sextante (which is integrated with OpenJUMP, Kosmo GIS, gvSIG, QGIS and probably
others) seems to have such a function. I think also that some planar graph tools
could be suitable for this task. I bet that GRASS has fine tools for building
topology and polygons.

-Jukka Rahkonen-





More information about the gdal-dev mailing list