Loading 3D City Models in QGIS. Using QGIS to explore the CityJSON 3D... | by Joe T. Santhanavanich | Towards Data Science

In Geospatial Data Science, the 3D data models recently play an important role in the research and visualization projects. QGIS is one of the most popular free and open-source cross-platform desktop GIS application software that every GIS geek knows. Since version 3.0 of the QGIS, a separate interface is responsible for 3D data visualization of the Point cloud and Digital Elevation Models. It’s called the 3D map view and is accessed from the View context menu.
However, the usual way the building- or city models had been visualized in the 3D GIS projects is by extruding the building footprints. This will result in the Level of Details-1. In 2020, the QGIS plugin for loading CityJSON 3D city models in QGIS has been developed [1]. Accordingly, it is possible to visualize the building models at a higher Level of Details. This article will introduce the use of this plugin for loading the CityJSON 3D city models with some examples.
In the world of 3D data, the 3D city models have been used for many application domains such as 3D cadastres, facilities management, and emergency response. One of the most popular data schemas for the 3D city models is the OGC CityGML which is a global data model for describing 3D geo-spatially-enabled urban models; developed by the OGC (open geospatial consortium). However, it is based on GML encoding which has a complex nature and poor interoperability. For this reason, the CityJSON has been developing as an easy‐to‐use JavaScript Object Notation (JSON) encoding for 3D city models using the CityGML 2.0 data model.
You can check out this article to check out the available open-source CityGML datasets.
Any CityGML datasets can be converted to the CityJSON format using the citygml-tools. It is a command-line utility that bundles several operations for processing CityGML files. (Check this Link)
Then you can convert your CityGML data with this command:
$ citygml-tools to-cityjson /path/to/your/CityGML.gml
You can download and install the latest version of QGIS from here. Then, open the plugin window (Plugins => Manage and Install Plugins) and find the CityJSON Loader.
After the CityJSON Loader had been installed, you can use it to load the CityJSON file. You can find it under the Vector menu (Vector => CityJSON Loader => Load CityJSON... ).
For example, you can try this dataset for the 3D city model of Den Haag in CityJSON format. Before you load the CityJSON, check the EPSG code from the metadata and set your project Coordinate Reference System (CRS) to match the EPSG code of your dataset to ensure that the dataset will be loaded properly.
You can set the project CRS from the lower right of your QGIS window as in the following figure.
After the CityJSON is loaded to your QGIS project, you can visualize it in 3D by opening a new 3D Map View (View => New 3D Map View [Ctrl + Alt + m]). The following figure is an example of the Den Haag CityJSON model. [~2.9 Mb].
After exploring the 3D city models, there are a lot of possibilities for using the 3D city models for real-world projects; for example,
Build the 3D Web map application with 3D City Models
Explore more open-source 3D City Models.
Download open-source data from OSM using QGIS & QuickOSM.
Or, why don't you try to integrate it with your game project in Unity3D?
And, much more!
This short article introduces the CityJSON; a light 3D City Model encoding for the 3D city model and shows how to visualize these data models in an open-source GIS desktop software QGIS. I hope you like this article and found it useful for your daily work or projects. Feel free to leave me a message if you have any questions or comments.
About me & Check out all my blog contents: Link
Be Safe and Healthy! 💪
Thank you for Reading. 📚
[1] Stelios Vitalis, Ken Arroyo Ohori, Jantien Stoter: CityJSON in QGIS: Development of an open‐source plugin https://doi.org/10.1111/tgis.12657 (2020).