[gdal-dev] GDAL block cache question

Frank Warmerdam warmerdam at pobox.com
Wed Oct 8 15:33:14 EDT 2008


Luke Roth wrote:
> Hi everybody,
> 
> I've been working on writing an image viewer using GDAL, and I'd like
> to take advantage of the block cache to avoid keeping multiple copies
> of things in memory where I can.  I'm currently using the
> GetLockedBlockRef() function, which works well, but can sometimes lead
> to large delays when scrolling around and reading in new data.  Is
> there any easy way to check to see if a particular block is present in
> the cache before trying to read it?  I've found the
> TryGetLockedBlockRef() function, which I could use to read the data
> from the cache, note which blocks are not valid, and go back and read
> those blocks in idle time or in a separate thread, but it's protected
> and I don't really want to mess with the GDAL class hierarchy if I
> don't have to.  Is there a straightforward way to do this?

Luke,

I would not be adverse to making this method public instead of protected.
I'd suggest you try out this approach locally and if it accomplishes what
you need file a ticket on the issue - hopefully before GDAL 1.6.0 beta1 is
issued.

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