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

Martin Lacayo mlacayo at stanford.edu
Sun Jun 9 16:24:20 PDT 2013


>From reading the 1998 white paper it would seem that it was intended
to be possible, since each record includes a shape type (in addition
to the file header), however I have never seen or heard of data with
mixed geometries. I have always been curious though, does anyone have
any experience with a shapefile with mixed geometries?

On Sun, Jun 9, 2013 at 3:40 AM, Jukka Rahkonen
<jukka.rahkonen at mmmtike.fi> wrote:
> 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-
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list