公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
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 (世界標準時間)。"],[[["\u003cp\u003eLinks a source image to a matching image within a specified image collection based on a shared metadata property, such as 'system:index'.\u003c/p\u003e\n"],["\u003cp\u003eIf a match is found, it adds or overwrites bands and metadata from the collection image to the source image, otherwise, new bands are masked and metadata is nulled.\u003c/p\u003e\n"],["\u003cp\u003ePrimarily used to link collections with varied processing applied to the same base imagery, providing a streamlined method for band and metadata integration.\u003c/p\u003e\n"],["\u003cp\u003eOffers basic linking functionality; for more complex scenarios requiring joins, refer to the Earth Engine guide on joins.\u003c/p\u003e\n"],["\u003cp\u003eThe output maintains the source image's footprint regardless of the linking outcome.\u003c/p\u003e\n"]]],["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"],null,["# ee.Image.linkCollection\n\nLinks the source image to a matching image from an image collection.\n\n\u003cbr /\u003e\n\nAny specified bands or metadata will be added to the source image from the image found in the collection, and if the bands or metadata are already present they will be overwritten. If a matching image is not found, any new or updated bands will be fully masked and any new or updated metadata will be null. The output footprint will be the same as the source image footprint.\n\nA match is determined if the source image and an image in the collection have a specific equivalent metadata property. If more than one collection image would match, the collection image selected is arbitrary. By default, images are matched on their 'system:index' metadata property.\n\nThis linking function is a convenience method for adding bands to a target image based on a specified shared metadata property and is intended to support linking collections that apply different processing/product generation to the same source imagery. For more expressive linking known as 'joining', see https://developers.google.com/earth-engine/guides/joins_intro.\n\n| Usage | Returns |\n|---------------------------------------------------------------------------------------------------------|---------|\n| Image.linkCollection`(imageCollection, `*linkedBands* `, `*linkedProperties* `, `*matchPropertyName*`)` | Image |\n\n| Argument | Type | Details |\n|---------------------|---------------------------------|-------------------------------------------------------------------------------------|\n| this: `input` | Image | The source image a matching image in the collection will be linked to. |\n| `imageCollection` | ImageCollection | The image collection searched to extract an image matching the source. |\n| `linkedBands` | Object, default: null | A band name or list of band names to add or update from the matching image. |\n| `linkedProperties` | Object, default: null | A metadata property or list of properties to add or update from the matching image. |\n| `matchPropertyName` | String, default: \"system:index\" | The metadata property name to use as a match criteria. |"]]