ee.FeatureCollection.toList

מחזירה את הרכיבים של אוסף כרשימה.

שימושהחזרות
FeatureCollection.toList(count, offset)רשימה
ארגומנטסוגפרטים
זה: collectionFeatureCollectionאוסף הקלט לאחזור.
countמספר שלםהמספר המקסימלי של רכיבים לאחזור.
offsetמספר שלם, ברירת מחדל: 0מספר הרכיבים שצריך להשליך מההתחלה. אם המאפיין מוגדר, יאוחזרו (offset + count) רכיבים והרכיבים הראשונים של offset יימחקו.

דוגמאות

עורך הקוד (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));

הגדרת Python

מידע על Python API ועל שימוש ב-geemap לפיתוח אינטראקטיבי מופיע בדף Python Environment.

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())