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

CNES land cover classification visualisation script

//VERSION=3

// This scripts visualise land cover over Metropolitan France

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

//EvaluatePixel function - return corresponding color based on CNES Land Cover nomenclature and colouring scheme
function evaluatePixel(samples) {
    const val = samples.OCS;
    if (val == 1) {
        return [1, 0, 1, 1];
    } else if (val == 2) {
        return [1, 85/255, 1, 1];
    } else if (val == 3) {
        return [1, 170/255, 1, 1];
    } else if (val == 4) {
        return [0, 1, 1, 1];
    } else if (val == 5) {
        return [1, 1, 0, 1];
    } else if (val == 6) {
        return [208/255, 1, 0, 1];
    } else if (val == 7) {
        return [161/255, 214/255, 0, 1];
    } else if (val == 8) {
        return [1, 171/255, 68/255, 1];
    } else if (val == 9) {
        return [214/255, 214/255, 0, 1];
    } else if (val == 10) {
        return [1, 85/255, 0, 1];
    } else if (val == 11) {
        return [197/255, 1, 1, 1];
    } else if (val == 12) {
        return [170/255, 170/255, 97/255, 1];
    } else if (val == 13) {
        return [170/255, 170/255, 0, 1, 1];
    } else if (val == 14) {
        return [170/255, 170/255, 1, 1];
    } else if (val == 15) {
        return [85/255, 0, 0, 1];
    } else if (val == 16) {
        return [0, 156/255, 0, 1];
    } else if (val == 17) {
        return [0, 50/255, 0, 1];
    } else if (val == 18) {
        return [170/255, 250/255, 0, 1];
    } else if (val == 19) {
        return [85/255, 170/255, 127/255, 1];
    } else if (val == 20) {
        return [1, 0, 0, 1];
    } else if (val == 21) {
        return [1, 184/255, 2/255, 1];
    } else if (val == 22) {
        return [190/255, 190/255, 190/255, 1];
    } else if (val == 23) {
        return [0, 0, 1, 1];
    } else if (val == 0 || val == 255) {
        return [1, 1, 1, 0];
    } else {
        return [0, 0, 0, 1];
    }
  }

General description of the script

The script visualises land cover over Metropolitan France using a 23-categories nomenclature.

Table 1: Color legend for CNES land cover classification map

Value Color Color Code Label
1 #ff00ff Dense built-up area
2 #ff55ff Diffuse built-up area
3 #ffaaff Industrial and commercial areas
4 #00ffff Roads
5 #ffff00 Oilseeds (Rapeseed)
6 #d0ff00 Straw cereals (Wheat, Triticale, Barley)
7 #a1d600 Protein crops (Beans / Peas)
8 #ffab44 Soy
9 #d6d600 Sunflower
10 #ff5500 Corn
11 #c5ffff Rice
12 #aaaa61 Tubers/roots
13 #aaaa00 Grasslands
14 #aaaaff Orchards and fruit growing
15 #550000 Vineyards
16 #009c00 Hardwood forest
17 #003200 Softwood forest
18 #aaff00 Natural grasslands and pastures
19 #55aa7f Woody moorlands
20 #ff0000 Natural mineral surfaces
21 #ffb802 Beaches and dunes
22 #bebebe Glaciers and eternal snows
23 #0000ff Water

Description of representative images

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

CNES land cover France overview

CNES Land Cover 2020 around Lyon visualised in EO Browser

CNES land cover Lyon

Resources