osgb转Cesium 3D tiles工具

Cesium学习资料 · devhu · 于 5年前 发布 · 38491 次阅读

目前Cesium不支持直接加载倾斜摄影的OSGB数据:

https://www.oschina.net/question/104733_2198017

但是可以通过转换将OSGB数据转换成Cesium可以加载的数据格式。

目前Cesium自己定义支持最好的格式应该是:3D Tiles。这种格式处于发展阶段还不够成熟。但是基于官方的一些Demo可以发现效果还是非常不错的。

3D Tiles在逻辑层,也就是JSON部分增加了FeatureTable和BatchTable,以及LOD(tileset)概念,并对应提供了header(二进制存储)。从数据规范角度来看,继承了glTF优秀的部分,同时考虑了倾斜,点云,后续也会支持OSM,从数据类型的支持上也比较到位。

3D Tiles = glTF + LOD

https://www.cnblogs.com/fuckgiser/p/6565957.html

在开发过程中,通过网上搜索发现了开发者分享出来的一些转换工具:

https://www.v2ex.com/t/402321

https://blog.csdn.net/qq_37796475/article/details/79221939

经过测试发现:

https://download.csdn.net/download/qq_37796475/10274378 这个工具的效果不错。

建议大家支持这个工具的分享作者,去CSDN下载,如果有需要,也可以留言邮箱,分享给您。

本文由 devhu 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。

共收到 16 条回复 osgb cesium
devhu#15年前 2 个赞

下载转换工具之后,目录中自带一张操作示例图,如果大家有不明白的地方可以进行留言。

2楼 已删除.
admin#35年前 0 个赞

挺好的,根据楼主的方法目前测试结果如下:

原生的osgb数据预览

转换之后的数据通过Cesium加载

fanvanzh#45年前 0 个赞

这个有个数限制,不好用, 可以参照我的 github 项目: https://github.com/fanvanzh/3dtiles

admin#55年前 0 个赞

目前我还没遇到个数限制哈,我大概800MB的数据,转换一点问题没有,不过也推荐这位朋友自己开源的项目: https://github.com/fanvanzh/3dtiles

admin#65年前 0 个赞

另一种开源工具: 参考链接: https://github.com/fanvanzh/3dtiles

3dtiles

Build status

The fastest tools for 3dtiles convert in the world!

include these tools:

osgb => 3dtile , convert huge of osgb file to 3dtiles.

shapefile => 3dtile, convert shape file to 3dtiles.

fbx => 3dtile, convert fbx file to 3dtile, include auto_lod\texture convert etc..

How to build / 编译指南

How to debug / vs调试指南

Windows pre-build / 预编译下载

3dtile 转换工具集。

世界上最快的 3dtiles 转换工具,极度节省你的处理时间。

命令行:

3dtile.exe [FLAGS] [OPTIONS] --format <osgb,shape> --input <FILE> --output <FILE>

示例:

3dtile.exe -f osgb -i E:\Data\倾斜摄影\hgc -o E:\Data\倾斜摄影\hgc_test

3dtile.exe -f osgb -i E:\Data\倾斜摄影\dayanta -o E:\Data\倾斜摄影\dayanta_test -c "{\"offset\": 0}"

参数说明:

-c, --config

     {
	
      "x": 120,
      
      "y": 30,
      
      "offset": 0 , // 模型最低面地面距离
      
      "max_lvl" : 20 // 处理切片模型到20级停止
      
     }
  -f, --format <osgb,shape> 
  
  -i, --input <FILE> 
	
  -o, --output <FILE> 
  
  --height, 指定shapefile的高度字段

命令行参数详解:

-c 在命令行传入 json 配置的字符串, json 内容为选配,可部分实现。

-f 输入数据格式: osgb 为倾斜摄影格式数据。

-i 输入数据的目录,截止到 "\Data" 目录的上一级。

-o 输出目录。最终结果位于输出目录的 "\Data" 目录。

--height 高度字段。指定shapefile中的高度属性字段。

数据说明:

1、倾斜摄影数据:

倾斜摄影数据仅支持 smart3d 格式的 osgb 组织方式, 数据目录必须有一个 “Data” 目录的总入口, “Data” 目录同级放置一个 metadata.xml 文件用来记录模型的位置信息。

每个瓦片目录下,必须有个和目录名同名的 osgb 文件,否则无法识别根节点。

osgb 文件名中需要能识别出来是第几级,如 Tile_001_001_L8.osgb,程序能根据最后一个L识别出来第8级,否则程序无法辨认,产生的 geometricError 会有错误。

正确的目录结构如下:

--metadata.xml

--Data\Tile_000_000\Tile_000_000.osgb

--Data\Tile_000_000\Tile_000_000_L6.osgb

2、shapefile 数据:

目前仅支持 shapefile 的面数据,可用于建筑物轮廓批量生成 3dtile。

shapefile 中需要有字段来表示高度信息。

saadat2930#75年前 0 个赞

Hi! I want some help regarding 3Dtiles for display on cesium. I have a photogrammetry model that is prepared in Pix4d desktop application, I can have it in multiple formats including osgb, fbx, obj etc. I tried alot to create 3D tiles using various techniques, I am unable to do it sucessfully.

For "3dtile conversion toolset" I have to add metadata.xml along with osgb files, which i dont have, So i put an empty metadata.xml. It gives me the data copied in different folders along with json files tileset.json but when i run the code to display on cesium it gives me error and the data is not displayed. var tileset = new Cesium.Cesium3DTileset({ url: "mydata/tileset.json" }); viewer.scene.primitives.add(tileset);

viewer.zoomTo(tileset);

Please tell me where i am going wrong as soon as possible. I will be really very thankful.

admin#85年前 0 个赞

@saadat2930 #7楼 hi, saadat2930, where are from?

  1. If you want to use the tool in this page, you should transfer your models to .osgb format.
  2. when you get osgb models, you can use the tool from url: https://download.csdn.net/download/qq_37796475/10274378
  3. pls click "立即下载"(download). if you don't have a vip account. you can mail me: tohujiulin@126.com, I will send u.
  4. just do follow: @devhu #1楼
admin#95年前 0 个赞

@saadat2930 #7楼 I am sorry, my email can not reach gmail. Just try the attachment from the webdisk.


链接:https://pan.baidu.com/s/13aysULuiUx3GhzrWqCNWig 提取码:tkmn

link:https://pan.baidu.com/s/13aysULuiUx3GhzrWqCNWig key:tkmn

jerry#104年前 0 个赞

请问各位大牛有没有方法生成osgb的LOD?

用超图的desktop 9d将obj转换为osgb后,发现没有osgb的LOD,只有一个比较大的osgb文件,加载很慢

admin#114年前 0 个赞

Cesium批量显示三维模型(gltf格式)和一些心得体会 https://blog.csdn.net/zxzfcsu/article/details/80957399

cesuim加载倾斜摄影OSGB三维数据完整过程(超详细) https://blog.csdn.net/qq_36377037/article/details/86591761

devhu#123年前 1 个赞

求问osgb转3dtiles数据模型,在linux下有工具可以转换吗,查了下基本都是windows的转换工具

admin#133年前 0 个赞

osgb文件 用哪个软件转换成cesium使用比较好 ????

cesium_abc#143年前 0 个赞

转较大的文件似乎会出现白色。

wty_#162年前 0 个赞

@devhu #12楼 同问,有找到linux转换的工具吗

17楼 已删除.
alanx#182年前 0 个赞

很棒 mark 一下

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics