hypertidy / vapour

GDAL API package for R
https://hypertidy.github.io/vapour/
83 stars 9 forks source link

`vapour_read_raster_raw()` does not work when using "~/" home path #193

Closed Sibada closed 1 year ago

Sibada commented 1 year ago
ERROR 4: ~/image.tif: No such file or directory
gdalinfo - unable to open '~/image.tif'.
Error in if (is.character(txt) && length(txt) == 1 && nchar(txt, type = "bytes") <  :
  missing value where TRUE/FALSE needed

But when I using "/home/username/image.tif", it works.

mdsumner commented 1 year ago

I normally put this into the reader functions (it avoids ruining non-file dsn):

f <- "~/image.tif"
if (file.exists(f)) {
  f <- normalizePath(f)
}
# then proceed ...

but, I'd like to know why gdal doesn't just handle this - can you share your sessionInfo and the output of vapour_gdal_version() please?

mdsumner commented 1 year ago

thanks, I fixed this across a lot of the exported functions