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

read low resolution version of the data #348

Open
vincentsarago opened this issue Feb 11, 2021 · 0 comments
Open

read low resolution version of the data #348

vincentsarago opened this issue Feb 11, 2021 · 0 comments

Comments

@vincentsarago
Copy link
Member

By design rio-tiler assume you are working within the native zoom range of your data (raw data = Max res, max res/number of overviews ~= minzoom).

When reading a file, we always use a VRT to align the data to the bounds/size we want to read. This is all defined in

tile_transform = from_bounds(w, s, e, n, width, height)
w_res = (
tile_transform.a
if abs(tile_transform.a) < abs(dst_transform.a)
else dst_transform.a
)
h_res = (
tile_transform.e
if abs(tile_transform.e) < abs(dst_transform.e)
else dst_transform.e
)
vrt_width = math.ceil((e - w) / w_res)
vrt_height = math.ceil((s - n) / h_res)
vrt_transform = from_bounds(w, s, e, n, vrt_width, vrt_height)
return vrt_transform, vrt_width, vrt_height

(this part was copie from rasterio/rasterio#1373 (comment))

if you try to read a really low version of your data, we will first create a huge VRT and then ask to read a decimated part of it (this is to make sure we read the overview).

To be honest, for now I'm not sure there is a solution for this.

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

No branches or pull requests

1 participant