I have created an google earth engine image collection by combining multiband rasters (I previously had eleven rasters, one for each year of my analysis period, each with 365 bands). I first combined all the rasters, then turned them into an image collection This is the code I used to make the image collection (composite is my combined set of multiband rasters)
var bands_all = composite.bandNames()
var list_all = bands_all.map(function(n) { return composite.select([n]) })
var collection = ee.ImageCollection.fromImages(list_all)
Now I have one image collection with individual features for each day of the eleven years, with only one band for each feature, to match existing image collections such as gridMET heat data). I need to assign a date to each feature so I can filter by date, and the rasters I started with did not contain that data.
I used the following code to create a list of dates and assign it to the image collection:
var Date_Start = ee.Date('2008-01-01');
var Date_End = ee.Date('2018-12-31');
var Date_window = ee.Number(30);
var n_days = Date_End.difference(Date_Start,'day').round();
var dates = ee.List.sequence(0,n_days,1);
var make_datelist = function(n) {
return Date_Start.advance(n,'day')
}
dates = dates.map(make_datelist);
print(dates)
var collection_2 = collection.set({
date: dates
});
print(collection_2)
But, what I noticed is that the "date" is added as a main property for the entire collection in the form of a list, but I need it to be added to "properties" under each individual feature so I can ultimately filter by date and overlay with other similar image collections. How can I accomplish this in google earth engine?