环境: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;

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





