GEE 统计影像覆盖次数

以下为利用GEE统计Sentinel-1影像覆盖次数的代码,统计了每月的情况。

注意roi的赋值geometry5是之前就提供的范围变量,可以在代码运行之前就手动编辑。

可以采用

ee.Geometry.BBox(aoi['xmin'], aoi['ymin'], aoi['xmax'], aoi['ymax']),

 来赋值,但是我发现如果我用这个下面的Map.addLayer(roi, {'color':'grey'}, 'studyArea');就报错,当鼠标放在上方代码,就可以把它转为一个全局?变量,就是像你自己编辑好的那样,下面的Map之类的我也去掉了,否则还是会报错。

另外我希望只在纬度上控制因此应该是:-180,60,180,90的写法。



// set study area table 就是roi
var roi = geometry5;

// Map.addLayer(roi, {'color':'grey'}, 'studyArea');
// Map.centerObject(roi,2);//可以改变缩放等级

var year_start = 2018; //设定年份
var year_end = 2018;
var month=3;

var imgCol = ee.ImageCollection("COPERNICUS/S1_GRD")
              .filterBounds(roi)
              .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'HH'))
              .filter(ee.Filter.eq('instrumentMode', 'EW'))
              .filter(ee.Filter.calendarRange(year_start, year_end,'year')).filter(ee.Filter.calendarRange(month,month,'month'));

// compute the image total size
// var imgSize = imgCol.size();
// print("imgSize",imgSize);

/*****************************************************************
compute the image avaibility. There are several ways to achieve that.
1: use the count function
2: use the sum function
******************************************************************/
var imgCount_V1 = imgCol.select("HH").count().clip(roi);


// define image render parameters
var visParam = {
 min: 0,
 max: 10,
 palette: '#00c82d, #15cc2d, #95e11d, #d4d900, #ffae18, #ff6a30, #f53031, #f53031'};

Map.addLayer(imgCount_V1,visParam,"imgCount_V1");

Export.image.toDrive({
    image: imgCount_V1,
    description: "S1_201803_imagecount",
    fileNamePrefix: "S1_201803_imagecount",
    region: imgCount_V1.geometry().getInfo(),
    crs: "EPSG:3413",   //坐标系参数,32650表示WGS_1984_UTM_Zone_50N
    scale: 1000,
    maxPixels: 1e13
});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

就是一只白

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值