ee.Dictionary.getString

تستخرج هذه الدالة قيمة سلسلة مسماة من قاموس.

الاستخدامالمرتجعات
Dictionary.getString(key)سلسلة
الوسيطةالنوعالتفاصيل
هذا: dictionaryالقاموس
keyسلسلة

أمثلة

محرّر الرموز البرمجية (JavaScript)

// A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).
var dict = ee.Dictionary({
  B1: 182,
  B2: 219,
  B3: 443,
  Region: 'The Forest of Nisene Marks State Park'
});

print('The "Region" value as an ee.String object', dict.getString('Region'));

إعداد 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,
    'Region': 'The Forest of Nisene Marks State Park'
})

print('The "Region" value as an ee.String object:',
      dic.getString('Region').getInfo(), sep='\n')