ee.FeatureCollection.aggregate_histogram

Agreguje dane dotyczące wybranej właściwości obiektów w kolekcji, obliczając histogram tej właściwości.

WykorzystanieZwroty
FeatureCollection.aggregate_histogram(property)Słownik
ArgumentTypSzczegóły
to: collectionFeatureCollectionKolekcja, po której ma nastąpić agregacja.
propertyCiąg znakówWłaściwość do użycia z każdego elementu kolekcji.

Przykłady

Edytor kodu (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

Konfiguracja Pythona

Informacje o interfejsie Python API i używaniu geemap do interaktywnego programowania znajdziesz na stronie Środowisko Python.

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