replaceWithValueIf method

ContinuousFieldFunction replaceWithValueIf({
  1. required BooleanFieldFunction selection,
  2. required double value,
})

Composes a function that preserves values from this function's field result or replaces them with a constant value.

Values are determined point-wise across the extent of this function's field result based on a selection. Where the selection is true, the specified constant value is returned. Where the selection is false, values from this function's field result are returned. The function result has no data where the selection or this function's field result has no data.

The function result extent is the intersection of the selection with this function's field result.

The spatial reference of this function's field result and the selection must be equivalent.

Parameters:

  • selection — A selection.
  • value — The float value to be used when replacing.

Return Value: A function that preserves values from this function's field result or replaces them with a constant value.