I have thousand of tif tiles and a vrt file, generated by using gdalbuildvrt. At the moment they are at the same folder level in the system, but if I open the vrt file with Notepad I cannot find any url, address or location. Does this mean that the vrt file and the tiles cannot be separated from each other and have to be together in the same folder? how can I edit that in the vrt file?
1 Answer
Depending on where you create the VRT, it will either become a relative path, or an absolute path. You can manually set this, by modifying the relativeToVRT="1"
to a 0, and then write a complete path in the instead of just the image filename.
See the example below of a full path VRT.
<VRTRasterBand dataType="Byte" band="1">
<ColorInterp>Red</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="0">D:/A/Bunch/of/Folders/Image.tif</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="6152" RasterYSize="2584" DataType="Byte" BlockXSize="6152" BlockYSize="128" />
<SrcRect xOff="0" yOff="0" xSize="6152" ySize="2584" />
<DstRect xOff="0" yOff="0" xSize="6152" ySize="2584" />
</SimpleSource>