OSGEarth局部高清地图

1. 导出纹理

导出多张大图,大小为2的整数次幂,格式为tif,如:

x1.tif  x2.tif  x3.tif  x4.tif

2. 生成中间文件

osgdem.exe -t x1.tif -t x2.tif -t x3.tif -t x4.tif --geocentric -l 1 -o output.ive

该命令执行过程中生成被重投影过的中间文件,如

temportaryfile_1.tif
temportaryfile_2.tif
temportaryfile_3.tif
temportaryfile_4.tif

该中间文件是我们需要的数据,原有的tif文件可以删除。

根据需要重命名中间文件,可借助工具,如下:

temportaryfile_1.tif  ->  1.tif
temportaryfile_2.tif  ->  2.tif
temportaryfile_3.tif  ->  3.tif
temportaryfile_4.tif  ->  4.tif

3. 编写earth文件

<map name="Geometry Rasterizer Demo" type="geocentric" version="2">  
    <image name="world" driver="gdal">
        <url>world.tif</url>
    </image>
	
	<heightfield name = "dem" driver = "gdal">
		<url>dem/sx_astergdemv2.tif</url>
	</heightfield>
	
	<image name="detial-image" driver="composite">
		<image name="1" driver="gdal">
			<url>maps/rp/1.tif</url>
		</image>
		<image name="11" driver="gdal">
			<url>maps/rp/2.tif</url>
		</image>
		<image name="12" driver="gdal">
			<url>maps/rp/3.tif</url>
		</image>
		<image name="13" driver="gdal">
			<url>maps/rp/4.tif</url>
		</image>
	</image>
    
	<image name="earth" driver="agglite">
        <features name="earth" driver="ogr">
            <url>world.shp</url>
            <build_spatial_index>true</build_spatial_index>
        </features>

        <styles>
            <style type="text/css">
                earth {
                   stroke:             #ffff00;
                   stroke-width:       2px;
                   altitude-clamping:  terrain-drape;
                }
            </style>
        </styles>
    </image> 
	
	
	<options>
		<cache type="filesystem">
			<path>./FileCache</path>
		</cache>
	</options>
</map>

4. 生成cache

osgearth_cache.exe --seed china.earth --min-level 1 --max-level 3
osgearth_cache.exe --seed china.earth --bounds 103 30 115 35 --min-level 1 --max-level 5
osgearth_cache.exe --seed china.earth --bounds 108.5 34 109.5 35 --min-level 1 --max-level 6

逐步缩小范围,提高精度。

5. 运行测试

osgearth_viewer.exe china.earth

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值