[gdal-dev] Update ShapeLayer
mateusz at loskot.net
Sun Aug 10 08:35:24 EDT 2008
> To update shape files. i got two questions:
For Shapefile updating issues, read this post:
> 1. How could i delete a field from a shapelayer?
You have to create new Shapefile based on attributes schema of the
exisiting Shapefile but removing unwanted field.
If your shapefile stores any features, it's not possible to update its
> 2. How to set a value to a specified field of all records?
> Could i use SQL sentences like "set field_name='value'" on the
> datasource of shapelayer?
You can do it programmatically with a script or C/C++ program.
OGR SQL  engine does not support SQL UPDATE/INSERT commands.
BTW, it's a good idea to scan the archives of this mailing list, where
you will find a lot of discussion about updating Shapefile issues.
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
More information about the gdal-dev