Standards /

WCPS-Manual / trimExpr

The trimExpr element extracts a subset from a given coverage expression along the axis indicated, specified by a lower and upper bound for each axis affected. Interval limits can be expressed in the coverage's image CRS or any CRS which the the coverage supports.

Lower as well as upper limits must lie inside the coverage's domain.

For syntactic convenience, both array-style addressing using brackets and function-style syntax are provided; both are equivalent in semantics.


C1 be a coverageExpr,
n be an integer with 0 ≤ n ,
a1, ... , an be pairwise distinct axisNames with ai ∈ axisNameSet(C1) for 1 ≤ i ≤ n,
an, ... , crsn be pairwise distinct crsNames with crsi ∈ crsList(C1) for 1 ≤ i ≤ n,
(lo1,hi1), ... ,(lon,hin) be axisPoint pairs with loihii for 1 ≤ i ≤ n.


for any coverageExpr C2
where C2 is one of

Cbracket = C1 [ p1, ... , pn ]
Cfunc = trim ( C1, { p1, ... , pn } )


pi is one of
pimg,i = ai(loi,hii)
pcrs,i = ai(loi,hii)crsi

C2 is defined as follows:

NOTE It is possible to mix different CRSs in one trim operation, however each axis must be addressed in exactly one CRS (either image CRS or another supported CRS).

NOTE A trim operation might simultaneously perform x/y trimming expressed in some geographic coordinate CRS, time trimming in a time CRS, and abstract axis trimming in (integer) grid cell coordinates.


The following are syntactically valid, equivalent trim expressions:

C[ x(-180,+180), y(-90,90) ]
trim( C, { x(-180,+180), y(-90,90) } )