raster_tools.Raster.reclassify
raster_tools.Raster.reclassify#
- Raster.reclassify(remapping, unmapped_to_null=False)[source]#
Reclassify raster values based on a mapping.
The raster must have an integer type.
- Parameters
remapping (str, dict) – Can be either a
dictor a path string. If adictis provided, the keys will be reclassified to the corresponding values. If a path string, it is treated as an ASCII remap file where each line looks likea:bandaandbare integers. All remap values (both from and to) must be integers.unmapped_to_null (bool, optional) – If
True, values not included in the mapping are instead mapped to the null value. Default isFalse.
- Returns
The remapped raster.
- Return type