Standards /

WCPS-Manual / coverageConstructorExpr

The coverageConstructorExpr element allows to create a d-dimensional coverage for some d ≥ 1.

The domain definition consists, for each dimension, of a unique axis name plus lower and upper bound of the coverage, expressed in a fixed image CRS and using integer coordinates; for this image CRS one of the identifiers listed in [05-096r1] Table 1 shall be used.

The coverage's content is defined by a general expression. The result type of the expres-sion defining the contents also determines the coverage range type.

This coverage has no other CRS associated beyond the abovementioned image CRS; fur-ther, it has no null values and interpolation methods associated. Finally, all other metadata are undefined. To set specific metadata for this new coverage the setMetaDataExpr is available.

NOTE This constructor is useful

  • whenever the coverage is too large to be described as a constant or
  • when the coverage's cell values are derived from some other source (such as a histogram computation, see example below).

Let

f be a fieldName,
d be an integer with d > 0,
ti be a axisTypes for 1 ≤ i ≤ d, where only axis type abstract can occur more than once,
namei be pairwise distinct identifiers for 1 ≤ i ≤ d, which additionally, in the request on hand, are not used already as a variable in this expression's scope,
loi and hii be integers for 1 ≤ i ≤ d with loihii,
V be a scalarExpr possibly containing occurrences of namei.

Then,

for any coverageExpr C2
where

  C  =	coverage f
        over t1 name1 (lo1,hi1),
        ... ,
        td named (lod,hid)
        values 	V

C is defined as follows:

6Note that, due to the empty crsSet, this "loop" anyway will not be "entered".

Example

The expression below represents a 2-D greyscale image with a diagonal shade from white to black (the cast operator forces the floating point division result into an integer):

coverage greyshade
over     x x(0,255),
         y y(0,255)
values	 (char) (x+y)/2

Example

The expression below computes a 256-bucket histogram over some coverage C of unknown domain and dimension:

coverage histogram
over     bucket histogram(0,255)
values	 count( C = bucket )