[Gdal-dev] Transform Line String into Polygon with ogr2ogr

Lijian Shi lijian.shi at und.nodak.edu
Tue Apr 17 18:06:07 EDT 2007


Hi, 

 

I have a shp file with Line String geometry type. Actually these lines are
polygon because the coordinate values of line string's first point are same
with them of line string's last one. Now I want to transform this shp into a
new one with polygon and I use command "ogr2ogr" as:

 

ogr2ogr new.shp old.shp -nlt POLYGON

 

But there are some errors as followed:

 

ERROR 1: Attempt to write non-polygon (LINESTRING) geometry to type
shapefile.

ERROR 1: Terminating translation prematurely after failed

Translation of layer zones

 

Can I use this "ogr2ogr" to convert LINESTRING into POLYGON? If yes, what's
the problem with my command? 

 

Thanks in advance,

 

Lijian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070417/6aafd1e8/attachment.html


More information about the Gdal-dev mailing list