City GML to 3D Tiles
Deven Mistry -- 08/16/2022
Cesium Ion does not allow you to directly the rendered 3D tiles which are obtained from the CityGML. As an alternative to that, this task was explored.
citygml-to-3dtiles
This repo was found by Sudhir. Link to the repo.
The repository is a npm package which allows you convert CityGML files to 3D Tiles.
Install
To install the package follow the instructions on the README of the repository.
Adding a new CRS
JS -- 08/22/2023 -- modified for clarity...
- Once the npm package is installed, you can run the CLI tool.
- The CityGML have we are using for Absecon Island and Martin County contain a CRS which is not directly supported by the tool.
- You need to add a custom CRS to the source code of the tool
- Open the source code at
C:\Users\<USER>\AppData\Roaming\npm\node_modules\citygml-to-3dtiles. - Open
bin\citygml-to-3dtiles.mjsand modify the Converter constructor to match the following:let converter = new Converter({
srsProjections: {
"urn:ogc:def:crs:EPSG::4979": "+proj=longlat +datum=WGS84 +no_defs +type=crs",
"EPSG:4979": "+proj=longlat +datum=WGS84 +no_defs +type=crs"
}
}) - Additional instructions on where the appropriate syntax and other nuances are available in the README of the citygml-to-3dtiles repository.
Uploading the tileset to Cesium Ion
- Once you have the 3D Tiles, you can upload them to Cesium Ion.
- The tool creates 2 files,
tileset.jsonand afull.b3dmfile. - You cannot upload these 2 files individually, you need to zip file them and then upload them to Ion.