pyrtid.utils.grid.get_polygon_selection_with_dilation_2d#

pyrtid.utils.grid.get_polygon_selection_with_dilation_2d(polygons: Union[List[ndarray[Any, dtype[float64]]], List[List[Tuple[float, float]]]], grid: RectilinearGrid, selection: Optional[ndarray[Any, dtype[int64]]] = None) ndarray[Any, dtype[int64]][source]#

Extend the selections using binary dilation.

Parameters
  • polygon (Union[NDArrayFloat, List[Tuple[float, float]]]) – Coords of the exterior ring with shape (M, 2)

  • grid (RectilinearGrid,) – The grid definition (dimensions, position, etc.).

  • selection (Optional[NDArrayInt]) – An already existing selection as starting point. The default is None.