xrspatial.utils.multi_overlap#

xrspatial.utils.multi_overlap(agg, func, n_outputs, depth, boundary='nan', dtype=None)[source]#

Run a multi-output kernel via a single overlap + map_blocks call.

func receives a padded 2-D chunk and returns (n_outputs, H, W) – the unpadded interior for each output band. The result is a 3-D DataArray with a leading band dimension.

Parameters:
  • agg (xr.DataArray) – 2-D input raster.

  • func (callable) – (H+2*dy, W+2*dx) -> (n_outputs, H, W)

  • n_outputs (int) – Number of output bands (>= 1).

  • depth (int or tuple of int) – Per-axis overlap (>= 1 on each axis).

  • boundary (str) – Boundary mode: ‘nan’, ‘nearest’, ‘reflect’, or ‘wrap’.

  • dtype (numpy dtype, optional) – Output dtype. Defaults to input dtype.

Returns:

Shape (n_outputs, H, W) with band leading dimension.

Return type:

xr.DataArray