[Gdal-dev] ogr2ogr - delete features from a shapefile

Frank Warmerdam warmerdam at pobox.com
Sun Mar 4 23:47:07 EST 2007

keith lewis wrote:
> How can I delete features from a shapefile using the ogr2ogr utility? 
> The shapefile driver documentation indicates I should first delete the 
> appropriate records from the DBF file and then repack the file. Can 
> ogr2ogr do this or does it need to be done in code?


I don't believe that ogr2ogr or any of the commandline utilities offer
a mechanism to delete layers.  You need at least a small script to be
able to invoke the DeleteLayer() method on the OGRDataSource.

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