mapSpain icon indicating copy to clipboard operation
mapSpain copied to clipboard

Echo de menos 3 municipios en el resultado de esp_get_munic_siane

Open perezcalderon opened this issue 2 years ago • 1 comments

En la ejecución del siguiente código:

municipios <- esp_get_munic_siane(epsg = 4326, moveCAN = FALSE, resolution = 10) 
nrow(municipios)

El resultado son 8.209 registros.

municipios <- municipios %>% 
  filter(!is.na(name))
nrow(municipios)

Tras el filtrado, aparecen 8.128 (en lugar de 8.131).

En el resultado no aparecen 3 municipios:

CODIGO_INE	NOMBRE	nombre_provincia
34242	Villodrigo	Palencia
39101	Valle de Villaverde	Cantabria
48074	Urduña/Orduña	Bizkaia

No estoy seguro del sitio correcto para abrir el issue porque no sé si es un problema del dato en origen del IGN.

¡Muchas gracias por este pedazo de librería!

perezcalderon avatar Jul 21 '23 10:07 perezcalderon

Hola @perezcalderon

Por lo que veo es un problema del IGN. Para resolution = 10 parece que no están incluidos, sin embargo en resolution = 3 si que aparecen:

library(mapSpain)
library(dplyr)
municipios <- esp_get_munic_siane(epsg = 4326, moveCAN = FALSE, 
                                  resolution = 3)
# Aqui si que está
municipios %>%
  filter(LAU_CODE %in% c("34242", "39101","48074")) 
#> Simple feature collection with 3 features and 7 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -4.111872 ymin: 42.13155 xmax: -2.955765 ymax: 43.26689
#> Geodetic CRS:  WGS 84
#>   codauto   ine.ccaa.name cpro ine.prov.name cmun                name LAU_CODE
#> 1      06       Cantabria   39     Cantabria  101 Valle de Villaverde    39101
#> 2      07 Castilla y León   34      Palencia  242          Villodrigo    34242
#> 3      16      País Vasco   48       Bizkaia  074       Urduña/Orduña    48074
#>                         geometry
#> 1 MULTIPOLYGON (((-3.285106 4...
#> 2 MULTIPOLYGON (((-4.076154 4...
#> 3 MULTIPOLYGON (((-3.049804 4...

Created on 2023-07-21 with reprex v2.0.2

dieghernan avatar Jul 21 '23 10:07 dieghernan