How to copy metadata from one image collection to another? #338
-
|
Hi there, I have been trying to create an image collection of Landsat imagery, where I have written script to mosaic images from two tiles/scenes taken on the same day and to clip the imagery to a region. However, I have noticed that when I mosaic images, as well as clip images, I lose all metadata. It makes sense, as a new image collection is made and EE assumes the metadata would be different, but I would like to keep some metadata from one of the two Landsat tiles used for the daily mosaics. In the EE documentation I have found the ImageCollection.copyProperties() function but keep receiving attribute errors when trying to call on the new image collection with the properties copied. I have tried implementing the copyProperties function by creating an image collection with just the tile/scene I would like to take metadata from, which is the same length of images as the mosaiced collection, and called on different metadata properties. Ultimately, I would imagine I am implementing the function incorrectly but examples of the function (in javascript) seem to be employed similarly to how I am trying to employ the function here. Can't seem to find any other functions or ways to accomplish this. What is a good way to go about copying metadata from one image collection, or image, to another (assuming they are the same length of images)? I would imagine there must be a good way to use .map() for this. Here's an example of my code: I am just starting out with Earth Engine and Python so I apologize if this is a simple problem. Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
See https://gist.github.com/giswqs/e85b0371bc3cd15ff6ccd5adfa9643d7 |
Beta Was this translation helpful? Give feedback.
-
|
I might have accidentally flipped the source and dest. It should be |
Beta Was this translation helpful? Give feedback.
See https://gist.github.com/giswqs/e85b0371bc3cd15ff6ccd5adfa9643d7