'Google Earth Engine - use reduce(ee.Reducer.max())
I tried to used reduce(ee.Reducer.max()) and reduce(ee.Reducer.min())in the follow function, but doesn't work very well. Max and min return the same value. How can I solve this issue? Thank you.
var SM = function(image) {
var FE = image.expression('((SM-SMmin)/(SMmax-SMmin))',{
'SM':image.select('susm'),
'SMmax':image.select('susm').reduce(ee.Reducer.max()),
'SMmin':image.select('susm').reduce(ee.Reducer.min()),
})
return FE;
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|