Skip to content

Commit

Permalink
40 historical shapefiles (#83)
Browse files Browse the repository at this point in the history
* link to raw RUIAN for admin data / resolves #77

* download links for zip codes & KFME grid / relates #77

* pkgdown - prepare for future deployment

* cleaner silnice

* sidestep the pesky mbcsToSbcs failure

* that pesky unicode!

* a more colorful plot of kraje

* align ozymandias and dockerfile

* + přfuk confirmation

* internals of the world, unite!

* helper functions created

* update docs for new internals

* historie in principle working / relates #40

* resolve CI fails on R-devel

* yet another shot at a clean workflow run

* unicode gets no respect

* shorter title for clarity

* update docs of history()

* historie in tests / relates #40

* resolve vignette warning

* date for release 1.12.0 set to 2023-10-29

* resolve winbuilder issues

* resolve codecov issues

* less aggressive testing of envir vars
  • Loading branch information
jlacko committed Oct 29, 2023
1 parent a9a87c2 commit 38be6e4
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 14 deletions.
4 changes: 4 additions & 0 deletions R/RCzechia.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
#' \item *geomorfo* - geomorphological divisions
#'
#' source: [CENIA / INSPIRE](https://www.arcgis.com/home/item.html?id=25813686a8564b0bbcdc951a5573cfa4), high res object: <1 MB, no low res version
#' \item *historie* - historical admin areas and census records, download size ~ 100 KB to 3.5 MB depending on object
#'
#' source: [URRlab](https://www.historickygis.cz/)
#'
#' }
#'
#' @section Utility functions:
Expand Down
8 changes: 4 additions & 4 deletions R/historie.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Function returning historical admin areas of the Czech Republic, together with relevant census data as specified by parameter **era**.
#'
#' 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 <https://doi.org/10.14712/23361980.2015.93>.
#' 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{https://doi.org/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.
#'
Expand All @@ -16,8 +16,8 @@
#' \describe{
#' \item{okresy_1921}{soudní okresy + census 1921; 328 rows / 92 columns + geometry}
#' \item{okresy_1930}{soudní okresy + census 1931; 330 rows / 90 columns + geometry}
#' \item{okresy_1947}{politické okresy + census 1947; 162 rows / 16 columns + geometry}
#' \item{okresy_1950}{správní okresy + census 1950; 193 rows / 57 columns + geometry}
#' \item{okresy_1947}{politické okresy + census 1947; 163 rows / 68 columns + geometry}
#' \item{okresy_1950}{správní okresy + census 1950; 182 rows / 57 columns + geometry}
#' \item{okresy_1961}{správní okresy + census 1960; 76 rows / 105 columns + geometry}
#' \item{okresy_1970}{správní okresy + census 1970; 76 rows / 144 columns + geometry}
#' \item{okresy_1980}{správní okresy + census 1980; 76 rows / 148 columns + geometry}
Expand All @@ -35,7 +35,7 @@
#'
#' 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ů 19212011. Urbánní a regionální laboratoř, Přírodovědecká fakulta Univerzity Karlovy v Praze, Praha.“
#' 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/>
#'
Expand Down
2 changes: 1 addition & 1 deletion R/lesy.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @return `sf` data frame with 2.366 rows of geometry variable only
#'
#' @source © ArcČR, ARCDATA PRAHA, ZÚ, ČSÚ, 2016 <https://www.arcdata.cz/produkty/geograficka-data/arccr-4>
#' @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>
#'
#' @export
lesy <- function() {
Expand Down
2 changes: 1 addition & 1 deletion R/vyskopis.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#'
#' @return `terra` package SpatRaster
#'
#' @source Copernicus Land Monitoring service, with funding by the European Union. <https://land.copernicus.eu/imagery-in-situ/eu-dem>
#' @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
#' \donttest{
Expand Down
4 changes: 4 additions & 0 deletions man/RCzechia-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/historie.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/lesy.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/vyskopis.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-1-historie.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ test_that("historie platí", {

test_that("chyby zadání", {

expect_error(geomorfo("bflm")) # neznámá úroveň
expect_error(geomorfo()) # povinný argument bez defaultu
expect_error(historie("bflm")) # neznámá úroveň
expect_error(historie()) # povinný argument bez defaultu

})

Expand Down
20 changes: 20 additions & 0 deletions tests/testthat/test-2-code-internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,23 @@ test_that("očekávané chyby", {
})


test_that("envir variable", {

skip_on_cran()

envir_backup <- Sys.getenv("RCZECHIA_HOME") # uložit systémovou hodnotu do zálohy

expect_true(set_home((tempdir()))) # nastavení na tempdir projde

expect_warning(set_home("bflm"), regexp = "path") # neexistiující cesta

expect_true(set_home((tempdir()))) # nastavení na tempdir projde

expect_true(unset_home()) # vysazení projde

if(envir_backup != "") Sys.setenv("RCZECHIA_HOME" = envir_backup) # obnovit hodnotu ze zálohy, pokud dává smysl

})



0 comments on commit 38be6e4

Please sign in to comment.