xrspatial.utils.fused_overlap#

xrspatial.utils.fused_overlap(agg, *stages, boundary='nan')[source]#

Run multiple overlap operations in a single map_overlap call.

Each stage is a (func, depth) pair. func receives a padded chunk and returns the unpadded interior result. Stages are fused into one map_overlap call with the sum of all depths, producing one blockwise graph layer instead of N.

Parameters:
  • agg (xr.DataArray) – Input raster.

  • *stages (tuple of (callable, depth)) – Each func takes array (H+2*d, W+2*d) -> (H, W). depth is int, tuple, or dict.

  • boundary (str) – Must be 'nan'.

Return type:

xr.DataArray