Skip to content

Commit

Permalink
use terra::ext to get lidar extent
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakillo committed Mar 25, 2024
1 parent 958ec55 commit 3dd3566
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ License: AGPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
LazyData: true
RoxygenNote: 7.2.1
RoxygenNote: 7.3.1
Imports:
class,
gdistance,
Expand Down
1 change: 1 addition & 0 deletions man/CityShadeMapper-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions tests/testthat/test-read_lidar.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ test_that("read_lidar works", {

lidar <- read_lidar(system.file("extdata", "PlazaNueva.laz",
package = "CityShadeMapper", mustWork = TRUE))
lidar.ext <- lidR::extent(lidar)
lidar.ext <- terra::ext(lidar)

expect_true(inherits(lidar, "LAScatalog"))
expect_equal(lidar.ext@xmin, 234700)
expect_equal(round(lidar.ext@xmax), 234880)
expect_equal(lidar.ext@ymin, 4142100)
expect_equal(lidar.ext@ymax, 4142250)
expect_equal(terra::xmin(lidar.ext), 234700)
expect_equal(round(terra::xmax(lidar.ext)), 234880)
expect_equal(terra::ymin(lidar.ext), 4142100)
expect_equal(terra::ymax(lidar.ext), 4142250)
expect_equal(lidR::st_crs(lidar)$input, "EPSG:3042")

})

0 comments on commit 3dd3566

Please sign in to comment.