replaceIf

Composes a function that preserves values from this function's field result or replaces them with values from another. Values are replaced point-wise across the spatial intersection of the selection with the union of the two function's field results. Where the selection is true, values from the other field are 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 the selected field has no data.

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

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

Return

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

Since

300.0.0

Parameters

selection

A selection.

otherField

The continuous field function to draw values from when replacing.


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.

Return

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

Since

300.0.0

Parameters

selection

A selection.

value

The float value to be used when replacing.