ee.Dictionary.toImage

تصویری از ثابت ها را از مقادیر موجود در فرهنگ لغت ایجاد می کند. نوارهای تصویر بر اساس آرگومان names مرتب و نامگذاری می شوند. اگر هیچ نامی مشخص نشده باشد، باندها به صورت الفا عددی مرتب می شوند.

استفاده برمی گرداند
Dictionary. toImage ( names ) تصویر
استدلال تایپ کنید جزئیات
این: dictionary فرهنگ لغت فرهنگ لغت برای تبدیل.
names لیست، پیش فرض: null ترتیب باندهای خروجی

نمونه ها

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

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

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

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

import ee
import geemap.core as geemap

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

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