[Gdal-dev] How to use GetLockedBlockRef

Reiner Beck r.beck at m4com.de
Tue Apr 4 12:30:18 EDT 2006


Hello list,
Hello Frank,

after upgrading to GDAL 1.3.1 (from 1.2.6) the method 
GDALRasterBand::GetBlockRef() is no longer available. It has been 
replaced by GDALRasterBand::GetLockedBlockRef().

Simply replacing the call with GDALRasterBand::GetLockedBlockRef() does 
work somehow. However, for large images the process will allocate the 
whole memory of the system up to a degree where it becomes unusable.

I fixed that by releasing each band after accessing the tile data with 
"block->DropLock()". This seems to work.

Question: Is this the supposed way to use the block cache? If not, a 
short example would help ...

The documentation for GDALRasterBand still contains references to 
GetBlockRef. To avoid confusion I propose to remove or change that. 
Further, I have the impression that some public member functions in 
GDALRasterBlock shouldn't really be public, or am I supposed to use e.g. 
Internalize()?

Cheers
Reiner





More information about the Gdal-dev mailing list