Skip to content

Commit

Permalink
test sfPolys has area
Browse files Browse the repository at this point in the history
  • Loading branch information
robitalec committed Aug 22, 2023
1 parent 6a269c9 commit aa3f12d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test-group-polys.R
Original file line number Diff line number Diff line change
Expand Up @@ -510,3 +510,20 @@ test_that('proportion within 0-100, area > 0', {
units::as_units(0, 'm^2'))

})


test_that('sfPolys has area column', {
sfPolys <- build_polys(DT, projection = utm, hrType = 'kernel',
hrParams = list(grid = 60, percent = 95),
id = 'ID', coords = c('X', 'Y'))

sfPolys$area <- NULL

expect_error(
group_polys(sfPolys = sfPolys,
area = TRUE,
id = 'id'),
'please ensure column "area"',
fixed = TRUE
)
})

0 comments on commit aa3f12d

Please sign in to comment.