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

add warning when trying to create huge VRT #381

Closed
wants to merge 3 commits into from
Closed

Conversation

vincentsarago
Copy link
Member

ref #348

Still not sure how to resolve this issue, but for now here I added a warning when the output resolution is bigger than the small overview resolution.

The main problem is that in this case, rio-tiler will create a Huge VRT (matching the input bounds) and use out_shape https://github.com/cogeotiff/rio-tiler/blob/master/rio_tiler/reader.py#L101 to fetch the data for the right overview. But when the output resolution is > to the min resolution for the COG, we will create a bigger VRT and still read part like 256x256 while in reality with might need only 10x10 pixel resampled to 256x256.

Comment on lines +210 to +212
# Warns when the read resolution (tile, part) is lower than the
# resolution of the smaller overview. This will result in rasterio/rio-tiler
# creating a big WarpedVRT and trying to read a small part of it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put this in the second line of the warning message as well. Just saying

Trying to fetch lower resolution than min overview resolution

doesn't really tell anything to the user, and as a user I'd be confused why I'm getting warned at.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, TBH I'm still not sure about the warning, I hope I'll be able to find a solution instead 😄

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 this pull request may close these issues.

2 participants