open.gis.lab

View Original

Setup QGIS Print Layout to use Inch Instead of Millimeter

I’m in the process of migrating as much of my workflow from ArcGIS to QGIS as possible. As part of my migration, I’m creating Layout templates to make the process of map making a bit easier. One of the questions I get all the time is how to set the units used in Layout to be in inches instead of millimeter. If you’re a QGIS user, you’ll noticed that you can change the Layout page size to be in inches (e.g. 8.5x11” Letter Portrait), however, the unit for the Ruler in Layout is hard coded in QGIS to be in millimeter - this causes a lot of confusion/frustration for users since the page size and Ruler units don’t match. This is

the workflow that I use to create a print layout template in QIGS that sets the units of the Ruler and the page size to be in inches. Note, I’m using the latest version of QGIS 3.14 Pi.

1. Open QGIS. Go to Project Menu >> New Print Layout

2. Give your new print layout a name (e.g QGIS PrintLayout Inches)

The default QGIS Layout looks like this:

3. Change page size via Page Properties, which is sort of hidden (its not in the menus). Right click anywhere within the Layout >> Page Properties.

Change your settings on the Page Properties to whatever you want. Here I’m changing my page size to 8.5x11 inches Portrait

Note: You may get either the Unit or Orientation grayed out depending on what page size you choose. Notice in the snapshot below, when Custom is selected the Orientation field i s grayed out, and when selecting Letter the unit is grayed out. I find this weird and don’t know if this a bug or not. But to work around it I first use Custom as my page size to input the width and height and change the unit to inches. Then switch to Letter size and change my orientation to Portrait.

Notice when Custom is selected the Orientation field is grayed out, and when selecting Letter the unit is grayed out.

4. Change the units for the Guides and Grid as needed (e.g. Inches)

This is how my layout looks like now. Notice that even though my page size is set to 8.5x11 inches Portrait the Ruler unit is still in mm (this is the default unit in QGIS and built into the core software).

At this point, you can add other map elements (e.g. Logo, map title, scale bar, etc) that you want to include in your template.

5. Save the print layout as a *.qpt template file (e.g.QGIS_Layout_inhces.qpt). Go to the Layout Menu >> Save as Template

6. Open and edit the layout template (.qpt) that you just saved. Here, I’m using Notepad++ as my text editor. Find and replace “mm” to “in” the qpt file. Save the file when done editing.

7. Go to Layout Menu >> Layout Manager. Open your print template.

  • Under New from Template: Select Specific

  • Navigate to your print layout template (the one you just edited above in step 6).

  • Create a new layout using the specified template

 Now the Ruler unit and Page Size unit match. Both should be in inches.

8. Optional – you can add the path to your layout templates in the Layout Settings so that QGIS will know to look for your templates.


That’s it for this session. I hope you find it useful. Print Layout templates is a great way to standardize map making and share them with others inside or outside your company.

Thanks for reading :)