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

class 'NoneType' after vector_to_raster #273

Closed
VincentVerelst opened this issue Mar 18, 2024 · 2 comments
Closed

class 'NoneType' after vector_to_raster #273

VincentVerelst opened this issue Mar 18, 2024 · 2 comments
Assignees

Comments

@VincentVerelst
Copy link

VincentVerelst commented Mar 18, 2024

After converting a VectorCube to a RasterCube using the vector_to_raster process, I get a ProcessParameterInvalidException when applying a process. The following code snippet is an example, when trying to apply the rename_labels process to the result of vector_to_raster:

...

scl = c.load_collection(
    "SENTINEL2_L2A",
    spatial_extent=spatial_extent,
    temporal_extent=temporal_extent,
    bands=["SCL"],
)

classification = scl.band("SCL")
binary = (classification == 3) | (classification == 8) | (classification == 9) | (classification == 10)

cloud_coverage = (1 - binary).aggregate_spatial(geometries=aoi_polygon, reducer='mean')
cloud_coverage_raster = cloud_coverage.vector_to_raster(scl)
cloud_coverage_raster = cloud_coverage_raster.rename_labels('bands', ['score'])

cloud_coverage_raster.execute_batch()

This results in: ProcessParameterInvalidException(status_code=400, code='ProcessParameterInvalid', message="The value passed for parameter 'data' in process 'rename_labels' is invalid: Invalid data type <class 'NoneType'> expected raster-cube.", id='no-request').

This problem is not specific for rename_labels as I've been able to reproduce it with other processes as well.

Job ID: j-240318430ec242549efa4d62c8bda33d
Backend: CDSE

@VincentVerelst
Copy link
Author

When running the above code on the CDSE staging backend, there is still a very similar error message:

ProcessParameterInvalidException(status_code=400, code='ProcessParameterInvalid', message="The value passed for parameter 'data' in process 'rename_labels' is invalid: Invalid data type <class 'openeo_driver.save_result.AggregatePolygonResult'> expected raster-cube.", id='no-request')

@JeroenVerstraelen
Copy link
Contributor

The AggregatePolygonResult as return type is a separate issue: #276
The issue described here is fixed.

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