Learn R Programming

giscoR (version 0.1.1)

gisco_get_communes: Download Geospatial Communes Data from GISCO

Description

Downloads a simple feature (sf) object.

Usage

gisco_get_communes(
  year = "2016",
  epsg = "4326",
  update_cache = FALSE,
  cache_dir = NULL,
  spatialtype = "RG",
  country = NULL
)

Arguments

year

Release year. One of "2001", "2004", "2006", "2008", "2010", "2013" or 2016

epsg

projection of the map: 4-digit EPSG code. One of:

  • "4326" - WGS84

  • "3035" - ETRS89 / ETRS-LAEA

  • "3857" - Pseudo-Mercator

update_cache

a logical whether to update cache.

cache_dir

a path to a cache directory. The directory have to exist. The NULL (default) uses and creates /gisco directory in the temporary directory from tempdir. The directory can also be set with options(gisco_cache_dir = <path>).

spatialtype

Type of geometry to be returned:

  • RG: Regions - Multipolygon

  • LB: Labels - Point

  • BN: Boundaries - Multilines

  • COASTL: coastlines - Multilines

  • INLAND: inland boundaries - Multilines

country

Optional. A character vector of country codes. See Details.

Value

a sf object.

Details

country only available on specific datasets. Some spatialtype datasets (as Multilines data-types) may not have country-level identifies.

country could be either a vector of country names, a vector of ISO3 country codes or a vector of Eurostat country codes.

If you experience any problem on download, try to download the file by any other method and set cache_dir = <folder>.

See Also

gisco_get_lau

Examples

Run this code
# NOT RUN {
library(sf)

communes <- gisco_get_communes(country = "Belgique")
plot(
  st_geometry(communes),
  col = c("black", "gold", "brown2"),
  border = "grey90"
  )

title(
  main = "Communes on Belgium (2016)",
  sub = gisco_attributions(copyright = FALSE),
  line = 1,
  cex.sub = 0.8
  )
# }

Run the code above in your browser using DataLab