Skip to contents

Acquire a SpatVector for a given country, optionally limited to subregion(s) thereof.

Usage

getCountrySubregions.SpatVector(countryCodeISO3C = "COD", level1Region, folder)

Arguments

countryCodeISO3C

The uppercase ISO three character code of a recognized country.

level1Region

Subregions of the country to limit the extent of the SpatVector to.

folder

The folder which should be searched for the GADM data, passed on to lvl1AdminBorders.

Value

SpatVector for the specificed country, optionally cropped to the provinces/states specified in the level1Region argument.

Author

Bryce Carson

Examples

library(geodata)
#> Loading required package: terra
#> terra 1.7.78
geodata_path_backup <- geodata_path()
options(geodata_default_path = getOption("spatialEpisim.foundation.datapath"))
getCountrySubregions.SpatVector("COD")
#>  class       : SpatVector 
#>  geometry    : polygons 
#>  dimensions  : 26, 10  (geometries, attributes)
#>  extent      : 12.20663, 31.30572, -13.45568, 5.386098  (xmin, xmax, ymin, ymax)
#>  coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs 
#>  names       : GID_0          NAME_0   GID_1       NAME_1 VARNAME_1 NL_NAME_1
#>  type        : <chr>           <chr>   <chr>        <chr>     <chr>     <chr>
#>  values      :   COD Democratic Rep~ COD.1_1     Bas-Uélé        NA        NA
#>                  COD Democratic Rep~ COD.2_1     Équateur        NA        NA
#>                  COD Democratic Rep~ COD.3_1 Haut-Katanga        NA        NA
#>    TYPE_1 ENGTYPE_1  CC_1 HASC_1
#>     <chr>     <chr> <chr>  <chr>
#>  Province  Province    NA  CD.BU
#>  Province  Province    NA  CD.ET
#>  Province  Province    NA  CD.HK
getCountrySubregions.SpatVector("COD", c("Nord-Kivu", "Ituri"))
#>  class       : SpatVector 
#>  geometry    : polygons 
#>  dimensions  : 2, 10  (geometries, attributes)
#>  extent      : 27.22714, 31.30572, -2.06577, 3.674677  (xmin, xmax, ymin, ymax)
#>  coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs 
#>  names       : GID_0          NAME_0    GID_1    NAME_1 VARNAME_1 NL_NAME_1
#>  type        : <chr>           <chr>    <chr>     <chr>     <chr>     <chr>
#>  values      :   COD Democratic Rep~  COD.6_1     Ituri        NA        NA
#>                  COD Democratic Rep~ COD.19_1 Nord-Kivu        NA        NA
#>    TYPE_1 ENGTYPE_1  CC_1 HASC_1
#>     <chr>     <chr> <chr>  <chr>
#>  Province  Province    NA  CD.IT
#>  Province  Province    NA  CD.NK
getCountrySubregions.SpatVector("CZE", "Prague")
#>  class       : SpatVector 
#>  geometry    : polygons 
#>  dimensions  : 1, 10  (geometries, attributes)
#>  extent      : 14.25095, 14.71854, 49.93997, 50.17131  (xmin, xmax, ymin, ymax)
#>  coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs 
#>  names       : GID_0         NAME_0    GID_1 NAME_1       VARNAME_1 NL_NAME_1
#>  type        : <chr>          <chr>    <chr>  <chr>           <chr>     <chr>
#>  values      :   CZE Czech Republic CZE.11_1 Prague Prag |Hlavní m~        NA
#>  TYPE_1 ENGTYPE_1  CC_1 HASC_1
#>   <chr>     <chr> <chr>  <chr>
#>    Kraj    Region    NA  CZ.SK
getCountrySubregions.SpatVector("NGA", "Kwara")
#>  class       : SpatVector 
#>  geometry    : polygons 
#>  dimensions  : 1, 10  (geometries, attributes)
#>  extent      : 2.728413, 6.210898, 7.965384, 10.15013  (xmin, xmax, ymin, ymax)
#>  coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs 
#>  names       : GID_0  NAME_0    GID_1 NAME_1 VARNAME_1 NL_NAME_1 TYPE_1
#>  type        : <chr>   <chr>    <chr>  <chr>     <chr>     <chr>  <chr>
#>  values      :   NGA Nigeria NGA.24_1  Kwara        NA        NA  State
#>  ENGTYPE_1  CC_1 HASC_1
#>      <chr> <chr>  <chr>
#>      State    NA  NG.KW
options(geodata_default_path = geodata_path_backup)