[Gdal-dev] caching of the blocks

Stephane Routelous route at cae.com
Fri Aug 27 13:28:07 EDT 2004


Hi Frank,

Thanks a lot for your quick answer.
I need to use the ReadBlock to have the best performances, and also because
of the resampling.
I will continue to use it and implement my own cache mecanism.

Cheers,

Stephane
http://www.exotk.org


-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com]
Sent: Friday, August 27, 2004 1:14 PM
To: Stephane Routelous
Cc: 'gdal-dev at remotesensing.org'
Subject: Re: [Gdal-dev] caching of the blocks


Stephane Routelous wrote:
> Hi,
> 
> I'm using GDALRasterBand::ReadBlock to access raster info; I cannot use
> RasterIO because I need to scale the values by myself.
> Is it true that the ReadBlock method does not put the blocks in cache ?
> I tried to follow the code to see what's happenning, and it seems so.
> Can you confirm that ?

Stephane,

I can confirm that.  ReadBlock() just does a wee bit of parameter checking
and then calls IReadBlock() at the driver specific level.  This reads into
the passed in data array but no where in this call chain is the existing
block cache used or populated.

The ReadBlock() method is essentially intended to be the most direct
way of getting data from a driver with no overhead from caching, resampling
or data type conversion.

In retrospect, I'm not sure I like this approach so well.  The fact that you
might already have the block in cache and that would be ignored is kind of
obtuse for instance.

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