getPolyFnamePath: Get the path of the unzipped polygon directory downloaded...

Description Usage Arguments Value Examples

View source: R/polygons.R

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

1
2
3
4
5
6
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

1
2
3
4
Rnightlights:::getPolyFnamePath("KEN")
 #returns "dataPath/polygons/KEN_adm_shp"

#@export only due to gui() shiny app

chrisvwn/Rnightlights documentation built on Sept. 7, 2021, 1:44 a.m.