ee.FeatureCollection.aggregate_first

Agreguje wartości danej właściwości obiektów w kolekcji, obliczając wartość właściwości pierwszego obiektu w kolekcji.

WykorzystanieZwroty
FeatureCollection.aggregate_first(property)
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('Fuel source for first power plant in the collection',
      fc.aggregate_first('fuel1'));  // Wind

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)

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

print('Fuel source for first power plant in the collection:',
      fc.aggregate_first('fuel1').getInfo())  # Wind