Jorge,<br><br>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.<br><br>It&#39;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 buffer.<br>
<br>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.<br>
<br>Best regards,<br><br>Tamas<br> <br><br><br><div class="gmail_quote">2009/8/7 Jorge Arévalo <span dir="ltr">&lt;<a href="mailto:jorge.arevalo@gmail.com">jorge.arevalo@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
Context: GDAL WKT Raster driver<br>
<br>
In my class derived from GDALRasterBand, I&#39;ve overrided the methods:<br>
<br>
- IReadBlock: Fetch a block from database<br>
- IRasterIO: Should fetch several blocks, that cover an area, and add<br>
them to papoBlocks (cache). The idea is to avoid rounds in the server<br>
<br>
AFAIK, the base IRasterIO implementation (in GDALRasterBand), tries to<br>
fetch the block from the cache. If the block isn&#39;t in the cache, then<br>
call to IReadBlock. So, the normal way to read blocks in any GDAL<br>
driver should be IRasterIO --&gt; IReadBlock<br>
<br>
Then, If I override IRasterIO in my driver RasterBand&#39;s class, I<br>
should fetch several blocks in one round and call GetLockedBlockRef to<br>
add these blocks to the cache. After this, call the base<br>
implementation of IRasterIO (in GDALRasterBand) to do its work (see<br>
previous point).<br>
<br>
Is it correct? I have problems with my IRasterIO implementation,<br>
because it takes a long time executing until this fail:<br>
<br>
ERROR 7: Assertion `nLockCount == 0&#39; failed<br>
in file `gdalrasterblock.cpp&#39;, line 228<br>
<br>
Is there any mistake in this approach? If not, I suppose I had to<br>
debug my queries, but I&#39;d like to rule our wrong concepts first.<br>
<br>
Many thanks in advance.<br>
<br>
Best regards,<br>
Jorge<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br>