Skip to content

Commit f3512ff

Browse files
committed
test fix
1 parent d49a522 commit f3512ff

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

tests/testthat/test-Misc_extractToRast.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ test_that("Function: extractToRast: raster reprojecting", {
110110
input <- terra::rast(file.path(testDirs$testdata, "extractToRast", "tile1.tif"))
111111

112112
templateRast <- terra::rast(
113-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-4326.prj"),
113+
crs = file.path(testDirs$testdata, "CRS", "EPSG-4326.prj"),
114114
ncols = 213, nrows = 215, vals = 1,
115115
ext = c(xmin = -105.6567825386380974, xmax = -105.6294401406081107,
116116
ymin = 55.1008597705739831, ymax = 55.1284589047357017))
@@ -176,11 +176,11 @@ test_that("Function: extractToRast: coverage with NAs", {
176176

177177
# Test: without reprojection
178178
inputTemplate <- terra::rast(
179-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-3979.prj"),
179+
crs = file.path(testDirs$testdata, "CRS", "EPSG-3979.prj"),
180180
res = 5, vals = 1,
181181
xmin = 0, ymin = 0, xmax = 10, ymax = 10)
182182
templateRast <- terra::rast(
183-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-3979.prj"),
183+
crs = file.path(testDirs$testdata, "CRS", "EPSG-3979.prj"),
184184
res = 10, vals = 1,
185185
xmin = 0, ymin = 0, xmax = 10, ymax = 10)
186186

@@ -206,22 +206,22 @@ test_that("Function: extractToRast: coverage with NAs", {
206206

207207
## > 50% coverage NA in 1 pixel
208208
input <- terra::rast(
209-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-3979.prj"),
209+
crs = file.path(testDirs$testdata, "CRS", "EPSG-3979.prj"),
210210
res = 8, vals = c(NA, NA, 1, NA),
211211
xmin = 0, ymin = 0, xmax = 16, ymax = 16)
212212
expect_equal(extractToRast(input, templateRast), 1)
213213

214214
# Test: with reprojection
215215
inputTemplate <- terra::rast(
216-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-3979.prj"),
216+
crs = file.path(testDirs$testdata, "CRS", "EPSG-3979.prj"),
217217
res = 100, vals = 1,
218218
xmin = -663200,
219219
xmax = -663000,
220220
ymin = 729200,
221221
ymax = 729400
222222
)
223223
templateRast <- terra::rast(
224-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-102001.prj"),
224+
crs = file.path(testDirs$testdata, "CRS", "EPSG-102001.prj"),
225225
res = 100, vals = 1,
226226
xmin = -607300,
227227
xmax = -607200,
@@ -241,7 +241,7 @@ test_that("Function: extractToRast: coverage with NAs", {
241241

242242
## > 50% coverage NA in 1 large area
243243
input <- terra::rast(
244-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-3979.prj"),
244+
crs = file.path(testDirs$testdata, "CRS", "EPSG-3979.prj"),
245245
res = 100, vals = c(1, NA, NA, NA),
246246
xmin = -663200 + 50,
247247
xmax = -663000 + 50,
@@ -321,7 +321,7 @@ test_that("Function: extractToRast: sf polygons with numeric field: reproject",
321321
input <- subset(input, id != 8)
322322

323323
templateRast <- terra::rast(
324-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-32613.prj"),
324+
crs = file.path(testDirs$testdata, "CRS", "EPSG-32613.prj"),
325325
res = 10, vals = 1,
326326
ext = c(xmin = 456000, xmax = 461000, ymin = 6105000, ymax = 6110000))
327327

@@ -347,7 +347,7 @@ test_that("Function: extractToRast: sf polygons with text field: reproject", {
347347
input$id <- paste("Id", input$id)
348348

349349
templateRast <- terra::rast(
350-
crs = file.path(testDirs$testdata, "extractToRast", "EPSG-32613.prj"),
350+
crs = file.path(testDirs$testdata, "CRS", "EPSG-32613.prj"),
351351
res = 10, vals = 1,
352352
ext = c(xmin = 456000, xmax = 461000, ymin = 6105000, ymax = 6110000))
353353

tests/testthat/test-Misc_writeRasterWithValues.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test_that("Function: writeRasterWithValues", {
77
dir.create(tempDir, recursive = TRUE, showWarnings = FALSE)
88

99
templateRast <- terra::rast(
10-
crs = file.path(testDirs$testdata, "writeRasterWithValues", "EPSG-32613.prj"),
10+
crs = file.path(testDirs$testdata, "CRS", "EPSG-32613.prj"),
1111
res = 100, vals = 1,
1212
ext = c(xmin = 456000, xmax = 457000, ymin = 6105000, ymax = 6106000))
1313

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)