Skip to content

Commit

Permalink
Issue #287 More support for DriverVectorCube in apply_polygon
Browse files Browse the repository at this point in the history
other refs: #288, d180c24
  • Loading branch information
soxofaan committed Jun 8, 2024
1 parent c95d1f1 commit 6f6fa8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion openeo_driver/dry_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,12 @@ def chunk_polygon(
self, reducer, chunks: MultiPolygon, mask_value: float, env: EvalEnv, context: Optional[dict] = None
) -> "DryRunDataCube":
# TODO #229: rename/update `chunk_polygon` to `apply_polygon` (https://github.com/Open-EO/openeo-processes/pull/298)
polygons: List[Polygon] = chunks.geoms
if isinstance(chunks, Polygon):
polygons = [chunks]
elif isinstance(chunks, MultiPolygon):
polygons: List[Polygon] = chunks.geoms
else:
raise ValueError(f"Invalid type for `chunks`: {type(chunks)}")
# TODO #71 #114 Deprecate/avoid usage of GeometryCollection
geometries, bbox = self._normalize_geometry(GeometryCollection(polygons))
cube = self.filter_bbox(**bbox, operation="weak_spatial_extent")
Expand Down

0 comments on commit 6f6fa8b

Please sign in to comment.