I am working with Dynamic World dataset. The label band gives me the pixelwise landcover class values. For any specific year, ImageCollection.mode()
gives me the pixelwise most occurring landcover class. I am also interested in calculating how many times that class actually occurred in each pixel. In short, value and count of that class.
bn = ee.Geometry.Rectangle([-91, 33, -90, 34])
startDate = '2020-06-01'
endDate = '2021-09-01'
dw = ee.ImageCollection('GOOGLE/DYNAMICWORLD/V1').filterDate(startDate, endDate).filterBounds(bn)
max_occurred_class_label = dw.select('label').mode()
max_occurred_class_count = anyFunction(dw.select('label'))
Any ideas, how to achieve this?