Skip to content

Commit 4400565

Browse files
committed
Issue #114/#141/#239 re-enable automatic vector cube conversion for Point geometries in aggregate_spatial
reverts 2ec255e and 4927eee openeo-geopyspark-driver now properly supports point geometries
1 parent e1e35f5 commit 4400565

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

openeo_driver/ProcessGraphDeserializer.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,24 +1052,8 @@ def aggregate_spatial(args: dict, env: EvalEnv) -> DriverDataCube:
10521052
geoms = geoms
10531053
elif isinstance(geoms, dict):
10541054
try:
1055-
if (
1056-
# Don't convert point geometries to DriverVectorCube
1057-
# TODO #114 migrate Point handling to DriverVectorCube too
1058-
geoms["type"] == "Point"
1059-
or (geoms["type"] == "Feature" and geoms["geometry"]["type"] == "Point")
1060-
or (
1061-
geoms["type"] == "FeatureCollection"
1062-
and any(f["geometry"]["type"] == "Point" for f in geoms["features"])
1063-
)
1064-
or (
1065-
geoms["type"] == "GeometryCollection"
1066-
and any(g["type"] == "Point" for g in geoms["geometries"])
1067-
)
1068-
):
1069-
geoms = geojson_to_geometry(geoms)
1070-
else:
1071-
# Automatically convert inline GeoJSON to a vector cube #114/#141
1072-
geoms = env.backend_implementation.vector_cube_cls.from_geojson(geoms)
1055+
# Automatically convert inline GeoJSON to a vector cube #114/#141
1056+
geoms = env.backend_implementation.vector_cube_cls.from_geojson(geoms)
10731057
except Exception as e:
10741058
_log.error(
10751059
f"Failed to parse inline GeoJSON geometries in aggregate_spatial: {e!r}",

openeo_driver/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.21.5a1"
1+
__version__ = "0.21.6a1"

openeo_driver/dry_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ def aggregate_spatial(
463463
cube = self.filter_bbox(**bbox, operation="_weak_spatial_extent")
464464
cube._process(operation="aggregate_spatial", arguments={"geometries": geometries})
465465
if isinstance(geometries, (Polygon, MultiPolygon)):
466+
# TODO #71 normalize to feature collection instead of deprecated geometry collection
466467
geometries = GeometryCollection([geometries])
467468
return AggregatePolygonResult(timeseries={}, regions=geometries)
468469

0 commit comments

Comments
 (0)