Last active
March 18, 2025 22:38
-
-
Save alexgleith/a1f4ddba36bc06f55c8cdefc6944373a to your computer and use it in GitHub Desktop.
These items are missing raster extension, if you patch them like so:
from pystac.extensions.raster import RasterExtension
from copy import deepcopy
def patch(item_dict):
item_dict = deepcopy(item_dict)
item_dict['assets']['visual']['raster:bands'] = [{}]*4 #< or better yet specify
item_dict['assets']['analytic']['raster:bands'] = [{}]*4 #< correct `data_type` and `nodata` here
item_dict['stac_extensions'].append(RasterExtension.get_schema_uri())
return item_dict
you should be able to load bands separately by using bands=['red', 'green', 'blue']
option, it will use analytics
band, to load visual bands separately you can use bands=[..., "visual.1", "visual.2", "visual.3"]
and then rename I guess.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I updated my demo notebook to include an example of using
stacrs
to search for Items and display images on a slippy map via a tile server. See theVisualizing the Imagery on an Interactive Slippy Map
section. 🚀