تطرح Earth Engine
فئات حصص غير تجارية لحماية موارد الحوسبة المشترَكة وضمان أداء موثوق للجميع. يجب أن تختار جميع المشاريع غير التجارية فئة حصة بحلول
27 أبريل 2026، وإلا سيتم استخدام "فئة المجتمع" تلقائيًا. سيبدأ تطبيق حصص المستوى على جميع المشاريع (بغض النظر عن تاريخ اختيار المستوى) في
27 أبريل 2026.
مزيد من المعلومات
ee.Dictionary.get
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تستخرج هذه الدالة قيمة مسماة من قاموس. إذا لم يحتوي القاموس على المفتاح المحدّد، يتم عرض defaultValue، ما لم تكن القيمة فارغة.
| الاستخدام | المرتجعات |
|---|
Dictionary.get(key, defaultValue) | عنصر |
| الوسيطة | النوع | التفاصيل |
|---|
هذا: dictionary | القاموس | |
key | سلسلة | |
defaultValue | كائن، القيمة التلقائية: 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
});
print('Value for "B1" key', dict.get('B1'));
// Set a default value for the case where the key does not exist.
print('Value for nonexistent "Band_1" key',
dict.get({key: 'Band_1', defaultValue: -9999}));
إعداد Python
راجِع صفحة
بيئة Python للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap للتطوير التفاعلي.
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
})
display('Value for "B1" key:', dic.get('B1'))
# Set a default value for the case where the key does not exist.
display('Value for nonexistent "Band_1" key:',
dic.get(**{'key': 'Band_1', 'defaultValue': -9999}))
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-10-30 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-10-30 (حسب التوقيت العالمي المتفَّق عليه)"],[],["The `get` method retrieves a value from a dictionary using a specified key. If the key exists, its corresponding value is returned. If the key is absent, a `defaultValue` is returned. The `defaultValue` can be customized, defaulting to `null` if not provided. Usage examples demonstrate retrieving existing values and setting default values for nonexistent keys, in both JavaScript and Python. The `get` method is applicable to dictionary objects.\n"]]