Learn R Programming

RCzechia (version 1.4.3)

geocode: Geocode a Czech Address

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

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

target

the address searched (address input)

typ

type of record matched by API

address

address as recorded by R<U+00DA>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<U+017E>. K<U+0159>ov<U+00E1>k = EPSG:5514 may be more relevant).

Output is a sf data frame of spatial points.

Depending on the outcome of matching the address to R<U+00DA>IAN data there is a number of possible outcomes:

  • All items were *matched exactly*: the returned sf data frame has the same number of rows as there were elements in vector to be geocoded. The field target will have zero duplicates.

  • Some items had *multiple matches*: the returned sf data frame has more rows than the there were elements in vector to be geocoded. In the field target will be duplicate values. Note that the R<U+00DA>IAN API limits multiple matches to 10.

  • Some (but not all) items had *no match* in RUIAN data: the returned sf data frame will have fewer rows than the vector sent. to be geocoded elements. Some values will be missing from field target.

  • No items were matched at all: the function returns NA.

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 {
asdf <- geocode("Pod s<U+00ED>dli<U+0161>t<U+011B>m 9, Praha 8") # physical address of <U+010C><U+00DA>ZK
print(asdf)

# }

Run the code above in your browser using DataLab