-1

It is my understanding that imageCollection.reduce() takes an image collection -collection of images over time, where at any given time the image is/can-be consist of several bands- and then reduces it by acting in time dimension. In other words, for any given band like B1, it does the reduction over the time window from t_1 to t_n, and generates an image which has lost its time dimensionality, but has the same number of bands as original ImageCollection object.

And Image.reduce() which acts on a single image, single image being an object that is snapshot at a given time-i.e. there is no time dimensionality here to begin with- and then reduces the image, by acting on the band dimensionality. So, output will be like a 2D matrix consisting of just one value per pixel.

What does the sentence below mean at the Image Reductions documentation page?

The output is also an image with number of bands equal to number of reducer outputs.

0

1 Answer 1

1

Your understanding is correct. I like to imagine it in a different way. For image collection I think of it as multiple image stacks for each bands and the reducer works in the 3rd dimension which is like you said is time dimensions. In case of image I think of it as simply a stack of bands. So it works out that the reducer works in the 3rd dimension. So like I said, your understanding is correct.

The statement just means that the resulting image has bands corresponding to the reducer output. What I mean by that is, referring to the example on the documentation page, they use ee.Reducer.max() which gives one result i.e. the maximum value across bands. So, the resulting image has a single band that is max of the input bands. However, if we use ee.Reducer.minMax(), the reducer gives two outputs i.e. min value across bands and max value across bands. Therefore the resulting image will have two bands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.