WCPS-Tutorial / Condensers shorthand
Similar to what SQL aggregates do on sets, the condenser shorthands allow to obtain summary information about coverages.
Example: "the average of the red components of all cells in the image".
for c in ( rgb ) return avg( c.red )
The following table lists the shorthands available;
a is assumed to be a numeric,
b a Boolean coverage
||sum over all cells in a|
||average of all cells in a|
||minimum of all cells in a|
||maximum of all cells in a|
||number of cells in b containing true / non-zero values|
||is there any cell in b with value true?|
||do all cells of b have value true?|
Example: "the number of vegetation pixels in
for s in ( satScene ) return count( (s.0-s.1)/(s.0+s.1) > 0.6 )
The response is a single integer number, so no
encode() is needed.
See manual: reduceExpr