geocode: Geocode a Czech Address

Description Usage Arguments Format Details Examples

View source: R/geocode.R

Description

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

Usage

1
geocode(address, crs = 4326)

Arguments

address

point to be geocoded, as character (vector)

crs

coordinate reference system of output; default = WGS84

Format

sf data frame with 3 variables + geometry

address

the address searched (address input)

type

type of record matched by API

result

address as returned by API / recorded in RÚIAN

geometry

hidden column with spatial point data

Details

Input of the function are an address to geocode (or a vector of addresses) and expected Coordinate Reference System of output (default is WGS84 = EPSG:4326, but in some use cases inž. Křovák = EPSG:5514 may be more relevant).

NA's in input are considered an error.

Output is a sf data frame of spatial points.

Depending on the outcome of matching the address to RÚIAN data there is a number of possible outcomes:

Note that character encoding is heavily platform dependent, and you may need to convert to UTF-8, e.g. by running address <- iconv(address, from = "windows-1250", to = "UTF-8") before calling the function.

Usage of the ČÚZK API is governed by ČÚZK Terms & Conditions - https://geoportal.cuzk.cz/Dokumenty/Podminky.pdf.

Examples

1
2
asdf <- geocode("Gogolova 212, Praha 1")
print(asdf)

RCzechia documentation built on April 12, 2021, 1:07 a.m.