TA的每日心情 | 难过 2021-1-18 17:02 |
---|
签到天数: 1 天 [LV.1]初来乍到
|
请问下大佬,为什么我加载shp文件的时候,有的shp文件可以在earth上显示,有的却不能显示,shp文件是没有问题的,下面是加载代码
Style style;
LineSymbol* ls=style.getOrCreateSymbol<LineSymbol>();
ls->stroke()->color()=Color::Yellow;
ls->stroke()->width()=10.0f;
style.getOrCreate<osgEarth::AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_RELATIVE_TO_TERRAIN;
style.getOrCreate<osgEarth::AltitudeSymbol>()->technique() =osgEarth::AltitudeSymbol::TECHNIQUE_DRAPE;
style.getOrCreate<osgEarth::AltitudeSymbol>()->binding() = osgEarth::AltitudeSymbol::BINDING_VERTEX;
osgEarthrivers::OGRFeatureOptions featureOptions;
featureOptions.url()="F:\\Progams\\bou2_4l.shp";
osgEarth::Drivers::FeatureGeomModelOptions geomOptions;
geomOptions.featureOptions()=featureOptions;
geomOptions.styles()=new StyleSheet();
geomOptions.styles()->addStyle(style);
geomOptions.enableLighting()=true;
ModelLayerOptions layerboundryOptions("china_boundry",geomOptions);
m_pMap->addModelLayer(new ModelLayer(layerboundryOptions)); |
|