catr_ovc_get_cod_munic: OVCCallejero: Extract the code of a municipality

View source: R/ovc-munic.R

catr_ovc_get_cod_municR Documentation

OVCCallejero: Extract the code of a municipality

Description

Implementation of the OVCCallejero service ConsultaMunicipioCodigos. Returns names and codes of a municipality as per the Cadastre and 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, cmun_ine

Code of a municipality, as recorded on the Spanish Cadastre (cmun) or the National Statistics Institute. Either cmun or cmun_ine must be provided.

verbose

Logical. If TRUE, displays informational messages.

Details

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

  • munic: Name of the municipality as per the Cadastre.

  • catr_to: Cadastral territorial office code.

  • catr_munic: Municipality code as recorded on the Cadastre.

  • catrcode: Full Cadastral code for the municipality.

  • cpro: Province code as per the INE.

  • cmun: Municipality code as per the INE.

  • inecode: Full INE code for the municipality.

  • Rest of fields: Check the API Docs.

Value

A tibble. See Details

References

ConsultaMunicipioCodigos.

See Also

mapSpain::esp_get_munic_siane() 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 cadastral code
ab <- catr_ovc_get_cod_munic(cpro = 2, cmun = 900)

ab

# Same query using the INE code

ab2 <- catr_ovc_get_cod_munic(cpro = 2, cmun_ine = 3)

ab2



CatastRo documentation built on April 27, 2026, 5:07 p.m.