[Gdal-dev] rawdataset.cpp

Frank Warmerdam warmerdam at pobox.com
Wed Jul 16 15:55:16 EDT 2003


We need to fine tune the rules for RawRasterBand's decision on whether
to do "direct io" to satisfy a request vs. passing it off to the default
logic based on caching blocks (whole scanlines in the case of RawRasterBand).

There are a few applications, like MapServer where we know there will be
essentially one RasterIO() request made for a given dataset for the whole
map area that we want to render.  For these kinds of applications it may
be helpful skip any caching of data.  To address this I would like to give
applications (or users via the environment) to indicate to GDAL that IO
will take the form of a single big request.  In RawRasterBand::IRasterIO()
I would like you to check using the new CPLGetConfigOptions() call with
a symbol named "GDAL_ONE_BIG_READ".  If this is not set, or is "NO" then
we use a normal strategy that would tend towards caching data.  If this is
anything else we would tend towards satisfying this single request as
efficiently as possible.

Within RawRasterBand::IRasterIO() I would like the following decision

Use direct IO (the current implementation) if:

   GDAL_ONE_BIG_READ is enabled


   the length of a scanline on disk is more than 50000 bytes, and
   the width of the requested chunk is less than 40% of the whole
   scanline and none of the requested scanlines are already in the cache.

Otherwise just call GDALRasterBand::IRasterIO() forcing things to go through
the default caching logic.  Also, please ensure you keep the case for
overviews that I added even if the above conditions are satisified.

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    | Geospatial Programmer for Rent

More information about the Gdal-dev mailing list