ee.Dictionary.toImage

यह फ़ंक्शन, डिक्शनरी में मौजूद वैल्यू से कॉन्स्टेंट की इमेज बनाता है. इमेज के बैंड को, names आर्ग्युमेंट के हिसाब से क्रम में लगाया जाता है और नाम दिया जाता है. अगर कोई नाम नहीं दिया गया है, तो बैंड को वर्णमाला और संख्या के हिसाब से क्रम में लगाया जाता है.

इस्तेमालरिटर्न
Dictionary.toImage(names)इमेज
आर्ग्यूमेंटटाइपविवरण
यह: dictionaryशब्दकोशवह डिक्शनरी जिसे बदलना है.
namesसूची, डिफ़ॉल्ट: nullआउटपुट बैंड का क्रम.

उदाहरण

कोड एडिटर (JavaScript)

// A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).
var dict = ee.Dictionary({
  B1: 182,
  B2: 219,
  B3: 443
});

var selectedKeysImg = dict.toImage(['B1', 'B2']);
print('Selected keys image band names', selectedKeysImg.bandNames());

var allKeysImg = dict.toImage();
print('All keys image band names', allKeysImg.bandNames());

Python सेटअप करना

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

import ee
import geemap.core as geemap

Colab (Python)

# A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).
dic = ee.Dictionary({
    'B1': 182,
    'B2': 219,
    'B3': 443
})

selected_keys_img = dic.toImage(['B1', 'B2'])
print('Selected keys image band names:',
      selected_keys_img.bandNames().getInfo())

all_keys_img = dic.toImage()
print('All keys image band names:', all_keys_img.bandNames().getInfo())