| gisco_get_unit | R Documentation |
Download datasets of single spatial units from GISCO to the
cache_dir.
Unlike gisco_get_countries(), gisco_get_nuts() or
gisco_get_urban_audit() (which download full datasets and apply filters),
these functions download a single-unit file, reducing the time
needed to download and read data into your R session.
gisco_get_unit_country(
unit = "ES",
year = 2024,
epsg = c(4326, 3857, 3035),
cache = TRUE,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE,
resolution = c(1, 3, 10, 20, 60),
spatialtype = c("RG", "LB")
)
gisco_get_unit_nuts(
unit = "ES416",
year = 2024,
epsg = c(4326, 3857, 3035),
cache = TRUE,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE,
resolution = c(1, 3, 10, 20, 60),
spatialtype = c("RG", "LB")
)
gisco_get_unit_urban_audit(
unit = "ES001F",
year = 2024,
epsg = c(4326, 3857, 3035),
cache = TRUE,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE,
spatialtype = c("RG", "LB")
)
unit |
A character vector of unit IDs to download. See Details. |
year |
A character string or numeric value with the release year of the file. |
epsg |
A character string or numeric value with the coordinate reference system as a 4-digit EPSG code. One of:
|
cache |
A logical value indicating whether to cache results. Defaults
to |
update_cache |
A logical value indicating whether to refresh the
cached file. Defaults to |
cache_dir |
A character string with a path to a cache directory. See
the Caching strategies section in |
verbose |
A logical value indicating whether to display informational messages. |
resolution |
A character string or numeric value with the geospatial data resolution. One of:
|
spatialtype |
A character string with the type of geometry to return. Available values are:
|
Check the available unit IDs for the required argument combination with
gisco_get_metadata().
An sf object.
See the GISCO copyright provisions for administrative and statistical units:
Administrative units: https://ec.europa.eu/eurostat/web/gisco/geodata/administrative-units.
Statistical units: https://ec.europa.eu/eurostat/web/gisco/geodata/statistical-units.
Check the download and usage provisions in gisco_attributions().
GISCO countries distribution API: https://gisco-services.ec.europa.eu/distribution/v2/countries/.
GISCO NUTS distribution API: https://gisco-services.ec.europa.eu/distribution/v2/nuts/.
GISCO Urban Audit distribution API: https://gisco-services.ec.europa.eu/distribution/v2/urau/.
All source files are .geojson files.
gisco_get_metadata(), gisco_get_countries(),
gisco_get_nuts(), gisco_get_urban_audit().
See gisco_id_api to download via the GISCO ID service API.
Bulk and single-unit downloads:
gisco_bulk_download()
# Get metadata.
cities <- gisco_get_metadata("urban_audit", year = 2024)
# Valencia, Spain.
valencia <- cities[grep("Valencia", cities$URAU_NAME, fixed = TRUE), ]
valencia
if (
requireNamespace("dplyr", quietly = TRUE) &&
requireNamespace("ggplot2", quietly = TRUE)
) {
library(dplyr)
# Get `sf` objects and order by `AREA_SQM`.
valencia_sf <- gisco_get_unit_urban_audit(
unit = valencia$URAU_CODE,
year = 2024
) |>
arrange(desc(AREA_SQM))
# Plot.
library(ggplot2)
ggplot(valencia_sf) +
geom_sf(aes(fill = URAU_CATG)) +
scale_fill_viridis_d() +
labs(
title = "Valencia",
subtitle = "Urban Audit 2020",
fill = "Category"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.