GEE开发之MODIS_NDVI年均值数据分析
GEE开发之MODIS_NDVI年均值数据分析
前言:前面几篇博客主要介绍了NDVI的日均值和月均值的数据分析,这次主要介绍年均值的数据分析。
代码如下(以鹿邑县为例):
var geometry = ee.FeatureCollection('users/www1573979951/luyixian');
// 选择数据集并进行波段比例换算
var collection = ee.ImageCollection("MODIS/006/MOD13Q1").filterDate('2000-01-01', '2020-12-31').select("NDVI");
//换算单位
var multiply = function(image){
var img = image.multiply(0.0001);
return img.set(image.toDictionary(image.propertyNames()));
};
collection = collection.map(multiply);
//进行年平均值的计算
var years = ee.List.sequence(2000, 2020);
var collectYear = ee.ImageCollection(years
.map(function(y) {
var start = ee.Date.fromYMD(y, 1, 1);
var end = start.advance(12, 'month');
return collection.filterDate(start, end).reduce(ee.Reducer.mean()).float().set('system:time_start',y).set('year',y);
}));
print(collectYear);
//年均值的时间序列展示
var Yearly_chart = ui.Chart.image.series({
imageCollection: collectYear.select('NDVI_mean'),
region: geometry,
reducer: ee.Reducer.mean(),
scale: 500,
xProperty: 'year',
}).setOptions({
interpolateNulls: true,
lineWidth: 2,
title: 'NDVI Yearly Seires',
vAxis: {title: 'NDVI'},
hAxis: {title: 'Date'},
//trendlines: { 0: {title: 'NDVI_trend',type:'linear', showR2: true, color:'red', visibleInLegend: true}}
});
print(Yearly_chart);
数据集截图:

数据表格趋势截图

CSV数据:
