Aggregate Functions

Aggregate functions can be added to a Values node to calculate a single result from one or more inputs, specified as the result of a Predicates.

Geometric

Aggregate Description Parameter(s) Returns

intersection

Returns the intersection of a set of geometries.

All points in the final geometry will also lie in the geometry value passed in for each object traversed.

      Note: This function does not currently fully support heighted or measured 2D geometries. Any such geometries will be projected down to 2 dimensions.

  • Any geometry.

A geometry equal to the intersection of all the geometry values passed in.

mbr

Returns the MBR (minimum bounding rectangle) of a set of geometries.

The final result is the smallest rectangle, with sides parallel to the x and y axes, containing all the geometry values passed in.

      Note: This function does not currently fully support heighted or measured 2D geometries. Any such geometries will be projected down to 2 dimensions.

  • Any geometry.

A geometry equal to the MBR of all the geometry values passed in.

union

Returns the union of a set of geometries.

All points which lie in the geometry value passed in for any object will also be in the final geometry.

      Note: This function does not currently fully support heighted or measured 2D geometries. Any such geometries will be projected down to 2 dimensions.

  • Any geometry.

A geometry equal to the union of all the geometry values passed in.

Logical

Aggregate Description Parameter(s) Returns

all_distinct

Tests whether the parameter values passed in are distinct for each object.

An arbitrary number of parameters may be passed to this function and it will test if the set of values passed for each object is distinct from the set of values passed for each other object.

  • Any value to test.

  • (Optional) Any additional values to test.

A boolean value, true if the values passed in for each object are different from those passed in for each other object, and false if any two objects passed in the same sets of parameter values.

all_same

Tests whether the parameter values passed in are the same for each object.

An arbitrary number of parameters may be passed to this function and it will test if the set of values passed for each object is the same as the set of values passed for each other object.

  • Any value to test.

  • (Optional) Any additional values to test.

A boolean value, true if the values passed in for each object are the same as those passed in for each other object, and false if any two objects passed in different sets of parameter values.

as_list

Returns a list of values, which may be iterated over. Items which may be added to a list are: objects, strings, integers, booleans, reals, and geometries (2D, Heighted or Measured). A list may not contain elements of different types.

  • Any item to be added to the list.

  • (Optional) Any additional items to add to the list.

A list containing all the values passed in. The list may contain duplicates.

count

Counts the number of objects or the number of non-null parameter values passed in.

If no parameters are passed, this function counts the number of objects traversed. Otherwise, it counts the number of objects for which any of the parameters has a non-null value.

  • (Optional) Any values to count.

The number of objects or the number of objects with any non-null parameter values.

count_distinct

Counts the number of distinct occurrences of the parameter values passed in.

An arbitrary number of parameters may be passed to this function and it will count the number of distinct sets of values passed in.

  • Any value to count.

  • (Optional) Any additional values to count.

The number of distinct sets of parameter values.

Mathematical

Aggregate Description Parameter(s) Returns

avg

Returns the average value of the parameter over each object for which the parameter value is not null.

  • A numerical value to average.

The average value of the parameter.

max

Returns the maximum value of the parameter over each object traversed.

The values may be either numerical values, booleans or strings. Boolean values are regarded as being equal to either 1 for true or 0 for false. Strings are compared lexicographically. If numbers are compared to strings, they are converted to strings before being compared.

  • A numerical, boolean or string value.

The maximum value of the parameter.

min

Returns the minimum value of the parameter over each object traversed.

The values may be either numerical values, booleans or strings. Boolean values are regarded as being equal to either 1 for true or 0 for false. Strings are compared lexicographically. If numbers are compared to strings, they are converted to strings before being compared.

  • A numerical, boolean or string value.

The minimum value of the parameter.

sum

Returns the sum of the parameter value over each object traversed.

The values may be either numerical values, booleans or strings. Boolean values are regarded as being equal to either 1 for true or 0 for false. Strings are added together using concatenation. If numbers are added to strings, they are converted to strings first.

  • A numerical, boolean or string value.

The total of the parameter value summed over all objects traversed.