Skip To Content

Buffer expressions

The Create Buffers and Reconstruct Tracks tools can apply buffers based on an expression. Buffer expressions can be straightforward, such as = Field1 + 10, or much more complicated.

To learn about the Arcade expressions available in ArcGIS Enterprise 10.6 or later, see Buffer expressions.

Buffer expressions must start with an equal sign (=). The buffer expression is applied to each feature in the dataset, where each feature may have a unique buffer distance. The following table explains the available functions:

Buffer expression functions

FunctionDescription

as_meters()

Applies a calculation assuming the input values are in meters.

Syntax: as_meters( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use as_meters(feature['Store dist']); starting at 10.5.1, use as_meters($feature['Store dist'])
  • as_meters(distance)
  • as_meters(10)

as_kilometers()

Applies a calculation assuming the input values are in kilometers.

Syntax: as_kilometers( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use as_kilometers(feature['Store dist']); starting at 10.5.1, use as_kilometers($feature['Store dist'])
  • as_kilometers(distance)
  • as_kilometers(10)

as_feet()

Applies a calculation assuming the input values are in feet.

Syntax: as_feet( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use as_feet(feature['Store dist']) and starting at 10.5.1 use as_feet($feature['Store dist'])
  • as_feet(distance)
  • as_feet(10)

as_yards()

Applies a calculation assuming the input values are in yards.

Syntax: as_yards( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use as_yards(feature['Store dist']); starting at 10.5.1, use as_yards($feature['Store dist'])
  • as_yards(distance)
  • as_yards(10)

as_nautical_miles()

Applies a calculation assuming the input values are in nautical miles.

Syntax: as_nautical_miles( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use as_nautical_miles(feature['Store dist']); starting at 10.5.1, use as_nautical_miles($feature['Store dist'])
  • as_nautical_miles(distance)
  • as_nautical_miles(10)

abs()

Returns the absolute (positive) value of the input.

Syntax: abs( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use abs(feature['Store dist']); starting at 10.5.1, use abs($feature['Store dist'])
  • abs(distance)
  • abs(['Store dist'])
  • abs(10)

log()

Returns the natural logarithm (base E) of the input.

Syntax: log( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use log(feature['Store dist']); starting at 10.5.1, use log($feature['Store dist'])
  • log(distance)
  • log(['Store dist'])
  • log(10)

sin()

Returns the trigonometric sine of the input value. The input is assumed to be an angle in radians.

Syntax: sin( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use sin(feature['Store dist']); starting at 10.5.1, use sin($feature['Store dist'])
  • sin(radValue)
  • sin(['Sun ang'])
  • sin(1)

cos()

Returns the trigonometric cosine of the input value. The input is assumed to be an angle in radians.

Syntax: cos( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use cos(feature['Store dist']); starting at 10.5.1, use cos($feature['Store dist'])
  • cos(radValue)
  • cos(['Sun ang'])
  • cos(1)

tan()

Returns the tangent of the input value. The input is assumed to be an angle in radians.

Syntax: tan( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use tan(feature['Store dist']); starting at 10.5.1, use tan($feature['Store dist'])
  • tan(distance)
  • tan(['Store dist'])
  • tan(1.2)

sqrt()

Returns the square root of the input value.

Syntax: sqrt( <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use sqrt(feature['Store dist']); starting at 10.5.1, use sqrt($feature['Store dist'])
  • sqrt(distance)
  • sqrt(['Store dist'])
  • sqrt(9)

min(,)

Returns the lowest valued number in the input field.

Syntax: min( <value>, <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use min(feature['Store dist'],feature['MarketDist']); starting at 10.5.1, use min($feature['Store dist'],$feature['Marketdist'])
  • min(distance, 10)

max(,)

Returns the highest valued number in the input field.

Syntax: max( <value>, <value> )

<value> is one of the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

  • At 10.5, use max(feature['Store dist'],feature['MarketDist']); starting at 10.5.1, use max($feature['Store dist'],$feature['Marketdist'])
  • max(distance, 10)

constrain(,,)

Returns the input value if it's within the constraining bounds. If the value is less than the low value, it returns the low value. If the value is greater than the high value, it returns the high value.

Syntax: constrain( <value> , <low> , <high> )

value, low, and high can be the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.

Examples:

Note:

At 10.5, use fields in the format feature['Store dist']; starting at 10.5.1, use fields in the format $feature['Store dist'].

  • constrain($feature['Store dist'], 6, $feature['distance'])—Returns 6 if Store dist is less than 6, distance if Store dist is greater than distance, and Store dist otherwise.
  • constrain( distance, 0, 10)—Returns 0 if distance is less than 0, 10 if distance is greater than 10, and distance otherwise.

iff(,,)

Returns one value if a condition evaluates to true, and another value if that condition evaluates to false.

Syntax: iff( <condition>, <true value> , < false value> )

condition is a conditional that is tested for each feature.

true value and false value can be the following:

  • A numeric field. If there is a space in the field name, use square brackets.
  • A number.
  • A function.

Examples:

Note:

At 10.5, use fields in the format feature['Store dist']; starting at 10.5.1, use fields in the format $feature['Store dist'].

  • iff($feature['field1'] > $feature['field2'], $feature['field1'], 0)—Returns field1 if field1 is greater than field2, and 0 otherwise.
  • iff($feature['field1'] > $feature['field2'], iff($feature['field2'] = 0, $feature['field3'], $feature['field4']), 0)—Returns the result of the second iff function if field1 is greater than field2, and 0 otherwise.

when(,,,...,,)

Evaluates a series of expressions in turn, until one evaluates to true.

Syntax: when( <expression1> , <result1> , <expression2> , <result2> , ... , <expressionN> , <resultN>, <default> )

  • expression—An expression. If there is a space in the field name, place it in square brackets.
  • result—Can be a number or field.
  • default—An optional value if none of the expression match.

Example:

Note:

At 10.5, use fields in the format feature['Store dist']; starting at 10.5.1, use fields in the format $feature['Store dist'].

  • when(($feature['field1] + 10) > 1, 1,($feature['field2'] + 10) > 2 , 2, $feature['field3'])—If field1 + 10 is greater than 1, returns 1. If not, checks if field2 + 10 is greater than 2. If yes, it returns 2. If not, it returns field3.

decode(,,,...,,)

The decode function evaluates an expression and compares its value with subsequent parameters. If the expression matches, it returns the next parameter value. If none match, there is the option for the last parameter to be a default return value.

Syntax: decode( <conditional val> , <case1> , <result1>, <case2>, <result2>, ... <caseN>, <resultN>, <defaultValue> )

  • conditional val—Can be a field or an expression.
  • case—A value to be compared to the conditional val.
  • result—The result if the corresponding case matches the conditional val.
  • defaultValue—An optional value if no other values are true.

Examples:

Note:

At 10.5, use fields in the format feature['Store dist']; starting at 10.5.1, use fields in the format $feature['Store dist'].

  • decode($feature['field1'] + 3 , $feature['field1'], 1, $feature['field2'], 2, 0)—Compares equality between the conditional val field1 + 3 and case1 field1. If true, it returns 1. If false, it compares the equality between field1 + 3 and field2. If true, it returns 2; otherwise, it returns 0.