Computes stats on a single band of input image with any number of bands and write the outputs to a feature collection. Paramters inlude: image: the image to generate stats of statsBand: the name of the band to calculate stats of groupBy: optional, a band to group the stats band by (e.g. carbon counts grouped by land cover) reducer: the name of the reducer to apply. currently supported:sum, count, mean region: the region to calculate stats scale: the scale to calculate stats crs: optional, a crs for the stats defaults to epsg 4326
requestDict
{image: ee.Image, statsBand: str, groupBy: str, reducer: str, region: ee.Geometry, scale: int, crs: str} A dictionary of paramters to define what stats should be computed.
Returns any ee.FeatureCollection({map_name:statsBand, map_value:groupByImages map value, reducerName:reducer statistics})
Calculates stats for an input image grouped by another image.
statsImg
ee.Image the image to generate stats ofgroupByImg
ee.Image the image to group stats byreducerName
str the name of the reducer to apply. currently supported:sum, count, meanscale
int optional, the scale to calculate stats, defaults to 30mregion
ee.Geometry optional, the region to calculate stats, defaults to image boundscrs
str optional, a crs for the stats defaults to epsg 4326
Returns any Object (ee.Dictionary)
adds a human readable property based on a map_value
fc
ee.FeatureCollectiondict
ee.Dictionaryprop
str The property you want to set a readable name toreadable
str The name of the new property to add, defaults to 'readable'
organizes stats so each map value, name, and count is converted to a feature
el
reducerName
str the name of the reducer used to calculate statistics
Returns any ee.FeatureCollection({map_name:statsBand, map_value:groupByImages map value, reducerName:reducer statistics})
creates a human readable dictionary from the output of the getPixelCounts function. The readable name is formatted as "{description} {i}" where i is the map vlaue. By default description is "map value"
e.g. makeHumanReadableFromValues(input, 'useful description') input feature collection with a feature where map_value = 1 outputs {1:"'useful description 1"}
countsFeatureCollection
ee.FeatureCollection feature collection to add properties todescription
str optional, the description to concatenate with a map value, defaults to map_value
Returns any ee.Dictionary({int_map_value:description_map_value})