Closed
Description
From revdeps with PROJ 8.1.1 and GDAL 3.3.2, the package fails in the outputs examples:
> newRas <- raster(dir(tmpdir, full.name = TRUE, pattern = ".tif"))
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", :
Cannot create a RasterLayer object from this file.
In addition: There were 14 warnings (use warnings() to see them)
> dir(tmpdir, full.name = TRUE, pattern = ".tif")
[1] "/tmp/RtmpvjXEpt/outputs/test_year10.tif"
[2] "/tmp/RtmpvjXEpt/outputs/test_year10.tif.aux.xml"
> newRas <- raster(dir(tmpdir, full.name = TRUE, pattern = ".tif")[1])
> all.equal(newRas, ras) # Should be TRUE
So dir(tmpdir, full.name = TRUE, pattern = ".tif")
now returns two file names, which raster()
cannot disambiguate. I think the code has always been fragile, so choosing the first element disambiguates.
Metadata
Metadata
Assignees
Labels
No labels