osgearth API编程动态建立地图的问题!
using namespace osgEarth;using namespace osgEarth::Drivers;
int _tmain(int argc, _TCHAR* argv[])
{
osg::ref_ptr<osgViewer::Viewer> viewer=new osgViewer::Viewer();
osg::ref_ptr<osg::Group> root=new osg::Group();
Map *map=new Map;
TMSOptions tms;
tms.url()="E:\\osgearth\\OSG\\data\\world.tif";
ImageLayer *layer=new ImageLayer("world",tms);
map->addImageLayer(layer);
MapNode* mapNode=new MapNode(map);
viewer->setSceneData(mapNode);
viewer->realize();
viewer->run();
return 0;
}
编译时没有错运行时就发现建立地球失败,如下图:
求指教啊!:) 没人嘛?:(:( 本帖最后由 xiaoping2753 于 2013-7-21 20:25 编辑
tms.url()="E:\\osgearth\\OSG\\data\\world.tif";
这就错了,tms是一种切片服务,怎么能直接用tif数据呢,你需要通过osgearth_package把tif数据切片后,访问生成的xml文件
如果你要直接用tif数据的话,要使用gdal替换tms 4楼正解 xiaoping2753 发表于 2013-7-21 20:24 static/image/common/back.gif
tms.url()="E:\\osgearth\\OSG\\data\\world.tif";
这就错了,tms是一种切片服务,怎么能直接用tif数据呢, ...
谢谢指教啊!:) 用GDAL库读取大的tif,可读,但性能很低,最好打包成tms库,或者处理成vpb的ive库,ive库的性能是最高的 学习了,谢谢。
页:
[1]