QGIS Ordnance Survey – Seamless Raster Mapping in QGIS

ordnance-surveyqgisraster

I would like to use Ordnance Survey base mapping in QGIS. I would like to set up something like a seamless table in MapInfo. I think that the equivalent in QGIS is a Virtual Raster Table. The files are in tif format as they were when I download them.

I have built a VRT but it seems slow to load when I open the layer. I have also tried building pyramids for the data and this doesn't seem to speed it up that much.

Is there a way to speed this up? Am I missing something? Are there any good resources about steps to take to prepare raster data for use in QGIS?

Would I be best to start to load this information into a PostGIS database with PostGIS Raster installed?

Best Answer

Are the TIFs tiled? The OS Vector District raster images I have aren't. To find out using QGIS, load one of the rasters and select Information in the Raster menu. Click OK, and somewhere after the projection and metadata you should see a line something like: Band 1 Block=4000x65 Type=Byte, ColorInterp=Palette

If, as in this case the block size is the width of the image x some number of lines, then converting it to a tiled TIF can give you a good speedup in most cases. This is because we tend to want to look at rectangular areas of an image, and it avoids QGIS having to load an entire row of pixels only to discard most of them because they fall outside the view.

To do that, use the Translate menu item in the Raster menu. You can convert an entire directory, or just one file at a time. The key setting is the Creation Options which you should enable, and enter TILED for the name, and YES as the value. This defaults to a tile size of 256x256 which should be fine for most purposes, but it is possible to specify other sizes by adding BLOCKXSIZE and BLOCKYSIZE to the creation options and specifying the size you want.

Settings for the Translate tool


Addendum

When you tile your images, you will notice an increase in file size because the width and height of you image is probably not a multiple of the tile size. So with the OS Vector District raster the effective size will be 4096x4096, an increase of just under 5% of the file size, but QGIS and other tools will transparently treat it as 4000x4000.