查看: 1889|回复: 1

能不能从map中进行要素的操作?

[复制链接]

该用户从未签到

发表于 2011-12-5 13:56:33 | 显示全部楼层 |阅读模式
本帖最后由 liaowei5566 于 2011-12-5 14:53 编辑

那我一个map中的一些矢量图层。能获取到modelLayer但是看例子都是这样来获取操作的    OGRFeatureOptions featureOpt;
    featureOpt.url() = filename;
    featureOpt.openWrite() = write;

    osg::ref_ptr< FeatureSource > features = FeatureSourceFactory::create( featureOpt );
只能这样弄要素图层了嘛?》、

modelLayer中的

        /**
         * Gets the initialization options for this layer.
         */
        const ModelLayerOptions& getModelLayerOptions() const { return _initOptions; }

        /**
         * Access the underlying model source.
         */
        ModelSource* getModelSource() const { return _modelSource.get(); }

怎么才能跟

osgEarth::Features::FeatureSourceFactory::create();

关联上?

        osgEarth::ModelLayerOptions pModelLayerOptions= pModelLayer->getModelLayerOptions();
       
        //抽象类
        osg::ref_ptr<osgEarth::Features::FeatureSource> pFeatureSource= osgEarth::Features::FeatureSourceFactory::create(pModelLayerOptions);

pFeatureSource = NULL;能不能从着开始搞起?

该用户从未签到

 楼主| 发表于 2011-12-5 17:05:29 | 显示全部楼层
我解决了。        osgEarth::ModelLayerOptions _ModelLayerOptions= pModelLayer->getModelLayerOptions();
        osgEarth::ModelSourceOptions _modelSourceOptions = _ModelLayerOptions.driver().get();
        osgEarth::Features::FeatureModelSourceOptions mf = _ModelLayerOptions.driver().get();
        /*std::string my = */mf.featureOptions().get()/*.url().get().full()*/;
        //抽象类
        //pfeatureSource = osgEarth::Features::FeatureSourceFactory::create(n_ogr);
        osg::ref_ptr<osgEarth::ModelSource> pModelSource= osgEarth::ModelSourceFactory::create(_modelSourceOptions);
        pfeatureSource = osgEarth::Features::FeatureSourceFactory::create(mf.featureOptions().get());
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表