<div dir="ltr"><div>Hello Even,</div><div><br></div><div>My map contains no overviews but a seamless collection of PNG tiles with zoom levels ranging from 13 to 17 (which I suppose is similar to overviews). Each tile is 256 x 256 pixels with the pixel being RGB888, a pretty much standard arrangement.<br></div><div><br></div><div>When reading I call each band's RasterIO this way:<br></div><div><br></div><div>GDALRasterBand *b1 = DataSetIn->GetRasterBand(1);</div><div>
b1->RasterIO(GF_Read, x * MAP_TILE_SIZE, y * MAP_TILE_SIZE, MAP_TILE_SIZE, MAP_TILE_SIZE, red, MAP_TILE_SIZE, MAP_TILE_SIZE, GDT_Byte, 0, 0, NULL);</div><div><br></div><div>having:</div><div><br></div><div>
MAP_TILE_SIZE defined to be 256</div><div>red - is the red band which I've allocated to be 256 x 256 byte-sized pixel array<br></div><div>x & y are tile's id with respect to the main map's top-left corner at (0,0).</div><div><br></div><div>But this would always return data in zoom-level 17.</div><div><br></div><div>Deyan<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 29, 2021 at 8:50 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Deyan,</p>
<p>you generally don't need to use that option. The driver should
automatically select the right overview level when you use the
dataset or band RasterIO() methods, according to the window of
interest and the size of the buffer you specify.</p>
<p>Even<br>
</p>
<div>Le 29/12/2021 à 19:47, Deyan Vasilev a
écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hello,</div>
<div>I am trying to handle map zooming in a GDAL-based MBTiles
windows app. The only way I have found to control the raster's
zoom level is through GDALOpenEx's open options.</div>
<div><br>
</div>
<div>Changing the zoom-level app-side would require closing the
MBTiles db and reopening it, passing the new zoom level as an
open option. I made this to work but it seems to me
somehow clumsy as there is surely a significant overhead for
closing and reopening the db.<br>
</div>
<div><br>
</div>
<div>Can you please share if there is a way to request specific
zoom-levels without doing the closing/reopening stuff?<br>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote></div>