diff --git a/R/katastry.R b/R/katastry.R index ab688c5..df764dc 100644 --- a/R/katastry.R +++ b/R/katastry.R @@ -21,6 +21,22 @@ #' #' @source © ČÚZK, 2024 #' +#' @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)) +#' +#' # it is Josefov - the former Jewish Ghetto +#' mapview::mapview(praha[smallest, ]) +#' +#' } +#' #' @export katastry <- function() { diff --git a/cran-comments.md b/cran-comments.md index c71f3a4..8073d17 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -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 diff --git a/man/katastry.Rd b/man/katastry.Rd index 667c86f..8929b21 100644 --- a/man/katastry.Rd +++ b/man/katastry.Rd @@ -30,3 +30,20 @@ The dataset is based on RUIAN data by the Czech cadastral office. If necessary y The data is current to June 2024. Downloaded size is 26.1 MB. } +\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)) + +# it is Josefov - the former Jewish Ghetto +mapview::mapview(praha[smallest, ]) + +} + +} diff --git a/tests/testthat/test-1-katastr.R b/tests/testthat/test-1-katastr.R index e8b6d4a..2a6a4c1 100644 --- a/tests/testthat/test-1-katastr.R +++ b/tests/testthat/test-1-katastr.R @@ -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) + + })