Get map of a specific country from GADM.
get_map(format = c("gpkg", "shp"), country, version = "gadm3.6", layer)
format | Either |
---|---|
country | Three-letter ISO country code. Corresponding three-letter ISO
code for each country can be found in the |
version | A character vector specifying the GADM version from which to
get the geopackage download from. Default is |
layer | A numeric value specifying which layer from geopackage to get. A layer corresponds to the different administrative units of the specific country where 1 is country-level. |
SpatialPolygonsDataFrame of the specified country map layer.
get_map(format = "gpkg", country = "AFG", layer = 1)#> OGR data source with driver: GPKG #> Source: "/private/var/folders/rx/nr32tl5n6f3d_86tn0tc7kc00000gp/T/Rtmp5nVm1m/gadm36_AFG.gpkg", layer: "gadm36_AFG_1" #> with 34 features #> It has 10 fields#> class : SpatialPolygonsDataFrame #> features : 34 #> extent : 60.50487, 74.89413, 29.36157, 38.49092 (xmin, xmax, ymin, ymax) #> crs : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 #> variables : 10 #> names : GID_0, NAME_0, GID_1, NAME_1, VARNAME_1, NL_NAME_1, TYPE_1, ENGTYPE_1, CC_1, HASC_1 #> min values : AFG, Afghanistan, AFG.1_1, Badakhshan, Badahšan, NA, Velayat, Province, NA, AF.BD #> max values : AFG, Afghanistan, AFG.9_1, Zabul, Zubul|Zaboul, NA, Velayat, Province, NA, AF.ZB