From 842b3d7263207d63b57af481b11bf4413e48f969 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Fri, 7 Oct 2022 10:41:14 +0200 Subject: [PATCH] fixup! fixup! fixup! fixup! fixup! Issue #114/#141 convert inline GeoJSON in aggregate_spatial to VectorCube --- openeo_driver/ProcessGraphDeserializer.py | 4 +++- openeo_driver/dummy/dummy_backend.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openeo_driver/ProcessGraphDeserializer.py b/openeo_driver/ProcessGraphDeserializer.py index 8eaee1a9..2bfc3bec 100644 --- a/openeo_driver/ProcessGraphDeserializer.py +++ b/openeo_driver/ProcessGraphDeserializer.py @@ -1322,7 +1322,9 @@ def run_udf(args: dict, env: EvalEnv): if isinstance(data, AggregatePolygonResult): pass if isinstance(data, DriverVectorCube): - # TODO: this is temporary adaption to old style save results. Better have proper DriverVectorCube support in run_udf? + # TODO: this is temporary stopgap measure, converting to old-style save results to stay backward compatible. + # Better have proper DriverVectorCube support in run_udf? + # How does that fit in UdfData and UDF function signatures? data = data.to_legacy_save_result() if isinstance(data, (DelayedVector, dict)): diff --git a/openeo_driver/dummy/dummy_backend.py b/openeo_driver/dummy/dummy_backend.py index 8adf0ba4..c3d6e791 100644 --- a/openeo_driver/dummy/dummy_backend.py +++ b/openeo_driver/dummy/dummy_backend.py @@ -228,6 +228,7 @@ def assert_polygon_sequence(geometries: Union[Sequence, BaseMultipartGeometry]) coords[self.metadata.band_dimension.name] = self.metadata.band_names shape = [len(coords[d]) for d in dims] data = numpy.arange(numpy.prod(shape), dtype="float") + # Start with some more interesting values (e.g. to test NaN/null/None handling) data[0] = 2.345 data[1] = float("nan") cube = xarray.DataArray(