The RasterTypeConversion operator allows changing the data type of raster data. It transforms all pixels into the new data type.
RasterTypeConversion
Applying the operator could lead to a loss of precision, e.g., converting a F32 value of 3.1 to a U8 will return a value of 3.
F32
3.1
U8
3
If the old value is not valid in the new type it will clip at the value range of the new type. E.g., converting a F32 value of 300.0 to a U8 will return a value of 255.
300.0
255
outputDataType
RasterDataType
The RasterTypeConversion operator expects exactly one raster input.
source
SingleRasterSource
{ "type": "RasterTypeConversion", "params": { "outputDataType": "U8" }, "sources": { "raster": { "type": "GdalSource", "params": { "data": "ndvi" } } } }