EOSMDBOne: Unterschied zwischen den Versionen

Aus Geoinformation HSR
Wechseln zu: Navigation, Suche
(Background)
Zeile 38: Zeile 38:
 
* The data source originally is [[OpenStreetMap]] but actually the download server from Geofabrik [http://download.geofabrik.de/] is being used.  
 
* 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.
 
* [[PostGIS]] is used as the database system.
* The whole update process is controlled by a sell script.
+
* The whole update process is controlled by a shell script.
 
* The software used for the main update process is [[Osm2pgsql]].  
 
* The software used for the main update process is [[Osm2pgsql]].  
  
 
[[Kategorie: Geodaten]]
 
[[Kategorie: Geodaten]]

Version vom 17. August 2011, 00:56 Uhr

"Enhanced OpenStreeMap Database One" (EOSMDBOne)

Schweizer Geodaten von OpenStreetMap - konkret 'switzerland.osm.pbf' von Geofabrik - importiert mit Hilfe von Osm2pgsql.

Diese Geodatenbank wird von einigen unserer Webapplikationen verwendet, wie

Schema

Das Schema (siehe Osm2pgsql) wurde angepasst wo überhaupt möglich (in Konfigurations-Datei .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 => Tabelle über osm_point, osm_line und osm_polygon über die Kolonnen osm_id, name, tags, gtype, way, osm_version (ACHTUNG: ev. nicht-materialisiert, d.h. langsam!).
  • osm_poi => Tabelle über osm_point und osm_polygon mit ST_Centroid mit den Kolonnen osm_id, name, tags, gtype, way, osm_version (ACHTUNG: ev. nicht-materialisierte View, 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 like multi-polygons.

Background

Some facts:

  • This database is being updated every early morning (using a Linux cron job at 03:03 a.m.).
  • 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 shell script.
  • The software used for the main update process is Osm2pgsql.