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

Fails to load some COGs #1

Closed
giswqs opened this issue Jul 7, 2021 · 3 comments
Closed

Fails to load some COGs #1

giswqs opened this issue Jul 7, 2021 · 3 comments
Labels
question Further information is requested

Comments

@giswqs
Copy link

giswqs commented Jul 7, 2021

Very nice work! I was trying the streamlit app with some COGs from maxar, but it seems the app can't load the data. Any advice? Thanks.

https://www.maxar.com/open-data/california-colorado-fires

https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif

https://opendata.digitalglobe.com/events/california-fire-2020/post-event/2020-08-14/pine-gulch-fire20/10300100AAC8DD00.tif

@mykolakozyr mykolakozyr added the bug Something isn't working label Jul 7, 2021
@mykolakozyr
Copy link
Owner

Thanks, @giswqs! And thanks for sharing links.
I'll take a look, I had some issues with specific CORS settings on the bucket. It could be the case. When there is a tiler in between, as it is implemented in @vincentsarago viewer, then it's solved.

The implementation of the current viewer does not have any tiler in between, so FE reads COG directly.

@robmarkcole
Copy link

robmarkcole commented Jul 7, 2021

I believe there is issue with single-band cogs (tracking on GeoTIFF/georaster-layer-for-leaflet#16):

georaster-layer-for-leaflet:2 ERROR initializing GeoTIFFLayer pixelValuesToColorFn is a required option for single-band rasters

RE cors we resolved this by updating the bucket S3 CORS policy:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]

@mykolakozyr
Copy link
Owner

Hey @robmarkcole, thanks for sharing that!
When I organize a bucket to share COGs, I do use those CORS settings as well. I believe in the case of the links shared by @giswqs, CORS settings are different.
The HTML page that is added to Streamlit app as a component returns the following error when run locally:
Access to fetch at 'https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

As a summary:

  • This implementation of the viewer renders COG directly on a browser with no layer in between (like tiler). Therefore, this issue would happen once the bucket settings do not allow CORS.

I don't consider adding any tiler to the viewer at this moment based on the whole concept of COG, so considering closing the issue.

@mykolakozyr mykolakozyr added question Further information is requested and removed bug Something isn't working labels Aug 1, 2021
@giswqs giswqs closed this as completed Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants