Re: [gdal-dev] OGRLayer::SetFeature fails with out of date OGRFeature

2010-04-27 Thread Ari Jolma
Even Rouault wrote: Ramiro, It is illegal to change the layer definition with CreateField() if you have pre-existing features of that layer. This is documented here : http://www.gdal.org/ogr/classOGRFeatureDefn.html#40e681d8464b42f1a1fac655f16ac3dd Illegal yes, but IMHO segfault should ne

Re: [gdal-dev] OGRLayer::SetFeature fails with out of date OGRFeature

2010-04-27 Thread Even Rouault
Ramiro, It is illegal to change the layer definition with CreateField() if you have pre-existing features of that layer. This is documented here : http://www.gdal.org/ogr/classOGRFeatureDefn.html#40e681d8464b42f1a1fac655f16ac3dd There's no way to check if the feature is "valid". So, just don't

[gdal-dev] OGRLayer::SetFeature fails with out of date OGRFeature

2010-04-27 Thread Ramiro Gonzalez
My application uses OGR to edit ESRI Shapefiles. If I follow this steps: 1_ Create a feature(OGRFeature::CreateFeature) using the feature definition from an existing layer(layerA) 2_ Add a field (OGRLayer::CreateField) to layerA 3_ Try to save the feature (OGRLayer::SetFeature) in layerA I recei