spod_get_zones | R Documentation |
Get spatial zones for the specified data version. Supports both v1 (2020-2021) and v2 (2022 onwards) data.
spod_get_zones(
zones = c("districts", "dist", "distr", "distritos", "municipalities", "muni",
"municip", "municipios", "lua", "large_urban_areas", "gau", "grandes_areas_urbanas"),
ver = NULL,
data_dir = spod_get_data_dir(),
quiet = FALSE
)
zones |
The zones for which to download the data. Can be |
ver |
Integer. Can be 1 or 2. The version of the data to use. v1 spans 2020-2021, v2 covers 2022 and onwards. |
data_dir |
The directory where the data is stored. Defaults to the value returned by |
quiet |
A |
An sf
object (Simple Feature collection).
The columns for v1 (2020-2021) data include:
A character vector containing the unique identifier for each district, assigned by the data provider. This id
matches the id_origin
, id_destination
, and id
in district-level origin-destination and number of trips data.
A string with semicolon-separated identifiers of census districts classified by the Spanish Statistical Office (INE) that are spatially bound within the polygons for each id
.
A string with semicolon-separated municipality identifiers (as assigned by the data provider) corresponding to each district id
.
A string with semicolon-separated municipality identifiers classified by the Spanish Statistical Office (INE) corresponding to each id
.
A string with semicolon-separated district names (from the v2 version of this data) corresponding to each district id
in v1.
A string with semicolon-separated district identifiers (from the v2 version of this data) corresponding to each district id
in v1.
A MULTIPOLYGON
column containing the spatial geometry of each district, stored as an sf object. The geometry is projected in the ETRS89 / UTM zone 30N coordinate reference system (CRS), with XY dimensions.
The columns for v2 (2022 onwards) data include:
A character vector containing the unique identifier for each zone, assigned by the data provider.
A character vector with the name of each district.
A numeric vector representing the population of each district (as of 2022).
A string with semicolon-separated identifiers of census sections corresponding to each district.
A string with semicolon-separated identifiers of census districts as classified by the Spanish Statistical Office (INE) corresponding to each district.
A string with semicolon-separated identifiers of municipalities classified by the Spanish Statistical Office (INE) corresponding to each district.
A string with semicolon-separated identifiers of municipalities, as assigned by the data provider, that correspond to each district.
A string with semicolon-separated identifiers of LUAs (Local Urban Areas) from the provider, associated with each district.
A string with semicolon-separated district identifiers from v1 data corresponding to each district in v2. If no match exists, it is marked as NA
.
A MULTIPOLYGON
column containing the spatial geometry of each district, stored as an sf object. The geometry is projected in the ETRS89 / UTM zone 30N coordinate reference system (CRS), with XY dimensions.
# get polygons for municipalities for the v2 data
municip_v2 <- spod_get_zones(zones = "municipalities", ver = 2)
# get polygons for the districts for the v1 data
distr_v1 <- spod_get_zones(zones = "districts", ver = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.