Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev version #99

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions R/katastry.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,36 @@
#' @return `sf` data frame with 142 rows of 4 variables + geometry
#'
#' \describe{
#' \item{KOD}{Code of the city part / kod mestske casti}
#' \item{NAZEV}{Name of the city part / nazev mestske casti}
#' \item{KOD_OBEC}{Code of the city}
#' \item{NAZ_OBEC}{Name of the city}
#' \item{KOD}{Code of the cadastral area / kód katastrálního území}
#' \item{NAZEV}{Name of the cadastral area / název katastrálního území}
#' \item{KOD_OBEC}{Code of the municipality}
#' \item{NAZ_OBEC}{Name of the municipality}
#' \item{digi}{boolean indicating completed digitalization}
#' }
#'
#' @source © ČÚZK, 2024 <https://vdp.cuzk.cz/>
#'
#' @examples
#'
#' \donttest{
#' 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)
#'
#' }
#'
#' @export

katastry <- function() {
Expand Down
17 changes: 8 additions & 9 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
## Test environments
* Ubuntu 22.04.1 LTS, 4.3.1 (2023-06-16) GEOS 3.12.0, GDAL 3.7.2, PROJ 9.3.0 (current)
* Ubuntu 18.04.6 LTS, R version 3.6.3 GEOS 3.6.2, GDAL 2.2.3, PROJ 4.9.3 (lowest supported)
* Ubuntu 22.04.1 LTS, R version 4.4.1 (2024-06-14) GEOS 3.12.0, GDAL 3.7.2, PROJ 9.3.0 (current)

* Ubuntu 22.04.3 LTS, 4.3.1 (2023-06-16) (GitHub Actions)
* Ubuntu 22.04.3 LTS, R Under development (unstable) (2023-10-27 r85420) (GitHub Actions)
* Windows Server 2022 10.0.20348, R version 4.3.1 (2023-06-16 ucrt) (GitHub Actions)
* Mac OS X 12.6.3, R version 4.3.1 (2023-06-16) (GitHub Actions)
* Ubuntu 22.04.3 LTS, R version 4.4.1 (2024-06-14) (GitHub Actions)
* Ubuntu 22.04.3 LTS, R Under development (unstable) (2024-07-07 r86880) (GitHub Actions)
* Windows Server 2022 10.0.20348, R version 4.4.1 (2024-06-14 ucrt) (GitHub Actions)
* Mac OS X 12.6.3, R version 4.4.1 (2024-06-14) (GitHub Actions)

* Windows R version 4.3.1 (2023-06-16 ucrt) (win builder)
* Windows R Under development (unstable) (2023-10-28 r85429 ucrt) (win builder)
* Windows R version 4.2.3 (2023-03-15 ucrt) (win builder)
* Windows R version 4.4.1 (2024-06-14 ucrt) (win builder)
* Windows R Under development (unstable) (2024-07-11 r86890 ucrt) (win builder)
* Windows R version 4.3.3 (2024-02-29 ucrt) (win builder)

## R CMD check results
Status: OK
Expand Down
31 changes: 27 additions & 4 deletions man/katastry.Rd

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

4 changes: 4 additions & 0 deletions tests/testthat/test-1-katastr.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ test_that("katastrální území", {
# sloupce se nerozbily...
expect_equal(colnames(katastry()), c("KOD", "NAZEV", "KOD_OBEC", "NAZ_OBEC", "digi", "geometry"))

# území je pokryté
expect_equal(sum(st_area(katastry())), st_area(republika("high")), tolerance = 5/100)


})
5 changes: 5 additions & 0 deletions tests/testthat/test-3-integrace.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ test_that("integrace", {
expect_equal(sum(st_area(filter(katastry(), NAZ_OBEC == "Praha"))),
st_area(subset(obce_polygony(), NAZ_OBEC == "Praha")), tolerance = 1/1000)

# židovské město je v Praze
expect_true(st_contains(subset(obce_polygony(), NAZ_OBEC == "Praha"),
subset(katastry(), NAZEV == "Josefov"),
sparse = F)[[1]])


# Kramářova vila je v Praze / obci, orp, okresu i kraji

Expand Down
Loading