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

Running UDF on Vector Cube #197

Open
soxofaan opened this issue May 25, 2023 · 4 comments
Open

Running UDF on Vector Cube #197

soxofaan opened this issue May 25, 2023 · 4 comments

Comments

@soxofaan
Copy link
Member

reported by @mbuchhorn :

  • loading vector cube with connection.vectorcube_from_paths (which uses load_uploaded_files process)
  • run UDF on that cube

fails with

  File ".../openeo_driver/ProcessGraphDeserializer.py", line 1491, in run_udf
    data = data.to_legacy_save_result()
  File ".../openeo_driver/datacube.py", line 366, in to_legacy_save_result
    if cube.dims == (self.DIM_GEOMETRIES, "t"):
AttributeError: 'NoneType' object has no attribute 'dims'
@soxofaan
Copy link
Member Author

apparently, the VITO backend now has 3 non-official processes to load geojson data from url:

  • read_vector -> DelayedVector
  • get_geometries -> DelayedVector
  • load_uploaded_files -> DriverVectorCube

running run_udf on DriverVectorCube is not properly supported yet, so it might be better to use one of the others for now.

also related: Open-EO/openeo-processes#322 which recommends to use load_geojson to load geojson from URL

@soxofaan
Copy link
Member Author

hmm, I tried to set up a POC based on read_vector/DelayedVector, but that doesn't seem to be working either:
DelayedVector strips out all properties along the way (keeping only the geometries):

  • before passing the vector data to run_udf: so you can not access properties from your intput data
  • after run_udf, e.g. in save_result: so you can not access properties that were added in the UDF

@soxofaan
Copy link
Member Author

soxofaan commented Aug 3, 2023

I iterated on PR Open-EO/openeo-api#200 and merged that in f83d1cf which adds initial support for doing apply_dimension with a UDF on a vector cube

soxofaan added a commit that referenced this issue Aug 4, 2023
soxofaan added a commit that referenced this issue Aug 4, 2023
soxofaan added a commit that referenced this issue Aug 4, 2023
soxofaan added a commit that referenced this issue Aug 4, 2023
soxofaan added a commit that referenced this issue Aug 4, 2023
soxofaan added a commit that referenced this issue Aug 4, 2023
soxofaan added a commit that referenced this issue Aug 4, 2023
using `darker -v -i -r master openeo_driver tests`
soxofaan added a commit that referenced this issue Aug 4, 2023
soxofaan added a commit that referenced this issue Aug 4, 2023
using `darker -v -i -r master openeo_driver tests`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant