
How to use STAC¶
Install¶
pip install pystac-client
Connect and search¶
Open a connection to the eodc catalogue and search for items by collection, bounding box, and time range:
import pystac_client
stac_url = "https://catalogue.services.eodc.eu"
eodc = pystac_client.Client.open(stac_url)
found = eodc.search(
collections=["S1_SAR_GRD"],
bbox=[7.9, 48.9, 8, 49],
datetime="2021-07-01/2021-07-15"
)
for item in found.items():
print(item.id, item.datetime)
Step by step:
pystac_client.Client.open(stac_url)— connects to the eodc catalogue. No authentication required for public collections.eodc.search(collections=...)— filters by collection ID. Browse available collections at https://catalogue.services.eodc.eu/collections.bbox— spatial filter as[west, south, east, north]in WGS84 decimal degrees.datetime— temporal filter as an ISO 8601 interval (start/end). Single dates are also accepted.found.items()— iterates over matching STAC items. Each item contains metadata and links to the actual data assets.
List collections¶
To see which collections are available, use the collection search and read the results as plain dictionaries:
for col in eodc.collection_search(limit=100).collections_as_dicts():
print(col["id"], "-", col.get("title"))
You can also narrow the list with a free-text query, e.g. eodc.collection_search(q="flood").
Next steps¶
Load assets into xarray using
odc-stac— see the Load Data with Xarray notebook.See the Data Discovery notebook for a full worked example of searching and browsing collections.
Browse available collections: https://catalogue.services.eodc.eu/collections