pyrtid.utils.grid.create_selections_array_2d#

pyrtid.utils.grid.create_selections_array_2d(polygons: Sequence[Sequence[Tuple[float, float]]], sel_ids: Union[Sequence[int], ndarray[Any, dtype[int64]]], grid: RectilinearGrid) ndarray[Any, dtype[int64]][source]#

Return a grid array containing the sel_ids as values.

The grid array has the dimension of the grid. It ensure that one grid block corresponds to a unique selection id.

Parameters
  • polygons (Sequence[Sequence[Tuple[float, float]]]) – Sequence of polygons for which to perform the selection in the grid. The order matters as the first polygon will be prioritize if overlapping between polygons occurs.

  • sel_ids (Union[Sequence[int], NDArrayInt]) – Sequence integers selection ids. An id cannot be zero (reserved for no selection).

  • grid (RectilinearGrid) – The grid object for which to performm the selection.

Returns

Grid selections array.

Return type

NDArrayInt