zoukankan      html  css  js  c++  java
  • 统计研究区内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"]});
    
  • 相关阅读:
    js中for循环点击事件(闭包)
    浏览器缩放,会导致布局打乱,解决方法?/一缩小网页布局就打乱了怎么办?
    新手如何理解JS面向对象开发?
    PHP超全局变量$_SERVER
    个人网站(sysoft.net.cn)被k,公司名都搜索不出来了,怎么办?
    松软带你学开发-SQLSELECTDISTINCT语句
    Tomcat内存监控及调优
    JAVA概述 也许你会豁然开朗
    Java programming problems
    Summary of Java basics review data
  • 原文地址:https://www.cnblogs.com/icydengyw/p/15200630.html
Copyright © 2011-2022 走看看