UrbanAnalyst / dodgr

Distances on Directed Graphs in R
https://urbananalyst.github.io/dodgr/
128 stars 16 forks source link

add OS open roads sample data #14

Closed mpadge closed 7 years ago

mpadge commented 7 years ago

to show how dodgr handles non-OSM street networks. @Robinlovelace wanna PR this? Just put some data there, and I should be able to take care of the rest.

Robinlovelace commented 7 years ago

Great stuff - now the mission is to integrate this in the vignette. You up for making a start on that? Or we could go directly for an academic write-up. Your call.

mpadge commented 7 years ago

Yeah, i guess this newly expanded functionality should be described in the vignette. I'm also very keen to start an academic write up imminently!

In the meantime, could you do one more thing, please? Just tidy the man entry for os_roads_bristol so it can be run. It currently relies on some .shp file that only you have, and also calls some lad16nm object that doesn't exist. It would also be good to state at the outset that "these data may be reproduced with the following lines of code." Thanks!

I'll re-open until:

Robinlovelace commented 7 years ago

Hi Mark, you can reproduce it by downloading the data from https://www.ordnancesurvey.co.uk/business-and-government/products/os-open-roads.html and running the commands.

However, there's no way to automate the process of delivering the 300 MB file - you need to fill-in an application form.

Robinlovelace commented 7 years ago

Demo that it is reproducible generated using reprex:

library(sf)
#> Linking to GEOS 3.5.1, GDAL 2.2.1, proj.4 4.9.2, lwgeom 2.3.3 r15473
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
os_roads <- sf::read_sf("~/data/roads-data/data/ST_RoadLink.shp")  # data must be unzipped here
u <- "https://opendata.arcgis.com/datasets/686603e943f948acaa13fb5d2b0f1275_4.kml"
lads <- sf::read_sf(u)
mapview::mapview(lads)
bristol_pol <- dplyr::filter(lads, grepl("Bristol", lad16nm))
os_roads <- st_transform(os_roads, st_crs(lads))
os_roads_bristol <- os_roads[bristol_pol, ] %>% dplyr::filter(class == "Motorway" & 
  roadNumber != "M32") %>% st_zm(drop = TRUE)
#> although coordinates are longitude/latitude, it is assumed that they are planar
mapview::mapview(os_roads_bristol)
Robinlovelace commented 7 years ago

Results just tested in new session:

image

Robinlovelace commented 7 years ago

(I love the place name Catbrain).

mpadge commented 7 years ago

oh, i see. Can you just describe the process then? Say that you have to register and manually download. I just did the vignette with this push. (Also re-inserted explicit section numbers coz pkgdown doesn't respect the number sections: true command - i checked on lotsa tidyverse packages, and they all omit section numbers, which is dumb!)

Robinlovelace commented 7 years ago

Sure.

Robinlovelace commented 7 years ago

Final thing: I suggest a visualisation of the a network measure such as centrality would be good to visualise how datasets such as OS Open Roads can be analysed with dodgr.

mpadge commented 7 years ago

sounds good, but it might be tricky to manage that at present without introducing additional package dependencies? If you can manage it, then great, otherwise I'll ref this in new issue about viz.

Robinlovelace commented 7 years ago

Good stuff.