There is an example in GEE Guide, about Grouped Reductions and Zonal Statistics
This code computes the total population and number of housing units for each state:
// Load a collection of US census blocks.
var blocks = ee.FeatureCollection('TIGER/2010/Blocks');
// Compute sums of the specified properties, grouped by state code.
var sums = blocks
.filter(ee.Filter.and(
ee.Filter.neq('pop10', null),
ee.Filter.neq('housing10', null)))
.reduceColumns({
selectors: ['pop10', 'housing10', 'statefp10'],
reducer: ee.Reducer.sum().repeat(2).group({
groupField: 2,
groupName: 'state-code',
})
});
// Print the resultant Dictionary.
print(sums);
But I need, mean, min, max, and count of grouped features by states, not only summed columns of 'pop10'.
How can I achieve this? How can combine reducer for this example?
Best Answer
I found a way with combine reducers: