[Gdal-dev] what is supplement to CreateLayer command?

Frank Warmerdam warmerdam at pobox.com
Sat Mar 3 00:55:14 EST 2007

Gennady Khokhorin wrote:
> Hello, all.
> I'm creating output data using OGRDataSource::CreateLayer(fileName, ...)
> and need to drop "empty" data set (no features in shp for example).
> What is a supplement to this creation command? Is there some command
> to drop file in OGR/GDAL style?


There is a DeleteLayer() method on the OGRDataSource class, but it is
only implemented for a small number of driver, and I don't think the
shapefile driver is one of those.   Luckily shapefiles are pretty
easy to do yourself, so you can always delete them yourself using
unlink() after closing the datasource.

If you would like DeleteLayer() implemented for the shapefile please
file an enhancement request.

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