I have use the following function to calculate the area of an area of interest (AOI) of a classification using landsat8 images. this counts the area in square meters of the classification for a given polygon.

var areaChart = ui.Chart.image.byClass({
  image: ee.Image.pixelArea().addBands(lista_imagenes[0]),
  classBand: 'classification', 
  region: geometry,
  scale: 30,
  reducer: ee.Reducer.sum()

The problem is that the band of classification of landsat8 is just one (classification band). And the layer I am using has three layers (it is call year of loss).

There is any way to count the classes of the layer given a polygon using a similar question ?

here the code: https://code.earthengine.google.com/495ed315756b7181b4570546be82e2f4


i Just found the way to solve the problem, everything is in the following link (google documentation).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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