[gdal-dev] MULTILINESTRING to MULTIPOLYGON using ogr2ogr

Alisson Barbosa alisson.uece at gmail.com
Fri Nov 23 08:40:07 PST 2012


Hi friends,

I would like to transform a shape with multilinestring in a shape with
polygons using ogr2ogr.

Polygon to multilinestring, I use:
ogr2ogr -f "ESRI Shapefile" -overwrite "C:/Users/Alisson/Basins3.shp"
"C:/Users/Alisson/Basins2.shp" -sql "SELECT * FROM Basins2" -skipfailures
-nlt MULTILINESTRING

This works.

Multilinestring to multipolygon, I use:
ogr2ogr -f "ESRI Shapefile" -overwrite "C:/Users/Alisson/polygon.shp"
"C:/Users/AlissonContorno30.shp" -sql "SELECT * FROM Contorno30"
-skipfailures -nlt MULTIPOLYGON

But, this error appears:
ERROR 1: Attempt to write non-polygon (LINESTRING) geometry to POLYGON type
shapefile.

Can you help me?

Best regards,
-- 
Alisson Barbosa
Systems Analyst - FUNCEME
M.Sc. in Computer Science - MACC
Graduate in Computer Science  - UECE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20121123/cc1d9a23/attachment.html>


More information about the gdal-dev mailing list