Google Earth Engine – Summing Over Bands in Google Earth Engine

google-earth-enginemulti-bandsummarizing

I have this real Big Bandet Image with 25000 Bands.
I want to Sum over the Bands, Pixelwise.

is there a Way to either :

-convert this ee.image, bandwise to an ee.ImageCollection

-Collapse all Bands of means into 1 Summed Band ?

Best Answer

Here is another approach:

// Make a (toy) 3 bands image
var image  = ee.Image([1,2,3]).rename(['one', 'two', 'three'])
Map.addLayer(image, null, '3 bands image')

// Sum all bands
var sum_bands = image.reduce('sum')
Map.addLayer(sum_bands, null, 'sum')

// You can compute any reduction
var mean_bands = image.reduce('mean')
Map.addLayer(mean_bands, null, 'mean')

link: https://code.earthengine.google.com/9ff53b49274f3842f353a2994905e750

Related Question