GEE显示并下载研究区sentinel-1影像

var geometry = 
    ee.Geometry.Polygon(
        [[[121.90456654564989, 40.65237240724255],
          [121.90456654564989, 40.46456998182115],
          [122.08584095971239, 40.46456998182115],
          [122.08584095971239, 40.65237240724255]]]);//自己在地图上勾画出研究区后会直接import,这个研究区域的范围可自行更改

var roi=ee.Image()
          .toByte()
          .paint({
            featureCollection:geometry,
            color:0,
            width:2
    
});

// 设置日期范围
var startDate = '2023-02-01';
var endDate = '2023-02-10';

// 导入 Sentinel-1 数据集
var sentinel1 = ee.ImageCollection("COPERNICUS/S1_GRD")
  .filterBounds(geometry) // 过滤研究区域内的影像
  .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
  .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
  .filter(ee.Filter.eq('instrumentMode', 'IW'))
  .filterDate(startDate, endDate) // 指定时间范围
  .sort('system:time_start'); // 按时间升序排序

// 获取最新影像
var latestImage = sentinel1.first();


// 创建一个可视化参数
var visParams = {
  bands: ['VV', 'VH'],  // 选择显示的波段
  min: -25,  // 最小亮度值
  max: 5,    // 最大亮度值
  gamma: 1.2  // 伽马校正参数
};

// 合成多个影像成一幅影像,如果研究区域涉及多幅影像的话会用到
var composite = sentinel1.mosaic();

// 裁剪合成影像到指定几何范围
var S_image = composite.clip(geometry);


// 在地图上显示合成影像
Map.centerObject(geometry, 8);  // 设置地图中心和缩放级别
Map.addLayer(S_image, visParams, 'S_image');
//Map.addLayer(composite, visParams, 'composite');
Map.addLayer(sentinel1, visParams, 'Sentinel-1');//显示整幅影像



Map.addLayer(roi,{palette:"blue"},"roi");//显示边框


//时间
var timeLabel = ee.String('Image Time: ')
  .cat(ee.Date(latestImage.get('system:time_start')).format('YYYY-MM-dd'));
  
// 打印合成影像信息
print("Sentinel-1 Image Information:", S_image);
print("Day",timeLabel);


//导出
Export.image.toDrive({
    image:S_image.select(['VV','VH']),//如果不select的话会报错数据格式不兼容,因为angle的数据类型是float
    description:'S_image',
    scale:10,
    region:geometry,
    fileFormat:'GeoTIFF',
    crs: "EPSG:4526",
    maxPixels:1e13
});


新手刚开始学习GEE,在这里做个专栏用以记录和分享

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

唐唐唐吖

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

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

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

打赏作者

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

抵扣说明:

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

余额充值