Virtual Band tile

Virtual Band tile can be requested in the same way as any other web tile (See Image tile). The only difference is in a band combination expression. Instead of just one or three bands (B3 or B4,B3,B2) bandmath expressions can be specified (B5-B4/B5+B4 or B5-B4/B5+B4,B6+B4/B5,sqrt(B4)). Some band combinations are defined in the service using aliases (see Name Aliases).

It is possible to request either single Virtual Band and apply query parameters PALETTE/THRESHOLDS or COLORMAP/MIN_MAX, or RGB composite by specifying three Virtual Band expressions separated with coma and applying query parameter COMPOSITE=1. See Supported basic operators for list of supported operators. An output array has Float32 dtype, so its pixel values lay in range +-3.4028235e+38. Everything out of this range will be black or white respectively.

GET /(view_id)/(bands)
Parameters:
  • view_id – View id of a scene retrieved from the Search API
  • bands – Virtual Band expression
  • z – zoom level
  • x – tile grid x coordinate
  • y – tile grid y coordinate
Query Parameters:
 
  • api_key – (required) user’s API key
  • MIN_MAX – (optional) list of comma separated min,max values for contrast stretching. Default: calculated by cumulative count cut algorithm with 2%-98% range and cloud correction.
  • COLORS – (optional, only used in pair with THRESHOLDS) (for bandmath and grayscale only) list of comma separated color-hexes, which are used for colorization in pair with THRESHOLDS. Note: has to contain 1 more value than THRESHOLDS. (See Range colorization)
  • THRESHOLDS – (optional, only used in pair with COLORS) (for bandmath and grayscale only) list of comma separated values of color thresholds, which are used for colorization in pair with COLORS. Note: has to contain 1 less value than COLORS. (See Range colorization)
  • crs – (optional) output tile projection. Default: “EPSG:3857”
  • CALIBRATE – (optional) (for bandmath only) unique parameter for BandMath – if True (or 1), converts band data to ToA Reflectance (or to At-Satellite Brightness Temperature for TIRS) prior to performing the band math (See Radiometric Correction).
  • COLORMAP – (optional) (for bandmath and grayscale only) bandmath colorization with the specified colormap. MIN_MAX can be applied with this query param. (See Colormap API; see also Colorbar API to get the legend colorbar)
  • COLORS_LIMIT – (optional) count of colors for continuous colormaps (See Colormap API)
  • cropper_ref – (optional) AOI reference from Cropper API; any image data that does not fall into AOI is made transparent. (See Cropper API)
  • RESAMPLE – (optional) interpolation type (‘near’, ‘bilinear’, ‘cubic’, ‘cubicspline’, ‘lanczos’, ‘average’, ‘mode’, ‘max’, ‘min’, ‘med’, ‘q1’, ‘q3’)
  • mimetype – (optional) output image type (‘image/jpeg’, ‘image/png’). Default: ‘image/jpeg’ for not transparent tiles; ‘image/png’ for tiles with transparency
  • PALETTE – (optional) dictionary with bit numbers (1 bit number or 2 as a tuple) as keys and colors (in form of RGB or hex) as values. If in any given pixel some bits have value 1, it’s set to corresponding color from the palette. If bits don’t have a color tied to them in the palette, pixels are made transparent. Without this parameter BQA is colorized with default palette (See Palette)
  • PANSHARPENING – (optional) performs pansharpening of a given band combination if True (or 1). This option is supported for Landsat-8 and Landsat-7 only (see Pansharpening)

Examples

Visualize Virtual Band as a single band

http

GET /api/render/L8/LC80440342015224LGN00/(B5-B4)/(B5+B4)/11/328/794?api_key=XXX HTTP/1.1
Host: gate.eos.com

curl

curl -i 'https://gate.eos.com/api/render/L8/LC80440342015224LGN00/(B5-B4)/(B5+B4)/11/328/794?api_key=XXX'

Visualize Virtual Band as combination of 3 bands (RGB mapping)

http

GET /api/render/L8/LC80440342015224LGN00/NDVI,NDSI,NDWI/11/328/794?api_key=XXX HTTP/1.1
Host: gate.eos.com

curl

curl -i 'https://gate.eos.com/api/render/L8/LC80440342015224LGN00/NDVI,NDSI,NDWI/11/328/794?api_key=XXX'

Supported basic operators

Operator Description Example
+ Add B2+B3
- Subtract B2-B3
* Multiply B2*B3
/ Divide B2/B3
^ or ** Power B2^B3 or B2**B3
. Floating point B2/0.5
arccos Inverse cosine arccos(B2/B3)
arcsin Inverse sine arcsin(B2/B3)
arctan Inverse tangent arctan(B2/B3)
cos Cosine cos(B2/B3)
sin Sine sin(B2/B3)
tan Tangent tan(B2/B3)
degrees Convert from radians to degrees degrees(B2/B3)
radians Convert from degrees to radians radians(B2/B3)
exp Exponential exp(B2)
log Natural logarithm log(B2)
log10 Base 10 logarithm log10(B2)
pi Pi B3*pi
sqrt Square-root sqrt(B2)

List of all supported operators

Trigonometric functions
'sin', 'cos', 'tan', 'arcsin', 'arccos', 'arctan', 'degrees', 'radians', 'unwrap',
'deg2rad', 'rad2deg', 'hypot', 'arctan2',
Hyperbolic functions
'sinh', 'cosh', 'tanh', 'arcsinh', 'arccosh', 'arctanh',
Rounding
'around', 'round', 'rint', 'fix', 'floor', 'ceil', 'trunc',
Exponents and logarithms
'exp', 'expm1', 'exp2', 'log', 'log10', 'log2', 'log1p', 'logaddexp', 'logaddexp2',
Floating point routines
'copysign', 'ldexp', 'nextafter'
Arithmetic operations
'negative', 'reciprocal', 'add', 'multiply', 'divide', 'power', 'subtract',
'true_divide', 'floor_divide', 'float_power', 'fmod', 'mod', 'modf',
'remainder', 'divmod',
Miscellaneous
'sqrt', 'cbrt', 'square', 'abs', 'fabs', 'sign', 'absolute', 'fmin', 'fmax', 'minimum',
'maximum', 'heaviside', 'clip',
Logical operations
'logical_and', 'logical_or', 'logical_xor', 'logical_not',
Comparison
'allclose', 'isclose', 'array_equal', 'array_equiv', 'greater', 'greater_equal',
'less', 'less_equal', 'equal', 'not_equal',
Indexing routines
'where'

Note

Apply floating point to get proper output data types. Note that

\[B4^{1/2}==B4^{0}\]

because input values 1 and 2 are integers, but

\[B4^{1.0/2}==B4^{0.5}==sqrt(B4)\]