catr_ovc_get_cod_munic: OVCCallejero: Get municipality codes

View source: R/ovc-munic.R

catr_ovc_get_cod_municR Documentation

OVCCallejero: Get municipality codes

Description

Query the OVCCallejero ConsultaMunicipioCodigos service to retrieve municipality names and codes from the Spanish Cadastre and the National Statistics Institute (INE).

Usage

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

Arguments

cpro

Province code returned by catr_ovc_get_cod_provinces().

cmun, cmun_ine

Municipality code as recorded by the Spanish Cadastre (cmun) or the National Statistics Institute (cmun_ine). Either cmun or cmun_ine must be provided.

verbose

Logical. Whether to display informational messages.

Details

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

  • munic: Municipality name used by the Spanish Cadastre.

  • catr_to: Cadastral territorial office code.

  • catr_munic: Municipality code as recorded by the Cadastre.

  • catrcode: Full cadastral code for the municipality.

  • cpro: Province code according to the INE.

  • cmun: Municipality code according to the INE.

  • inecode: Full INE code for the municipality.

  • Remaining fields: See the API documentation.

Value

A tibble as described in Details. Returns NULL if the request fails.

References

ConsultaMunicipioCodigos.

See Also

catr_atom_search_munic() searches municipality codes by name. catr_atom_get_parcels() accepts the returned catrcode as munic. mapSpain::esp_get_munic_siane() retrieves municipality geometries, including the INE code.

Search for cadastral identifiers: catr_atom_search_munic(), catr_get_code_from_coords(), catr_ovc_get_cod_provinces()

Query OVC web services: catr_ovc_get_cod_provinces(), catr_ovc_get_cpmrc(), catr_ovc_get_rccoor(), catr_ovc_get_rccoor_distancia()

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 Oct. 5, 2026, 5:07 p.m.