
Creating raster overviews (pyramids)
Overviews, or pyramids, and resampling are all about making raster layers load faster when zooming and panning in your map canvas, by reducing the amount of data loaded when not zoomed in all the way.
Getting ready
You will need a large raster image.
How to do it…
- Load your raster in QGIS.
elev_lid792_1m.tif
will work fine for this example. - Right-click on the layer name and open Properties.
- Go to the Pyramids item on the left:
- Select the image sizes that you want to create pyramids for:
- Optionally, choose whether to store externally (safer) or internally (less files to keep track of).
- Optionally, choose a resampling algorithm; Nearest Neighbor is the simplest, but other methods may look smoother at the cost of more data manipulation and compute time
- Click on Build pyramids.
- When this is completed, you'll notice the red X on the sizes that you picked will now show a pyramid.
How it works…
Generating pyramids essentially makes copies of your original data resized for different zoom levels. As you zoom out, the original data is resampled to fit the size of the screen. The pyramids do the same thing, but they let you decide what resampling method to use and generate this overview ahead of time. By generating them ahead of time, QGIS can load the image faster when you change zoom levels.
There's more…
Resampling is a fancy way of saying that at each zoom level that is now 1 pixel is more than 1 pixel from the original data, so they need to be averaged in some way and the result assigned to the 1 pixel that is now available. Each of the different methods uses a different math formula to decide the new value and how much to smooth that value with neighboring pixels (so that it looks aesthetically pleasing). This is the same concept as when you shrink pictures so that you can e-mail them to your friends.
If you chose to save them externally, your overviews are stored in elev_lid792_1m.tif.ovr
. Some other programs store the same thing in the .aux
files; however, pyramid formats are not universally compatible between GIS applications.
See also
- This is the same effect as using the GDAL
gdaladdo
command; refer to http://gdal.org/gdaladdo.html - More details from the QGIS documentation can be found at https://docs.qgis.org/2.8/en/docs/user_manual/working_with_raster/raster_properties.html