Skip to content

Commit

Permalink
EP-3934: add mask_value parameter to chunk_polygon process
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenVerstraelen committed Jan 17, 2022
1 parent 4050550 commit f439672
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions openeo/rest/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,8 @@ def reduce_dimension(
def chunk_polygon(
self,
chunks: Union[shapely.geometry.base.BaseGeometry, dict, str, pathlib.Path, Parameter],
process: Union[str, PGNode, typing.Callable]
process: Union[str, PGNode, typing.Callable],
mask_value: float = None
) -> 'DataCube':
"""
EXPERIMENTAL: not generally supported, API subject to change.
Expand All @@ -922,6 +923,9 @@ def chunk_polygon(
:param chunks: A polygon, provided as a :class:`shapely.geometry.Polygon`
or :class:`shapely.geometry.MultiPolygon`, or a filename pointing to a valid vector file
:param process: "child callback" function, see :ref:`callbackfunctions`
:param mask_value: The value used for cells outside the polygon.
This provides a distinction between NoData cells within the polygon (due to e.g. clouds)
and masked cells outside it. If no value is provided, NoData cells are used outside the polygon.
"""
process = self._get_callback(process, parent_parameters=["data"])
valid_geojson_types = ["Polygon", "MultiPolygon", "GeometryCollection", "Feature", "FeatureCollection"]
Expand All @@ -931,7 +935,8 @@ def chunk_polygon(
arguments=dict_no_none(
data=THIS,
chunks=chunks,
process=process
process=process,
mask_value=mask_value
)
)

Expand Down

0 comments on commit f439672

Please sign in to comment.