2

How can I get the max or min value of one image? I don't know what's the function is in GEE. I have to use this for vegetation coverage For example: [1,2,3, 4,5,6, 7,8,9] max:9;min:1

1

Are you looking for something like this?

var geometry = ee.Geometry.Polygon(
    [[[-121.52324218749999, 37.901687004454395],
      [-121.46831054687499, 37.42335315973017],
      [-120.86406249999999, 37.46696534545472],
      [-120.89702148437499, 37.98832531444019]]]);

var modis = ee.ImageCollection("MODIS/MCD43A4_NDVI")
var modis_filtered = modis.filterDate("2010-01-01","2010-04-01").median().clip(geometry)

print(modis_filtered.reduceRegion({
      reducer: ee.Reducer.min(),
      geometry: geometry,
      scale : 250
      }))

More info can be found here

  • Thank you for your help! Honestly, I used Landsat to caculate NDVI, but I think they are the same. – jianjianhahaha Sep 25 '18 at 3:36
  • This is just an example - you can perform the reduce operation on any ee.Image, or ee.ImageCollection whether it be landsat, modis, seneinel, or others. Try substituting your image instead of the modis_filtered variable and examine the results. – nyquist Sep 25 '18 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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