Skip to main content

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...

  1. Once the npm package is installed, you can run the CLI tool.
  2. The CityGML have we are using for Absecon Island and Martin County contain a CRS which is not directly supported by the tool.
  3. You need to add a custom CRS to the source code of the tool
  4. Open the source code at C:\Users\<USER>\AppData\Roaming\npm\node_modules\citygml-to-3dtiles.
  5. Open bin\citygml-to-3dtiles.mjs and 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"
    }
    })
  6. 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

  1. Once you have the 3D Tiles, you can upload them to Cesium Ion.
  2. The tool creates 2 files, tileset.json and a full.b3dm file.
  3. You cannot upload these 2 files individually, you need to zip file them and then upload them to Ion.