replaceWithFunctionIf method

ContinuousFieldFunction replaceWithFunctionIf({
  1. required BooleanFieldFunction selection,
  2. required FloatFunction value,
})

Composes a function that preserves values from this function's field result or replaces them with another 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 value is returned. Where the selection is false, values from this function's field result are returned. A null value is interpreted as no data. 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 — A function that returns the float value replacement.

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