• 统计研究区内Landsat影像数量


    统计研究区内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"]});
    
  • 相关阅读:
    五、excel末尾补0和开头补0
    MYSQL查询前30条数据
    MYSQL数据库从A表把数据插入B表
    测试用例大全
    EXTJS 5.0 资料
    fs event_socket
    centos 编译swoole
    Valgrind简单用法
    linux 大并发下 内核优化
    FS拓展设置
  • 原文地址:https://www.cnblogs.com/icydengyw/p/15200630.html
Copyright © 2020-2023  润新知