Skip to contents

Download a geojson url, standardise it and cache the result

Usage

downloadGeojson(
  geojsonUrl,
  codeCol = "code",
  nameCol = "name",
  altCodeCol = NULL,
  codeType = NA_character_,
  simplify = FALSE,
  id,
  license = "unknown",
  ...
)

Arguments

geojsonUrl

the URL of the geojson resource

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

id

an id for the map that can be used to retrieve it in the future (through getMap()).

license

an optional license string

...

Named arguments passed on to .cached

.nocache

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

Value

the sf object for this geoJson