基于GEE的MODIS LST数据多时序下载

文章介绍了如何使用GoogleEarthEngine(EE)下载MODISLST数据,针对两个不同的兴趣区域(Shenyang_urban和Shenyang),进行多时序处理,然后将处理后的数据导出到GoogleDrive的GeoTIFF格式文件中。
摘要由CSDN通过智能技术生成

1.MODIS LST数据多时序下载(一)

// 定义感兴趣的区域
var roi = ee.FeatureCollection("projects/ee-wn1206/assets/shenyang_urban");
//显示研究区的位置
var styling = {color:'red',fillColor:'00000000'};
Map.addLayer(roi.style(styling),{},'roi');
Map.centerObject(roi,7);
var modisLST = ee.ImageCollection('MODIS/006/MOD11A1')
                .filterDate('2020-05-01', '2020-08-31')
                .select('LST_Day_1km')
                .filterBounds(roi)
var collection = modisLST.map(function(img){
  var date = img.get('system:time_start');
  return img.multiply(0.02).subtract(273.15).set('system:time_start', date).clip(roi);
});
var ndviVis = {
  min: 0.0,
  max: 30,
  palette: [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'
  ],
};

var LST=collection.mean()
Map.addLayer(LST,ndviVis,"ndviCol");
//导出影像数据函数,三个参数
function exportImage(image, roi, fileName) {  
   Export.image.toDrive({  
      image:image,
      description: 'LST'+fileName,  // 下载任务名称
      fileNamePrefix: 'LST'+fileName,  //影像的名称
      folder: "LSTCOL",  //在Drive中存储的文件夹名称
      scale: 1000, //空间分辨率
      region: roi,  //要下载影像的范围
      maxPixels: 1e13, //输出的最大像元数
      fileFormat:"GeoTIFF", //设置影像导出格式
      crs: "EPSG:4326"  //投影信息
  });  
} 
//获取每幅影像对应的时间
var indexList =  collection.reduceColumns(ee.Reducer.toList(), ["system:index"]).get("list");
//循环导出影像,用影像时间对其命名
indexList.evaluate(function(indexs) 
{  
  for (var i=0; i<indexs.length; i++) {  
      var image = collection.filter(ee.Filter.eq("system:index", indexs[i])) //筛选对应时间的影像
                           .first().float(); 
      exportImage(image, roi, indexs[i]); 
  }  
});

2.MODIS LST数据多时序下载(二)

// 定义感兴趣的区域
var fc = ee.FeatureCollection("projects/ee-wn1206/assets/shenyang");
Map.centerObject(fc,4)
var modisLST = ee.ImageCollection('MODIS/006/MOD11A1').filterDate('2020-05-01', '2020-08-31').select('LST_Day_1km').filterBounds(fc)

var collection = modisLST.map(function(img){
  var date = img.get('system:time_start');
  return img.multiply(0.02).subtract(273.15).set('system:time_start', date);
});

print(collection)
function exportImageCollection(imgCol) { 
  var indexList = imgCol.reduceColumns(ee.Reducer.toList(), ["system:index"]) 
                        .get("list"); 
  indexList.evaluate(function(indexs) { 
    for (var i=0; i<indexs.length; i++) { 
      var image = imgCol.filter(ee.Filter.eq("system:index", indexs[i])).first(); 
      image = image.toInt16(); 
      Export.image.toDrive({ 
        image: image.clip(fc.geometry().bounds()), 
        description: indexs[i], 
        fileNamePrefix: indexs[i], 
        region: fc.geometry(), 
        scale: 1000, 
        crs: "EPSG:4326",   
        folder: "LST1",//谷歌云盘中的文件夹名称
        maxPixels: 1e13 
      }); 
    } 
  }); 
} 
exportImageCollection(collection);
  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值