Buffer expression examples for ArcGIS Enterprise 10.5 and 10.5.1
Entering values or using a field are not the only way you can specify the size of a buffer using GeoAnalytics Tools. In some cases, you might want to perform a mathematical calculation to set the buffer size. You can perform simple as well as advanced calculations that are applied to all records. This calculation is applied to each feature. The sections below include examples of using a buffer expression. Calculations are performed when analysis is run on your ArcGIS GeoAnalytics Server.
At ArcGIS Enterprise 10.6 and later, expressions are formatted using Arcade Expressions. Learn more about Arcade expressions and about Arcade Expressions with GeoAnalytics Server and 10.6 and later.
Buffer expressions are used by the Reconstruct Tracks and Create Buffers tools.
Simple calculations
Simple math examples
Buffer expressions are able to mathematically process numbers.
|
Operator |
Explanation |
Example |
Result |
|---|---|---|---|
|
a + b |
a plus b |
["fieldname"] + 2.5 |
4.0 |
|
a - b |
a minus b |
["fieldname"]- 2.2 |
1.1 |
|
a * b |
a multiplied by b |
["fieldname"] * 2.2 |
4.4 |
|
a / b |
a divided by b |
["fieldname"] / 1.25 |
3.2 |
|
abs( a ) |
Returns the absolute (positive) value of a. |
abs(["fieldname"]) |
1.5 |
|
log ( a ) |
Returns the natural logarithm (base E) of a. |
log(["fieldname"]) |
0 |
|
sin ( a ) |
Returns the trigonometric sine of a. The input is assumed to be an angle in radians. |
sin(["fieldname"]) |
1 |
|
cos( a ) |
Returns the trigonometric cosine of a. The input is assumed to be an angle in radians. |
cos(["fieldname"]) |
1 |
|
tan( a ) |
Returns the tangent of a. The input is assumed to be an angle in radians. |
tan(["fieldname"]) |
0 |
|
sqrt( a ) |
Returns the square root of a. |
sqrt(["fieldname"]) |
3 |
|
min( a, b ) |
Returns the lowest valued number between a and b. |
min(["fieldname"], -3) |
-3 |
|
max( a, b ) |
Returns the highest valued number between a or b. |
max(["fieldname1"], ["fieldname2"]) |
1.5 |
Multiplication
["Distance"] * 2
Built-in functions for GeoAnalytics Tools
As distance function examples
Buffer expressions are able to cast numeric values to a linear distance.
|
Function |
Explanation |
Example |
Result |
|---|---|---|---|
|
as_meters( <value> ) |
Applies a calculation assuming the input values are in meters |
as_meters( ["fieldname"] ) as_meters(150) |
Results are buffered by 150 meters. |
|
as_kilometers( <value> ) |
Applies a calculation assuming the input values are in kilometers |
as_kilometers( ["fieldname"] ) as_kilometers(150) |
Results are buffered by 150 kilometers. |
|
as_feet( <value> ) |
Applies a calculation assuming the input values are in feet |
as_feet( ["fieldname"] ) as_feet(150) |
Results are buffered by 150 feet. |
|
as_yards( <value> ) |
Applies a calculation assuming the input values are in yards |
as_yards( ["fieldname"] ) as_yards(150) |
Results are buffered by 150 yards. |
|
as_nautical_miles( <value> ) |
Applies a calculation assuming the input values are in nautical miles |
as_nautical_miles( ["fieldname"] ) as_nautical_miles(150) |
Results are buffered by 150 nautical miles. |
|
as_miles( <value> ) |
Applies a calculation assuming the input values are in miles |
as_miles( ["fieldname"] ) as_miles(150) |
Results are buffered by 150 miles. |
For each feature, multiply the field Distance assuming it's in kilometers, and add 10 meters.
as_kilometers(["Distance"]) + as_meters(10)
Advanced build in functions for GeoAnalytics Tools buffer expressions
In addition to simple mathematical expressions, more advanced functions can be used to apply buffer expressions.
|
Function |
Explanation |
Example |
Result |
|---|---|---|---|
|
|
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. |
constrain( ["distance"], 0, 10) constrain(['Store dist'], 6, distance) |
Returns 0 if Returns 6 if |
|
|
Returns one value if a condition evaluates to
|
iff(["field1"] > ["field2"], ["field1"], 0) iff(["field1"] > ["field2"], iff(["field2"] = 0, ["field3"], ["field4"]), 0) |
Returns Returns the result of the second |
|
|
Evaluates a series of expressions in turn, until one evaluates to
|
when((["field1"] + 10) > 1, 1,(["field2"] + 10) > 2 , 2, ["field3"]) |
If |
|
|
The
|
decode(["field1"] + 3 , ["field1"], 1, ["field2"], 2, 0) |
Compares equality between the conditional val |
Conditional statements can use the following operators:
|
Operator |
Explanation |
Example |
Results |
|---|---|---|---|
|
a > b a < b |
a is greater than b. a is less than b. |
10 > 2 |
False |
|
a >= b a <= b |
a is greater than or equal to b. a is less than or equal to b. |
abs(-10) >= 10 |
True |
|
a != b |
a is not equal to b. |
abs(-3) != -3 |
True |
|
a == b |
a is equal to b. |
abs(-5) == 5 |
True |
|
<condition1> OR <condition2> |
Condition one or condition two is met. |
(abs(-5) == 5) OR (10 < 2) |
True |
|
<condition1> AND <condition2> |
Condition one and condition two are met. |
(abs(-5) == 5) AND (10 < 2) |
False |