ee.FeatureCollection.limit

یک مجموعه را به تعداد مشخصی از عناصر محدود کنید، به صورت اختیاری ابتدا آنها را بر اساس یک ویژگی مشخص مرتب کنید.

مجموعه محدود را برمی گرداند.

استفاده برمی گرداند
FeatureCollection. limit (max, property , ascending ) مجموعه
استدلال تایپ کنید جزئیات
این: collection مجموعه نمونه مجموعه
max شماره تعداد محدود به مجموعه.
property رشته، اختیاری خاصیت مرتب سازی بر اساس، در صورت مرتب سازی.
ascending بولی، اختیاری به ترتیب صعودی یا نزولی. پیش فرض درست (صعودی) است.

نمونه ها

ویرایشگر کد (جاوا اسکریپت)

// FeatureCollection of global power plants.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants');

print('First 5 features (power plants)', fc.limit(5));

print('Smallest 5 power plants by capacity in ascending order',
      fc.limit({max: 5, property: 'capacitymw'}));

print('Largest 5 power plants by capacity in descending order',
      fc.limit({max: 5, property: 'capacitymw', ascending: false}));

راه اندازی پایتون

برای اطلاعات در مورد API پایتون و استفاده از geemap برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.

import ee
import geemap.core as geemap

کولب (پایتون)

# FeatureCollection of global power plants.
fc = ee.FeatureCollection('WRI/GPPD/power_plants')

print('First 5 features (power plants):', fc.limit(5).getInfo())

print('Smallest 5 power plants by capacity in ascending order:',
      fc.limit(**{'maximum': 5, 'opt_property': 'capacitymw'}).getInfo())

print('Largest 5 power plants by capacity in descending order:',
      fc.limit(**{'maximum': 5, 'opt_property': 'capacitymw',
                  'opt_ascending': False}).getInfo())