I need some help with my script in GEE. I’m working with a MODIS Terra Vegetation Continuous Fields Yearly (MOD44B.051 Terra Vegetation Continuous Fields Yearly Global 250m) and I’m trying to obtain the number of pixels of three bands (Percent Non vegetated, percent vegetated, percent tree cover) at municipal level (2, 458 units).
So far my script runs until it count the total of pixels inside the municipality, and its ok, but I need to know of the total of pixels (inside the municipality) how many belongs to non-vegetated, vegetated and tree cover. Below it’s my script
//Counting pixels per municipalities //
//Map of municipalities done in ArcGIS//
var Mun= ee.FeatureCollection ('users/ceciliasosaa/MUN_FINAL')
Map.addLayer (Mun)
//Load MODIS. Specify year and band of interest//
var NV2000= ee.Image ('MODIS/051/MOD44B/2000_03_05'). select ('Percent_NonVegetated')
Map.addLayer (NV2000)
// Center locality//
Map.setCenter (-100.55, 21.37); //Mexico
// Counting pixels in municipalities //
var MunNV = NV2000.reduceRegions({
collection: Mun,
reducer: ee.Reducer.count(),
scale: 250
});
print(MunNV);
What I’m missing in my script?