cogeotiff/rio-cogeo

COG validation fails for files that are SPARSE and have sparse edge tiles in the overviews.

mpadillaruiz opened this issue ยท 4 comments

I am using the rio-cogeo validator to validate a sparse COG file and the validation returns False even though it is a valid COG. Other COG validators return valid for the same file.

I believe this is 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 it is zero, and it cannot verify that the overviews are in the right order, even though they are.

Is this a limitation of the validator? Is there a way to overcome this issue or is it planned to be fixed?

Thank you.

๐Ÿ‘ Yes I think we should fix this!
Do you have an example of file you could create or share? ๐Ÿ™

Hi @vincentsarago
Here is a link to the file I have been testing with
https://drive.google.com/file/d/1urWkrF0qY-JZ54souDdj5gljsL5CLivZ/view?usp=sharing

I get the following error with the validator:

COG Validation info
    - The offset of the first block of overview of index 1 should be after the one of the overview of index 2 (error)

Note that the overviews and full image are in the right order if you ignore the sparse zero blocks:
fullimage
overview1
overview2
overview3
overview4

Hi @vincentsarago ,
I opened a PR for this fix. I was not able to add reviewers but please let me know if there is some other procedure I need to follow.

Thank you!

this was done in #282