class: center, middle, inverse, title-slide # Geospatial Network Analysis in R ##
sfnetworks
in 7 minutes or less ### Lorena Abad ### 2021-02-10 --- class: center, middle, hide-logo <STYLE type='text/css' scoped> PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em}; </STYLE> ## What are geospatial networks? -- .pull-left[ ![](figs/road_network.png) ] -- .pull-right[ ![](figs/river_network.png) ] --- class: center, middle, hide-logo #### Most popular spatial network analyst software? -- ## ArcGIS! ![](https://www.esri.com/content/dam/esrisites/en-us/arcgis/products/arcgis-network-analyst/device-follow-your-existing-workflow.png) .footnote[Image © ESRI] --- class: hide-logo .pull-left[ ## Why R then? - Free and Open-source - Go to Data Science coding language - Super nice visualization libraries - Amazing user community ] -- .pull-right[ .center[ ![:scale 100%](https://github.com/allisonhorst/stats-illustrations/raw/master/rstats-artwork/r_first_then.png) ] ] .footnote[ Art from [@allison_horst](https://twitter.com/allison_horst) ] --- class: center, middle, hide-logo ## R's potential ![](https://raw.githubusercontent.com/allisonhorst/stats-illustrations/master/rstats-artwork/rainbowr.gif) .footnote[ Art from [@allison_horst](https://twitter.com/allison_horst) ] --- class: center, middle, hide-logo ## Spatial Analysis in R ![:scale 70%](https://github.com/allisonhorst/stats-illustrations/raw/master/rstats-artwork/sf.png) .footnote[ Artwork by [@allison_horst](https://twitter.com/allison_horst) ] --- class: center, middle, hide-logo ## Network Analysis in R ![:scale 25%](https://www.r-graph-gallery.com/313-basic-circle-packing-with-several-levels_files/figure-html/thecode3a-1.png) ![:scale 25%](https://www.r-graph-gallery.com/313-basic-circle-packing-with-several-levels_files/figure-html/thecode3d-1.png) ![:scale 24%](https://www.r-graph-gallery.com/313-basic-circle-packing-with-several-levels_files/figure-html/thecode3b-1.png) ![:scale 25%](https://www.r-graph-gallery.com/313-basic-circle-packing-with-several-levels_files/figure-html/thecode3e-1.png) ![:scale 25%](https://www.r-graph-gallery.com/314-custom-circle-packing-with-several-levels_files/figure-html/thecode3c-1.png) .footnote[ Graphs from [R Graph Gallery](https://www.r-graph-gallery.com) ] --- class: center, middle, hide-logo ## How to combine them? -- .pull-left[ ![](figs/sf.png) ] -- .pull-right[ ![:scale 38%](https://raw.githubusercontent.com/thomasp85/tidygraph/master/man/figures/logo.png) ] -- .center[ ![:scale 20%](https://raw.githubusercontent.com/luukvdmeer/sfnetworks/master/man/figures/logo.png) ] --- class: center, middle ### What is the core? > A data structure that can be provided as input to both graph analytical functions of tidygraph and to spatial analytical functions of sf, without the need for conversion. -- <br> > On top of that, it contains a set of spatial network specific functions that can be used alongside the offer of the two ‘parent packages’. --- class: center, middle ### What can we do? --- class: middle ### What can we do? #### Network cleaning <img src="index_files/figure-html/clean2-1.png" width="864" /> --- class: middle ### What can we do? #### Network cleaning: Simplifying edges <img src="index_files/figure-html/clean3-1.png" width="864" /> --- class: middle ### What can we do? #### Network cleaning: Subdividing edges <img src="index_files/figure-html/clean4-1.png" width="864" /> --- class: middle ### What can we do? #### Network cleaning: Removing pseudo-nodes <img src="index_files/figure-html/clean5-1.png" width="864" /> --- class: middle ### What can we do? #### Network cleaning: Simplifying intersections <img src="index_files/figure-html/clean6-1.png" width="864" /> --- class: middle ### What can we do? #### Convert foreign objects: from OSM lines <img src="index_files/figure-html/demo2-1.png" width="864" /> --- class: middle ### What can we do? #### Convert foreign objects: to network representations <img src="index_files/figure-html/demo7-1.png" width="864" /> --- class: middle ### What can we do? #### Shortest path calculations <img src="index_files/figure-html/unnamed-chunk-2-1.png" width="864" /> --- class: middle ### What can we do? #### Shortest path calculations <img src="index_files/figure-html/unnamed-chunk-3-1.png" width="864" /> --- class: middle ### What can we do? #### Shortest path calculations <img src="index_files/figure-html/unnamed-chunk-4-1.png" width="864" /> --- class: middle ### What can we do? #### Closest facility analysis <img src="index_files/figure-html/unnamed-chunk-6-1.png" width="864" /> --- class: middle ### What can we do? #### Closest facility analysis <img src="index_files/figure-html/unnamed-chunk-7-1.png" width="864" /> --- class: middle ### What can we do? #### Closest facility analysis <img src="index_files/figure-html/unnamed-chunk-8-1.png" width="864" /> --- class: middle ### What can we do? #### Closest facility analysis <img src="index_files/figure-html/unnamed-chunk-9-1.png" width="864" /> --- class: middle ### What can we do? #### And much more! Some tips here to get started with the coding! https://luukvdmeer.github.io/sfnetworks/ --- class: center, middle # Thank you! #### Q&A .footnote[ Slides powered by [xaringan](https://github.com/yihui/xaringan) and [xaringanthemer](https://github.com/gadenbuie/xaringanthemer) ]