stac-layer
stac-layer copied to clipboard
integration with "planetary computer"
I created this issue to track issues with integrating with Microsoft's "planetary computer". @JustinGOSSES is leading the way on this effort: https://observablehq.com/@justingosses/exploring-microsoft-planetary-computer-stac-catalog
- I changed the code, so that it will log the overview's href that you are using regardless of whether it's a JPG/PNG or GeoTIFF.
- I also added a test for a planetary computer STAC Item that was acting funny
Both changes in this commit: https://github.com/stac-utils/stac-layer/commit/75903710d3c4720e24ffaa9ef075b4b00706d06b
Issue with https://github.com/stac-utils/stac-layer/blob/main/src/test/stac-item/planetary-computer.html is that the asset with role "overview" (but name preview.png) returned by planetary computer is fully transparent: https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=gap&items=gap_landfire_nationalterrestrialecosystems2011_-1161135_562215_-861135_262215&assets=data&tile_format=png&colormap_name=gap-lulc
I loaded up the data GeoTIFF in QGIS and that's all zero values in it:

I'll try out more STAC features and see if we can debug them as well.
fwiw, it should be possible to write a library/function that would check if an image is fully transparent and log to the console when this is the case. this might be over-engineering though, so we'll have to test and see how often this is the case.
(Please excuse all the messages)
@JustinGOSSES , apologies if you already figured this. I think the reason why some of the images for the gap_landfire_nationalterrestial... feature collection aren't appearing is because they are in Mexico. I think they intersect the bbox of the continental USA, but not the actual polygon boundaries of the Landuse-Landcover Dataset that Microsoft uses.
For the projection issue, @JustinGOSSES , do you mean when the Leaflet map is displayed in typical Web Mercator, but the data is in something like Albers, so the image is warped when it's displayed? Do you have a specific example that you would like us to look at? Thank you!
That's all for now :-)
I'll need to replicate the projection issue a bit more.
I initially thought it was just different projection than leaflet default, but then I noticed some behavior that seemed like it might relate to zooming behaviors.
Haven't dived in deep yet, just put that note in the notebook as a reminder to look into it later.