openeo-python-client
openeo-python-client copied to clipboard
Create datacube from UDP more easily
Currently, I need to create a datacube from a UDP as follows:
udp_sar = connection.save_user_defined_process(
user_defined_process_id="s1_stats",
process_graph=s1_stats,
parameters=[temporal_extent, spatial_extent],
summary="S1 SAR stats",
description="Calculate S1 SAR stats (min, max, mean, sd, q10, q50, q90). This service can cost an approximate of 3-5 credits per sq km. This cost is based on resource consumpltion only and added-value cost has not been included.",
public=True,
)
public_url, _ = [
l["href"] for l in udp_sar.describe()["links"] if l["rel"] == "canonical"
]
sar = connection.datacube_from_process(
"s1_stats",
namespace=public_url,
temporal_extent=["2023-05-01", "2023-07-30"],
spatial_extent={"west": 8.82, "south": 44.40, "east": 8.92, "north": 44.45},
)
It would be nice if the client could allow to pass the UDP directly:
udp_sar = connection.save_user_defined_process(
user_defined_process_id="s1_stats",
process_graph=s1_stats,
parameters=[temporal_extent, spatial_extent],
summary="S1 SAR stats",
description="Calculate S1 SAR stats (min, max, mean, sd, q10, q50, q90). This service can cost an approximate of 3-5 credits per sq km. This cost is based on resource consumpltion only and added-value cost has not been included.",
public=True,
)
sar = connection.datacube_from_process(
udp,
temporal_extent=["2023-05-01", "2023-07-30"],
spatial_extent={"west": 8.82, "south": 44.40, "east": 8.92, "north": 44.45},
)