Skip to content

Commit

Permalink
different way of doing a multi-layer raster
Browse files Browse the repository at this point in the history
  • Loading branch information
Aariq committed Aug 21, 2024
1 parent 36df4f9 commit daa75c6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/testthat/test-tar-terra-tiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ targets::tar_test("recombined tiles are equal to original", {
list(
tar_target(
my_file,
# system.file("ex/elev.tif", package="terra"),
system.file("ex/logo.tif", package = "terra"),
system.file("ex/elev.tif", package = "terra"),
format = "file"
),
tar_terra_rast(
my_map,
terra::rast(my_file)
#create multi-layer raster for testing
rast(c(my_file, my_file))
),
tar_terra_tiles(
name = rast_split,
Expand All @@ -65,7 +65,6 @@ targets::tar_test("recombined tiles are equal to original", {
targets::tar_make()
targets::tar_load(c(my_map, rast_split))
recombined <- terra::merge(terra::sprc(rast_split))
names(recombined) <- names(my_map) <- 1:3 #ignore dimnames because of bug #89
expect_equal(terra::values(my_map),
terra::values(recombined))
})

0 comments on commit daa75c6

Please sign in to comment.