Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jun 19, 2024
1 parent afd8428 commit 6a91e09
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/testthat/test-crs-less-warp.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,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 6a91e09

Please sign in to comment.