Skip to content
Learn QGIS with BNHR

Module 4 · Intermediate

The prescribed map layout

The prescribed map for forestry tenure applications in QGIS: for one application, driven by the QGIS Atlas, and for several applications at once.

Module 4Level Intermediate
On this page
  1. Overview
  2. Before we begin
  3. What we want to achieve
  4. What we have
  5. Relevant QGIS knowledge/skills
  6. The prescribed map format
  7. The map of one application
  8. 4.1. Setting up the page and the main map
  9. 4.2. Adding the map grid in latitude and longitude
  10. What we want to achieve
  11. 4.3. Styling the application area and its corners
  12. 4.4. Adding the technical description and original coordinate tables
  13. 4.5. Building the title block from the layer’s attributes
  14. What we want to achieve
  15. 4.6. Adding the location map
  16. 4.7. Adding the legend, certification, and signatories
  17. 4.8. Saving and reusing the layout template
  18. 4.9. Exporting the map
  19. Letting the atlas drive the layout
  20. 4.10. Turning on the atlas
  21. One layout for several applications
  22. 4.11. Preparing the applications’ layers
  23. What we have
  24. 4.12. Keying the layout to the current application
  25. The tables and the tie line
  26. Only the current application on the main map
  27. A scale that fits each application
  28. 4.13. Previewing and exporting the maps
  29. Quizzes
  30. Certification and support

QGIS usually offers several ways to do the same task: a processing algorithm, the Field Calculator, a plugin, or editing by hand. The steps in this module are examples of how to do each task, tested with the course’s sample data. They are not the only way, and other methods are equally valid as long as the outputs meet the guide’s requirements and agree with each other. Where a choice affects correctness (for example, using area($geometry) instead of $area), the module says why.

Before diving into this module’s exercises, it would be good if you can review and familiarize yourself with the Print Layout and the QGIS Atlas.

For exercises in this module, you will use the outputs of Preparing the area data and Technical descriptions and corner coordinates. The outputs subfolder of the BNHR_QGIS-for-SFLMA-Mapping folder has a completed project and a layout template for each part of this module:

Part Project Template
The map of one application sflma-sample.qgz SFLMA-prescribed-map.qpt
Letting the atlas drive the layout sflma-sample-atlas.qgz SFLMA-prescribed-map-atlas.qpt
One layout for several applications sflma-several-applications.qgz SFLMA-prescribed-map-several-applications.qpt

Each project is also saved inside bnhr_qgis-sflma-mapping-outputs.gpkg, under the same name, the way you saved yours in Laying the foundation. To open one from there, expand the GeoPackage in the Browser panel and double-click the project, or use Project ‣ Open From ‣ GeoPackage.

  1. Build the prescribed map of the sample application in the Print Layout.
  2. Read the title, location, area, and tables from the layers, so the map cannot disagree with the shapefiles and the technical description.
  3. Let the QGIS Atlas drive the same layout.
  4. Map several applications of any size with one layout, each on its own page.
  1. area_boundary and area_corners - the sample application’s shapefiles
  2. td_lines and tie_point - the technical description lines and the tie line from Module 3
  3. ref_barangays, ref_municipalities, and ref_provinces - reference administrative boundaries
  4. sample2 to sample5 (each with its _boundary, _corners, _td_lines, and _tie_point) - four more fictional applications, fully prepared, for the last part of this module
  1. Identify the elements of the prescribed map for forestry tenure applications.
  2. Plan the layout before building it.

The guide requires the map to contain the title of the application, location, area, and projection used. The prescribed format for SFLMA applications arranges these elements as follows:

The prescribed map of the sample application, with its elements numbered
The completed map of the sample application (A3, landscape)
# Element Contents
1 Main map The application area with numbered corners, barangay boundaries and names, and a grid of latitude and longitude marked with crosses and labelled in degrees, minutes, and seconds
2 Technical description Line, bearing, and distance for each side, with the tie line below
3 Original coordinate of the point Reference point, easting, northing, and datum and zone
4 Location map A small-scale map of the surrounding provinces marking this site, with its frame labelled in latitude and longitude
5 North arrow
6 Title Application for a Sustainable Forest Land Management Agreement (SFLMA) of the applicant
7 Location and area Barangay, municipality/city, and province; area in hectares
8 Scale and projection Scale bar, numeric scale, and projection
9 Legend Corners, application area, and administrative boundary
10 Office and certification Office logo and name; certification statement
11 Signatories Prepared by, noted by (two), and attested by

The signatories in the prescribed format are:

  • Prepared by: PENRO/CENRO GIS Focal or Concerned Permanent Staff
  • Noted by: Chief, Regulation and Permitting Section (RPS)
  • Noted by: Chief, Technical Services Division (TSD)
  • Attested by: PENRO/CENR Officer

Confirm the page size, the certification text, and the signatories with your office. The office logo in the sample is a placeholder.

  1. Build the prescribed map for one application.
  2. Read the map’s text and tables from the layers with expressions.
  3. Save the layout as a template and export it.

This first version is all that a single application needs. Its labels read the application’s attributes from the area_boundary layer with aggregate(), which works because the layer holds exactly one application.

Level: Beginner

  1. Create a new print layout and set the page to A3, Landscape (right-click the page ‣ Page Properties).
  2. In the map canvas, zoom to area_boundary. Add the main map (Add Map button) on the left side of the page and give it the Item ID main_map.
  3. In its Item Properties, set a round Scale that fits the application area, such as 5000. Move the map content (Move Item Content tool) so the area sits below the tables you will add in the top-left corner.
The main map’s item properties
The main map at a fixed scale of 1:5,000, following the main map theme

The map stays in the national grid, the CRS of the shapefiles. Its grid is added next, in latitude and longitude.

4.2. Adding the map grid in latitude and longitude

Section titled “4.2. Adding the map grid in latitude and longitude”

Level: Intermediate

  • A grid of crosses on the main map, labelled along the frame in latitude and longitude (degrees, minutes, and seconds, e.g. 14°44’00”N and 121°34’00”E), as the prescribed map requires.

A map grid is drawn in its own CRS, which does not have to be the map’s. The main map stays in the national grid (EPSG:3123), so the shapefiles, tables, and scale are untouched; only the grid is set to a geographic CRS, so its lines follow latitude and longitude instead of eastings and northings.

Latitude and longitude depend on the datum. At the sample application, the same latitude and longitude read in PRS 1992 and in WGS 84 are 221 m apart. The grid must therefore be in the same datum as the map:

Map’s CRS (national grid) Grid CRS
PRS92 / Philippines zone 1 to 5 (EPSG:3121 to 3125) PRS92, EPSG:4683
Luzon 1911 / Philippines zone I to V (EPSG:25391 to 25395) Luzon 1911, EPSG:4253

Do not use EPSG:4326 (WGS 84), the geographic CRS most tools offer first. For the same reason, a handheld GPS (which reads WGS 84) will not agree with a PRS 1992 grid by about 200 m: that difference is the datum, not an error in the map.

  1. Select main_map. Under Grids, click the green plus button to add a grid, rename it latitude and longitude, and click Modify Grid….
  2. Under Appearance, set:
    • Grid type: Cross, with a Cross width of 2.50 mm
    • CRS: click the CRS button and select EPSG:4683 - PRS92 (or EPSG:4253 - Luzon 1911 for a Luzon 1911 map)
    • Interval: Map Units, with X and Y both 0.002777777778. Map units are now the grid CRS’s units, degrees, and 0.002777777778° is 10 seconds (10 ÷ 3600).
The grid’s type, CRS, and interval
A cross grid in PRS92 geographic coordinates, every 10 seconds
  1. Under Frame, set the Frame style to Line Border.
  2. Check Draw Coordinates and set:
    • Format: Degree, Minute, Second Aligned (it pads the minutes and seconds, so 121°34’00”E rather than 121°34’0”E)
    • Left and Right: Show Latitude/Y Only, Outside Frame, Vertical Ascending
    • Top and Bottom: Show Longitude/X Only, Outside Frame, Horizontal
    • Coordinate precision: 0
The grid’s coordinate labels
Latitude on the left and right, longitude on the top and bottom, in degrees, minutes, and seconds
  1. Check the map: the crosses fall on every 10 seconds of latitude and longitude, and the labels read 14°43’40”N to 14°44’10”N and 121°33’40”E to 121°34’20”E.

At the sample’s latitude, 10 seconds is about 300 m on the ground (299 m east-west, 307 m north-south), which puts four to five crosses across the map at 1:5,000. For a larger area at a smaller scale, use another whole number of seconds so the labels stay round: 20” is 0.005555555556 and 30” is 0.008333333333. Type all 12 decimals; a rounded interval such as 0.00278 drifts off the round seconds.

Lines of longitude point to true north, while the national grid’s vertical lines point to grid north. The angle between them, the grid convergence, is 0.14° at the sample site, so the grid’s lines lean less than a millimeter across the map. That tilt is correct; it is not a misalignment.

4.3. Styling the application area and its corners

Section titled “4.3. Styling the application area and its corners”

Level: Beginner

  1. Style area_boundary with a red outline and no fill.
  2. Style area_corners as white circles with a black outline, labelled with T_CORNER over the point.
  3. Style ref_barangays with a dashed gray outline and no fill, labelled with the barangay name in capital letters (upper("barangay")) with wide letter spacing.
  4. Create a map theme (Map Themes icon) named main with only these three layers visible, and set the main map to Follow map theme: main.

4.4. Adding the technical description and original coordinate tables

Section titled “4.4. Adding the technical description and original coordinate tables”

Level: Intermediate

  1. Add an attribute table (Add attribute table button) inside the top-left corner of the main map, set its Layer to td_lines, and click Attributes…. Keep only LINE, BEARING, and DISTANCE, with the headings Line, Bearing, and Distance (m), centered.
  2. Still in Attributes…, replace DISTANCE’s attribute with an expression so it always shows two decimals (186.90, not 186.9):
format_number("DISTANCE", 2)
  1. Under Sorting, add SEQ, ascending.
  2. Set a white background and show the grid lines. Resize the table’s frame until all the lines fit.
The technical description table’s item properties
The technical description table, reading the td_lines layer
  1. Add a label (Add label button) with the title TECHNICAL DESCRIPTION above the table, and another directly below it for the tie line:
[% aggregate('tie_point', 'max', "TIE_LINE") %]
  1. Add a fixed table (Add Item ‣ Add Fixed Table) to the right of the technical description, with the heading ORIGINAL COORDINATE OF THE POINT and four rows. Set each cell to an expression (Insert Expression in the table editor):
'Reference Point: ' || aggregate('tie_point', 'max', "ref_point")
'Easting: ' || format_number(aggregate('tie_point', 'max', "easting"), 3, omit_group_separators:=true)
'Northing: ' || format_number(aggregate('tie_point', 'max', "northing"), 3, omit_group_separators:=true)
'Datum: ' || aggregate('tie_point', 'max', "datum")

Because the tables read the layers, there is nothing to retype: a corrected bearing or a new tie point shows up on the map the next time it is refreshed.

4.5. Building the title block from the layer’s attributes

Section titled “4.5. Building the title block from the layer’s attributes”

Level: Intermediate

  • A title, location, and area that are read from the area boundary’s attributes, so they cannot disagree with the shapefile.
  1. Add a label (Add label button) for the title, with the Item ID title:
[% 'APPLICATION FOR A SUSTAINABLE FOREST LAND MANAGEMENT AGREEMENT (SFLMA) OF ' || upper(aggregate('area_boundary', 'max', "NAME")) %]
The title label’s item properties
The title reads the applicant’s name from the area boundary
  1. Add a label for the location. Multiple barangays are stored as Batangan,Maigang; the label adds a space after each comma for readability:
[% 'Barangay: ' || replace(aggregate('area_boundary', 'max', "BARANGAY"), ',', ', ')
|| '\nMunicipality/City: ' || replace(aggregate('area_boundary', 'max', "MUNI_CTY"), ',', ', ')
|| '\nProvince: ' || aggregate('area_boundary', 'max', "PROVINCE") %]
  1. Add a label for the area. AREA is a number, and a number drops its trailing zeros (23.7580 would print as 23.758); format_number writes it with exactly four decimals and no thousands separator:
[% 'Area = ' || format_number(aggregate('area_boundary', 'max', "AREA"), 4, omit_group_separators:=true) || ' hectares' %]
  1. Add a north arrow (Add Item ‣ Add North Arrow) and a scale bar (Add scale bar button) in meters, linked to main_map, with four segments of 100 m.
  2. Add labels for the numeric scale and the projection, read from the main map:
[% 'SCALE 1:' || format_number(map_get(item_variables('main_map'), 'map_scale'), 0) %]
[% 'Projection: ' || map_get(item_variables('main_map'), 'map_crs_description') || ' (' || map_get(item_variables('main_map'), 'map_crs') || ')' %]

Typing the area into a label creates a second copy of it that can drift from the attribute table. Reading it from the layer with an expression means there is only one value to check.

Level: Intermediate

  1. Duplicate area_boundary in the Layers panel (right-click ‣ Duplicate Layer) and name the copy location_marker. Style it with a Geometry Generator marker at centroid($geometry) (a red dot) and a label with the text 'THIS SITE'.
  2. Style ref_provinces with a light fill, labelled with the province names. Style ref_municipalities with a Rule-based symbology whose only rule highlights the municipality the application is in:
overlay_intersects('area_boundary')
  1. Create a map theme named location with ref_provinces, ref_municipalities, and location_marker visible.
  2. Add a second map in the top-right of the page that follows the location theme, at a scale that shows the neighboring provinces, with a LOCATION MAP label.
  3. The prescribed format labels the location map’s frame in latitude and longitude too. Add a grid to location_map as in Adding the map grid in latitude and longitude, but with Grid type Frame and annotations only, Interval 0.5 map units (30 minutes), Format Degree, Minute Aligned, and Frame style Exterior Ticks. Leave a few millimeters around the map for the labels.
The location map’s item properties
The location map follows the location map theme

4.7. Adding the legend, certification, and signatories

Section titled “4.7. Adding the legend, certification, and signatories”

Level: Beginner

  1. Add a legend (Add legend button), uncheck Auto update, and keep only area_corners, area_boundary, and ref_barangays, renamed Proposed SFLMA corners, Proposed SFLMA area, and Barangay boundary.
  2. Add the office logo and name.
  3. Add the certification statement as a label that reads the applicant’s name:
[% 'This is to certify that this is the correct map of the proposed area for the Sustainable Forest Land Management Agreement (SFLMA) of ' || aggregate('area_boundary', 'max', "NAME") || ', as described hereon. This map was prepared based on the submitted maps, technical description and other references available from this Office.' %]
  1. Add the signatories in the prescribed order.

4.8. Saving and reusing the layout template

Section titled “4.8. Saving and reusing the layout template”

Level: Beginner

  1. Save the layout as a template (Layout ‣ Save as Template…). The completed template is SFLMA-prescribed-map.qpt in the outputs folder.
  2. For a new application, load its layers and name them area_boundary, area_corners, td_lines, and tie_point, as in this course. The template’s expressions find the layers by these names.
  3. Create a layout from the template (Project ‣ Layout Manager, choose Specific under New from Template, and select the .qpt file).
  4. Check the technical description table’s Layer, zoom the main map to the new application, and move the tie line label directly below the table if the new technical description has a different number of lines. The title, location, area, tables, and certification update without retyping.

Level: Beginner

  1. Export the map with Layout ‣ Export as PDF… (Export as PDF button), e.g. as IV-A_SFLMA_Map_Bagong Gubat Agroforestry Cooperative.pdf.
  2. Open the PDF and check every element against the prescribed format.
  1. Turn the layout of one application into an atlas-driven layout.
  2. Replace layer lookups with the atlas feature’s attributes.

The layout above works, but every new application means re-zooming the map and checking each label. With the QGIS Atlas (Atlas icon), the area boundary becomes the coverage layer: the main map follows the application on its own, labels read its attributes directly ("NAME" instead of aggregate('area_boundary', 'max', "NAME")), and the PDF is named from its attributes.

An atlas turns one layout into a series of pages, one for each feature of a layer, the coverage layer. For each page, QGIS makes one feature the atlas feature and draws the whole layout again for it:

  • A map with Controlled by Atlas checked moves to the atlas feature. How it zooms is set under that checkbox: Margin around feature fits the feature with a margin, at whatever scale that gives; Predefined scale (best fit) picks the closest scale that fits from the project’s list of scales (or QGIS’s own list if the project has none); Fixed scale keeps the map’s own scale and only centers it on the feature.
  • Labels, tables, and other expressions in the layout read the atlas feature’s fields directly, so "NAME" in a label is the current feature’s name. QGIS also gives the atlas feature as variables: @atlas_feature (the feature itself, read with attribute(@atlas_feature, 'NAME')), @atlas_featureid (its id), @atlas_geometry (its shape), and @atlas_featurenumber and @atlas_totalfeatures (the page number and the number of pages).
  • Preview Atlas steps through the pages in the layout. Export Atlas writes every page, one file per page named by the Output filename expression, or one PDF of all the pages if Single file export when possible is checked.

Here the coverage layer is area_boundary, so each application is one page. For a longer introduction with its own exercises, see the QGIS Atlas in Maps and Layouts, and Generate an Atlas in the QGIS manual.

Level: Intermediate

  1. Open Atlas ‣ Atlas Settings, check Generate an atlas, and set the Coverage layer to area_boundary. Set the Output filename expression to:
"REGION" || '_SFLMA_Map_' || "NAME"
The atlas settings
An atlas over the area boundary
  1. Select the main map and check Controlled by Atlas with Fixed scale, so the map centers on the application at 1:5,000. The grid needs no change: it belongs to the main map, so its crosses and labels follow each application.
The main map controlled by the atlas
The main map, controlled by the atlas at a fixed scale of 1:5,000
  1. Select the technical description table and, under Feature filtering, check Show only features intersecting atlas feature.
  2. Replace the layer lookups in the labels with the atlas feature’s fields:
Label One application Atlas
Title upper(aggregate('area_boundary', 'max', "NAME")) upper("NAME")
Location aggregate('area_boundary', 'max', "BARANGAY"), and so on "BARANGAY", and so on
Area format_number(aggregate('area_boundary', 'max', "AREA"), 4, omit_group_separators:=true) format_number("AREA", 4, omit_group_separators:=true)
Certification aggregate('area_boundary', 'max', "NAME") "NAME"
The title label in the atlas layout
The title reads the applicant’s name from the atlas feature
  1. On the location map, mark only the current application: in location_marker, change the symbology to Rule-based with this rule, and use the same expression for the label’s Show label data-defined override:
$id = @atlas_featureid

and highlight the municipality the current application is in:

intersects($geometry, @atlas_geometry)
  1. Click Preview Atlas on the Atlas toolbar to check the map, save the layout as a template (the completed one is SFLMA-prescribed-map-atlas.qpt), and export it with Atlas ‣ Export Atlas as PDF.
  1. Bring several applications into one set of working layers, keyed by the applicant’s name.
  2. Filter every table, label, and the application’s own layers to the current application.
  3. Fit the main map’s scale to each application.
  4. Export one map per application from one layout.

An office that prepares or reviews many applications can produce all their maps from one layout: the atlas makes one page per application. The atlas needs all the applications in one coverage layer, while the guide requires separate shapefiles for each application. So the applications are merged into working layers, keyed by NAME, and the submission shapefiles are left untouched.

This part maps five applications, chosen for what an office’s applications do: one shares a boundary with another, one is too large for the main map at 1:5,000, and one has a long technical description. One layout handles all of them.

4.11. Preparing the applications’ layers

Section titled “4.11. Preparing the applications’ layers”

Level: Intermediate

  • The sample application’s area_boundary, area_corners, td_lines, and tie_point
  • Four fully prepared applications in bnhr_qgis-sflma-mapping-001.gpkg, each with its _boundary, _corners, _td_lines, and _tie_point layers:
Layers Application Area Corners
sample2_… Luntiang Bundok Agroforestry Association, in Maigang and Minahan Norte 20.15 ha 8
sample3_… Malawak na Kagubatan Agroforestry Cooperative, in Anoling and Minahan Norte 255.29 ha 12
sample4_… Sampung Bundok Agroforestry Association, in Batangan 9.04 ha 24
sample5_… Kapitbahay Agroforestry Association, in Batangan and Maigang, sharing the sample’s line 4-5 7.11 ha 5
  1. The boundary and corners already carry NAME. Add NAME to the sample application’s td_lines and tie_point with the Field Calculator (Text), read from its area boundary:
aggregate('area_boundary', 'max', "NAME")
  1. Run Processing Toolbox ‣ Merge vector layers four times, once for each kind of layer, each time with five input layers: the five boundaries, the five corner layers, the five technical description line layers, and the five tie points.
Merging the five applications’ boundaries
Merge vector layers: one boundary layer for the five applications
  1. Save the four merged layers in a GeoPackage, load them, and name them area_boundary, area_corners, td_lines, and tie_point. The completed layers are applications_boundary, applications_corners, applications_td_lines, and applications_tie_point in bnhr_qgis-sflma-mapping-outputs.gpkg: 5 boundaries, 58 corners, 58 technical description lines, and 5 tie points.

The merged layers are working layers for producing the maps. Each application is still submitted with its own shapefiles, technical description, and coordinates, in the prescribed names.

4.12. Keying the layout to the current application

Section titled “4.12. Keying the layout to the current application”

Level: Advanced

Start from the atlas layout. The labels that read the atlas feature (title, location, area, certification) already work. The tables, the tie line, and the application’s own layers on the main map read other features too, so they must be filtered to the current application by NAME, and the main map’s scale must fit each application.

  1. Select the technical description table. Under Feature filtering, uncheck Show only features intersecting atlas feature, check Filter with, and enter:
"NAME" = attribute(@atlas_feature, 'NAME')
Filtering the technical description table to the current application
The table shows only the lines of the current application

Applications that share a boundary have technical description lines that touch both areas, so filtering by intersection would list the neighbor’s lines too. Filtering by NAME is exact.

  1. Change the tie line label and the four cells of the original coordinate table to read the current application’s tie point:
[% attribute(get_feature('tie_point', 'NAME', "NAME"), 'TIE_LINE') %]
'Reference Point: ' || attribute(get_feature('tie_point', 'NAME', "NAME"), 'ref_point')
'Easting: ' || format_number(attribute(get_feature('tie_point', 'NAME', "NAME"), 'easting'), 3, omit_group_separators:=true)
'Northing: ' || format_number(attribute(get_feature('tie_point', 'NAME', "NAME"), 'northing'), 3, omit_group_separators:=true)
'Datum: ' || attribute(get_feature('tie_point', 'NAME', "NAME"), 'datum')
The tie line label reading the current application’s tie point
The tie line of the current application, found by NAME
  1. Applications have different numbers of lines, so the table’s height changes from page to page. Make the table’s frame tall enough for the longest technical description (e.g. 30 lines), and place the tie line under the last row with a data-defined override of the label’s Y position (in Position and Size). With the table starting at 28 mm and rows 5.11 mm high:
28 + 5.11 * (1 + aggregate('td_lines', 'count', "LINE", filter:="NAME" = attribute(@atlas_feature, 'NAME')))

The 1 + accounts for the table’s header row. Measure your own table’s top and row height in the layout and change the two numbers accordingly. The Sampung Bundok Agroforestry Association’s 24 lines are the longest technical description here: check that its tie line sits under its last row.

Only the current application on the main map

Section titled “Only the current application on the main map”

The main map shows every feature of area_boundary and area_corners in its extent, so where two applications are close, both are drawn. The sample’s page would show the Kapitbahay Agroforestry Association beside it, with a second corner 1, 2, and 3, and the legend would call both the proposed area. Give each of the two layers a symbology that draws only the current application:

  1. Open area_corners’ Layer Properties ‣ Symbology and change Single Symbol to Rule-based. Edit its one rule (double-click it): set its Label to Proposed SFLMA corners and its Filter to:
"NAME" = attribute(@atlas_feature, 'NAME')
The rule-based symbology of the corners
One rule: only the current application’s corners are drawn, and so labelled
  1. Do the same for area_boundary, with the Label Proposed SFLMA area and the same filter. The corner numbers follow the rule: a corner that is not drawn is not labelled.
  2. In the legend, a rule-based layer shows its rule as an item under the layer’s name, so each would now appear twice. Select the legend, and in its Legend Items, right-click the Proposed SFLMA corners and Proposed SFLMA area layers and choose Hidden: their headings are hidden, and the legend shows the rules’ labels in their place, as before.

The location map is not affected: its location_marker is a separate layer, and already marks only the current application with $id = @atlas_featureid.

At 1:5,000 the main map covers 1,330 m by 1,300 m on the ground. The Malawak na Kagubatan Agroforestry Cooperative is 1,840 m across, so with Fixed scale only part of it is on its page. The scale must be chosen for each application, and the grid and the scale bar must follow it.

  1. Select the main map. Next to Scale, click the Data-defined override button ‣ Edit… and enter:
with_variable('need', 1.5 * max(bounds_width(@atlas_geometry) / 0.266, bounds_height(@atlas_geometry) / 0.26),
CASE WHEN @need <= 5000 THEN 5000 WHEN @need <= 10000 THEN 10000 WHEN @need <= 20000 THEN 20000 ELSE 50000 END)

bounds_width(@atlas_geometry) is the application’s width on the ground, in meters, and 0.266 and 0.26 are the main map’s width and height on paper, in meters (266 mm by 260 mm). Dividing one by the other gives the scale at which the application would just fill the map; 1.5 * keeps it to two thirds of the map, clear of the tables in its corner. The CASE then takes the first round scale at least that small. Change 0.266 and 0.26 if your main map has another size.

The main map’s data-defined scale
The data-defined scale (the yellow button) gives 1:20,000 on the page of the large application
  1. Open the main map’s grid (Modify Grid…), and next to Interval, give X and Y each a data-defined override, so the crosses stay on round seconds without crowding the labels at smaller scales:
CASE WHEN @map_scale <= 5000 THEN 10 WHEN @map_scale <= 10000 THEN 20 WHEN @map_scale <= 20000 THEN 30 ELSE 60 END / 3600
  1. Select the scale bar, and give its Fixed width (the units per segment) a data-defined override, so each of its four segments stays 20 mm long: 100 m at 1:5,000, 400 m at 1:20,000.
map_get(item_variables('main_map'), 'map_scale') / 50

The scale label and the scale bar already read the main map, so they show each page’s scale.

The large application at 1,000
Page 3: the Malawak na Kagubatan Agroforestry Cooperative at 1:20,000, clear of the tables

Controlled by Atlas offers Predefined scale (best fit), which also picks a round scale for each feature. It fits the application to the whole map, ignoring the margin, so a large application can end up under the tables. It also reads its list of scales from the project, and a layout template does not carry it: in another project the layout would use QGIS’s own list. The data-defined scale is part of the layout, so it goes with the template.

Keep Controlled by Atlas checked with Fixed scale: the atlas centers the map on each application, and the data-defined override sets its scale.

Level: Beginner

  1. Click Preview Atlas and step through the five pages: one page per application, each with its own map, tables, tie line, title, and certification. Check each page: the whole application is on the map, clear of the tables, at 1:5,000 except page 3 at 1:20,000; page 1 shows only the sample, not its neighbour; and page 4’s tie line sits under its 24 lines.
The second application in the atlas preview
Page 2 of the atlas: the Luntiang Bundok Agroforestry Association
The map of the Kapitbahay Agroforestry Association
Page 5: the Kapitbahay Agroforestry Association, beside the sample, which is not drawn on its map
  1. Export with Atlas ‣ Export Atlas as PDF, choosing a folder. The atlas writes one PDF per application, named by the output filename expression:
    • IV-A_SFLMA_Map_Bagong Gubat Agroforestry Cooperative.pdf
    • IV-A_SFLMA_Map_Luntiang Bundok Agroforestry Association.pdf
    • IV-A_SFLMA_Map_Malawak na Kagubatan Agroforestry Cooperative.pdf
    • IV-A_SFLMA_Map_Sampung Bundok Agroforestry Association.pdf
    • IV-A_SFLMA_Map_Kapitbahay Agroforestry Association.pdf

The completed project is sflma-several-applications.qgz, also inside bnhr_qgis-sflma-mapping-outputs.gpkg, and the template is SFLMA-prescribed-map-several-applications.qpt; the five PDFs are in the outputs folder’s several-applications subfolder.

An application with several parcels works the same way: add a PARCEL field to the boundary, the technical description lines, and the tie points, and filter by it instead of by NAME.

Quizzes

The quizzes are on BNHR Quizzes and count toward nothing. Learning on your own, a quiz opens as the self-paced one; while a training runs, it asks which training you are in.

Saved in this browser only

Certification and support

We offer additional resources, certificates, official QGIS certification, ongoing support, and other perks to those who join our instructor-led training.

Join an upcoming training to take this as an instructor-led course, or contact us to arrange one for your team or organization.

Something new

Identify results
LayerTry an exercise
ExerciseRegional map of the Philippines showing statistics per province
Number4.1, in Dynamic and automated maps with the QGIS Atlas
CourseQGIS: Maps and Layouts
DataProvided in the lesson