【发布时间】:2019-04-19 14:54:33
【问题描述】:
我正在尝试创建 3D 对象并将其加载到 Cesium 中。 我需要从各种来源以编程方式创建这些对象(通过使用一些导入转换服务,使用 .NET 平台)
我有在 THREEJS 中做这件事的经验。 我读取 DXF 文件,将实体转换为 PostGIS 几何,三角测量(从高程数据创建表面),镶嵌几何并最终构建 与 THREEJS 兼容的场景(使用 JSON 格式、Gzipped、THREE.BufferGeometry)。这很好用:加载成千上万的三角形/点没有问题。 有时我使用 webworkers 只是为了请求和解析 JSON。
此外,我能够毫无问题地将相当大的 (40mb) geojson 加载到我的 OpenLayers 客户端应用程序中(地图和 WebGLMap)
但我什至无法将 20mb geojson(折线)加载到 cesium (1.51.0) 中!
viewer.dataSources.add(Cesium.GeoJsonDataSource.load('data/geojson/test1.geojson'));
给我
An error occurred while rendering. Rendering has stopped.
RangeError: Array buffer allocation failed
RangeError: Array buffer allocation failed
at arrayBufferConstructor_DoNotInitialize (<anonymous>)
at new Float64Array (<anonymous>)
at Object.o.createTypedArray (http://localhost:9090/public/ThirdParty/Cesium/Workers/combineGeometry.js:227:18570)
at H (http://localhost:9090/public/ThirdParty/Cesium/Workers/combineGeometry.js:230:21640)
at j (http://localhost:9090/public/ThirdParty/Cesium/Workers/combineGeometry.js:230:22200)
at ne (http://localhost:9090/public/ThirdParty/Cesium/Workers/combineGeometry.js:230:30083)
at Object.ae.splitLongitude (http://localhost:9090/public/ThirdParty/Cesium/Workers/combineGeometry.js:231:7036)
at v (http://localhost:9090/public/ThirdParty/Cesium/Workers/combineGeometry.js:231:10398)
at Object.M.combineGeometry (http://localhost:9090/public/ThirdParty/Cesium/Workers/combineGeometry.js:231:13298)
at r (http://localhost:9090/public/ThirdParty/Cesium/Workers/combineGeometry.js:231:18552)
这是为什么呢? 我能做些什么? GLTF/GLB/3D 瓦片是相当复杂的格式。没有丰富的工具集可以使用这些格式自定义/控制对象创建。 我不想购买超级(真的)FME 服务器来创建 GLTF... 也许我可以使用 czml 加载复杂的几何图形,使用 polylines 等)?
【问题讨论】:
标签: 3d postgis cesium gltf czml