Skip to content

Commit 993dab9

Browse files
committed
include tests for intertidal cube
1 parent d63222b commit 993dab9

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/testthat/test-cube-deaustralia.R

+38
Original file line numberDiff line numberDiff line change
@@ -479,3 +479,41 @@ test_that("Creating GA_LS_FC_3 cubes from DEAustralia", {
479479
cube_nrows <- .tile_nrows(landsat_cube)
480480
expect_true(.raster_nrows(r_obj) == cube_nrows)
481481
})
482+
483+
test_that("Creating GA_S2LS_INTERTIDAL_CYEAR_3 cubes from DEAustralia", {
484+
intertidal_cube <- .try(
485+
{
486+
sits_cube(
487+
source = "DEAUSTRALIA",
488+
collection = "GA_S2LS_INTERTIDAL_CYEAR_3",
489+
bands = c("ELEVATION", "EXPOSURE"),
490+
roi = c(
491+
lon_min = 137.15991,
492+
lon_max = 138.18467,
493+
lat_min = -33.85777,
494+
lat_max = -32.56690
495+
),
496+
start_date = "2016-01-01",
497+
end_date = "2019-06-01",
498+
progress = FALSE
499+
)
500+
},
501+
.default = NULL
502+
)
503+
504+
testthat::skip_if(purrr::is_null(intertidal_cube),
505+
message = "DEAustralia is not accessible"
506+
)
507+
508+
expect_true(all(sits_bands(intertidal_cube) %in% c(
509+
"ELEVATION", "EXPOSURE"
510+
)))
511+
expect_equal(nrow(intertidal_cube), 14)
512+
bbox_cube <- sits_bbox(intertidal_cube, as_crs = "EPSG:4326")
513+
bbox_cube_1 <- sits_bbox(.tile(intertidal_cube), as_crs = "EPSG:4326")
514+
expect_true(bbox_cube["xmax"] >= bbox_cube_1["xmax"])
515+
expect_true(bbox_cube["ymax"] >= bbox_cube_1["ymax"])
516+
r_obj <- .raster_open_rast(intertidal_cube$file_info[[1]]$path[1])
517+
cube_nrows <- .tile_nrows(intertidal_cube)
518+
expect_true(.raster_nrows(r_obj) == cube_nrows)
519+
})

0 commit comments

Comments
 (0)