I'm creating a custom image collection over a bound region as follows:
- Get image collection containing images taken by satellite in 7 days
var collection_to_covert_to_image = ee.ImageCollection("COPERNICUS/S2").filterDates(d1, d2).filterBounds(roi);
- Convert image collection to a single image:
var img = collection_to_convert_to_image.toBands();
Now this creates an image with bands list as a sum of all images in collection. Like instead of correct B1, B2, B3, B4, etc it is creating bands list having IMAGE_1_DATE_B1, ...IMAGE_1_DATE_B2, ..., IMAGE_2_DATE_B1, IMAGE_2_DATE_B2, ...
What I want the resulting combined image from image collection to have B1, B2, B3, B4, ...
- Repeat Steps 1 and 2 to get multiple 'combined' images and then creating image collection as follows:
var custom_col = ee.ImageCollection([ combined_img_1, combined_img_2, ... ]);
Finally to preview this collection, I add first image to the map:
Map.addLayer(custom_col.first(), { min: 0, max: 6000 });
But nothing gets displayed although layer is loaded. I believe this is because of new images not having proper B1, B2, etc bands
So how to make combined image that contains these bands as sum of child images' respective bands like e.g combined_img_B1 = img1_B1 + img2_B1 + ... in order to display it on map?