GEE学习总结(9)——像元二分法计算月度植被覆盖度(MODIS)

像元二分法计算植被覆盖度

通过MODIS的NDVI数据集MOD13Q1和像元二分法计算植被覆盖度

var multi_NDVI = ee.ImageCollection('MODIS/006/MOD13Q1')
                  .filterDate('2015-06-01', '2016-09-01')
                  .select('NDVI')
                  .max().divide(10000)
                  .clip(geometry);
                  
var ndviVis = {
  min: 0.0,
  max: 1,
  palette: [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'
  ],
};

//
Map.centerObject(geometry);

//统计影像中对应分位数的值
var num = multi_NDVI.reduceRegion({
  reducer:ee.Reducer.percentile([5,95]),
  geometry:geometry,
  scale:250,
  maxPixels:1e13
});
var min = ee.Number(num.get("NDVI_p5"));
var max = ee.Number(num.get("NDVI_p95"));
print(min)
print(max)


//根据统计值通过像元二分法计算植被覆盖度
var NDVI = ee.ImageCollection('MODIS/006/MOD13Q1')
                  .filterDate('2015-06-01', '2016-07-01')
                  .select('NDVI')
                  .max().divide(10000)
                  .clip(geometry);

var greaterPart = NDVI.gt(max);
var lessPart    = NDVI.lt(min);
var middlePart  = ee.Image(1).subtract(greaterPart).subtract(lessPart);

//计算FVC
var tempf1= NDVI.subtract(min).divide(max.subtract(min));

var FVC = ee.Image(1).multiply(greaterPart)
          .add(ee.Image(0).multiply(lessPart))
          .add(tempf1.multiply(middlePart));

Map.addLayer(FVC, ndviVis, 'FVC');

你可能感兴趣的:(☁️,GEE云计算,GEE,像元二分法,植被覆盖度,MODIS)