-
Notifications
You must be signed in to change notification settings - Fork 2
Split traits to get image bytes and metadata bytes #79
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
Conversation
I think it's a good change, but the metadata bytes differ greatly from COG to COG, from a few kB to a few MB, so it's impossible for any middleware to be aware of that, unless we tell it how big tag data is. I do think it's a good change, please don't misunderstand, but here's the point:
What middleware could possibly account for both of these files? - I think none, unless #76 is landed. In #74, and the corresponding example, I did a:
|
Who is we? The developer at compile time or the end user at runtime?
Sure you can; you can have an exponential metadata reader. Start with 32kb; if you end up needing more than 32kb while still reading metadata you read the next 256kb. If you need more than that you read the next 2MB, and so on. This is still all at the
#76 only works on a single tag at a time, so I don't see how it solves the problem. |
With this PR, we can have a |
Was chatting with @vincentsarago and apparently this is roughly the same approach that GDAL takes to read header metadata |
Dev at compile time
Because of how a file is laid out in a COG and we're reading the full-res image first:
Since we're only really expecting to have large tile_info arrays in BigTiff, I went with the BigTiff assumption.
I think #74 does better than exponential prefetching in limiting the number of requests and not over-estimating if we're almost at the end of tile_info. But in any case, my proposed changes can also not be made, and then the logic for the |
aka LGTM, but please also #76 :) |
This allows for separate caching/buffering of image data and metadata.
Closes #78 . I think this probably also closes #76
cc @feefladder what do you think?