[gdal-dev] MULTILINESTRING to MULTIPOLYGON using ogr2ogr

Hugo Benicio hbobenicio at gmail.com
Mon Nov 26 04:24:18 PST 2012


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.


On Mon, Nov 26, 2012 at 8:47 AM, Alisson Barbosa <alisson.uece at gmail.com>wrote:

> Can anybody help me?
>
>
> 2012/11/23 Alisson Barbosa <alisson.uece at gmail.com>
>
>> 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
>>
>>
>>
>
>
> --
> Alisson Barbosa
> Systems Analyst - FUNCEME
> M.Sc. in Computer Science - MACC
> Graduate in Computer Science  - UECE
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20121126/f5772912/attachment.html>


More information about the gdal-dev mailing list