自己利用公司的数据发布了一个三维rest服务,想获取里面的数据,可以将Scene里面的数据显示出来,但是我拿不到三维data的数据,按照java api的文档去操作,但一直返回null,求给用java api获取三维数据的案例 RestRealspaceProviderSetting restRealspaceProviderSetting = new RestRealspaceProviderSetting(); restRealspaceProviderSetting.restServiceRootURL = "http://localhost:8090/iserver/services/3D-HaiRunChangJing/rest"; restRealspaceProviderSetting.userName="tyd2020"; restRealspaceProviderSetting.password="Tyd333666"; RestRealspaceProvider restRealspaceProvider = new RestRealspaceProvider(restRealspaceProviderSetting); //加入服务者集合 List<RealspaceProvider> listRealspaceProvider = new ArrayList<>(); listRealspaceProvider.add(restRealspaceProvider); RealspaceContext realspaceContext = new RealspaceContext(); realspaceContext.setProviders(listRealspaceProvider); //连接上下文 Realspace realspaceImpl = new RealspaceImpl(realspaceContext); //获取当前提供者的所有三维的名称和类型 List<RealspaceDataInfo> listRealspaceDataInfo = restRealspaceProvider.getDataInfos(); for (RealspaceDataInfo realspaceDataInfo:listRealspaceDataInfo) { System.out.println(realspaceDataInfo.dataName); System.out.println(realspaceDataInfo.dataType); } //restRealsceneProdevir支持操作Sceneinfo 和 data,但不知道操作 System.out.println("名称为"+realspaceImpl.getSceneNames()); /*List<String> listSceneinfo = realspaceImpl.getSceneNames(); for (String scname:listSceneinfo) { System.out.println("发布名称为:"+scname); SceneInfo sceneInfo = realspaceImpl.getSceneInfo(scname); //System.out.println(sceneInfo.layers); for (Layer3D layer3D: sceneInfo.layers) { System.out.println(layer3D.dataName); System.out.println(layer3D.layer3DType); System.out.println(layer3D.maxVisibleAltitude); System.out.println(layer3D.minVisibleAltitude); System.out.println(layer3D.visibleDistance); System.out.println(layer3D.editable); System.out.println(layer3D.level); System.out.println(layer3D.oldCache); System.out.println(layer3D.dataConfigPath); } }*/ //获取版本号 String test = realspaceImpl.getDataVersion("建筑@建筑",10,10,-1,".png"); System.out.println(test); //获取配置文件 /*byte[] bytes = realspaceImpl.getDataConfig("Building@CBD"); for (byte bytet:bytes) { System.out.println("配置文件是:"+bytet); }*/ System.out.println("数据是否可用:"+realspaceImpl.isDataAvailable("建筑@建筑")); RealspaceDataParam dataParam = new RealspaceDataParam(); //dataParam.dataName="海润场景";//对应三维图层的名称 //dataParam.dataFindType=DataFindType.FINDBYBOUNDS;//根据文件路径获取瓦片数 //dataParam.bounds=; //dataParam.level=-1; //dataParam.relativePath=""; //dataParam.dataVersion= //dataParam.relativePathType=RelativePathType.Config; //dataParam.xIndex=10; //dataParam.yIndex=20; RealspaceDataResult realspaceDataResult = realspaceImpl.getData(dataParam); System.out.println(realspaceImpl.getData(dataParam)); }
您好,可以使用iserver rest api请求去或者到scene里面的场景数据。 具体地址:http://support.supermap.com.cn/DataWarehouse/WebDocHelp/iServer/index.htm 具体目录:API参考--REST API--services--root--3D
这里面需要填充什么数据类型才能获取到三维里面的详细数据啊