Open
Description
Now that we are mostly using RasterStack as an input, and using very large rasters lazily, its difficult to load sparse arrays for affinity and cost.
However these are simply the 4 or 8 neighbors of each pixel. To standardise this in an easily stored form, we can calculate n/e/s/w or n/ne/e/se/s/sw/w/nw affinity layers as tif/netcdf etc files, and combine them into the sparse matrix on the fly for each windowed region
Probably a Band dimension can hold the directions in a tiff, or we can switch to netcdf