Opened 16 years ago

Closed 16 years ago

#2561 closed defect (fixed)

ogr2ogr overwrite option not working for Shapefile output

Reported by: tomkralidis Owned by: warmerdam
Priority: normal Milestone: 1.6.0
Component: OGR_SF Version: 1.5.2
Severity: normal Keywords:
Cc:

Description

Note that used to work in 1.2.6:

$ ogr2ogr -F "ESRI Shapefile" ./output_dir ./file.ovf
Generating Active_Climate_Stations-fr...
FAILED: Layer Active_Climate_Stations-fr already exists, and -append not specified.
        Consider using -append, or -overwrite.
ERROR 1: Terminating translation prematurely after failed
translation of layer Active_Climate_Stations-fr
 
$ ogr2ogr -overwrite -F "ESRI Shapefile" ./output_dir ./file.ovf
Generating Active_Climate_Stations-fr...
ERROR 6: DeleteLayer() not supported by this data source.
DeleteLayer() failed when overwrite requested.
ERROR 1: Terminating translation prematurely after failed
translation of layer Active_Climate_Stations-fr

We have sinced implemented a workaround to manually remove the files, but it would valuable to implement DeleteLayer() for shapefiles here.

Change History (1)

comment:1 by Even Rouault, 16 years ago

Resolution: fixed
Status: newclosed

OGRShapeDataSource::DeleteLayer() implemented in r15328.

Note that ogr2ogr -overwrite only works when using a directory as the destination for the shapefile driver. I don't see any trivial way of making it work when the destination is a filename.

Note: See TracTickets for help on using tickets.