Convert OSGB,Shp,GDB To Cesium 3DTiles

Overview

About Project

  1. 整体参考https://github.com/fanvanzh/3dtiles, 向作者致敬,市面上唯一的开源好用的3DTILES转换工具,在学习过程中,从中收获很多,对3DTiles、OSGB、GLTF等数据格式有了进一步了解。

  2. 原工程基于C++、C和Rust,本人本身对Rust不了解,但是学习过程中难免涉及到调试,也看了整个代码,个人理解作者采用Rust和C++混编应该是两个问题:

    1. OpenSceneGraph没有除了C++之外其他版本,而且我们在用这个工具时,最主要的就是OSGB转3DTILES
    2. 本身C++可以跨平台,但是C++对字符串、文件系统支持不够好,Rust可以很好满足这一点,并且Rust也便于和C++交互
    3. 综合下来,原作者使用了Rust和C++来编写,一是保证跨平台,二是保证了性能。
  3. 本人本身是对Qt比较熟悉的,就萌生了这个想法,用C++和Qt,从新梳理整个框架,刚好今年春节一个人,秉着学习想法,使用纯C++(加了Qt)重写了该工程,新的工程基于C++ 17标准重写,使用了Qt5.15,主要作者本身写C++大部分时候都是基于Qt,对Qt也稍微了解,同时也借助Qt很好的跨平台特性,性能没有变化,并且也便于调试学习。

    1. 整个工程开源,但是鉴于Qt一些限制,该程序采用LGPL协议。
    2. 后续会与作者同步保持更新,后期希望可以加入自己一些特色功能。

Download Windows Pre-build

简介

3DTiles 转换工具集, 快速将OSGB、Shp、GDB等格式转为Cesium 3DTiles, 方便搭建三维平台。

这是一个基于c++ 17 和 Qt5.15 项目。

提供了如下的子工具:

  • OSGB(OpenSceneGraph Binary)3DTiles
  • Esri Shapefile3DTiles

用法说明

命令行格式

Converter.exe --format <FORMAT> --input <INPUT> --output <OUTPUT> [OPTIONS] 

示例命令

# from osgb dataset
Converter.exe --format osgb -input E:\osgb_path -o E:\out_path

# from single shp file
Converter.exe --format gdal --input <Shapefile Path> --output <DIR>  --field height --layer <Shapefile Name>

# from gdb file
Converter.exe --format gdal --input <GDB Path> --output <DIR>  --field height --layer <Layer Name>

参数说明

  • -f, --format <FORMAT> 输入数据格式。

    FORMAT 可选:OSGB, GDAL

    可选:OSGB 为倾斜摄影格式数据, GDAL 为GDAL支持的面(Polygon)数据

  • --input <PATH> 输入数据的目录,osgb数据截止到 <DIR>/Data 目录的上一级,GDAL参考GDAL数据格式。

  • --output <DIR> 输出目录。OSGB转换的3DTiles输出的数据文件位于 <DIR>/Data 目录, GDAL转换的3DTiles输出的数据文件位于<DIR>/Tile目录,tileset.json位于<DIR>根目录。

  • --field 高度字段。指定GDAL数据集中的高度属性字段,此项为转换 GDAL 时的必须参数。

  • --offset OSGB高度偏移字段。

数据要求及说明

倾斜摄影数据

倾斜摄影数据仅支持 smart3d 格式的 osgb 组织方式:

  • 数据目录必须有一个 Data 目录的总入口;
  • Data 目录同级放置一个 metadata.xml 文件用来记录模型的位置信息;
  • 每个瓦片目录下,必须有个和目录名同名的 osgb 文件,否则无法识别根节点;

正确的目录结构示意:

- Your-data-folder
  ├ metadata.xml
  └ Data/Tile_000_000/Tile_000_000.osgb

GDAL

目前仅支持GDAL格式的面数据,可用于建筑物轮廓批量生成3DTiles.

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

How To Build (Windows)

  1. vcpkg install "osg" "osg[plugins]"
  2. 如果没有Qt5.15,可以通过以下两种方式安装:
    1. 通过Qt官网安装
    2. vcpkg install "qt5[all]"
  3. VS2019选择CMakeLists.txt,导入工程,编译
  4. 把OSGPlugins文件夹复制到编译目录下

About Author

You might also like...
Tiny project to convert a .ase to a RGBA Byte array

Tiny project to convert a .ase to a RGBA Byte array

OpenScan is an open-source document scanner app that enables users to scan hard copies of documents or notes and convert it into a PDF file. No ads. No data collection. We respect your privacy.
OpenScan is an open-source document scanner app that enables users to scan hard copies of documents or notes and convert it into a PDF file. No ads. No data collection. We respect your privacy.

OpenScan An open source app that enables users to scan hardcopies of documents or notes and convert it to a PDF file. No ads. No data collection. We r

⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.
⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.

A cross compiler for shader languages. Convert between SPIR-V, GLSL / GLSL ES, HLSL, Metal Shader Language, or older versions of a given language. Cross Shader wraps glslang and SPIRV-Cross, exposing a simpler interface to transpile shaders.

Tool to convert ELF (S)hared (O)bject to Nintendo (R)elocatable (S)hared (O)bject

elf2rso Tool to convert ELF (S)hared (O)bject to Nintendo (R)elocatable (S)hared (O)bject Command Line Options -i or --input - It's the ELF File to be

Convert ATARI ATR files to CAR (SWITCHABLE XEGS CARTRIDGE)

ATR2CAR Convert ATARI ATR files to CAR (SWITCHABLE XEGS CARTRIDGE) Konwerter uruchamiamy z wiersza poleceń: atr2car File.atr File.car [-c] [-128|-256|

An efficient tool written in C to convert base numbers dumps into human readable string and vice versa.

strtools A tool written in C to convert number bases to human readable string and vice versa. Usage Compile make Help strtools -h Output: Usage: strt

The fastest tools for 3dtiles convert in the world!

English | 简体中文 Introduction Tools for 3D-Tiles convertion. This is a RUST language project with cpp lib to handle osgb data. Tools provided are as fol

C-shellcode to hex converter, handy tool for paste & execute shellcodes in gdb, windbg, radare2, ollydbg, x64dbg, immunity debugger & 010 editor

shellex WARNING: the ugliest code in the world C-shellcode to hex converter. Handy tool for paste & execute shellcodes in gdb, windbg, radare2, ollydb

IDA Debugger Module to Dynamically Synchronize Memory and Registers with third-party Backends (Tenet, Unicorn, GDB, etc.)
IDA Debugger Module to Dynamically Synchronize Memory and Registers with third-party Backends (Tenet, Unicorn, GDB, etc.)

IDA Debug Bridge IDA Debugger Module to Dynamically Synchronize Memory and Registers with third-party Backends (Tenet, Unicorn, GDB, etc.) By synchron

GDB 11.2 mac/darwin hang possible fix

README for this repository The repository is the modification of the GNU GDB-11.2: Source code: https://ftp.gnu.org/gnu/gdb/gdb-11.2.tar.gz The bug of

convert json/xml/bson to c++ struct

xpack 用于在C++结构体和json/xml之间互相转换, bson在xbson中支持。 只需要头文件, 无需编译库文件。 具体可以参考example的例子 基本用法 容器支持 FLAG 别名 位域 继承 枚举 自定义编解码 char数组 第三方类和结构体 格式化缩进 XML数组 Qt支持 重要

Utility to convert any binary file into C source that can be compiled and linked to the executable.

bin2c Utility to convert any binary file into C source that can be compiled and linked to the executable. bin2o Utility to convert any binary file int

Convert YouTube Subscriptions JSON into RSS Reader Compatible OPML

OPMLify Convert YouTube Subscriptions JSON into RSS Reader Compatible OPML Brief Overview OPMLify allows you to import your YouTube Subscriptions to a

HIPIFY: Convert CUDA to Portable C++ Code

Tools to translate CUDA source code into portable HIP C++ automatically

Convert LLVM coverage information into HTML reports

llvm-coverage-to-html converter The clang compiler supports source based coverage tracking, but the default reporting options are very basic. This too

Convert osu beatmaps to the format osu ds wants

osu-ds-convert Convert osu beatmaps (with the latest .osu file format) to the format osu ds wants It's currently hardcoded to convert Miracle Sugite Y

convert elf file to single c/c++ header file

elf-to-c-header Split ELF to single C/C++ header file

POC tool to convert CobaltStrike BOF files to raw shellcode

BOF2Shellcode POC tool to convert a Cobalt Strike BOF into raw shellcode. Introduction This code was written as part of a blog tutorial on how to conv

Convert Javascript/TypeScript to C

Convert Javascript/TypeScript to C

Comments
  • 关于tileset空间范围框和矩阵变换的计算

    关于tileset空间范围框和矩阵变换的计算

    大佬,您好! 我是一个搞gis的,前不久因为工作的需要,我想要将shp转化为三维,所以就有幸看到了您的这个项目。我用了一些时间,用rust重写了shp转b3dm的功能,但是因为完全是照抄,中间有些计算公式(空间范围框其实还好理解,但是矩阵transform的计算我不知道是怎样的)我还不是很了解,方便指教一下吗?

    opened by yueyan-zm 2
  • 使用xmake编译的时候, gdal 3.5.1这个包编译失败

    使用xmake编译的时候, gdal 3.5.1这个包编译失败

    image

    image 打开日志看,

    LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib”

    但是这个 sqlite3.lib文件 的 确是存在的

    `

    LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\iso8211\8211view.vcxproj]

       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\dted\dted_test.vcxproj.metaproj”(Rebuild 目标) (153) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\dted\dted_test.vcxproj”(Rebuild 目标) (308) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\dted\dted_test.vcxproj]
    
    
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\bsb\bsb2raw.vcxproj.metaproj”(Rebuild 目标) (149) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\bsb\bsb2raw.vcxproj”(Rebuild 目标) (311) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\bsb\bsb2raw.vcxproj]
    
    
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\envisat\dumpgeo.vcxproj.metaproj”(Rebuild 目标) (154) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\envisat\dumpgeo.vcxproj”(Rebuild 目标) (306) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\envisat\dumpgeo.vcxproj]
    
    
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\ceos\ceostest.vcxproj.metaproj”(Rebuild 目标) (150) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\ceos\ceostest.vcxproj”(Rebuild 目标) (312) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\ceos\ceostest.vcxproj]
    
    
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\dgn\dgndump.vcxproj.metaproj”(Rebuild 目标) (151) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\dgn\dgndump.vcxproj”(Rebuild 目标) (310) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\dgn\dgndump.vcxproj]
    
    
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\dgn\dgnwritetest.vcxproj.metaproj”(Rebuild 目标) (152) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\dgn\dgnwritetest.vcxproj”(Rebuild 目标) (309) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\dgn\dgnwritetest.vcxproj]
    
    
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\iso8211\8211dump.vcxproj.metaproj”(Rebuild 目标) (146) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\iso8211\8211dump.vcxproj”(Rebuild 目标) (314) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\iso8211\8211dump.vcxproj]
    
    
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\envisat\envisat_dump.vcxproj.metaproj”(Rebuild 目标) (155) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\envisat\envisat_dump.vcxproj”(Rebuild 目标) (303) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\frmts\envisat\envisat_dump.vcxproj]
    
    
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\gdal.sln”(Rebuild 目标) (1) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\s57\s57dump.vcxproj.metaproj”(Rebuild 目标) (159) ->
       “C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\s57\s57dump.vcxproj”(Rebuild 目标) (305) ->
         LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\runneradmin\AppData\Local\.xmake\packages\s\sqlite3\3.39.0+200\5c303184aefa42949c3588eda1b81e7e\lib\sqlite3.lib” [C:\Users\JS_User\AppData\Local\.xmake\cache\packages\2210\g\gdal\3.5.1\source\build_905da6ea\ogr\ogrsf_frmts\s57\s57dump.vcxproj]
    

    `

    opened by YeYongFen 1
  • 一点改进的小建议

    一点改进的小建议

    首先很感谢您的工作,在fanvanzh的基础上做了很多改进,这些对我来说帮助很大。不过有几点小问题可以改进一下

    1. 需要设置PROJ_LIB环境变量,不然程序会提示找不到proj.db。另外如果电脑里之前已经安装过PostgreSQL的话,运行Converter.exe可能也会报错。这个可以在README说明。
    2. 如果metadata.xml内容不符合要求的话,没有出错提示,会让人无法定位错误。这个可以稍微改进一下哈。
    3. 还有一点,如果osgb储存的是点云,而不是三角面片的话,无法完成转换,这是故意这么设计的吗?
    opened by cbtogu 3
Releases(V2.1)
Owner
HuiWang
HuiWang
GDB 11.2 mac/darwin hang possible fix

README for this repository The repository is the modification of the GNU GDB-11.2: Source code: https://ftp.gnu.org/gnu/gdb/gdb-11.2.tar.gz The bug of

null 4 Feb 28, 2022
Convert LLVM coverage information into HTML reports

llvm-coverage-to-html converter The clang compiler supports source based coverage tracking, but the default reporting options are very basic. This too

Thomas Neumann 2 Oct 11, 2021
POC tool to convert CobaltStrike BOF files to raw shellcode

BOF2Shellcode POC tool to convert a Cobalt Strike BOF into raw shellcode. Introduction This code was written as part of a blog tutorial on how to conv

FalconForce 131 Nov 29, 2022
Convert Javascript/TypeScript to C

Convert Javascript/TypeScript to C

Andrei Markeev 1.1k Nov 23, 2022
cbmconvert: create, extract and convert 8-bit Commodore binary archives

cbmconvert: create, extract and convert 8-bit Commodore binary archives cbmconvert extracts files from most known archive file formats that are used o

Marko Mäkelä 7 Nov 27, 2022
Resize, crop, and convert images on Upload.

Upload Image Plugin Resize, crop, and convert images on Upload. To use this plugin use the following settings in a "Transformation Step" in the Upload

Upload.js 20 Mar 31, 2022
iconv implementation using Win32 API to convert.

win_iconv is a iconv implementation using Win32 API to convert. win_iconv is placed in the public domain. ENVIRONMENT VARIABLE: WINICONV_LIBICON

null 164 Nov 12, 2022
Small program using GMP to convert a decimal number (1.8) into a reduced fraction (9/5)

gmp_rationalize This is a small program to convert a decimal number (like 1.8) into a reduced fraction (like 9/5), using GMP for handling arbitrary-pr

null 3 Apr 5, 2022
pluggable tool to convert an unrolled TritonAST to LLVM-IR, optimize it and get back to TritonAST

it is fork from https://github.com/fvrmatteo/TritonASTLLVMIRTranslator *WARNINGS: tested only linux(ubuntu 20.04) and only llvm and clang version 10*

pr4gasm 5 Jun 10, 2022
A tool to convert Call of Duty XBIN/EXPORT files to and from each other.

exportxbin exportxbin is an enhanced version of export2bin included in the Call of Duty: Black Ops III Mod Tools. Its main goal is to provide users wi

Philip 3 Jan 22, 2022