MazamaSpatialUtils (version 0.7.6)

convertGADM: Convert Global Administrative Areas (GADM) SPDF

Description

Create a SpatialPolygonsDataFrame for Global Administrative Areas.

Usage

convertGADM(
  countryCode = NULL,
  admLevel = 0,
  nameOnly = FALSE,
  baseUrl = "https://biogeo.ucdavis.edu/data/gadm3.6/Rsp"
)

Value

Name of the dataset being created.

Arguments

countryCode

ISO-3166-1 alpha-2 country code

admLevel

administrative level to be downloaded

nameOnly

Logical specifying whether to only return the name without creating the file.

baseUrl

Base URL for data queries.

Details

A pre-generated Global Administrative Areas SpatialPolygonsDataFrame is downloaded and amended with additional columns of data. The resulting file will be created in the spatial data directory which is set with setSpatialDataDir().

The @data slot of each SpatialPolygonsDataFrame is both simplified and modified to adhere to the MazamaSpatialUtils internal standards.

References

https://gadm.org/data.html

https://gadm.org/metadata.html