catr_ovc_get_cod_munic {CatastRo}R Documentation

OVCCallejero: Extract the code of a municipality

Description

Implementation of the OVCCallejero service ConsultaMunicipioCodigos. Return the names and codes of a municipality. Returns both the codes as per the Cadastre and as per the INE (National Statistics Institute).

Usage

catr_ovc_get_cod_munic(cpro, cmun = NULL, cmun_ine = NULL, verbose = FALSE)

Arguments

cpro

The code of a province, as provided by catr_ovc_get_cod_provinces().

cmun

Code of a municipality, as recorded on the Spanish Cadastre.

cmun_ine

Code of a municipality, as recorded on National Statistics Institute. See INE: List of municipalities

verbose

Logical, displays information. Useful for debugging, default is FALSE.

Details

Parameter cpro is mandatory. Either cmun or cmun_ine should be provided.

On a successful query, the function returns a tibble with one row including the following columns:

Value

A tibble. See Details

References

ConsultaMunicipioCodigos

See Also

mapSpain::esp_get_munic() to get shapes of municipalities, including the INE code.

OVCCoordenadas API: catr_ovc_get_cod_provinces()

Other search: catr_atom_search_munic(), catr_get_code_from_coords(), catr_ovc_get_cod_provinces()

Examples



# Get municipality by cadastal code
ab <- catr_ovc_get_cod_munic(2, 900)

ab

# Same query using the INE code

ab2 <- catr_ovc_get_cod_munic(2, cmun_ine = 3)

ab2



[Package CatastRo version 0.3.0 Index]