Returns Autonomous Communities of Spain at a specified scale.
Source
CartoBase ANE provided by Instituto Geografico Nacional (IGN), http://www.ign.es/web/ign/portal. Years available are 2005 up to today.
Copyright: https://centrodedescargas.cnig.es/CentroDescargas/cartobase-ane
It's necessary to always acknowledge authorship using the following formulas:
When the original digital product is not modified or altered, it can be expressed in one of the following ways:
CartoBase ANE 2006-2024 CC-BY 4.0 ign.es
CartoBase ANE 2006-2024 CC-BY 4.0 Instituto Geográfico Nacional
When a new product is generated:
Obra derivada de CartoBase ANE 2006-2024 CC-BY 4.0 ign.es
Data distributed via a custom CDN, see https://github.com/rOpenSpain/mapSpain/tree/sianedata.
Arguments
- ccaa
character string. A vector of names and/or codes for Autonomous Communities or
NULLto get all the autonomous communities. See Details.- year
character string or number. Release year, it must be in formats
YYYY(assuming end of year) orYYYY-MM-DD. Historical information starts as of 2005.- epsg
character string or number. Projection of the map: 4-digit EPSG code. One of:
"4258": ETRS89"4326": WGS84."3035": ETRS89 / ETRS-LAEA."3857": Pseudo-Mercator.
- cache
logical. Whether to do caching. Default is
TRUE. See Caching strategies section inesp_set_cache_dir().- update_cache
logical. Should the cached file be refreshed? Default is
FALSE. When set toTRUE, it will force a new download.- cache_dir
character string. A path to a cache directory. See Caching strategies section in
esp_set_cache_dir().- verbose
logical. If
TRUEdisplays informational messages.- resolution
character string or number. Resolution of the geospatial data. One of:
"10": 1:10 million.
"6.5": 1:6.5 million.
"3": 1:3 million.
- moveCAN
A logical
TRUE/FALSEor a vector of coordinatesc(lat, lon). It places the Canary Islands close to Spain's mainland. Initial position can be adjusted using the vector of coordinates. See Displacing the Canary Islands inesp_move_can().- rawcols
logical. Setting this to
TRUEwill add the raw columns of the resulting object as provided by IGN.
Value
A sf object.
Details
When using ccaa you can use and mix names and NUTS codes (levels 1 or 2),
ISO codes (corresponding to level 2) or codauto (see esp_codelist).
Ceuta and Melilla are considered as Autonomous Communities in this function.
When calling a NUTS1 level, all the Autonomous Communities of that level will be added.
See also
Other datasets representing political borders:
esp_get_capimun(),
esp_get_ccaa(),
esp_get_comarca(),
esp_get_countries_siane(),
esp_get_gridmap,
esp_get_munic(),
esp_get_munic_siane(),
esp_get_nuts(),
esp_get_prov(),
esp_get_prov_siane(),
esp_get_simpl,
esp_get_spain(),
esp_get_spain_siane(),
esp_siane_bulk_download()
Political borders from CartoBase ANE:
esp_get_capimun(),
esp_get_countries_siane(),
esp_get_munic_siane(),
esp_get_prov_siane(),
esp_get_spain_siane(),
esp_siane_bulk_download()
Examples
ccaas1 <- esp_get_ccaa_siane()
dplyr::glimpse(ccaas1)
#> Rows: 19
#> Columns: 22
#> $ codauto <chr> "01", "02", "03", "04", "05", "06", "07", "08", "09"…
#> $ iso2.ccaa.code <chr> "ES-AN", "ES-AR", "ES-AS", "ES-IB", "ES-CN", "ES-CB"…
#> $ nuts1.code <chr> "ES6", "ES2", "ES1", "ES5", "ES7", "ES1", "ES4", "ES…
#> $ nuts2.code <chr> "ES61", "ES24", "ES12", "ES53", "ES70", "ES13", "ES4…
#> $ ine.ccaa.name <chr> "Andalucía", "Aragón", "Asturias, Principado de", "B…
#> $ iso2.ccaa.name.es <chr> "Andalucía", "Aragón", "Asturias, Principado de", "I…
#> $ iso2.ccaa.name.ca <chr> NA, NA, NA, "Illes Balears", NA, NA, NA, NA, "Catalu…
#> $ iso2.ccaa.name.gl <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, "Galicia…
#> $ iso2.ccaa.name.eu <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
#> $ nuts2.name <chr> "Andalucía", "Aragón", "Principado de Asturias", "Il…
#> $ cldr.ccaa.name.en <chr> "Andalusia", "Aragon", "Asturias", "Balearic Islands…
#> $ cldr.ccaa.name.es <chr> "Andalucía", "Aragón", "Principado de Asturias", "Is…
#> $ cldr.ccaa.name.ca <chr> "Andalusia", "Aragó", "Astúries", "Illes Balears", "…
#> $ cldr.ccaa.name.ga <chr> "Andalucía", "Aragón", "Principado de Asturias", "Il…
#> $ cldr.ccaa.name.eu <chr> "Andaluzia", "Aragoi", "Asturiesko Printzerria", "Ba…
#> $ ccaa.shortname.en <chr> "Andalusia", "Aragon", "Asturias", "Balearic Islands…
#> $ ccaa.shortname.es <chr> "Andalucía", "Aragón", "Asturias", "Baleares", "Cana…
#> $ ccaa.shortname.ca <chr> "Andalusia", "Aragó", "Astúries", "Illes Balears", "…
#> $ ccaa.shortname.ga <chr> "Andalucía", "Aragón", "Asturias", "Illas Baleares",…
#> $ ccaa.shortname.eu <chr> "Andaluzia", "Aragoi", "Asturias", "Balear Uharteak"…
#> $ nuts1.name <chr> "Sur", "Noreste", "Noroeste", "Este", "Canarias", "N…
#> $ geometry <MULTIPOLYGON [°]> MULTIPOLYGON (((-5.024684 3..., MULTIPO…
# Low res
ccaas_low <- esp_get_ccaa_siane(
rawcols = TRUE, moveCAN = FALSE,
resolution = 10, epsg = 3035
)
library(ggplot2)
ggplot(ccaas_low) +
geom_sf(aes(fill = nuts1.name)) +
scale_fill_viridis_d(option = "cividis")
