[gdal-dev] read a catalog is slower then directly the raster ?

Even Rouault even.rouault at mines-paris.org
Thu Feb 2 05:48:23 EST 2012

Selon Andrea Peri <aperi2007 at gmail.com>:

> Hi,
> Unfortunately I was unable to test with GDB.
> My skill was not enough :(

Well, provided you have gdb installed, it is "just" a matter of :

1) "gdb qgis"
2) in the gdb console, type "run" and validate
3) when qgis is slow, switch to the console with gdb and hit Ctrl+C
4) in the gdb console, type "bt" (for backtrace)and validate, and then it can
give some interesting information
5) to go on qgis execution, type "c" (continue) and validate
6) you can go to 3) again

> However I try other ways.
> I will use a utility to test the disk activity and after put the qgis
> canvas on a little portion of land covered I add the catalog.vrt.
> Using this utility I can see that qggis try to open all the raster instead
> of open only the single raster necessary to visualize the portion of land
> in the canvas.
> After this I see the xml in the catalog:
> <SimpleSource>
>   <SourceFilename relativeToVRT="0">F:....216110_2010.ecw</SourceFilename>
>       <SourceBand>1</SourceBand>
>       <SourceProperties RasterXSize="13900" RasterYSize="11760"
> DataType="Byte" BlockXSize="13900" BlockYSize="1" />
>       <SrcRect xOff="0" yOff="0" xSize="13900" ySize="11760" />
>       <DstRect xOff="26320" yOff="140" xSize="13900" ySize="11760" />
>     </SimpleSource>
> And I notice also that the catalog don't store on every tag of a raster the
> single bbox of that raster.
> So qgis necessary must open all the raster to understand what raster is on
> the visible portion on the canvas.

No, what you show above is sufficient to defer the loading of individual tiles,
until they are really necessary.

What I suspect is that your vrt has no associated overviews, so when you open
qgis, it will try to display the overall coverage of the raster, which then will
require to open each tile.

Try "gdaladdo your.vrt 2 4 8 16 32"

> I guess this is a good reason to explain because it is so slow when in the
> catalog there and many hundred of rasters.
> Unfortunately I don't find any option in gdalbuildvrt to add the extension
> of every raster in the catalog.

There's none : the above information that is generated by default is sufficient.

Best regards,


More information about the gdal-dev mailing list