Created
April 3, 2024 03:41
-
-
Save robbibt/87182d88451e1f7ac6e5c9fda1ca0798 to your computer and use it in GitHub Desktop.
Load raster data directly from a STAC item using `odc-stac`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pystac import Item | |
from odc.stac import load | |
import rasterio | |
import odc.geo.xr | |
path = 'https://dea-public-data-dev.s3-ap-southeast-2.amazonaws.com/derivative/ga_s2ls_intertidal_cyear_3/1-0-0/x128/y165/2016--P1Y/ga_s2ls_intertidal_cyear_3_x128y165_2016--P1Y_final.stac-item.json' | |
# path = 'https://dea-public-data-dev.s3-ap-southeast-2.amazonaws.com/derivative/ga_s2ls_intertidal_cyear_3/1-0-0/x128/y165/2017--P1Y/ga_s2ls_intertidal_cyear_3_x128y165_2017--P1Y_final.stac-item.json' | |
items = [Item.from_file(path)] | |
data = load(items, chunks={}) | |
data.qa_ndwi_corr.plot.imshow() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment