Google Earth Engine – Getting the Maximum Value of One Image

google-earth-engine

The Google Earth Engine API doc has function to get max value of some bands. But how to get the max value of one image?

Best Answer

.reduceRegion works if the geometry is reasonably small.

https://code.earthengine.google.com/8d71b1f03571c4510be90381928f3925 (I drew a polygon region.)

var RedBandIMAGE   = ee.Image( 'LC8_L1T_TOA/LC80410362015107LGN00' ).select( ['B4'] );
var maxReducer = ee.Reducer.max();
var theMax = RedBandIMAGE.reduceRegion(maxReducer, geometry);
print(theMax);
Map.setCenter( -118.2733, 34.0942, 12 ); 
Map.addLayer( RedBandIMAGE,   {min:0, max:0.17, palette:'000000,ff5555'},     'RedImage'   );