Table of Contents

getStatsImage

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

Parameters

  • 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})

getStatsSingleBand

Calculates stats for an input image grouped by another image.

Parameters

  • statsImg ee.Image the image to generate stats of
  • groupByImg ee.Image the image to group stats by
  • reducerName str the name of the reducer to apply. currently supported:sum, count, mean
  • scale int optional, the scale to calculate stats, defaults to 30m
  • region ee.Geometry optional, the region to calculate stats, defaults to image bounds
  • crs str optional, a crs for the stats defaults to epsg 4326

Returns any Object (ee.Dictionary)

setReadable

adds a human readable property based on a map_value

Parameters

  • fc ee.FeatureCollection
  • dict ee.Dictionary
  • prop str The property you want to set a readable name to
  • readable str The name of the new property to add, defaults to 'readable'

makeFeaturesNew

organizes stats so each map value, name, and count is converted to a feature

Parameters

  • 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})

makeHumanReadableFromValues

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"}

Parameters

  • countsFeatureCollection ee.FeatureCollection feature collection to add properties to
  • description str optional, the description to concatenate with a map value, defaults to map_value

Returns any ee.Dictionary({int_map_value:description_map_value})