fmeobjects.FMERasterTools.replaceCellValues

FMERasterTools.replaceCellValues(minValue, maxValue, replacement, nodataFlag, band)

Replaces a range of value in the source raster with a new single value. All values greater than or equal to ‘minValue’ and less than or equal to ‘maxValue’ will be replaced by ‘replacement’.

Alternatively, if ‘minValue’ is greater than ‘maxValue’, then then the bounds define two distinct ranges that will be replaced by ‘replacement’. For example, a minValue of 200 and a ‘maxValue’ of 100 will replace all values that are greater than or equal to 200 or less than or equal to 100.

Parameters:
  • minValue (FMETile) – Minimum value of band.

  • maxValue (FMETile) – Maximum value of band.

  • replacement (FMETile) – A new value that will replace existing one in the raster. That is, if True is specified, nodata values will be replaced just as any other values. If False is specified, then nodata values will not be replaced, even if they fall within the specified bounds.

  • nodataFlag (bool) – Specifies whether nodata values will be replaced.

  • band (FMEBand) – Band object.

Return type:

FMEBand

Returns:

The band after replacing.

Raises:

FMEException – An exception is raised if an error occurred.