Skip to content

Instantly share code, notes, and snippets.

@alexgleith
Last active March 18, 2025 22:38
Show Gist options
  • Save alexgleith/a1f4ddba36bc06f55c8cdefc6944373a to your computer and use it in GitHub Desktop.
Save alexgleith/a1f4ddba36bc06f55c8cdefc6944373a to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmcandr
Copy link

bmcandr commented Mar 14, 2025

TIL I can use stacrs to search STAC GeoParquet a la pystac-client and deserialize the result to pystac objects. Thanks for sharing!

@alexgleith
Copy link
Author

TIL I can use stacrs to search STAC GeoParquet a la pystac-client and deserialize the result to pystac objects. Thanks for sharing!

And it’s fast too! Well, 30 seconds is pretty good 😌

@bmcandr
Copy link

bmcandr commented Mar 16, 2025

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 the Visualizing the Imagery on an Interactive Slippy Map section. 🚀

@Kirill888
Copy link

@alexgleith

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