🎨QGISIntermediate⏱️ 4 mins read

Map Layout & Cartographic Design in QGIS

Published by GISTECHNEWS Editorial Team • Peer-Reviewed & Verified on QGIS 3.34+ LTR & Python 3.10+

A rigorous geospatial analysis is rendered useless if its conclusions cannot be clearly communicated to stakeholders, policymakers, or clients. Cartography is the art and science of map design—transforming complex vector and raster layers into clear, legible, and visually balanced visual layouts. Professional cartography demands strict adherence to visual hierarchy, color harmony, typography standards, and the inclusion of mandatory map elements. In this tutorial, we construct a publication-ready thematic map in QGIS 3.34+ Print Layout and automate multi-page atlas production.

📋 Prerequisites

  • QGIS 3.34+ LTR installed.
  • A completed vector or raster GIS project ready for cartographic export.
  • Basic understanding of page sizes (A4, A3) and print DPI resolution.

🛠️ Technical Environment

Required Software: QGIS Print Layout & Atlas Generator (Recommended: 3.34+ LTR)

Practice Dataset: Municipal Revenue Wards & Parcels

Source Portal: OpenData GIS Archives

CRS / Format: UTM Zone 43N (GeoPackage)

Step-by-Step Workflow & Methodological Execution

1

Module 1: The Six Mandatory Elements of Cartographic Design

Every professional map must include six foundational components: 1. The Map Canvas Frame: The focal element showcasing the spatial phenomenon. 2. Descriptive Title & Subtitle: Answers 'What, Where, and When' (e.g., 'Groundwater Vulnerability Assessment — Mehsana District, Gujarat (2024)'). 3. Dynamic Scale Bar: Must use clean, rounded metric units (e.g., 0, 5, 10, 20 km; never odd numbers like 13.7 km). Scale must be metric. 4. North Arrow: Indicates orientation. In regional UTM projections, specify whether the arrow represents True North, Magnetic North, or Grid North. 5. Dynamic Legend: Remove cryptic layer filenames (e.g., rename `l8_b4_ndvi_final_v2` to 'Vegetation Density (NDVI)'). Group items logically. 6. Metadata & Attribution: State the Coordinate Reference System (e.g., 'Projection: WGS 84 / UTM Zone 43N'), author name, production date, and authoritative data sources (e.g., 'Source: Copernicus Sentinel Data 2024').

2

Module 2: Print Layout Manager Setup & Inset Overview Maps

1. Launch Print Layout: Click Project -> New Print Layout (Ctrl+P) and assign a title. 2. Page Properties: Right-click the blank canvas, select Page Properties, and configure dimensions (e.g., A4 Landscape, 300 DPI for high-resolution print output). 3. Add Map Element: Click 'Add Map' and drag across the canvas. 4. Setting Up an Inset Overview Map: • Add a secondary smaller map frame in the corner of your page. • Zoom out to show the country or state boundary context. • Under Inset Map Properties, expand 'Overviews', click the '+' icon, and link it to Map 1. QGIS renders a red dynamic bounding box on the inset map showing the exact extent of your primary map!

3

Module 3: Automating Multi-Page Map Books with QGIS Atlas

Imagine you need to export 150 individual A4 parcel maps for every ward in a city. Generating these manually takes days. The QGIS Atlas tool automates this in minutes: 1. Open the Atlas Panel in the Print Layout. 2. Enable Atlas: Check 'Generate an atlas'. 3. Coverage Layer: Select your municipal boundary polygon layer. 4. Page Name: Set to the ward name attribute (e.g., `"ward_name"`). 5. Link Map to Atlas: Select your primary map element, go to Item Properties, and check 'Controlled by atlas'. Set margin to 10%. 6. Dynamic Text Expressions: Insert labels like `Ward Number: [% "ward_id" %]` and `Total Parcels: [% "parcel_count" %]`. QGIS automatically iterates through every ward polygon, re-centers the map, recalculates dynamic text, and exports all 150 pages into a multi-page PDF map book automatically!

⚠️ Common Errors & Troubleshooting

❌ Legend displays 50 layers including hidden background tiles

💡 Resolution: In Legend Item Properties, check 'Only show items inside linked map' to filter out unrendered layers.

❌ Scale bar displays strange numbers (e.g. 0.003 units)

💡 Resolution: Map canvas is in EPSG:4326 degrees! Change project CRS to a projected system (UTM meters) to enable meter/km scale bars.

💡 Expert Tips & Best Practices

  • Use QGIS Atlas generator to automatically export individual map sheets for 500 distinct cadastral parcels with dynamic labeling.
  • Export final presentation maps at 300 DPI for crisp vector line and font reproduction in commercial PDF print.

🐍 PyQGIS Automated Map Layout & PNG Exporter

from qgis.core import (
    QgsProject, QgsPrintLayout, QgsLayoutItemMap, 
    QgsLayoutItemLabel, QgsLayoutItemScaleBar, QgsLayoutSize, QgsUnitTypes
)
from qgis.PyQt.QtGui import QFont

# Initialize layout
project = QgsProject.instance()
layout = QgsPrintLayout(project)
layout.initializeDefaults()
layout.setName("Automated_Report_Map")

# 1. Add Map Item
map_item = QgsLayoutItemMap(layout)
map_item.setRect(20, 20, 200, 150)
map_item.zoomToExtent(project.viewExtent())
layout.addLayoutItem(map_item)

# 2. Add Title Label
title = QgsLayoutItemLabel(layout)
title.setText("Municipal Infrastructure Analysis")
title.setFont(QFont("Arial", 16, QFont.Bold))
title.adjustSizeToText()
title.attemptMove(QgsLayoutPoint(20, 10, QgsUnitTypes.LayoutMillimeters))
layout.addLayoutItem(title)

# 3. Add Metric Scale Bar
scalebar = QgsLayoutItemScaleBar(layout)
scalebar.setStyle('Line Ticks Up')
scalebar.setLinkedMap(map_item)
scalebar.setUnits(QgsUnitTypes.DistanceKilometers)
scalebar.setNumberOfSegments(4)
scalebar.setUnitsPerSegment(5)
scalebar.attemptMove(QgsLayoutPoint(20, 180, QgsUnitTypes.LayoutMillimeters))
layout.addLayoutItem(scalebar)

print("Layout successfully constructed programmatically.")

🔗 Related Tutorials & Practical Workflows