I want to define coverage of each land cover type in my study area in Turkey-Isparta. I call ("COPERNICUS/CORINE/V20/100m/2018") dataset and restrict it for my region as below (I load Rectangle as shapefile to my assets):
var CLC= ee.Image('COPERNICUS/CORINE/V20/100m/');
var CLC2018= ee.Image('COPERNICUS/CORINE/V20/100m/2018');
var landCover2018 = CLC2018.select('landcover').clip(Rectangle);
I want to restrict the landcover dataset to my study area and get coverage of each class in this region.
My code define the coverage of each class in study area but I can't access the definition of each code for landcover types. For example as the code give me, the class with code 112 has coverage of 56591.51 km2
My code is as follows:
//var CLC2018= ee.Image('COPERNICUS/CORINE/V20/100m/2018');// converted to an import recors
print(CLC);
var landCover2018 = CLC2018.select('landcover').clip(Rectangle);
print('landCover2018',landCover2018);
print('Year Coverage:',CLC.size());
/////////////
print('LC_Area',LC_Area);// result is 30030856907292.477
var LC2018_Area=landCover2018.geometry().area();
print('LC2018_Area',LC2018_Area);// result is Infinity
var LC_AreaSqKm = ee.Number(LC_Area).divide(1e6).round()
print('LC_AreaSqKm',LC_AreaSqKm)// result is 30030857
As below I calculate the coverage of each landcover class in study region:
var counts=landCover2018.reduceRegion({
reducer: ee.Reducer.frequencyHistogram(),
geometry: Rectangle,
scale: 10
});
If I use CLC2018 besides the landCover2018 the result does not differ. and I print results by following command:
var LC_Counts=counts.get('landcover');
print ('LC_Counts',LC_Counts)
or
print('LC_Counts:', counts.get('landcover').getInfo())
This results coverage of classes as follows:
Object (17 properties)
112: 56591.51764705882
121: 4600
131: 46174.70980392157
211: 71061.55686274508
222: 230049.0823529411
231: 35600
242: 272844.474509804
243: 212301.61960784308
.
.
.
but I can't access the description of these landcover types as provided in 'landcover_class_names' of the 'Image COPERNICUS/CORINE/V20/100m/2018 (1 band)'
How can I get data descriptions for each class like this:
[112]: Agricultural areas; arable land; non-irrigated arable land
In brief, I want to define coverage of each landcover types in the study region with access to landcover class descriptions.
here is the whole code