for $lc in (INSPIRE_LC),
$oi in (INSPIRE_OI_RGB)
let $sub := [E(480000:482000), N(4649750:4651150)]
return
encode(
(
(unsigned char) $oi [ $sub ]
overlay
scale(
( unsigned char)
switch
case $lc[ $sub ] = 221 return { red:230; green:128; blue:0 }
case $lc[ $sub ] = 111 return { red:230; green:0; blue:77 }
default return { red:0; green:0; blue:0} ,
{ imageCrsDomain( $oi[ $sub ] ) }
)
),
"image/jpeg"
)