<div dir="ltr"><div>Thanks Even</div><div><br></div><div>I tried both ways and in both I am still getting a lot of requests, I am exepcting only few, one for the headers and one for the tile:</div><div><br></div><div><br></div><div>The resolution I used is driven from <a href="https://wiki.openstreetmap.org/wiki/Zoom_levels">https://wiki.openstreetmap.org/wiki/Zoom_levels</a></div><div><br></div><div>and the bounds I calculated using mercantile <br></div><div><br></div><div>so an example of what I ran is:</div><div><br></div><div>gdal_translate source.tif target.tif -co TILED=YES -co COPY_SRC_OVERVIEWS=YES -co COMPRESS=LZW -tr 0.596 0.596   -projwin 675091.8338146766 4706074.957461731 684875.7734351791 4696291.017841227</div><div><br></div><div>One more thing, the raster I got is 1/3 of the size of the original raster<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 17, 2018 at 12:00 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On dimanche 17 juin 2018 10:19:34 CEST Guy Doulberg wrote:<br>
> Hi all,<br>
> <br>
> I am trying to use cloud optimized geotiff(cog) to reduce the block fetched<br>
> when accessing a raster.<br>
> <br>
> The use case I am trying to build, is a TileServer that serves tile in<br>
> openlayer map.<br>
> The rasters are to be stored on a remote location, in my case azure blob<br>
> storage.<br>
> <br>
> We were able to do that, and you can see the code here:<br>
> <a href="https://github.com/satellogic/telluric/blob/master/telluric/" rel="noreferrer" target="_blank">https://github.com/satellogic/<wbr>telluric/blob/master/telluric/</a><br>
> georaster.py#L1497<br>
> <br>
> The problem is, when running in verbose mode I can see that there are many<br>
> requests to the blob storage,<br>
> <br>
> I am responsible of creating the raster, is there a way in your opinion I<br>
> can create the raster aligned to the XYZ tiling system so when I try to<br>
> fetch a tile from the raster I will be able to do that with a single or<br>
> close to that call?<br>
<br>
</span>If your raster source is not already in WebMercator projection, you could use <br>
gdalwarp with the appropriate -te and -tr to align on the boundaries of XYZ <br>
tiling scheme at a given zoom level.<br>
<br>
If your raster is already in WebMercator, gdal_translate -projwin -tr would do<br>
<br>
If you don't want to compute the bounds, you could use gdal_translate to <br>
MBTiles that will use gdalwarp internally to reproject and align on XYZ tiling <br>
scheme automatically, followed by gdal_translate to TIFF with -oo <br>
USE_BOUNDS=NO so that the extent used aligns on tile boundaries.<br>
<span class="HOEnZb"><font color="#888888"><br>
Even<br>
<br>
-- <br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></div><br></div>