0

I want to learn pixels band values, for example when I clik on mNDWI image in screen of Earth Engine, I need learning values of red, green and blue

var geometry=ee.Geometry.Polygon([[38.877002459052335,40.75574968156597],
 [41.206104021552335,41.17882292442983],
 [40.645801287177335,41.59918091806734],
 [40.052539568427335,41.84517989453356],
 [39.569141130927335,41.886088143011904],
 [38.800098162177335,41.48405920501165],
 [38.877002459052335,40.75574968156597],
  ]);

var s2SR = ee.ImageCollection('COPERNICUS/S2_SR')
              //filter start and end date
             .filter(ee.Filter.calendarRange(2020,2020,'year'))
             .filter(ee.Filter.calendarRange(8,8,'month'))
             //filter according to drawn boundary
             .filterBounds(geometry)
             .filterMetadata('CLOUD_COVERAGE_ASSESSMENT', 'less_than',10);

//Map.addLayer(s2SR, {bands:['B4', 'B3', 'B2'], min:0, max:8000}, 's2SR');

// adding mNDWI function
var addMNDWI = function(image) {
  var mndwi = ee.Image(image).normalizedDifference(['B3', 'B11']).rename('MNDWI');
  return ee.Image(image).addBands(mndwi);
};
var mndwı=s2SR
            .map(addMNDWI);
Map.addLayer(mndwı.first(), { min:245, max:5000}, 'mndwı');
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
CHH
  • 5
  • 2

1 Answers1

0

It is simple to view the values for any displayed image. First, click on the “Inspector” tab in the top right pane of the Earth Engine Code Editor.

View of Inspector tab

Then, click wherever you want on the map. The Inspector tab will display:

  • The coordinates of the location you clicked.
  • The values of every band of every image under that point. (When there are many, as a chart.)
  • The details of the image (or feature), including properties.

enter image description here

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108