get_gadm | R Documentation |
Download GADM 3.6 data in all available format.
get_gadm(
country,
level = 0,
path = ".",
format = c("sf", "sp", "kmz", "shp", "gpkg")
)
country |
ISO3 code of a country, use "?" to get the full list of codes. |
level |
administrative level, |
path |
path to the folder where files will be stored. |
format |
either "sf", "sp", "kmz", "shp" or "gpkg" (see details). |
"sf" downloads a .rds
file containing an object of class SpatialPolygonsDataFrame
.
"sp" downloads a .rds
file containing an object of class sf
.
"kmz" downloads a .kmz
(Keyhole Markup language Zipped) file.
"shp" download an archive zip containing one ESRI shapefiles per level available.
"gpkg" downloads an archive zip containing a GeoPackage file including all available levels.
Note that if a specific level does not exist, an HTTP error 404 will be returned for the first group of files whereas for the second group the archive will still be downloaded but a error will be thrown when attempting reading a level that does not exist.
A "SpatialPolygonsDataFrame"
object if format = "sp"
, otherwise an object
of class sf
.
## Not run:
can <- get_gadm("CAN", level = 1, format = "sf")
bel <- get_gadm("BEL", format = "gpkg")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.