sum function

Syntax

float/string sum(array)

Parameters

Returns

The sum functions returns

Related

Examples

Count and measure geometric properties

frontLength = sum( comp(fe) { street.front : scope.sx } )

numberSmallFaces = sum( comp(f) { all : geometry.area < 0.1 } )

Cumulative sum

const x = cumsum([1:5])                        // [1,3,6,10,15]
const y = cumsum(["a","b","c","d","e"])        // [a,ab,abc,abcd,abcde]
const z = cumsum([false,true,true,false,true]) // [0,1,2,2,3]

cumsum(array) = case size(array) < 2 : [ sum(array) ]
                else : [ cumsum(array[0:size(array)-2]), sum(array) ]

Copyright ©2008-2024 Esri R&D Center Zurich. All rights reserved.