Hi everyone, I used below codes to create ShapeFile layer
OGRDataSource *poDS, *poSHPDS; OGRLayer *poSHPLayer; ...... poSHPLayer = poSHPDS->CreateLayer (shpFileName, NULL, wkbPolygon , NULL); And I used below codes to create feature: OGRFeature *poSHPFeature; poSHPFeature = OGRFeature::CreateFeature (poSHPLayer->GetLayerDefn()); poSHPFeature->SetGeometry (poGeometry); 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) ? -- View this message in context: http://osgeo-org.1560.x6.nabble.com/How-to-create-feature-LineString-in-a-Polygon-shape-file-layer-tp5058827.html Sent from the GDAL - Dev mailing list archive at Nabble.com. _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
