QGIS is a user-friendly open source Geographic Information System (GIS). It runs on Linux, OS X, Windows and Android. QGIS supports numerous vector, raster, database formats and provide extendable functionality. Learn more about the project at: http://www.qgis.org
QGIS is great because:
QGIS provides a continuously growing number of capabilities provided by core functions and plugins. You can visualise, manage, edit, analyse data and compose printable maps. QGIS is also the platform which InaSAFE is built on, and so this document focuses on building foundational skills using QGIS.
The data for this exercise is available in Introduction to QGIS.zip which can be downloaded in InaSAFE Training Data Packages. To download QGIS, go to the QGIS Website (we will explain how to download and install QGIS later in this exercise). We will use the following QGIS project and data:
You can download QGIS software by accessing the main QGIS website:
After you download the QGIS software installer, the next step is to install QGIS to your computer.
Next, we will introduce the main QGIS interface. In general, there are four elements in QGIS:
By hovering your mouse over an icon, the name of the tool will appear to help you identify each tool. The number of tools (buttons) can seem a bit overwhelming at first, but you will gradually get to know them. The tools are grouped into related functions on toolbars. If you look closely you can see a vertical array of ten dots to the left of each toolbar. By grabbing these with your mouse, you can move the toolbar to a more convenient location, or separate it so that it sits on its own.
The coordinates of this map are the same type of coordinates that are recorded by GPS devices. The status bar shows the longitude and latitude of your mouse cursor.
At the top of QGIS are a large number of tools, which are contained within various ‘toolbars.’ For example, the File toolbar allows you to save, load, print, and start a new project. We already used one of these tools when we opened this project.
By hovering your mouse over an icon, the name of the tool will appear to help you identify each tool.
The number of tools (buttons) can seem a bit overwhelming at first, but you will gradually get to know them. The tools are grouped into related functions on toolbars. If you look closly you can see a vertical array of ten dots to the left of each toolbar. By grabbing these with your mouse, you can move the toolbar to a more convenient location, or separate it so that it sits on its own.
If you feel overwhelmed by the number of toolbars, you can customize the interface to see only the tools you use most often, adding or removing toolbars as necessary.
To add or remove a toolbar, right-click on empty space in toolbars, or go to View ‣ Toolbars.
Rearrange the toolbar so that it’s on one line. Left-click and hold the vertical dots on the left hand side of the tool. Drag to the first line of the toolbar.
We’ve already taken a look at the QGIS toolbar and have seen the tools for opening QGIS. Here’s a list of some of the most commonly used tools. Feel free to play around with them if you like. The important thing for now is to start getting familiar with QGIS.
|Add Vector Layer||Add vector data to Layer List|
|Add Raster Layer||Add raster data to Layer List|
|New||Create new QGIS project|
|Open||Open QGIS project|
|Toggle Editing||Edit features in a layer|
|Pan Map||Drag the map to a new location|
|Zoom In||Zoom in on the map|
|Zoom Out||Zoom out on the map|
|Zoom Full||Zoom so that all layers fit in the map window|
|Identify features||Identify the attribute of an active layer in the map canvas|
|Open Attribute Table||Open a layer’s attribute table|
|Select Single Feature||Select a feature in the selected layer|
Sometimes if you handle many layers, you need to hide/unhide layers to make the map canvas more organized. For example, open the pre-saved QGIS project, DKI_Jakarta_Introduction.qgs. Once all the data are displayed on your map canvas, try toggling the layer, a flood similar to the 2007 Jakarta Event by clicking on the checkbox in the Layers Panel on the left side of your screen.
After you uncheck the check box, the layer will disappear from the map canvas. This operation won’t remove your layer from the layers list but only hide it temporarily until you recheck again the check box. Try to turn ON the layer again to unhide the layer.
What if your layer does not appear in the map canvas even though you already turned ON your layers? In this example, the Jakarta_roads_WGS84 layer didn’t appear in Map Canvas even though it’s already turned ON. In this case, it’s related to layer order. The layers in your Layers List are drawn on the map in a certain order. The layer at the bottom of the list is drawn first, and the layer at the top is drawn last. By changing the order of the layers in the list, you can change the order they are drawn in.
For example in this layer order...
… would result in Jakarta_roads_WGS84 being hidden as they position underneath A Flood in Jakarta like 2013. To solve this problem, simply click the Jakarta_roads_WGS84 layer and drag to the top of the Layer List or reorder them to the correct order.
What do you see after you move the Jakarta_roads_WGS84 layer?
You can see the road network now because the Jakarta_roads_WGS84 layer is shown above the other layers.
The symbology of a layer is its visual appearance on the map. One of the basic strengths of GIS is that you have a dynamic visual representation of the data you’re working with. Therefore, the visual appearance of the map (which depends on the symbology of the individual layers) is very important. For example in the project that you currently have open, DKI_Jakarta_Introduction.qgs, you will see the A Flood in Jakarta like 2013 layer covering the area of DKI Jakarta. Did the flood really cover the whole of DKI Jakarta?
To answer this, let’s turn OFF the Jakarta_roads_WGS84 and A Flood Similar to the Jakarta 2007 event layers and open the attribute table of A Flood in Jakarta like 2013 by right clicking the layer and selecting Open Attribute Table. You will see there are 6 columns in this table and one of the columns has the name ‘affected’ with values of 1 and 0. A value of 1 represents an area that is flooded, while a value of 0 represents an area that has not been flooded. Let’s select a feature in this layer and see the highlighted feature in the attribute table.
What is the value of the selected feature in the attribute table?
Not all of the features in this dataset have a value of 1 (or flooded). You need to see which features have a value of 1 to make it easier to interpret the hazard area. To solve this problem, we will symbolize the data so it will only shows the flooded area.
After you click OK, only features that have a value of 1 (flooded) will be displayed on the map canvas, the other values won’t be shown on the map canvas because you turned OFF the symbol that represents a value of 0. Symbology helps us better understand the data that we will work on.
As we know, the InaSAFE plugin has been built for QGIS. It is one of the plugins which are available in the QGIS Repository. Make sure that you have a working internet connection before you follow the steps below. To get InaSAFE please follow these steps:
wait for a moment until the InaSAFE dock appears in the right side of QGIS main window.
Close the plugin manager window.
Congratulations! Now you have InaSAFE installed in QGIS.
After successfully installing InaSAFE, you should now have an InaSAFE dock on the right hand side of your screen. It should look like this:
InaSAFE also comes with a toolbar of its own! To retrieve the InaSAFE toolbar, you can right-click on the top toolbar and check InaSAFE.
|Set Analysis Area|
|Toggle Scenario Outline|
|Keyword Creation Wizard|
|Impact Function Centric Wizard|
|Add OpenStreetMap Tile Layer|
Later we will explore and use these tools in Run Basic InaSAFE and Intermediate Modules.
In this exercise you have learned about QGIS, the free and open source software for processing spatial data. You have learned where to get QGIS, how to install QGIS, understand the QGIS layout and looked at some useful toolbars, learning how to turn ON/OFF QGIS layers, and learned how to symbolize the data layers.
We also learned how to install InaSAFE through the QGIS plugin manager. Later on we will learn how to operate InaSAFE with DKI Jakarta flood scenario.