Skip to content

Commit

Permalink
fixes #75 (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlacko authored May 5, 2023
1 parent 1e1a970 commit 2c60fe5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/testthat/test-1-relief.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ test_that("reliéf", {
expect_s4_class(vyskopis("rayshaded", FALSE), "SpatRaster")

# test rozsahu
expect_equal(terra::expanse(vyskopis()), units::drop_units(st_area(republika("low"))), tolerance = 1/100)
expect_equal(terra::expanse(vyskopis("actual")), units::drop_units(st_area(republika("low"))), tolerance = 1/100)
expect_equal(terra::expanse(vyskopis("rayshaded")), units::drop_units(st_area(republika("low"))), tolerance = 1/100)
expect_equal(terra::expanse(vyskopis())$area, units::drop_units(st_area(republika("low"))), tolerance = 1/100)
expect_equal(terra::expanse(vyskopis("actual"))$area, units::drop_units(st_area(republika("low"))), tolerance = 1/100)
expect_equal(terra::expanse(vyskopis("rayshaded"))$area, units::drop_units(st_area(republika("low"))), tolerance = 1/100)

# oříznutý raster je menší než surový
expect_gt(terra::expanse(vyskopis(cropped = F)), terra::expanse(vyskopis(cropped = T)))
expect_gt(terra::expanse(vyskopis("rayshaded", cropped = F)), terra::expanse(vyskopis("rayshaded", cropped = T)))
expect_gt(terra::expanse(vyskopis("actual", cropped = F)), terra::expanse(vyskopis("actual", cropped = T)))
expect_gt(terra::expanse(vyskopis(cropped = F))$area, terra::expanse(vyskopis(cropped = T))$area)
expect_gt(terra::expanse(vyskopis("rayshaded", cropped = F))$area, terra::expanse(vyskopis("rayshaded", cropped = T))$area)
expect_gt(terra::expanse(vyskopis("actual", cropped = F))$area, terra::expanse(vyskopis("actual", cropped = T))$area)

# test projekce - WGS84 pure & unadultered
expect_true(grepl("WGS 84", st_crs(vyskopis())$input))
Expand Down

0 comments on commit 2c60fe5

Please sign in to comment.