ee.Image.linkCollection

  • Links a source image to a matching image within a specified image collection based on a shared metadata property, such as 'system:index'.

  • If 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.

  • Primarily used to link collections with varied processing applied to the same base imagery, providing a streamlined method for band and metadata integration.

  • Offers basic linking functionality; for more complex scenarios requiring joins, refer to the Earth Engine guide on joins.

  • The output maintains the source image's footprint regardless of the linking outcome.

Links the source image to a matching image from an image collection.

Any 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.

A 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.

This 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.

UsageReturns
Image.linkCollection(imageCollection, linkedBands, linkedProperties, matchPropertyName)Image
ArgumentTypeDetails
this: inputImageThe source image a matching image in the collection will be linked to.
imageCollectionImageCollectionThe image collection searched to extract an image matching the source.
linkedBandsObject, default: nullA band name or list of band names to add or update from the matching image.
linkedPropertiesObject, default: nullA metadata property or list of properties to add or update from the matching image.
matchPropertyNameString, default: "system:index"The metadata property name to use as a match criteria.