3D City Database¶
The 3D City Database is a free 3D geo database to store, represent, and manage virtual 3D city models on top of a standard spatial relational database. The database model contains semantically rich, hierarchically structured, multi-scale urban objects facilitating complex GIS modeling and analysis tasks, far beyond visualization. The schema of the 3D City Database is based on the City Geography Markup Language (CityGML), an international standard for representing and exchanging virtual 3D city models.
The 3D City Database was implemented on behalf of the Berliner Senatsverwaltung für Wirtschaft, Technologie und Frauen and the Berlin Partner GmbH. The development is continuing the work of the Institute for Cartography and Geoinformation (IKG), University of Bonn. See the previous version of the database here.
The 3D City Database has been realized as an Oracle Spatial and an PostgreSQL/PostGIS relational database schema. It is shipped as a collection of SQL scripts which allow for creating and dropping instances of the 3D City Database on top of the DBMS.
The 3D City Database is open source and released under the terms of the GNU Lesser General Public License v3 (LGPL).
Key features¶
- Semantically rich, hierarchically structured model
- Five different Levels of Detail (LODs)
- Appearance data in addition to flexible 3D geometries
- Representation of generic and prototypical 3D objects
- Free, also recursive aggregation of geo objects
- Complex digital terrain models (DTMs)
- Management of large aerial photographs
- Version and history management
- Matching/merging of building features
Supported DBMS¶
- Oracle Spatial 10g R2, 11g R1, and 11g R2
- PostgreSQL >= 8.4 with PostGIS >= 2.0
How to setup the 3D City Database in Oracle¶
- Download the distribution package of the 3D City Database from the Files section and unpack it to some location on your computer
- Open a shell environment and change to the top-level SQL folder of the distribution package
- From within the shell environment, connect to the Oracle Spatial DBMS using
sqlpluswith the schema owner account - At the
sqlplusprompt, execute the SQL scriptCREATE_DB.sql
- Spatial Reference Identifier for newly created geometry objects (SRID),
- corresponding GML SRSName, and
- decision whether the database instance should be versioning enabled.
In order to drop an existing instance of the 3D City Database, simply invoke the DROP_DB.sql script following the above steps.
How to setup the 3D City Database in PostgreSQL/PostGIS¶
- Download the distribution package of the 3D City Database from the Files section and unpack it to some location on your computer
- Create a new database in PostgreSQL with PostGIS extension that will be used for the 3D City Database schema
- Open a shell environment and change to the top-level SQL folder of the distribution package
- From within the shell environment, connect to the PostgreSQL DBMS using
psqlusing the parameter-f CREATE_DB.sqlto execute the script
- Spatial Reference Identifier for newly created geometry objects (SRID) and
- corresponding GML SRSName
The 3D City Database schema will not be created if none or an invalid SRID is provided. The SRID will be checked for its existence in the spatial_ref_sys table of PostGIS and if it's appropriate for spatial functions.
If the SRID is accepted the user is given the feedback “SRID ok”. Otherwise an error will occur which forces the setup to stop.
A more comfortable way for creating a 3D City Database instance on PostgreSQL/PostGIS is offered with the shell scripts CREATE_DB.bat (Microsoft Windows family) and CREATE_DB.sh (UNIX/Linux and derivates, MacOS X) which are also located in the top-level SQL folder of the distribution package. Before invoking the scripts please make sure to define values for the following parameters given in the scipts:
PGPORT = 5432 (this is the default port)
PGHOST = your_host_address ('localhost' for locally installed servers)
PGUSER = your_username ('postgres' is the default superuser)
CITYDB = name of the already existing empty PostGIS-database
PGBIN = path_to_psql (e.g. 'C:\PostgreSQL\9.1\bin' on Windows or '/usr/bin' on UNIX/Linux/MacOS X)
On Windows machines, double-clicking the shell script is sufficient to run the setup process. On UNIX/Linux/MacOS X, you can run the CREATE_DB.sh script from within a shell environment. Please open your favorite shell and change to top-level SQL folder of the distribution package. Enter the following command to make the CREATE_DB.sh script executable for the owner of the file:
chmod u+x CREATE_DB.sh
Afterwards, simply run the CREATE_DB.sh script by typing:
./CREATE_DB.sh
In order to drop an existing instance of the 3D City Database, simply invoke the DROP_DB.sql script following the above steps. Executing the DROP_DB.bat respectively DROP_DB.sh script involves steps similar to creation with CREATE_DB. Note that DROP_DB.sql only removes the relational schema of the 3D City Database as well as all PL/pgSQL functions and utilities. The database itself is not dropped.
Documentation¶
A comprehensive documentation of the 3D City Database is available in the Documents section of this site.
Additional documentation:
Tools¶
The 3DCityDB Importer/Exporter is a Java based front-end for the 3D City Database. It allows for high-performance importing and exporting spatial data for a virtual 3D city model. See the 3DCityDB Importer/Exporter project for further information.
Are you using the 3D City Database?¶
Please contact us through citydb@gis.tu-berlin.de if you are using the 3D City Database for the storage and management of your 3D city model in your city, in your project, or in any testing or production environment. We are happy about your feedback.
Resources & links¶
- Internet portal for the 3D City Database: http://www.3dcitydb.net
- Official website of the IGG at TU Berlin: http://www.igg.tu-berlin.de
- Official CityGML website: http://www.citygml.org
- CityGML Wiki: http://www.citygmlwiki.org
- Official CityGML section of the OGC website: http://www.opengeospatial.org/standards/citygml