这个案例主要是通过筛选时间序列,选择其中两个波段,然后进行一个整体时序的影像下载,前期代码有一点问题,主要问题在于,我们应该先筛选日期和边界,然后再进行map否则会带来巨大的计算量:
之前是这个代码:
var L7 = ee.ImageCollection('LANDSAT/LE07/C01/T1_SR')
.filterDate('2002-01-01', '2014-12-31')
.map(cloudMaskL457)
.filterBounds(aoi)
.select(['B4','B7','pixel_qa'])
.map(function(a){
return a.set('year',ee.Image(a).date().get('year'));
});
改过后代码:
var aoi = ee.FeatureCollection("users/bqt2000204051/beijing");
var cloudMaskL457 = function(image) {
var qa = image.select('pixel_qa');
// If the cloud bit (5) is set and the cloud confidence (7) is high
// or the cloud shado