[gdal-dev] Delete implementation of OGRMemDriver

Even Rouault even.rouault at spatialys.com
Thu Mar 30 07:19:11 PDT 2017


On jeudi 30 mars 2017 12:59:09 CEST Vautour, André (INT) wrote:
> Hi all,
> 
> We recently updated from 1.11.x to 2.1.3.
> 
> Previously, GDAL had the ODrCDeleteDataSource capability, which the
> OGRMemDriver did not handle in its TestCapability implementation. So, in
> effect, the memory driver did not support deletion, which makes sense to
> me.
> 
> From what I can tell, that capability was removed in favor of every driver
> supporting delete. My question is did, should calling Delete() on the
> OGRMemDriver with an existing file name delete the file on the file system?
> That seems to be what is happening, which is not what I would have
> expected. In our workflow, we were doing a CreateCopy to copy a source to
> the memory driver, but using the same name for the destination.
> 
> I can work around the problem by setting the QUIET_DELETE_ON_CREATE_COPY
> option, but I was wondering if delete being implemented on the memory
> driver makes sense.

The mem driver is particular in the sense that there's no filename associated to it (that is you 
can pass an arbitrary string on creation time, but it is just known by the dataset object. You 
can set empty strings to several MEM datasets and they will be different). So as soon as you 
close the dataset handle returned by CreateDataSource(), the resources are effectively 
freed. I don't think there's much difference between 1.X and 2.X for that.

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170330/f469f3fb/attachment.html>


More information about the gdal-dev mailing list