I'm trying to reduce an ImageCollection based on pixels with the highest value in a particular band (Sentinel 2, band 3, in case that matters). I also need to retain all bands in the output. So, I want to choose the greenest pixels from the image stack. The max()
reducer doesn't appear to work this way? How would I go about this?
var s2 = s2_col.filterDate('2019','2022')
.filterBounds(LGA)
.reduce(ee.Reducer.max(s2_col.select('B3')))
Best Answer
You can use
qualityMosaic
to do this, or you can useee.Reducer.max({numInputs:13})
, however with the reducer, the band with the max you want to select on has to be the first band.