GEE20:获取地面站点的遥感图层的采样值

获取采样点值

  • 1. 介绍
  • 2. GEE实现
    • 2.1 数据介绍
    • 2.2 GEE code
  • 3.参考

1. 介绍

  去年由于实验需要,想通过GEE获取遥感图层的采样值,但是多次尝试后任无法实现。最近通过查询,终于找到的获取采样点的方法,现在将其记录在此,并与大家分享。
GEE20:获取地面站点的遥感图层的采样值_第1张图片

2. GEE实现

  首先是需要导入你的采样点的文件,其中主要包括了经纬度。
  接下来,就可以通过导入的采样点进行数据提取了,在这里主要是提取2022年逐月的地表温度值(LST)。

2.1 数据介绍

地表温度LST:
  The MOD21C2 dataset is an 8-day composite LST product that uses an algorithm based on a simple averaging method. The algorithm calculates the average from all the cloud free MOD21A1D and MOD21A1N daily acquisitions from the 8-day period. Unlike the MOD21A1 data sets where the daytime and nighttime acquisitions are separate products, the MOD21A2 contains both daytime and nighttime acquisitions. The LST, Quality Control (QC), view zenith angle, and viewing time have separate day and night bands, while the values for the MODIS emissivity bands 29, 31, and 32 are the average of both the nighttime and daytime acquisitions.

GEE20:获取地面站点的遥感图层的采样值_第2张图片

地表覆盖图:
  The European Space Agency (ESA) WorldCover 10 m 2020 product provides a global land cover map for 2020 at 10 m resolution based on Sentinel-1 and Sentinel-2 data. The WorldCover product comes with 11 land cover classes and has been generated in the framework of the ESA WorldCover project, part of the 5th Earth Observation Envelope Programme (EOEP-5) of the European Space Agency.

GEE20:获取地面站点的遥感图层的采样值_第3张图片

地形图:
  The Shuttle Radar Topography Mission (SRTM) digital elevation dataset was originally produced to provide consistent, high-quality elevation data at near global scope. This version of the SRTM digital elevation data has been processed to fill data voids, and to facilitate its ease of use.

GEE20:获取地面站点的遥感图层的采样值_第4张图片

2.2 GEE code

var roi = 
    ee.Geometry.Polygon(
        [[[105.13836035633825, 32.02577928909809],
          [105.13836035633825, 28.49669989421675],
          [110.22503027821325, 28.49669989421675],
          [110.22503027821325, 32.02577928909809]]], null, false);
var roi_bound = ee.Image().toByte()
                  .paint({featureCollection: ee.FeatureCollection(roi), color:0, width: 3});
Map.addLayer(roi_bound, {palette: "black"}, 'roi boundary');

var points = ee.FeatureCollection("projects/ee-ypzh736/assets/points")
                .aside(print) // 导入本地上传的站点信息
                .map(function(fea){
                  return ee.Feature(ee.Geometry.Point([fea.get('LON'),fea.get('LAT')]))//设置经纬度
                           .copyProperties(fea)//拷贝原有属性信息
                }).aside(print)

Map.centerObject(points)
Map.addLayer(points.style({color:'red',pointSize:5}),{},'randomPoints')

// --------------------------------------
// 获取2022年1-12月逐月LST数据
var originDate = ee.Date('2022-01-01')
var advance_list = ee.List.sequence(0, 11, 1)
var LST_list = advance_list.map(function(adv){
  var startDate = originDate.advance(adv,'month');//当前的开始日
  var endDate = startDate.advance(3,'month');//当前的结束日
  return  ee.ImageCollection("MODIS/061/MOD21C2")//地表温度数据
                  .filterDate(startDate,endDate)//时间过滤
                  .select('LST_Day')//日间平均地温
                  .mean()
                  .clip(roi);
                   
})//.aside(print)  

var imageLayers =  ee.Image(ee.ImageCollection("ESA/WorldCover/v100").first()) //地表覆盖度图
                      .addBands(ee.Image('CGIAR/SRTM90_V4').select('elevation'))//高程数据
                      .rename(['LandCover','DEM'])// 波段重命名
                      .addBands(ee.ImageCollection.fromImages(LST_list).toBands())//将逐月LST数据转为波段
                      //.aside(print)

// -----------------------------------
var sample_points = imageLayers.sampleRegions({
  collection: points,
  scale:20,//A nominal scale in meters of the projection to sample in. If unspecified,the scale of the image's first band is used.
  geometries:true //注意,这个geometries属性要加上,如果不加上,结果不会有地理坐标
})
print('sample_points',sample_points)

// 导出数据至Google drive
Export.table.toDrive({
    collection: sample_points,
    description: 'sample_points_LST',
    fileFormat: 'CSV',
    folder: "LUCC"
  });

结果展示(共计100个点):

GEE20:获取地面站点的遥感图层的采样值_第5张图片
GEE20:获取地面站点的遥感图层的采样值_第6张图片

数据展示:

完整代码链接: https://code.earthengine.google.com/2b9958563b3101efd8cee2c4829c79cd

3.参考

  • GEE获取地面站点的取样值(附完整代码)

你可能感兴趣的:(GEE,经验分享,GEE,云计算,javascript,GIS,遥感)