-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
There are some folks doing STAC in GeoParquet files, see: https://github.com/stac-utils/rustac-py
You can load this into an xarray using odc.stac.load
as shown in the below code.
import rustac
import pystac
from odc.stac import load
url = "https://data.source.coop/ausantarctic/ghrsst-mur-v2/ghrsst-mur-v2.parquet"
year = 2025
dicts = await rustac.read(url)
items = [pystac.Item.from_dict(d) for d in dicts["features"]]
less_items = [i for i in items if i.datetime.year == year]
print(f"Found {len(items)} items, filtered to {len(less_items)} items for {year}")
data = load(
less_items,
chunks={"longitude": 4000, "latitude": 4000, "time": 1},
measurements=["analysed_sst"],
fail_on_error=False
)
data
We could shortcut this by supporting a parquet file in the load function, so odc.stac.load("https://example.com/stac.parquet")
and handle all the filtering and so on. It would be pretty neat!
Metadata
Metadata
Assignees
Labels
No labels