Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep 128 as default GDAL_TIFF_OVR_BLOCKSIZE #60

Closed
vincentsarago opened this issue Mar 13, 2019 · 0 comments · Fixed by #61
Closed

keep 128 as default GDAL_TIFF_OVR_BLOCKSIZE #60

vincentsarago opened this issue Mar 13, 2019 · 0 comments · Fixed by #61

Comments

@vincentsarago
Copy link
Member

vincentsarago commented Mar 13, 2019

While working on the web-optimized (ref: #62) option I realized I made a bad choice from the beginning. in

GDAL_TIFF_OVR_BLOCKSIZE=os.environ.get("GDAL_TIFF_OVR_BLOCKSIZE", block_size),
we set GDAL_TIFF_OVR_BLOCKSIZE to be the same as the internal tile for the high resolution data. This is usually ok, but in a case of web-optimized COG, it will result in GDAL having to fetch more tiles than needed.

👇 here we created a COG with internal tiles (256px for high resolution and overviews) aligned with web mercator grid (left). But the right image show that the overview (level 1) internal tiles are not aligned with the mercator grid at zoom - 1 (this is in fact normal).
Capture d’écran, le 2019-03-12 à 23 37 33

Having internal tiles not aligned for overview is normal, but if we look at the figure 👇, if we try to fetch the data for mercator tile 17-118594-60034, GDAL will fetch 2 256x256px internal tiles (0,0 and 1,0) while the mercator tile only cover 1/4 of the area for those tiles.

Capture d’écran, le 2019-03-12 à 23 29 36

Because GDAL can merge http call for adjacent range requests, having different internal tiles size for overviews will not create any harms and should speed up the performance.

⚠️
I'm inclined to update the CLI and add a --overview-tilesize option with default to GDAL_TIFF_OVR_BLOCKSIZE env and a fallback to 128.

This will be a breaking change and should happen before 1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant