-
Notifications
You must be signed in to change notification settings - Fork 3
IntermediateDB
Thomas Schwotzer edited this page Jun 5, 2019
·
7 revisions
The intermediate DB is more or less a SQL incarnation of an OSM file.
It comprise five tables. Their structure are straightforward.
Nodes, ways and relations table contain data of nodes etc. These three tables have several columns in common: First, they store data taken from osm file:
id | primary key |
osm_id | the osm id |
tstamp | timestamp (last change date) |
classcode | foreign key referencing a row in OHDM classification table |
otherclasscodes | osm objects can be of more than one map feature |
serializedtags | tags from osm file |
Secondly, each table has some flags which are used for the OHDM/OSM archive update.
ohdm_geom_id | ohdm id of a geometry that was produced from this osm entity (can be null) |
ohdm_geom_type | geometry type (point, linestring, polygon |
ohdm_object_id | ohdm id of an object that was produced from this osm entity (can be null) |
geom_changed | geometry has changed since last update |
object_changed | object has changed since last update |
deleted | osm entity was deleted since last update |
object_new | osm entity is new |
valid | osm entity is valid and unchanged since last update |
longitude |
latitude |
node_ids | node id in the same order as found in tags in the osm file |
member_ids | member id in the same order as found in tags in the osm file |
That table describes the n-m relation between ways and nodes
id | primary key |
way_id | foreign key to ways table |
node_id | foreign key to nodes table (nodes making up that way) |
That table describes the n-m relation between relations and other entities
id | primary key |
relation_id | foreign key to relations table (relation that is described) |
node_id | foreign key to nodes table (node is part of the relation) |
way_id | foreign key to ways table (way is part of the relation) |
member_relation_id | foreign key to relations table (relation is part of the relation) |
role | role played by node, way or relation in this relation |