I would like to add a band to each image in an image collection ('median_ndvi' in the linked code). The band should be a sequence of ee.Image() constants from 1 to 12.
https://code.earthengine.google.com/e6f22ac8bc6763aa795a14272c89ce6f
google-earth-engine
I would like to add a band to each image in an image collection ('median_ndvi' in the linked code). The band should be a sequence of ee.Image() constants from 1 to 12.
https://code.earthengine.google.com/e6f22ac8bc6763aa795a14272c89ce6f
Best Answer
You can make your image collection way more convenient by looping over the years you are interested in. While doing so, you can also add a constant band to each of the images.
Note that for further calculations you might have to cast the different types of bands to a similar bandtype. Most likely, you will have to cast the constant image to a floating number using
You can then get only the bands you are interested in using:
Link