1.Osgdem运行例子所需数据下载地址:

http://www.cc.gatech.edu/projects/large_models/ps.html

Download Elevation Map: 16385 × 16385 PNG: 188MB 
Download Texture Map: 16384 × 16384 PNG: 268MB

2.GDAL对高程数据和影像数据格式化处理:

gdal_translate ps_height_16k.png ps_height_16k.tif

gdaladdo -r average ps_height_16k.tif 2 4 8 16 32

gdal_translate ps_texture_16k.png ps_texture_16k.tif

gdaladdo -r average ps_texture_16k.tif 2 4 8 16 32

3.使用osgdem命令生成模型文件

osgdem --xx 10 --yy 10 -t ps_texture_16k.tif \ 
--xx 10 --yy 10 -d ps_height_16k.tif \ 
-l 8 -v 0.1 -o puget.ive -a pegout.osga

Microsoft Windows [版本 10.0.17134.984]
(c) 2018 Microsoft Corporation。保留所有权利。

C:\Windows\System32>e:

E:\>
E:\>
E:\>
E:\>cd E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data

E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>gdal_translate ps_height_16k.png ps_height_16k.tif
Input file size is 16385, 16385
0...10...20...30...40...50...60...70...80...90...100 - done.

E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>gdaladdo -r average ps_height_16k.tif 2 4 8 16 32
0...10...20...30...40...50...60...70...80...90...100 - done.

E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>gdal_translate ps_texture_16k.png ps_texture_16k.tif
Input file size is 16384, 16384
0...10...20...30...40...50...60...70...80...90...100 - done.

E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>gdaladdo -r average ps_texture_16k.tif 2 4 8 16 32
0...10...20...30...40...50...60...70...80...90...100 - done.

E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>osgdem --xx 10 --yy 10 -t ps_texture_16k.tif --xx 10 --yy 10 -d ps_height_16k.tif -l 8 -v 0.1 -o puget.ive -a pegout.osga
Warning: archive option -a is temporarily disabled, building with archive.
--xx 10
--yy 10
-t ps_texture_16k.tif
ADD: ps_texture_16k.tif
loaded layer ps_texture_16k.tif

E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>
E:\OpenSourceGraph\VirtualPlanetBuilder_0_9_install\data>

参考:https://www.cnblogs.com/eaglezhao/archive/2011/09/26/2192374.html

05-26 11:27