to standard code, name, altCode and codeType columns

downloadMap(
  zipUrl,
  mapName = NULL,
  codeCol = "code",
  nameCol = "name",
  altCodeCol = NULL,
  codeType = NA_character_,
  simplify = FALSE,
  wd = getOption("arear.download.dir", tempdir()),
  id = NULL,
  license = "unknown",
  ...
)

Arguments

zipUrl

- the URL of the zipped shapefile

mapName

- the layer name or map name - this is the "xyz" of a zip file containing "xyz.shp". If you are getting multiple layers it is OK to repeatedly call this within the same session as the download is stored, see wd option.

codeCol

- the name of the column containing the id or code

nameCol

- the name of the column containing the label (optional - defaults to the same as codeCol)

altCodeCol

- an optional column name containing another code type

codeType

- the "type" of the code - optional. defaults to NA

simplify

- do you want to simplify the map

wd

- an optional working directory (defaults to `getOption("arear.download.dir", tempdir())`)

id

- an optional id for the map that can be used to retrieve it later (through getMap()) - defaults to either the mapName or if not present the name of the zip file.

license

- an optional license string

...

- passed to .cache, param nocache=TRUE to disable caching

Value

a sf object containing the map

Examples

if (FALSE) {
downloadMap(
  zipUrl="https://bit.ly/3A9TnR1",
  mapName="NHS_England_Regions__April_2020__Boundaries_EN_BGC",
  codeCol="nhser20cd",
  nameCol="nhser20nm"
)
}