[Gdal-dev] RFC 12: Improved File Management
Ray Gardener
rayg at daylongraphics.com
Mon May 7 20:35:39 EDT 2007
> Ray,
>
> In MapServer I would like to be able to write a dataset with GDAL
and then
> ask for all the files so I can zip them up and return them to a client.
An issue here is that the returned filenames might not refer to files,
unless you know which VSI*L filesyshandler was used. Usually this
assumption is harmless -- the default handler is assigned at compile
time and set to use the machine's normal filesystem -- but when one
starts using other filesyshandlers (like you said, for mem and so
forth), then the assumption breaks.
If we want to enumerate and manage the physical entities in a dataset
regardless of how their storage is implemented, and add entity
management methods to GDALDataSet, the dataset needs to know how the
entities were stored. But storage details lie outside the driver. The
driver would need to forward an entity management call to the same
filesyshandler that originally wrote the entity.
So what we need is to have datasets know which filesyshandler they are
using. The driver's methods need an extra filesyshandler parameter,
which they can forward to datasets as part of the openinfo or something
similar. VSIFOpenL() needs to take a filesyshandler parameter, or
drivers should be able to call VSIFilesystemHandler::Open().
Then I could pass a filesyshandler subclass to driver::Create(), and
have the dataset do all of it's I/O with it, and know which
filesyshandler to use when doing entity management.
Issues like subdatasets could then be handled by treating the base
dataset as a filesystem, and implementing a filesyshandler for that
dataset's format.
Ray
More information about the Gdal-dev
mailing list