fmeobjects.FMERasterTools.replaceCellValuesMultipleRanges

FMERasterTools.replaceCellValuesMultipleRanges(minValues, maxValues, replacements, nodataFlag, band)

Replaces ranges of values in the source raster with new values. In contrast to replaceCellValues(), this function can replace multiple ranges at once.

The ‘minValues’, ‘maxValues’, and ‘replacementValues’ must have the same number of entries.

When both minValue and maxValue have valid values, all source values >= minValue and <= to maxValue will be replaced with the corresponding replacement value. For example, if minValues[0] = 10, maxValues[0] = 20, and replacementValues[0] = 100, then all values >= 10 and <= 20 will be replaced with 100.

If minValue or maxValue is py:obj:None, then that range will be treated as one-sided. For example, if minValues[0] = 10, maxValues[0] is py:obj:None, and replacementValues[0] = 100, then all values >= 10 will be replaced with 100.

If a minValue is greater than its corresponding maxValue, this will be treated as two ranges. For example, if minValues[0] = 20, maxValues[0] = 10, and replacementValues[0] = 100, then all values >= 20 or <= 10 will be replaced with 100.

Parameters:
  • minValues (list[int] or list[float] or list[None]) – Minimum values of band.

  • maxValues (list[int] or list[float] or list[None]) – Maximum values of band.

  • replacement – New values that will replace the existing ones in the raster that fall within the defined ranges.

  • nodataFlag (bool) – Specifies whether nodata values will be replaced. 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.

  • band (FMEBand) – Band object.

Return type:

FMEBand

Returns:

The band after replacing.

Raises:

FMEException – An exception is raised if an error occurred.