How to Install on Windows machines

Scenarios for Windows

Please follow one of the scenarios below which fits your setup or plan:

  • Scenario A) I don’t have a 3DCityDB instance on docker and want to create a new one, import the features and test upgrade scripts on this new docker image.
  • Scenario B) I have already a 3DCityDB instance on a docker container and want to try upgrade scripts on it.
  • Scenario C) I have already a 3DCityDB instance in a physical computer and want to try upgrade scipts on it.
  • Scenario D) If you want to create a 3DCityDB instance in a physical computer, please visit the official documentation page.

Scenario A

(I don’t have a 3DCityDB instance on docker and want to create a new one, import the features and test upgrade scripts on this new docker image.)

Tasks: Create 3DCityDB instance, import features and upgrade it to v5 using docker

  • 1) Pull the latest docker image
docker pull tumgis/3dcitydb-v5
  • 1 Optional) Force to remove docker container if doesnt run first time
docker rm --force --volumes YOURCONTAINERNAME

Also you can remove the docker image to download latest one:

docker rmi tumgis/3dcitydb-v5
  • 2) Run docker container with a specific port forwarding Note: If you need specify shared_buffer for PG, add following parameter: "--shm-size=1g ^"
docker run --detach --name YOURCONTAINERNAME -p YOURCUSTOMPORT:5432 ^
    -e SRID=YOURSRIDNUMBER ^
    -e POSTGRES_PASSWORD=YOURDATABASEPASSWORD ^
    -e POSTGRES_DB=YOURDATABASENAME ^
    -e POSTGRES_USER=YOURPOSTGRESQLUSERNAME ^
  tumgis/3dcitydb-v5
  • 3) Run importer with edge-alpine tag Run terminal from the folder in which you have GML files. ...or just specify relative path of GML files after "/share"
docker run --interactive --rm --tty ^
    --network host ^
    --name impexp ^
    -v %cd%:/share ^
    3dcitydb/impexp:edge-alpine import ^
    -H localhost -d YOURDATABASENAME -p YOURDATABASEPASSWORD -u YOURPOSTGRESQLUSERNAME -P YOURCUSTOMPORT ^
    /share/
  • 4) Run the upgrade script inside the container . Your database connections will be same with you defined, but hostname is "localhost" and the port number will be "5432". (It is because you will run the script already inside the container.)
    docker exec --interactive --tty YOURCONTAINERNAME /3dcitydb-v5/upgradeto_citydb_v5.sh
  • 4 Optional) You can check for errors if any exists:
    docker exec --interactive --tty YOURCONTAINERNAME cat /3dcitydb-v5/logs/errors.txt

Scenario B

(I have already a 3DCityDB instance on a docker container and want to try upgrade scripts on it.)

Tasks: Upgrade an existing docker 3dcitydb to v5 using docker A tip: Do not use backslah (\) as latest character in volume sharing option (Line 15). Backslah as latest chracter in -v option evaluated as escape character in command prompt.

  • 1) Download whole package as ZIP file and extract it.
  • 2) Run following command and copy your container's ID:
docker ps --all

3) Start by commiting and paste as "existingContainersID":

docker commit --message "created to upgrade citydb v5." existingContainersID newimagename
  • 4) Run following command to create a new container with an image name which given in previously command. Please consider that, you should give the directory of extracted ZIP as volume sharing (-v) directory.
docker run --name newcontainername --detach ^
  -p TARGET_PORT:SOURCE_PORT ^
    -e POSTGRES_PASSWORD=yourpassword ^
    -e SRID=yourSRIDnumber ^
    -v "C:\yourDirectory\inwhichYouExtracted\theZIPFile":/share ^
    -e POSTGRES_DB=yourdatabasename ^
    -e POSTGRES_USER=yourusername ^
    newimagename
  • 5) You can now run following command in this new container:
docker exec --interactive --tty ^
    newcontainername ^
    bash /share/3dcitydb-v5-master/upgradeto_citydb_v5.sh

Scenario C

(I have already a 3DCityDB instance on a physical computer and want to try upgrade scripts on it.)

  1. Enable "Windows Subsystem for Linux" in Control Panel/Programs.
  2. Install a linux system using Microsoft Store. (Ubuntu 18.04 tested, preferred)
  3. Run linux and install postgresql-client package using: sudo apt install postgresql-client
  4. Browse to subsystem folder by entering: \wsl$
  5. Copy upgrade scripts into /home folder or wherever you want.
  6. Run linux subsytem and use upgrade script just like as in the scenario 3.
  7. Run the script:
./upgradeto_citydb_v5.sh

Scenario D