公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.linkCollection
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将源图片与图片集中的匹配图片相关联。
系统会将指定波段或元数据添加到集合中找到的图片所对应的源图片中,如果波段或元数据已存在,则会被覆盖。如果未找到匹配的图片,则任何新的或更新的频段都将被完全遮盖,并且任何新的或更新的元数据都将为 null。输出覆盖区将与源图片覆盖区相同。
如果源图片和集合中的图片具有特定的等效元数据属性,则判定为匹配。如果多个集合图片都匹配,则所选的集合图片是任意的。默认情况下,系统会根据图片的“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” | 要用作匹配条件的元数据属性名称。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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. |"]]