../../../../_images/image713.png

Module 1: QGIS Review

Learning Objectives

  • Identify data types in QGIS

  • Understand symbology

  • Understand map layout

Before we dive deeper into InaSAFE, we will review the QGIS techniques that we covered in Unit 2. We will once more go over some of they key aspects of QGIS, including adding vector and raster layers, symbolising layers and using the Print Composer. If you feel competent in all of these areas, feel free to jump ahead to the next module, but otherwise follow along for a brief review!

1. Data types in QGIS

As you may recall, there are two types of data that we often use in QGIS: raster and vector data. Raster data is characterised as an array of data which consists of rows and columns, like the pixels in an image. Vector data, on the other hand, consists of discrete features made of points and lines, and their position is defined by coordinates.

1.1 Adding vector data

Let’s add vector data to a new project.

  1. Open a new QGIS project. Your map and Layers panel should be empty.

../../../../_images/image813.png
  1. There are two ways to add a new vector layer to your project. Navigate to Layer ‣ Add Vector Layer… on the menu or click on the Add Vector Layer button on the toolbar:

../../../../_images/image914.png
  1. If you can’t find the toolbar button, right-click the toolbars and make sure that the box is checked next to File.

The Add vector layer dialog looks like this:

../../../../_images/image1014.png
  1. Click on the Browse button and navigate to your exercise data. Go into the qgis/Sleman/ directory and select Jalan_Sleman_OSM, POI_Sleman and Kecamatan_Sleman. Select multiple files by holding the CTRL key on your keyboard as you click each file. Click Open and then Open again.

Your map canvas will now look like this:

../../../../_images/image1113.png

Great! You’ve added some vector data to your map.

Note

Remember that there are three kinds of vectors:

  • points

  • lines

  • polygons

We have just added one layer of each type.

1.2 Adding Raster Data

Raster data has different characteristics than vector data. Raster data is composed of rows and columns which form small boxes (known as pixels). The pixels contain information, which is usually expressed as greyscale or colour. The information in each pixel could be the altitude of a point, the size of the population, the area’s colour or another value.

  1. There are two ways to add a new raster layer to your project. Navigate to Layer ‣ Add Raster Layer… on the menu or click on the Add Raster Layer button on the toolbar:

../../../../_images/image1213.png
  1. Navigate to qgis/Sleman/SRTM/ and select SRTM_Sleman.tif, which depicts the topography of the area.

../../../../_images/image1313.png
  1. Click Open. The raster will be added to our project.

../../../../_images/image1413.png

Next we will symbolise the data to make it easier to understand.

2. Symbolising data

Layer symbology is useful so that users can easily understand our maps. It is also important to make our maps more attractive. Your choice of a layer’s symbology is very important to deliver the right information.

2.1 Symbolise the districts

Let’s symbolise the district layer that we’ve added:

  1. Right-click on the Kecamatan_Sleman layer, and click Properties, or double-click the layer name.

  2. Click on the Style tab.

../../../../_images/image1513.png

Notice all the options that we have to change the appearance of this layer. We can change the layer’s transparency or its colour, or make even more detailed variations by clicking on Change.

We can also base the symbology on the data contained in the layer itself.

  1. Click on the box that says Single Symbol and change it to Categorized.

../../../../_images/image1612.png
  1. Change the Color Ramp to a set of colours that you like, and then click Classify. It may look something like this (although your colours will be different):

../../../../_images/image1712.png
  1. Click OK to apply the style changes.

2.2 Symbolise the roads

Next, let’s symbolise our roads layer.

  1. Double-click Jalan_Sleman_OSM in the Layers panel to open the Properties window.

  2. Click on the Style tab.

  3. Adjust the colour as you like, or choose one of the style presets that are displayed at the bottom.

  4. Feel free to experiment. As you make changes, click Apply to view your changes on the map.

If you use multiple symbologies (as we covered in Unit 2), your roads may end up looking like this:

../../../../_images/image1812.png
  1. This isn’t ideal. To fix this, open the Properties window and on the Style tab click on the Advanced button and choose Symbol Levels. Check the box next to Enable symbol levels.

../../../../_images/image1911.png

The roads will then look correct:

../../../../_images/image2012.png

Try editing the symbology of the POI_Sleman_OSM layer on your own.

Your map should end up looking something like this:

../../../../_images/image2312.png

3. Map layout

Your map is a medium to communicate information (as well as your ideas). Layer symbology is used to convey the content of your data so that it can be easily understood by the user. By creating a map layout, you are going a step further in using your map as a way to convey information.

For a full review of Map Composer, refer back to Unit 2. For now, let’s create a basic layout with a legend.

  1. Start a new Map Composer window by going to File ‣ New Print Composer.

  2. Click the Add new map button and draw a box on the left side of the canvas.

../../../../_images/image2412.png
  1. Now click on the Add new legend button and draw a box on the right side of the canvas.

../../../../_images/image2512.png

Your map will look similar to this:

../../../../_images/image2612.png

Play around a bit with the Print Composer if you like, and refresh your memory!

Now it’s time to get back to InaSAFE!

Go to next module –>