[Qgis-user] Virtual rasters and relative paths

Richard Burkmar rich.burkmar at gmail.com
Thu Feb 25 07:25:36 PST 2016


I created a virtual raster from a number of raster files (jpegs) all in one
folder through the interface available from Raster>Miscellaneous>Build
Virtual Raster. I saved the VRT file to the same folder as the raster
images. I open as a VRT and all is well.

But if I copy the folder to another location, the VRT breaks when I open
it. So I looked at the VRT file in Notepad++ and, sure enough, the
pathnames to all the raster files are full pathnames instead of relative
pathnames which is why moving the folder breaks it.

I assumed that if I saved the VRT in, or in a parent folder of, the folder
with the raster images, then the paths to the rasters would be relative. I
can't see an option to explicitly specify relative pathnames. I tried
saving the VRT in the parent folder of the rasters but still it saves full
pathnames. I tried specifying rasters using both 'all visible' and 'all in
folder' method with the same result.

The actual paths in the VRT file look like this:

<SourceFilename
relativeToVRT="0">E:\ExerciseData\Raster\PM\pm4.jpeg</SourceFilename>

It looks like the relativeToVRT attribute should be set to 1 to make
relative paths, but how do I specify that from the
Raster>Miscellaneous>Build Virtual Raster interface?

I'm using QGIS 2.12.3 from the standalone installer for Windows 64 bit.

Rich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20160225/0e19c20c/attachment.html>


More information about the Qgis-user mailing list