geodata.mask.apply_fn_to_raster

geodata.mask.apply_fn_to_raster#

geodata.mask.apply_fn_to_raster(raster: rasterio.DatasetReader, fn: callable)#

Apply a custom function to individual values in the raster array.

Parameters:
  • raster (ras.DatasetReader) – The source raster.

  • fn (callable) – A function/method to be applied to the raster array the function needs map individual values to another. This callable will be JIT compiled, if possible.

  • kwargs – the arguments to be passed to the function

return: (ras.DatasetReader) The updated raster