ee.FeatureCollection.sort

ترتيب مجموعة حسب السمة المحدّدة

تعرض هذه الدالة المجموعة المصنّفة.

الاستخدامالمرتجعات
FeatureCollection.sort(property, ascending)مجموعة
الوسيطةالنوعالتفاصيل
هذا: collectionمجموعةمثيل المجموعة
propertyسلسلةالسمة التي سيتم الترتيب حسبها
ascendingقيمة منطقية، اختياريةلتحديد ما إذا كان سيتم الترتيب تصاعديًا أو تنازليًا القيمة التلقائية هي "صحيح" (ترتيب تصاعدي).

أمثلة

محرّر الرموز البرمجية (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 للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام geemap للتطوير التفاعلي.

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