| gb_get_world | R Documentation |
Returns global composite boundaries for the requested ADM level. Boundaries are clipped to international borders, with gaps between borders filled.
CGAZ boundaries are not covered by the package's MIT license. Attribution is required when sharing the boundaries or derived products.
gb_get_world(
country = "all",
adm_lvl = "adm0",
quiet = TRUE,
overwrite = FALSE,
cache_dir = NULL
)
country |
A character vector of country names or ISO 3166-1 alpha-3
country codes. Use |
adm_lvl |
ADM level. Accepted values are levels 0, 1 and 2 ( |
quiet |
A logical value. If |
overwrite |
A logical value. If |
cache_dir |
A path to a cache directory. If not set (the default
|
Comprehensive Global Administrative Zones (CGAZ) are global composites for administrative boundaries. Compared with individual country boundaries, global composite boundaries use extensive simplification so file sizes are small enough for most desktop software. They remove disputed areas, replace them with polygons following United States Department of State definitions and fill gaps between borders.
Follow the citation and use information included in the downloaded CGAZ archive. CGAZ and figures derived from it are not relicensed under the package's MIT license.
An sf object from sf containing the requested
boundaries. Returns NULL if no boundaries match the request or the
downloads return no geometries.
geoBoundaries global downloads: https://www.geoboundaries.org/globalDownloads.html.
CGAZ release files: https://github.com/wmgeolab/geoBoundaries/tree/main/releaseData/CGAZ.
Runfola et al. (2020) "geoBoundaries: A global database of political administrative boundaries." PLOS ONE, 15(4), 1–9. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1371/journal.pone.0231866")}.
gb_get_metadata() inspects boundary metadata and licensing.
gb_get_max_adm_lvl() checks the ADM levels available for individual
country boundaries.
gb_set_cache_dir() configures where downloaded archives are cached.
Boundary download functions:
gb_get(),
gb_get_adm
# This download may take some time.
## Not run:
world <- gb_get_world()
library(ggplot2)
ggplot(world) +
geom_sf() +
coord_sf(expand = FALSE) +
labs(caption = "Source: geoBoundaries (CGAZ)")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.