Skip to content

Allow openeo.api.process.Parameter object as resolution in DataCube.resample_spatial() #897

@VincentVerelst

Description

@VincentVerelst

Version: 0.49.0

Problem
The following script will fail

import openeo 
from openeo.api.process import Parameter

c = openeo.connect("openeo.dataspace.copernicus.eu").authenticate_oidc()

s2 = c.load_collection("SENTINEL2_L2A", spatial_extent={"west": 16.0, "south": 48.0, "east": 17.0, "north": 49.0}, temporal_extent=["2021-01-01", "2021-12-31"])

res_param = Parameter.number(
    name='resolution'
)

s2 = s2.resample_spatial(
    resolution=res_param
)

Because normalize_resample_resolution doesn't allow for an openeo.api.process.Parameter:

def normalize_resample_resolution(

Solution

Support openeo.api.process.Parameter in openeo.utils.normalize.normalize_resample_resolution() by returning something like (None, None) in that case.

CC: @Pratichhya

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions