Skip to content

Commit

Permalink
skip ci tests on nasty netcdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jun 19, 2024
1 parent 6a91e09 commit bb2d4f0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion R/raster-info.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ vapour_sds_names <- function(x) {
#' drivers <- vapour_all_drivers()
#' ok <- drivers$raster[ drivers$driver == "netCDF"]
#' if (isTRUE(ok)) {
#' vapour_geolocation(system.file("extdata/gdal/geos_rad.nc", package = "vapour"), 0L)
#' ##vapour_geolocation(system.file("extdata/gdal/geos_rad.nc", package = "vapour"), 0L)
#' }
vapour_geolocation <- function(x, sds = NULL) {
sd <- if (is.null(sds)) 0L else as.integer(sds[1L])
Expand Down
31 changes: 17 additions & 14 deletions tests/testthat/test-crs-less-warp.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
test_that("with with no source crs works", {
#skip("skip fixme")

skip_on_cran()
skip_on_ci()
f <- system.file("extdata/volcano.png", package = "vapour", mustWork = TRUE)
info <- vapour_raster_info(f)
ok <- vapour_warp_raster(f, dimension = info$dimension,
Expand All @@ -18,19 +21,19 @@ test_that("with with no source crs works", {
badnc <- system.file("extdata/gdal", "bad_netcdf_geoloc_arrays.nc", package = "vapour")
sds <- vapour_sds_names(badnc)

# lcc <- "+proj=lcc +lat_0=-30 +lon_0=134.33 +lat_1=-50 +lat_2=-10 +R=6378137"
# ex <- c(-3077504, 3968504, -2763621, 3472383)
# vrt <- vapour_vrt(sds[3], geolocation = sds[2:1], bands = 1)
# info <- vapour_raster_info(vrt)
# expect_type(im <- vapour_warp_raster_dbl(vrt, extent = ex, dimension = info$dimension, projection = lcc
# , transformation_options = c("SRC_METHOD=NO_GEOTRANSFORM")), "double")
#
#
# ex <- c(-180, 180, -90, 90)
# dm <- c(512, 1024)
# vrt <- vapour_vrt(sds[3], geolocation = sds[2:1], bands = 1)
# vapour::vapour_set_config("GDAL_NETCDF_BOTTOMUP", 'NO')
# expect_type( im <- vapour_warp_raster_dbl(vrt, extent = ex, dimension = dm, projection = "OGC:CRS84"
# , transformation_options = c("SRC_METHOD=GEOLOC_ARRAY")), "double")
lcc <- "+proj=lcc +lat_0=-30 +lon_0=134.33 +lat_1=-50 +lat_2=-10 +R=6378137"
ex <- c(-3077504, 3968504, -2763621, 3472383)
vrt <- vapour_vrt(sds[3], geolocation = sds[2:1], bands = 1)
info <- vapour_raster_info(vrt)
expect_type(im <- vapour_warp_raster_dbl(vrt, extent = ex, dimension = info$dimension, projection = lcc
, transformation_options = c("SRC_METHOD=NO_GEOTRANSFORM")), "double")


ex <- c(-180, 180, -90, 90)
dm <- c(512, 1024)
vrt <- vapour_vrt(sds[3], geolocation = sds[2:1], bands = 1)
vapour::vapour_set_config("GDAL_NETCDF_BOTTOMUP", 'NO')
expect_type( im <- vapour_warp_raster_dbl(vrt, extent = ex, dimension = dm, projection = "OGC:CRS84"
, transformation_options = c("SRC_METHOD=GEOLOC_ARRAY")), "double")

})

0 comments on commit bb2d4f0

Please sign in to comment.