Skip to contents

If a map needs to be downloaded as a shapefile then it is stored temporarily. The location of this download directory can be set as option("arear.download.dir" = "~/.)

Usage

getMap(mapId = names(sources)[1], sources = arear::mapsources, ...)

Arguments

mapId

either: a name of a default map

sources

or: a named list of map sources. Each map source entry must be a named list containing the following information:

- `url`: the download URL of the map - `mapName`: either `geojson` or for shapes the layer name containing the map. if not given the first shape file layer will be used. - `simplify` (opt: boolean) do you want the map to be simplified - `source`: (opt) the URL that best represents the source of the map - `license`: (opt) the license of the map - `nameCol`: (opt) the column containing the name - `codeCol`: (opt) the column containing the id code - `altCodeCol`: (opt) alternative code columns

see `arear::mapsources` for example

...

Named arguments passed on to standardiseMap

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

...

not used.

Named arguments passed on to .cached

.nocache

an option to defeat the caching which can be set globally as options("cache.disable"=TRUE)

.stale

the length of time in days to keep cached data before considering it as stale. can also be set by options("cache.stale")

Value

a standard sf map

Examples

if (interactive()) {
  map = getMap("NHSER20")
  map %>% dplyr::glimpse()
}