ee.FeatureCollection.select

किसी कलेक्शन में मौजूद हर सुविधा से प्रॉपर्टी चुनें. इस फ़ंक्शन को सिर्फ़ स्ट्रिंग आर्ग्युमेंट के साथ भी कॉल किया जा सकता है. इन सभी को propertySelectors (varargs) के तौर पर समझा जाएगा.

चुनी गई प्रॉपर्टी के साथ सुविधाओं का कलेक्शन दिखाता है.

इस्तेमालरिटर्न
FeatureCollection.select(propertySelectors, newProperties, retainGeometry)FeatureCollection
आर्ग्यूमेंटटाइपविवरण
यह: featurecollectionFeatureCollectionFeatureCollection इंस्टेंस.
propertySelectorsList<String>चुनने के लिए एट्रिब्यूट की जानकारी देने वाले नामों या रेगुलर एक्सप्रेशन की सूची.
newPropertiesList<String>, ज़रूरी नहींआउटपुट प्रॉपर्टी के नए नामों की सूची. यह संख्या, चुनी गई प्रॉपर्टी की संख्या से मेल खानी चाहिए.
retainGeometryबूलियन, ज़रूरी नहींअगर यह फ़ील्ड गलत है, तो नतीजे में NULL ज्यामिति होगी. डिफ़ॉल्ट रूप से, यह 'सही' पर सेट होती है.

उदाहरण

कोड एडिटर (JavaScript)

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

// Select a single property.
var singleProp = fc.select('fuel1');
print('Single property selected',
      singleProp.first());

// Select multiple properties.
var multiProp = fc.select(['fuel1', 'capacitymw']);
print('Multiple properties selected',
      multiProp.first());

// Select multiple properties and rename them.
var multiPropRename = fc.select({
  propertySelectors: ['fuel1', 'capacitymw'],
  newProperties: ['Fuel_1', 'Capacity_MW']
});
print('Multiple properties selected, renamed',
      multiPropRename.first());

// Select multiple properties, remove geometry.
var multiPropNoGeom = fc.select({
  propertySelectors: ['fuel1', 'capacitymw'],
  retainGeometry: false
});
print('Multiple properties selected, geometry removed',
      multiPropNoGeom.first());

Python सेटअप

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

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"')

# Select a single property.
single_prop = fc.select('fuel1')
print('Single property selected:', single_prop.first().getInfo())

# Select multiple properties.
multi_prop = fc.select(['fuel1', 'capacitymw'])
print('Multiple properties selected:', multi_prop.first().getInfo())

# Select multiple properties and rename them.
multi_prop_rename = fc.select(**{
    'propertySelectors': ['fuel1', 'capacitymw'],
    'newProperties': ['Fuel_1', 'Capacity_MW']
    })
print('Multiple properties selected, renamed:',
      multi_prop_rename.first().getInfo())

# Select multiple properties, remove geometry.
multi_prop_no_geom = fc.select(**{
    'propertySelectors': ['fuel1', 'capacitymw'],
    'retainGeometry': False
    })
print('Multiple properties selected, geometry removed:',
      multi_prop_no_geom.first().getInfo())