ee.FeatureCollection.aggregate_histogram

Agrège une propriété donnée des objets d'une collection, en calculant un histogramme de la propriété sélectionnée.

UtilisationRenvoie
FeatureCollection.aggregate_histogram(property)Dictionnaire
ArgumentTypeDétails
ceci : collectionFeatureCollectionCollection à agréger.
propertyChaînePropriété à utiliser pour chaque élément de la collection.

Exemples

Éditeur de code (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

Configuration de Python

Consultez la page Environnement Python pour en savoir plus sur l'API Python et sur l'utilisation de geemap pour le développement interactif.

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