osgearth通过earth文件配置高程、影像、shp数据

本文介绍了一个使用osgEarth和GDAL加载地理信息文件(GeoTIFF)的示例配置。通过该配置,可以加载影像数据、高程数据及矢量数据,并设置样式效果。同时启用了文件缓存来提高数据加载效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境:vs2013+osg3.6.5+oe2.10.2

完整的earth文件配置:其中world.tif\world.shp来自oe源码的data目录下(此配置文件将data\目录下的wrold.dbf\wrold.prj\wrold.shp\wrold.shx\wrold.tif五个文件复制到world文件夹下)。world文件夹与.earth文件为同一目录。

<!-- 
osgEarth Sample - GDAL Driver
Demonstrates the simplest possible use of the GDAL driver to load a GeoTIFF image.
-->

<map>

	<!-- 影像数据 -->
    <image name="World GeoTIFF" driver="gdal">
        <url>world/world.tif</url>
    </image>
	
	<!-- 高程数据 -->
	<elevation name="World HeighField" driver="gdal">
        <url>world/world.tif</url>
    </elevation>
	
	<!-- Shp数据 -->
	<model name="National boundary" driver="feature_geom">
        <features build_spatial_index="true" driver="ogr" url="world/world.shp" />
		<styles>
			<style type="text/css">
				province_label
				{
					stroke-opacity:0.7;
					stroke-width:1;
					altitude-clamping:terrain-gpu;
					stroke:#FF8C00;
				}
			</style>
		</styles>
    </model>
	
	<!-- 文件缓存 -->
	<options>
		<overlay_blending>true</overlay_blending>
		<cache type="filesystem">
			<path>./.cache</path>
		</cache>
	</options>
	
</map>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值