GEE下载研究区DEM代码

2023-10-16 19:03:12 浏览数 (3)

代码语言:javascript复制
var dataset = ee.Image('USGS/SRTMGL1_003');

var elevation = dataset.select('elevation');

var data = ee.FeatureCollection("projects/ee-1261423515/assets/EHE"); // 改为你上传至GEE上的数据地址

var roi = data.geometry(); // 获取ROI的几何信息

Map.centerObject(data, 8);
Map.addLayer(data, {color: 'FF0000', fillColor: '00000000', width: 1}, "ROI");

var SA_DEM = elevation.clip(roi); // 使用roi对高程数据进行裁剪

print(SA_DEM,'elevation');

Map.addLayer(SA_DEM,{min:0,max:3000},'StudyArea');

Export.image.toDrive({
  image:SA_DEM,
  description:'STRMDEM',
  scale:30,
  region:roi,
  maxPixels:1e13
});

如果你想要下载研究区范围内的矩形区域的图像,可以用下面的代码

代码语言:javascript复制
var dataset = ee.Image('USGS/SRTMGL1_003');
var elevation = dataset.select('elevation');

var data = ee.FeatureCollection("projects/ee-1261423515/assets/EHE");
var roi = data.geometry().bounds(); // 获取ROI的边界矩形范围

Map.centerObject(data, 8);
Map.addLayer(data, {color: 'FF0000', fillColor: '00000000', width: 1}, "ROI");

var SA_DEM = elevation.clip(roi); // 使用roi对高程数据进行裁剪

print(SA_DEM,'elevation');

Map.addLayer(SA_DEM,{min:0,max:3000},'StudyArea');

Export.image.toDrive({
  image:SA_DEM,
  description:'STRMDEM',
  scale:30,
  region:roi,
  maxPixels:1e13
});

0 人点赞