{"id":16276239,"url":"https://github.com/robinlovelace/pollutedroutes","last_synced_at":"2026-01-21T02:32:07.714Z","repository":{"id":153981642,"uuid":"81490128","full_name":"Robinlovelace/pollutedRoutes","owner":"Robinlovelace","description":"Identification of travel routes commonly walked and cycled for air pollution research","archived":false,"fork":false,"pushed_at":"2017-02-09T20:37:55.000Z","size":1309,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T16:12:21.454Z","etag":null,"topics":["air-quality","cycling","hackathon","rstats","transport","walking"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robinlovelace.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-02-09T20:06:29.000Z","updated_at":"2022-12-17T08:02:06.000Z","dependencies_parsed_at":"2023-09-22T03:26:29.097Z","dependency_job_id":null,"html_url":"https://github.com/Robinlovelace/pollutedRoutes","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"6197a0a133e2b37bd73705f1e11f4b3214bf4053"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinlovelace%2FpollutedRoutes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinlovelace%2FpollutedRoutes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinlovelace%2FpollutedRoutes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinlovelace%2FpollutedRoutes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robinlovelace","download_url":"https://codeload.github.com/Robinlovelace/pollutedRoutes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247887560,"owners_count":21012983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["air-quality","cycling","hackathon","rstats","transport","walking"],"created_at":"2024-10-10T18:47:30.932Z","updated_at":"2026-01-21T02:32:07.708Z","avatar_url":"https://github.com/Robinlovelace.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\nalways_allow_html: yes\n---\n\n# pollutedRoutes\nIdentification of travel routes commonly walked and cycled for air pollution research\n\n## Download route data \n\nThere is a large open dataset on travel to work patterns provided by WICID.\n\nA pre-processed and geographically specific version of this dataset was made available by the Propensity to Cycle Tool (PCT) project (Lovelace et al. 2016).\n\nThis can be downloaded, and subset to Leeds as follows:\n\n```{r}\nurl_lines = \"https://github.com/npct/pct-data/raw/master/west-yorkshire/l.Rds\"\ndownload.file(url = url_lines, destfile = \"l.Rds\")\nl = readRDS(\"l.Rds\")\nmost_walked = head(order(l$foot, decreasing = TRUE), n = 5)\nl_most_walked = l[most_walked,]\nplot(l_most_walked)\n```\n\nLet's save that into a language-neutral open geographic file format:\n\n```{r}\ngeojsonio::geojson_write(input = l_most_walked, file = \"l_most_walked.geojson\")\n```\n\nWe can plot this as an interactive map as follows:\n\n```{r}\nlibrary(leaflet)\nleaflet() %\u003e%\n  addTiles() %\u003e% \n  addPolylines(data = l_most_walked)\n```\n\n\nHow many trips are represented in that data?\n\n```{r}\nsum(l_most_walked$all)\n```\n\nWow, 5000 trips in just 5 routes: that's a LOT of travel into the centre of Leeds from 5 of the clostest MSOA zones (average population: ~7000).\n\nHow many of those are walked?\n\n```{r}\nsum(l_most_walked$foot)\n```\n\nOver half of them!\n\nThat should not be a surprise as the distances involved are so short, averaging around 1.5 km straight-line distance:\n\n```{r}\nlibrary(stplanr)\nline_length(l_most_walked) # results in m\n```\n\n## Route allocation\n\nWe can allocate these routes to the travel network using a routing service such as GraphHopper:\n\n```{r}\nr_most_walked = line2route(l = l_most_walked, route_fun = route_graphhopper, vehicle = \"foot\")\nplot(r_most_walked)\ngeojsonio::geojson_write(input = r_most_walked, file = \"r_most_walked.geojson\")\n```\n\nWe can look at the buffer of likely walked routes now, as follows:\n\n```{r}\nr_buff = buff_geo(shp = r_most_walked, width = 200) # 200 m buffer\nplot(r_buff)\n```\n\nThat represents corridors with high numbers of walkers commuting who may be vulnerable to air polution.\n\nLet's save the result and get on with the challenge!\n\n```{r}\ngeojsonio::geojson_write(input = r_buff, file = \"r_buf.geojson\")\n```\n\n\n## References\n\nLovelace, R., Goodman, A., Aldred, R., Berkoff, N., Abbas, A., Woodcock, J., 2016. The Propensity to Cycle Tool: An open source online system for sustainable transport planning. Journal of Transport and Land Use 10. doi:10.5198/jtlu.2016.862\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinlovelace%2Fpollutedroutes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinlovelace%2Fpollutedroutes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinlovelace%2Fpollutedroutes/lists"}