Commit a52b74b8 authored by Felix Delattre's avatar Felix Delattre
Browse files

Added initial database documentation

parent c9e58a5f
......@@ -2,7 +2,63 @@
This repository handles the structure and migrations in the `obm_buildings` database.
The database is described through sql files in the `migrations/` directory.
The database is described through SQL files in the `migrations/` directory.
## Connection
* $ `psql -h hayabusa.gfz-potsdam.de -U consumer obm_buildings` (allows to access data read-only)
* $ `psql -h hayabusa.gfz-potsdam.de -U contributor obm_buildings` (allows data manipulation)
**Example database for tests**
This is an empty database to be filled with edge cases, with the purpose of running tests for our scripts before rolling them out to the real OBM buildings database. You can access it through the following commands:
* $ `psql -h hayabusa.gfz-potsdam.de -U consumer -p 5434 obm_buildings`
* $ `psql -h hayabusa.gfz-potsdam.de -U contributor -p 5434 obm_buildings`
**Alternative legacy database backup for reference**
This is the legacy database, which we keep for reference to be able to deal with (i.e. understand) legacy code. We will eventually erase it. You can access it through the following commands:
* $ `psql -h hayabusa.gfz-potsdam.de -U consumer -p 5433 gis`
## Database tables
* `obm_buildings` - Main OBM Buildings attributes
These tables are going to be moved into [database-osmreplication](https://git.gfz-potsdam.de/dynamicexposure/openbuildingmap/database-osmreplication):
* `planet_osm_line` - OpenStreetMap source data
* `planet_osm_nodes` - OpenStreetMap source data
* `planet_osm_point` - OpenStreetMap source data
* `planet_osm_polygon` - OpenStreetMap source data
* `planet_osm_rels` - OpenStreetMap source data
* `planet_osm_roads` - OpenStreetMap source data
* `planet_osm_update` - OpenStreetMap source data
* `planet_osm_ways` - OpenStreetMap source data
* `spatial_ref_sys` - PostGIS table including known spatial reference systems
## OpenBuildingMap Building attributes
The core of OpenBuildingMap are the following attributes in the `obm_buildings` table:
```
column_name | data_type
-----------------+-----------------------------
osm_id | bigint
z_order | integer
geometry | geometry(Geometry,900913)
building | text
building_use | text
building_levels | text
amenity | text
occupancy | text
position | text
floor_space | double precision
last_modified | timestamp without time zone
area | double precision
```
## More information
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment