OpenStreetMap


townsendjennings.com/osm-data-tools



Jennings Anderson
Project EPIC, Dept. of Computer Science
University of Colorado Boulder

February 22, 2017

Opening Question

What type of OSM data needs do you have?

openstreetmap.org, Amy Lee Walton (Mapbox Gallery), Stamen Designs

monochome.com, MapOnShirt, MaptimeSLC

OpenStreetMap is everywhere

..all of these companies

(Mapbox Clients)

Craigslist

National Geographic

"Improve this Map"

If not this, then typically OSM

Port-Au-Prince, Haiti

January 10, 2010: 7.0M earthquake strikes Haiti

2010 Haiti Earthquake (wikipedia)

Haiti Earthquake 2010

2013 Typhoon Yolanda (Philippines)

Nepal Earthquake 2015

The Open Database License (ODbL)

OSM Data Model

Semi-Structured GeoSpatial Data

Points? Lines? Polygons?

Points, Lines, Polygons

Nodes, Ways, Relations (sort of)

OpenStreetMap Data: Node


  
  
  


OpenStreetMap Data: Way


  
  
  
  
  
  
  
  
  
  
  
  
  ...
  
  
  
  
  
  
  
  
  


OpenStreetMap Data: Way


  
  
  
  
  
  ...
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  


OpenStreetMap Data: Tags

  • Descriptive, non-spatial characteristic of a map object
  • Unrestricted key-value pairs added to any map object.


Example tags for OSM objects in New York City

Objects w/ tag Key Most-common values
66% building yes, garage, house, school
64% height 8.2, 8.0
13% highway residential
11% name (various)
2% amenity parking, bicycle parking

OSM Data Types

xml (.osm / .osh)
pbf (.osm.pbf .osh.pbf)
Vector Tiles(.mbtiles)

Obtaining OSM Data

Overpass API

wiki.openstreetmap.org/wiki/Overpass_API

Optimized for read-only DB access.

Custom query language

The Overpass Turbo project is very helpful

planet.openstreetmap.org

Full history file is also available:

- Every version of an object

- Timestamp, user, version #

planet.openstreetmap.org/planet/full-history/
Vector Tile Description
OSM-QA-Tiles

Tools for Handling OSM Data

Benefits of an active dev community:
There are a lot of them, depending on your needs

osmium library

osmcode.org

The primary library for working with full OSM data formats.

Written in C++, ported to Python, Node

Standalone utility as well

osm2pgsql

wiki/osm2pgsql

Command-Line utility to populate PostGIS database with OSM data

Tile-Reduce

Tile Reduce 3 OSM Coverage from Mapbox on Vimeo.

Tile Reduce Example

OSM Lint (Bridge On Node)

use 'strict';
var turf = require('turf');

// Identify Point geometries with a bridge tag.
module.exports = function(tileLayers, tile, writeData, done) {
  var layer = tileLayers.osm.osm;
  var result = layer.features.filter(function(val) {
    if (val.properties.bridge && (val.geometry.type === 'Point')) {
      val.properties._osmlint = 'bridgeonnode';
      return true;
    }
  });

  if (result.length > 0) {
    var fc = turf.featureCollection(result);
    writeData(JSON.stringify(fc) + '\n');
  }

  done(null, null);
};

Tile-Reduce Examples

OSM Lint

My OSM Analyses (osm-analysis-collab with Mapbox)

OSM-Analytics.org

OSM Analytical Databases

Currently an active area of research...

Open Schema?

NoSQL? SQL?

MongoDB: NoSQL document store. Works for smaller areas (small Countries) Epic-OSM

Who are the stakeholders?

Discussion

Examples?

Epic-OSM

Tile Reduce

pyosmium

Contributor Centric QA

Thanks!

Questions?

@jenningsatcu
jennings.anderson@colorado.edu