ee.FeatureCollection.aggregate_count

Agrega uma determinada propriedade dos objetos em uma coleção, calculando o número de valores não nulos da propriedade.

UsoRetorna
FeatureCollection.aggregate_count(property)Número
ArgumentoTipoDetalhes
isso: collectionFeatureCollectionA coleção para agregar.
propertyStringA propriedade a ser usada de cada elemento da coleção.

Exemplos

Editor de código (JavaScript)

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

print('Number of non-null values for the fuel1 property',
      fc.aggregate_count('fuel1'));  // 66

Configuração do Python

Consulte a página Ambiente Python para informações sobre a API Python e como usar geemap para desenvolvimento interativo.

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('Number of non-null values for the fuel1 property:',
      fc.aggregate_count('fuel1').getInfo())  # 66