ee.FeatureCollection.limit

किसी कलेक्शन को तय किए गए एलिमेंट की संख्या तक सीमित करें. इसके अलावा, उन्हें किसी तय की गई प्रॉपर्टी के हिसाब से क्रम में लगाएं.

यह फ़ंक्शन, सीमित कलेक्शन दिखाता है.

इस्तेमालरिटर्न
FeatureCollection.limit(max, property, ascending)संग्रह
आर्ग्यूमेंटटाइपविवरण
यह: collectionसंग्रहकलेक्शन इंस्टेंस.
maxनंबरसंग्रह में शामिल किए जाने वाले आइटम की संख्या.
propertyस्ट्रिंग, ज़रूरी नहींअगर क्रम से लगाना है, तो क्रम से लगाने के लिए प्रॉपर्टी.
ascendingबूलियन, ज़रूरी नहींबढ़ते या घटते क्रम में लगाने का विकल्प. डिफ़ॉल्ट रूप से, यह 'सही' (बढ़ते क्रम में) पर सेट होती है.

उदाहरण

कोड एडिटर (JavaScript)

// 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}));

Python सेटअप करना

Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए, Python एनवायरमेंट पेज देखें.

import ee
import geemap.core as geemap

Colab (Python)

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