Le dimanche 20 mars 2011 23:47:44, Mike Toews a écrit :
> Ok, I found the issue. Rather than adding a new field def'n:
> layer_defn.AddFieldDefn(new_field)
> 
> it needs to instead be created on the layer:
> layer.CreateField(new_field)
> 
> The documentation is misleading, as I thought I couldn't add a field
> to an existing shapefile if there were features in it. I would
> recommend adding a "See also" link from AddFieldDefn to:
> http://www.gdal.org/ogr/ogr__api_8h.html#ab585ef1166c61c4819f7fd46ee4a275
> 
Agreed, done in http://trac.osgeo.org/gdal/changeset/21999
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to