EOSMDBOne: Unterschied zwischen den Versionen
Stefan (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „'''OpenStreeMap Database One''' Data from OpenStreetMap imported once every early morning using Osm2pgsql. Used by webapplications like [[PostGIS Termina…“) |
Stefan (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
'''OpenStreeMap Database One''' | '''OpenStreeMap Database One''' | ||
− | Data from [[OpenStreetMap]] imported once every early morning using [[Osm2pgsql]]. | + | Data from [[OpenStreetMap]] imported once every early morning using [[Osm2pgsql]]. |
+ | |||
+ | This database is being used by some of our webapplications like [[PostGIS Terminal]] and [[POI-Service]]. | ||
+ | |||
+ | == Schema == | ||
Das Schema (siehe '''[[Osm2pgsql]]''') wurde angepasst (wo überhaupt möglich) mittels der Konfigurations-Daten (.style). Die Attribute osm_id und osm_version (aus Oms2pgsql-Option "-extended-attributes") in der Tabellen-Gruppe 'Osm2pgsql' können nicht umbenannt werden (hardcoded). | Das Schema (siehe '''[[Osm2pgsql]]''') wurde angepasst (wo überhaupt möglich) mittels der Konfigurations-Daten (.style). Die Attribute osm_id und osm_version (aus Oms2pgsql-Option "-extended-attributes") in der Tabellen-Gruppe 'Osm2pgsql' können nicht umbenannt werden (hardcoded). | ||
Zeile 25: | Zeile 29: | ||
* Table osm_lines has duplicates with neg. and pos. osm_ids. Line rows with duplicate neg. osm_ids got the (positive) osm_id from relations. Lines also have rows with duplicate pos. osm_ids. These belong somehow together since they have identical tags but different geometries. In original db there is only one http://www.openstreetmap.org/browse/way/47926394 (compared to "select osm_id, tags, length(way) from osm_line where osm_id=47926394"). | * Table osm_lines has duplicates with neg. and pos. osm_ids. Line rows with duplicate neg. osm_ids got the (positive) osm_id from relations. Lines also have rows with duplicate pos. osm_ids. These belong somehow together since they have identical tags but different geometries. In original db there is only one http://www.openstreetmap.org/browse/way/47926394 (compared to "select osm_id, tags, length(way) from osm_line where osm_id=47926394"). | ||
* Table osm_polygon have duplicates too but only with negative osm_ids. Like Lines, Polygon rows with duplicate neg. osm_ids got the (positive) osm_id from relations. | * Table osm_polygon have duplicates too but only with negative osm_ids. Like Lines, Polygon rows with duplicate neg. osm_ids got the (positive) osm_id from relations. | ||
+ | |||
+ | == Background == | ||
+ | |||
+ | Some facts: | ||
+ | * This database is being updated every early morning (using a Linux cron job). | ||
+ | * The data source originally is [[OpenStreetMap]] but actually the download server from Geofabrik [http://download.geofabrik.de/] is being used. | ||
+ | * [[PostGIS]] is used as the database system. | ||
+ | * The whole update process is controlled by a sell script. | ||
+ | * The software used for the main update process is [[Osm2pgsql]]. | ||
[[Kategorie:Datenbanken]] | [[Kategorie:Datenbanken]] |
Version vom 23. Juli 2011, 20:24 Uhr
OpenStreeMap Database One
Data from OpenStreetMap imported once every early morning using Osm2pgsql.
This database is being used by some of our webapplications like PostGIS Terminal and POI-Service.
Schema
Das Schema (siehe Osm2pgsql) wurde angepasst (wo überhaupt möglich) mittels der Konfigurations-Daten (.style). Die Attribute osm_id und osm_version (aus Oms2pgsql-Option "-extended-attributes") in der Tabellen-Gruppe 'Osm2pgsql' können nicht umbenannt werden (hardcoded).
Tabellen-Gruppe 'OSM-Original': Tabellen angelehnt an originale OSM-Planet-Struktur (jedoch mit Tags als Array):
- osm_nodes => Node mit id, lat, lon, tags (Array) (gem. default.style)
- osm_ways => Way mit Set of references to Node, d.h. ohne eigene Geometrie (gem. default.style).
- osm_rels => Relation mit Referenz auf Nodes, Ways, Relations (gem. default.style).
Tabellen-Gruppe 'Osm2pgsql': Tabellen mit Geometrien (PostGIS) zusammengestellt aus aus osm_nodes und osm_ways (mit Tags als hstore durch osm2pgsql '-h'-Flag ):
- osm_point => Punktobjekte mit den Attribten osm_id, versch. weitere (gem. default.style) plus osm_version. Enthält nur Nodes, die auch Tags enthalten (also keine, die nur Stützpunkte von Linien/Rändern sind).
- osm_line => Linienobjekte aus Ways-Tabelle mit 'echtem' Geometrie-Attribut, sowie osm_id, versch. weitere (gem. default.style) plus osm_version. Enthält auch Ways, die eigentlich Flächen bilden. Enthält Objekte mit (möglicherweise identischen!) negativen osm_id's; das sind Ways, die in der OSM-DB über Relations zusammengesetzt sind.
- osm_polygon => Flächenobjekte (gebildet aus bestimmten Ways und Relations), osm_id, versch. Attr. (gem. default.style) plus osm_version
Spezialtabellen:
- osm_roads => linienhafte Strassenobjekte => fehlt, da nicht verwendet! (aus .style auskommentiert)
- osm_all => View über osm_point, osm_line und osm_polygon über die Kolonnen osm_id, name, tags, gtype, way, osm_version (ACHTUNG: z.Zt. nicht-materialisiert, d.h. langsam!).
- osm_poi => View über osm_point und osm_polygon mit ST_Centroid mit den Kolonnen osm_id, name, tags, gtype, way, osm_version (ACHTUNG: z.Zt. nicht-materialisiert, d.h. langsam!).
Duplikate:
- Original OSM tables have separate ids and no duplicates in each table.
- Table osm_point has no duplicates.
- Table osm_lines has duplicates with neg. and pos. osm_ids. Line rows with duplicate neg. osm_ids got the (positive) osm_id from relations. Lines also have rows with duplicate pos. osm_ids. These belong somehow together since they have identical tags but different geometries. In original db there is only one http://www.openstreetmap.org/browse/way/47926394 (compared to "select osm_id, tags, length(way) from osm_line where osm_id=47926394").
- Table osm_polygon have duplicates too but only with negative osm_ids. Like Lines, Polygon rows with duplicate neg. osm_ids got the (positive) osm_id from relations.
Background
Some facts:
- This database is being updated every early morning (using a Linux cron job).
- The data source originally is OpenStreetMap but actually the download server from Geofabrik [1] is being used.
- PostGIS is used as the database system.
- The whole update process is controlled by a sell script.
- The software used for the main update process is Osm2pgsql.