- QGIS By Example
- Alexander Bruy Daria Svidzinska
- 586字
- 2025-02-22 02:47:18
The initial setup – page format and other essentials
Before creating the map, we should set up our working space, which is mainly defined by page settings. All the necessary options are present under the Composition tab. Let's take a closer look at the Paper and quality section. The default page size in the Presets drop-down list is A4, but you can select from among 23 other sizes. We are going to create our own page by performing the following steps:
- Select Custom from the list.
- The Width and Height fields will be activated. Enter a value of
200
for both of them (this means that we are going to create a square page for a map composition). The value depends on the units chosen in Units, and by default, it is set to mm (millimeters).
As we are going to create only one map, we leave Number of pages as 1, but you can always enter more if you're going to combine several pages into one document. This is because you could have several maps in a single-page composition. As shown in the example, we're using a square page. So, it doesn't matter whether it has the Portrait or Landscape page orientation. Page background is a very important item as it allows you to achieve cool cartographic visualization effects. By clicking on the Change button, you can see that, by default, it is set to Simple fill with white color (which we are going to use). However, you can change it and select from among multiple filling options to create an original filling pattern.
Tip
For example, you can find nice raster or SVG textures and use them as background patterns by selecting Raster image fill or SVG fill respectively. Otherwise, you can select Gradient or Shapeburst fill to play around with some color grading effects.
Export resolution defines the quality of the exported map in dpi units. The higher this value, the better the map. However, the resulting file will also be bigger. For common purposes, such as publications, reports, and presentation graphics, 300 dpi
is enough. When the Print as raster toggle is active, the entire composition is converted into raster before exporting to .pdf
. The World file on toggle allows you to attach a .wld
file that contains information about a geographic reference to the image export output. This means that your map can not only be viewed in graphical or preview software, but can also be opened and aligned properly directly in GIS software.
Now, we will adjust the grid that will be used to align map items within a map layout:
- In the Guides and Grid section, enter
5
mm as the Grid spacing value to make it denser, and set Snap tolerance to10
pixels (the higher the value, the stronger the snapping). - To show the grid, activate the Show grid button, which is under View, or use the Ctrl + ' keyboard shortcut.
- Toggle Snap to grid, which is under View, or pressing Ctrl + Shift + ' activates snapping.
Tip
Instead of using a predefined grid, you can create your own guidelines by placing the mouse arrow over horizontal (for vertical guidelines) or vertical (for horizontal guidelines) ruler bars and clicking and dragging them along the page canvas. Deactivate Snap to Grid and use various options from the View menu such as Show/Clear or Snap to Guides. The Smart Guides option helps you detect the best placement position automatically based on the other items in your composition.