I've created a very basic (!) JavaScript program to convert CityGML files to batched 3DTiles, which can then be loaded in Cesium.
https://github.com/njam/citygml-to-3dtiles
It works by reading the XML, extracting buildings (only buildings for now), converting coordinates of the geometric primitives, and then writing a single batched 3DTiles file.
The code for writing 3DTiles is based on the 3D Tiles Samples Generator (https://github.com/AnalyticalGraphicsInc/3d-tiles-tools/tree/master/samples-generator).
If you want to try it out, make sure you have a recent version of NodeJS with ESM module support (I'm using v9.9).
To convert the "3dified" CityGML of Delft:
-----------------------------
# Change into a temp dir:
cd $(mktemp -dt)
# Download and extract the model of Delft:
wget 'https://3d.bk.tudelft.nl/download/3dfier/Delft.gml.zip' && unzip Delft.gml.zip
# Install the conversion script
npm install citygml-to-3dtiles
# Run the conversion:
node --experimental-modules --max-old-space-size=10000 node_modules/.bin/citygml-to-3dtiles \
Delft_3dfier.gml 3dtiles/
-----------------------------
This will take a few minutes. Once done you should end up with a folder "3dtiles/" with two files "tileset.json" and "full.b3dm".
The code has many limitations, and probably does not work out of the box for many CityGML files out there. Maybe it's helpful for somebody as a starting point, but YMMV!
Regards
Reto
Very useful tool! I have tried it on my own dataset, and it seems to work very well. I have noticed one small thing though: concave shapes are not always rendered correctly (example from the Delft dataset: https://imgur.com/a/eBBxA). I would love to contribute and fix it, but unfortunately I am not sufficiently familiar with node.js. If you would be able to have a look at it, could you please let me know?
Thanks!
Thanks!
Jelle
I would like to seek for your assitance regarding to the issue I faced.
Script ((below):
------------------------------------------------------------------------
E:\3D_FP\citygml-to-3dtiles>node --experimental-modules --max-old-space-size=10000 ./bin/citygml-to-3dtiles.mjs ./test/Buildings.gml ./output/
(node:18800) ExperimentalWarning: The ESM module loader is experimental.
Converting...
Reading CityGML file 1/1...
Unknown projection name: "urn:ogc:def:crs,crs:EPSG::3414,crs:EPSG::6916"
------------------------------------------------------------------------
How to make the projection known by the program?
Best Regards,
Rex
> To unsubscribe from this group and all its topics, send an email to cesiu...@googlegroups.com.