0
点赞
收藏
分享

微信扫一扫

地球引擎保姆级教程——最简单的单点NDVI时序图表!

地球引擎保姆级教程——最简单的单点NDVI时序图表!_时间序列

var roi = /* color: #00ff00 */ee.Geometry.Point([-122.10067749023438, 37.43615762405059]),
var l8sr = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR");

// ndvi函数
var addNDVI = function(image) {
var ndvi = image.normalizedDifference(['B5', 'B4']).rename('NDVI');
return image.addBands(ndvi);
};

// 时间筛选和映射ndvi
var withNDVI = l8sr.filterDate('2017-01-01', '2017-12-31').map(addNDVI);

// 制图表
var chart = ui.Chart.image.series({
imageCollection: withNDVI.select('NDVI'),
region: roi,
reducer: ee.Reducer.first(),
scale: 30
});

// 定义图表的自定义选项。见。
// https://developers.google.com/chart/interactive/docs/reference
var options = {
title: 'NDVI over time',
hAxis: { title: 'time' },
vAxis: { title: 'NDVI' },
series: {
0: { color: 'green' }
}
};

// 设置图表的选项并打印。
chart = chart.setOptions(options);
print(chart);


举报

相关推荐

0 条评论