ee.FeatureCollection.toList

Zwraca elementy kolekcji w postaci listy.

WykorzystanieZwroty
FeatureCollection.toList(count, offset)Lista
ArgumentTypSzczegóły
to: collectionFeatureCollectionKolekcja wejściowa do pobrania.
countLiczba całkowitaMaksymalna liczba elementów do pobrania.
offsetLiczba całkowita, domyślnie: 0Liczba elementów do odrzucenia od początku. Jeśli jest ustawiona, pobranych zostanie (offset + count) elementów, a pierwsze offset elementów zostanie odrzuconych.

Przykłady

Edytor kodu (JavaScript)

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

print('First 5 features to an ee.List', fc.toList(5));

print('Second 5 features to an ee.List', fc.toList(5, 5));

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('First 5 features to an ee.List:', fc.toList(5).getInfo())

print('Second 5 features to an ee.List:', fc.toList(5, 5).getInfo())