[GIS] Combining multiple bands from different image collection into one collection

google-earth-engine

I did some calculations on variety of image collections and have generated products and saved them in variables, say a, b and c. Now I want to combine all these products (All one bands) into a multiband image collection.

What function should i use?
I tried with:

a.combine(b).combine(c)
a.merge(b).merge(c)
a.add(b).add(c)

But, these functions are not working.

Best Answer

Assuming you made a unique name for each band, and that you want to obtain one image with 3 bands (one for a, one for b and one for c) you have to addBands, like this:

var a = ee.Image(1).rename('one') // product one
var b = ee.Image(2).rename('two')
var c = ee.Image(3).rename('three')

var final = a.addBands([b, c])

link: https://code.earthengine.google.com/5c3ceef589fc8cbe6036f8f2ef22f2ca