STAC Catalogs
Access STAC (SpatioTemporal Asset Catalog) catalogs with pystac and odc.stac.
Earth on AWS
@fused.udf
def udf(
bounds: fused.types.Bounds = [-77.083, 38.804, -76.969, 38.983],
):
import odc.stac
import pystac_client
import planetary_computer
odc.stac.configure_s3_access(aws_unsigned=True)
catalog = pystac_client.Client.open("https://earth-search.aws.element84.com/v1")
# Loading Elevation model
items = catalog.search(
collections=["cop-dem-glo-30"],
bbox=bounds
).item_collection()
xarray_dataset = odc.stac.load(
items,
crs="EPSG:3857",
bands=["data"],
resolution=150,
bbox=bounds,
).astype(int)
return xarray_dataset["data"], bounds
Microsoft Planetary Computer
@fused.udf
def udf(
bounds: fused.types.Bounds = [-122.463,37.755,-122.376,37.803],
):
import odc.stac
import planetary_computer
import pystac_client
catalog = pystac_client.Client.open(
"https://planetarycomputer.microsoft.com/api/stac/v1",
modifier=planetary_computer.sign_inplace,
)
# Loading Elevation model
items = catalog.search(collections=["cop-dem-glo-30"],bbox=bounds).item_collection()
xarray_dataset = odc.stac.load(
items,
crs="EPSG:3857",
bands=["data"],
resolution=150,
bbox=bounds,
).astype(int)
return xarray_dataset["data"], bounds