This repository contains code of a QGIS plug-in that facilitates management and visualization of data stored in the CityGML 3D City Database v. 4.x (aka 3DCityDB), which currently supports CityGML 1.0 and 2.0.
The plug-in allows to connect to local or remote instances of the free and open-source CityGML 3D City Database for PostgreSQL/PostGIS and to load data as "classical" layers into QGIS. Once data layers are available in QGIS, the user can interact with them as usual, i.e. perform analyses, work with associated attributes, explore and visualise the data in 2D and 3D, etc. Additionally, data in the database can be deleted, either using classical QGIS editing tools, or bulk-wise.
As semantic 3D city models tend to be huge datasets and are generally best managed in spatial databases, the main idea behind the development of this plug-in is to facilitate access and use of CityGML/CityJSON data for those practitioners that lack a deep knowledge of the international standard OCG CityGML data model, and/or have limited experience with SQL/Spatial-RDBMSs in general. The plug-in consists of a server-side part (written in PL/pgSQL) and a client-side part (written in Python).
The client-side part offers, at the moment, three GUI-based tools:
In particular, the Layer Loader offers following functionalities:
Further details, and a user guide, can be found in the \manuals subfolder of the plug-in installation directory (see file "3DCityDB-Tools_UserGuide.pdf").
Some datasets for testing purposes are available, too, and are contained in the \test_datasets subfolder.

The plug-in has been developed using QGIS 3.22 LTR, 3.28 LTR, 3.34 LTR and 3.40 LTR. Please note that support and further development focuses only on LTR versions.
The server-side part of the plug-in requires PostgreSQL version >= 10 and PostGIS version >= 2.
Otherwise, only a working instance of the 3D City Database is required. The currently supported version of the 3DCityDB is the 4.x. To set up the 3D City Database and import (or export) CityGML/CityJSON data from/to it, we heartily recommend to use the free and open-source, Java-based Importer-Exporter. Alternatively, the 3D City Database Suite already ships with all necessary software tools. Further information can be found here.
The easiest way to install the plug-in is via the QGIS Plugins repository, or directly from QGIS. Just look for the 3DCityDB-Tools plug-in!
Alternatively, you can download the plug-in zip file from here and install it manually. Please refer to the installation steps explained in the documentation, which also contains details on how to set up the server-side part of the plug-in.
The plug-in is currently developed by:
with contributions by:
and with additional suggestions and feedback by Camilo León-Sánchez (TU Delft), Claus Nagel and Zhihang Yao (Virtual City Systems GmbH).
If you use the 3DCityDB-Tools sowtware in scientific work, please cite our paper:
Besides further testing and debugging, there are a number of improvements that we are thinking of, such as:
This work started as a TU Delft MSc Thesis in Geomatics by Konstantinos Pantelios. If you would like to read more about his work, it is available here. The 3D Geoinformation group at TU Delft has created this fork of the initial GitHub repository to continue development in the future. You are kindly invited to submit issues (and ideas, and suggestions!) to THIS repository.