ee.FeatureCollection.toDictionary

Trích xuất các thuộc tính từ một đối tượng dưới dạng từ điển.

Cách sử dụngGiá trị trả về
FeatureCollection.toDictionary(properties)Từ điển
Đối sốLoạiThông tin chi tiết
this: elementPhần tửTính năng để trích xuất thuộc tính.
propertiesDanh sách, mặc định: nullDanh sách các thuộc tính cần trích xuất. Theo mặc định, tất cả các thuộc tính không phải của hệ thống.

Ví dụ

Trình soạn thảo mã (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']));

Thiết lập Python

Hãy xem trang Môi trường Python để biết thông tin về API Python và cách sử dụng geemap cho quá trình phát triển tương tác.

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())