ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

统计研究区内Landsat影像数量

2021-08-28 17:33:34  阅读:29  来源: 互联网

标签:ee 区内 Landsat day month year var image 影像


统计研究区内Landsat影像数量

2021-08-28 17:11:39 星期六
导出结果为数量csv文件

var ROI = ee.FeatureCollection("users/xxx/xxx");
function cloudmask(image) {
  // Remove edge pixels that don't occur in all bands
  var mask1 = image.mask().select('B.*').reduce(ee.Reducer.min());
  return image.updateMask(mask1);
}
function setImageInfo(image){
  var date = image.get("SENSING_TIME");//获取影像时间
  var year=ee.Date(date).get("year");
  image=image.set("year",year);//设置属性 年
  var month=ee.Date(date).get("month");
  image=image.set("month",month);//设置属性 月
  var day=ee.Date(date).get("day");
  image=image.set("day",day);//设置属性 日
  return image;
}
///////////////////////////////////////////////////////
//------------------Landsat5--------------------------//
var colTM2 = ee.ImageCollection("LANDSAT/LT05/C01/T1_SR")
                .filterDate('1989-01-01', '2012-05-31')
                .filterBounds(ROI)
                .map(cloudmask)
                .map(setImageInfo);
print(colTM2)
//export imageCollection information
Export.table.toDrive({
  collection:colTM2,
  description:"L5_Stat",
  fileNamePrefix:"L5_Stat",
  fileFormat:"CSV",
  selectors:["year","month","day","WRS_PATH","WRS_ROW"]});
////////////////////////////////////////////////////////
//------------------Landsat7--------------------------//
var colETM = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR")
                .filterDate('1999-01-01', '2003-05-31')
                .filterBounds(ROI)
                .map(cloudmask)
                .map(setImageInfo);
//export imageCollection information
Export.table.toDrive({
  collection:colETM,
  description:"L7_Stat",
  fileNamePrefix:"L7_Stat",
  fileFormat:"CSV",
  selectors:["year","month","day","WRS_PATH","WRS_ROW"]});
///////////////////////////////////////////////////////
//------------------Landsat8--------------------------//
var colOLI = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR")
                .filterDate('2013-01-01', '2019-12-31')
                .filterBounds(ROI)
                .map(cloudmask)
                .map(setImageInfo);
//export imageCollection information
Export.table.toDrive({
  collection:colOLI,
  description:"L8_Stat",
  fileNamePrefix:"L8_Stat",
  fileFormat:"CSV",
  selectors:["year","month","day","WRS_PATH","WRS_ROW"]});

标签:ee,区内,Landsat,day,month,year,var,image,影像
来源: https://www.cnblogs.com/icydengyw/p/15200630.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有