首页 > 其他 > 详细

统计研究区内Landsat影像数量

时间:2021-08-30 07:13:38      阅读:28      评论:0      收藏:0      [点我收藏+]

统计研究区内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"]});

统计研究区内Landsat影像数量

原文:https://www.cnblogs.com/icydengyw/p/15200630.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!