ee.FeatureCollection.aggregate_count

Agreguje dane dotyczące danej właściwości obiektów w kolekcji, obliczając liczbę wartości właściwości, które nie są wartościami null.

WykorzystanieZwroty
FeatureCollection.aggregate_count(property)Liczba
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('Number of non-null values for the fuel1 property',
      fc.aggregate_count('fuel1'));  // 66

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