Using CartoDB to analyze OpenStreetMap data

81
Analyzing OpenStreetMap using CartoDB Sunday, October 14, 12

description

A brief introduction to CartoDB and some of its powerful features for working with OpenStreetMap data. Given in October 2012 at StateoftheMap PDX

Transcript of Using CartoDB to analyze OpenStreetMap data

Page 1: Using CartoDB to analyze OpenStreetMap data

Analyzing OpenStreetMap using CartoDB

Sunday, October 14, 12

Page 2: Using CartoDB to analyze OpenStreetMap data

Senior scientist and developer @vizzualityFind me @andrewxhill

Sunday, October 14, 12

Page 3: Using CartoDB to analyze OpenStreetMap data

User, developer, and pusher of limits @cartodbFind me @andrewxhill

Sunday, October 14, 12

Page 4: Using CartoDB to analyze OpenStreetMap data

blog.cartodb.comSunday, October 14, 12

Page 5: Using CartoDB to analyze OpenStreetMap data

So tell me already,What is CartoDB?

Sunday, October 14, 12

Page 6: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 7: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 8: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 9: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 10: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 11: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 12: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 13: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 14: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 15: Using CartoDB to analyze OpenStreetMap data

CartoDB is a tool to build applications and master your geospatial data

Sunday, October 14, 12

Page 16: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 17: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 18: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 19: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 20: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 21: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 22: Using CartoDB to analyze OpenStreetMap data

Importing OSM data into CartoDB it’s sooooo easy

Sunday, October 14, 12

Page 23: Using CartoDB to analyze OpenStreetMap data

We support directly importing OSM and other formats too!

shp, csv, kml, etc

Sunday, October 14, 12

Page 24: Using CartoDB to analyze OpenStreetMap data

CartoDB uses osm2pgsql it keeps it simple

Sunday, October 14, 12

Page 25: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 26: Using CartoDB to analyze OpenStreetMap data

1 OSM file becomes 4 CartoDB tables

1. Points2. Polygons3. Roads4. Linestrings

Sunday, October 14, 12

Page 27: Using CartoDB to analyze OpenStreetMap data

Import local data from .org or mirror simple drag-drop support on most browsers

Sunday, October 14, 12

Page 28: Using CartoDB to analyze OpenStreetMap data

Or! Import directly from URL www.openstreetmap.org

Sunday, October 14, 12

Page 29: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 30: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 31: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 32: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 33: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 34: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 35: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 36: Using CartoDB to analyze OpenStreetMap data

From here the sky is the limit combine SQL, CartoCSS, and APIs with ease

Sunday, October 14, 12

Page 37: Using CartoDB to analyze OpenStreetMap data

no. seriously.

Sunday, October 14, 12

Page 38: Using CartoDB to analyze OpenStreetMap data

SQLremember. it’s everywhere

Sunday, October 14, 12

Page 39: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 40: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 41: Using CartoDB to analyze OpenStreetMap data

EMBEDsql is everywhere

Sunday, October 14, 12

Page 42: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 43: Using CartoDB to analyze OpenStreetMap data

SQL APIsql is everywhere

Sunday, October 14, 12

Page 44: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 45: Using CartoDB to analyze OpenStreetMap data

youraccount/osmtable/11/1022/679.png

youraccount/osmtable/11/1022/679.png?yada WHERE rail

Sunday, October 14, 12

Page 46: Using CartoDB to analyze OpenStreetMap data

CREATIVITYsql is everywhere

Sunday, October 14, 12

Page 47: Using CartoDB to analyze OpenStreetMap data

not for me

Sunday, October 14, 12

Page 48: Using CartoDB to analyze OpenStreetMap data

http://goo.gl/orkoqSunday, October 14, 12

Page 49: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 50: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 51: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 52: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 53: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 54: Using CartoDB to analyze OpenStreetMap data

CLIENT SIDELeaflet, Google Maps, Backbone, D3

Sunday, October 14, 12

Page 55: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 56: Using CartoDB to analyze OpenStreetMap data

ORmore practical things

Sunday, October 14, 12

Page 57: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 58: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 59: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 60: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 61: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 62: Using CartoDB to analyze OpenStreetMap data

INNOVATIONthey don’t let us sleep...

Sunday, October 14, 12

Page 63: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 64: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 65: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 66: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 67: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 68: Using CartoDB to analyze OpenStreetMap data

_I want to see ‘X’ over timeusing the SQL API with big data

Sunday, October 14, 12

Page 69: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 70: Using CartoDB to analyze OpenStreetMap data

WITH  hgrid            AS  (SELECT  Cdb_rectanglegrid(Cdb_xyz_extent(8,  12,  5),                                  Cdb_xyz_resolution(5)  *  4,                                                        Cdb_xyz_resolution(5)  *  4)  AS  cell)  SELECT  x,                y,                Array_agg(c)  vals,                Array_agg(d)  dates  FROM      (SELECT  St_xmax(hgrid.cell)                                                                                        x,                                St_ymax(hgrid.cell)                                                                                        y,                                Count(i.cartodb_id)                                                                                        c,                                Floor((  Date_part('epoch',  built)  -­‐  -­‐10418716800  )  /  32837875)  d                  FROM      hgrid,                                us_po_offices  i                  WHERE    St_intersects(i.the_geom_webmercator,  hgrid.cell)                  GROUP    BY  hgrid.cell,                                      Floor((  Date_part('epoch',  built)  -­‐  -­‐10418716800  )  /  32837875)                )  f  GROUP    BY  x,                      y

Sunday, October 14, 12

Page 71: Using CartoDB to analyze OpenStreetMap data

1

10

100

1000

3mb 70mb 300mb1.5

21.2

300

70

3

Raw Datacube

Payload sizesSunday, October 14, 12

Page 72: Using CartoDB to analyze OpenStreetMap data

http://goo.gl/TsGsr

Sunday, October 14, 12

Page 73: Using CartoDB to analyze OpenStreetMap data

https://dl.dropbox.com/u/580074/osm_edits_in_madrid.mov

Sunday, October 14, 12

Page 74: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 75: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 76: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 77: Using CartoDB to analyze OpenStreetMap data

That’s CartoDB + OpenStreetMap in a nutshell come talk to me, I’m sure I missed much more

Sunday, October 14, 12

Page 78: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 79: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 80: Using CartoDB to analyze OpenStreetMap data

Sunday, October 14, 12

Page 81: Using CartoDB to analyze OpenStreetMap data

Thanks!@andrewxhill

Sunday, October 14, 12