TransWikia.com

Displaying landcover classes using Google Earth Engine

Geographic Information Systems Asked on June 29, 2021

I was wondering if theres a way to display single Landcover classes from the Corine Land Cover-Dataset in GEE. I know i somehow have to select the landcover_class_names or values in the property section of the image but I’m not sure how to do that.

var corine = ee.ImageCollection('COPERNICUS/CORINE/V18_5_1/100m').first();

print(corine);
print(corine.propertyNames());
var lc_value = corine.get('landcover_class_values');
print(lc_value);

Thats my code so far. Now i only want to display the forest areas.

One Answer

If you want to display a single value (or set of values) in the Map Viewer then I suggest using the ee.Image.updateMask() function. This will set all values in the input image that correspond to 0 values in the mask image to no data.

Here is the code for your example:

var corine = ee.ImageCollection('COPERNICUS/CORINE/V18_5_1/100m').first();

print(corine);
print(corine.propertyNames());
var lc_value = corine.get('landcover_class_values');
print(lc_value);

var forest = corine.updateMask(corine.gte(23).and(corine.lte(32)))

Map.addLayer(forest)

I looked at the Corine image metadata to find which values are forest (23-34) and used logical operators to get an binary image as the mask image to .updateMask(). I hope this helps!

Answered by Kel Markert on June 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP