quickpaver.create_selections_array_2d#

quickpaver.create_selections_array_2d(polygons: Sequence[Sequence[Tuple[float, float]]], sel_ids: Sequence[int] | ndarray[tuple[Any, ...], dtype[int64]], grid: RectilinearGrid) ndarray[tuple[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