At a glance
| CityGML | CityJSON | |
|---|---|---|
| Encoding | XML with GML: GML 3.1.1 in CityGML 2.0, GML 3.2 in CityGML 3.0 | JSON |
| Data model | CityGML 2.0 or CityGML 3.0 | A subset of CityGML 3.0 |
| Standard | OGC. CityGML 2.0 in 2012; CityGML 3.0 in 2021, with its GML encoding in 2023 | OGC. CityJSON 2.0 |
| Coordinates | Written out in every polygon | One list of integer vertices with a transform; faces point to them by number |
| Levels of detail | LOD 0 to 4 in 2.0, LOD 0 to 3 in 3.0, in the element name such as lod2MultiSurface | LOD 0 to 3, as text such as "2" or "2.2" |
| Storeys and units | CityGML 3.0 only: Storey and BuildingUnit | BuildingStorey and BuildingUnit |
| Textures and colors | Appearance module | appearance with materials and textures |
| Schema check | XSD schemas published by OGC | JSON schemas, checked with the official validator cjval |
| File | .gml | .city.json, or .city.jsonl with one feature per line |
The CityJSON project reports files seven times smaller than CityGML on average. In the sample above, the CityJSON file is about a tenth of the size.
Which one to use
If the project or the software that receives the model names a format and a version, deliver that one. CityGML 2.0 and 3.0 are different files: 3.0 adds storeys, building units and interiors at every level, and drops LOD 4.
CityJSON is smaller and is plain JSON, so any programming language reads it without an XML library.
You do not have to choose before converting. Insula3D writes CityGML 2.0, CityGML 3.0 and CityJSON 2.0 from the same conversion and checks each file it writes.
What differs between the files Insula3D writes
- Storeys
- With the Storey · 3.0 · CityJSON role, CityGML 3.0 and CityJSON get storeys under the building. CityGML 2.0 has no storey, so there the value goes out as an attribute.
- LOD 4
- Exists only in CityGML 2.0. When a layer uses LOD 4, the Output window asks which LOD to write in CityJSON and CityGML 3.0 instead: LOD3 or LOD2.
- Units and rooms
- Building units and constructive elements are new in CityGML 3.0 and exist in CityJSON. CityGML 2.0 has rooms only at LOD 4. Where 2.0 has no place for an object, Insula3D writes it as
BuildingPartand counts it. - Addresses
- CityGML writes the address as xAL. CityJSON writes its own
addressfield. - Checks
- Each CityGML file is checked against the official XSD schemas. After the run, cjval and val3dity check the CityJSON.
Questions
Is CityJSON an OGC standard?
Yes. CityJSON 2.0 is an OGC standard. It encodes a subset of the CityGML 3.0 data model.
Can CityJSON store LOD 2.2?
Yes. In CityJSON the LOD is text: a single digit, or a value such as "2.2" for the refined levels from TU Delft. In CityGML the level is part of the element name, such as lod2MultiSurface. See CityGML LOD explained.
Which CityJSON version does Insula3D write?
CityJSON 2.0, next to CityGML 2.0 and 3.0 from the same conversion.
Can Insula3D open CityJSON and CityGML files?
Yes. Open a CityJSON file or a CityGML 1.0, 2.0 or 3.0 file to view it and check its geometry. See Open and check CityGML and CityJSON.