ee.FeatureCollection.toDictionary

ดึงพร็อพเพอร์ตี้จากฟีเจอร์เป็นพจนานุกรม

การใช้งานการคืนสินค้า
FeatureCollection.toDictionary(properties)พจนานุกรม
อาร์กิวเมนต์ประเภทรายละเอียด
ดังนี้ elementองค์ประกอบฟีเจอร์ที่จะดึงพร็อพเพอร์ตี้ออกมา
propertiesรายการ (ค่าเริ่มต้น: null)รายการพร็อพเพอร์ตี้ที่จะดึงข้อมูล ค่าเริ่มต้นคือพร็อพเพอร์ตี้ที่ไม่ใช่ระบบทั้งหมด

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (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 API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

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