Learn R Programming

giscoR (version 0.1.1)

gisco_get_urban_audit: Download Geospatial Urban Audit Data from GISCO

Description

Downloads a simple feature (sf) object.

Usage

gisco_get_urban_audit(
  year = "2020",
  epsg = "4326",
  update_cache = FALSE,
  cache_dir = NULL,
  spatialtype = "RG",
  level = NULL,
  country = NULL
)

Arguments

year

Release year. One of "2014", "2018" or "2020"

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

level

Level of Urban Audit. Possible values are 'CITIES', 'FUA', 'GREATER_CITIES' or NULL. See Details.

country

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

Value

a sf object.

Details

level = NULL would download the whole dataset including all levels

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

Examples

Run this code
# NOT RUN {
library(sf)

GreatCities <-
  gisco_get_urban_audit(level = "GREATER_CITIES")

unique(GreatCities$CNTR_CODE)

countries <- gisco_get_countries()

plot(
  st_geometry(countries)  ,
  col = "grey10",
  xlim = c(-15, 25),
  ylim = c(35, 60)
)
plot(st_geometry(GreatCities),
     add = TRUE,
     col = "darkgoldenrod3")
box()
title(
  main = "Greater Cities on Europe (2020)",
  sub = gisco_attributions(copyright = FALSE),
  cex.main = 0.8,
  cex.sub = 0.7,
  line = 1
)
# }

Run the code above in your browser using DataLab