Converting to/from CityGML files
The open-source software citygml-tools allows us to automatically convert between CityGML and CityJSON, and vice-versa.
Download its latest release (v1.2.0 at the time of writing this), and unzip its content.
Open a console/terminal (also called “Command Prompt” in Windows)
Then navigate to the folder
/bin/, there is a program called
To see its capabilities, type
Conversion CityGML -> CityJSON
Download this CityGML file of The Hague (or any CityGML files; these can have textures too), and place it in a given folder (say
To convert it to CityJSON:
./citygml-tools to-cityjson /Users/hugo/temp/data/DenHaag_01.xml
Voilà, this creates a new CityJSON file:
If you drag that file in the CityJSON web-viewer, you can view it:
Conversion CityJSON -> CityGML
From the CityJSON file, a new GML file can be created with that command: