geodata.Mask.filter_layer#
- geodata.Mask.filter_layer(layer_name: str, dest_layer_name: str | None = None, values: Iterable[float] | None = None, min_bound: float | None = None, max_bound: float | None = None, binarize: bool = False)#
Filter a layer of mask object using filter_raster method.
- Parameters:
layer_name (str) – The name of the layer to be filtered.
dest_layer_name (str) – The name of the filtered layer. If not specified, the filtered layer will replace the original layer.
values (list) – The list of numberic values in the raster array to filter out as 1. If not specified, the method will not filter out any values in the raster.
min_bound (float) – The minimum value in the raster array to filter out as 1. If not specified, the method will not filter out any values lower than the min_bound.
max_bound (float) – The maximum value in the raster array to filter out as 1 If not specified, the method will not filter out any values higher than the max_bound.
binarize (bool) – Whether the method will return 0 and 1 for the raster
- Raises:
ValueError – If no values, min_bound, nor max_bound are specified.