Repository navigation
fix(data): a large GeoTIFF opens from an overview whose size was rounded down, not by reading its whole full image (#1965) #2391
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Low confidence (~35%), behaviour change to confirm: the new comment says an overview counts as "as detailed" when it is the full size over k "rounded either way", which is a per-axis rule. The closure compares areas (
ow * oh >= floor_w * floor_h), so an overview that is short in one axis can pass if it is long in the other. For example, a 10,000 × 10,300 overview of 83517 × 78739 over 8 has area 103.0M, above the 102.7M floor product, and is accepted even though its width is 439 pixels short. The old ceil-area rule had the same shape, but this change widens the window, so the per-axis check is the stricter and clearer way to state the rule. Real writers produce proportional overviews, so this may never happen in practice. If you agree, the suggestion below also fixes the match guard that uses the closure:Left for the release quality pass (not raised inline):
decimatedis now used only foris_none(), so a plainlet decimable = k <= 1 << 20;would read better, and the floor values are computed twice (here and indw/dh).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Left as it is: the old rule was already an area comparison (ceil × ceil), so a disproportionate overview could pass it before too; this only moves its threshold to the floor product, at most one row and one column of the decimated grid. A per-axis rule alone would refuse overviews the area rule accepted until now (long one way, short the other), and those files would go back to reading their whole full image, the slowdown this PR fixes. Accepting either rule would cover both, but no writer makes such overviews (GDAL rounds up, terrio down, both proportionally), so it isn't worth the extra condition here.