Skip to content

Commit

Permalink
version 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kadyb authored and cran-robot committed May 4, 2021
1 parent a81aa91 commit dbb2650
Show file tree
Hide file tree
Showing 18 changed files with 109 additions and 139 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: rgugik
Type: Package
Title: Search and Retrieve Spatial Data from 'GUGiK'
Version: 0.3.0
Version: 0.3.1
Authors@R: c(person(given = "Krzysztof",
family = "Dyba",
role = c("aut", "cre"),
Expand Down Expand Up @@ -40,11 +40,11 @@ URL: https://kadyb.github.io/rgugik/, https://github.com/kadyb/rgugik
BugReports: https://github.com/kadyb/rgugik/issues
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2021-04-11 16:00:49 UTC; krzdyb
Packaged: 2021-05-04 17:20:11 UTC; krzdyb
Author: Krzysztof Dyba [aut, cre] (<https://orcid.org/0000-0002-8614-3816>),
Jakub Nowosad [aut] (<https://orcid.org/0000-0002-1057-3721>),
Maciej Beręsewicz [ctb] (<https://orcid.org/0000-0002-8281-4301>),
GUGiK [ctb] (source of the data)
Maintainer: Krzysztof Dyba <adres7@gmail.com>
Repository: CRAN
Date/Publication: 2021-04-11 18:00:02 UTC
Date/Publication: 2021-05-04 21:50:03 UTC
34 changes: 17 additions & 17 deletions MD5
@@ -1,4 +1,4 @@
4f2641d97c2fc2a7474affcb5263dac8 *DESCRIPTION
2d6a2c9cbc0351f1bff3b1de096367a3 *DESCRIPTION
41ac9f8e91d5e48aa2ec2d9f5669346e *LICENSE
aa7cc99303fdd454908fc12aa740c5f2 *NAMESPACE
0f374b1b8485fa00abaa1bb75e1c76a8 *R/DEM_request.R
Expand All @@ -21,7 +21,7 @@ e0ef681901465d24f47f9139cb2c086a *R/rgugik-package.R
bea2daffd6dce3241841b4d0b59f8c9a *R/topodb_download.R
a4d1b40442fee622f6fdb6d9d5df2962 *R/utils.R
615a5998ad097908e9c92c38612f8e13 *R/voivodeship_names.R
9664af64cc78c997b9f439d02384c83b *README.md
893aa1d1a2b99e6c5255d5363e690dc0 *README.md
e30b80816524646721011769cb01dd72 *build/vignette.rds
0c35d4561e86d09d247d95e387ae10d9 *data/commune_names.rda
990bedce7bfbaf9a3c7070db26b1b579 *data/county_names.rda
Expand All @@ -40,8 +40,8 @@ a7431920d3d133255be1080cf0f76655 *man/borders_get.Rd
49b257881cb68e2a59b45d8196f318aa *man/commune_names.Rd
0cc23657349ee6e32f1b1f9dd2662daa *man/county_names.Rd
037039cba8bad345498facb118010fbb *man/emuia_download.Rd
76683bb73497f81d3a8547da9e7895a5 *man/figures/README-f1-1.png
18b0fb95c32d0c179f3b84d4b11d6caf *man/figures/README-f2-1.png
291920de04db73f62b034ae37a9ac88d *man/figures/README-f1-1.png
641a23ba0197a8f30b8efc5a711e9a0d *man/figures/README-f2-1.png
e4c6520d05666cbe5cf6841ce4b411a2 *man/figures/logo.png
e939859fdf30c96cdd0eef4bf238c444 *man/geocodePL_get.Rd
2e3f68ff66b3f08f6104f344ed094f51 *man/geodb_download.Rd
Expand All @@ -57,19 +57,19 @@ e2cddd42b22bd1f1bfcb6678aacdefb3 *man/rgugik-package.Rd
ad8deb333c4759b30fa4056a15be8e99 *man/topodb_download.Rd
85ef538d488dcb9f89af6ba833e3ca25 *man/voivodeship_names.Rd
237df53a8c5963f000d5151e11586fc1 *tests/testthat.R
2a8b093697af309cb619bb5e80763b9f *tests/testthat/test-DEM_request.R
23c76fff857257239ad1816b739bed49 *tests/testthat/test-borders_get.R
d9001c91b39bf01bd6ea9e449b5f2e8b *tests/testthat/test-emuia_download.R
84a8d9b51ac7378bfcdf1e813bcf2d5f *tests/testthat/test-geocodePL_get.R
1221acc6e1ceeee08e5d03442e30cac5 *tests/testthat/test-geodb_download.R
b76ebc5382d4dd6f593957a06e1e3583 *tests/testthat/test-minmaxDTM_get.R
d34eee9788d1bd455be2dd3f2b2efd83 *tests/testthat/test-models3D_download.R
6d6804d125d1a047396848f765190af4 *tests/testthat/test-ortho_request.R
e0489e3f3ca449f4c08538d52021199d *tests/testthat/test-parcel_get.R
7cb5018e8403c344be4e62354438871a *tests/testthat/test-pointDTM100_download.R
f7637b65b33fe183a108e4f7ddbf7ba3 *tests/testthat/test-pointDTM_get.R
ee42b41c181820f8a04099a6a6daa1a0 *tests/testthat/test-tile_download.R
c2d4f67b0b3053bafe84bfbbdbddcf0c *tests/testthat/test-topodb_download.R
12ac9b02d467dfe4250f8db5de366072 *tests/testthat/test-DEM_request.R
3ab3920177eb43af973fc88957bb6036 *tests/testthat/test-borders_get.R
7c539ab41a9fda9732485bd0357595e2 *tests/testthat/test-emuia_download.R
4ace34c93607c35a0885d716a4ae391e *tests/testthat/test-geocodePL_get.R
98368ca4c8d38750b3e99dfb07698d68 *tests/testthat/test-geodb_download.R
63007ae84da1bb31407ac274f316d15a *tests/testthat/test-minmaxDTM_get.R
5b1fbd2999efefd4addb87df9a427769 *tests/testthat/test-models3D_download.R
92917d1dbaf03c9fa6439dfe5931dfe4 *tests/testthat/test-ortho_request.R
0eb41dc5125ddb97cd0ce34a5a8af5e6 *tests/testthat/test-parcel_get.R
45ea7293adda70855959e90cb492e151 *tests/testthat/test-pointDTM100_download.R
0302295590d6e4592e25a0977d7bf433 *tests/testthat/test-pointDTM_get.R
2ad826ef951dfaa1e6849fa475d69cca *tests/testthat/test-tile_download.R
485b14eabc8169f5185cbfd0488bb27f *tests/testthat/test-topodb_download.R
117003d40b6a7c0469f80a69d7a6b7af *tests/testthat/test-utils.R
08d837265eb25d481898f23d98dc8d20 *vignettes/DEM-GEOMETRY-1.png
406a0a35a337c5a5922c85900ad7f6a4 *vignettes/DEM-LINE-1.png
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -26,7 +26,7 @@ including:
- [Register of Towns, Streets and
Addresses](https://emuia.gugik.gov.pl)
- [State Register of Geographical
Names](http://www.gugik.gov.pl/pzgik/zamow-dane/panstwowy-rejestr-nazw-geograficznych)
Names](https://www.geoportal.gov.pl/dane/panstwowy-rejestr-nazw-geograficznych)
- [State Register of
Borders](http://www.gugik.gov.pl/pzgik/zamow-dane/panstwowy-rejestr-granic-i-powierzchni-jednostek-podzialow-terytorialnych-kraju)
- Location (geometry) of cadastral parcels using TERYT (parcel ID) or
Expand Down Expand Up @@ -113,7 +113,7 @@ req_df = req_df[req_df$year == 2001, ]

# print metadata
t(req_df)
#> 3
#> 17
#> sheetID "N-33-130-D-b-2-3"
#> year "2001"
#> resolution "1"
Expand Down
Binary file modified man/figures/README-f1-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-f2-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 20 additions & 20 deletions tests/testthat/test-DEM_request.R
@@ -1,28 +1,28 @@
# skip test on GitHub
if (!"GITHUB_ACTION" %in% names(Sys.getenv())) {
# skip test on GitHub and CRAN
skip_on_ci()
skip_on_cran()

library(sf)

polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik")
polygon = read_sf(polygon_path)
req_df = DEM_request(polygon)
library(sf)

# if output is "connection error", check class and return NULL
if (class(req_df) == "character") {
return(NULL)
}
polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik")
polygon = read_sf(polygon_path)
req_df = DEM_request(polygon)

# if output is "connection error", check class and return NULL
if (class(req_df) == "character") {
return(NULL)
}

test_that("check if ouput is data frame", {
expect_s3_class(req_df, "data.frame")
})

test_that("check number of rows", {
expect_true(nrow(req_df) > 0)
})
test_that("check if ouput is data frame", {
expect_s3_class(req_df, "data.frame")
})

test_that("check number of columns", {
expect_true(ncol(req_df) == 13)
})
test_that("check number of rows", {
expect_true(nrow(req_df) > 0)
})

}
test_that("check number of columns", {
expect_true(ncol(req_df) == 13)
})
3 changes: 3 additions & 0 deletions tests/testthat/test-borders_get.R
@@ -1,3 +1,6 @@
skip_on_cran()


voivodeship_geom = borders_get(voivodeship = "lubuskie") # 494 KB
county_geom = borders_get(county = "Sopot") # 18 KB
commune_geom1 = borders_get(commune = c("Hel", "Krynica Morska")) # 11 KB
Expand Down
14 changes: 3 additions & 11 deletions tests/testthat/test-emuia_download.R
@@ -1,3 +1,6 @@
skip_on_cran()


tmp = tempfile()
status = emuia_download(commune = "Jejkowice", outdir = tmp, unzip = FALSE) # 37.1 KB

Expand All @@ -7,13 +10,8 @@ if (!is.null(status)) {
}

file_path = list.files(tmp, full.names = TRUE)
file_size = file.info(file_path)$size / 2^10
file_ext = substr(file_path, nchar(file_path) - 2, nchar(file_path))

test_that("check file size", {
expect_true(file_size > 37)
})

test_that("check file ext", {
expect_true(file_ext == "zip")
})
Expand All @@ -27,14 +25,8 @@ if (!is.null(status)) {
}

file_path = list.files(tmp, full.names = TRUE)
file_number = length(file_path)
file_ext = substr(file_path, nchar(file_path) - 2, nchar(file_path))


test_that("check number of files", {
expect_true(file_number == 8L)
})

test_that("check if zip is removed", {
expect_true(!"zip" %in% file_ext)
})
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-geocodePL_get.R
@@ -1,3 +1,6 @@
skip_on_cran()


t1 = geocodePL_get(address = "Marki") # place
t2 = geocodePL_get(address = "Królewskie Brzeziny 13") # place and house number
t3 = geocodePL_get(road = "632") # road number
Expand Down
43 changes: 17 additions & 26 deletions tests/testthat/test-geodb_download.R
@@ -1,34 +1,25 @@
# skip test on GitHub and CRAN
cond = "GITHUB_ACTION" %in% names(Sys.getenv()) ||
"CRAN" %in% names(Sys.getenv())
skip_on_ci()
skip_on_cran()

if (!cond) {

tmp = tempfile()
status = geodb_download("opolskie", outdir = tmp, unzip = FALSE) # 5.8 MB
tmp = tempfile()
status = geodb_download("opolskie", outdir = tmp, unzip = FALSE) # 5.8 MB

# status should be NULL (successfully downloaded), otherwise return NULL
if (!is.null(status)) {
return(NULL)
}

file_path = list.files(tmp, full.names = TRUE)
file_size = file.info(file_path)$size / 2^20
file_ext = substr(file_path, nchar(file_path) - 2, nchar(file_path))


test_that("check file size", {
expect_true(file_size > 5.8)
})
# status should be NULL (successfully downloaded), otherwise return NULL
if (!is.null(status)) {
return(NULL)
}

test_that("check file ext", {
expect_true(file_ext == "zip")
})
file_path = list.files(tmp, full.names = TRUE)
file_ext = substr(file_path, nchar(file_path) - 2, nchar(file_path))

test_that("check file ext", {
expect_true(file_ext == "zip")
})

# test stops
test_that("check stops", {
expect_error(geodb_download(voivodeships = NULL), "enter names or TERC")
})

}
# test stops
test_that("check stops", {
expect_error(geodb_download(voivodeships = NULL), "enter names or TERC")
})
3 changes: 3 additions & 0 deletions tests/testthat/test-minmaxDTM_get.R
@@ -1,3 +1,6 @@
skip_on_cran()


library(sf)

polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik")
Expand Down
15 changes: 3 additions & 12 deletions tests/testthat/test-models3D_download.R
@@ -1,3 +1,6 @@
skip_on_cran()


tmp = tempfile()
status = models3D_download(county = "Sopot", LOD = "LOD1",
outdir = tmp, unzip = FALSE) # 2.4 MB
Expand All @@ -8,14 +11,8 @@ if (!is.null(status)) {
}

file_path = list.files(tmp, full.names = TRUE)
file_size = file.info(file_path)$size / 2^20
file_ext = substr(file_path, nchar(file_path) - 2, nchar(file_path))


test_that("check file size", {
expect_true(file_size > 1)
})

test_that("check file ext", {
expect_true(file_ext == "zip")
})
Expand All @@ -31,14 +28,8 @@ if (!is.null(status)) {
}

file_path = list.files(tmp, full.names = TRUE)
file_number = length(file_path)
file_ext = substr(file_path, nchar(file_path) - 2, nchar(file_path))


test_that("check number of files", {
expect_true(file_number == 1L)
})

test_that("check if zip is removed", {
expect_true(!"zip" %in% file_ext)
})
Expand Down
40 changes: 20 additions & 20 deletions tests/testthat/test-ortho_request.R
@@ -1,28 +1,28 @@
# skip test on GitHub
if (!"GITHUB_ACTION" %in% names(Sys.getenv())) {
# skip test on GitHub and CRAN
skip_on_ci()
skip_on_cran()

library(sf)

polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik")
polygon = read_sf(polygon_path)
req_df = ortho_request(polygon)
library(sf)

# if output is "connection error", check class and return NULL
if (class(req_df) == "character") {
return(NULL)
}
polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik")
polygon = read_sf(polygon_path)
req_df = ortho_request(polygon)

# if output is "connection error", check class and return NULL
if (class(req_df) == "character") {
return(NULL)
}

test_that("check if ouput is data frame", {
expect_s3_class(req_df, "data.frame")
})

test_that("check number of rows", {
expect_true(nrow(req_df) > 0)
})
test_that("check if ouput is data frame", {
expect_s3_class(req_df, "data.frame")
})

test_that("check number of columns", {
expect_true(ncol(req_df) == 12)
})
test_that("check number of rows", {
expect_true(nrow(req_df) > 0)
})

}
test_that("check number of columns", {
expect_true(ncol(req_df) == 12)
})
3 changes: 3 additions & 0 deletions tests/testthat/test-parcel_get.R
@@ -1,3 +1,6 @@
skip_on_cran()


parcel_byID = parcel_get(TERYT = "141201_1.0001.6509")
parcel_byCOORDS = parcel_get(X = 313380.5, Y = 460166.4)

Expand Down
9 changes: 3 additions & 6 deletions tests/testthat/test-pointDTM100_download.R
@@ -1,3 +1,6 @@
skip_on_cran()


tmp = tempfile()
status = pointDTM100_download("opolskie", outdir = tmp, unzip = FALSE) # 3.7 MB

Expand All @@ -7,14 +10,8 @@ if (!is.null(status)) {
}

file_path = list.files(tmp, full.names = TRUE)
file_size = file.info(file_path)$size / 2^20
file_ext = substr(file_path, nchar(file_path) - 2, nchar(file_path))


test_that("check file size", {
expect_true(file_size > 3)
})

test_that("check file ext", {
expect_true(file_ext == "zip")
})
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-pointDTM_get.R
@@ -1,3 +1,6 @@
skip_on_cran()


library(sf)

polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik")
Expand Down

0 comments on commit dbb2650

Please sign in to comment.