ee.Dictionary.combine

দুটি অভিধান একত্রিত করে। ডুপ্লিকেট নামের ক্ষেত্রে, আউটপুটে দ্বিতীয় অভিধানের মান থাকবে যদি না ওভাররাইট মিথ্যা হয়। উভয় অভিধানে শূন্য মান উপেক্ষা/মুছে ফেলা হয়।

ব্যবহার রিটার্নস
Dictionary. combine (second, overwrite ) অভিধান
যুক্তি টাইপ বিস্তারিত
এই: first অভিধান
second অভিধান
overwrite বুলিয়ান, ডিফল্ট: সত্য

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

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

// A second dictionary.
var dict2 = ee.Dictionary({
  Region: 'The Forest of Nisene Marks State Park',
  Image: 'Sentinel-2 surface reflectance (scaled by 1e4)',
  B1: -9999  // Note that the B1 key is present in both dictionaries.
});

print('Combined dictionaries (overwrite false)',
      dict1.combine(dict2, false));

print('Combined dictionaries (overwrite true)',
      dict1.combine(dict2, true));

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।

import ee
import geemap.core as geemap

Colab (পাইথন)

import pprint

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

# A second dictionary.
dic_2 = ee.Dictionary({
    'Region': 'The Forest of Nisene Marks State Park',
    'Image': 'Sentinel-2 surface reflectance (scaled by 1e4)',
    'B1': -9999  # Note that the B1 key is present in both dictionaries.
})

print('Combined dictionaries (overwrite false)')
pprint.pprint(dic_1.combine(dic_2, False).getInfo())

print('\nCombined dictionaries (overwrite true)')
pprint.pprint(dic_1.combine(dic_2, True).getInfo())