Code to process raw data for WHO analyses
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Build Status Project Status: Concept - Minimal or no implementation has been done yet.

Data for who repo. To obtain local copes of all data, simply clone this repo, then run the following in the main repo directory:

devtools::load_all (".", export_all = FALSE)
download_who_data ()

That should be all that is required for to generate flow layers for each city via the flowlayers repo.

Population density download and pre-processing

(None of this should need to be run; it is code used to generate the initial files.)

worldpop (Accra and Kathmandu)

Data must be manually downloaded from worldpop. See ?worldpop_files (type = "zip") for list of which files need to be obtained. These should be in the relevant <city>/popdens directories (where <city> is “accra” or “kathmandu”). Then upload to the release v0.0.1-worldpop-zip-gha-npl with

library (whodata)
upload_worldpop_zipfiles ()

These should never be needed again, but can easily be downloaded from the repo with

download_worldpop_zipfiles ()

These files can then be converted to local .tif files with

crop_worldpop_tif (city = "accra")
crop_worldpop_tif (city = "kathmandu")

And then uploaded via piggyback to corresponding release v0.0.2-worldpop-tif-gha-npl with

upload_worldpop_tiffiles ()


There are no worldpop data for Europe, but the EC Joint Research Centre Data Catalogue offers 250m resolution global population density tif files. The main JRCDC page describing the relevant file leads leading to the download of, which is 1GB, and is not archived in this repo. This file can then be processed with

crop_global_tif (city = "Bristol")

Street network up- and down-load

library (sf) # pre-load required
cities <- who_cities () # accra, kathmandu, bristol
junk <- lapply (cities, function (i) get_who_streets (city = i))
junk <- lapply (cities, function (i) get_who_buildings (city = i))
junk <- lapply (cities, function (i) get_who_busstops (city = i))

Then upload to repo with

upload_osm ()

and download with

download_osm ()

Population densities matched to street network nodes

This is done via the popdens package, using the single pop2point function. Simply

popdens::pop2point (city = "kathmandu")
popdens::pop2point (city = "accra")
whodata::upload_popdens_nodes ()