[gdal-dev] How to create feature LineString in a Polygon shape file layer ?

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Sun Jun 9 03:40:46 PDT 2013


taibc <taibc_coltech <at> yahoo.com> writes:


> But when I tried to add create a LineString feature into shape file layer. I
> got the error: "*Attempt to write non-polygon geometry to polygon type shape
> file*". Please see my image. 
> 
> <http://osgeo-org.1560.x6.nabble.com/file/n5058827/LineString.png> 
> 
> How can I add linestring into layer (shape file) ?

You can't write linestrings into a polygon shapefile. Each shapefile can
only contain features of the same shape type or null geometries. Read for
example http://en.wikipedia.org/wiki/Shapefile

-Jukka Rahkonen-



More information about the gdal-dev mailing list