download_boundaries | R Documentation |
Download the administraive boundary shapefile from geoboundaries and copy it to its corresponding folder.
download_boundaries(
mainPath,
location,
adminLevel,
type = "gbAuthoritative",
alwaysDownload = FALSE
)
mainPath |
character; the parent directory of the location folder |
location |
character; the location folder name |
adminLevel |
integer; administrative level of the boundaries. From 0 to 3. |
type |
character; data type. Can be 'gbOpen' for geoBoundaries data, 'gbHumanitarian' for UN OCHA CODs data, or 'gbAuthoritative' for UN SALB data (default). |
alwaysDownload |
logical; should the administrative boundaries always be downloaded, even if they have already been downloaded? If FALSE and if the administrative boundary shapefile has already been downloaded the user is interactively asked whether they want to download it again or not. |
The ISO code used to download the shapefile is retrieved by the internal get_param
function. Another internal function
will query the geoBoundaries database (geoboundaries_query) to check availability and retrieve a json file that contains the download link.
Runfola, D. et al. (2020) geoBoundaries: A global database of political administrative boundaries. PLoS ONE 15(4): e0231866. https://doi.org/10.1371/journal.pone.0231866
# Replace workDir with the actual path to your working directory
## Not run:
mainPath <- "workDir"
initiate_project(mainPath)
## End(Not run)
# Replace myLocation with the location name you are working on (workDir subfolder)
## Not run:
location <- "myLocation"
download_boundaries(mainPath, location, adminLevel = 1, type = "gbOpen", alwaysDownload = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.