Learn R Programming

Rnightlights (version 0.2.4)

getCtryPolyUrl: Get the GADM url from which to download country polygons

Description

Get the url from which to download country polygons. Polygons are downloaded from http://gadm.org. This provides the url to the zipped ESRI Shapefile which when decompressed contains a directory with the different country admin level boundary files. A sample url returned for Afghanistan: http://biogeo.ucdavis.edu/data/gadm2.8/shp/AFG_adm_shp.zip

Usage

getCtryPolyUrl(ctryCode = NULL,
  gadmVersion = pkgOptions("gadmVersion"),
  gadmPolyType = pkgOptions("gadmPolyType"), custPolyPath = NULL)

Arguments

ctryCode

character string The ctryCode of interest

gadmVersion

The GADM version to use

gadmPolyType

The format of polygons to download from GADM

custPolyPath

Alternative to GADM. A path to a custom shapefile zip

Value

Character string url of the zipped ESRI shapefile for the ctryCode

Examples

Run this code
# NOT RUN {
ctryCode <- "KEN"
Rnightlights:::getCtryPolyUrl(ctryCode)
 #returns url for the zipped country ESRI shapefile

# }

Run the code above in your browser using DataLab