get_geoBoundaries: Download geoBoundaries Shapefile as sf Object

View source: R/helperGeoBoundaries.R

get_geoBoundariesR Documentation

Download geoBoundaries Shapefile as sf Object

Description

Retrieves official administrative boundary shapefiles from the [geoBoundaries](https://www.geoboundaries.org/) API for a given country ISO3 code and administrative level. Returns the data as an 'sf' object for direct spatial use.

Usage

get_geoBoundaries(iso3, adm = "ADM1", release = "gbOpen")

Arguments

iso3

Character. The three-letter ISO3 country code (e.g., '"NGA"', '"ZMB"').

adm

Character. Administrative level to download (e.g., '"ADM0"', '"ADM1"', '"ADM2"'). Defaults to '"ADM1"'.

release

Character. geoBoundaries release type. Either '"gbOpen"' (default) for open data or '"gbAuthoritative"' for official boundaries.

Value

An 'sf' object containing the requested administrative boundaries.

Examples

## Not run: 
# Download Nigeria Admin 1 boundaries
nga_adm1 <- get_geoBoundaries("NGA", adm = "ADM1")

# Download Burkina Faso Admin 2 boundaries from the authoritative release
bfa_adm2 <- get_geoBoundaries("BFA", adm = "ADM2", release = "gbAuthoritative")

## End(Not run)


surveyPrev documentation built on June 19, 2026, 5:06 p.m.