Google Earth Engine(GEE)预处理landsat影像

var geometry = 
    /* color: #0b4a8b */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[77.07373046875, 38.84382273520147],
          [77.07373046875, 35.928922837806645],
          [82.47900390625, 35.928922837806645],
          [82.47900390625, 38.84382273520147]]], null, false),
    sandPer = ee.Image("OpenLandMap/SOL/SOL_SAND-WFRACTION_USDA-3A1A1A_M/v02");
/**
 * Using landsat8 data, extract indexes and study certain geographical phenomena
 * And because of the lack of necessary data, the script cannot run successfully directly
 * 
 * Saibo Li
 * Update 20191119
 * 
 * ------------------------------
 * 1、It is recommended to refer to the algorithm in the script. 
 * The data in the script is test data. 
 * It is recommended not to use the direct running results for other purposes.
 * 
 * 2、Lack of relevant data(trainpoint* and so on)
 */
Map.setOptions("SATELLITE");
Map.centerObject(geometry,5)
Map.addLayer(geometry, {color: "black",optional:1},'geometry');
 
//Landsat8 SR数据去云
function rmCloud(image) {
  var cloudShadowBitMask = (1 << 3);
  var cloudsBitMask = (1 << 5);
  var qa = image.select("pixel_qa");
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
                 .and(qa.bitwiseAnd(cloudsBitMask).eq(0));
  return image.updateMask(mask);
}

//缩放
function scaleImage(image) {
  var time_start = image.get("system:time_start");
  image = image.multiply(0.0001);
  image = image.set("system:time_start", time_start);
  return image;
}

//NDVI
function NDVI(image) {
  return image.addBands(
    image.normalizedDifference(["B5", "B4"])
         .rename("NDVI"));
}
var l8Col = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR")
              .filterBounds(geometry)
              .filterDate("2015-02-01", "2015-9-30")
              .filter(ee.Filter.lte("CLOUD_COVER", 50))
              .map(rmCloud)
              .map(scaleImage)
              .map(NDVI);
              
l8Col = l8Col.qualityMosaic("NDVI").clip(geometry)

在用上述代码的时候请引用以下文献:

Fan, Z.; Li, S.; Fang, H. Explicitly Identifying the Desertification Change in CMREC Area Based on Multisource Remote Data. Remote Sens. 2020, 12, 3170.

  • 作者:seibert(联系作者)
  • 发表时间:2020-11
  • 版权声明:未经站长允许,不可转载
  • 公众号转载:请在文末添加作者公众号二维码
  • 评论

    可能感兴趣内容