OSM-Technisches: Unterschied zwischen den Versionen

Aus Geoinformation HSR
Wechseln zu: Navigation, Suche
(Programming Resources)
 
(23 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 28: Zeile 28:
 
* "tote" Ways -> Ways ohne Nodes
 
* "tote" Ways -> Ways ohne Nodes
 
* Ways mit ein und derselben Node
 
* Ways mit ein und derselben Node
 +
 +
== 3D Buildings ==
 +
 +
* Simple 3D Buildings Tagging Schema (S3DB): http://wiki.openstreetmap.org/wiki/Simple_3D_Buildings
 +
* Demo: http://rbuch703.de/osmsv/?lat=47.22069461&lng=8.81504774&yaw=20.5&pitch=-28.9&height=272.25
 +
 +
== Indoor ==
 +
 +
* Simple Indoor Tagging Schema: https://wiki.openstreetmap.org/wiki/Simple_Indoor_Tagging
  
 
== Technische Dokumentation zum OSM-Dateiformat ==
 
== Technische Dokumentation zum OSM-Dateiformat ==
Zeile 87: Zeile 96:
 
Siehe [http://www.esri-germany.de/downloads/papers/OSM_in_ArcGIS9x.pdf Hinweise zur Nutzung von OSM in ArcGIS 9.x].
 
Siehe [http://www.esri-germany.de/downloads/papers/OSM_in_ArcGIS9x.pdf Hinweise zur Nutzung von OSM in ArcGIS 9.x].
  
== OSM REST API 0.5 ==
+
== Programming Resources ==
 +
 
 +
Tutorials:
 +
* uMap - Tool: [[OpenSchoolMaps]] > "uMap der Karteneditor". Example: [https://umap.osm.ch/en/map/electromobility-charging-stations-in-switzerland-b_941 "Electromobility Charging Stations"].
 +
* [[OpenSchoolMaps]] > Unterrichtsmaterialien > "OpenStreetMap-Daten beziehen und mit QGIS 3 nutzen (für Fortgeschrittene)" (Keywords: Overpass, QGIS QuickOSM-Plugin, OSM-Daten-Download).
 +
 
 +
Webapps and Tools:
 +
* Overpass - an OpenStreetMap query API with Web app ("Turbo"): [[Overpass API]]
 +
* Process OSM (history) data e.g. with command line osmium tool.
 +
 
 +
Web Mapping Clients:
 +
* >> [[OpenStreetMap für Webkarten]] <<
 +
* >> [[Leaflet]] Mapping Librariy in Javascript <<
 +
* [[Webmapping_Clients]]
 +
 
 +
OSM History:
 +
* [[Overpass]] with attic history data.
 +
* OSM History country extracts can be downloaded from (Geofabrik)[https://osm-internal.download.geofabrik.de/europe/switzerland.html] using OSM account as login.
 +
* ohsome History API: Covers only Germany.
 +
* GrapQL API to OSM Database based on postgraphile/PostGIS (https://github.com/singingwolfboy/graphile-build-postgis ) or https://github.com/hasura/graphql-engine connected to EOSMDBOne.
 +
 
 +
== Overpass ==
 +
 
 +
An OpenStreetMap query API with Web app ("Turbo"): See [[Overpass]].
 +
 
 +
== osm2pgsql ==
 +
Einer der beliebtesten "OSM-Daten zu PostgreSQL/PostGIS-DB" Converter und Loader.
 +
 
 +
Siehe '''[[Osm2pgsql]].
 +
 
 +
== Osmium-tool ==
 +
 
 +
Ein OSM-Daten Import- und Export-Tool (inkl. diffs). Liest/schreibt Dateien und Datenbanken (PostGIS).
 +
 
 +
Homepage: https://osmcode.org/osmium-tool/
 +
 
 +
== Osmosis ==
 +
 
 +
Ein OSM-Daten Import- und Export-Tool (inkl. diffs). Liest/schreibt Dateien und Datenbanken (PostGIS). Homepage: [http://wiki.openstreetmap.org/index.php/Osmosis Osmosis].
 +
 
 +
  >> Das Osmium-tool (siehe oben) ist neuer und schneller als Osmosis.
 +
    Ausserdem ist Osmosis nicht zu verwechseln mit dem QA-Tool [https://wiki.openstreetmap.org/wiki/Osmose Osmose] <<
 +
 
 +
=== Beispiel-Aufrufe ===
 +
 
 +
Entity Report: Erzeugt report-entity.txt
 +
  > java -jar osmosis.jar --read-xml switzerland.osm --report-entity
 +
 
 +
report-entity.txt:
 +
  ********** User Report **********
 +
  USER NAME                                          NODES  WAYS    RELNS 
 +
  anonymous                                          432095  41866  84     
 +
  fundriver                                          248    43      1     
 +
  gummibaerli                                        596    8      0     
 +
  ...
 +
 
 +
Integrity Report: Erzeugt report-integrity.txt (falls es Probleme gibt)
 +
  > java -Xmx1024m -jar osmosis.jar --read-xml switzerland.osm --report-integrity EnableDateParsing=no
 +
 
 +
=== Howto mit PostgreSQL ===
 +
 
 +
How to load an 0.6 OSM file into PostgreSQL (from J. Zobel on OSM-Dev mailing list; loaded Germany in about 6 hours):
 +
* Download PostgreSQL schema from Brett Henderson: http://gweb.bretth.com/apidb06-pgsql-latest.sql
 +
* Split the script into 2 parts at the COPY statements.
 +
* Run the first part to create the schema without indexes and foreign keys.
 +
* Run (the following is an example, adapt the parameters)
 +
  bin/osmosis --read-xml-0.6 file=~/Desktop/download/germany.osm.bz2
 +
  --write-apidb-0.6 host=localhost database=osm1 user=osm password=****
 +
  populateCurrentTables=yes validateSchemaVersion=no
 +
* When osmosis started to copy into the current_* tables, things slow down (nearly no disk writes, lots of reads). So add primary keys on nodes, node_tags, ways, way_nodes and way_tags and copying ran run fast
 +
* Run the second part of the schema script creating the missing indexes and FKs.
 +
 
 +
== Eigener OSM-Server installieren ==
 +
 
 +
Tile-Service als auch XML API.
 +
 
 +
Siehe [http://wiki.openstreetmap.org/index.php/The_Rails_Port The Rails Port] vom OSM-Wiki.
 +
 
 +
== OSM-Daten auf eigenem Server darstellen ('rendern') ==
 +
 
 +
  TIPP: Mit [[OpenStreetMap-in-a-Box]].
  
OSM REST API 0.5:  
+
* Als bereits gerenderte Rasterdatei über http://tah.openstreetmap.org
* [http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.5 Documentation]
+
* Via PostGIS (osm2pgsql) im UMN Mapserver:
* Example: http://api.openstreetmap.org/api/0.5/map?bbox=11.54,48.14,11.543,48.145
+
** mapnik config file (UMN Mapserver Mapfile?) is in SVN...?
* Example bbox:
+
** http://wiki.openstreetmap.org/index.php/Displaying_OSM_Shapefiles_In_Mapserver
** Example 11.54,48.14,11.543,48.145
+
** http://wiki.openstreetmap.org/index.php/Mapserver
** Bremen 8.4900,52.9195,9.123,53.234
+
* Via PostGIS im GeoServer
** Hannover 9.55,52.3,9.91,52.47
+
* Mapnik oder Osmarender lokal installieren...
** IsleOfWight -1.6,50.57,-1.0,50.77
+
** Mapnik-Rules: Siehe [http://geo.topf.org/mapnik/osm.xml] (Jochen Topf's XSLT)
** Rapperswil ...
+
* SVG direkt erzeugen...?
==OSM X API==
+
** Windows (im DOS-Fenster): % msxsl.exe osm-map-features-z15.xml -pi -o map.svg
* [http://wiki.openstreetmap.org/index.php/Osmxapi OsmXApi wiki entry]
+
*** wobei die Input-Datei data.osm heissen muss und '...-z15' dem Zoom-Level 15 entspricht (aus 12..17).  
 +
*** Bezug XML/XSLT: [http://svn.openstreetmap.org/applications/rendering/osmarender-frontend/ osmarender-frontend auf svn.openstreetmap.org]
 +
*** Bezug msxsl.exe: Siehe Microsoft Homepage.
  
 
[[Kategorie:Dateiformat]]
 
[[Kategorie:Dateiformat]]

Aktuelle Version vom 3. September 2020, 16:21 Uhr

Diese Seite enthält technische Aspekte zum OSM-Projekt. Die Einstiegsseite zu OpenStreetMap befindet sich hier.

Siehe auch:

Die OSM-'Tool Chain'

Die 'OSM-Tool Chain' (Quelle: F.Ramm, 2007)

Rechts in der Grafik ein Überblick über die Software, die zur Herstellung der Daten und der Karte auf der OSM-Startseite verwendet werden.

Verfügbarkeit der OSM-Webapplikationen und -Webservices: OSM-Plattform-Status

Routing

Einfaches Indoor-Routing (2D) geht mit OSM-Daten bereits (vgl. OpenRouteSerivce.org).

Links: [1]

Constraints/Checks:

  • Wege im Gebäude vorhanden und mit dem Straßennetz außerhalb des Gebäudes verbunden?
  • Für '3D' sind die Tags noch etwas experimentell
  • nicht verbundene Ways
  • auf die Digitalisierungsrichtung bei Oneways und zb Roundabouts achten?
  • richtige Schreibweisen der Highway-Values
  • "richtige"/genormte Schreibweise bei Straßennamen: "Str." vs. "Strasse" vs. "Straße" ....
  • "tote" Ways -> Ways ohne Nodes
  • Ways mit ein und derselben Node

3D Buildings

Indoor

Technische Dokumentation zum OSM-Dateiformat

OSM/XML besteht aus Knoten (Nodes), Kanten-Listen (Ways, früher: Segments) und Relations.

Import/Export der OSM-Daten

FAQ

How to get the OSM data?
If the size of the bounding box isn't too large osmxapi is great. osmxapi will return data from its own database, it's a web-based app; you don't need to download a planet file. If you want a large area or many areas, then switch to osmosis. Osmosis is a local application working on your own data file you need to download a planet file before.
How to get reliable bbox coordinates?
Use http://www.informationfreeway.org/ Google Earth is probably the simplest, possibly Google Maps.
Why are osm_id columns (generated from osm2pgsql) just almost but not completely unique?
Because a single feature in an OSM source file can translate into multiple "features" in the database. Parking areas which create nodes is the obvious one, but there are others like route-relations.

Notizen

Möglichkeiten:

Outdated:

Mobiles:

OSM zu Shapefiles konvertieren

Man beachte, dass es bedingt durch das Datenmodell von OSM keine einzig richtige Konversion gibt.

Ein Versuch eines Datenmodells, das topografischen Karten nahe kommt, wird hier diskutiert:

Ansonsten kann man vorsichtigerweise bei Nodes/Ways/Relations bleiben. Für kleinere Ausschnitte:

  1. Export-Tab auf openstreetmap.org => .osm lokal speichern.
  2. .osm zu GML konvertieren mit XSTL-Skript (Converting, verwendet xalan). Achtung: Das XSLT muss noch verbessert werden ('Closed Ways' fehlen).
  3. GML zu Shapefiles konvertieren mit OGR-Tools oder GeoConverter.

Für grössere Datenmengen:

  • Export nach .osm mit Planetfiles (siehe oben)
  • Import in PostgreSQL mit osm2pgsql

OSM in ArcGIS 9.x

Siehe Hinweise zur Nutzung von OSM in ArcGIS 9.x.

Programming Resources

Tutorials:

Webapps and Tools:

  • Overpass - an OpenStreetMap query API with Web app ("Turbo"): Overpass API
  • Process OSM (history) data e.g. with command line osmium tool.

Web Mapping Clients:

OSM History:

Overpass

An OpenStreetMap query API with Web app ("Turbo"): See Overpass.

osm2pgsql

Einer der beliebtesten "OSM-Daten zu PostgreSQL/PostGIS-DB" Converter und Loader.

Siehe Osm2pgsql.

Osmium-tool

Ein OSM-Daten Import- und Export-Tool (inkl. diffs). Liest/schreibt Dateien und Datenbanken (PostGIS).

Homepage: https://osmcode.org/osmium-tool/

Osmosis

Ein OSM-Daten Import- und Export-Tool (inkl. diffs). Liest/schreibt Dateien und Datenbanken (PostGIS). Homepage: Osmosis.

 >> Das Osmium-tool (siehe oben) ist neuer und schneller als Osmosis. 
    Ausserdem ist Osmosis nicht zu verwechseln mit dem QA-Tool Osmose <<

Beispiel-Aufrufe

Entity Report: Erzeugt report-entity.txt

 > java -jar osmosis.jar --read-xml switzerland.osm --report-entity

report-entity.txt:

 ********** User Report **********
 USER NAME                                          NODES   WAYS    RELNS   
 anonymous                                          432095  41866   84      
 fundriver                                          248     43      1       
 gummibaerli                                        596     8       0       
 ...

Integrity Report: Erzeugt report-integrity.txt (falls es Probleme gibt)

 > java -Xmx1024m -jar osmosis.jar --read-xml switzerland.osm --report-integrity EnableDateParsing=no

Howto mit PostgreSQL

How to load an 0.6 OSM file into PostgreSQL (from J. Zobel on OSM-Dev mailing list; loaded Germany in about 6 hours):

  • Download PostgreSQL schema from Brett Henderson: http://gweb.bretth.com/apidb06-pgsql-latest.sql
  • Split the script into 2 parts at the COPY statements.
  • Run the first part to create the schema without indexes and foreign keys.
  • Run (the following is an example, adapt the parameters)
 bin/osmosis --read-xml-0.6 file=~/Desktop/download/germany.osm.bz2
 --write-apidb-0.6 host=localhost database=osm1 user=osm password=****
 populateCurrentTables=yes validateSchemaVersion=no
  • When osmosis started to copy into the current_* tables, things slow down (nearly no disk writes, lots of reads). So add primary keys on nodes, node_tags, ways, way_nodes and way_tags and copying ran run fast
  • Run the second part of the schema script creating the missing indexes and FKs.

Eigener OSM-Server installieren

Tile-Service als auch XML API.

Siehe The Rails Port vom OSM-Wiki.

OSM-Daten auf eigenem Server darstellen ('rendern')

 TIPP: Mit OpenStreetMap-in-a-Box.