Skip to content

Styling layers and making maps

Introduction

This module is designed to teach you the basics of symbology and map-making in QGIS.

By the end of this module, you should know: QGIS style elements, basic styling and symbology of rasters and vectors, and how to create printable maps in QGIS.

What you should already know

Since this is a beginner module, no previous knowledge of GIS or QGIS is required. However, familiarity with the QGIS interface (as discussed in Introduction to QGIS) and how to load different kinds of layers (as discussed in Introduction to Layers in QGIS) are preferred.

How do you style layers?

When it comes to styling layers in QGIS, there are two main approaches you can take: using the Layer Styling Panel or applying the style via the Layer Properties. Both approaches have their pros and cons, and the choice ultimately depends on your preference and the specific task at hand.

Using the Layer Styling Panel allows you to see changes in layer symbology in real-time, making it easier to experiment with different styles and quickly visualize the effects of your changes. This approach is especially useful when you need to quickly make changes to a layer’s appearance or create a simple style for a new layer.

On the other hand, using the Layer Properties have some functionalities that provide precise control over the layer’s symbology. This approach is useful when you need to create a more complex or custom style that requires more fine-tuning.

The Layer Styling Panel

Figure 1. The Layer Styling Panel

Symbology using Layer Properties

Figure 2. Symbology using Layer Properties

Style and symbology components

Style Manager

The Style Manager allows you to easily manage and organize styles for your layers and provides a central location for storing and applying custom styles—making it easier to maintain consistency across your projects. It can be accessed via Settings ‣ Style Manager in the Menu bar.

The Style Manager

Figure 3. The Style Manager

With the Style Manager, you can create, edit, and delete styles, as well as import and export them for use in other projects. This can be especially useful if you have a large number of layers with different styles, or if you want to share styles with other users.

In the Style Manager, you can find the different styles for points (markers), lines, polygons (fills), color ramps, text formats, label settings, and legend patches. By using the Style Manager, you can have reusable and consistent style components—style can be created once, stored in the style manager, and used multiple times. The Style Manager also allows for sharing of styles between different users so one user can create a style and share it with others to use.

Importing styles

In addition to creating your own styles from scratch, QGIS also provides a convenient way to import pre-made style components into your project through the Style Manager. This feature allows you to import styles as files or URL. By importing these components into the Style Manager, you can easily reuse them in different projects and share them with other users. The Style Manager also allows you to organize your styles into categories for easier management and access.

Exercise 4.1. Importing Styles into QGIS

For this exercise, we’ll be importing the wonderful QGIS styles made by Topi Tjukanov (@tjukanov) available from https://github.com/tjukanovt/qgis_styles.

  1. Download any style XML from the link above or download the entire repository.
  2. Open the Style Manager via Settings ‣ Style Manager in the Menu bar.
  3. Click Import/Export and select Import Item/s.
  4. If you downloaded the qgis_styles repo by tjukanov, you can use File and select the necessary file.
  5. Was your style added to the Style Manager?
  1. Try to import a style from a URL.
  2. Once imported, these styles become available in QGIS and can be updated and modified just like any other style.

The QGIS Style Repository

You can also get more styles at the QGIS Style Repository: https://hub.qgis.org/styles/.

The QGIS Style Repository is an online resource where users can access a vast collection of styles created and shared by the QGIS community from all over the world. These styles are available for download and can be easily imported into your QGIS project.

The repository features a variety of styles, from simple and minimalistic to highly detailed and complex, covering various mapping themes such as land cover, transportation, and water features. By exploring and utilizing the QGIS Style Repository, you can save time and effort in creating your own styles from scratch and have access to a diverse range of creative options to enhance your mapping projects.

You can try downloading the HLURB Land Use Categories And Color Coding (2014) fill style [https://hub.qgis.org/styles/62/] and Philippines Administrative Boundary Patches (Regions) legend patch [https://hub.qgis.org/styles/145/] that I shared there.

Styles shared by BNHR on the QGIS Style repository

Figure 4. Styles shared by BNHR on the QGIS Style repository

Color Schemes or Palettes

QGIS allows you to create your own color scheme or color palette that easily gets integrated into QGIS’ built-in color selection dialogs. This is useful when you have a set of colors that you usually work with (i.e. branding) or if there are standard colors for the maps that you are creating (i.e. HLURB Land Use and Zoning Standards).

Exercise 4.2. Creating your own color scheme or palette

In this exercise we will create a new color scheme in QGIS that reflects the HLURB CLUP Guidebook Annex on Land Use Categories and Color Coding (HLURB_CLUP_Vol_3_Annex_1.pdf).

HLURB Land Use Categories and Color Coding sample

Figure 5. HLURB Land Use Categories and Color Coding sample

  1. Open the Color Options via Settings ‣ Options ‣ Colors in the Menu bar.

Color options in QGIS

Figure 6. Color options in QGIS

  1. QGIS has some built-in color schemes. You may check them out by selecting them from the dropdown button. Initially, the Standard color color scheme is shown.

  2. To create a new Color scheme, click the dropdown button next to the Color scheme selector and select New Palette. Name your new palette as HLURB-CLUP.

Create New Palette

Figure 7. Create New Palette

Name the Palette

Figure 8. Name the Palette

  1. A blank color palette should appear with the name HLURB-CLUP in the dropdown button.

Blank HLURB-CLUP Color Scheme/Palette

Figure 9. Blank HLURB-CLUP Color Scheme/Palette

  1. Now we need to fill up our color palette. We can use the buttons on the right side of the dialog to do this.

  2. Let’s add the colors from the HLURB Guidebook. Click Add new color (green plus button) to open the add color dialog. To add the Forest Zone category, add a color with RGB = 0, 100, 0.

  3. Rename the Label to Forest Zone.

Add the Forest Zone color (RGB 0, 100, 0)

Figure 10. Add the Forest Zone color (RGB 0, 100, 0)

The Forest Zone color added to our Scheme/Palette

Figure 11. The Forest Zone color added to our Scheme/Palette

  1. Do the same for all categories. In our case, let’s add a color for each Base zone (Bold Categories in the Guide) since the sub-zones have the same color as the base zone. In the end you, you should have the color palette below:

The HLURB-CLUP Color Scheme/Palette

Figure 12. The HLURB-CLUP Color Scheme/Palette

  1. Now, we can add this color palette to the QGIS color selection dialogs by clicking the dropdown button and checking Show in Color buttons.

Show the palette in the QGIS Color Buttons

Figure 13. Show the palette in the QGIS Color Buttons

  1. Afterwards, this palette should always appear in the color selection dialogs in QGIS.

The HLURB-CLUP color palette appearing in the QGIS color button/dialog

Figure 14. The HLURB-CLUP color palette appearing in the QGIS color button/dialog

Built-in color palettes and color ramps

QGIS also has a lot of built-in color palettes to choose from aside from the ones shown when selecting color palettes in the color selection dialog (e.g. raster symbology).

For example, QGIS has built-in cpt-city color palettes and even a palette creator using Color Brewer.

This option can be found by clicking Create New Color Ramp… when a color ramp dialog is present.

Create New Color Ramp

Figure 15. Create New Color Ramp

Color ramp types

Figure 16. Color ramp types

cpt-city color ramps in QGIS

Figure 17. cpt-city color ramps in QGIS

Basic vector symbology

Symbology is how the layer appears visually on the map, and it plays an important role in making the map informative and easy to read. In QGIS, there are different types of symbology that you can apply to vector layers, depending on the data type.

For points, lines, and polygons, there are several basic symbology types available in QGIS.

The first type is a Single Symbol, which means all features in the layer will appear the same. This is useful when you want to display simple datasets or when you want to show a basic layer with a uniform appearance.

The next symbology type is Categorized, which is ideal for categorical data. With Categorized symbology, a feature’s appearance is based on the value of one of its fields. For example, you can assign different colors or shapes to different categories, such as land use types or administrative boundaries.

Another symbology type is Graduated, which is useful for numeric data. Graduated symbology adjusts the appearance of features based on the value of one of their fields. You can use this to show population density, elevation or any other continuous data. Graduated symbology helps to visualize differences in data by using different colors or sizes for the features.

Lastly, Rule-based symbology is another type available for vector layers. With Rule-based symbology, you can define a set of rules that control the appearance of features based on multiple attributes. For instance, you can use rule-based symbology to apply different colors, shapes or sizes to features that match specific conditions.

There are also other symbology types that are specific to points, lines, and polygons. Using the correct symbology type will help you create a more visually appealing and informative map.

To change a vector’s symbology you can:

  • Right-click the layer ‣ Properties or
  • Use the Layer Styling Panel (F7)

For Exercises 4.3.X, you will use the bnhr_qgis_essentials_04.gpkg inside the data subfolder in the BNHR_QGIS-Essentials_Module_4 folder.

Exercise 4.3.1. Applying a Single Symbol symbology

  1. Load the amenity_hospital_osm and the ncr_admin_boundary layers.
  2. Select the amenity_hospital_osm layer in the Layers Panel.
  3. On the Layer Styling Panel, select Single Symbol and select the topo hospital marker.

Applying a Single Symbol symbology to the amenity_hospital_osm layer

Figure 18. Applying a Single Symbol symbology to the amenity_hospital_osm layer

  1. Apply a Single Symbol symbology to the ncr_admin_boundary layer as well.
  1. Your map canvas should look similar to the one below.

The amenity_hospital_osm styled as red crosses in white circles and the ncr_admin_boundary with a pink background

Figure 19. The amenity_hospital_osm and the ncr_admin_boundary layers with Single Symbols

Exercise 4.3.2. Applying a Categorized symbology

  1. Load the ncr_ground_shaking_phivolcs layer.
  2. Open its attribute table and notice the values. We have features with their corresponding intensities.

Attribute table of the ncr_ground_shaking_phivolcs layer

Figure 20. Attribute table of the ncr_ground_shaking_phivolcs layer

  1. Apply the following symbology.
    • Type: Categorized
    • Value: Intensity
    • Color ramp: Viridis
  2. Click Classify

Categorized symbology parameters for the ncr_ground_shaking_phivolcs layer

Figure 21. Categorized symbology parameters for the ncr_ground_shaking_phivolcs layer

  1. Your layer should look like below.

Categorized symbology applied to the ncr_ground_shaking_phivolcs layer

Figure 22. Categorized symbology applied to the ncr_ground_shaking_phivolcs layer

Exercise 4.3.2. Applying a Graduated symbology

  1. Load the ncr_municities layer.
  2. Open its attribute table and notice the values. We have the population for each municity based on the 2020 census (pop2020).

Attribute table of the ncr_municities layer

Figure 23. Attribute table of the ncr_municities layer

  1. Apply the following symbology.
    • Type: Graduated
    • Value: pop2020
    • Color ramp: Reds
  2. Click Classify
  3. Edit the parameters to make it have more sense.

Graduated symbology parameters for the ncr_municities layer

Figure 24. Graduated symbology parameters for the ncr_municities layer

  1. Your layer should look like below.

Graduated symbology applied to the ncr_municities layer

Figure 25. Graduated symbology applied to the ncr_municities layer

Basic raster symbology

When working with rasters, there are different ways to represent them visually, depending on their type and the purpose of the analysis. Here are some of the symbology types commonly used for rasters:

Multiband color: this symbology utilizes multiple bands of the raster to create a composite image that can show different combinations of colors or brightness values. It’s useful for visualizing multispectral or hyperspectral data, such as satellite imagery.

Paletted/Unique values: this symbology is useful for styling classified or categorized rasters, where each pixel value corresponds to a certain category. It assigns a color to each unique pixel value, based on a user-defined color ramp.

Singleband gray: this symbology applies a grayscale color ramp to a single band of the raster, which can be useful to display elevation data, for example.

Singleband pseudocolor: similar to the paletted symbology, this symbology applies a custom color ramp to a single band of the raster. It allows the user to create a smooth transition of colors between pixel values, rather than a discrete mapping.

Contours: you can generate contours directly from rasters. Contour lines are isolines that connect points of equal elevation, and they can be useful for creating elevation maps or visualizing terrain features.

Hillshade: this symbology applies hillshade shading to the raster, which simulates the effect of sunlight on a terrain surface. It’s very useful for elevation rasters, as it can enhance the visual perception of relief and slopes.

For Exercises 4.4.X, you can find the necessary files inside the data subfolder in the BNHR_QGIS-Essentials_Module_4 folder.

Exercise 4.4.1. Applying Singleband pseudocolor symbology

  1. Load the ncr_municities and ncr_popden_meta layers. The ncr_popden_meta is population density data from Meta’s high resolution population density maps.
  2. Apply a single color symbology to the ncr_municities that uses a light color as fill (e.g. white).
  3. Apply the following symbology to the ncr_popden_meta layer:
    • Type: Singleband pseudocolor
    • Band: Band 1 (Gray)
    • Min: 1, Max: 100
    • Interpolation: Linear
    • Mode: Equal Interval, Classes: 4
    • Edit the values of the 4 classes to read: 0, 20, 50, 100

Singleband pseudocolor symbology parameters for the ncr_popden_meta layer

Figure 26. Singleband pseudocolor symbology parameters for the ncr_popden_meta layer

  1. Your map should look like below.

Singleband pseudocolor symbology applied to the ncr_popden_meta layer

Figure 27. Singleband pseudocolor symbology applied to the ncr_popden_meta layer

Exercise 4.4.2. Applying Paletted/Unique values symbology

  1. Load the ncr_municities and ncr_lulc_esri layers. The ncr_lulc_esri is 10-meter resolution land cover data obtained using satellite imagery (ESA Sentinel-2) and composite land cover predictions released by Esri in 2020. It is composed of 10 discrete land cover classes.
  2. Apply a single color symbology to the ncr_municities that uses a transparent fill and a white stroke.
  3. Apply the following symbology to the ncr_lulc_esri layer:
    • Type: Paletted/Unique values
    • Band: Band 1 (Gray)
    • Add values manually by clicking the green plus button. You need to add 11 values/classes from 0 to 10.
    • Edit the color and Label for each Value. (You may choose not to edit the Colors to save time)
      1. Water
      2. Trees
      3. Grass
      4. Flooded vegetation
      5. Crops
      6. Scrub/shrub
      7. Built Area
      8. Bare ground
      9. Snow/Ice
      10. Clouds

Paletted/Unique values symbology parameters for the ncr_lulc_esri layer

Figure 28. Paletted/Unique values symbology parameters for the ncr_lulc_esri layer

  1. Your map canvas should look like below.

Paletted/Unique value symbology applied to the ncr_lulc_esri laye

Figure 29. Paletted/Unique value symbology applied to the ncr_lulc_esri laye

Exercise 4.4.3. Applying Contours symbology

  1. Load the albay_srtm_4326 layer. This is a digital elevation model (DEM) that is an output of the Shuttle Radar Topography Mission (SRTM) in 30m resoulution. This layer is in the WGS84 CRS (EPSG: 4326).
  2. Load a basemap such as OpenStreetMap.
  3. Apply the following symbology to the albay_srtm_4326 layer:
    • Type: Contours
    • Contour Interval: 50
    • Input Downscaling: 5.0

Contours symbology parameters for the albay_srtm_4326 layer

Figure 30. Contours symbology parameters for the albay_srtm_4326 layer

  1. Your map should look like below.

Contours symbology applied to the albay_srtm_4326 layer

Figure 31. Contours symbology applied to the albay_srtm_4326 layer

Exercise 4.4.4. Applying Hillshade symbology

  1. Load the albay_srtm_32651 layer. This is the same layer as albay_srtm_4326 only in a different CRS (EPSG: 32651 – UTM Zone 51N).
  2. Apply the following symbology to the albay_srtm_32651 layer:
    • Type: Hillshade
    • Band: Band 1 (Gray)
    • Altitude: 45 ˚
    • Azimuth: 275 ˚
    • Z Factor: 2.0

Hillshade symbology parameters for the albay_srtm_32651 layer

Figure 32. Hillshade symbology parameters for the albay_srtm_32651 layer

  1. Your map canvas should look like below.

![Hillshade symbology applied to the albay_srtm_32651 layer(../../../assets/img/essentials/04-4.4.4-hillshade-02.png)

Figure 33. Hillshade symbology applied to the albay_srtm_32651 layer

  1. Now load the albay_srtm_4326 layer.
  2. Copy the style from albay_srtm_32651 and paste it to albay_srtm_4326.
  3. Do they look the same?

Hillshade for albay_srtm_4326 layer with the same parameters as albay_srtm_32651

Figure 34. Hillshade for albay_srtm_4326 layer with the same parameters as albay_srtm_32651

Advanced symbology and styling

In addition to the basic symbology types, QGIS also offers advanced symbology and styling options that can enhance your maps and visualizations.

Learning advanced techniques in QGIS is essential for those who want to take their geospatial analysis and mapping skills to the next level. Advanced symbology and styling techniques allow users to create more visually appealing and informative maps while also providing greater flexibility and control over how data is represented.

One of these techniques is Geometry Generators which allows you to perform spatial operations directly within the symbology itself. This means you can create new geometries, modify existing ones, or perform calculations without having to create a new layer.

Another advanced feature is Data-defined Overrides which allows you to override symbology parameters using fields, expressions, or other variables. This means you can create dynamic styles that change based on the data in your attribute table. For example, you can use data-defined overrides to adjust the size or color of a point symbol based on a numerical field in your attribute table. To assist with data-defined overrides, there is an Assistant that helps you change how the data is applied to the parameter for each feature for some parameters using Data-defined override

Draw Effects is another advanced styling feature in QGIS that allows you to apply different visual effects to layers. These effects include drop shadows, inner and outer glows, blurs, and embossing, among others. Draw Effects can be accessed through the Layer Properties dialog, specifically under the Symbology tab.

QGIS also has Blending Modes, which are special rendering effects applied on layers, features, and print layout items. These modes can add interesting visual effects to your map, such as blending one layer into another or making a layer appear transparent. You can experiment with different blending modes to create unique and visually stunning maps.

Finally, you can utilize Expressions in creating your styles.

QGIS also allows you to fine-tune your styles using Rules and Scales or create 3D and Temporal visualizations.

You can combine all these techniques to create the map or visualization that is most appropriate for your need.

Making printable maps

Creating maps is probably the most popular and most known function of a GIS. In fact, a previous module, we mentioned that map making is usually used interchangeably with GIS. Of course, we know this isn’t technically true but that doesn’t diminish the importance of the ability of a GIS to create maps which allows us to visualize and communicate spatial information in a clear and understandable way.

In this module, we will look at the basics of map making in QGIS.

Exporting the Map Canvas

If you simply want to print the content of the map canvas, this can be done through: Projects ‣ Import/Export ‣ Export Map to Image.

Exporting the contents of the map canvas

Figure 35. Exporting the contents of the map canvas

You can add some minimal decorations to the map canvas like grids, title, a north arrow, and scale through: View ‣ Decorations.

Adding some decorations to the map canvas

Figure 36. Adding some decorations to the map canvas

Map canvas with some decorations (grid, north arrow, title, scale)

Figure 37. Map canvas with some decorations (grid, north arrow, title, scale)

This technique is useful for quick and simple maps but if we want to create a fully-featured map and take advantage of the power of QGIS as a cartography and map design application then we need to use Print Layouts.

Using the Print Layout

You can create and manage Print Layouts through Project ‣ Layout Manager. You can also create a new Layout using Project ‣ New Print Layout.

Print Layouts are stored together with the project and each project can have multiple layouts. This is useful if you need to create different map layouts with the same data or layers.

Exercise 4.5 Creating printable maps

For this exercise, we want to create a map that shows the population density in Metro Manila.

  1. Load and style the ncr_popden_meta and ncr_municities layers. Your map canvas should look something like below.

The ncr_popden_meta and ncr_municities loaded and styled

Figure 38. The ncr_popden_meta and ncr_municities loaded and styled

  1. Create a new Print Layout via Project ‣ New Print Layout (CTRL + P) and name your Print Layout.

Naming a new Print Layout

Figure 39. Naming a new Print Layout

  1. This will open the Print Layout dialog/window where you will layout your map.

The Print Layout window

Figure 40. The Print Layout window

  1. To edit the paper/layout size, right-click on an empty area of the canvas ‣ Page properties.

Setting the page size and background

Figure 41. Setting the page size and background

  1. Add a map to the layout by clicking Add map button and dragging to create a rectangle that will hold the map in the canvas.

  2. Map layout elements (e.g. maps, images, scale bar, texts) can be moved, resized, etc. with Move or resize button.

Map added to the Print Layout

Figure 42. Map added to the Print Layout

  1. Add a title to your map by adding a text element Add label button and edit the text by editing the options in the Item Properties panel.
  2. Under Appearance in the Item Properties tab, you can edit the font properties.

Editing font properties

Figure 43. Editing font properties

Title added to the layout

Figure 44. Title added to the layout

  1. Add a legend with Add label button and edit it in the Item Properties panel.

Legend properties

Figure 45. Legend properties

Legend added to the map

Figure 46. Legend added to the map

  1. Add a north arrow with Add north arrow button and edit it in the Item Properties panel.

North arrow added to map

Figure 47. North arrow added to map

  1. Add a scale bar with Add scale bar button and edit it in the Item Properties panel.

Scale bar added to map

Figure 48. Scale bar added to map

  1. Add another text element Add label button to include other information to your map.

Another label containing information added to map

Figure 49. Another label containing information added to map

  1. Export the map via the Layout menu or the following buttons: Print button Save map as image button Save as SVG button Save as PDF button

Exporting the map

Figure 50. Exporting the map

  1. You can specify your preferred export options.

Export options

Figure 51. Export options

Output map

Figure 52. Output map

As a challenge, you can try to update/upgrade the map by adding a table of the total population per city/municipality from highest to lowest.

Map with table

Figure 53. Map with table

Advanced map-making techniques

Advanced map-making techniques help you make better maps more efficiently. Below are some techniques that you should learn:

  • Preview modes allow you to simulate how your map will look like in different scenarios such as how it would look like photocopied, faxed, or if viewed by someone with color blindness.. This is very useful especially for creating visually-inclusive maps.
  • Map themes are snapshots of a your map which saves information related to the layers on your map such as their visibility and symbology. They allow you to quickly switch between different configurations of the layers in your map. Also, since map themes are available in the Print Layout, they allow you to create map items based on the themes and independent of the current rendering or appearance of the main canvas. This is extremely useful when adding multiple maps in a layout (e.g. insets, etc.).
  • QGIS Atlas allows you to automatically create a series of maps using a single layout. A properly configured QGIS Atlas will save you countless hours. This is particularly useful if you are creating a series of maps such as those for different regions or time periods.
  • QGIS Reports are similar to the Atlas capability but with more functionalities. With Reports, you aren’t constrained to just creating maps. You can add sections of texts, images, etc. Reports can even have other reports nested inside them. You can think of Reports as Atlas on steroids.

Quiz and discussion questions

  1. What is the difference between Categorized and Graduated Symbology?
  2. Why is knowing the CRS of a layer important when applying Hillshade symbology to a raster?
  3. Which way of applying symbology do you prefer—using the Layer Styling panel or through Layer Properties—and why?
  4. Although maps are usually created in landscape orientation, QGIS can also be used to create visualizations and materials in portrait orientation. How would this affect your planning and implementation with using the Print Layout.

Homework challenge

There is a jollibee_mcdo_osm layer in the geopackage for this module. There are also logos for both fastfood chains under logos.

Load the layer together with ncr_municities in QGIS and try to recreate the following map. Tip: utilize Raster image markers.

Jollibee and McDo in NCR map)

Figure 54. Jollibee and McDo in NCR map

Certification and support

Contact us or sign-up to our courses if you are interested in having this as an instructor-led or self-paced course.