null value for noDataValue will remove the no data value and that will ensure all pixels are included in functions rather than excluded as no data.
Since v1.5.1, this function supports the ability to replace the current no-data value with the new noDataValue.
When
replace is true, any pixels matching the provided noDataValue will be considered as no-data in the output raster.An IllegalArgumentException will be thrown if the input raster does not already have a no-data value defined. Replacing existing values with noDataValue requires a defined no-data baseline to evaluate against.To use this for no-data replacement, the input raster must first set its no-data value, which can then be selectively replaced via this function.Signatures
Parameters
The input raster.
The band index value.
The NoData value to use for pixels outside the raster extent.
The replace value.
Return type
The resulting raster.

