Skip to contents

Retrieve AREAdata gadm mapping shapefiles specified by spatial scale (GID). These vectors are cached as GeoPackage files.

Usage

fetch_gadm_sfs(
  gid = 0,
  cache_location = NULL,
  refresh_cache = FALSE,
  basereq = ad_basereq(),
  call = rlang::caller_env()
)

Arguments

gid

the spatial scale to retrieve (0 = country-level, 1=province-level...).

cache_location

path to cache location (defaults to a temporary user directory, or one set by set_default_ohvbd_cache()).

refresh_cache

force a refresh of the relevant cached data.

basereq

the url of the AREAdata database (usually generated by ad_basereq()). If NA, uses the default.

call

The env from which this was called (defaults to the direct calling environment).

Value

A SpatVector (from terra::vect()) of the requested shapefile.

Author

Francis Windram

Examples

if (FALSE) { # interactive()
fetch_gadm_sfs(gid=0)
}