Learn R Programming

Rnightlights (version 0.2.4)

getPolyFnamePath: Get the path of the unzipped polygon directory downloaded from GADM.ORG

Description

Get the path of the unzipped polygon directory downloaded from GADM.ORG. Note the polygons are in ESRI Shapefile format thus when unzipped create a directory with the name <ctrycode>_adm_shp e.g. KEN_adm_shp. The directory will contain a number of files including the .shp file. rgdal::readOGR can read a shapefile polygon when given the directory path. It will determine which files to read.

Usage

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

Arguments

ctryCode

character the ISO3 code of the country

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 path to polygon shapefile directory

Examples

Run this code
# NOT RUN {
Rnightlights:::getPolyFnamePath("KEN")
 #returns "dataPath/polygons/KEN_adm_shp"
 
#@export only due to exploreData() shiny app
# }

Run the code above in your browser using DataLab