ee.FeatureCollection.get

從特徵擷取屬性。

用量傳回
FeatureCollection.get(property)
引數類型詳細資料
這個:object元素要從中擷取屬性的特徵。
property字串要擷取的屬性。

範例

程式碼編輯器 (JavaScript)

// A global power plant FeatureCollection.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants');

// View a list of FeatureCollection property names.
print(fc.propertyNames());

// Get the value of a listed property.
print('Global power plant data provider as ee.ComputedObject',
      fc.get('provider'));

// The returned value is an ee.ComputedObject which has no methods available for
// further processing; cast to the relevant Earth Engine object class for use.
print('Global power plant data provider as ee.String',
      ee.String(fc.get('provider')));

Python 設定

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

import ee
import geemap.core as geemap

Colab (Python)

# A global power plant FeatureCollection.
fc = ee.FeatureCollection('WRI/GPPD/power_plants')

# View a list of FeatureCollection property names.
print(fc.propertyNames().getInfo())

# Get the value of a listed property.
print('Global power plant data provider as ee.ComputedObject:',
      fc.get('provider').getInfo())

# The returned value is an ee.ComputedObject which has no methods available for
# further processing; cast to the relevant Earth Engine object class for use.
print('Global power plant data provider as ee.String:',
      ee.String(fc.get('provider')).getInfo())