ee.FeatureCollection.aggregate_histogram

Agrega una propiedad determinada de los objetos en una colección y calcula un histograma de la propiedad seleccionada.

UsoMuestra
FeatureCollection.aggregate_histogram(property)Diccionario
ArgumentoTipoDetalles
esta: collectionFeatureCollectionEs la colección para agregar.
propertyStringEs la propiedad que se usará de cada elemento de la colección.

Ejemplos

Editor de código (JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
             .filter('country_lg == "Belgium"');

print('Histogram of power plant capacities (MW)',
      fc.aggregate_histogram('capacitymw'));  // Dictionary

Configuración de Python

Consulta la página Entorno de Python para obtener información sobre la API de Python y el uso de geemap para el desarrollo interactivo.

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')

print('Histogram of power plant capacities (MW):')
pprint(fc.aggregate_histogram('capacitymw').getInfo())  # Dictionary