Standards /

WCPS-Tutorial / Range subsetting: how to extract cell components

Often coverages have a complex cell structure. Following WCS, cells can have atomic cell types with only one field (ex: greyscale images) or complex fields (ex: 3-component RGB images, 242-band EO-1 scenes). In the conceptual coverage model of WCS, these components are identified by their names. Using these names WCPS allows to extract components (and actually also to recompose them).

Example: The following three requests extract the red, green, and blue channel of coverage rgb, resp.; the dot notation follows programming language notation:

for m in ( rgb )
return
        encode( m.red, "jpeg" )
for m in ( mowglie )
return
        encode( m.green, "jpeg" )
for m in ( mowglie )
return
        encode( m.blue, "jpeg" )

Below the respective results can be seen:

   

Background information:

  • Actually, range subsetting is a special case of induced operations.
  • The WCS extension for complex range field components currently is not supported by WCPS.

See manual: fieldExpr