How to configure your layers for Statistical Info in EO Browser?

Home > Faq > How to configure your layers for Statistical Info in EO Browser?

When you create a custom layer in Sentinel Hub Configuration Utility it is possible to select that layer in EO Browser. To do that, first select your configuration on Search tab, then select the appropriate search result, and in Visualization tab select the said custom layer.

However such layers usually contains color visualization (RGB) of values. Because Feature Info Service operates on the indicator values themselves (and not on RGB), that means that you must add an additional layer (in Sentinel Hub Configuration Utility) which returns the value without conversion to color. The name of this layer must be constructed from the ID (not name) of the visualization layer:

  __FIS_<original-layer-id>

That is: double underscore, followed by "FIS", followed by another underscore, followed by original layer's ID. For example, if we would like to use Feature Info on a layer with ID "3-NDVI2", we should add a layer with ID "__FIS_3-NDVI2".

The data processing script in the newly added "FIS layer" should either:

  • return a single indicator value or
  • return two values, the last of which indicates cloud coverage (1 if the point is covered by the cloud, 0 if not).

Example data processing script:

function index(x, y) {
    return (x - y) / (x + y);
}

const ndvi = index(B08, B04);
return [ndvi];

Example data processing script with cloud coverage:

function index(x, y) {
    return (x - y) / (x + y);
}

const NGDR = index(B03, B04);
const bRatio = (B03 - 0.175) / (0.39 - 0.175);

const isCloud = bRatio > 1 || (bRatio > 0 && NGDR > 0);
const ndvi = index(B08, B04);
return isCloud ? [ndvi, 1] : [ndvi, 0];

Note that this answer is specific to EO Browser and the way it uses layers.