Skip to main content Link Menu Expand (external link) Document Search Copy Copied

CNES land cover validity visualisation script

//VERSION=3

// This script visualise land cover validity

// Set up input and output settings
function setup() {
  return {
    input: [{
      bands: [
        "OCS_Validity"
      ]
    }],
    output: {
      bands: 4
    }
  }
}

// Create color map
const ramps = [
  [1, 0x000000],
  [45, 0xe60000 ],
];

// Create visualiser
const visualizer = new ColorRampVisualizer(ramps);

//EvaluatePixel function
function evaluatePixel(samples) {
  let val = samples.OCS_Validity;
  let rgb_triplet = visualizer.process(val);
  if (val == 0) {
      rgb_triplet.push(0) // Masked no data pixels
  } else {
      rgb_triplet.push(1) // Display visualiser for pixels with data
  }
  return rgb_triplet;
}

General description of the script

The script visualises the information on the number of cloudless images for validity.

Table 1: Color legend for CNES land cover validity

Value Color Color Code Label
1 #000000 1 cloudless image
45 #e60000 45 cloudless images

Description of representative images

The overview of CNES Land Cover validity 2020 for France visualised in EO Browser

CNES land cover validity France overview

CNES Land Cover validity 2020 around Lyon visualised in EO Browser

CNES land cover validity Lyon

Resources