|
本帖最后由 warding 于 2010-11-11 09:22 编辑
可能是小问题,但对我来说是大问题。。。尴尬
我编译osgEarth完成,没有提示错误
运行自带的例子
其中osgearth_features.exe运行只有蓝色背景
控制台提示错误(部分):
/////////////////////////////////////////////////////////////////////////////
ERROR 4: `..\data\world.tif' does not exist in the file system,
and is not recognised as a supported dataset name.
[osgEarth]* GDAL: Failed to open dataset ..\data\world.tif
[osgEarth] Could not initialize TileSource for layer basemap
ERROR 4: `..\data\world.tif' does not exist in the file system,
and is not recognised as a supported dataset name.
[osgEarth]* GDAL: Failed to open dataset ..\data\world.tif
[osgEarth] Could not initialize TileSource for layer basemap
[osgEarth]* Could not get a valid profile for Layer basemap
[osgEarth]* OGR: failed to open dataset at ../data/world.shp
[osgEarth] [osgEarth::MapEngine] Could not create any imagery or heightfields f
or 1_0_0. Not building tile
ERROR 4: `..\data\world.tif' does not exist in the file system,
and is not recognised as a supported dataset name.
////////////////////////////////////////////////////////////////////////////////////////
我以为是路径问题,把例子单独跟踪运行了一下
其中-
- #include <osgEarthDrivers/gdal/GDALOptions>
- #include <osgEarthDrivers/feature_ogr/OGRFeatureOptions>
- #include <osgEarthDrivers/agglite/AGGLiteOptions>
- using namespace osgEarth;
- using namespace osgEarth::Features;
- using namespace osgEarth:rivers;
- using namespace osgEarth::Symbology;
- using namespace osgEarthUtil;
- //
- // NOTE: run this sample from the repo/tests directory.
- //
- int main(int argc, char** argv)
- {
- osg::ArgumentParser arguments(&argc,argv);
- osgViewer::Viewer viewer(arguments);
- // Start by creating the map:
- Map* map = new Map();
- // Start with a basemap imagery layer; we'll be using the GDAL driver
- // to load a local GeoTIFF file:
- GDALOptions* basemapOpt = new GDALOptions();
- basemapOpt->url() = "../data/world.tif";
- map->addMapLayer( new ImageMapLayer( "basemap", basemapOpt ) );
- // Next we add a feature layer. First configure a feature driver to
- // load the vectors from a shapefile:
- OGRFeatureOptions* featureOpt = new OGRFeatureOptions();
- featureOpt->url() = "../data/world.shp";
- .................
- }
复制代码 跟踪到GDALOptions* basemapOpt = new GDALOptions();出问题
-
- GDALOptions( const PluginOptions* opt =0L ) : TileSourceOptions( opt ),
- _interpolation( INTERP_AVERAGE )
- {
- driver() = "gdal";
- config().getIfSet( "url", _url );
- config().getIfSet( "extensions", _extensions );
- std::string in = config().value( "interpolation" );
- if ( in == "nearest" ) _interpolation = osgEarth::INTERP_NEAREST;
- else if ( in == "average" ) _interpolation = osgEarth::INTERP_AVERAGE;
- else if ( in == "bilinear" ) _interpolation = osgEarth::INTERP_BILINEAR;
- config().getIfSet( "max_data_level", _maxDataLevel);
- }
复制代码 第一句driver() = "gdal";就出错~~
不管怎么解决,感谢您看完了。。见笑 |
|