抛砖引玉,贵州省地形分析,初探试试。
import aie
aie.Authenticate()
aie.Initialize()
1、导入数据
## 加载贵州省省界
feature_collection = aie.FeatureCollection('China_Province') \
.filter(aie.Filter.eq('province', '贵州省'))
geometry = feature_collection.geometry()
map = aie.Map(
center=geometry.getCenter(),
height=800,
zoom=5
)
vis_params = {
'color': '#ff150e'
}
map.addLayer(
geometry,
vis_params,
'geometry',
bounds=geometry.getBounds()
)
map
2、加载dem数据
import aie
aie.Authenticate()
aie.Initialize()
## 加载DEM数据
dataset = aie.ImageCollection('JAXA_ALOS_AW3D30_V3_2') \
.filterBounds(geometry) \
.limit(100)
imgs = dataset.select(['DSM'])
vis_params = {
'bands': 'DSM',
'min': 0,
'max': 3000,
'palette': [
'#0000ff', '#00ffff', '#ffff00', '#ff0000', '#ffffff'
]
}
map.addLayer(
imgs,
vis_params,
'Elevation',
bounds=imgs.getBounds()
)
map
3、镶嵌
## 镶嵌,ImageCollection转Image
mosaic_image = imgs.mosaic()
print(mosaic_image.getInfo())
4、裁剪
## 裁剪
result_image = mosaic_image.clip(geometry)
map.addLayer(
result_image,
vis_params,
'Elevation',
bounds=result_image.getBounds()
)
map
AIE蛮好用的,这个案例很简单的,希望大家以后可以开发出更多的。