公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取。如未在 2025 年 9 月 26 日前完成驗證,存取權可能會暫停。
ee.Image.linkCollection
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將來源圖片連結至圖片集中的相符圖片。
系統會將指定波段或中繼資料新增至集合中的圖片,並覆寫來源圖片中的波段或中繼資料 (如有)。如果找不到相符的圖片,系統會完全遮蓋任何新或更新的波段,並將任何新或更新的中繼資料設為空值。輸出內容的足跡會與來源圖片的足跡相同。
如果來源圖片和集合中的圖片具有特定等效中繼資料屬性,系統就會判定為相符。如果有多張圖片符合條件,系統會隨機選取一張做為收藏圖片。根據預設,系統會依據圖片的「system:index」中繼資料屬性進行比對。
這項連結功能是便利的方法,可根據指定的共用中繼資料屬性,將波段新增至目標圖片,並支援連結對相同來源影像套用不同處理/產品生成的集合。如要瞭解更具表現力的連結 (又稱「聯結」),請參閱 https://developers.google.com/earth-engine/guides/joins_intro。
| 用量 | 傳回 |
|---|
Image.linkCollection(imageCollection, linkedBands, linkedProperties, matchPropertyName) | 圖片 |
| 引數 | 類型 | 詳細資料 |
|---|
這個:input | 圖片 | 來源圖片會連結至收藏內容中的相符圖片。 |
imageCollection | ImageCollection | 搜尋圖片集,從中擷取與來源相符的圖片。 |
linkedBands | 物件,預設值:null | 要從相符圖片新增或更新的樂團名稱或樂團名稱清單。 |
linkedProperties | 物件,預設值:null | 要從相符圖片新增或更新的中繼資料屬性或屬性清單。 |
matchPropertyName | 字串,預設值為「system:index」 | 做為比對條件的中繼資料屬性名稱。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[],["The `linkCollection` function links a source image to a matching image from a collection based on a shared metadata property, defaulting to 'system:index'. It adds or overwrites specified bands and metadata from the matched collection image onto the source image. If no match is found, new or updated bands are masked, and metadata is null. The function accepts arguments for the collection, bands, metadata properties to link, and the match property name. The output footprint matches the source image.\n"]]