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

Fix for issue #281 COG validation fails for sparse edge tiles #282

Merged

Conversation

mpadillaruiz
Copy link

#281
The rio-cogeo validator returns False even though it is a valid COG when there are sparse edge tiles in the file and/or overviews.

This was because the overviews are stored as sparse and the validator checks for the first tile offset of each overview (BLOCK_OFFSET_0_0 tag). Since there are sparse edge tiles, this value is zero, and it cannot verify that the overviews are in the right order, even though they are.

I changed the code to iterate over BLOCK_OFFSET_x_y based on the number of tile rows/columns for the main file and overviews. This makes sure that the data_offset variable gets populated if there is an offset after all the sparse tiles.

Added a new test that checks for a sparse image with sparse tiles on the edges. I also added the tif image for the test.

…PARSE and have sparse edge tiles in the overviews
@mpadillaruiz mpadillaruiz marked this pull request as draft February 2, 2024 20:04
@mpadillaruiz mpadillaruiz marked this pull request as ready for review February 2, 2024 20:04
@vincentsarago
Copy link
Member

thanks a lot @mpadillaruiz 🙏

@vincentsarago vincentsarago merged commit 220c539 into cogeotiff:main Feb 9, 2024
5 checks passed
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