Skip to content

GDAL 3.3.2 example failure #174

Closed
Closed
@rsbivand

Description

@rsbivand

00check.log

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions