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 |
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.
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.
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
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)
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]
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.
Useful links:
Function taking no parameters and returning data frame of districts of Prague and other major cities as sf
polygons.
casti()
casti()
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.
sf
data frame with 142 rows of 4 variables + geometry
Code of the city part / kod mestske casti
Name of the city part / nazev mestske casti
Code of the city
Name of the city
© ČÚZK, 2021 https://vdp.cuzk.cz/
Function returning data frame of protected natural areas (Chráněná území) of the Czech Republic as sf
polygons. It has no obligatory parameters.
chr_uzemi()
chr_uzemi()
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).
sf
data frame with 2677 rows of 3 variables + geometry
Type of protected area
Name, with Czech accents
type of protected area: large or small
© AOPK ČR, 2020 https://data.nature.cz/
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.
geocode(address, crs = 4326)
geocode(address, crs = 4326)
address |
point to be geocoded, as character (vector) |
crs |
coordinate reference system of output; default = WGS84 |
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.
sf
data frame with 3 variables + geometry
the address searched (address input)
type of record matched by API
address as returned by API / recorded in RÚIAN
hidden column with spatial point data
asdf <- geocode("Gogolova 212, Praha 1") print(asdf)
asdf <- geocode("Gogolova 212, Praha 1") print(asdf)
Function returning one of the 8 levels of Geomorphological division of the Czech Republic, as specified by the obligatory parameter level.
geomorfo(level)
geomorfo(level)
level |
level of geomorphological division. One of system, subsystem, provincie, subprovincie, oblast, celek, podcelek, okrsek. |
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.
sf
data frame with geomorfo division names & codes + geometry; namely:
name of the system; 2 rows
names of the system, subsystem + kod; 4 rows
name of the province; 4 rows
name of the subprovince + kod; 10 rows
name of the subprovince, oblast + kod; 27 rows
name of the subprovince, oblast, celek + kod; 93 rows
name of the subprovince, oblast, celek, podcelek + kod; 253 rows
name of the subprovince, oblast, celek, podcelek, okrsek + kod; 933 rows
CENIA / INSPIRE, via Mgr. Vojtěch Blažek, Ph.D. https://www.arcgis.com/home/item.html?id=25813686a8564b0bbcdc951a5573cfa4
library(sf) soustavy <- RCzechia::geomorfo("subprovincie") plot(soustavy["kod"])
library(sf) soustavy <- RCzechia::geomorfo("subprovincie") plot(soustavy["kod"])
Function returning historical admin areas of the Czech Republic, together with relevant census data as specified by parameter era.
historie(era)
historie(era)
era |
a historical era of interest. |
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).
sf
data frame with historical admin area names & census data + geometry; namely:
soudní okresy + census 1921; 328 rows / 92 columns + geometry
soudní okresy + census 1931; 330 rows / 90 columns + geometry
politické okresy + census 1947; 163 rows / 68 columns + geometry
správní okresy + census 1950; 182 rows / 57 columns + geometry
správní okresy + census 1960; 76 rows / 105 columns + geometry
správní okresy + census 1970; 76 rows / 144 columns + geometry
správní okresy + census 1980; 76 rows / 148 columns + geometry
správní okresy + census 1991; 76 rows / 155 columns + geometry
správní okresy + census 2001; 77 rows / 174 columns + geometry
správní okresy + census 2011; 77 rows / 176 columns + geometry
kraje + census 1950; 13 rows / 55 columns + geometry
kraje + census 1960; 8 rows / 103 columns + geometry
kraje + census 1970; 8 rows / 144 columns + geometry
kraje + census 1980; 8 rows / 146 columns + geometry
kraje + census 1991; 8 rows / 153 columns + geometry
kraje + census 2001; 14 rows / 172 columns + geometry
kraje + census 2011; 14 rows / 174 columns + geometry
Credits:
„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.“
„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.“
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/
library(sf) pre_war <- RCzechia::historie("okresy_1930") plot(pre_war[, 47], main = "Residents of German ethnicity")
library(sf) pre_war <- RCzechia::historie("okresy_1930") plot(pre_war[, 47], main = "Residents of German ethnicity")
Function taking no parameters and returning data frame of cadastral areas (katastrální území) as sf
polygons.
katastry()
katastry()
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.
sf
data frame with 142 rows of 4 variables + geometry
Code of the cadastral area / kód katastrálního území
Name of the cadastral area / název katastrálního území
Code of the municipality
Name of the municipality
boolean indicating completed digitalization
© ČÚZK, 2024 https://vdp.cuzk.cz/
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)
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)
Function returning grid covering the Czech Republic according to the Kartierung der Flora Mitteleuropas methodology.
KFME_grid(resolution = "low")
KFME_grid(resolution = "low")
resolution |
Should the function return high or low resolution shapefile? Allowed values are "low" and "high". Default is "low". |
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.
sf
data frame with 1092 rows in low resolution and 4368 rows in high resolution
KFME code of the grid cell; depending on value of resolution
parameter either 4 digits, or 4 digits + 1 letter
library(ggplot2) ggplot() + geom_sf(data = republika("low")) + geom_sf(data = KFME_grid("low"), fill = NA)
library(ggplot2) ggplot() + geom_sf(data = republika("low")) + geom_sf(data = KFME_grid("low"), fill = NA)
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.
kraje(resolution = "high")
kraje(resolution = "high")
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. |
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.
sf
data frame with 14 rows of 3 variables + geometry
Code of the region.
Code of the region as NUTS3 (kraj).
Name of the region as NUTS3 (kraj).
© ČÚZK, 2024 https://vdp.cuzk.cz/
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")
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")
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.
lesy()
lesy()
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.
sf
data frame with 2.366 rows of geometry variable only
© 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
Function returning data frame of LAU2 administrative units for the Czech Republic as sf
points. It takes no parameters.
obce_body()
obce_body()
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.
sf
data frame with 6.258 rows of 14 variables + geometry
Code of the level I commune (obec).
Name of the level I commune (obec).
Code of the level II commune (obec s poverenym uradem).
Name of the level II commune (obec s poverenym uradem)).
Code of the level III commune (obec s rozsirenou pusobnosti).
Name of the level III commune (obec s rozsirenou pusobnosti).
Code of the district (okres).
Code of the LAU1 administrative unit (okres).
Name of the LAU1 administrative unit (okres).
Code of the region (kraj).
Code of the NUTS3 unit (kraj)
Name of the NUTS3 unit (kraj)
© ČÚZK, 2021 https://vdp.cuzk.cz/
Function returning data frame of LAU2 administrative units for the Czech Republic as sf
polygons. It takes no parameters.
obce_polygony()
obce_polygony()
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).
sf
data frame with 6.258 rows of 14 variables + geometry
Code of the level I commune (obec).
Name of the level I commune (obec).
Code of the level II commune (obec s poverenym uradem).
Name of the level II commune (obec s poverenym uradem)).
Code of the level III commune (obec s rozsirenou pusobnosti).
Name of the level III commune (obec s rozsirenou pusobnosti).
Code of the district (okres).
Code of the LAU1 administrative unit (okres).
Name of the LAU1 administrative unit (okres).
Code of the region (kraj).
Code of the NUTS3 unit (kraj)
Name of the NUTS3 unit (kraj)
© ČÚZK, 2021 https://vdp.cuzk.cz/
library(sf) library(dplyr) praha <- obce_polygony() %>% filter(NAZ_LAU1 == "Praha") plot(praha, max.plot = 1)
library(sf) library(dplyr) praha <- obce_polygony() %>% filter(NAZ_LAU1 == "Praha") plot(praha, max.plot = 1)
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.
okresy(resolution = "high")
okresy(resolution = "high")
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. |
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.
sf
data frame with 77 rows of 6 variables + geometry
Code of the district (okres).
Code of the district as LAU1 unit (okres).
Name of the district as LAU1 unit (okres).
Code of the region.
Code of the region as NUTS3 (kraj).
Name of the region (kraj).
© ČÚZK, 2021 https://vdp.cuzk.cz/
library(sf) hranice <- okresy() plot(st_geometry(hranice), col = "white") object.size(okresy("low")) object.size(okresy("high"))
library(sf) hranice <- okresy() plot(st_geometry(hranice), col = "white") object.size(okresy("low")) object.size(okresy("high"))
Function returning data frame of municipalities with extended powers (obce s rozšířenou působností) as sf
polygons. It takes no parameters.
orp_polygony()
orp_polygony()
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.
sf
data frame with 206 rows of 5 variables + geometry
Code of the level III commune (obec s rozsirenou pusobnosti).
Full name of the level III commune (obec s rozsirenou pusobnosti).
Code of the region (kraj).
Code of the NUTS3 unit (kraj)
Name of the NUTS3 unit (kraj)
© ČÚZK, 2024 https://vdp.cuzk.cz/
Function returning data frame of water bodies of the Czech Republic as sf
polygons. It takes no parameters.
plochy()
plochy()
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.
sf
data frame with 1.769 rows of 2 variables + geometry
Name, with Czech accents
water level, meters above sea level
Mapový podklad – Data200, 2021 © Český úřad zeměměřický a katastrální. https://cuzk.gov.cz
Function returning data frame of rivers of the Czech Republic as sf
lines. It takes a single parameter scope
with default "global".
reky(scope = "global", resolution = "high")
reky(scope = "global", resolution = "high")
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. |
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.
sf
data frame with 3.617 rows of 4 variables + geometry:
Type of river
Name, with Czech accents
Boolean indicating navigability of river.
Boolean indicating one of the major rivers.
Mapový podklad – Data200, 2021 © Český úřad zeměměřický a katastrální. https://cuzk.gov.cz>
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
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
Boundaries of the Czech Republic as sf
polygon.
republika(resolution = "high")
republika(resolution = "high")
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. |
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.
sf
data frame with 1 row of 1 variable + geometry:
© ČÚZK, 2021 https://vdp.cuzk.cz/
library(sf) hranice <- republika("low") plot(hranice, col = "white")
library(sf) hranice <- republika("low") plot(hranice, col = "white")
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.
revgeo(coords)
revgeo(coords)
coords |
coordinates to be reverse geocoded; expected as |
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.
sf
data frame as input, with column revgeocoded added (or overwritten)
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)
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)
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.
senat_obvody(resolution = "high")
senat_obvody(resolution = "high")
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. |
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).
sf
data frame with 81 rows of 3 variables + geometry
Code of the district; left padded with zero in case of districts one to nine.
Seat of the senator.
Formal name of the district.
ČSÚ https://www.czso.cz/csu/czso/podminky_pro_vyuzivani_a_dalsi_zverejnovani_statistickych_udaju_csu
library(sf) senat <- senat_obvody("low") plot(st_geometry(senat), col = "white") nrow(senat) # 81, because the Constitution says so...
library(sf) senat <- senat_obvody("low") plot(st_geometry(senat), col = "white") nrow(senat) # 81, because the Constitution says so...
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.
set_home(path)
set_home(path)
path |
path to local filesystem directory to be used as a cache; must exist and must be writable |
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.
TRUE for success and FALSE for failure; returned silently
Function returning data frame of roads of the Czech Republic as sf
lines. It has no obligatory parameters.
silnice()
silnice()
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.
sf
data frame with 59.594 rows of 3 variables + geometry:
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
Local road code
International road code
Mapový podklad – Data200, 2021 © Český úřad zeměměřický a katastrální. https://cuzk.gov.cz
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.
unset_home()
unset_home()
TRUE for success and FALSE for failure; returned silently
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.
volebni_okrsky(resolution = "high")
volebni_okrsky(resolution = "high")
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. |
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).
sf
data frame with 14 733 rows of 6 variables + geometry
Unique id of the district.
Id of the district within a given Obec / not globally unique.
Id of obec - maps to obce_polygony()$KOD_OBEC.
Id of městská část - maps to casti()$KOD.
Id of okres - maps to okresy()$KOD_LAU1.
Id of kraj - maps to kraje()$KOD_CZNUTS3.
© ČÚZK, 2023 https://vdp.cuzk.cz/
library(sf) prazske_okrsky <- subset(volebni_okrsky("low"), ObecKod == "554782") plot(prazske_okrsky) # the districts of Prague
library(sf) prazske_okrsky <- subset(volebni_okrsky("low"), ObecKod == "554782") plot(prazske_okrsky) # the districts of Prague
Terrain of the Czech Republic as a terra
package object.
vyskopis(format = "rayshaded", cropped = TRUE)
vyskopis(format = "rayshaded", cropped = TRUE)
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. |
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.
terra
package SpatRaster
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
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))
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))
Function returning data frame of railroads of the Czech Republic as sf
lines. It has no obligatory parameters.
zeleznice()
zeleznice()
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.
sf
data frame with 9.957 rows of 3 variables + geometry:
is the railroad electrified?
track: single = jednokolejní, double = dvojkolejní, more = tří a vícekolejní
gauge: standard = normální, narrow = úzkokolejka
Mapový podklad – Data200, 2021 © Český úřad zeměměřický a katastrální. https://cuzk.gov.cz
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.
zip_codes(resolution = "high")
zip_codes(resolution = "high")
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. |
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.
sf
data frame with 2 671 rows of 2 variables + geometry
ZIP Code as string in format NNNNN.
Responsible Post Office
ČSÚ https://www.czso.cz/csu/czso/podminky_pro_vyuzivani_a_dalsi_zverejnovani_statistickych_udaju_csu
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)
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)