案例一:提取一个点的FPAR时间序列
// define a region of interst as a buffer around a point
var study = ee.Geometry.Point(116.667,43.53).buffer(1000);
// show region of interst
Map.centerObject(study,4);
Map.addLayer(study,{},'study');
// load MODIS image
var image = ee.ImageCollection('MODIS/006/MOD15A2H')
.filterDate('2002-01-01', '2010-12-31')
.filterBounds(study)
.select('Fpar_500m');
// create the chart
var chart = ui.Chart.image.series({
imageCollection: image,
region: study,
reducer: ee.Reducer.mean(),
scale: 1000
});
// print the chart
print(chart);
案例二:提取数个点的GPP
// define a region of interst as a buffer around a point
var YY = ee.Feature( ee.Geometry.Point(112.93, 29.53).buffer(1000), {label: 'YY'});
var AQ = ee.Feature( ee.Geometry.Point(116.98, 30.48).buffer(1000), {label: 'AQ'});
var study = new ee.FeatureCollection([YY,AQ]);
// show region of interste
Map.centerObject(study,4);
Map.addLayer(study,{},'study');
// load MODIS data
var collection = ee.ImageCollection('MODIS/006/MOD17A2H')
.filterDate('2002-01-01', '2010-12-31')
.filterBounds(study)
.map(calculat);
// calculate
function calculat(image) {
var cal = image.expression(
'band*0.1', //formula
{
band: image.select('Gpp'),
});
return ee.Image(cal.copyProperties(image)).set('system:time_start', image.get('system:time_start'));
}
// create the time series chart
var chart = ui.Chart.image.seriesByRegion({
imageCollection: collection,
regions: study,
reducer: ee.Reducer.mean(),
scale: 1000,
seriesProperty:'label'})
.setOptions({
title:'GPP over time in flux station',
vAxis:{title:'GPP'},
lineWidth:1,
});
// print the chart
print(chart);
参考资料
GEE知乎专栏
GEE学习资料
提取时间序列数据