Skip to contents

Political boundaries of Spain

These functions return sf objects representing political boundaries.

CartoBase ANE

Datasets from IGN and CartoBase ANE.

esp_get_capimun()
City where the municipal public authorities are based - SIANE
esp_get_ccaa_siane()
Autonomous Communities of Spain - SIANE
esp_get_countries_siane()
Countries of the World - SIANE
esp_get_munic_siane()
Municipalities of Spain from SIANE
esp_get_prov_siane()
Provinces of Spain from SIANE
esp_get_spain_siane()
Boundaries of Spain - SIANE
esp_siane_bulk_download()
SIANE bulk download

GISCO

Datasets from GISCO and Eurostat.

esp_get_ccaa()
Autonomous Communities of Spain - GISCO
esp_get_munic()
Municipalities of Spain from GISCO
esp_get_nuts()
Territorial Spanish units for statistics (NUTS) dataset
esp_get_prov()
Provinces of Spain from GISCO
esp_get_spain()
Boundaries of Spain - GISCO

Other helpers and political objects

esp_get_can_box() esp_get_can_provinces()
Canary Islands inset box and outline
esp_move_can()
Displace a sf object located in the Canary Islands
esp_get_comarca()
'Comarcas' of Spain
esp_get_hex_prov() esp_get_hex_ccaa() esp_get_grid_prov() esp_get_grid_ccaa()
Get a sf hexbin or squared POLYGON of Spain
esp_get_simpl_prov() esp_get_simpl_ccaa()
Simplified map of provinces and Autonomous Communities of Spain

Maps with imagery

Functions to return static map tiles or create an interactive leaflet map.

addProviderEspTiles()
Add a tile layer from Spanish public administrations to a leaflet map
esp_get_tiles() esp_get_attributions()
Get static map tiles from public administrations of Spain
esp_make_provider()
Create a custom tile provider
plotRGB(<SpatRaster>)
Red-Green-Blue plot of a multi-layered SpatRaster (from terra)
addProviderTiles() providerTileOptions()
Add a tile layer from a known map provider (from leaflet)
geom_spatraster_rgb()
Visualise SpatRaster objects as images (from tidyterra)

Natural features

These functions return sf objects with natural features.

esp_get_hydrobasin()
River basin districts of Spain - SIANE
esp_get_hypsobath()
Hypsometry and bathymetry of Spain - SIANE
esp_get_rivers() esp_get_wetlands()
Rivers and wetlands of Spain - SIANE

Infrastructure

These functions return sf objects with infrastructure features.

esp_get_railway() esp_get_stations()
Railways of Spain - SIANE
esp_get_roads()
Roads of Spain - SIANE

Cache management

esp_clear_cache()
Clear your mapSpain cache directory
esp_set_cache_dir() esp_detect_cache_dir()
Set your mapSpain cache directory

Dictionary

Translate region names across languages and coding systems.

esp_dict_region_code() esp_dict_translate()
Convert and translate Spanish subdivision names and codes

Datasets

Datasets included with mapSpain.

esp_codelist
Database with codes and names of Spanish regions
esp_nuts_2024
NUTS 2024 for Spain sf object
esp_tiles_providers
Public WMS and WMTS providers for Spain
pobmun25
Population of Spain by municipality (2025)

Geographic grids

Geographic grids are agreed, defined and harmonized grid networks with standardized locations and grid cell sizes.

esp_get_grid_BDN() esp_get_grid_BDN_ccaa()
National geographic grids from BDN (Nature Data Bank)
esp_get_grid_ESDAC()
National geographic grids from the European Soil Data Centre (ESDAC)
esp_get_grid_MTN()
National geographic grids from IGN MTN (Mapa Topografico Nacional)

About the package

mapSpain mapSpain-package
mapSpain: Administrative Boundaries of Spain