tif <- system.file("extdata", "sst.tif", package = "vapour", mustWork = TRUE)
hdf <- system.file("extdata/gdal/complex.h5", package = "vapour", mustWork = TRUE)
vrttif <- vapour_vrt(tif)
#vrthdf <- vapour_vrt(hdf)
## can't do this because file is absolute atm
#vrttif <- "\n GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AXIS[\"Latitude\",NORTH],AXIS[\"Longitude\",EAST],AUTHORITY[\"EPSG\",\"4326\"]]\n 1.4000000000000000e+02, 6.9999999999999937e-02, 0.0000000000000000e+00, -3.9997222067892665e+01, 0.0000000000000000e+00, -7.0003889104950298e-02\n \n Area\n \n \n LZW\n BAND\n \n \n \n 289.859\n 279.8360951673\n 271.35\n 4.9558170498586\n \n -3.399999952144364e+38\n Gray\n \n /perm_storage/home/gdalbuilder/R/x86_64-pc-linux-gnu-library/4.1/vapour/extdata/sst.tif\n 1\n \n \n \n \n \n\n"
#vrthdf <- "\n \n \n HDF5:\"/perm_storage/home/gdalbuilder/vapour/inst/extdata/gdal/complex.h5\"://f16\n 1\n \n \n \n \n \n\n"
# test_that("vrt works", {
# expect_equal(vapour_driver(vrttif), "VRT")
# # expect_equal(vapour_vrt(hdf, sds = 1), vrthdf)
# expect_silent(vapour_vrt(hdf, bands = 2))
# expect_equal(vapour_vrt(hdf, bands = 2), NA_character_)
# expect_length(vapour_read_raster(vapour_vrt(tif, bands = rep(1, 3)), band = 1:3, window = c(0, 0, 2, 3)), 3L)
#
# ## type is Complex so weird message
# expect_error(vapour_read_raster(vapour_vrt(hdf, bands = rep(1, 3)), band = 1:3, window = c(0, 0, 2, 3)), "is it Complex")
# ex <- c(19, 20, -30, -50)
# expect_equal(vapour_raster_info(vapour_vrt(tif, extent = ex))$extent, ex)
# prj <- "EPSG:3031"
# expect_equal(vapour_raster_info(vapour_vrt(tif, projection = prj))$projection, vapour_srs_wkt(prj))
#
# })