class: center, middle, inverse, title-slide # ICTs para la (ciclo)inclusión ## 🚗🚌🚲🚶
datos abiertos, ciencia ciudadana, como participar e incidir (Ideas sobre una herramienta ¡Pedalea!) ### Robin Lovelace, University of Leeds ### University of Leeds, ITS 2018-10-04 --- ## The scale of the challenge, from this... .pull-left[ <img src="https://pbs.twimg.com/media/DOH94nXUIAAgcll.jpg" width="100%" /> ] .pull-right[ Source: [Brent Toderian](https://twitter.com/BrentToderian) Any ideas which city this is? ] --- ## Towards cycling being the natural choice <img src="https://pbs.twimg.com/media/DJaWCo0U8AAzQGW.jpg:large" width="80%" /> Source: [Brent Toderian](https://twitter.com/BrentToderian) --- ## Problem: evidence overload <img src="https://larrycuban.files.wordpress.com/2015/02/data-overload-2.jpg" width="70%" /> -- - Challenge: operationalising this data -- - Needs to be provided in 'actionable' format -- - Requires skills + infrastructure --- ## A case study of an actionable tool: [w](http://npct0.vs.mythic-beasts.com/shiny_interface/?r=west-yorkshire)[ww.pct.bike](www.pct.bike) <div class="figure"> <img src="https://raw.githubusercontent.com/npct/pct-team/master/figures/pct-frontpage.png" alt="La Propensity to Cycle Tool (PCT), un collaboracion entre las universidades de Cambridge, Westminster y Leeds." width="80%" /> <p class="caption">La Propensity to Cycle Tool (PCT), un collaboracion entre las universidades de Cambridge, Westminster y Leeds.</p> </div> --- ## Building the web application - Started by writing various messy scripts -- ![](https://media.giphy.com/media/OMeGDxdAsMPzW/giphy.gif) -- But soon that became unsustainable --- ## Open source, what, how, why? -- - Que: Software libre. Puedes mirar el 'source code' (en castellano 'codigo fuente'): es transparente. No solo una cosa técnica. Es la communidad, e.g.: [Data Science Meetups Chile](https://www.meetup.com/topics/data-science/cl/) Vínculado con el concepto de datos abiertos. -- - ¿Como? Más fácil cada año -- Antes software como el Linux te cuesta mucho instalar -- ![](https://qph.fs.quoracdn.net/main-qimg-23c6374dfa3fc4ace9b9a930b64d0056-c) --- # Data abiertos - Cada vez hay más información en el dominio público - En Inglaterra, por ejemplo, una gran parte del censo está abierto: https://www.ukdataservice.ac.uk/get-data/open-data/census-data - En Ámerica Latina hay un gran movimiento de datos de libre acceso, e.g.: http://datos.gob.cl/ - Y las empresas estan librando cada vez data (e.g. Uber): -- ![](https://eng.uber.com/wp-content/uploads/2017/04/image00.gif) --- ## La necesidad de 'data science' - Con tanta informacion, hay que usar nuevas herramientas -- - Con Excel no se puede! - Y ademas los resultados tienen mayor impacto y utilidad si se pueden reproducir -- - Ejemplo: yo tuve que procesar OD data (datos origen-destino) par investigar la movilidad en bicicleta <table> <thead> <tr> <th style="text-align:left;"> </th> <th style="text-align:left;"> geo_code </th> <th style="text-align:left;"> geometry </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> 1708 </td> <td style="text-align:left;"> E02002384 </td> <td style="text-align:left;"> c(-1.54646277949532, 53.8095165330639) </td> </tr> <tr> <td style="text-align:left;"> 1712 </td> <td style="text-align:left;"> E02002382 </td> <td style="text-align:left;"> c(-1.51186137386083, 53.8116109775162) </td> </tr> <tr> <td style="text-align:left;"> 1805 </td> <td style="text-align:left;"> E02002393 </td> <td style="text-align:left;"> c(-1.52420468703814, 53.8040984466889) </td> </tr> </tbody> </table> --- ## Developing stplanr - With support from colleagues in LIDA I created **stplanr**, which works like this (after you have installed R): ```r library(stplanr) r = route_cyclestreet( from = "Chapeltown, Leeds", to = "University of Leeds" ) r ``` ``` ## class : SpatialLinesDataFrame ## features : 1 ## extent : -1.55247, -1.53145, 53.80275, 53.81671 (xmin, xmax, ymin, ymax) ## coord. ref. : +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 ## variables : 15 ## names : plan, start, finish, length, time, waypoint, cum_hill, change_elev, dif_max_min, up_tot, down_tot, av_incline, co2_saving, calories, busyness ## value : fastest, Chapeltown Road, Un-named link, 2663, 748, 113, 86, -8, 34, 39, 47, 0.0322944, 496, 54, 25613 ``` --- ## Visualising the results .pull-left[ - Thanks to existing open source tools for visualisation, we can plot this, e.g. with: ```r library(leaflet) m = leaflet() %>% addTiles() %>% addPolylines(data = r) %>% addMiniMap() %>% addScaleBar() ``` ] .pull-right[ ```r m ```
] --- ## Ensuring impact <!-- See https://twitter.com/robinlovelace/status/907261128354488320 --> <!-- <blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Scenario of cycling infrastructure in Leeds: <a href="https://t.co/FqehV7kAjc">https://t.co/FqehV7kAjc</a> Prelim. cost: ~£120m (without junction remodelling) for 157 km. <a href="https://twitter.com/hashtag/CyIPT?src=hash&ref_src=twsrc%5Etfw">#CyIPT</a> <a href="https://t.co/OHqC8axut5">pic.twitter.com/OHqC8axut5</a></p>— Robin Lovelace (robinlovelace) <a href="https://twitter.com/robinlovelace/status/907261128354488320?ref_src=twsrc%5Etfw">September 11, 2017</a></blockquote> --> <!-- <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> --> -- > The ‘Propensity to Cycle Tool’ shows that if residents of Greater Manchester were as likely to cycle as the Dutch we would increase commuter journeys ten-fold, leaving room on the road for people who had to drive. This level of cycling would lead to an estimated £1 billion per year saving to individuals and the local economy because of the resulting health benefits. (British Cycling’s chief executive, Julie Harrington, November 2017 see [britishcycling.org.uk](https://www.britishcycling.org.uk/campaigning/article/20171102-campaigning-news-British-Cycling-responds-to-Mayor-of-Greater-Manchester-Andy-Burham-s--congestion-conversation--0)) -- ~ 3 months later... -- > City cycling czar Chris Boardman has unveiled plans for a thousand miles of interlinked bike and walking lanes across Greater Manchester. Dubbed ‘Beelines’, the game-changing 10-year, £1.5bn proposal includes 75 miles of segregated cycle lanes similar to those found in Holland and Denmark ([Manchester Evening News](https://www.manchestereveningnews.co.uk/news/greater-manchester-news/cycling-walking-lanes-greater-manchester-14832995)) --- ## Deployment - Live demo at http://www.pct.bike/ - Get policy makers interested -- ![](https://raw.githubusercontent.com/npct/pct-team/master/figures/front-page-leeds-pct-demo.png)<!-- --> --- ## Links + references > - Contact: r.lovelace@leeds.ac.uk or [`@robinlovelace`](https://twitter.com/robinlovelace) - If you want to code in R 4 transport, start here: https://geocompr.robinlovelace.net/spatial-class.html - The PCT in action: http://www.pct.bike/ - A prototype of the CyIPT: http://cyipt.bike/ - Resource on R for transport: http://geocompr.robinlovelace.net/transport.html Citation Lovelace, R., Goodman, A., Aldred, R., Berkoff, N., Abbas, A., Woodcock, J., 2017. The Propensity to Cycle Tool: An open source online system for sustainable transport planning. Journal of Transport and Land Use 10. https://doi.org/10.5198/jtlu.2016.862 --- ## Capabilities of stplanr .pull-left[ - Convert origin-destination pairs into geographic lines Example datasets in **stplanr** Centroids (open access data): ```r head(cents_sf[1], 3) ``` ``` ## Simple feature collection with 3 features and 1 field ## geometry type: POINT ## dimension: XY ## bbox: xmin: -1.546463 ymin: 53.8041 xmax: -1.511861 ymax: 53.81161 ## epsg (SRID): 4326 ## proj4string: +proj=longlat +datum=WGS84 +no_defs ## geo_code geometry ## 1708 E02002384 POINT (-1.546463 53.80952) ## 1712 E02002382 POINT (-1.511861 53.81161) ## 1805 E02002393 POINT (-1.524205 53.8041) ``` ] .pull-right[ ### Origin-destination (OD) pairs ```r head(flow[c(1:3)], 2) ``` ``` ## Area.of.residence Area.of.workplace All ## 920573 E02002361 E02002361 109 ## 920575 E02002361 E02002363 38 ``` ] --- ## Making tabular data spatial Conversion to a spatial object with **stplanr** ```r l = od2line(flow, cents_sf) sf:::plot.sf(l[3:5], lwd = l$All / mean(l$All)) ``` ![](pedalea_files/figure-html/unnamed-chunk-13-1.png)<!-- --> --- ## Interactive visualisation is key .pull-left[ - Previous plot is not particularly revealing - Another visualisation will help ```r library(tmap) l$pwalk = l$On.foot / l$All m2 = tm_shape(l) + tm_lines( "pwalk", lwd = "All", scale = 10, palette = "RdYlBu") ``` ] .pull-right[ - Make the data come alive ```r tmap_leaflet(m2) ```
]