首页 / 浏览问题 / 组件GIS / 问题详情
linux服务器下,objectJava可以生成三维缓存吗?
256EXP 2020年08月21日

请问在linux环境下,objectJava组件可以生成三维切片缓存吗?

以及对显卡的要求是怎么样的?如下所示的显卡,满足要求吗?

生成场景缓存,导致java崩溃。

Stack: [0x00007fc62b800000,0x00007fc62c000000],  sp=0x00007fc62bffd368,  free space=8180k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libstdc++.so.6+0x7517a]
C  [libosg.so.100+0x32487a]  std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_get_insert_unique_pos(std::string const&)+0x10e
C  [libosg.so.100+0x32422d]  std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::string const, std::string> >, std::string const&)+0xdf
C  [libosg.so.100+0x323e35]  std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<std::string const, std::string> >, std::pair<std::string const, std::string> const&)+0x3d
C  [libosg.so.100+0x323a44]  std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::insert(std::_Rb_tree_iterator<std::pair<std::string const, std::string> >, std::pair<std::string const, std::string> const&)+0x3e
C  [libosg.so.100+0x323605]  std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::operator[](std::string const&)+0xed
C  [libosgDB.so.100+0x218e2c]  osgDB::Options::setPluginStringData(std::string const&, std::string const&) const+0x2e
C  [libosgDB.so.100+0x218c22]  osgDB::Options::parsePluginStringData(std::string const&, char, char)+0xfa
C  [libSuFileParser3DModel.fps+0x55c2f]  UGC::UGOSGToolkit::SaveNodeFile(UGC::UGRenderOperationGroup*, OGDC::OgdcUnicodeString)+0x18f

1个回答

你好,请问您的代码在Windows下能否正常执行呢,方便的话也可以将您的代码发一下,我这边看一下
2,842EXP 2020年08月24日

你好,windows下能够正常执行。

objectJava是9.1.2版本。

    /**
     * 场景缓存构建
     *
     * @param scene         场景
     * @param output        输出路径
     * @param workspaceName 工作空间名称
     * @return
     */
    private Boolean SceneCacheBuild(Scene scene, Path output, String workspaceName) {
        Boolean flag = false;
        SceneCacheBuilder builder = null;
        try {
            //1.三维数据集图层设置
            Layer3Ds layer3Ds = scene.getLayers();
            System.out.println("场景中图层数量:" + layer3Ds.getCount());
            ArrayList<String> layerNames = new ArrayList<String>();
            for (int i = 0; i < layer3Ds.getCount(); i++) {
                Layer3D layer3D = layer3Ds.get(i);
                if (layer3D.getType() == Layer3DType.DATASET) {
                    Layer3DDataset layer3DDataset = (Layer3DDataset) layer3D;
                    layer3DDataset.setFileType(CacheFileType.S3M);//缓存文件类型
                    layer3DDataset.setTileWidth(2000);//瓦片宽度
                    layer3DDataset.setIsBuildOSGBCache(true);//三维切片缓存,不然会生成矢量缓存
                    if (layer3DDataset.getDataset().getType() != DatasetType.NETWORK3D) {
                        layer3DDataset.setBuildOSGBPipeCache(true);//生成管线缓存
                    }
                    layer3DDataset.setFilterPixelSize(2);//像素过滤值,提升显示性能
                    layer3DDataset.setLODCount(0);//部分管点符号模型存在压缩变形,这个参数是超图给出的解决方式
                    layerNames.add(layer3D.getName());
                    scene.ensureVisible(layer3D);
                }
            }
            System.out.println("场景中三维自定义专题图层数量:" + layerNames.size());
            if (layerNames.size() == 0) {
                return false;
            }
            //2.场景缓存生成参数
            builder = new SceneCacheBuilder(scene, output.toString());
            builder.setCompressedTextureType(CompressedTextureType.DDS);//压缩方式,PC
            builder.setProcessThreadsCount(8);//处理线程
            builder.setStorageType(StorageType.Original);//存储方式,原始
            builder.setIsCalNormal(false);
            builder.setIsInstance(true);

//            Point2D[] pts = new Point2D[]{rectangle2D.leftBottom,rectangle2D.rightTop};
//            Point2Ds te2DS = new Point2Ds(pts);
//            CoordSysTranslator.forward(te2DS, PrjCoordSys.fromEPSG(EPSGCode));
//            Rectangle2D rectangle2DProj = new Rectangle2D(te2DS.getItem(0), te2DS.getItem(1));
//            builder.setBounds(rectangle2DProj);//设置范围
//            builder.setBoundsCeiled(true);
            //2.1 设置需要生成缓存的普通图层和地形图层
            String[] layerNameArr = layerNames.toArray(new String[]{});
            builder.setOutputLayerNames(layerNameArr);//三维自定义图层
            builder.setOutputTerrainLayerNames(null);//地形图层不生成
            //2.2 场景和工作空间输出参数
            builder.setOutputSceneName(sceneName);//设置新生成的场景名称
            Path path = Paths.get(output.toString(), workspaceName + ".smwu");//*工作空间路径
            connectionInfo.setServer(path.toString());//工作空间路径
            builder.setOutputWorkspaceConnectionInfo(connectionInfo);
            //2.3 开始生成缓存
            flag = builder.build();
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return false;
        } finally {
            builder.dispose();
            builder = null;
        }
        return flag;
    }

你这个应该是页面的程序吧,你的Linux系统也是有页面的系统吗
?这就是java代码啊,直接通过命令行启的jar包。
我这边试了下,运行你的代码是没有问题的。你的Windows 版本的组件和Linux的是否一致,以及jdk版本是否一致呢
你好,您可以私信我,发一下你的联系方式,我这边给您远程看一下
...