Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OpenStreetMap: An Introduction

OpenStreetMap: An Introduction

Learn the basics of OpenStreetMap and what you can do with the data.

Michael Fogleman

March 02, 2016
Tweet

More Decks by Michael Fogleman

Other Decks in Programming

Transcript

  1. Not the prettiest maps. But lots of cool data is

    in there. And it’s all freely available!
  2. OPENSTREETMAP STEP 1: ACQUIRE THE DATA ▸ Straight from the

    source ▸ openstreetmap.org > Export ▸ Bulk downloads ▸ download.geofabrik.de ▸ Through an API ▸ http://wiki.openstreetmap.org/wiki/Overpass_API/ Language_Guide 2016-03-02
  3. OPENSTREETMAP STEP 2: UNDERSTAND THE FILE FORMATS ▸ .osm -

    XML format ▸ .osm.pbf - Binary protocol buffer format (much smaller on disk) ▸ Some tools / parsers only work with one format ▸ Convert between formats: ▸ osmosis --read-xml input.osm --write-pbf output.osm.pbf ▸ Filter the file contents: ▸ osmfilter --keep="highway=" input.osm > output.osm 2016-03-02
  4. OPENSTREETMAP STEP 3: FIND AN OSM PARSER IN YOUR FAVORITE

    LANGUAGE ▸ Python ▸ http://imposm.org/docs/imposm.parser/latest/ ▸ Go ▸ https://github.com/qedus/osmpbf ▸ Javascript ▸ https://github.com/marook/osm-read ▸ https://www.npmjs.com/package/osmparser ▸ Lots of others… 2016-03-02
  5. OPENSTREETMAP STEP 4: UNDERSTAND THE DATA STRUCTURES! ▸ Node (Point)

    ▸ ID, Latitude, Longitude, Tags ▸ Way (Polyline) ▸ ID, Node IDs, Tags ▸ Relation (Group) ▸ ID, Member IDs, Tags 2016-03-02
  6. OPENSTREETMAP TAGS: HIGHWAY= ▸ motorway ▸ trunk ▸ primary ▸

    secondary ▸ tertiary ▸ unclassified ▸ residential ▸ service 2016-03-02
  7. OPENSTREETMAP SOME INTERESTING TAGS ▸ oneway=yes ▸ building=yes ▸ height=10

    (meters by default) ▸ highway= traffic_signals ▸ name=Park Avenue ▸ maxspeed=50 (km/h by default) 2016-03-02