欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

利用Google Earth Engine进行地形分析:计算坡度与坡向

最编程 2024-02-12 17:19:36
...
在var roi = ee.FeatureCollection("users/lilei655123/Ningxia");
Map.centerObject(roi,7)
//研究区自己定义为roi
//SRTM
var srtm = ee.Image('USGS/SRTMGL1_003');

var elevation = srtm.select('elevation').clip(roi);
//计算坡度
var slope = ee.Terrain.slope(elevation).clip(roi);
//计算坡向
var aspect = ee.Terrain.aspect(srtm);
// 将坡向值拉伸到-1————1之间
//-1代表正西、1代表正东方向
var asImage = aspect.divide(180).multiply(Math.PI).sin().clip(roi);
Map.addLayer(slope, {min: 0, max:30}, 'slope');//坡度
Map.addLayer(asImage, {min:-1,max:1}, 'asImage')//坡向
print(slope,'slope')
下载DEM
Export.image.toDrive({
image: elevation,
description: 'elevation',
scale: 30,
maxPixels: 1e13,
region:roi,
fileFormat: 'GeoTIFF',
});
Export.image.toDrive({
image: slope,
description: 'slope',
scale: 30,
maxPixels: 1e13,
region:roi,
fileFormat: 'GeoTIFF',
});
Export.image.toDrive({
image: asImage,
description: 'asImage',
scale: 30,
maxPixels: 1e13,
region:roi,
fileFormat: 'GeoTIFF',
});