
Clone repository from github.com/adius/CityViz like this:
git clone https://github.com/adius/CityViz
Run $ npm install to install all dependencies
In order to make the cityviz command available on your machine
run following command in the CityViz root directory:
npm link
In order to get an overview over available sub-commands you can
simply run cityviz without any parameters.
cityviz setup to create the CityViz database.
The newly created database has following properties:
cityviz dropdb and try again.cityviz import <citygml-file|directory> to import specified files
Attention: Although the script reports that the import was successful it
might not contain any data.
Investigation on this issue
Alternatively you can import data with the graphical version of the
3DCityDb-importer-exporter 1.6Please checkout test/export.js for the export to collada and the conversion to gltf
Install RethinkDB
On Mac with hombrew: brew update && brew install rethinkdb
Start RethinkDB by executing rethinkdb in your command line
Use the admin interface on localhost:8080 to manage the database.
Import citygml files into your database by running:
cityviz rdb-import <gml file | directory of gml files>
Run node app.js to start the application server
The server now exposes several endpoints:
Get all cityObjects from the database as JSON-array. To limit the number of cityObjects use the endpoint like this: localhost:3000/cityObjects/1000
The query parameter type can be used to get the data [buffered]
(http://localhost:3000/cityObjects?type=buffered) or as
event-stream
(default is streamed)
The query parameter district can be used to get only cityObjects
from a certain district:
localhost:3000/cityObjects?district=witte%20dorp
Open localhost:3000 in your Browser to get a interactive webgl globe including renderings of the ground-surfaces of all buildings in your database. (Attention: This might crash when you have too many (~ >50000) cityObjects in your database)
The query parameter numberOfCityObjects can be used to limit the number of
cityObjects to be rendered:
localhost:3000?numberOfCityObjects=500
This uses the streaming version of the cityObjects endpoint in a buffered way. Clients for the streaming api and for the event-stream api which leverage streaming are work in progress in the app/js/index.js file.
The query parameter district is the same as in the backend.
localhost:3000?district=witte%20dorp
This should be used if you want to use the official GUIs and execute the 3DCityDb setup process manually instead of using the bundled version (not recommended).
On Mac:
Install postgresapp (Already contains PostGIS plugin which otherwise would have to be installed as well)
Follow the instructions on postgresapp.com/documentation
to add the psql
command to your command line.
Download 3DCityDB 2.1
Run setup.jar to install 3DCityDB
Open /Applications/3DCityDB-Importer-Exporter/3dcitydb/postgis/CREATE_DB.sh
with a text-editor and adapt the exported variables to your settings.
Then create the necessary schemas and tables by executing this shell-script. (For the Rotterdam model use SRID: 28992 and name EPSG: 28992)
Open the 3D City Database Importer/Exporter by executing
/Applications/3DCityDB-Importer-Exporter/3DCityDB-Importer-Exporter.sh
and connect to the database
Import your files with the Importer/Exporter.