
Batch Export Maps with the QGIS Atlas Tool
What you'll learn
- The basic mechanics of the QGIS atlas tool and how to set it up
- How to export maps automatically, driven by a print layout
- How to generate multiple PDF or image files in one batch
Recommended for
- Anyone who wants to export a map for each administrative area in one batch
- Anyone who wants to print or save many maps efficiently
- Anyone who creates reports or handouts in QGIS
Introduction
Have you ever wanted to use the QGIS print layout to efficiently create a large number of maps with the same layout, such as one map per municipality or one per location in a customer list? The atlas tool built into QGIS is a powerful way to generate standardized maps like these automatically.
This article walks through the atlas tool step by step, from basic usage to advanced techniques.
To use the atlas tool, you first need to set up the look of your map in a print layout. If you want to learn the basics of print layouts, see this article.
What the atlas tool can do
The atlas tool mainly lets you do the following.
Automatic map generation:
For each feature in the layer you specify, QGIS generates maps one after another, automatically changing the center and extent of the map.
Dynamic labels:
The title and description change automatically for each map (for example, “XX City Surrounding Area Map”).
Batch export:
You can export the large number of generated maps in one batch as PDF or image files. This greatly improves productivity, prevents manual errors, and keeps quality consistent.

Basic setup of the QGIS atlas tool
Prepare the print layout
This example uses the municipality polygons of Aichi Prefecture downloaded from National Land Numerical Information to show how to create a map for each municipality.

First, click Project → New Print Layout in the menu bar. Enter a name for the layout and click OK.

When the print layout window opens, place a basic Map item.

Enable the atlas tool
Now set up the atlas tool. With the Map item selected, open the Atlas tab in the panel on the right side of the window and check Generate an atlas at the top of the panel.

The settings become active. Configure them as follows.
- Coverage layer: Select the layer that defines the extent of each map (the coverage layer). QGIS creates one map for each feature in the layer you specify here. This example uses the
行政区域layer (administrative areas). - Page name (optional): Specify the page name of each exported map. It helps to use a field that holds the name of each feature in the coverage layer (for example, the municipality name). This example selects
N03_004, the field that stores the municipality name. - Output filename expression (optional): If the atlas exports separate files, you can set their file names. For example, to name the output files
output_<municipality name>.xxx, enter the expression'output_' || "<field name for the municipality name (N03_004)>". - Single file export when possible (optional): To get a separate file for each map, clear the check box. This example clears it.
") refers to a field, and text in single quotes (') is entered as a literal string. The || operator joins strings. You can also click the ε button to open the expression dialog, which makes it easier to enter symbols and other elements.
Next, link the Map item to the atlas so that it follows the coverage layer you just set. With the Map item selected, check Controlled by Atlas on the Item Properties tab.

Preview the atlas
The basic setup is complete. Now preview how the maps are generated. On the menu bar, choose Atlas → Preview Atlas.

QGIS redraws the map, centered on a feature of the layer you set as the coverage layer.

Click the arrow buttons (▶ and ◀) on the toolbar to step through the features of the coverage layer one by one and check each generated map.

Add dynamic text (labels)
Next, set up the print layout so that the title changes automatically for each map. Add a Label item wherever you like and adjust settings such as the font size.

With the Label item selected, delete the default text (Lorem ipsum) in the text box under Main Properties in Item Properties. Then click the Insert/Edit Expression button below it.

As an example, enter the expression "<field name for the municipality name (N03_004)>" || '周辺地図' so that each title reads the municipality name followed by 周辺地図 (“surrounding area map”), then click the OK button. Replace the field name placeholder in the expression with the name of the field you want to show in the layout, such as a name field in the coverage layer.

Now, based on the expression, the attribute value you specified from the coverage layer appears as the title.

Export the atlas
If the preview looks fine, export the atlas.
From the Atlas menu on the menu bar, choose Export Atlas as Images or Export Atlas as PDF, depending on the output format you want. This example uses Export Atlas as Images.

Specify where to save the files, set the export options, and click the Save button.

When the export finishes, check the files. QGIS has created one map for each feature of the coverage layer.

Advanced uses of the atlas tool
The atlas is a handy way to export maps in the same style in one batch. Here are a few more advanced ways to use it.
Add an overview map
The atlas creates each print layout for the area of a coverage layer feature. So adding an overview map that shows where that area sits within the whole area makes the map easier to understand.
First, add another small Map item to the print layout and adjust its scale as needed. This is the overview map.

In the Item Properties of the Map item you added as the overview map, expand Overviews and click the + button. Then, for Map frame, select the main Map item (such as Map 1).

The overview map now shows the area displayed in the main map as a red frame.

Show attribute information of the coverage layer
A print layout can display an attribute table, and you can control which features it shows in sync with the atlas.
First, add an Attribute Table item to the print layout.

In the Item Properties of the Attribute Table item, expand Feature Filtering and check Show only features intersecting atlas feature.

The table is now filtered to show only the features that intersect the atlas feature.

You can also limit the attribute table to the atlas feature only. In the Feature Filtering group, check only Filter with and enter $id = @atlas_featureid as the expression.
$id = @atlas_featureid is an expression that shows only the feature with the same ID as the current atlas feature. All functions that start with atlas_ relate to the atlas.
Now only the atlas feature appears in the attribute table.

Show only the atlas feature on the map
Before you export the atlas, you can set the style of the coverage layer so that only the atlas feature is displayed.
First, open the layer properties, go to the Symbology tab, choose Rule-based, and double-click where (no filter) appears.

The Edit Rule dialog opens. In Filter, enter $id = @atlas_featureid.

When you finish, close the layer properties. Then open the print layout where you set up the atlas from the Layout Manager. Only the atlas feature is displayed, and the surrounding municipality polygons are hidden.

You can also add another rule to change the style of everything other than the atlas feature. Click the + button to add a new rule and set the expression $id != @atlas_featureid.

You can see that different styles are applied to the atlas feature and the other features.

Print a map for each grid cell
So far, you have created an atlas for each feature of the municipality layer. If you create a grid beforehand, you can also print a map for each grid cell.
On the menu bar, click Vector → Research Tools → Create grid.

Set Grid type to Rectangle (Polygon) and create a grid with whatever extent and size you like.

QGIS creates the grid.

Once the grid is ready, open a print layout and add a Map item and other items. Set up the atlas with the same steps as before, and select the Grid layer you created as the coverage layer.

When you preview the atlas, QGIS creates a map for each grid cell.

Fix the scale
By default, the atlas creates each map so that it surrounds the feature with the margin you specify. When you use a point layer or want maps at a specific scale, fixing the scale is useful.
To do this, select the Map item, check Controlled by Atlas in Item Properties, and select Fixed scale. This fixes the scale of all the maps.

To change the scale, adjust the Scale value in Item Properties.

Conclusion
The QGIS atlas tool is a very powerful way to streamline the creation of standardized maps. Mastering just the basic usage covered in this article will prove useful in many situations.
Combine it with advanced techniques, such as adding an overview map and showing attribute information, and you can create many clearer maps in a short time.


QGIS LAB is a comprehensive information hub for QGIS, the open-source GIS software. Under the concept of “Geospatial for Greater Good,” we share the knowledge and skills to open up the world through location data.


