catr_get_code_from_coords {CatastRo} | R Documentation |
This function takes as an input a pair of coordinates of a sf
object
and returns the corresponding municipality code for that coordinates.
See also mapSpain::esp_get_munic_siane()
and catr_ovc_get_cod_munic()
.
catr_get_code_from_coords(x, srs, verbose = FALSE, cache_dir = NULL, ...)
x |
It could be:
|
srs |
SRS/CRS to use on the query. To check the admitted values check
catr_srs_values, specifically the |
verbose |
Logical, displays information. Useful for debugging,
default is |
cache_dir |
A path to a cache directory. On missing value the function
would store the cached files on a temporary dir (See |
... |
Arguments passed on to
|
When x
is a numeric vector, make sure that the srs
matches the
coordinate values.
When x
is a sf
object, only the first value would be used. The function
would extract the coordinates using
sf::st_centroid(x, of_largest_polygon = TRUE)
.
A tibble with the format described in catr_ovc_get_cod_munic()
.
mapSpain::esp_get_munic_siane()
, sf::st_centroid()
.
Other search:
catr_atom_search_munic()
,
catr_ovc_get_cod_munic()
,
catr_ovc_get_cod_provinces()
# Use with coords
catr_get_code_from_coords(c(-16.25462, 28.46824), srs = 4326)
# Use with sf
prov <- mapSpain::esp_get_prov("Caceres")
catr_get_code_from_coords(prov)