From 329a4ce130974b5dea93c03e12ae0e1afa19ea4b Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Tue, 1 Aug 2023 18:24:57 +0200 Subject: [PATCH] fixup! fixup! PR #200 finetune VectorCube.apply_dimension --- openeo_driver/datacube.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openeo_driver/datacube.py b/openeo_driver/datacube.py index abba5d49..04c43916 100644 --- a/openeo_driver/datacube.py +++ b/openeo_driver/datacube.py @@ -520,8 +520,12 @@ def apply_dimension( if single_run_udf: # Process with single "run_udf" node if self._cube is None and dimension == self.DIM_GEOMETRIES and target_dimension is None: + log.warning( + f"Using experimental feature: DriverVectorCube.apply_dimension along dim {dimension} and empty cube" + ) # TODO: this is non-standard special case: vector cube with only geometries, but no "cube" data - feature_collection = openeo.udf.FeatureCollection(id="_", data=self._as_geopandas_df()) + gdf = self._as_geopandas_df() + feature_collection = openeo.udf.FeatureCollection(id="_", data=gdf) udf_data = openeo.udf.UdfData( proj={"EPSG": self._geometries.crs.to_epsg()}, feature_collection_list=[feature_collection], @@ -537,8 +541,7 @@ def apply_dimension( return DriverVectorCube(geometries=result_features[0].data) raise ValueError(f"Could not handle UDF result: {result_data}") - else: - raise FeatureUnsupportedException() + raise FeatureUnsupportedException()