Skip to content

feature

Rodrigo E. Principe edited this page Oct 30, 2018 · 1 revision

feature

gets(feature, properties)

Similar to ee.Feature.get but can retrieve many properties at once and return them as a list

reduce(options)

Reduce properties with a reducer. It returns a function to map over a FeatureCollection

Argument options:

  • reducer: defaults to mean
  • properties: properties to aggregate with reducer. Defaults to all properties
  • name: name for the resulting property. Defaults to reduction
var a = ee.Feature(null, {
  "forest_area": 100,
  "desert_area": 50,
  "something_else": 1000
})
var options = {
  reducer: 'sum',
  properties: ['forest_area', 'desert_area'],
  name: 'areas'
}
var areas = tools.feature.reduce(options)(a)
print(areas)

https://code.earthengine.google.com/5df3d3f037f8ea5a9a176f84a6f3121d

Clone this wiki locally