@@ -86,6 +86,23 @@ test_that("classify_ground csf works with last_returns = FALSE", {
8686 expect_equal(sum(las @ data $ Classification == 2L ), 105L )
8787})
8888
89+ test_that(" classify_ground ptd works" ,
90+ {
91+ skip_on_cran()
92+
93+ myptd = ptd()
94+ las <- classify_ground(topography , myptd )
95+ ans <- as.numeric(table(las $ Classification ))
96+ class = c(48967 ,24383 ,53 )
97+ expect_equal(ans , class )
98+
99+ myptd = ptd(angle = 1 , distance = 0.5 )
100+ las <- classify_ground(topography , myptd )
101+ ans <- as.numeric(table(las $ Classification ))
102+ class = c(67271 ,4758 ,1374 )
103+ expect_equal(ans , class )
104+ })
105+
89106test_that(" classify_ground works with last_returns = TRUE but attribute not properly populated" , {
90107
91108 skip_if_not_installed(" RCSF" )
@@ -115,20 +132,5 @@ test_that("classify_ground does not erase former classification (but new ground
115132 expect_equal(names(table(las $ Classification )), c(" 1" , " 2" , " 9" ))
116133})
117134
118- test_that(" PTD works" ,
119- {
120- skip_on_os(" mac" )
121-
122- myptd = ptd()
123- las <- classify_ground(topography , myptd )
124- ans <- as.numeric(table(las $ Classification ))
125- class = c(48967 ,24383 ,53 )
126- expect_equal(ans , class )
127135
128- myptd = ptd(angle = 1 , distance = 0.5 )
129- las <- classify_ground(topography , myptd )
130- ans <- as.numeric(table(las $ Classification ))
131- class = c(67271 ,4758 ,1374 )
132- expect_equal(ans , class )
133- })
134136
0 commit comments