- 积分
- 3632
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-10-21
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
数字高程模型(Digital Elevation Model),简称DEM,就是下面这种图,似乎可以理解为填了伪彩色的地形图:
现在想把下图贴到GIS上:
把该图读进变量image中:
imagefile=filepath('elev_t.jpg',subdirectory=['examples','data'])
read_jpeg,imagefile,image
IMAGE BYTE = Array[3, 512, 512]
读取dem数据:
demfile=filepath('elevbin.dat',subdirectory=['examples','data'])
dem=read_binary(demfile,data_dims=[64,64])
DEM BYTE = Array[64, 64]
dem重采样:
dem=congrid(dem,128,128,/interp)
DEM BYTE = Array[128, 128]
建立窗口:
device,decomposed=0,retain=2
window,0,title='Elevation Data',xsize=400,ysize=300
单纯绘制dem:
shade_surf,dem
初始化对象:
omodel=obj_new('IDLgrModel')
oview=obj_new('IDLgrView')
owindow=obj_new('IDLgrWindow',retain=2,color_model=0,dimension=[400,300])
osurface=obj_new('IDLgrSurface',dem,style=2)
oimage=obj_new('idlgrimage',image,interleave=0,/interpolate)
计算归一化显示比例,在各个方向平移-0.5使图像居中:
osurface.getproperty,xrange=xr,yrange=yr,zrange=zr
xs=norm_coord(xr)
xs[0]=xs[0]-0.5
ys=norm_coord(yr)
ys[0]=ys[0]-0.5
zs=norm_coord(zr)
zs[0]=zs[0]-0.5
xr 0.00000000 127.00000
yr 0.00000000 127.00000
zr 0.00000000 222.00000
xs -0.50000000 0.0078740157
ys -0.50000000 0.0078740157
zs -0.50000000 0.0045045045
osurface.SetProperty,xcoord_conv=xs,ycoord_conv=ys,zcoord_conv=zs
添加纹理对象:
osurface.SetProperty,texture_map=oimage,color=[255,255,255]
omodel添加到oview:
omodel.add,osurface
oview.add,omodel
旋转:
omodel.Rotate,[1,0,0],-90
omodel.Rotate,[0,1,0],30
omodel.Rotate,[1,0,0],30
绘制oview:
owindow.draw,oview
使用xobjview查看对象:
xobjview,omodel,/block,scale=1
|
-
-
dem.pro
1.04 KB, 下载次数: 0, 下载积分: 金钱 -5
|