Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply_neighborhood causes crash when overlap parameter is left undefined #519

Closed
GriffinBabe opened this issue Dec 18, 2023 · 1 comment
Closed
Assignees

Comments

@GriffinBabe
Copy link

When using the apply_neighborhood function and leaving the overlap parameter undefined (which is set to None by default), the geotrellis driver returns a 500 code on the request.

OpenEoApiError: [500] Internal: Server error: TypeError("'NoneType' object is not iterable")

Maybe the overlap parameter should be set by default to overlap=[] instead of overlap=None?

Minimal example:

import openeo

spatial_context = {
    "west": 5.0515130512706845,
    "south": 51.215806593713,
    "east": 5.060320484557499,
    "north": 51.22149744530769,
    "crs": "EPSG:4326"
}

temporal_context = ["2023-01-01", "2023-02-28"]

connection = openeo.connect("https://openeo.vito.be").authenticate_oidc()

cube = connection.load_collection(
    collection_id="SENTINEL2_L2A",
    spatial_extent=spatial_context,
    temporal_extent=temporal_context,
    bands=["SCL"]
)

def dummy_function(cube):
    return cube + 1

cube = cube.apply_neighborhood(
    dummy_function,
    size=[
        {"dimension": "x", "unit": "px", "value": 1},
        {"dimension": "y", "unit": "px", "value": 1}
    ],
)

cube.download('output.nc', format="NetCDF")
@jdries jdries self-assigned this Dec 20, 2023
jdries added a commit to Open-EO/openeo-geopyspark-driver that referenced this issue Dec 20, 2023
@jdries
Copy link
Collaborator

jdries commented Dec 20, 2023

fix committed

@jdries jdries closed this as completed Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants