Google Earth Engine(GEE)提取点的土壤湿度

今天来分享下如何利用GEE提取点的土壤湿度,首先介绍一个数据集NASA/GLDAS/V021/NOAH/G025/T3H,里面包含很多数据集,包括气象、土壤、气温等数据,

Google Earth Engine(GEE)提取点的土壤湿度_第1张图片

例如:

CanopInt_inst植物冠层地表水含量、

ECanop_tavg树冠水分蒸发

ESoil_tavg裸土蒸发量

Snowf_tavg雪速率

SoilMoi0_10cm_inst土壤湿度

SoilTMP0_10cm_inst土壤温度

Tair_f_inst气温

Wind_f_inst风速

GEE调用代码如下:

var roi = /* color: #d63000 */ee.Geometry.Point([121.3664979892787, 37.45796001127996]);
// Create a chart for SoilMoi100_200cm_inst trend in point 1.
Map.centerObject(roi,7)
var dataset = ee.ImageCollection('NASA/GLDAS/V021/NOAH/G025/T3H')
          .filterBounds(roi)
          .filterDate('2006-01-01', '2016-12-31')
          .select('SoilMoi100_200cm_inst');


var radius_lst = ee.List([250, 500, 1000, 1500, 2000]);


var colByRadius = ee.List(radius_lst).map(function (radius) {


  var months = ee.List.sequence(1, 12);
  var start_year = 2006;
  var start_date = '2006-01-01';
  var end_year = 2016;
  var end_date = '2016-12-31';


  var years = ee.List.sequence( start_year, end_year);


  var ptsbuff = ee.FeatureCollection(roi).map(function (radius, bounds) {
    return function(pt) {
      pt = ee.Feature(pt);
    return bounds ? pt.buffer(radius).bounds() : pt.buffer(radius);
  };
  }(radius, false));


  var byMonthYear =  years.map(function (y) {
      return months.map(function(m) {
        var w = dataset.filter(ee.Filter.calendarRange(y, y, 'year'))
                    .filter(ee.Filter.calendarRange(m, m, 'month'))
                    .mean();
        var pointMean = w.reduceRegion(
          {reducer:ee.Reducer.first(), 
          geometry:ptsbuff, scale:500});  
     
      // set the dictionary as property and cast to an ee.Image, as setMulti returns an ee.Element.
      return ee.Feature(null).set("value",
                                  pointMean
                                    .get("SoilMoi100_200cm_inst"))
                                    .set("year",y)
                                    .set("month",m)
                                    .set("radius", radius);
      


      });
    }).flatten();


  return byMonthYear;


}).flatten();


Export.table.toDrive({collection:ee.FeatureCollection(colByRadius), description:"csvExport"})

 导出结果:

Google Earth Engine(GEE)提取点的土壤湿度_第2张图片

感谢关注,欢迎转发!

声明:仅供学习使用!

GEE demo:

https://code.earthengine.google.com/699a662afe7028ac818e03c04b3a5753

如果对你有帮助的话记得给小编点个赞!

你可能感兴趣的:(大数据,filter,java,python,google)