xxxxxxxxxx
https://inspire.rasdaman.org/rasdaman/ows?
service=WCS & version=2.0.1 &
request=GetCoverage & coverageId=INSPIRE_OI_IR &
subset=E(480000,482000) & subset=N(4651150,4652100) &
format=image/jpeg
Next, we do the same with WCPS - just subsetting:
xxxxxxxxxx
for $ir in (INSPIRE_OI_IR)
return
encode(
$ir[ E(480000:482000), N(4651150:4652100) ],
"image/jpeg"
)
Finally, we compute the NDVI. For better visualization, the NDVI value (normally between -1 and +1) gets added 1 (to be non-negative) and multiplied with 127 (to "stretch" it into the 0 to 255 range of 8-bit grayscale imagery). Cast operations (syntactically: data types in parenthesis, like "(unsigned char)") first force the integer values from the coverage into float for the division, and then into the target format of 8-bit unsigned quantities.
xxxxxxxxxx
for $ir in (INSPIRE_OI_IR)
return
encode(
(unsigned char) (127 * ( 1 + ((float) $ir.red - $ir.green) / ((float) $ir.red + $ir.green) ) )
[ E(480000:482000), N(4651150:4652100) ],
"image/jpeg"
)