Open-EO / openeo-geopyspark-driver

OpenEO driver for GeoPySpark (Geotrellis)
Apache License 2.0
25 stars 4 forks source link

MSPC authentication support for Landsat access #760

Closed jdries closed 2 months ago

JeroenVerstraelen commented 2 months ago

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.

VictorVerhaert commented 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)

bossie commented 2 months ago

@jdries: these collections?

landsat-c2-l1 landsat-c2-l2

bossie commented 2 months ago

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"))
jdries commented 2 months ago

nice! Can you do an attempt for somewhere in 2010? We also want to check if it works for older landsat platforms.

bossie commented 2 months ago

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"))
bossie commented 2 months ago

Integration test against openeo-dev finishes successfully.