Skip to contents

This function retrieves GeoBoundaries data from the API based on the specified release, ISO3 country code, and administrative level. If data is not found at the specified administrative level, it attempts to retrieve data from a lower administrative level until data is found or the lowest level is reached.

Usage

get_geoboundaries_api_data(iso3, admin_level, release = "gbOpen")

Arguments

iso3

A three-letter capitalized character string. Must follow the ISO-3166 Alpha-3 country code standard (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3).

admin_level

An integer specifying the administrative level. It should be between 0 and 5.

release

A character string specifying the release type. It should be one of 'gbOpen', 'gbHumanitarian', or 'gbAuthoritative'. Default is 'gbOpen'.

Value

A list containing the GeoBoundaries API data and file paths to admin boundaries in .geojson format.

Examples

if (FALSE) {

tmp <- get_geoboundaries_api_data(iso3 = 'MCO', admin_level = 2, release = 'gbOpen')
head(tmp)

}