Code Monkey home page Code Monkey logo

cityviz's Introduction

CityViz

Sreenshot of CityViz web-app

Getting Started

  1. Clone repository from github.com/adius/CityViz like this:

    git clone https://github.com/adius/CityViz
  2. Run $ npm install to install all dependencies

  3. 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.

3DCityDb 2.1 based version

  1. Start postgres server
  2. Run cityviz setup to create the CityViz database. The newly created database has following properties:
    • name: cityviz
    • user: cityviz
    • password: cityviz If you want to have different database-settings, make sure to update those in config.yaml.
  3. If you encounter any problems during setup, drop the CityViz database first with cityviz dropdb and try again.
  4. Run 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.6

Please checkout test/export.js for the export to collada and the conversion to gltf

RethinkDB based version

  1. Install RethinkDB On Mac with hombrew: brew update && brew install rethinkdb

  2. Start RethinkDB by executing rethinkdb in your command line

  3. Use the admin interface on localhost:8080 to manage the database.

  4. Import citygml files into your database by running:

    cityviz rdb-import <gml file | directory of gml files>
  5. Run node app.js to start the application server

The server now exposes several endpoints:

localhost:3000/cityObjects

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

Detailed Installation

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:

  1. Install postgresapp (Already contains PostGIS plugin which otherwise would have to be installed as well)

  2. Follow the instructions on postgresapp.com/documentation to add the psql command to your command line.

  3. Download 3DCityDB 2.1

  4. Run setup.jar to install 3DCityDB

    • Create a new database in postgres (You can use pagadmin to inspect and interact with your database.)
    • Enable the postgis extension for it by right clicking Extensions > name: postgis > OK.
  5. 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)

  6. Open the 3D City Database Importer/Exporter by executing /Applications/3DCityDB-Importer-Exporter/3DCityDB-Importer-Exporter.sh and connect to the database

  7. Import your files with the Importer/Exporter.

Links

Gltf

Viewer

WebGL Resources

Coordinates

cityviz's People

Contributors

ad-si avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cityviz's Issues

No package metadata was found for gyp

OS VERSION:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye

== Installation steps: ==

git clone https://github.com/adius/CityViz
cd CityViz
npm install

== Error: ==

npm ERR! Traceback (most recent call last):
npm ERR!   File "/usr/share/nodejs/node-gyp/gyp/gyp_main.py", line 33, in <module>
npm ERR!     sys.exit(load_entry_point('gyp==0.1', 'console_scripts', 'gyp')())
npm ERR!   File "/usr/share/nodejs/node-gyp/gyp/gyp_main.py", line 22, in importlib_load_entry_point
npm ERR!     for entry_point in distribution(dist_name).entry_points
npm ERR!   File "/home/user/.local/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 558, in distribution
npm ERR!     return Distribution.from_name(distribution_name)
npm ERR!   File "/home/user/.local/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 215, in from_name
npm ERR!     raise PackageNotFoundError(name)
npm ERR! importlib_metadata.PackageNotFoundError: No package metadata was found for gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/nodejs/node-gyp/lib/configure.js:355:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
npm ERR! gyp ERR! System Linux 5.10.0-9-amd64
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/share/nodejs/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /opt/Programming/CityViz/node_modules/node-expat
npm ERR! gyp ERR! node -v v12.22.12
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

node-gyp -v
v7.1.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.