Creating atlases in QGIS

11.10.2012 08:33 ·  GIS  ·  qgis, howto

As I wrote before, Oslandia kept their promise, and during the 8th QGIS developer meeting, the Atlas plugin was integrated into the QGIS print composer. This has been made possible thanks to the financial support (although not the full amount has been raised) of the following individuals and organisations:

The workflow remains the same: create a print layout and specify a coverage layer that will be used to generate the atlas. In addition, it is now possible to create complex labels using the full power of QgsExpression and the attributes of the coverage layer.

Let’s go through the process of making an atlas step by step.

Creating a project

The first step is to prepare the project: add all the necessary layers, adjust the symbology and labels, etc. For this example, I used data from NaturalEarth.

QGIS project used for atlas creation
QGIS project used for atlas creation

Coverage layer

This is a layer that defines the boundaries of the areas to be printed. In other words, for each feature in the coverage layer, an output file is created containing a portion of the map covered by that feature. Although all types of geometry are supported, for obvious reasons, it is best to use polygon layers as the coverage layer.

A cover layer can contain any number of attributes with arbitrary names.

I created my coverage layer using the ‘Polygon from layer extent’ tool. I used a layer with administrative boundaries as the input layer, with the “Calculate extent for each feature separately” option set to “Yes”. The output is a polygon layer with 27 features (corresponding to the number of features in the input layer). I also added an attribute with the names of the administrative units.

Coverage layer used for atlas
Coverage layer used for atlas

Atlas template

Now it is time to create the atlas template in Print Composer. Do not be intimidated by the word “template” — this is a normal print layout.

My layout looks like this

Print layout used for atlas
Print layout used for atlas

The large map shows the information corresponding to each feature in the coverage layer, and the second, smaller map is an overview map. There is also a legend and several labels: page number, name of the administrative unit, area and perimeter of the bounding rectangle, and atlas feature counter.

A few words should be said about labels. They can now contain QgsExpression expressions and use data from the coverage layer attributes. Several special functions have also been added:

Creating a text label with Atlas functions
Creating a text label with Atlas functions

Creating an atlas

The first thing you need to do is find out the identifier of the map for which the atlas is being created. This is done by hovering over the map and waiting for a tooltip to appear with the information you need. In my case, it is “Map 0”.

Switch to the “Atlas generation” tab and start configuring:

Atlas settings
Atlas settings

That’s it. All that remains is to specify the output directory.

Generated atlas page
Generated atlas page
⮜ Prev
Next ⮞