Package 'RCzechia'

Title: Spatial Objects of the Czech Republic
Description: Administrative regions and other spatial objects of the Czech Republic.
Authors: Jindra Lacko [aut, cre] , Nick Bearman [rev] (<https://orcid.org/0000-0002-8396-4061>, Nick reviewed the package for JOSS, providing helpful comments leading to significant improvement of the package.)
Maintainer: Jindra Lacko <[email protected]>
License: MIT + file LICENSE
Version: 1.12.3
Built: 2024-11-26 10:22:52 UTC
Source: CRAN

Help Index


RCzechia: Spatial Objects of the Czech Republic

Description

A selection of spatial objects relevant to the Czech Republic. Due to CRAN package size requirements (5 MB) the objects are stored externally (on Amazon S3) - and therefore could not be implemented as datasets. They are functions returning data frames instead.

Details

To save time (and bandwidth) the downloaded objects are saved locally in tempdir directory when requested, and downloaded at most once per R session; out of respect to CRAN Repository Policy a more permanent caching on user's side is not attempted by default – but it can be actively introduced by the user either via a RCzechia::set_home() call or by setting the value of RCZECHIA_HOME environment variable directly, either using a Sys.setenv() call or via editing the .Renviron file.

This means that:

  • a working internet connection is required to use the full resolution objects

  • the first call to an object in a R session will download the object from the internet (and thus take some time)

  • the user an has an option to create a permanent local cache of the objects by setting the RCZECHIA_HOME environment variable in her .Renviron file, gaining a faster access to the objects in the future and sidestepping the requirement of a working internet connection. Out of respect to CRAN Repository Policy this is not default behavior.

For the most frequently used objects - republika, kraje and okresy - a low resolution version is also implemented. The low resolution data sets are stored locally (and working internet connection is not necessary to use them).

All objects are implemented as sf data frames.

Data overview & download sizes

  • republika - borders of the Czech Republic

    source: RÚIAN / ČÚZK, high res object: 245.8 KB, low res version internal

  • kraje - 14 regions / NUTS3 units

    source: RÚIAN / ČÚZK, high res object: 982.2 KB, low res version internal

  • okresy - 76 + 1 districts / LAU1 units

    source: RÚIAN / ČÚZK, high res object: 2.1 MB, low res version internal

  • orp_polygony - 205 + 1 municipalities with extended powers

    source: RÚIAN / ČÚZK, high res object: 3.1 MB, no low res version

  • obce_polygony - 6.258 municipalities as polygons

    source: RÚIAN / ČÚZK, high res object: 13.3 MB, no low res version

  • obce_body - 6.258 municipalities as centroids (points)

    source: RÚIAN / ČÚZK, high res object: 252.0 KB, no low res version

  • casti - 57 city districts (where available)

    source: RÚIAN / ČÚZK, high res object: 1.5 MB, no low res version

  • senat_obvody - 81 senate districts

    source: Czech Statistical Office, high res object: 10.5 MB, low res object: 50.0 KB

  • volebni_okrsky - 14.733 general election districts

    source: RÚIAN / ČÚZK, high res object: 75.8 MB, low res object: 5.0 MB

  • katastry - 13.076 cadastral areas of the Czech Republic

    source: RÚIAN / ČÚZK, high res object: 26.1 MB, no low res version

  • zip_codes - 2.671 ZIP code areas

    source: Czech Statistical Office, high res object: 45.4 MB, low res object: 2.1 MB

  • reky - rivers

    source: Data200, high res object: 4.4 MB, low res object: 301.4 KB

  • plochy - water bodies

    source: Data200, high res object: 687.0 KB, no low res version

  • lesy - woodland areas

    source: ArcČR 500 v3.3, high res object: 2.1 MB, no low res version

  • silnice - roads

    source: Data200, high res object: 6.0 MB, no low res version

  • zeleznice - railroads

    source: Data200, high res object: 805.8 KB, no low res version

  • KFME_grid - KFME grid cells (faunistické čtverce)

    source: own work, internal

  • chr_uzemi - protected natural areas

    source: AOPK ČR, high res object: 7.0 MB, no low res version

  • vyskopis - terrain relief

    source: Copernicus EU, high res object: 68.8 MB, no low res version

  • geomorfo - geomorphological divisions

    source: CENIA / INSPIRE, high res object: <1 MB, no low res version

  • historie - historical admin areas and census records, download size ~ 100 KB to 3.5 MB depending on object

    source: URRlab

Utility functions

In addition the following utility functions are implemented to support spatial workflow:

  • geocode - geocoding (from address to coordinates)

  • revgeo - reverse geocoding (from coordinates to address)

Author(s)

Maintainer: Jindra Lacko [email protected] (ORCID)

Other contributors:

  • Nick Bearman (ORCID) (Nick reviewed the package for JOSS, providing helpful comments leading to significant improvement of the package.) [reviewer]

References

Lacko J (2023). “RCzechia: Spatial Objects of the Czech Republic.” Journal of Open Source Software, 8(83). doi:10.21105/joss.05082, https://joss.theoj.org/papers/10.21105/joss.05082.

See Also

Useful links:


City Districts

Description

Function taking no parameters and returning data frame of districts of Prague and other major cities as sf polygons.

Usage

casti()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The dataset is based on RUIAN data by the Czech cadastral office. If necessary you can download the most up to date raw dataset in VFR format (a special case of XML which is understood by GDAL) on https://vdp.cuzk.cz/vdp/ruian/vymennyformat (in Czech only).

The data is current to June 2024. Downloaded size is 1.5 MB.

Value

sf data frame with 142 rows of 4 variables + geometry

KOD

Code of the city part / kod mestske casti

NAZEV

Name of the city part / nazev mestske casti

KOD_OBEC

Code of the city

NAZ_OBEC

Name of the city

Source

© ČÚZK, 2021 https://vdp.cuzk.cz/


Protected Natural Areas

Description

Function returning data frame of protected natural areas (Chráněná území) of the Czech Republic as sf polygons. It has no obligatory parameters.

Usage

chr_uzemi()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to September 2020. Downloaded size is 7 MB (so use with caution, and patience).

Value

sf data frame with 2677 rows of 3 variables + geometry

TYP

Type of protected area

NAZEV

Name, with Czech accents

PLOCHA

type of protected area: large or small

Source

© AOPK ČR, 2020 https://data.nature.cz/


Geocode a Czech Address

Description

This function connects to Czech State Administration of Land Surveying and Cadastre (https://cuzk.gov.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

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:

  • 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Ú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 empty data frame and a message.

  • The CUZK API is down or overloaded: the function returns empty data frame and a message.

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.

Value

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

Examples

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

Geomorphological division of the Czech Republic

Description

Function returning one of the 8 levels of Geomorphological division of the Czech Republic, as specified by the obligatory parameter level.

Usage

geomorfo(level)

Arguments

level

level of geomorphological division. One of system, subsystem, provincie, subprovincie, oblast, celek, podcelek, okrsek.

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to 2014 (3rd edition of Demek & Mackovčin's Zeměpisný lexikon ČR. Hory a nížiny.) Downloaded size is < 1 MB for any of the hierarchy levels.

Value

sf data frame with geomorfo division names & codes + geometry; namely:

system

name of the system; 2 rows

subsystem

names of the system, subsystem + kod; 4 rows

provincie

name of the province; 4 rows

subprovincie

name of the subprovince + kod; 10 rows

oblast

name of the subprovince, oblast + kod; 27 rows

celek

name of the subprovince, oblast, celek + kod; 93 rows

podcelek

name of the subprovince, oblast, celek, podcelek + kod; 253 rows

okrsek

name of the subprovince, oblast, celek, podcelek, okrsek + kod; 933 rows

Source

CENIA / INSPIRE, via Mgr. Vojtěch Blažek, Ph.D. https://www.arcgis.com/home/item.html?id=25813686a8564b0bbcdc951a5573cfa4

Examples

library(sf)

soustavy <- RCzechia::geomorfo("subprovincie")

plot(soustavy["kod"])

Historical censuses of the Czech Republic

Description

Function returning historical admin areas of the Czech Republic, together with relevant census data as specified by parameter era.

Usage

historie(era)

Arguments

era

a historical era of interest.

Details

The census data structure is too complex to fully list here; most of the fields are self documenting (for Czech speakers) - and when in doubt please consult the original metadata at https://cuni.maps.arcgis.com/home/item.html?id=c2f19cd1146747a9a8daf5b900e7747b, or the original journal article at doi:10.14712/23361980.2015.93.

Of notable interest is the 1930 census, which was the last before WWII - and thus the last one to include Czechoslovak citizens of German ethnicity.

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

Value

sf data frame with historical admin area names & census data + geometry; namely:

okresy_1921

soudní okresy + census 1921; 328 rows / 92 columns + geometry

okresy_1930

soudní okresy + census 1931; 330 rows / 90 columns + geometry

okresy_1947

politické okresy + census 1947; 163 rows / 68 columns + geometry

okresy_1950

správní okresy + census 1950; 182 rows / 57 columns + geometry

okresy_1961

správní okresy + census 1960; 76 rows / 105 columns + geometry

okresy_1970

správní okresy + census 1970; 76 rows / 144 columns + geometry

okresy_1980

správní okresy + census 1980; 76 rows / 148 columns + geometry

okresy_1991

správní okresy + census 1991; 76 rows / 155 columns + geometry

okresy_2001

správní okresy + census 2001; 77 rows / 174 columns + geometry

okresy_2011

správní okresy + census 2011; 77 rows / 176 columns + geometry

kraje_1950

kraje + census 1950; 13 rows / 55 columns + geometry

kraje_1961

kraje + census 1960; 8 rows / 103 columns + geometry

kraje_1970

kraje + census 1970; 8 rows / 144 columns + geometry

kraje_1980

kraje + census 1980; 8 rows / 146 columns + geometry

kraje_1991

kraje + census 1991; 8 rows / 153 columns + geometry

kraje_2001

kraje + census 2001; 14 rows / 172 columns + geometry

kraje_2011

kraje + census 2011; 14 rows / 174 columns + geometry

Credits:

  1. „Tento výstup vznikl v rámci řešení projektu číslo DF12P01OVV033 Zpřístupnění historických prostorových a statistických dat v prostředí GIS řešeného v rámci programu Aplikovaného výzkumu a vývoje národní a kulturní identity (NAKI), jehož poskytovatel je Ministerstvo kultury České republiky.“

  2. „JÍCHOVÁ, J., SOUKUP, M., NEMEŠKAL, J., OUŘEDNÍČEK, M., POSPÍŠILOVÁ, L., SVOBODA, P., ŠPAČKOVÁ, P. a kol. (2014): Geodatabáze historických statistických a prostorových dat Česka ze Sčítání lidu, domů a bytů 1921-2011. Urbánní a regionální laboratoř, Přírodovědecká fakulta Univerzity Karlovy v Praze, Praha.“

Source

Urbánní a regionální laboratoř (UrRlab) působící na katedře sociální geografie a regionálního rozvoje Přírodovědecké fakulty Univerzity Karlovy v Praze https://www.historickygis.cz/

Examples

library(sf)

pre_war <- RCzechia::historie("okresy_1930")

plot(pre_war[, 47], main = "Residents of German ethnicity")

Cadastral Areas

Description

Function taking no parameters and returning data frame of cadastral areas (katastrální území) as sf polygons.

Usage

katastry()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The dataset is based on RUIAN data by the Czech cadastral office. If necessary you can download the most up to date raw dataset in VFR format (a special case of XML which is understood by GDAL) on https://vdp.cuzk.cz/vdp/ruian/vymennyformat (in Czech only).

The data is current to June 2024. Downloaded size is 26.1 MB.

Value

sf data frame with 142 rows of 4 variables + geometry

KOD

Code of the cadastral area / kód katastrálního území

NAZEV

Name of the cadastral area / název katastrálního území

KOD_OBEC

Code of the municipality

NAZ_OBEC

Name of the municipality

digi

boolean indicating completed digitalization

Source

© ČÚZK, 2024 https://vdp.cuzk.cz/

Examples

library(sf)

# which cadastral area of Prague is the smallest?
praha <- RCzechia::katastry() |>
   subset(NAZ_OBEC == "Praha")

smallest <- which.min(sf::st_area(praha))

plot(st_geometry(RCzechia::obce_polygony() |>
   subset(NAZ_OBEC == "Praha")))

plot(st_geometry(RCzechia::reky("Praha")), col = "navyblue", add = TRUE)

# it is Josefov - the former Jewish Ghetto
plot(st_geometry(praha[smallest, ]), col = "red", add = TRUE)

KFME grid cells (faunistické čtverce) of the Czech Republic

Description

Function returning grid covering the Czech Republic according to the Kartierung der Flora Mitteleuropas methodology.

Usage

KFME_grid(resolution = "low")

Arguments

resolution

Should the function return high or low resolution shapefile? Allowed values are "low" and "high". Default is "low".

Details

The function returns a sf data frame of grid cells. Depending on the value of parameter resolution either low resolution (26×42 cells - default) with labels in 4 digit format (e.g. Hrčava = 6479) or high resolution (104×168 cells) with labels in 4 digit + 1 letter format (e.g Hrčava = 6479c).

Raw version of the dataset is available for download for use in non-R setting on https://rczechia.jla-data.net/kfme_czechia.gpkg.

Value

sf data frame with 1092 rows in low resolution and 4368 rows in high resolution

ctverec

KFME code of the grid cell; depending on value of resolution parameter either 4 digits, or 4 digits + 1 letter

Examples

library(ggplot2)

ggplot() +
  geom_sf(data = republika("low")) +
  geom_sf(data = KFME_grid("low"), fill = NA)

Regions (kraje) of the Czech Republic

Description

Function returning data frame of NUTS3 administrative units for the Czech Republic as sf polygons. It takes a single parameter resolution - high res (default) or low res polygons.

Usage

kraje(resolution = "high")

Arguments

resolution

Should the function return high or low resolution shapefile? Allowed values are "high" (default) and "low". This parameter affects only the geometry column, all other fields remain the same.

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The dataset is based on RUIAN data by the Czech cadastral office. If necessary you can download the most up to date raw dataset in VFR format (a special case of XML which is understood by GDAL) on https://vdp.cuzk.cz/vdp/ruian/vymennyformat (in Czech only).

The data is current to June 2024. Downloaded size of high resolution shapefile is <1 MB; low resolution object is internal.

Value

sf data frame with 14 rows of 3 variables + geometry

KOD_KRAJ

Code of the region.

KOD_CZNUTS3

Code of the region as NUTS3 (kraj).

NAZ_CZNUTS3

Name of the region as NUTS3 (kraj).

Source

© ČÚZK, 2024 https://vdp.cuzk.cz/

Examples

library(sf)

colors <- rainbow(14) # legend colors

hranice <- RCzechia::kraje("low")

plot(hranice["KOD_CZNUTS3"],
     col = colors,
     main = "Czech Regions",
     xlim = st_bbox(hranice)[c(1, 3)] * c(1, 1.1))

legend("right",
       hranice$KOD_CZNUTS3,
       fill = colors,
       bty = "n")

Woodland Areas

Description

Function returning data frame of woodland areas (lesy) of more than 30 hectares in are of the Czech Republic as sf polygons. It has no obligatory parameters.

Usage

lesy()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package). The data is current to January 2014. Downloaded size is 2.1 MB.

Value

sf data frame with 2.366 rows of geometry variable only

Source

© ArcČR, ARCDATA PRAHA, ZÚ, ČSÚ, 2016 https://www.arcdata.cz/cs-cz/produkty/data/arccr?rsource=https%3A%2F%2Fwww.arcdata.cz%2Fprodukty%2Fgeograficka-data%2Farccr-4


Municipalities / communes (obce) as centerpoints

Description

Function returning data frame of LAU2 administrative units for the Czech Republic as sf points. It takes no parameters.

Usage

obce_body()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The dataset is based on RUIAN data by the Czech cadastral office. If necessary you can download the most up to date raw dataset in VFR format (a special case of XML which is understood by GDAL) on https://vdp.cuzk.cz/vdp/ruian/vymennyformat (in Czech only).

The data is current to June 2024. Downloaded size is <1 MB.

Value

sf data frame with 6.258 rows of 14 variables + geometry

KOD_OBEC

Code of the level I commune (obec).

NAZ_OBEC

Name of the level I commune (obec).

KOD_POU

Code of the level II commune (obec s poverenym uradem).

NAZ_POU

Name of the level II commune (obec s poverenym uradem)).

KOD_ORP

Code of the level III commune (obec s rozsirenou pusobnosti).

NAZ_ORP

Name of the level III commune (obec s rozsirenou pusobnosti).

KOD_OKRES

Code of the district (okres).

KOD_LAU1

Code of the LAU1 administrative unit (okres).

NAZ_LAU1

Name of the LAU1 administrative unit (okres).

KOD_KRAJ

Code of the region (kraj).

KOD_CZNUTS3

Code of the NUTS3 unit (kraj)

NAZ_CZNUTS3

Name of the NUTS3 unit (kraj)

Source

© ČÚZK, 2021 https://vdp.cuzk.cz/


Municipalities / communes (obce) as polygons

Description

Function returning data frame of LAU2 administrative units for the Czech Republic as sf polygons. It takes no parameters.

Usage

obce_polygony()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The dataset is based on RUIAN data by the Czech cadastral office. If necessary you can download the most up to date raw dataset in VFR format (a special case of XML which is understood by GDAL) on https://vdp.cuzk.cz/vdp/ruian/vymennyformat (in Czech only).

The data is current to June 2024. Downloaded size is 13.2 MB (so use with caution, and patience).

Value

sf data frame with 6.258 rows of 14 variables + geometry

KOD_OBEC

Code of the level I commune (obec).

NAZ_OBEC

Name of the level I commune (obec).

KOD_POU

Code of the level II commune (obec s poverenym uradem).

NAZ_POU

Name of the level II commune (obec s poverenym uradem)).

KOD_ORP

Code of the level III commune (obec s rozsirenou pusobnosti).

NAZ_ORP

Name of the level III commune (obec s rozsirenou pusobnosti).

KOD_OKRES

Code of the district (okres).

KOD_LAU1

Code of the LAU1 administrative unit (okres).

NAZ_LAU1

Name of the LAU1 administrative unit (okres).

KOD_KRAJ

Code of the region (kraj).

KOD_CZNUTS3

Code of the NUTS3 unit (kraj)

NAZ_CZNUTS3

Name of the NUTS3 unit (kraj)

Source

© ČÚZK, 2021 https://vdp.cuzk.cz/

Examples

library(sf)
library(dplyr)

praha <- obce_polygony() %>%
  filter(NAZ_LAU1 == "Praha")

plot(praha, max.plot = 1)

Districts (okresy)

Description

Function returning data frame of LAU1 administrative units for the Czech Republic as sf polygons. It takes a single parameter resolution - high res (default) or low res polygons.

Usage

okresy(resolution = "high")

Arguments

resolution

Should the function return high or low resolution shapefile? Allowed values are "high" (default) and "low". This parameter affects only the geometry column, all other fields remain the same.

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The dataset is based on RUIAN data by the Czech cadastral office. If necessary you can download the most up to date raw dataset in VFR format (a special case of XML which is understood by GDAL) on https://vdp.cuzk.cz/vdp/ruian/vymennyformat (in Czech only).

The data is current to June 2024. Downloaded size of high resolution shapefile 2.1 MB; low resolution object is internal.

Value

sf data frame with 77 rows of 6 variables + geometry

KOD_OKRES

Code of the district (okres).

KOD_LAU1

Code of the district as LAU1 unit (okres).

NAZ_LAU1

Name of the district as LAU1 unit (okres).

KOD_KRAJ

Code of the region.

KOD_CZNUTS3

Code of the region as NUTS3 (kraj).

NAZ_CZNUTS3

Name of the region (kraj).

Source

© ČÚZK, 2021 https://vdp.cuzk.cz/

Examples

library(sf)

hranice <- okresy()
plot(st_geometry(hranice), col = "white")

object.size(okresy("low"))
object.size(okresy("high"))

Obce s rozsirenou pusobnosti

Description

Function returning data frame of municipalities with extended powers (obce s rozšířenou působností) as sf polygons. It takes no parameters.

Usage

orp_polygony()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The dataset is based on RUIAN data by the Czech cadastral office. If necessary you can download the most up to date raw dataset in VFR format (a special case of XML which is understood by GDAL) on https://vdp.cuzk.cz/vdp/ruian/vymennyformat (in Czech only).

The data is current to June 2024. Downloaded size is 3.1 MB.

Value

sf data frame with 206 rows of 5 variables + geometry

KOD_ORP

Code of the level III commune (obec s rozsirenou pusobnosti).

NAZ_ORP

Full name of the level III commune (obec s rozsirenou pusobnosti).

KOD_KRAJ

Code of the region (kraj).

KOD_CZNUTS3

Code of the NUTS3 unit (kraj)

NAZ_CZNUTS3

Name of the NUTS3 unit (kraj)

Source

© ČÚZK, 2024 https://vdp.cuzk.cz/


Water Bodies

Description

Function returning data frame of water bodies of the Czech Republic as sf polygons. It takes no parameters.

Usage

plochy()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to December 2020. Downloaded size is 1.5 MB.

Value

sf data frame with 1.769 rows of 2 variables + geometry

NAZEV

Name, with Czech accents

VYSKA

water level, meters above sea level

Source

Mapový podklad – Data200, 2021 © Český úřad zeměměřický a katastrální. https://cuzk.gov.cz


Rivers

Description

Function returning data frame of rivers of the Czech Republic as sf lines. It takes a single parameter scope with default "global".

Usage

reky(scope = "global", resolution = "high")

Arguments

scope

Should the function return all rivers, or just Vltava in Prague / Svitava & Svratka in Brno?

resolution

Should the function return high or low resolution shapefile? Allowed values are "high" (default) and "low". This parameter affects only the geometry column, all other fields remain the same.

Details

Two special case scopes are defined: Praha (returning the part of Vltava in and around Prague) and Brno (returning Svitava and Svratka near and around Brno).

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to January 2021. Downloaded size is 4.4 MB.

Value

sf data frame with 3.617 rows of 4 variables + geometry:

TYP

Type of river

NAZEV

Name, with Czech accents

Navigable

Boolean indicating navigability of river.

Major

Boolean indicating one of the major rivers.

Source

Mapový podklad – Data200, 2021 © Český úřad zeměměřický a katastrální. https://cuzk.gov.cz>

Examples

library(sf)

plot(st_geometry(subset(okresy(), KOD_LAU1 == "CZ0642"))) # Brno city
plot(reky("Brno"), add = TRUE) # Svitava & Svratka added to Brno my city plot

Republika

Description

Boundaries of the Czech Republic as sf polygon.

Usage

republika(resolution = "high")

Arguments

resolution

Should the function return high or low resolution shapefile? Allowed values are "high" (default) and "low". This parameter affects only the geometry column, all other fields remain the same.

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The dataset is based on RUIAN data by the Czech cadastral office. If necessary you can download the most up to date raw dataset in VFR format (a special case of XML which is understood by GDAL) on https://vdp.cuzk.cz/vdp/ruian/vymennyformat (in Czech only).

The data is current to June 2024. Downloaded size of high resolution shapefile is <1 MB; low resolution object is internal.

Value

sf data frame with 1 row of 1 variable + geometry:

Source

© ČÚZK, 2021 https://vdp.cuzk.cz/

Examples

library(sf)

hranice <- republika("low")
plot(hranice, col = "white")

Reversely Geocode a Czech Address

Description

This function connects to Czech State Administration of Land Surveying and Cadastre (https://cuzk.gov.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. Should the data frame contain a column named revgeocoded it will be overwritten.

In case of reverse geocoding failures (e.g. coordinates outside of the Czech Republic and therefore scope of ČÚZK) NA is returned.

In case of API failures (CUZK down) the function returns NAs again, with a message.

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

Value

sf data frame as input, with column revgeocoded added (or overwritten)

Examples

library(dplyr)
library(sf)

brno <- obce_polygony() %>% # shapefile of Brno
  filter(NAZ_OBEC == "Brno") %>%
  st_transform(5514) # planar CRS (eastings & northings)

pupek_brna <- st_centroid(brno) # calculate centroid

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

print(adresa_pupku)

Senate Districts (Volební obvod pro volby do Senátu) of the Czech Republic

Description

Function returning data frame of the 81 Senate Districts for the Czech Republic as sf polygons. It takes a single parameter resolution - high res (default) or low res polygons.

Usage

senat_obvody(resolution = "high")

Arguments

resolution

Should the function return high or low resolution shapefile? Allowed values are "high" (default) and "low". This parameter affects only the geometry column, all other fields remain the same.

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to February 2021 (last update was in 2016). Downloaded size of high resolution shapefile is 10 MB, size of the low res object is negligible (but a working internet is still required, as the object is not internal).

Value

sf data frame with 81 rows of 3 variables + geometry

OBVOD

Code of the district; left padded with zero in case of districts one to nine.

SIDLO

Seat of the senator.

NAZEV_VO

Formal name of the district.

Source

ČSÚ https://www.czso.cz/csu/czso/podminky_pro_vyuzivani_a_dalsi_zverejnovani_statistickych_udaju_csu

Examples

library(sf)

senat <- senat_obvody("low")
plot(st_geometry(senat), col = "white")
nrow(senat) # 81, because the Constitution says so...

Set the local cache directory

Description

The function sets the environment variable RCZECHIA_HOME to be used as a local cache for RCzechia remote files; if unset tempdir() is used instead, with persistence for current session only.

Usage

set_home(path)

Arguments

path

path to local filesystem directory to be used as a cache; must exist and must be writable

Details

Note that when set (it is unset by default) the remote files will be cached to local file system and persist between R sessions, for good or bad.

Also note that you can set the value of RCZECHIA_HOME environment variable directly, either via a Sys.setenv() call or via your .Renviron file.

Value

TRUE for success and FALSE for failure; returned silently


Road Network

Description

Function returning data frame of roads of the Czech Republic as sf lines. It has no obligatory parameters.

Usage

silnice()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to December 2020. Downloaded size is 6 MB.

Value

sf data frame with 59.594 rows of 3 variables + geometry:

TRIDA

Class of the road:

  • highway = dálnice,

  • speedway = rychlostní silnice,

  • 1st class road = silnice I. třídy,

  • 2nd class road = silnice II. třídy,

  • 3rd class road = silnice III. třídy,

  • other road = neevidovaná silnice

CISLO_SILNICE

Local road code

MEZINARODNI_OZNACENI

International road code

Source

Mapový podklad – Data200, 2021 © Český úřad zeměměřický a katastrální. https://cuzk.gov.cz


Unset the local cache directory

Description

The function unsets the environment variable RCZECHIA_HOME, meaning tempdir() will be used in future function calls, and no persistent data will be stored locally.

Usage

unset_home()

Value

TRUE for success and FALSE for failure; returned silently


Election Districts (Volební okrsky) of the Czech Republic

Description

Function returning data frame of the local election districts for the Czech Republic as sf polygons. It takes a single parameter resolution - high res (default) or low res polygons.

Usage

volebni_okrsky(resolution = "high")

Arguments

resolution

Should the function return high or low resolution shapefile? Allowed values are "high" (default) and "low". This parameter affects only the geometry column, all other fields remain the same.

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to January 2023 (the presidential elections). Downloaded size of high resolution shapefile is 75 MB, size of the low res object is 5 MB (so proceed with caution, and patience).

Value

sf data frame with 14 733 rows of 6 variables + geometry

Kod

Unique id of the district.

Cislo

Id of the district within a given Obec / not globally unique.

ObecKod

Id of obec - maps to obce_polygony()$KOD_OBEC.

MomcKod

Id of městská část - maps to casti()$KOD.

KOD_LAU1

Id of okres - maps to okresy()$KOD_LAU1.

KOD_CZNUTS3

Id of kraj - maps to kraje()$KOD_CZNUTS3.

Source

© ČÚZK, 2023 https://vdp.cuzk.cz/

Examples

library(sf)

prazske_okrsky <- subset(volebni_okrsky("low"), ObecKod == "554782")
plot(prazske_okrsky) # the districts of Prague

Vyskopis

Description

Terrain of the Czech Republic as a terra package object.

Usage

vyskopis(format = "rayshaded", cropped = TRUE)

Arguments

format

Should the function return actual terrain (meters above sea level) or shaded relief (rayshaded). Allowed values are "actual" and "rayshaded".

cropped

Should the raster provide data over Czech Republic's bounding box (cropped = FALSE) or just actual borders (cropped = TRUE). Defaults to TRUE to preserve compatibility with earlier versions.

Details

The function returns a raster file of either actual terrain (values are meters above sea level) or rayshaded relief.

The raster is created from EU DEM 1.1 file by Copernicus Land Monitoring service. The original file has pixel resolution 25×25 meters, which is too detailed for purposes of the package and was downsampled by factor of 4.

The extent of the raster file is bounding box of the Czech Republic; this is a change to prior versions in order to better facilitate use of the raster in natural sciences context. To preserve compatibility optional argument cropped has been created, defaulting to TRUE (i.e. behavior before v1.10.0).

Due to package size constraints both versions are stored externally (and a working internet connection is required to use the package).

The data is current to year 2011 (but it is not expected to materially change over time). Downloaded size of the rasters is 70 MB, so proceed with caution.

Value

terra package SpatRaster

Source

Copernicus Land Monitoring service, with funding by the European Union. https://land.copernicus.eu/en/products/products-that-are-no-longer-disseminated-on-the-clms-website

Examples

library(terra)

# original extent - bounding box over Czech Republic
original_extent <- vyskopis("rayshaded", cropped = FALSE)

plot(original_extent, col = gray.colors(16))

# add plot of country borders, for context
plot(RCzechia::republika(),
     border = "red",
     col = NA,
     add = TRUE)

# cropped to size - default behaviour
cropped_extent <- vyskopis("rayshaded")

plot(cropped_extent, col = gray.colors(16))

Railroad Network

Description

Function returning data frame of railroads of the Czech Republic as sf lines. It has no obligatory parameters.

Usage

zeleznice()

Details

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to December 2020. Downloaded size is <1 MB.

Value

sf data frame with 9.957 rows of 3 variables + geometry:

ELEKTRIFIKACE

is the railroad electrified?

KOLEJNOST

track: single = jednokolejní, double = dvojkolejní, more = tří a vícekolejní

ROZCHODNOST

gauge: standard = normální, narrow = úzkokolejka

Source

Mapový podklad – Data200, 2021 © Český úřad zeměměřický a katastrální. https://cuzk.gov.cz


ZIP Codes of the Czech Republic

Description

Function returning data frame of the 2 671 ZIP Code Areas for the Czech Republic as sf polygons. It takes a single parameter resolution - high res (default) or low res polygons.

Usage

zip_codes(resolution = "high")

Arguments

resolution

Should the function return high or low resolution shapefile? Allowed values are "high" (default) and "low". This parameter affects only the geometry column, all other fields remain the same.

Details

Note that there are a number of special ZIP Codes - e.g. 118 01 for Government of the Czech Republic (Strakova akademie / Nábřeží Edvarda Beneše 4). These are not listed here, as they do not relate to a specific delivery area but are in essence private.

The geometry type is MULTIPOLYGON, as there are a number of non continuous areas of delivery.

Due to package size constraints the data are stored externally (and a working internet connection is required to use the package).

The data is current to February 2021 (last update was in January 2020). Downloaded size of high resolution shapefile is 45 MB, size of the low res object is 2 MB.

Raw version of the dataset is available for download for use in non-R setting on https://rczechia.jla-data.net/zip_codes.gpkg.

Value

sf data frame with 2 671 rows of 2 variables + geometry

PSC

ZIP Code as string in format NNNNN.

NAZ_POSTA

Responsible Post Office

Source

ČSÚ https://www.czso.cz/csu/czso/podminky_pro_vyuzivani_a_dalsi_zverejnovani_statistickych_udaju_csu

Examples

library(sf)
library(dplyr)

# residence of the Czech Prime Minister
kramarova_vila <- RCzechia::geocode("Gogolova 212, Praha 1")

# ZIP code of the PM residence
kramarova_vila %>%
   st_join(RCzechia::zip_codes("low"), left = FALSE) %>%
   pull(PSC)