<div dir="ltr"><div>Even suggestions worked for me,</div><div><br></div><div>I am working on code that can ease the process of doing that</div><div><br></div><div><a href="https://github.com/satellogic/telluric/blob/get_tile_aligned/telluric/georaster.py#L1344">https://github.com/satellogic/telluric/blob/get_tile_aligned/telluric/georaster.py#L1344</a></div><div><br></div><div>I will update when it is done </div><div><br></div><div>After working with that I realized that now I have a new question. How deep(low) to go in alignments. <br></div><div><br></div><div>If I align the raster only in the zoom level the raster is at then I might fetch more then one tile of overviews image data when overviews are used, but to align the raster to zoom level that is very low doesn't make sense either since the headers will be huge. <br></div><div><br></div><div>How do you guys deal with this case?<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 17, 2018 at 5:25 PM, Guy Doulberg <span dir="ltr"><<a href="mailto:guyd@satellogic.com" target="_blank">guyd@satellogic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>it is 1/3 because the original was not compressed, <br></div><div><br></div><div>anyhow I am still getting too many requests when fetching a tile, maybe my read code is not doing what I think it is doing</div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 17, 2018 at 4:51 PM, Guy Doulberg <span dir="ltr"><<a href="mailto:guyd@satellogic.com" target="_blank">guyd@satellogic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">https://wiki.openstreetmap.org<wbr>/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"><span>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></span><div><div class="m_1991883075412504267h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>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="m_1991883075412504267m_3199245136113313685HOEnZb"><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></div></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>