ee.FeatureCollection.sort

מיון אוסף לפי הנכס שצוין.

הפונקציה מחזירה את האוסף הממוין.

שימושהחזרות
FeatureCollection.sort(property, ascending)אוסף
ארגומנטסוגפרטים
זה: collectionאוסףמופע האוסף.
propertyמחרוזתהמאפיין שלפיו יתבצע המיון.
ascendingבוליאני, אופציונליהאם למיין בסדר עולה או יורד. ברירת המחדל היא true (סדר עולה).

דוגמאות

עורך הקוד (JavaScript)

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

print('Belgium power plants in ascending order by capacity',
      fc.sort('capacitymw'));

print('Belgium power plants in descending order by capacity',
      fc.sort('capacitymw', false));

הגדרת 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('Belgium power plants in ascending order by capacity:',
      fc.sort('capacitymw').getInfo())

print('Belgium power plants in descending order by capacity:',
      fc.sort('capacitymw', False).getInfo())