Skip to content

5-3. Categories for a COG

The category system determines how COGs are rendered when their values represent a data classification (as opposed to a continuous variable).

  1. Create a new layer card called World Cover - Austria in the Land Cover interface group - see tutorial 2-6 for a recap if needed
  2. Add the following dataset — a World Cover COG for Austria - see tutorial 2-7 for a recap if needed:

    https://esa-apex.s3.eu-west-1.amazonaws.com/APEX-example-data/constraints/PowerDensity_100m_Austria_WGS84_COG_clipped_3857_fix-esa_worldcover_2021.tif
    
  3. Click the (i) info icon on the dataset row to open the COG metadata dialog.

    COG metadata dialog showing categorical statistics and the embedded colour palette

  4. Scroll down until you see the colour palette display. Click Copy embedded colormap to config categories. This takes both the class values (10, 30, 40 etc) and colours (green, yellow, red) from the colormap in the COG and copies them into our layer definition. Then close the metadata dialog.

    • Although this COG has an embedded colormap, that is not always the case. The option to Copy unique values to config categories is used when there is no colormap but will still transfer our unique values.
  5. Now select the pen icon, next to Categories in the Data Visualisation section of the layer card. Edit a couple of the category labels to align to the World Cover class names (e.g. 10 → Tree cover, 30 → Grassland). See the WorldCover class lookup below for the full list of values, colours and names.

    Edit Categories dialog for the World Cover COG layer showing populated categories with labels and values

    Info

    The values are populated from a sample of pixels. It is possible for a small number of pixels to fall into classes that were not sampled. Cross-check against the source data if completeness matters.

  6. To save on manual typing you can also import or export categories from CSV files. You can do this now by downloading world-cover-classes.csv (<- click on the link to download). Then select Import CSV and load up the file you just downloaded.

  7. Select Save Categories to exit the dialog and then Preview, toggle on the layer and view the results. The COG is now rendered with the labels and colours you defined.

  8. (Optional) Go back to Data Visualisation → Categories → Edit and change the colour of one class — for example, make Tree cover a light green. Save the layer card and preview again. The configured colour overrides the colour map embedded in the COG, so the legend and map rendering reflect your choice rather than the built-in palette.

WorldCover class lookup

Value Colour Colour code Class name
10 #006400 Tree cover
20 #ffbb22 Shrubland
30 #ffff4c Grassland
40 #f096ff Cropland
50 #fa0000 Built up
60 #b4b4b4 Bare / sparse vegetation
70 #f0f0f0 Snow and ice
80 #0032c8 Permanent water bodies
90 #0096a0 Herbaceous wetland
95 #00cf75 Mangroves
100 #fae6a0 Moss and lichen
0 No data

Source: ESA WorldCover collection documentation