Skip to content
Snippets Groups Projects

Added initial database documentation

Closed Felix Delattre requested to merge feature/add-some-docu into master
1 file
+ 56
0
Compare changes
  • Side-by-side
  • Inline
+ 56
0
@@ -4,6 +4,62 @@ This repository handles the structure and migrations in the `obm_buildings` data
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
* [Database versioning best practices](https://enterprisecraftsmanship.com/posts/database-versioning-best-practices/)
Loading