[gdal-dev] Overriding IRasterIO in class derived from GDALRasterBand

Tamas Szekeres szekerest at gmail.com
Fri Aug 7 12:03:06 EDT 2009


Did you call DropLock() right after copying the data on the newly allocated
block? This assertion shows the raster block have remained in locked state.

It's quite annoying if you find long executing times somewhere. Did you know
how much time required to fetch the data and place that into the internal

One issue with this concept would be related to the limited memory size of
the particular machine, it may be more reasonable to copy the retrieved
blocks directly onto the output buffer if possible. In this case you cannot
much rely on the base RasterIO implementation.

Best regards,


2009/8/7 Jorge Arévalo <jorge.arevalo at gmail.com>

> Hello,
> Context: GDAL WKT Raster driver
> In my class derived from GDALRasterBand, I've overrided the methods:
> - IReadBlock: Fetch a block from database
> - IRasterIO: Should fetch several blocks, that cover an area, and add
> them to papoBlocks (cache). The idea is to avoid rounds in the server
> AFAIK, the base IRasterIO implementation (in GDALRasterBand), tries to
> fetch the block from the cache. If the block isn't in the cache, then
> call to IReadBlock. So, the normal way to read blocks in any GDAL
> driver should be IRasterIO --> IReadBlock
> Then, If I override IRasterIO in my driver RasterBand's class, I
> should fetch several blocks in one round and call GetLockedBlockRef to
> add these blocks to the cache. After this, call the base
> implementation of IRasterIO (in GDALRasterBand) to do its work (see
> previous point).
> Is it correct? I have problems with my IRasterIO implementation,
> because it takes a long time executing until this fail:
> ERROR 7: Assertion `nLockCount == 0' failed
> in file `gdalrasterblock.cpp', line 228
> Is there any mistake in this approach? If not, I suppose I had to
> debug my queries, but I'd like to rule our wrong concepts first.
> Many thanks in advance.
> Best regards,
> Jorge
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090807/efde368c/attachment.html

More information about the gdal-dev mailing list