Learn R Programming

RCzechia (version 1.4.3)

revgeo: Reversely Geocode a Czech Address

Description

This function connects to Czech State Administration of Land Surveying and Cadastre (https://www.cuzk.cz/en) API to reversely geocode an address. As consequence it is implemented only for Czech addresses.

Usage

revgeo(coords)

Arguments

coords

coordinates to be reverse geocoded; expected as sf data frame of spatial points

Details

Input of the function is a sf data frame of spatial points, and output a vector of characters.

The function returns the same sf data frame as input, with added field revgeocoded; it contains the result of operation. If the data frame contained a column named revgeocoded it gets overwritten.

In case of reverse geocoding failures (e.g. coordinates outside of the Czech Republic and therefore scope of <U+010C><U+00DA>ZK) NA is returned.

Usage of the <U+010C><U+00DA>ZK API is governed by <U+010C><U+00DA>ZK Terms & Conditions - https://geoportal.cuzk.cz/Dokumenty/Podminky.pdf.

Examples

Run this code
# NOT RUN {
library(dplyr)
library(sf)

brno <- obce_polygony() %>% # shapefile of Brno
   filter(NAZ_OBEC == "Brno")

pupek_brna <- st_centroid(brno) # calculate centroid

adresa_pupku <- revgeo(pupek_brna)$revgeocoded # address of the center

# }

Run the code above in your browser using DataLab