-
Notifications
You must be signed in to change notification settings - Fork 11
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
Show (non-cloud-optimized) GeoTiffs by default, too #46
Conversation
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.
Is there a test case that we can build for this? It might help me understand a little better the use case. Is the scenario that sometimes there is a COG and separate non-COG asset and we want to prioritize them differently?
If we don't have time for that, I can approve, merge and just make sure there are no regressions before approving. I'm also wondering if we want to comment this option out in the README.md, so we aren't committing to maintaining it as part of the "public" api until we have more use cases.
Not yet, but I can add one quickly. By default only COGs were loaded automatically for e.g. Items and I also want this to be possible for GeoTiff. In my use-case it's just a single asset in the Item with the GeoTiff media type. That's the only use-case I have right now. |
Thanks! Just added a test (stac-item/geotiff-default.html). I think it's fine to have this in the public API, I feel it is useful in any case where you don't have COGs but smaller GeoTiffs in STAC. |
hmm... lots of factors to think about! I think originally the thinking for only displaying COGs was that if there is a large non-COG GeoTIFF, it would be bad to try to render it because the layer would try to fetch a lot of data into the browser. It would appear as if it wasn't working to the user, because it would take a long time for the layer to fetch and display. I'm wondering if Long-term, it would probably be possible to create an open-source library that could guess the file size of a GeoTIFF by its metadata or maybe can we do a HEAD request to get the file size? We could then set a threshold, so anything lower than 10 MB would be displayed by default. It's a tough case, especially for stac-browser where you are trying to work for all cases! :-) |
Yes, that's why the option is off by default, also in STAC Browser. This is really for niche cases where the author is sure that the input/catalog only contains small GeoTiffs. We have that currently for a catalog that contains ML source imagery, which are all 256x256px GeoTiffs, which are pretty small and I need the GeoTiffs to show up automatically. In this case, I enable this specifically in that deployment. The option is really just for default detection, because if you pass a GeoTiff asset it already loads large GeoTiffs with the existing code so As the current implementation shouldn't change anything if you don't set the option specifically, I don't see a huge risk here. I like the HEAD idea for the future! |
sounds good. will merge and then test and republish |
Instead of just looking for COGs to show, also allow GeoTiffs to be loaded automatically. Added an option so it should now affect existing implementations.