Loading OS OpenData raster images into a Rasterlite database.
There are pre-compiled Rasterlite/Spatialite binaries for Windows (32 and 64-bit) so I took this route.
Step 1, install the software. For 32-bit Windows go here:
or for 64-bit Windows go here:
Download (as a minimum) the following files and unzip them to a directory (I used C:/spatialite).
You will also need a recent version of sqlite3.dll (the one that comes with OSGEO4W is too old), get it here:
Unzip this to the C:/spatialite folder.
Finally, add C:/spatialite to your path.
Step 2, prepare the raster images. OpenData rasters are indexed TIFFs with world files. To be loaded into a Rasterlite database these need to be batch converted to geotiffs. Do this in QGIS, Raster -> Conversion -> Translate. Use batch mode and (most important) tick 'Expand' and set 'RGB'.
Step 3, load the directory of GeoTIFFs into a Rasterlite database. Go to your C:/spatialite directory, click on spatialite_gui and then create a new spatialite database in the directory containing the GeoTIFFs, you could call this 'vmd.sqlite' for example.
Next, open a command line window in the directory containing the GeoTIFFs and type this command:
rasterlite_load -d vmd.sqlite -T vmd -D . -i wavelet -q 25
This should load all of the GeoTIFFs in the directory into vmd.sqlite, in a table called 'vmd'. It will take a while, but the progress will be reported.
Next, build pyramids:
rasterlite_pyramid -d vmd.sqlite -T vmd -i wavelet -v
When this finishes, set topmost:
rasterlite_topmost -d vmd.sqlite -T vmd -v
That should be it, load the new Rasterlite database into QGIS via Layer -> Add Raster Layer.
for more on Rasterlite.
In closing. You can download one of my Rasterlite VectorMap District (VMD) databases from here (about 500 KB):
Right-click on the link to download the db, don't try to open it in a browser.
Ordnance Survey VMD rasters are of course a blurry, washed-out, badly-styled, badly-labelled disgrace and you can't make a silk purse out of a pig's ear. The db should however load into QGIS with no problems, it looks best at about 1:10000. The QGIS screen rendering isn't that good either, but you can obtain the best quality available by exporting images from the print composer.
If you have problems loading the db let me know, it works here in QGIS 1.7.4 (Win) and in Master (Ubuntu). Nick.