Closed jdries closed 2 months ago
useful link: https://planetarycomputer.microsoft.com/docs/quickstarts/reading-stac/ & https://github.com/microsoft/planetary-computer-sdk-for-python
I would check if the root link of a stac collection equals https://planetarycomputer.microsoft.com/api/stac/v1
, if so sign the pystac_client
Optional: add job-option/stac property (non standard) to provide your own subscription key. This key can be configured with planetary_computer.set_subscription_key(key)
@jdries: these collections?
landsat-c2-l1 landsat-c2-l2
This works:
data_cube = (connection
.load_stac("https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2")
.filter_bbox(west=3.143622080824514, south=51.30768529127022, east=3.272047105221418, north=51.365902618479595)
.filter_temporal(["2024-04-12", "2024-04-13"])
.filter_bands(["OLI_B4", "OLI_B3", "OLI_B2"])
.save_result("GTiff"))
nice! Can you do an attempt for somewhere in 2010? We also want to check if it works for older landsat platforms.
Works:
data_cube = (connection
.load_stac("https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2")
.filter_bbox(west=3.143622080824514, south=51.30768529127022, east=3.272047105221418,
north=51.365902618479595)
.filter_temporal(["2010-04-06", "2010-04-07"])
.filter_bands(["TM_B3", "TM_B2", "TM_B1"])
.save_result("GTiff"))
Integration test against openeo-dev finishes successfully.
Stac collections and data is open on MSPC, but rate limited. So token is required for every request. Pystac client will automatically fill in token for every request.
Then we can access any STAC collection from MSPC including Landsat.