[gdal-dev] Add a new filed to an existing shapefile

Frank Warmerdam warmerdam at pobox.com
Fri May 16 10:15:27 EDT 2008


Limei Ran wrote:
> Hi:
> 
> I am trying to add a new double field to an existing shapefile using the 
> following codes.  But,  poLayer->CreateField failed.  Could you tell me 
> what is wrong with the codes?

Limei,

I believe the shapefile driver does not support adding fields to a shapefile
layer that already has records/features in it.  This is fairly common in file
based drivers, though it *could* be implemented for shapefiles if there was
sufficient need.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list