ee.FeatureCollection.aggregate_first

Aggrega una determinata proprietà degli oggetti in una raccolta, calcolando il valore della proprietà del primo oggetto della raccolta.

UtilizzoResi
FeatureCollection.aggregate_first(property)
ArgomentoTipoDettagli
questo: collectionFeatureCollectionLa raccolta su cui eseguire l'aggregazione.
propertyStringaLa proprietà da utilizzare per ogni elemento della raccolta.

Esempi

Editor di codice (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

Configurazione di Python

Consulta la pagina Ambiente Python per informazioni sull'API Python e sull'utilizzo di geemap per lo sviluppo interattivo.

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