Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Aug 4, 2023
1 parent c51cea4 commit 38d98f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openeo_driver/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,18 +624,21 @@ def apply_dimension(
context: Optional[dict] = None,
env: EvalEnv,
) -> "DriverVectorCube":
# Is callback a single run_udf node process?
single_run_udf = SingleRunUDFProcessGraph.parse_or_none(process)

if single_run_udf:
# Process with single "run_udf" node
# TODO: check provided dimension with actual dimension of the cube
# TODO: also support along geometries dim (e.g. when it's the only dim)?
if dimension in (self.DIM_BANDS, self.DIM_PROPERTIES) 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
# TODO: data chunking (e.g. large feature collections)
gdf = self._as_geopandas_df()
feature_collection = openeo.udf.FeatureCollection(id="_", data=gdf)
# TODO: dedicated UDF signature to indicate to work on vector cube through a feature collection based API
udf_data = openeo.udf.UdfData(
proj={"EPSG": self._geometries.crs.to_epsg()},
feature_collection_list=[feature_collection],
Expand Down

0 comments on commit 38d98f5

Please sign in to comment.