依赖 OSGEarth的编译还是比较简单的,首先是要获取编译的依赖。 1) OpenSceneGraph OSGEarth是OpenSceneGraph扩展库,编译过程可以参看我的另一篇文章:Win64下编译OSG详细过程(Win10+VS2015+OSG3.6.3)。 2) GDAL 通用的用于读写空间数据的一套跨平台开源库,OSGEarth很多对于空间数据的支持就是GDAL实现的。编译过程:Win64下编译集成GEOS和Proj4的GDAL。 而现在的版本应该也不用依赖QT组件,反正我是没有看到编译参数的,需要在QT中使用osgEarth的话,可以使用osgQT。 2. 参考文献 Building osgEarth osgearth编译全过程
::Map> map) { // std::string filePath = "D:/Work/OSGNewBuild/osgearth-2.10.1/data/world.shp"; osgEarth ::Map> map = new osgEarth::Map(mapOpts); osg::ref_ptr<osgEarth::MapNode> mapNode = new osgEarth::MapNode (map); osgEarth::Drivers::GDALOptions gdal; gdal.url() = "D:/Work/OSGNewBuild/osgearth-2.10.1/data /world.tif"; osg::ref_ptr<osgEarth::ImageLayer> layer = new osgEarth::ImageLayer("BlueMarble", gdal) ::Map> map = new osgEarth::Map(mapOpts); osg::ref_ptr<osgEarth::MapNode> mapNode = new osgEarth::MapNode
osgEarth最基础的就是显示一个数字地球了。 2. 实现 2.1. ::Map> map = new osgEarth::Map(mapOpts); osg::ref_ptr<osgEarth::MapNode> mapNode = new osgEarth::MapNode (map); osgEarth::Drivers::GDALOptions gdal; gdal.url() = "D:/Work/OSGNewBuild/osgearth-2.10.1/data ; //创建地图节点 osg::ref_ptr<osgEarth::Map> map = new osgEarth::Map(mapOpts); osg::ref_ptr<osgEarth::MapNode /OSGNewBuild/osgearth-2.10.1/data/world.tif"; osg::ref_ptr<osgEarth::ImageLayer> layer = new osgEarth
在osgEarth中可以不用关心这个问题,其直接封装了一个类osgEarth::GeoTransform,可以直接通过这个类的接口来加载倾斜摄影模型: std::string filePath = "D ("oblic", xform); map->addLayer(modelLayer); 给osgEarth::GeoTransform传入的osgEarth::GeoPoint就是站心点。 /ImageLayer> #include <osgEarth/Viewpoint> #include <osgEarth/GeoTransform> #include <osgEarth/ModelLayer /使用绝对高,正高 xform->setPosition(point); osg::ref_ptr<osgEarth::ModelLayer> modelLayer = new osgEarth: ; //创建地图节点 osg::ref_ptr<osgEarth::Map> map = new osgEarth::Map(mapOpts); osg::ref_ptr<osgEarth::MapNode
概述 可以通过osgEarth自带的world.tif作为数字地球的底图数据,但是效果并不是很好看。因此在网上找了两个适合作为底图的资源。 2. 详论 2.1. 蓝色弹珠系列照片已经更新了很多代,osgEarth自带的world.tif应该是初代的照片。在NASA的官网上存放了一个Blue Marble Next Generation图片的集合。 下载下来的是压缩过jpg,可以将其随软件发布,通过osgEarth显示: ? 2.2.
< endl; } void TestOE() { double L = 116.9395751953; double B = 36.7399177551; double H = 0; osgEarth ::SpatialReference *spatialReference = osgEarth::SpatialReference::create("epsg:4326"); osgEarth::GeoPoint 4 + i]); } cout << endl; } cout << endl; double x = 117; double y = 37; double z = 10.3; osgEarth 进行转换实现:" << endl; TestXYZ2ENU(); cout <<"---------------------------------------"<< endl; cout << "通过OsgEarth 进行验证:" << endl; TestOE(); } 这个示例先用Eigen矩阵库,计算了坐标转换需要的矩阵和转换结果;然后通过osgEarth进行了验证,两者的结果基本一致。
doxygen graphviz libwebkitgtk-3.0-0 sudo apt-get install libopenscenegraph-dev \ openscenegraph-plugin-osgearth
属于GISSer领域使用率较高的软件,特别是3DGIS在Web领域的无插件应用,对比其他的同类GIS引擎包括,开源的:OsgEarth,WorldWind等;商业的包括:SkylineGlobe,ArcGisGlobe 其他国内目前使用较多的引擎包括: 老牌图形厂家,一般使用:Ogre、Osg、OsgEarth、VTK、Unigine等引擎,架构相对较老,只支持CS应用,大部分此类公司会在开辟一条BS引擎线。
参考Cesium的具体实现如下: #include <iostream> //#include <eigen3/Eigen/Eigen> //#include <osgEarth/GeoData>