Skip to contents

Search for a municipality (as a string, part of string or code) and get the corresponding coding as per the Cadastre.

Usage

catr_atom_search_munic(
  munic,
  to = NULL,
  cache = TRUE,
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE
)

Arguments

munic

Municipality to extract, It can be a part of a string or the cadastral code.

to

Optional parameter for defining the Territorial Office to which munic belongs. This parameter is a helper for narrowing the search.

cache

A logical whether to do caching. Default is TRUE. See About caching section on catr_set_cache_dir().

update_cache

A logical whether to update cache. Default is FALSE. When set to TRUE it would force a fresh download of the source file.

cache_dir

A path to a cache directory. On NULL value (the default) the function would store the cached files on the tempdir.

verbose

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

Value

A tibble.

Examples

# \donttest{
catr_atom_search_munic("Mad")
#> Warning: cannot open URL 'https://www.catastro.hacienda.gob.es/INSPIRE/Addresses/ES.SDGC.AD.atom.xml': HTTP status was '500 Internal Server Error'
#> Warning: cannot open URL 'https://www.catastro.hacienda.gob.es/INSPIRE/Addresses/ES.SDGC.AD.atom.xml': HTTP status was '500 Internal Server Error'
#> Download failed
#> 
#> url 
#>  https://www.catastro.hacienda.gob.es/INSPIRE/Addresses/ES.SDGC.AD.atom.xml not reachable.
#> 
#> Please try with another options. If you think this is a bug please consider opening an issue
#> Error in catr_hlp_dwnload(api_entry, filename, cache_dir, verbose, update_cache,     cache): 
#> Execution halted
# }