WCPS-Tutorial / General condensers
The general condenser is a powerful tool for summarising data, in particular in conjunction with the coverage constructor introduced later. The ingredients for a condenser are a coverage (or coverage expression), a domain (or subdomain) of this coverage to iterate over, an expression to be evaluated for each cell inspected, and finally a summarization function to aggregate all values obtained.
"The maximum value of the
rgb green band."
for c in ( rgb ) return condense max over p in imageCrsDomain(c) using c[p]
imageCrsDomain(c) returns the coverage extent in its ImageCRS
that is: in integer cell coordinates.
The cell expression
c[p] simply takes the value addressd by the current
p. Not surprisingly, this condense expression in fact is
equivalent (and defines) the shorthand
However, in contrast to the shorthands, where the coordinates do not appear, random addressing is possible in a general condenser. For a meaningful example on this we need to introduce the coverage constructor in the next section.
+on floating point numbers is admissible for a condenser on a float coverage, while binary
See manual: generalCondenseExpr