Learn R Programming

mapSpain (version 0.1.2)

esp_munic.sf: All Municipalities POLYGON object of Spain

Description

A sf object including all municipalities of Spain as provided by GISCO (2019 version).

Arguments

Format

A POLYGON data frame (resolution: 1:1million, EPSG:4258) object:

codauto

INE code of each autonomous community.

ine.ccaa.name

INE name of each autonomous community.

cpro

INE code of each province.

ine.prov.name

INE name of each province.

cmun

INE code of each municipality.

name

Name of the municipality

LAU_CODE

LAU Code (GISCO) of the municipality

geometry

geometry field

See Also

esp_get_munic

Examples

Run this code
# NOT RUN {
library(sf)

data("esp_munic.sf")
data("esp_nuts.sf")

Teruel.cpro <- esp_dict_region_code("Teruel", destination = "cpro")
Teruel.NUTS <- esp_dict_region_code(Teruel.cpro,
   origin = "cpro",
   destination = "nuts")

Teruel.sf <- esp_munic.sf[esp_munic.sf$cpro == Teruel.cpro, ]
Teruel.city <- Teruel.sf[Teruel.sf$name == "Teruel", ]

NUTS <-
  esp_nuts.sf[esp_nuts.sf$LEVL_CODE == 3 &
             esp_nuts.sf$NUTS_ID != Teruel.NUTS,]


plot(st_geometry(Teruel.sf), col = "cornsilk")
plot(st_geometry(Teruel.city), col = "firebrick3", add = TRUE)
plot(st_geometry(NUTS), col = "wheat", add = TRUE)
title(main = "Municipalities of Teruel",  line = 1)
# }

Run the code above in your browser using DataLab