抛砖引玉,贵州省地形分析,初探试试。
import aie
aie.Authenticate()
aie.Initialize()
## 加载贵州省省界
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
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
## 镶嵌,ImageCollection转Image
mosaic_image = imgs.mosaic()
print(mosaic_image.getInfo())
## 裁剪
result_image = mosaic_image.clip(geometry)
map.addLayer(
result_image,
vis_params,
'Elevation',
bounds=result_image.getBounds()
)
map