Slide 1

Slide 1 text

OPENSTREETMAP MICHAEL FOGLEMAN 2016-03-02 speakerdeck.com/fogleman

Slide 2

Slide 2 text

OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Not the prettiest maps. But lots of cool data is in there. And it’s all freely available!

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

OPENSTREETMAP TAGS: HIGHWAY= ▸ motorway ▸ trunk ▸ primary ▸ secondary ▸ tertiary ▸ unclassified ▸ residential ▸ service 2016-03-02

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

QUESTIONS?