[gdal-dev] Performance issues with gdal vrt
even.rouault at mines-paris.org
Wed Sep 30 07:52:42 EDT 2009
Selon Craig Leat <craig.leat at gmail.com>:
I suppose you are speaking about bad performance when not viewing the VRT at its
full resolution ? (at full resolution, the overhead of VRT should be small
I'm afraid there's little you can do to improve the situation in a simple way.
As you noticed, the VRT driver currently doesn't expose any overviews to the
caller. So if you request for example subsampling by a factor of 1/2 to the VRT,
it will go to fetch full resolution MrSID first, before being subsampled to 1/2.
So basically the existing overviews for each tile inside the VRT aren't used.
As other drivers, the VRT driver is capable of using external overviews
(normally in GeoTIFF format, but that's not required...), so here's a possible
workaround, but that's probably not very practical to use unless you use some
scripting to do it.
Let's suppose I've a file, test.tif, with a overview of factor 1/2
1) create the VRT : gdalbuildvrt test.vrt test.tif
2) copy test.vrt as test.vrt.ovr
3) edit test.vrt.ovr to divide by 2 the rasterXSize and rasterYSize of the
<VRTDataset> element, as well as the values of the attributes xOff, yOff, xSize,
ySize of each <DstRect> element
If you need overview of factor 1/4, copy test.vrt.ovr as test.vrt.ovr.ovr and
repeat step 3)... A bit of cheating, but seems to work here.
The real solution would be to improve the VRT driver to do something similar
internally and/or gdalbuildvrt.
> I am having performance issues with gdal raster vrt files and since I
> am not experienced with this format I am hoping someone can offer some
> advice. I built the vrt files from a collection of MrSid images using
> gdalbuildvrt. I then used sed to add the <NODATA> tag and changed from
> <SimpleSource> to <ComplexSource>. I am using QGIS to view the data
> and working with the MrSid files directly is fast, however working
> with the same collection via the vrt file is VERY slow. The MrSid
> files contain overviews and I wish to know if there is anything I need
> to do to make these overviews available to the vrt driver? I have
> noticed that my CPU usage is around 90% while QGIS tries to load the
> vrt and this seems strange to me for a task that I expect to be disk
> My system is Ubuntu 9.04, gdal 1.6.1 and QGIS trunk r11732.
> Many thanks,
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
More information about the gdal-dev