Report for week 7.--11..7.2008.<br><br>I learned how to use cpl_minixml to parse TMS TileMap file. From this the first executable read driver for TMS followed. I tried it on datasets created by gdal2tiles.py using gdal_translate. Found a bug in gdal2tiles which Klokan promptly fixed. As I mentioned in the previous report, all my initial attempts to tile caching went out of the window. So for the time being I implemented the IReadBlock in the most straightforward way possible -- just read the tile from disk, perform raster IO and destroy the tile dataset. Turns out GDALRasterBand has its own block cache. I have to investigate it further to determine how big it is etc. and how it would interact with my driver. <br>
<br>The code worked, sort of. I found out the hard way the differences between TMS and GDAL raster abstractions. GDAL has raster with (0,0) coordinates in the top left corner and can work on them in blocks. TMS has blocks (tiles) but it has (0,0) in the bottom left corner. So, if raster height is not a multiple of tile height the GDAL blocks does not map 1:1 to tiles. If the IReadBlock was implemented the way it was, it would have to read two tiles and create one block from them. On top of this, some drivers (PNG for example) doesn&#39;t like nonlinear acces which would be necessary in this case. To solve this I introduced tile cache which holds predefined number of tiles in MEM datasets. IReadBlock read data from the two according cached tiles.<br>
<br>Again, this worked, sort of. The problem is that IReadBlock has to fill the buffer using two RasterIO calls and have to calculate appropriate offset in the buffer for the second call. The code I have written works for BMP datasets but not for GeoTiff, so there is some bug I will have to fix. I sent this code to Frank for review as he requested.<br>
<br>What do to next:<br><br>Found out how to reliably and portably fill one buffer from two sources. Additional positive effect of this is that then I could simplify the tile cache. Now it is a set of MEM GDALDatasets. But that is probably not necessary. It could just be one giant buffer into which the data would be loaded during cache fill and from which the IReadBlock would copy the data to its source buffer. After this works, jump to the writing part of driver. In terms of raster IO it would be already almost done, but the Create method has to create a directory structure and generate the XML file basen on creation options, which I have not investigated much yet.<br>
<br>Václav &quot;Keo&quot; Klusák<br>