ee.FeatureCollection.toDictionary

從特徵擷取屬性做為字典。

用量傳回
FeatureCollection.toDictionary(properties)字典
引數類型詳細資料
這個:element元素要從中擷取屬性的特徵。
properties清單,預設值為空值要擷取的屬性清單。預設為所有非系統屬性。

範例

程式碼編輯器 (JavaScript)

// FeatureCollection of power plants.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants');

print('All non-system FeatureCollection properties as an ee.Dictionary',
      fc.toDictionary());
print('Selected properties as an ee.Dictionary',
      fc.toDictionary(['description', 'provider']));

Python 設定

請參閱 Python 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

# FeatureCollection of power plants.
fc = ee.FeatureCollection('WRI/GPPD/power_plants')

print('All non-system FeatureCollection properties as an ee.Dictionary:',
      fc.toDictionary().getInfo())
print('Selected properties as an ee.Dictionary:',
      fc.toDictionary(['description', 'provider']).getInfo())