ประกาศ : โปรเจ็กต์ที่ไม่ใช่เชิงพาณิชย์ทั้งหมดที่ลงทะเบียนเพื่อใช้ Earth Engine ก่อนวันที่
15 เมษายน 2025 ต้อง
ยืนยันการมีสิทธิ์ที่ไม่ใช่เชิงพาณิชย์ เพื่อรักษาสิทธิ์เข้าถึง หากคุณไม่ยืนยันภายในวันที่ 26 กันยายน 2025 ระบบอาจระงับสิทธิ์เข้าถึงของคุณ
ส่งความคิดเห็น
ee.ImageCollection.toDictionary
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ดึงพร็อพเพอร์ตี้จากฟีเจอร์เป็นพจนานุกรม
การใช้งาน การคืนสินค้า ImageCollection. toDictionary (properties )
พจนานุกรม
อาร์กิวเมนต์ ประเภท รายละเอียด ดังนี้ element
องค์ประกอบ ฟีเจอร์ที่จะดึงพร็อพเพอร์ตี้ออกมา properties
รายการ (ค่าเริ่มต้น: null) รายการพร็อพเพอร์ตี้ที่จะดึงข้อมูล ค่าเริ่มต้นคือพร็อพเพอร์ตี้ที่ไม่ใช่ระบบทั้งหมด
ตัวอย่าง
โปรแกรมแก้ไขโค้ด (JavaScript)
// A contrived, empty image collection for simple demonstration.
var col = ee . ImageCollection ([]);
print ( 'Collection without properties' , col );
// Set collection properties using a dictionary.
col = col . set ({
project_name : 'biomass_tracking' ,
project_id : 3 ,
plot_ids : ee . Array ([ 7 , 11 , 20 ])
});
// Set collection properties using a series of key-value pairs.
col = col . set ( 'project_year' , 2018 ,
'rgb_vis' , 'false_color' );
print ( 'Collection with properties' , col );
// Get a dictionary of collection property keys and values.
print ( 'Property keys and values (ee.Dictionary)' , col . toDictionary ());
// Get the value of a collection property. To use the result of
// ee.ImageCollection.get in further computation, you need to cast it to the
// appropriate class, for example, ee.Number(result) or ee.String(result).
print ( 'Project ID (ambiguous object)' , col . get ( 'project_id' ));
// Get the value of a string collection property as an ee.String object.
print ( 'Project name (ee.String)' , col . getString ( 'project_name' ));
// Get the value of a numeric collection property as an ee.Number object.
print ( 'Project year (ee.Number)' , col . getNumber ( 'project_year' ));
// Get the value of an ee.Array collection property as an ee.Array object.
print ( 'Plot IDs (ee.Array)' , col . getArray ( 'plot_ids' ));
การตั้งค่า Python
ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap
เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า
สภาพแวดล้อม Python
import ee
import geemap.core as geemap
Colab (Python)
# A contrived, empty image collection for simple demonstration.
col = ee . ImageCollection ([])
print ( 'Collection without properties:' , col . getInfo ())
# Set collection properties using a dictionary.
col = col . set ({
'project_name' : 'biomass_tracking' ,
'project_id' : 3 ,
'plot_ids' : ee . Array ([ 7 , 11 , 20 ])
})
# Set collection properties using a series of key-value pairs.
col = col . set ( 'project_year' , 2018 ,
'rgb_vis' , 'false_color' )
print ( 'Collection with properties:' , col . getInfo ())
# Get a dictionary of collection property keys and values.
print ( 'Property keys and values (ee.Dictionary):' , col . toDictionary () . getInfo ())
# Get the value of a collection property. To use the result of
# ee.ImageCollection.get in further computation, you need to cast it to the
# appropriate class, for example, ee.Number(result) or ee.String(result).
print ( 'Project ID (ambiguous object):' , col . get ( 'project_id' ) . getInfo ())
# Get the value of a string collection property as an ee.String object.
print ( 'Project name (ee.String):' , col . getString ( 'project_name' ) . getInfo ())
# Get the value of a numeric collection property as an ee.Number object.
print ( 'Project year (ee.Number):' , col . getNumber ( 'project_year' ) . getInfo ())
# Get the value of an ee.Array collection property as an ee.Array object.
print ( 'Plot IDs (ee.Array):' , col . getArray ( 'plot_ids' ) . getInfo ())
ส่งความคิดเห็น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
หากต้องการบอกให้เราทราบเพิ่มเติม
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-26 UTC"],[],["The `ImageCollection.toDictionary()` method extracts properties from a feature, returning them as a dictionary. You must provide a list of `properties`; otherwise, it will default to all non-system properties. Properties can be added to an image collection with `set()`. Individual property values can be retrieved using `get()`, `getString()`, `getNumber()`, or `getArray()`, and then must be cast into the appropriate data type.\n"]]