I'm new to QGIS (using version 3.4). I'd like to make our raster files ready to use. There are 5k rasters in one folder with several subfolders. What's the best way to display them all in QGIS?
I thought that best would be to use a virtual raster. Because of the many subfolders and because I need to repeat the process of creating the virtual raster, I wanted to write a Python script. That's how far I've got trying to add only one file to the vrt:
from osgeo import gdal input_File = r"D:\Folder\Raster.ecw" output_File = r'C:\Folder\VRTFile.vrt' gdal.BuildVRT (input_File, output_File)
This doesn't generate a traceback but also no file. What is wrong?
I also tried this:
import subprocess subprocess.Popen(['gdalbuildvrt','C:\Folder\VRTFile.vrt','D:\Folder\Raster.ecw'])
with the same result.
(Also, how can I import all files from the folder? Can I use similar expressions as with arcpy?)