ee.FeatureCollection.set

किसी एलिमेंट की एक या उससे ज़्यादा मेटाडेटा प्रॉपर्टी को बदल देता है.

ओवरराइड की गई प्रॉपर्टी वाले एलिमेंट को दिखाता है.

इस्तेमालरिटर्न
FeatureCollection.set(var_args)एलिमेंट
आर्ग्यूमेंटटाइपविवरण
यह: elementएलिमेंटएलिमेंट इंस्टेंस.
var_argsVarArgs<Object>प्रॉपर्टी की डिक्शनरी या प्रॉपर्टी का वैरग सीक्वेंस, जैसे कि key1, value1, key2, value2, ...

उदाहरण

कोड एडिटर (JavaScript)

// An empty FeatureCollection for simple demonstration.
var fc = ee.FeatureCollection([]);

// Set a single new property using a key-value pair.
fc = fc.set('key_1', 'value 1');

// Set multiple new properties using a series of key-value pairs.
fc = fc.set('key_2', 'value 2',
            'key_3', 3);

// Set new properties using a dictionary of key-value pairs.
fc = fc.set({
  key_5: ee.Array([1, 2, 3]),
  key_6: ee.Image(0),
  key_7: ee.Feature(null)
});
print('New FeatureCollection properties added', fc);

// Overwrite an existing property.
fc = fc.set('key_1', 'overwritten');
print('FeatureCollection property overwritten', fc);

Python सेटअप

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

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

# An empty FeatureCollection for simple demonstration.
fc = ee.FeatureCollection([])

# Set a single new property using a key-value pair.
fc = fc.set('key_1', 'value 1')

# Set multiple new properties using a series of key-value pairs.
fc = fc.set('key_2', 'value 2', 'key_3', 3)

# Set new properties using a dictionary of key-value pairs.
fc = fc.set({
  'key_5': ee.Array([1, 2, 3]),
  'key_6': ee.Image(0),
  'key_7': ee.Feature(None)
})
print('New FeatureCollection properties added:')
pprint(fc.getInfo())

# Overwrite an existing property.
fc = fc.set('key_1', 'overwritten')
print('FeatureCollection property overwritten:')
pprint(fc.getInfo())