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.

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:

  • 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.

  • catr_munic: Municipality code as per the INE.

  • catrcode: 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() 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



CatastRo documentation built on April 3, 2025, 10:34 p.m.