30
Mapping time using CartoDB to enable bigdata(™) on the client Andrew Hill & Simon Tokumine Friday, 28 September 12

Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Mapping timeusing CartoDB to enable bigdata(™) on the client

Andrew Hill & Simon Tokumine

Friday, 28 September 12

Page 2: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

GeneralistVizzuality

Friday, 28 September 12

Page 3: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Work Products Clients About Blog

Working to improve ourWorking to improve ourworld, one project at a time.world, one project at a time.From data visualization to citizen science, it is all about stories that matterFrom data visualization to citizen science, it is all about stories that matter

RECENT WORK

View more projects

LATESTLATEST Subscribe to RSS

Our project Evolution of the Web was declared Project of the Day by the FWA. Check it!

Evolution Of Web 2.0Google

Endangered LanguagesGoogle

GFW 2.0 PrototypeWorld Resources Institute

Irekia 2.0Basque Government

Carbon CalculatorUNEP-WCMC

OldWeatherZooniverse

PlanetHuntersZooniverse

ProtectedPlanetUNEP-WCMC

NGO Aid MapInteraction

Red List Geospatial ToolKew Gardens

NEEMO MISSIONNASA

Antarctic Field GuideSCARMARBIN

Wed, 12 Sep 2012The Graphical Web:Advanced mappingtechniques for real projectsWe’ve been today in Zurich at TheGraphical Web, an amazingconference for discussing “what isaesthetically possible on the web”.@saleiva has participated in asession on 2D Web Mapping andWeb-GIS ...Read more

Mon, 30 Jul 2012The Old Weather project iscomplete - 1.6 Million newobservationsThe Old Weather Project, a citizenscience initiative by Zooniverse, hasreached its goal: all the logbooks from280 World War I Royal Navy shipshave been read and transcribed intheir entirety. This...Read more

Mon, 09 Jul 2012Evolution of the Web 2.0Two weeks ago we launched TheEvolution of the Web, a revamped,dynamic visualization of the history ofweb technologies and browsers, andthe growth of global internet usersand traffic since the ear...Read more

Map data ©2012 Google, Tele Atlas - Terms of Use

We are an open source company

[email protected]

Come and meet us at Madrid office, we are only2 hours away by plane

148 Lafayette Street,Penthouse, NY 10013

+1 347 460-5284

NEW YORK

c/Hortaleza, 48, 1.28004, Madrid - Spain

+34 659 157 916

MADRID

Works Products Clients About Blog

Friday, 28 September 12

member of Vizzuality. Small agency. Madrid and NYC. Data visualization. Working on stories that matter. Here to talk about CartoDB and some of the cool things you can do with it.

Page 4: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Same old thingsServer configGeospatial Database (backups, optimal config)Import/exportAdmin UI and configTiler + interactivity APIData APICachingAuthentication...

Friday, 28 September 12

hosted geospatial database (postgis) + nice gui to take the grunt work out of our geospatial projects

Page 5: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Friday, 28 September 12

hosted geospatial database (postgis) + nice gui to take the grunt work out of our geospatial projects

Page 6: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Friday, 28 September 12

Page 7: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Friday, 28 September 12

Page 8: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Friday, 28 September 12

Page 9: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

CartoDB APIsMaps API SQL API

Friday, 28 September 12

Page 10: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

SQL APIHTTP data API Full postgis 2.0R/W via API keysPublic accessRead only cache layerCDN'able

Friday, 28 September 12

Page 12: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

SQL API

Friday, 28 September 12

Page 13: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

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

Friday, 28 September 12

Page 14: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

_Traditional approachDownload the data to the client and render it.http://goo.gl/c6KxN - Recent earthquakeshttp://goo.gl/B7NK6 - Syria casualties

Friday, 28 September 12

Page 15: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Friday, 28 September 12

Page 16: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

_n-GB? n-Million rows?the problem

Friday, 28 September 12

Page 17: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Friday, 28 September 12

Page 19: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

“Even though you can bring big data into the client you might not want to take all of it. There's definitely a case for taking slices of it”

http://www.youtube.com/watch?v=zH5bJSG0DZk&feature=youtu.be&t=2h44m20s

Josh Livni & Chris Broadfoot - Google. SXSW 2012.

Friday, 28 September 12

Page 20: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

_n-GB? n-Million rows?redefining the problem

Friday, 28 September 12

Page 21: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

_Acceptable granularity?redefining the problem

Friday, 28 September 12

Maybe Josh and Chris were talking about windowing/streaming, but maybe they were talking about datacubes.

Page 22: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Datacubes

Friday, 28 September 12

Page 23: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Datacubes•BI/Finance analysis•multidimensional•summary data•binned variables

Friday, 28 September 12

Aka. Hypercubes/OLAP cubes (Make city people sound like they're lawnmowerman)

Page 24: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

DatacubesCons•can be lossy•take time to generate

Pros •fast access•lightweight•cachable

Friday, 28 September 12

Aka. Hypercubes/OLAP cubes (Make city people sound like they're lawnmowerman)

Page 25: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

_Can we cube the data?rather than tile it?

Friday, 28 September 12

Real world usage. Can we replace tiles with these?

Page 26: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

Friday, 28 September 12

Page 27: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

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

Friday, 28 September 12

Page 28: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

{    rows:  [    {        x:  0,        y:  0,        vals:  [2],        dates:  [457]    },    {        x:  1,        y:  0,        vals:  [1,1,4],        dates:  [2,3,4]        }    ]}

Friday, 28 September 12

Page 29: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

1

10

100

1000

3mb 70mb 300mb1.5

21.2

300

70

3

Raw Datacube

Payload sizesFriday, 28 September 12

Page 30: Mapping time - NYHOLTgijs.github.io/images/cartodb_datacubes.pdfworld, one project at a time. From data visualization to citizen science, it is all about stories that matter RECENT

_Thanks!Checkout www.cartodb.com for more!

Friday, 28 September 12