Learn R Programming

GADMTools (version 3.9-1)

gadm_sf_loadCountries: Load one or more GADM shapefiles

Description

Load one or more GADM shapefiles as Simple Features (SF) format from a local path or from a remote repository.

Usage

gadm_sf_loadCountries(fileNames, level = 0, basefile="./",
                         baseurl=GADM_SF_URL, simplify=NULL)

# deprecated : gadm_sf.loadCountries(fileNames, level = 0, basefile="./", baseurl=GADM_SF_URL, simplify=NULL)

Arguments

fileNames

Character vector of named regions. An ISO-3166-1 code or a custom name. You don't have to specify the suffix (admX) nor the file extension (.rds).

level

Integer the level of the administrative boundaries (0 is the country, higher values equal finer divisions)

basefile

Character vector the path of the directory where shapefiles are stored. Default is "./"

baseurl

Character vector The url of GADM files. Default is "https://biogeo.ucdavis.edu/data/gadm3.6/Rsf/"

simplify

Numeric Numerical tolerance value to be used by the Douglas-Peuker algorithm. Higher values use less polygon points (and less memory) and lower values use more polygon points (and more memory). We suggest not going higher than 0.025 in order for intra-country boundaries to align.

Value

Object of class gadm_sf (Simple Features wrapper)

References

----

See Also

gadm_sp_loadCountries

Examples

Run this code
# NOT RUN {
# library(GADMTools)
# library(sp)
# Belgium = gadm_sf_loadCountries("BEL", level=2, basefile="./")
# plotmap(Belgium)
# }

Run the code above in your browser using DataLab