[GIS] Using gdalbuildvrt in R gives Warning Message … had status 1

gdalgdalbuildvrtmosaicqgisr

I want to make a mosaic out of several raster files that are next to each other, all including 4 bands. Due to saving space on the server I need to build a vrt and want to write the code in R, so I can process this action more often without too much work. Unfortunately I cannot get rid of the Warning message:

    Warning message:
    running command '"C:\Program Files\QGIS 2.16\bin\gdalbuildvrt.exe"  
    -overwrite  
    "S:/Raster/Ortho_Mosaic.vrt" "S:/Raster/Input/*.tiff"'    
    had status 1 

I use R and gdalbuildvrt should use gdal from QGIS 2.16.

My packages are rgdal, raster and gdalUtils.
My code looks like this:

    folder <- 'S:/Raster/'
    gdalbuildvrt(gdalfile = paste(folder, '/Input/*.tiff', sep = ""),
    output.vrt= paste(folder, '/Ortho_Mosaic.vrt', sep = ""), 
    intern = TRUE, overwrite = TRUE))

I tried a lot of different ways for my input files: use an extent, use single files, all .tif files or changed tif to tiff …
The output file is not produced even though it is only a warning and not an error message. All files are in the same coordinate system; EPSG 31467

Does anyone have an idea what the problem could be?

Best Answer

I changed my code a bit and it looks like I had problem with the paths. I am not sure though if this warning (/error) message is a sign in general that the path is wrong.

My paths look now like this with less frontslashes:

    folder_lisa_2015 <-'S:/Raster/'
    gdalbuildvrt(gdalfile = paste(folder, 'Input/*.tif', sep = ''), 
    output.vrt= paste(folder_lisa_2015, 'Ortho_Mosaic.vrt'), intern = TRUE, 
    overwrite = TRUE)

If it would not be for so many files, I would prefer the nice solution by @user30184 and process the mosaic in command line!