|
请问我在osgearth中加载了一个地名的shp数据,我看了osgearth_featurequerry的例子,但是里面需要通过鼠标点一下才能获取相应的矢量数据的信息,现在我想用程序自动就获取加载到地球中的shp数据的属性信息该怎么办呢?
下面是我加载shp数据的代码,请大家积极拍砖
osgEarth:rivers::OGRFeatureOptions featureOptions;
featureOptions.url()="F:/osgearth/bin/data/wolddata/landlable/land.shp";
osgEarth::Drivers::FeatureGeomModelOptions geomOptions;
geomOptions.featureOptions()=featureOptions;
geomOptions.styles()=new StyleSheet();
geomOptions.styles()->addStyle(style);
geomOptions.enableLighting()=false;
ModelLayerOptions layerOptions("china_boundaries",geomOptions);
map->addModelLayer(new ModelLayer(layerOptions)); |
|