0

I am using the 'ESA WorldCover 10m v100' dataset in Google Earth Engine and I am trying to calculate the area that each land cover classification covers in a region I specify. However, I don't know how to extract that band information from the dataset.

I only have the following code so far (since all attempts to do this have failed):

var dataset = ee.ImageCollection("ESA/WorldCover/v100").first();

var visualization = {
  bands: ['Map'],
};

Map.centerObject(area);

Map.addLayer(dataset.clip(area), visualization, "Landcover");
2

1 Answer 1

1

Another way would be by using groupReducers

var dataset = ee.ImageCollection("ESA/WorldCover/v100").first();

var areaImage = ee.Image.pixelArea().addBands(
      dataset)

var areas = areaImage.reduceRegion({
      reducer: ee.Reducer.sum().group({
      groupField: 1,
      groupName: 'landcover_class',
    }),
    geometry: area,
    scale: 10,
    maxPixels: 1e13
    }); 

as referenced here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.