Vous êtes sur la page 1sur 175

c

Disclaimer
This document is initial draft and still in reviewing phase by these
parties:
Badan Nasional Penanggulangan Bencana (BNPB)
Australia-ndonesia !acility for "isaster #eduction (A!"#-
"!AT)
$umanitarian %pen&treet'ap Team ($%T)
All contents and materials on this document possibly changed without
public notice(
License
All contents and materials on this document is licensed as )reative
)ommons
Attribution Australia ())byA)(
*ou are free:
- to copy+ distribute+ display+ and perform the wor,
- to ma,e derivative wor,s
- to ma,e commercial use of the wor,
*ou must give the original author credit(
'ore information about ))byA -icense:
http:..creativecommons(org.licenses.by./(0.au.deed(en12B
Unit 2: QGIS and InaSAFE Beginner Level | 2
About Us
Badan Nasional Penanggulangan Bencana (BNPB)
BNPB is ndonesia3s National "isaster 'anagement Agency( BNPB is
a non-departmental ministerial-level government agency+ tas,ed with
providing guidance and direction to the efforts of disaster
management that includes disaster prevention+ emergency response+
rehabilitation+ and reconstruction in a fair and e4ual( National "isaster
'anagement Agency has the function as a policy ma,er and
formulator and #efugee ("P) management to act 4uic,ly and
appropriately and effectively and efficiently5 and coordinating the
implementation of disaster management activities in a planned+
integrated+ and comprehensive(
http:..bnpb(go(id
Unit 2: QGIS and InaSAFE Beginner Level | 3
Australia-Indonesia Facility for Disaster Reduction
(AIFDR)
The Australia-ndonesia !acility for "isaster #eduction (A!"#) is a
6oint initiative between the governments of Australia and ndonesia(
7e wor, to strengthen ndonesia8s ability to reduce the impact of
disasters( The Australian and ndonesian governments at a special
ceremony on 9: ;uly <090 launched the Australia-ndonesia facility(
The launch mar,s an important event in the strong relationship now
shared by both countries and their united commitment to better
prepare for and respond to natural disasters in ndonesia(
http:..aifdr(org
umanitarian !"en#treet$a" %eam (!%)
Unit 2: QGIS and InaSAFE Beginner Level | 4
!ree+ collaborative maps are uni4uely valuable to humanitarian wor,+
especially in places where base map data is often scarce+ out of date+
or rapidly changing( %pen&treet'ap is a web pro6ect to create a free
and open map of the entire world+ built entirely by volunteers
surveying with 2P&+ digiti=ing aerial imagery+ and collecting and
liberating e>isting public sources of geographic data( The
$umanitarian %pen&treet'ap Team ($%T) is an initiative to apply
the principles and activities of open source and open data sharing
towards humanitarian response and economic development(
http:..hot(openstreetmap(org
Uni&ersitas 'ad(a) $ada (U'$)
?niversitas 2ad6ah 'ada (internationally ,nown as 2ad6ah 'ada
?niversity5 Abbreviation : ?2') is an ndonesian public ivy league
research university located in *ogya,arta+ ndonesia( "epartment of
2eodetic @ngineering+ !aculty of @ngineering focuses on education+
research+ and commmunity services related to geodesy and geomatics
engineering+ including ac4uisition+ analysis+ and uses of detailed and
accurate geospatial data and large-scale maps using open source
geospatial software for disaster management(
http:..ugm(ac(id
Unit 2: QGIS and InaSAFE Beginner Level | 5
Preface
A 2eographic nformation &ystem (2&) is a system designed to enable people to
wor, with data related to places on the @arth( A 2& allows the creation+ storage+
manipulation+ and analysis of geographic data( 2& is a very broad concept and
can involve comple> hardware and software( But for most people3s purposes+ a
simple 2& software application is all that is re4uired
2& in general can be used for a variety of fields+ including in disaster
management( ?nfortunately+ the 2& software currently on the mar,et are very
e>pensive( Therefore we ma,e a guide how to analy=e the data with 2& software+
which is free and open for the purposes of disaster management+ particularly in
the preparation of contingency plans(
The software used is A2& (A2&) is a 2eographic nformation &ystem (2&)
that is user-friendly and open-source( na&A!@ is a free software and open-
source+ that can create realistic scenario of natural disasters impact for planning+
preparation+ and better response( na&A!@ is developed by A!"# through
consultation with BNPB(
Analy=ing "ata with A2& and na&A!@ is designed to complement the previous
unit to collect spatial data with %pen&treet'ap for scenario development for
contingency plan(
7e hope it can be useful(
Unit 2: QGIS and InaSAFE Beginner Level | 6
%ABL* !F +!N%*N%#
Disclaimer.........................................................................................................1
License..............................................................................................................1
About Us...........................................................................................................1
Preface..............................................................................................................2
GIS for Developing Contingency Plan.................................................................2
GIS an! InaSA"# in Contingency Plan..............................................................$
%&e 'asics of GIS.............................................................................................(
GIS Plugins......................................................................................................)
*ap Pro+ection 'asics.......................................................................................,
-or.ing /it& 0ector Data................................................................................11
Labels an! Classification..................................................................................11
-or.ing /it& 2aster Data................................................................................1)
Create a 3e/ 0ector Layer...............................................................................21
0ector Analysis for Problem Solving.................................................................21
Using *ap Composer......................................................................................24
Un!erstan!ing InaSA"#...................................................................................$2
Getting Support...............................................................................................$1
Unit 2: QGIS and InaSAFE Beginner Level | 7
$odule ,
'I# for De&elo"ing +ontingency Plan
Learning !b(ecti&es
B "istinguishing data and information
B ?nderstand the concept of 2&
%)e difference bet-een data and information
n the first unit+ we loo,ed at %pen&treet'ap and how to collect data and add it to the
worldwide map( But what do we mean when we say that we collect dataC s this the
same as collecting informationC 7ell+ not e>actly(
"ata is raw facts( nformation is data that is organi=ed and presented in such a way as to
be useful( n other words+ when we go mapping to collect locations and facts about those
locations+ we have collected data - we have collected facts( To turn this data into
information+ we must ma,e sense of it( 7e must present the data in such a way that it can
be easily understood(
%pen&treet'ap data is already made informative in an obvious way( The map that you
see when you visit the %&' website is there because a computer has processed all of the
%&' data and used it to paint a nice loo,ing map( The map is informative+ and useful for
us to see where places are in relation to us(
n this unit we will ta,e this even further( 7e will learn how to perform geographic data
analysis+ and thereby learn how to ma,e our data more useful+ informative+ and effective(
%erminology of 'eogra")ic Information #ystem ('I#)
A 2eographic nformation &ystem (2&) is a system designed to enable people to wor,
with data related to places on the @arth( A 2& allows the creation+ storage+ manipulation+
and analysis of geographic data( 2& is a very broad concept and can involve comple>
hardware and software( But for most people3s purposes+ a simple 2& software
application is all that is re4uired+ and in this unit we will learn how to use the e>cellent
open-source application+ A2&(
Unit 2: QGIS and InaSAFE Beginner Level | 8
2& provides different ways to analy=e data( t enables us to as, comple> 4uestions+ such
as:
B where are all schools with more than 100 students?
B how many children live in a certain district?
B How many women live within 500 meters of a certain hospital?
B What is the shortest walking path from a given point to a hospital?
2& helps us to answer these sorts of 4uestions( n the previous unit we learned how to
collect data+ and in this unit we will see how to analy=e it(

Unit 2: QGIS and InaSAFE Beginner Level | 9
$odule .
/'I# and Ina#AF* in +ontingency
Plan
Learning !b(ecti&e
B @>plain 2& to prepare contingency plan
B @>plain the important of data
B @>plain the benefit A2&.na&A!@ in the development of scenario for contingency plan
'I# for Pre"aring +ontingency Plans
2& has an important role in contingency planning( A contingency plan is intended to
support community preparedness to anticipate the arrival of a potentially ha=ardous event+
such as an earth4ua,e or tsunami( The purpose of such a plan is to minimi=e casualties
and losses in case of such an event(
Before contemplating a contingency plan+ one must first consider potential disaster
scenarios( A good plan will li,ely answer 4uestions such as:
B what sort of disaster would be likely to happen?
B how widespread will the impact be?
B who is responsible for helping?
B what can be given as aid?
B where are the priority areas?
n other words+ a contingency plan answers the 4uestion+ who does what, where and
when?
A 2eographic nformation &ystem is able to help planners answer these 4uestions+
especially the important spatial elements of contingency planning( 2& may be used to
model ha=ardous events so that they can be better predicted and reduce ris,( t may be
used to plan evacuation routes prior to a disaster( 7hen a disaster occurs+ 2& may also
play a role in the emergency response phase( t can be used to map the area affected and
Unit 2: QGIS and InaSAFE Beginner Level | !
position of refugee camps+ so that helpers can be directed to the most useful locations to
aid those affected( After a disaster+ 2& may also be used to plan for rehabilitation and
reconstruction( %verall+ 2& helps to perform analysis of a disaster+ damage and losses
caused+ and opportunities for reducing ris,(
%)e Im"ortance of Data
7e previously learned how to start collecting e>posure data( 7hen thin,ing about 2& it
is important to remember that if your data is bad+ your analysis will be bad also( $ence
the more detailed and accurate your data is+ the better your analysis and action may be
during a disaster(
As we shall see in this unit+ some data may be obtained from various agencies that
speciali=e in certain ,inds of data( !or e>ample+ we will obtain our ha=ard models
(ha=ard data) from various organi=ations that speciali=e in this( As for e>posure data+
some data we may find through agencies+ such as population data( !or ever important
infrastructure data+ collecting data at a community level is ,ey+ which is why in the
previous unit we learned how to utili=e the crowd-sourced %pen&treet'ap platform(
/'I# and Ina#AF*
A2& (A2&) is a user friendly open-source 2eographic nformation &ystem (2&)( t
runs on 7indows+ 'ac %&D+ and -inu>( A2& provides a continually growing number
of capabilities provided by core functions and plugins( *ou can visuali=e+ manage+ edit+
analy=e data+ and compose printable maps(
A2& is awesome because:
B t3s completely free( t doesn3t cost anything(
B t3s free+ as in liberty( f you thin, a feature is missing+ you can sponsor the development
of a feature+ or add it yourself if you are familiar with programming(
B t3s constantly developing and improving( Because many people continue adding
features+ it ,eeps getting better(
B @>tensive help and documentation is available( f you have problems you can always
turn to the software documentation+ other A2& users+ or even the developers(
A2& has many plugins which e>tend the core functionality of the software( %ne of
these plugins is na&A!@+ which can be used to analy=e the impact of a disaster and
create a list of actions needed to be ta,en when a disaster occurs( A2& and na&A!@
can also help to determine the location of ideal places of refuge+ evacuation routes+ areas
li,ely to be damaged+ and more(
Unit 2: QGIS and InaSAFE Beginner Level |
na&A!@ provides overviews of potential disaster scenarios+ of their outcomes+ as well as
maps which can aid decision ma,ers when disaster stri,es( 'aps are an effective way of
communicating disaster impact+ but showing in a simple way the areas of damage+ such
as the e>tent of flood-affected areas and buildings affected by a flood(
n the preface to this guide you may have followed along in our optional 4uic,start guide
to using na&A!@( f you followed the steps in this chapter+ then you have already
installed A2& and na&A!@ and seen them in action( f you haven3t+ don3t worry+ we3ll
go through the steps again in this unit(
Unit 2: QGIS and InaSAFE Beginner Level | 2
$odule 0
%)e Basics of /'I#
Learning !b(ecti&es
B "ownloading A2&
B nstall A2&
B %pen a previously created A2& pro6ect
B -oo,ing at available layer list
B Access basic tools through Etoolbar3
B )leaning the toolbar
B "isplaying a map from window map
B 2etting information from map through status bar
n this chapter+ we will get started using A2& (A2&)( *ou3ll see how to install the
software (if you haven3t already)+ understand the layout and interface+ and other core
functions of the software( By the end of this chapter+ you3ll be on your way to becoming
a competent 2& userF
Note that if you followed along with the instructions in the introduction to this guide+ you
may have already installed A2& and na&A!@( f so+ feel free to s,ip ahead to section
three in this chapter( %therwise+ let3s start here and get A2& installed(
,1 'et /'I#
2 The A2& installer is contained in the file pac,age that comes with this guide+ in
software/QGIS-OSGeo4W-2.0.-2-Setup.ee( f you have this file+ s,ip to section <(
%therwise you can download it from the A2& website(
%pen your web browser and in the address bar at the top of the window+ type 4gis(org(
Press enter(
Unit 2: QGIS and InaSAFE Beginner Level | 3
The A2& website will loo, something li,e this:
2 )lic, E"ownload NowFG
2 f you are using 7indows clic, on /'I# #tandalone Installer 3ersion .141, (0. bit)
2 f you are not using 7indows+ select your %perating &ystem from the menu(
Unit 2: QGIS and InaSAFE Beginner Level | 4
B 7hen the file is downloaded+ run it and follow the instructions to install A2&(
.1 Install /'I#
B %pen the folder where you have the A2& installation file(
B #un the installation file( f you are installing A2& version <(0(>+ it should loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 5
B )lic, Ne>t(
B )lic, H AgreeG to agree with the conditions in the license agreement(
Unit 2: QGIS and InaSAFE Beginner Level | 6
B The ne>t window as,s where you would li,e to install A2&( n most cases+ the default
should be fine( )lic, Ne>t(
B n the ne>t window+ )lic, HnstallG without chec,ing any of the bo>es(
Unit 2: QGIS and InaSAFE Beginner Level | 7
2 A2& will begin to install( t may ta,e a few minutes to complete(
2 )lic, H!inishG to complete the installation( Then your computer will automatically
reboot(
Unit 2: QGIS and InaSAFE Beginner Level | 8
2 *ou can now open A2& from your "es,top+ clic, A2& <(0(9 "es,top shortcut(
B A2& will loo, something li,e this:
01 /'I# user interface layout
n this section we will open up a A2& pro6ect+ and ta,e a loo, at the different pieces of
the A2& interface( f you installed na&A!@ previously+ ma,e sure it is closed by
clic,ing on the D in the upper right corner of the na&A!@ panel( f it isn3t open or you
haven3t installed it yet+ carry on( 7e will come bac, to this later(
B )lic, on the folder icon on the upper toolbar or go to !ile %pen Pro6ect(((
Unit 2: QGIS and InaSAFE Beginner Level | 9
B Navigate to the tutorial files and go into the !gis/ directory( %pen the file named
sle"an#2#2.!gs(
B A2& should now loo, something li,e the following image( -et3s pause for a moment
and go over the various components of the A2& interface(
$ap %an&as
This is the window where the map is shown( %ur pro6ect has two different files open+ one
which shows districts of the &leman regency+ and another that shows the railway line
running through the area( *ou can see both of these files are drawn together in the map
canvas(
'a(ers 'ist
%n the left side of A2& is the layers list( This lists the layers+ or files+ that are loaded
into our A2& pro6ect( n this pro6ect+ we have two layers+ )e*a"atan#Sle"an and
railwa(#Sle"an#OS$( The layers panel not only shows all the files that are currently
open+ it also determines the order that they will be drawn on the map canvas( A layer that
is at the bottom of the list will be drawn first+ and any layers above it will be drawn on
top(
B )lic, on the layer railwa(#Sle"an#OS$ and drag it below the layer named
)e*a"atan#Sle"an(
Unit 2: QGIS and InaSAFE Beginner Level | 2!
B Notice how the map canvas changes( The railway layer is now shown below the district
layer+ and part of the railway is now obscured( A map will never show railway hidden
beneath district areas+ so go ahead and move the layers bac,(
B ?nchec, the bo> ne>t to a layer3s name( t will be hidden from the map canvas(
B *ou can e>pand collapsed items by clic,ing the arrow or plus symbol beside them( This
will provide you with more information on the layer3s current appearance(
B #ight-clic, on a layer to view a menu with menu e>tra options( *ou3ll be using some of
them before long+ so ta,e a loo, aroundF
+ool,ars
At the top of A2& are a large number of tools+ which are contained within various
Htoolbars(G !or e>ample+ the !ile toolbar allows you to save+ load+ print+ and start a new
pro6ect( 7e already used one of these tools when we opened this pro6ect(
B By hovering your mouse over an icon+ the name of the tool will appear to help you
identify each tool(
B The number of tools (buttons) can seem a bit overwhelming at first+ but you will
gradually get to ,now them( The tools are grouped into related functions on tool,ars( f
you loo, closed you can see a vertical array of ten dots to the left of each toolbar( f you
grab these with your mouse+ you can move the toolbar to a more convenient location+ or
separate it so that it sits on its own(
Unit 2: QGIS and InaSAFE Beginner Level | 2
B f you feel overwhelmed by the number of toolbars+ you can customi=e the interface to
see only the tools you use most often+ adding or removing toolbars as necessary( To add
or remove a toolbar+ right-clic, on any of the toolbars+ or go to Iiew Toolbars(
B -et3s remove some of the toolbars that we will not be using in this training+ to ma,e the
interface a bit cleaner( #ight-clic, on the toolbar+ and unchec, the bo>es ne>t to the
following toolbars:
Unit 2: QGIS and InaSAFE Beginner Level | 22
J Advanced "igiti=ing
J "atabase
J 2#A&&
J -abel
J #aster
J Iector
B After removing these toolbars and moving them around+ your tools should loo, li,e this:
@ven if they are not visible in a toolbar+ all of your tools will remain accessible via the
menus( !or e>ample+ if you remove the !ile toolbar (which contains the &ave button)+ you
can still save your map by clic,ing on the !ile menu and then clic,ing on &ave(
Status -ar
This shows information about the current map( t allows you to ad6ust the map scale and
see the mouse cursor3s coordinates on the map(
The coordinates of this map are the same type of coordinates that you learned about when
learning about 2P& devices( The status bar show shows the longitude and latitude of
your mouse cursor(
This may not all be clear right now+ but as you progress in your ,nowledge of 2& is will
ma,e more and more sense(
51 Adding 3ector Layer
Now we will add an additional layer containing roads to our pro6ect(
B )lic, on the HAdd Iector -ayerG button on the toolbar(
B A dialog bo> will open( )lic, the HBrowseG button(
Unit 2: QGIS and InaSAFE Beginner Level | 23
B Navigate to the file !gis/Sle"an/.alan#Sle"an#OS$.shp (in the training directory)(
&elect the file and clic, %pen(
NOTE: One of the most common file formats are
shapefiles, which end with the extension .shp.
Shapefiles are often used to save geodata, and are
commonly used with GS applications li!e "GS.
B *ou should now see your new layer appear both in the map canvas and in the layers list(
t should be drawn above both the district and railway layers(
61 Basic /'I# %ools
Unit 2: QGIS and InaSAFE Beginner Level | 24
7e3ve already ta,en a loo, at the A2& toolbar and seen the tools for opening a pro6ect
and adding a new layer( $ere3s a list of some other commonly used tools( !eel free to
play around with them if you li,e( The important thing for now is to start getting familiar
with A2&(
Toggle @diting @dit features in a layer
Pan 'ap "rag the map to a new location
Koom n Koom in on the map
Koom %ut Koom out on the map
Koom !ull Koom so that all layers fit in the map window
%pen Attribute Table %pen a layer3s attribute table
&elect &ingle !eature &elect a feature in the selected layer
71 Panning $a"
B Before we e>amine the attributes of individual features+ let3s ta,e a 4uic, loo, at how to
navigate the map( The main controls for moving the map around and =ooming in and out
are by default on the panels at the top of A2&(
B 7hen you clic, on one of these buttons+ it changes what you can do with your mouse in
the main map window(
B &elect the first button that loo,s li,e a hand( Now hold your left mouse button down and
drag your mouse in the map window( This allows you to pan the map+ or move it around(
Unit 2: QGIS and InaSAFE Beginner Level | 25
B The button which has a plus sign below a magnifying glass+ allows you to =oom in on the
map( &elect this button( ?sing your mouse+ draw a bo> around an area that you want to
=oom in on+ and release your mouse(
B The button which has a minus sign below a magnifying glass+ allows you to =oom out on
the map( &elect this button and clic, on the map( This allows you to =oom out(
B The button that loo,s li,e a magnifying glass with red arrows pointing away from it lets
you =oom to the full e>tent of your map( 7hen you clic, this button+ you will be able to
see all of the data that you have loaded in your pro6ect fit into the map canvas(
Unit 2: QGIS and InaSAFE Beginner Level | 26
$odule 5
/'I# Plugins
Learning !b(ecti&es
B ?nderstand the )oncept of Plugins
B nstall A2& Plugins
B Add satellite imagery via %pen-ayers
B nstall na&A!@ Plugin
A2& has core functionality+ which we will continue to e>plore in this guide+ but it also
allows the use of additional "lugins+ which allow you to add functionality to the
software( Again+ these plugins are free( To use them+ you simply need to connect to the
internet and install( n this chapter we will learn how to install A2& plugins+ using one
plugin to add a satellite imagery layer to our A2& pro6ect(
f you have closed A2& since completing the previous chapter+ start it again and open up
the pro6ect that you saved at the end of the chapter( f you didn3t save where we left off+
don3t worry+ simply open the pro6ect named sle"an#2#/.!gs in the !gis/ folder(
Note that you must be connected to the internet to follow the e>ercises in this chapter(
,1 $anaging Plugins
To install new plugins+ ma,e sure you are connected to the internet( They first need to be
downloaded+ and then activated( &ome plugins are already downloaded and available+
and you can see them by going to Plugins 'anage and nstall Plugins(
The nstalled tab displays a list of plugins that have already been downloaded and can be
activated( To enable a plugin+ chec, the bo> ne>t to it in this menu and press )lose( !or
Unit 2: QGIS and InaSAFE Beginner Level | 27
now+ let3s leave all the plugins as they are( 7e3re going to download and activate a new
plugin in the ne>t section(
.1 Installing Plugins
There are many more plugins+ but they must first be downloaded( To download a plugin+
go to ENew3( This will load available plugin repositories+ and you will see a list of all
available plugins for download(
Unit 2: QGIS and InaSAFE Beginner Level | 28
Note that plugins which have already been downloaded can be activated or deactivated
from the HnstalledG menu( f it has not yet been downloaded+ downloading a plugin from
the HNewG menu will automatically activate it(
01 %)e !"enLayers Plugin
The %pen-ayers plugin allows you to view various web maps as a layer in A2&( This
means that you can access the %&' slippy map+ 2oogle 'aps+ and Bing maps+ from
within A2&( !ollow along and we3ll see what this means(
B 2o to Plugins 'anage and nstall PluginsL New and type HopenlayersG into the
search bo>(
Unit 2: QGIS and InaSAFE Beginner Level | 29
B &elect H%pen-ayers PluginG from the list and clic, Hnstall plugin(G
B t may ta,e a few minutes to download(
B 7hen the download finishes clic, %M(
Unit 2: QGIS and InaSAFE Beginner Level | 3!
B Now the %pen-ayers plugin is installed and activated( f you go nstalled you will see it
now in your list of active plugins( )lic, close after you finished(
B Now we have new menus options that offer e>tra functionality( 2o to Plugins
%pen-ayers plugin and you will see various options of map layers that you can load(
Unit 2: QGIS and InaSAFE Beginner Level | 3
B )lic, on HBing Aerial layer(G A new layer+ called HBing AerialG will be added to your
layers list+ and the imagery will load on your map canvas( f the layer is above your other
layers+ drag it to the bottom of the layers list(
B *our pro6ect should now loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 32
B f you pay attention+ there is something wrong with the maps( )an you guess what is itC
All three layers above Bing Aerial layers should be shown on the map( t is not shown
because of #endering %rder setting on -ayer %rder Panel( To fi> this+ go to Iiew
Panel Activate -ayer order panel
Unit 2: QGIS and InaSAFE Beginner Level | 33
B Then+ -ayer order panel will shows ne>t to -ayers panel (9)( )lic, that panel and
?nchec, )ontrol #endering %rder to fi> the problem (<)
Unit 2: QGIS and InaSAFE Beginner Level | 34
B Then bac, to -ayers panel+ and you can see the map should shows in correct order( All
layers above Bing Aerial will shows up on the map canvas li,e image below(
Unit 2: QGIS and InaSAFE Beginner Level | 35
B Adding a layer such as Bing Aerial magery will change the )oordinate #eference
&ystem+ or )#&+ of your pro6ect( @ssentially this means that your pro6ect is not using
longitude and latitude coordinates anymore( This shouldn3t affect you right now+ but it
will ma,e sense later when we cover )#&es(
f the map data does not appear to match up with the aerial imagery+ it may be due to
different )#&es( *ou can fi> this problem by going to Pro6ect Pro6ect Properties+ then
go to )#& tab and chec,ing the bo> ne>t to H@nable Eon the fly3 )#& Transformation(G
Unit 2: QGIS and InaSAFE Beginner Level | 36
B )oolF Now we can see our map data on top of an aerial photograph of the earthF Note
that this is the same imagery provided by 'icrosoft Bing that you would load for editing
in ;%&'( Try unchec,ing the bo> ne>t to the layer )e*a"atan#Sle"an so that you can
see the area better( f you =oom in close you can see detailed imagery with our streets
and railway layers displayed on top(
B #emove the Bing Aerial layer by right-clic,ing it in the layers list and selecting
H#emove(G
B Try out other layers that are available to you from the Plugins %pen-ayers plugin
menu(
Unit 2: QGIS and InaSAFE Beginner Level | 37
51 Install Ina#AF* Plugin
Now+ we are going to install na&A!@ plugin(
2o to EPlugins 'anage and install plugins3 menu
2o to the ENew3 tab and type HinasafeG on the search bo>
&elect na&A!@ and clic, Enstall plugin3 and wait for a moment until a pop-
up notification showing that plugin has installed successfully(
)lose the plugin manager window and we will learn about na&A!@ later in
'odule 9<(
$odule 6
Unit 2: QGIS and InaSAFE Beginner Level | 38
$a" Pro(ection Basics
Learning !b(ecti&es
B ?nderstand )oordinate #eference &ystems ()#&)
B dentify the )#& of a vector dataset
B "oing Hon the flyG repro6ection
B &ave dataset with a different )#&
B 'a,ing its own pro6ection
7e3ve tal,ed a little bit about )oordinate #eference &ystems ()#&s) previously+ but
haven3t covered it in depth( n this chapter+ we3ll loo, more at what a )#& means
practically+ and how it affects our wor, in A2&(
,1 +oordinate Reference #ystem (+R#)
The )#& that all the data as well as the map itself are in right now is called 72&NO( This
is a very common 2eographic )oordinate &ystem (2)&) for representing data( But
there3s a problem+ as we will see(
B %pen the pro6ect world.!gs+ located in the !gis/ folder
B Koom in to ndonesia by using the Koom n tool(
B &etting the scale in the &cale field+ which is in the &tatus Bar along the bottom of the
screen( 7hile over ndonesia+ set this value to 9:<0000000 (one to twenty million)(
B Now pan around the map while ,eeping an eye on the &cale field(
Unit 2: QGIS and InaSAFE Beginner Level | 39
Notice the scale changingC That3s because you3re moving away from the one point that
you =oomed into at 9:<0000000+ which was at the center of your screen( All around that
point+ the scale is different(
To understand why+ thin, about a globe of the @arth( t has lines running along it from
North to &outh( These longitude lines are far apart at the e4uator+ but they meet at the
poles( n a 2)&+ you3re wor,ing on this sphere+ but your screen is flat( 7hen you try to
represent the sphere of the earth on a flat surface+ it becomes distorted+ as if you too, an
orange peel and tried to flatten it( 7hat this means on a map is that the longitude lines
stay e4ually far apart from each other+ even at the poles (where they are supposed to
meet)( This means that+ as you travel away from the e4uator on your map+ the scale of the
ob6ects that you see gets larger and larger( 7hat this means for us+ practically+ is that there
is no constant scale on our mapF
To solve this+ we3ll use a Pro6ected )oordinate &ystem (P)&) instead( A P)& Hpro6ectsG
or converts the data in a way that ma,es allowance for the scale change and corrects it(
Therefore+ to ,eep the scale constant+ we should repro6ect our data to use a P)&(
Projection is the act of ta!ing coordinates on a sphere
#li!e the earth$, and manipulating them so that they can %e
displayed on a flat surface.
.1 8!n t)e Fly9 Re"ro(ection
@very A2& pro6ect has a )#&+ and each of the data layers have a )#& too( %ften these
are the same( *our pro6ect may be in 72&NO+ and the layers too( But sometimes you
will add a layer that is not in the same )#& as the pro6ect+ and you need A2& to convert
it so that it can be displayed along with the rest of the data( The term that we use for this
is repro6ecting Hon the fly(
B To enable Hon the flyG pro6ection+ clic, on the )#& &tatus button in the &tatus Bar along
the bottom of the A2& window:
B n the dialog that appears+ chec, the bo> ne>t to @nable Eon the fly3 )#& transformation(
B Type the EN&")3 into the !ilter field( %ne )#& (N&") @A&@-2rid 2lobal) will appear
in the list below(
Unit 2: QGIS and InaSAFE Beginner Level | 4!
B )lic, on it to select it+ then clic, %M(
B Notice how the shape of ndonesia changes( All pro6ections wor, by changing the
apparent shapes of ob6ects on @arth(
B Koom in to a scale of 9:<0000000 again+ as before(
B Pan around the map(
B Notice how the scale stays the sameF
H%n the flyG repro6ection is useful for combining datasets that are in different )#&es(
B "eactivate Hon the flyG repro6ection again+ by unchec,ing the bo> ne>t to @nable Eon the
fly3 )#& transformation(
B Now let3s add another vector layer+ located in !gis/peta#dunia/Indonesia.shp(
7hat do you noticeC The layer isn3t visibleF But that3s easy to fi>+ rightC
B #ight-clic, on the layer in the -ayers list(
B &elect Koom to -ayer @>tent(
Unit 2: QGIS and InaSAFE Beginner Level | 4
%M+ so now we see ndonesia((( but where is the rest of the worldC
t turns out that we can =oom between these two layers+ but we can3t ever see them at the
same time( That3s because their )oordinate #eference &ystems are so different( The
*ontinents layer is in degrees+ but the Indonesia layer is in meters( n other words+ one
feature in the continents layer might be N(: degrees away from the e4uator+ but the same
feature in the ndonesia layer might be P00000 meters away from the e4uator(
N(: degrees and P00000 meters is about the same distance+ but A2& doesn3t ,now thatF
%ne of our layers must be repro6ected to match the other layer(
To correct this:
B &witch @nable Eon the fly3 )#& transformation on again as before(
B Koom to the e>tents of the ndonesia dataset(
Now+ because they3re made to pro6ect in the same )#&+ the two datasets fit perfectly:
7hen combining data from different sources+ it3s important to remember that they might
not be in the same )#&( H%n the flyG repro6ection helps you to display them together(
01 Dataset -it) different +R#
t3s great that A2& can repro6ect layers on the fly so that we can wor, with them in the
same pro6ect( But this re4uires more time for our computer to repro6ect the layers+ and
can slow down our wor,( !or this+ or for other reasons+ we might want to be able to
repro6ect a dataset+ and save it with the new pro6ection(
Unit 2: QGIS and InaSAFE Beginner Level | 42
-et3s repro6ect the Indonesia layer so that it is in the same )#& as the pro6ect( To do this+
we will need to e>port the data to a new file using a new pro6ection(
B #ight-clic, on the Indonesia layer in the -ayers list(
B &elect &ave As((( in the menu that appears( *ou will be shown the &ave vector layer as(((
dialog(
B )lic, on the Browse button ne>t to the &ave as field(
B Navigate to !gis/peta#dunia/ and specify the name of the new layer as
Indonesia#terpro(e0si.shp(
B -eave the @ncoding unchanged(
B )hange the value of the -ayer )#& dropdown to Pro6ect )#&(
B )hec, the bo> ne>t to HAdd saved file to map(G
B The &ave vector layer as((( dialog now loo,s li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 43
B )lic, %M and after a minute+ you should be presented with a notification above map
canvas telling that the process is finished(
B Now your new layer+ Indonesia#terpro(e0si+ will be shown in the layers panel( f you
turn off Hon the flyG repro6ection+ this layer will still be shown correctly+ because it has
been repro6ected into the same )#& as the pro6ect (and the *ontinents layer)(
51 +reating :our !-n Pro(ection
There are many more pro6ections than 6ust those included in A2& by default( *ou can
even create your own pro6ections( -et3s see how this wor,s(
B &tart a new map(
B -oad the vector layer o*eans.shp located in !gis/peta#dunia/(
B 2o to &ettings )ustom )#&((( and you3ll see this dialog:
Unit 2: QGIS and InaSAFE Beginner Level | 44
B 7e will create a pro6ection ,nown as 3an der 'rinten I( This interesting pro6ection
represents the @arth on a circular field instead of a rectangular field+ as most pro6ections
do(
B @nter HIan der 2rinten G in the Name field(
B n the Parameters field+ use the following string:
+projvandg +lon!00 +"!00 +y!00 +#!$ +a%&'1000 +b%&'1000 +unitsm
+no!defs
Unit 2: QGIS and InaSAFE Beginner Level | 45
B )lic, %M(
B 2o to Pro6ect Pro6ect Properties
B @nable Hon the flyG repro6ection(
B &earch for your newly defined pro6ection by typing it into the !ilter bo>:
B *ou should see it appear in the bo> at the bottom( &elect it+ and clic, %M(
B %nce you3ve applied the new pro6ection+ the map will be repro6ected li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 46
Unit 2: QGIS and InaSAFE Beginner Level | 47
$odule 7
;or<ing -it) 3ector Data
Learning !b(ecti&es
B ?nderstand vector data
B dentify attribute of vector data
B Add vector layers
B &ymboli=e vector layers
n this chapter+ we will learn what is meant by vector data( 7e will practice adding it to
our A2& pro6ects+ and we will learn how to style the data in different ways(
,1 3ector Data
Iector data is the most common type of data found in 2&( A vector is essentially
something in the form of a dots+ or lines connecting those dots( n other words+ points+
lines+ and polygons are all &e*tors( (curved lines are vectors too+ but we won3t worry
about that for now) 7e are already 4uite familiar with vector data because in the
previous unit+ we used ;%&' to create itF
@ach ob6ect in a vector dataset is referred to as a Efeature(3 7hen we are using ;%&' we
often refer to them as ob6ects+ but in traditional 2& terminology they are features( A
polygon that represents a building is a feature+ as is a line that represents a river( @ach
feature has a geographic location+ and is attached to other data that describe the feature(
%ne important thing to note is that A2& layers can only contain one type of feature(
That is+ one layer can3t contain both point features and line features+ because they are
different types of data( $ence if you have a file that contains school polygons and
another file that contains school points+ you would add them as two separate layers(
Almost always+ polygon layers will be at the bottom of your layer list+ line layers in the
middle+ and point layers at the top( *ou don3t generally want your polygons overlapping
your lines and points(
Unit 2: QGIS and InaSAFE Beginner Level | 48
.1 Attribute Data
t3s important to ,now that the data you will be wor,ing with does not only represent
where ob6ects are in space+ but also tells you what those ob6ects are(
B %pen the pro6ect sle"an#2#1.!gs( This is the same pro6ect that you wor,ed with in
chapter /(
B )lose the na&A!@ panel if you still have it open(
B *ou can see in your pro6ect the position of &leman districts+ the railway+ and some roads+
but you can3t see all of the data contained in those layers(
B &elect .alan#Sle"an#OS$ in the layers list(
2 )lic, the H%pen Attribute TableG button:
B *ou will see a table with more data about the streets layer( This e>tra data is called
attri,ute data( The lines that you can see on your map represent where the streets go -
this is the spatial data( *ou will remember in ;%&' that there was the same division(
The points+ lines+ and shapes you drew tell us -)ere+ but the tags+ or attributes+ tell us
-)at( These definitions are commonly used in 2&+ so it3s essential to remember themF
2 Ta,e a loo, at the attribute table( @ach row in the table is associated with one feature in
the streets layer( @ach column contains one of the attributes( f you select other layers
and clic, on the H%pen Attribute TableG button+ you3ll see different tables(
2 )lose the attribute table(
Unit 2: QGIS and InaSAFE Beginner Level | 49
01 Adding 3ector Data
Shapefiles
*ou3ve already added vector data to a pro6ect once+ in the form of a shapefile( As we
mentioned previously+ a shapefile is a commonly used geographic file format( t can
easily be converted into other formats+ and most 2& software can read this type of file(
*ou may notice when adding a shapefile that there are numerous files in your shapefile
directory with the same name( This is because a shapefile actually relies on a collection
of several other files to store the data and ,eep various settings( 7hen you add a
shapefile to your pro6ect+ you should always add the one that ends in .shp+ but the rest of
the files are important tooF
B "o you remember how to add a shapefileC Try adding the layer 2OI#Sle"an#OS$+
from the shapefile located in the tutorial directory( f you don3t remember how to add a
new vector layer+ refer to the instructions in chapter <(
B *our pro6ect should loo, li,e this after the new layer has been added:
3ata,ases
&hapefiles (and other types of files) are one way to store geographic data( *ou can also
load a vector layer into A2& from a database( *ou may already be familiar with
"atabase 'anagement &ystems ("B'&) such as 'icrosoft Access( 2& applications
also ma,e use of databases to store geographic data( "atabases can be hosted and used
locally on your computer+ or could be shared between users over a networ, or even the
internet((
Unit 2: QGIS and InaSAFE Beginner Level | 5!
B -et3s try adding a layer from a database( )lic, on the following icon( f you can3t find it+
right-clic, on the toolbar and ma,e sure that the H'anage -ayersG toolbar is enabled(
B *ou will see a dialog bo>( )lic, HNew(G
B Navigate to the !gis#data/Sle"an folder and find the file guna#lahan.d,( &elect the file
and clic, H%pen(G
B Now in the original dialog bo>+ you will see that the dropdown button now contains
Hguna1lahan(db Q (((G+ followed by the path of the database file on your computer(
B )lic, H)onnect(G *ou will see the following in the bo>:
Unit 2: QGIS and InaSAFE Beginner Level | 5
B This database actually has three different layers available+ all saved in the database( )lic,
on the first layer to select it+ then hold &$!T and clic, the last layer to select them all(
B )lic, HAdd(G This will add all three layers to our pro6ect(
NOTE: &emem%er fre'uently to save your map( )our "GS
pro*ect file does not save the data #data is saved in a
shapefile or a data%ase$, %ut it does remem%er the layers
that you have added to the pro*ect, their order, and any
settings that you ad*ust.
B The layers you have 6ust added are all polygon layers+ so you will want to drag them
down below the line and point layers( f you have a chec,bo> beneath your layers list
that reads H)ontrol rendering order+G go ahead and chec, it(
B -et3s remove a couple of layers to ma,e it easier to deal with our data( #ight-clic, on the
railway and district layers and clic, H#emove(G Then order your layers li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 52
51 #ymbology
The symbology of a layer is its visual appearance on the map( %ne of the basic strengths
of 2& is that you have a dynamic visual representation of the data you3re wor,ing with(
Therefore+ the visual appearance of the map (which depends on the symbology of the
individual layers) is very important( The end user of the maps you produce will need to
be able to easily see what the map represents( @4ually as important+ you need to be able
to e>plore the data as you3re wor,ing with it+ and good symbology helps a lot(
n other words+ having proper symbology is not a lu>ury or 6ust nice to have( n fact+ it3s
essential for you to use a 2& properly and produce maps and information that people
will understand and be able to use(
51, +)anging colors
To change a layer3s symbology+ we will open its -ayer Properties( -et3s begin by
changing the color of the pe"u0i"an layer(
B #ight-clic, on the pe"u0i"an layer in the -ayers list(
B &elect the menu item Properties in the menu that appears(
Note: +y default you can also access the ,roperties menu %y
dou%le-clic!ing on the name of the layer.
B n the Properties window select the H&tyleG tab(
Unit 2: QGIS and InaSAFE Beginner Level | 53
B )lic, the color button to change the color
B A standard color dialog will appear( )hoose a grey color and clic, %M(
Unit 2: QGIS and InaSAFE Beginner Level | 54
B )lic, %M again in the -ayer Properties window+ and you will see the color change being
applied to the layer(
51. +)anging #ymbol #tructure
This is good stuff so far+ but there3s more to a layer3s symbology than 6ust its color( Ne>t
we want to change the color of the vegetation+ but we also want to eliminate the lines
between the different types of vegetation so as to ma,e the map less visually cluttered(
Unit 2: QGIS and InaSAFE Beginner Level | 55
B %pen the -ayer Properties window for the &egetasi layer( ?nder the &tyle tab+ you will
see the same ,ind of dialog as before( This time+ however+ we will do more than 6ust
change the color(
B )lic, on the &imple !ill under the symbol layer column panel( Then &ymbol layer dialog
will appear ne>t to the symbol layer column panel(
B )hange the color inside the polygons in the layer by clic,ing the button ne>t to the !ill
label:
Unit 2: QGIS and InaSAFE Beginner Level | 56
B n the dialog that appears+ choose a new color (that seems to suit vegetation)(
B )lic, %M(
B Ne>t+ we want to get rid of the lines between all the farms(
B )lic, on the Border style dropdown( At the moment+ it should be showing a short line and
the words &olid -ine(
B )hange this to No Pen(
B )lic, %M+ and then %M again( Now when we loo, at our map+ the &egetasi layer will
have a new color and no lines between polygons(
B Try changing the symbology of the pe"u0i"an layer so that it also does not have
outlines(

510 #cale-based 3isibility
&ometimes you will find that one of your layers is not suitable for a given scale( !or
e>ample+ if you have a layer which shows the earth3s continents but not with very much
Unit 2: QGIS and InaSAFE Beginner Level | 57
detail+ the continent lines may not be very accurate when you are =oomed in very far to
see streets(
Note: Scale is a reference to how your map references what
is actually on the ground in terms of si.e. Scale is
usually given in terms li!e /:/0000, which means that one
centimeter of length on your map is e'ual to /0000
centimeters in the real world. 1hen you .oom in or out on
a map, the scale changes, as you can see in the status %ar
at the %ottom of "GS.
n our case+ we may decide to hide our streets layer when we are =oomed out very far (a
small scale)( !or e>ample+ the streets layer is not very useful when we are =oomed out
far and it loo,s li,e a blob(
-et3s enable scale-based rendering:
B %pen the -ayer Properties dialog for the .alan#Sle"an#OS$ layer(
B Activate the 2eneral tab(
B @nable scale-based rendering by clic,ing on the chec,bo> labeled H&cale dependent
visibility(G Then change the value in H'a>imumG to 9:90 and H'inimumG to 9:900000
B )lic, %M(
Unit 2: QGIS and InaSAFE Beginner Level | 58
B Now loo, at your map and see what happens when you =oom in and out( The streets
layer should appear when you are at a large scale and disappear at small scales(
NOTE: )ou can use your mouse wheel to .oom in increments.
2lternatively, use the .oom tools to draw a %ox and .oom to
it:
515 Adding #ymbol Layers
Now that you ,now how to change simple symbology for layers+ the ne>t step is to create
more comple> symbology( A2& allows you to do this using symbol layers(
B 2o bac, to the &egetasi layer3s &ymbol properties dialog as before(
B n this e>ample+ the current symbol has no outline (i(e(+ it uses the No Pen border style)(
B )lic, on H!illG then clic, R button on the left(
Unit 2: QGIS and InaSAFE Beginner Level | 59
B )lic, on it and another symbol layer will be added to the list:
B Note that it may appear different in color+ but we3re going to change that anyway(
Now this layer has two different symbologies( n other words+ both the green color AN"
the blue color will be drawn( $owever+ the blue color will be drawn above the green+ and
since it is a solid color+ it will completely hide the green color( -et3s change it(
t3s important not to get confused between a map layer and a symbol layer( A map layer is
a vector (or raster) that has been loaded into the map( A symbol layer is part of the
symbol used to represent a map layer( This course will usually refer to a map layer as 6ust
a layer+ but a symbol layer will always be called a symbol layer+ to prevent confusion(
B &et the border style to No Pen+ as before(
B )hange the fill style to something other than &olid or No brush( !or e>ample:
Unit 2: QGIS and InaSAFE Beginner Level | 6!
B )lic, %M and then %M and ta,e a loo, at your layers new symbology(
B Now try it yourself( Add an additional symbology layer to the .alan#Sle"an#OS$
layer(
J 2ive the thic,ness of the original layer a value of <(0
Unit 2: QGIS and InaSAFE Beginner Level | 6
J 2ive the thic,ness of the new symbology layer a value of 9(0
B This will result in your roads loo,ing something li,e this:
B %ur streets now appear to have an outline+ but they seem dis6ointed+ as if they don3t
connect with each other( To prevent this from happening+ you can enable symbol levels+
which will control the order in which the different symbol layers are rendered(
B n the -ayer Properties dialog+ clic, on Advanced &ymbol levels:
B The &ymbol -evels dialog will appear( )hec, the bo> ne>t to H@nable symbol levels(G
B *our map will now loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 62

B 7hen you3re done+ you can save the symbol itself in A2& so that you won3t have to do
all this wor, again if you want to use the symbol again in the future( &ave your current
symbol style by clic,ing the &ave &tyle ((( button under the &tyle tab of the -ayer
Properties dialog(
B 2ive your style file a name and save( *ou can load a previously saved style at any time by
clic,ing the -oad &tyle ((( button( Before you change a style+ ,eep in mind that any
unsaved style you are replacing will be lost(
B Try to change the appearance of the streets layer again+ so that the roads are dar, gray or
blac,+ with a thin yellow outline+ and a dashed white line running in the middle(
516 +lassified #ymbology
&ymbol levels also wor, for classified layers (i(e(+ layers having multiple symbols)( 7e
will cover classification in the ne>t chapter+ but you can see how it wor,s here with roads(
By classifying various streets according to their type+ we can give them different
symbologies and they will still appear to flow into each other(
Unit 2: QGIS and InaSAFE Beginner Level | 63
517 #ymbol layer ty"es
n addition to setting fill colors and using predefined patterns+ you can use different
symbol layer types entirely( The only type we3ve been using up to now was the &imple
!ill type( The more advanced symbol layer types allow you to customi=e your symbols
even further(
@ach type of vector (point+ line and polygon) has its own set of symbol layer types( !irst
we will loo, at the types available for points(
4e*tor 2oints
B )hange the symbol properties for the 2OI#Sle"an#OS$ layer:
Unit 2: QGIS and InaSAFE Beginner Level | 64
B *ou can access the various symbol layer types by clic,ing a symbol layer (9) then
clic,ing the dropdown bo> in the upper right corner (<)
B nvestigate the various options available to you+ and choose a symbol layer type other
than the default &imple 'ar,er(
Unit 2: QGIS and InaSAFE Beginner Level | 65
B f in doubt+ use an @llipse 'ar,er(
B )hoose a white outline and dar, fill+ with a symbol width of <(00 and symbol height of
O(00(
4e*tor 'ines
B To see the various symbology options for vector lines+ open the streets layer properties
and clic, on the dropdown bo>:
Unit 2: QGIS and InaSAFE Beginner Level | 66
B )lic, on H'ar,er line(G
B )lic, &imple 'ar,er on symbol layers (9)
Unit 2: QGIS and InaSAFE Beginner Level | 67
B )hange the symbol properties to match this dialog:
Unit 2: QGIS and InaSAFE Beginner Level | 68
B Now+ clic, on H'ar,er lineG on symbol layers panel+ then change the interval to <(00:
B *our road should now loo, something li,e this:
%nce you have applied the style+ ta,e a loo, at its results on the map( f the dots not
shown up+ chec, the advanced setting and go bac, to &ymbol level( )hange the upper
symbol layer to H<G( Then clic, %M( As you can see+ these symbols change direction
along with the road but don3t always bend along with it( This is useful for some purposes+
but not for others( f you prefer+ you can change the symbol layer in 4uestion bac, to the
way it was before(
4e*tor 2ol(gons
Unit 2: QGIS and InaSAFE Beginner Level | 69
B Now let3s change the symbol layer type for the pe"u0i"an layer( Ta,e a loo, at the
dropdown menu as you3ve done for the point and line layers+ and see what the various
options can do(
B !eel free to play around with the various options( 7e will use the Point pattern fill with
the following settings:
Unit 2: QGIS and InaSAFE Beginner Level | 7!
B Add a new symbol layer with a normal &imple fill(
B 'a,e it gray with no outlines(
B 'ove it underneath the point pattern symbol layer with the 'ove down button:
B The symbol properties should loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 7
As a result+ you have a te>tured symbol for the urban layer+ with the added benefit that
you can change the si=e+ shape and distance of the individual dots that ma,e up the
te>ture(
Unit 2: QGIS and InaSAFE Beginner Level | 72
$odule =
Labels and +lassification
Learning !b(ecti&es
@>plores the attributes of data in ob6ects and e>plain the use of varying
data types
Add labels to vector layers
2ive a vector data label using classification
?p to now+ none of the changes we have made to the map have been influenced by the
ob6ects that are being shown( n other words+ every type of vegetation loo,s ali,e+ and all
the roads loo, ali,e( 7hen loo,ing at the map+ the viewers don3t ,now anything about the
roads they are seeing5 only that there is a road of a certain shape in a certain area(
But the whole strength of 2& is that all the ob6ects that are visible on the map also have
attributes( 'aps in a 2& aren3t 6ust pictures( They represent not only ob6ects in locations+
but also information about those ob6ects( n this lesson we will e>plore the attribute data
of an ob6ect and understand what the various data can be useful for(
f you would li,e to start with the e>amples used in this chapter+ begin by opening the
A2& pro6ect sle"an#2#5.!gs(
,1 Attribute Data
B %pen the attribute table for the 2OI#Sle"an#OS$ layer by selecting it in the layers list
and clic,ing on the %pen Attribute Table button (you can also right-clic, on the layer and
select %pen Attribute Table)(
B 7hich field would be the most useful to use as a labelC
Unit 2: QGIS and InaSAFE Beginner Level | 73
*ou now ,now how to use the attribute table to see what is actually in the data you3re
using( A dataset will only be useful to you if it has the attributes that you care about( f
you ,now which attributes you need+ you can 4uic,ly decide if you3re able to use a given
dataset+ or if you need to loo, for another one that has the re4uired attribute data(
"ifferent attributes are useful for different purposes( &ome of them can be represented
directly as te>t for the map user to see( Ne>t we3ll see how to use attributes as labels+ so
that users can see the te>t on your map(
.1 %)e Label %ool
-abels can be added to a map to show any information about an ob6ect( Any vector layer
can have labels associated with it( -abels rely on the attribute data of a layer for their
content(
There are several ways to add labels in A2&+ but some are better than others( *ou may
notice that when you open the -ayer Properties window for a layer+ there is a tab called
H-abels(G 7hile this tab is designed to put labels on your map+ it is not nearly as good as
the so-called H-abel Tool+G which we will learn in this section(
Before being able to access the -abel tool+ you will need to ensure that it has been
activated(
B 2o to the menu item Iiew Toolbars(
Unit 2: QGIS and InaSAFE Beginner Level | 74
B @nsure that the -abel item has a chec,mar, ne>t to it( f it doesn3t+ clic, on the -abel
item+ and it will be activated( The -abel toolbar loo,s li,e this:
B )lic, on the 2OI#Sle"an#OS$ layer in the -ayers list+ so that it is highlighted(
B )lic, on the H-abellingG button:
This gives you the -ayer labeling settings dialog(
B )hec, the bo> ne>t to -abel this layer with((((
B 7e must indicate which of the attribute fields we want to use for the labels( The NA'@
field is the mostly li,ely candidate for a label+ so let3s select NA'@ from the list:
B )lic, %M( The map should now have labels li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 75
7hat we have so far is good+ but as you can see+ the labels are overlapping the points that
they are associated with( That doesn3t loo, very nice( The te>t is also a bit larger than it
needs to be( -et3s fi> these problemsF
B %pen the -abel tool again by clic,ing on its button as before(
B )lic, on the Te>t tab button to change the te>t properties:
A standard te>t change dialog appears+ similar to those in many other
programs( )hange the font to Arial si=e P
Now clic, on Buffer tab to add buffer on the te>t( )hec, bo> labelled
H"raw te>t bufferG
Unit 2: QGIS and InaSAFE Beginner Level | 76
*our labels will now loo, li,e this:
Now you can see why we usually need label buffersF
That3s the font problem solvedF Now let3s loo, at the problem of the labels overlapping
the points(
B n the -abel tool dialog+ clic, on H"istanceG tab(
B )hange the value of -abel distance to <(
Unit 2: QGIS and InaSAFE Beginner Level | 77
B )lic, %M( The labels no longer hover over the icons+ but are HbufferedG a short distance
away:
'a,eling lines
Now that you ,now how labeling wor,s+ there3s an additional problem( Points and
polygons are easy to label+ but what about linesC f you label them the same way as the
points+ your results would loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 78
This is not very usefulF To ma,e lines behave+ we3ll need to edit some options(
B $ide the 2OI#Sle"an#OS$ layer so that it doesn3t distract you(
B Activate labels for the .alan#Sle"an#OS$ layer as before( (#emember to use the -abel
tool on the toolbar+ not the one in -abel PropertiesF)
B &et the font &i=e to P and activate the buffer so that you can see more labels(
B Koom in so that the scale is around 9:90000(
B n the -abel tool dialog3s Placement tab+ choose the following settings:
Unit 2: QGIS and InaSAFE Beginner Level | 79
The map will loo, somewhat li,e this+ depending on scale:
t3s better than before+ but still not ideal( !or starters+ some of the names appear more than
once+ and that3s not always necessary( To prevent that from happening:
B 2o to H#enderingG tab
B @nable the option 'erge connected lines to avoid duplicate labels (also under the
#endering tab - you may need to scroll down to see it)(
Another useful function is to prevent labels being drawn for features too short to be of
notice(
B &et the value of &uppress labeling of features smaller than ((( to :mm and note the results
when you clic, Apply(
B Try out different Placement settings as well (also under the Placement tab)( As we3ve
seen before+ the hori=ontal option is not a good idea in this case+ so let3s try the curved
option insteadF
B &elect the curved option under the Placement tab of the -ayer labeling settings dialog(
$ere3s the result:
Unit 2: QGIS and InaSAFE Beginner Level | 8!
As you can see+ this hides a lot of the labels that were previously visible+ because of the
difficulty of ma,ing some of them follow twisting street lines and still be legible( *ou can
decide which of these options to use+ depending on what you thin, seems more useful or
what loo,s better(
Now that you ,now how attributes can ma,e a visual difference for your map+ how about
using them to change the symbology of ob6ects themselvesC That3s the topic for the ne>t
sectionF
/. %lassifi*ation
-abels are a good way to communicate information such as the names of individual
places+ but they can3t be used for everything( !or e>ample+ let3s say that we want to show
which district each feature in our vegetation layer is in( ?sing labels+ it would loo, li,e
this:
Unit 2: QGIS and InaSAFE Beginner Level | 8
%bviously this is not ideal+ so we need another solution( That3s what this lesson is aboutF
n this section+ we will learn how to classify vector data effectively(
%lassif(ing no"inal data
B %pen -ayer Properties for the &egetasi layer(
B 2o to the &tyle tab(
B )lic, on the dropdown that says &ingle &ymbol:
B )hange it to )ategori=ed and the interface will change:
Unit 2: QGIS and InaSAFE Beginner Level | 82
B )hange the )olumn to guna>la)an and the )olor ramp to #"ectral:
B )lic, the button labeled )lassify:
Unit 2: QGIS and InaSAFE Beginner Level | 83
B )lic, %M( *ou3ll see something li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 84
B )lic, the arrow (or plus sign) ne>t to rural in the -ayer list+ you3ll see the categories
e>plained:
&o+ this is usefulF But it hurts your eyes to loo, at it+ so let3s see what we can do about
that(
B %pen -ayer Properties and go to the &tyle tab again(
B )lic, the H)hangeG button ne>t to &ymbol(
B #emove the outline as you did in the previous chapter( (change the border style to HNo
PenG)
B )lic, the "elete all button:
B Now clic, )lassify again+ and the new symbols will appear(
*ou3ll notice they don3t have outlines( This is because because you 6ust removed the
outlinesF
B )hange the color for each type of vegetation by double-clic,ing on the colored bloc, ne>t
to its name( *ou can change the color for each type of vegetation to something that you
thin, is more applicable+ as we3ve done here:
B Notice that the category on the bottom is empty( &elect it+ and clic, the "elete button(
Unit 2: QGIS and InaSAFE Beginner Level | 85
B 7hen we clic, %M our map loo,s li,e this:
f you feel confident in your new classification s,ills+ try to classify the residential layer
yourself( ?se dar,er colors to distinguish it from vegetation(
6atio *lassifi*ation
n the previous e>ample+ we classified the &egetasi layer by what is ,nown as nominal
classification( This type of classification is when categories are defined based on names(
Ne>t we will classify the pe"u0i"an layer based on the si=e of each feature(
)lassifiying with attributes that contain only positive numbers+ sych as land area+ is
,nown as ratio classification1
B %pen the attribute table for the pe"u0i"an layer( Notice the final column+ luas!ha( This
attribute contains the si=e of the land area contained within that feature polygon(
Unit 2: QGIS and InaSAFE Beginner Level | 86
B %pen the layer properties for pe"u0i"an(
B )hange the &tyle type to H2raduated+G and use luas!ha as the column(
B Because we are categori=ing with numbers this time+ a color gradient will be useful for
representing our categories( )lic, on H%rangesG in the color ramp+ and then clic,
)lassify(
Unit 2: QGIS and InaSAFE Beginner Level | 87
B Now you3ll have something li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 88
$odule ?
;or<ing -it) Raster Data
Learning !b(ecti&es
)reating #aster "ata
)hanging #aster &ymbology
"oing Terrain Analysis
Thus far we3ve wor,ed mostly with vector data+ which consists of features+ and these
features are themselves made up of points and lines( n this chapter we will learn about
raster data( #emember when you were editing %pen&treet'ap in ;%&'C The points+
lines and shapes that you drew were vector data( But when you loaded Bing aerial
imagery in the bac,ground+ that was raster data( &o what3s the differenceC
#aster data essentially comes in the form of an image( t is made up of pi>els+ li,e a
photograph+ and a raster image will always be some number of pi>els wide and some
number of pi>els high( f you =oom in far enough on a raster image+ it will start to
become blurry+ 6ust as if you opened a photo on your computer and =oomed in very close(
As we3ll see in this chapter+ however+ a raster image can mean more than 6ust a
photograph from the s,y( !ollow along and we3ll learn all about rastersF
,1 Loading Raster Data
B %pen the pro6ect named sle"an#2#7.!gs in the directory !gis/( 7e3ve simplified the
pro6ect since our last chapter+ to ma,e it easier to follow along+ and so that our layers load
a bit faster( $owever+ if you are comfortable you can easily carry on with your pro6ect
from the previous chapter(
B )lic, on the -oad #aster -ayer button:
B The -oad #aster -ayer dialog will open( !ind the file in the directory Sle"an/ named
Sle"an.tif( %pen it(
B A2& will open a dialog which e>plains that the new layers does not have a )#&
assigned( n the bo> at the bottom+ scroll down until you find ;'# ?5 @ U%$ Aone 5B#1
&elect it and clic, %M(
Unit 2: QGIS and InaSAFE Beginner Level | 89
B 7hen the raster layer loads+ be sure to drag it to the bottom of your layers list(
B f you can3t see the raster layer+ you may need to enable Hon the flyG transformations( To
do so:
B 2o to Pro6ect Pro6ect Properties(((
)lic, )#& tab+ then @nable Hon the flyG repro6ection(
B )lic, %M(
'ove Sle"an.tif layer to the bottom then the raster should display nicely underneath
your vector data layers(
Unit 2: QGIS and InaSAFE Beginner Level | 9!
.1 o- to +)ange Raster #ymbology
Not all raster data consists of aerial photographs( There are many other forms of raster
data+ and in many of those cases+ it3s essential to symboli=e the data properly so that it
becomes properly visible and useful( n this section we3ll add a new ,ind of raster and
see how to change it3s symbology(
B !irst let3s remove our previous raster image so that our pro6ect will load faster( #ight-
clic, on the Sle"an layer and clic, H#emove(G
B )lic, on the -oad #aster -ayer button:
B %pen the file named S6+$#Sle"an.tif+ which is located in Sle"an/S6+$(
B 7hen it appears in the -ayers list+ right-clic, on it and clic, H#ename(G 2ive it the name
38$(
NOTE: This dataset is a 3igital Elevation 4odel #3E4$. t5s
a map of the elevation #altitude$ of the terrain, showing
us where the mountains and valleys are. n an aerial
photograph, each pixel in the image is a color. 1hen we
view all of these different colored pixels together, they
show us something we can understand - the Earth as viewed
from a%ove. n a 3E4, each pixel has a different value
instead of color. The value of each pixel represents
elevation.
B 7hen it loads+ you3ll notice that the new raster image appears as a gray rectangle( t3s
seen here with the roads layers on top:
Unit 2: QGIS and InaSAFE Beginner Level | 9
The layer appears gray (and doesn3t give us any information) because its symbology
hasn3t been customi=ed yet( n the color aerial photograph we loaded previously+
everything is already defined( But if you load a raster image and it3s 6ust a gray rectangle+
then you ,now there3s no symbology for it yet( t still needs to be defined( &o that3s what
we will do now(
B %pen the -ayer Properties dialog for the &#T' layer+ which is now named 38$(
B &witch to the &tyle tab( This shows the current symbology settings+ and as we3ve seen+
they don3t give us much information on the layer( -et3s ma,e sure the layer has data in it(
B )hange the render map to &ingle Pseudocolor+ on 2enerate new color map column+
change into &pectral+ activate H#everseG mode+ then clic, )lassify( %ur style setting
should be li,e:
Unit 2: QGIS and InaSAFE Beginner Level | 92
B Mli, %M( The raster should loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 93
B 2oodF This tells us that there is data in this layer( And by loo,ing at it we can get an idea
of where the elevation gets higher( n the north we can see the location of 'ount 'erapi(
-et3s stop for a minute and understand what is happening here( #emember that an image
is made up of pi>els+ individual cells that contain a value+ which is usually a color value(
!or e>ample+ if you =oom in very closely on a photograph you can see those individual
pi>els+ li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 94
The value of each cell is saved in the file( magine the file being saved something li,e
this+ where each s4uare is a pi>el::
%f course the computer doesn3t understand words for colors( n fact the value of each
cell would be a number+ which the computer then associates with a certain color( !or our
aerial image+ this is already defined( &ince it is a normal image+ it ,nows to associate the
numbers for each pi>el in the file with the common colors that we see every day( But this
new raster image is different+ because the values of each pi>el don3t represent colors+ but
rather altitude+ and A2& doesn3t ,now automatically how to display it( $ence it shows
every pi>el in the image as gray+ even if the values in each pi>el are different( 7hen we
change the symbology to Psuedocolor+ we can see all the different pi>el values shown
with various colors(
Unit 2: QGIS and InaSAFE Beginner Level | 95
t would be nice to represent our "@' layer as a grayscale spectrum+ rather than a variety
of bright colors(( Ne>t we will tell A2& to symboli=e the layer with colors in a
spectrum+ beginning at the lowest pi>el value in the file and ending at the highest pi>el
value( n other words+ if the pi>el values loo,ed li,e this:
A2& would create a spectrum e4uating numbers to colors li,e this:
And render the image li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 96
B %pen -ayer Properties again(
B &witch the render type bac, to &ingleband 2ray (9)
B Tell it to use )ustom min . ma> values (<)
B ?nder )ontrast enhancement+ set the value of )urrent to H&tretch To 'in'a>G (/)
Unit 2: QGIS and InaSAFE Beginner Level | 97
But what are the minimum and ma>imum values that should be usedC The ones that are
currently under )ustom min . ma> values are the same values that 6ust gave us a gray
rectangle before( nstead+ we should be using the minimum and ma>imum pi>el values
that are actually in the image( *ou can determine those values easily by loading the
minimum and ma>imum values of the raster(
B ?nder -oad min . ma> values from band+ select @stimate (faster)(
B )lic, the -oad button:
Notice how the )ustom min . ma> values have changed( The lowest pi>el value in this
image file is 0 and the highest is about 9P:(
Unit 2: QGIS and InaSAFE Beginner Level | 98
B )lic, %M( *ou should see the values of the raster properly displayed+ with the dar,er
colors representing valleys and the lighter ones+ mountains:
Unit 2: QGIS and InaSAFE Beginner Level | 99
7e3ve learned to do this the tric,y way+ but can we do it fasterC %f courseF Now that
you understand what needs to be done+ you3ll be glad to ,now that there3s a tool for doing
all of this easily(
B #emove the current "@' from the -ayers list+ by right-clic,ing and clic,ing H#emove(G
B -oad the raster image again+ renaming it to 38$ as before( t3s will be a gray rectangle
again(
B @nable the tool you3ll need by enabling Iiew Toolbars #aster( These icons will appear
in the interface:
The button on the right will stretch the minimum and ma>imum values to give you the
best contrast in the local area that you3re =oomed into( t3s useful for large datasets( The
button on the left will stretch the minimum and ma>imum values to constant values
across the whole image(
B )lic, the button on the left (&tretch $istogram to !ull "ataset)( *ou3ll see the data is now
correctly represented as beforeF @asyF
01 %errain Analysis
)ertain types of rasters allow you to gain more insight into the terrain that they represent(
"igital @levation 'odels ("@'s) are particularly useful in this regard( n this section
we3ll do a little bit more with our "@' raster+ in order to try to e>tract even more
information from it(
/.9 %al*ulating a :illshade
The "@' you have on your map right now does show you the elevation of the terrain+
but it can sometimes seem a little abstract( t contains all the /" elevation information
about the terrain that you need+ but it doesn3t really look /-"imensional( To get a better
loo, at the terrain+ it is possible to calculate a hillshade+ which is a raster that maps the
terrain using light and shadow to create a /"-loo,ing image(
To wor, with "@'s+ you should use A2&3 all-in-one "@' (Terrain models) analysis
tool(
B )lic, on the menu item #aster Analysis "@' (Terrain models)(
Unit 2: QGIS and InaSAFE Beginner Level | !!
B n the dialog that appears+ ensure that the nput file is the "@' layer(
B &et the %utput file to hillshade.tif in the directory !gis/Sle"an/(
B )hec, the bo> ne>t to -oad into canvas when finished(
B *ou may leave all the other options unchanged(
B )lic, %M to generate the hillshade(
B 7hen it tells you that processing is completed+ clic, %M on the message to get rid of it(
B )lic, )lose on the main "@' (Terrain models) dialog(
*ou will now have a new layer called hillshade that loo,s li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | !
This loo,s more /-"imensional+ but can we improve on thisC %n its own+ the hillshade
loo,s li,e a plaster cast( t will loo, better if we can combine it with our more colorful
"@'( 7e can do this by ma,ing the hillshade layer an overlay(
/.2 ;sing a :illshade as an O&erla(
A hillshade can provide very useful information about the sunlight at a given time of day(
But it can also be used for aesthetic purposes+ to ma,e the map loo, better( The ,ey to
this is setting the hillshade to being mostly transparent(
B )hange the symbology of the original 38$ layer to use the Pseudocolor scheme(
B $ide all the layers e>cept the "@' and hillshade layers(
B )lic, and drag the "@' to be beneath the hillshade layer in the -ayers list(
Unit 2: QGIS and InaSAFE Beginner Level | !2
B )ontrol rendering order(beneath the list) should be chec,ed as well(
B Now we will ma,e the hillshade layer somewhat transparent( %pen its -ayer Properties
and go to the Transparency tab(
B &et the 2lobal transparency to :0S:
B )lic, %M on the -ayer Properties dialog( *ou3ll get a result li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | !3
B &witch the hillshade layer off and bac, on in the -ayers list to see the difference it ma,es(
?sing a hillshade in this way+ it3s possible to enhance the topography of the landscape( f
the effect doesn3t seem strong enough to you+ you can change the transparency of the
hillshade layer5 but of course+ the brighter the hillshade becomes+ the dimmer the colors
behind it will be( *ou will need to find a balance that wor,s for you(
Unit 2: QGIS and InaSAFE Beginner Level | !4
$odule B
+reate a Ne- 3ector Layer
Learning !b(ecti&es
B Add a raster layer for digiti=ing
B )reate new vector features (polygons+ lines and points)
B "igiti=e a new vector layer by tracing the raster layer+ considering topology
B 2eoreference an image
)reating a map using data that already e>ists is only the beginning( 7e have already
learned how to edit and add features to %pen&treet'ap using ;%&'( n this chapter+ we
will discuss how to edit e>isting vector layers in A2&+ and how to create an entirely new
dataset(
1. Adding raster layer
Before you can add new vector data+ you need a vector dataset (a layer) to add it to( n
our case+ we3ll begin by creating a new data layer+ and then we3ll add features to it( !irst+
we must define our dataset(
B )reate a new pro6ect in A2&+ by clic,ing on the HNew Pro6ectG icon(
B 2o to -ayer New New &hapefile -ayer( *ou3ll be presented with the following
dialog:
Unit 2: QGIS and InaSAFE Beginner Level | !5
At this point we must decide what ,ind of dataset we want to create( #emember that a
data layer can only contain features of points+ lines+ or polygons - never a mi>( &o we
must define here+ when we create the layer+ what type of data it will contain(
&ince polygons are made up of points and lines+ let3s 6ump into polygons( %nce you3ve
mastered this+ creating a point or a line layer should be easyF
B )lic, on the Polygon radio button:
B 7e3ll specify the )oordinate #eference &ystem ()#&) in the ne>t bo>( By default the
bo> will contain the )#& of the pro6ect+ which for us will be 72&NO( This is a widely
used and very useful )#&+ so let3s stic, with itF
Unit 2: QGIS and InaSAFE Beginner Level | !6
B 7hen we create our new layer+ the attribute table will only have one column by default -
id( This attribute contains a uni4ue id number for every feature( 7e can add additional
fields to the attribute table now+ when we create the layer( -et3s add a name field(
B Type HnamaG into the bo> ne>t to Name( The settings should match those shown here:
B )lic, the Add to attributes list button(
B *our attributes list should now loo, li,e this(
B )lic, %M( A save dialog will appear(
B Navigate to a directory of your choosing(
B &ave your new layer as gedung#0a"pus.shp(
The new layer should appear in your -ayers list(
.1 +reating ne- &ector feature
7hen you create new data+ it should obviously represent ob6ects that really e>ist on the
ground( 7e have already learned of numerous ways to collect data using %pen&treet'ap
tools( 7e learned about 2P& to record locations+ 7al,ing Papers+ and of course+ aerial
imagery( These are all tools that we can use to identify real-life locations and record them
in a digital data layer(
Unit 2: QGIS and InaSAFE Beginner Level | !7
n A2&+ we can use the same types of sources to get information about the ground( n
this e>ample+ we will once again turn to aerial imagery+ but instead of using Bing+ we will
use a raster image provided in the tutorial directory(
B )lic, on the Add #aster -ayer button:
B Navigate to !gis/Sle"an/(
B &elect the file ;G$.tif(
B )lic, %pen( An image will load into your map(
B !ind the new image in the -ayers list(
B )lic, and drag it to the bottom of the list so that it is below the vector layer you created in
the previous section(
B 2o to Pro6ect Pro6ect Properties((( and enable Hon the flyG transformation(
B 'a,e sure that H72& NOG is selected as the )#&+ and clic, %M(
B #ight clic, on the ;G$ layer+ and clic, HKoom to -ayer @>tent(G
B Koom in to the center of the raster image( 7e will be digiti=ing three areas:
Unit 2: QGIS and InaSAFE Beginner Level | !8
01 DigitiAing
"igiti=ing+ as you might have guessed+ is the art (or science) of creating digital vector
data from another source+ such as a raster image( n order to begin digiti=ing+ we must
first enter @dit mode( 2& software commonly re4uires a separate mode for editing+ to
prevent users from accidentally editing or deleting important data( @dit mode is switched
on or off individually for each layer(
-et3s enter edit mode for the gedung#*a"pus layer:
B &elect gedung#*a"pus in the -ayer list(
B )lic, on the Toggle @diting button:
B f you can3t find this button+ chec, that the "igiti=ing toolbar is enabled( There should be
a chec, mar, ne>t to the Iiew Toolbars "igiti=ing menu entry(
B %nce you are in edit mode+ the digiti=ing tools will become active:
Unit 2: QGIS and InaSAFE Beginner Level | !9
!rom left to right on the image above+ they are:
B %oggle *ditC activates . deactivates edit mode(
B #a&e *ditsC saves changes made to the layer(
B Add FeatureC start digiti=ing a new feature(
B $o&e Feature(s)C move an entire feature around(
B Node %oolC move only one part of a feature(
B Delete #electedC delete the selected feature (only active if a feature is selected)(
B +ut FeaturesC cut the selected feature (only active if a feature is selected)(
B +o"y FeaturesC copy the selected feature (only active if a feature is selected)(
B Paste FeaturesC paste a cut or copied feature bac, into the map (only active if a feature
has been cut or copied)(
7e want to add a new feature(
B )lic, on the Add !eature button to start digiti=ing:
B *ou3ll notice that your mouse cursor becomes a crosshair( This allows you to more
accurately place the points you3ll be digiti=ing( #emember that even as you3re using the
digiti=ing tool+ you can =oom in and out on your map by rolling the mouse wheel+ and
you can pan around by holding down the mouse wheel and dragging around in the map(
The first feature you3ll digiti=e is 2&P field:
Unit 2: QGIS and InaSAFE Beginner Level | !
B &tart by clic,ing on a point somewhere along the edge of the field(
B Place more points by clic,ing further along the edge+ until the shape you3re drawing
completely covers the field( This is very similar to drawing a polygon in ;%&'(
B To place your last point+ right-clic, where you want it to be( This will finali=e the feature
and show you the Attributes dialog(
B !ill in the values as shown here:
B )lic, %M( *ou3ve created a new featureF
#emember+ if you3ve ma,e a mista,e while digiti=ing a feature+ you can always edit it
later( &imply finish digiti=ing the feature and then follow these steps:
B &elect the feature with the &elect &ingle !eature tool:
Unit 2: QGIS and InaSAFE Beginner Level |
Then use one of these tools to edit the feature:
B the $o&e Feature(s) tool to move the entire feature+
B the Node %ool to move only one point where you may have misclic,ed+
B Delete #elected to get rid of the feature entirely so you can try again
B the *dit Undo menu item or the ctrl D A ,eyboard shortcut to undo mista,es(
Now try it on your own:
B "igiti=e the school itself and the upper field( ?se this image to assist you:
Unit 2: QGIS and InaSAFE Beginner Level | 2
B #emember that each new feature needs to have a uni4ue id valueF
7hen you are finished adding features to a layer+ you must save the changes to that layer(
B )lic, on the HToggle @ditingG button(
B *ou will be as,ed to save your edits( )lic, H&ave(G
Now you ,now how to create polygon featuresF )reating points and line layers is 6ust as
easy - you simply need to define the type of layer when you create it+ and of course you
can only create points in point layers and lines in line layers(
Unit 2: QGIS and InaSAFE Beginner Level | 3
51 'eoreferencing
n the previous section we digiti=ed a raster image+ thus creating vector data( This is
essentially the same process as when we use Bing imagery in ;%&' to add to
%pen&treet'ap( And in both of these cases+ the imagery that we use is already
georeferen*ed - that is+ it is correctly placed in its proper location(
7hen an image is georeferenced+ it is stretched in different ways so that each pi>el in the
image corresponds as closely as possible to the area it represents on the spherical @arth(
Because it is difficult to perfectly align a flat image on a round ob6ect+ there are often
small georeferencing errors+ as we learned previously with imagery offset(
7hat if you have a map that is not georeferencedC 7hat if you have a paper map given
to you by a government agencyC $ow can you digiti=e itC
The first step is to turn your paper map into a digital image that you can manipulate with
your computer( *ou can do this with a scanner (or possibly a digital camera)+ although
doing so is beyond the scope of this chapter(
51, 'eoreference an Image
Now we will learn how to georeference an image in A2& so that is correctly located on
@arth( 7e will be using a map provided in the tutorial files+ which loo,s li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 4
B &tart a new A2& pro6ect( &ave your previous wor, if you li,e(
B 2o to #aster 2eoreferencer 2eoreferencer(
B )lic, the H%pen rasterG button(
B !ind the file peta#0r,#"erapi#2002.<pg+ which is located in the the folder
!gis/Sle"an/$erapi( )lic, H%pen(G
B &elect 72& NO when prompted and clic, %M(
Unit 2: QGIS and InaSAFE Beginner Level | 5
n order to georeference this image+ we need to associate points on the image to ,nown
points on the @arth( &uch points are called ground control points (2)Ps)( -uc,ily+ this
map image has latitude and longitude coordinates written on it at every corner( &o+ to
georeference this image+ we will create four 2)Ps+ one at each corner of the map+ and we
will turn our 6peg file into a geotiff+ a georeferenced image(
B Koom in to the upper-left corner of the map by using the =oom button(
B )lic, the HAdd pointG button(
B )lic, on the very top left point of the map+ right where the top border of the map meets
the left border(
B A bo> will pop up re4uesting the > and y coordinates of the point you 6ust clic,ed(
-uc,ily+ the coordinates are written in blue on the map( The longitude (> coordinate) is
990T 9:3 00G @ and the latitude (y coordinate) is UT <P3 OUG &( 7e can enter the
Unit 2: QGIS and InaSAFE Beginner Level | 6
coordinates in the bo> as follows( Remember t)at sout) and -est coordinates -ill be
negati&e numbers(
B )lic, %M(
B *ou will see a red point appear showing the location of your control point+ and an entry in
the table at the bottom(
B #epeat this process+ creating ground control points at each of the four corners of the map(
#emember to enter the longitude and latitude that is written at each corner( 7hen you are
finished+ you should have four 2)Ps and your table will loo, li,e this:
B -astly we will ad6ust the settings and then create our output file(
B )lic, on the HTransformation settingsG button(
B Ne>t to HTransformation typeG select H-inear(G
B Provide a filename for the output raster( The file type will be .tif
B )hec, the bo> ne>t to H-oad in A2& when done(G t should loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 7
B )lic, %M(
B Then loo, at the table
B 'a,e sure the residual value is near =ero to improve accuracy(
B Now we are ready to produce the georeferenced image file( )lic, on the H&tart
georeferencingG button(
B f you are as,ed to select the layer3s coordinate system+ choose 72& NO(
Unit 2: QGIS and InaSAFE Beginner Level | 8
B 2o to &ettings Pro6ect Properties and ma,e sure that on the fly transformation is
enabled(
B The output (tif file will be created and automatically added to your pro6ect( f you hover
over the image+ you should see coordinates at the bottom of A2& which are close the the
coordinates you entered when placing the 2)Ps(
B Another way to see that the image is correctly placed is by adding a layer with the
%pen-ayers plugin( $ere we have added Bing satellite imagery+ and made our new
geotiff transparent to see 'erapi in the bac,ground(
Mnowing how to georeference is important when you want to digiti=e from a paper map
or an image that is not already georeferenced( %nce you have georeferenced an image
li,e this+ you can apply the same digiti=ation techni4ues that we learned previously in this
chapter to create vector shapefiles that can be used in A2& and na&A!@(
Unit 2: QGIS and InaSAFE Beginner Level | 9
$odule ,4
3ector Analysis for Problem #ol&ing
Learning !b(ecti&es
B @>plaining 2& processes
B dentifying problems
B @>plaining data needed
B &tarting a pro6ect
B Analy=ing problems
B dentifying ha=ard =one
B -oo,ing for mportant #oads
B -oo,ing for 'edical !acilities
B Buffering #oads
B Buffering 'edical !acilities
B Analy=ing %verlapped Areas
B )hoosing !arms and 'oors
The power of 2& is its ability to help us analy=e data( Iector data can be analy=ed to
reveal how different features interact with each other( n this chapter+ we3ll wor, through
the 2& process+ attempting to solve a problem+ and as we proceed+ we will learn about
various analysis tools that A2& provides(
,1 %)e 'I# Process
Before we start+ it would be useful to give a brief overview of a process that can be used
to solve any 2& problem( The steps are simple:
" &tate the Problem
Unit 2: QGIS and InaSAFE Beginner Level | 2!
2" 2et the "ata
3" Analy=e the Problem
4" Present the #esults
.1 %)e Problem
-et3s start off the process by deciding on a problem to solve( -et3s say you3re a disaster
manager+ and you need to provide the best locations to place refugees ("Ps) in villages
surrounding 'ount 'erapi when it erupts( *ou3ve come up with the following criteria for
these locations:
" The area should be a dry field or farm in the districts Ngempla,+ Turi or Pa,em(
2" The area must be outside of 'erapi @ruption "isaster Prone #egion (
3" Access to the site should be easy+ so it will not be more than /00 meters from a main
roads(
4" The site should be close to health facilities(
5" The land area should be between :0000-9:0000 mV(
01 %)e Data
To answer these 4uestions+ we3re going to need the following data:
" -anduse in &leman regency
2" &treets in &leman
3" -ocation of health facilities
4" M#B 'erapi ('erapi @ruption "isaster Prone #egion - this is the same data that we
learned how to georeference in the previous chapter)
!or this e>ercise the data has been provided already+ but in a real scenario you may need
to find providers for the datasets in 4uestion( n ndonesia+ the National -and Agency
and BNPB Bappeda are good sources for the types of data you will need+ and
%pen&treet'ap can be used as a source for roads and infrastructure(
51 #tart a Pro(ect
&o now that we ,now what we want to do+ let3s start doing itF
Unit 2: QGIS and InaSAFE Beginner Level | 2
B &tart a new A2& pro6ect(
B &tart adding the layers we will use( n the Sle"an/$erapi folder+ add the layers
<alan#sle"an#4=S+ te"pat#penting#Sle"an#4=S+ )6-/#4=S and &egetasi#4=S( *our
-ayers list should loo, li,e this:
NOTE: 4ost of the layers are pretty self-explanatory, %ut
what are 6&+7, 6&+8, and 6&+/9 These layers show areas of
impact when 4erapi erupts. 6&+7 is the area of worst
impact, 6&+8 is medium, and 6&+/ has little impact. n
this scenario we want to find locations that are not within
6&+7.
The data we are wor,ing with now is similar to that from previous chapters+ but now it is
in a Pro6ected )oordinate &ystem( The previous data was saved in 72&NO - this meant
that the coordinates of our features were stored in degrees+ which aren3t very good for
measuring si=e or distance( By using a pro6ected system our coordinates are in meters+
which is important for analysis+ because we can easily measure distances between and
around features(
B #ename the layers by right-clic,ing on them and selecting the #ename option(
B 2ive them the new+ simpler names <alan+ lo0asi#penting+ )6- III and &egetasi(
B &ave your map as "erapi#analisis.!gs(
B n your operating system3s file manager+ create a new folder under !gis/Sle"an/$erapi
and call it e&a0uasi#,en*ana( This is where you3ll save the datasets that we will create
during our anaysis(
Unit 2: QGIS and InaSAFE Beginner Level | 22
Now that we3ve got the data+ let3s analy=e the problemF
61 AnalyAing t)e ProblemC Farms and Dry Fields
The first criterion we3re facing is that the land must be a farm or dry field+ and it must be
in one of three areas( &o let3s tell A2& to only show us the farms and dry fields that are+
in fact+ in these sub-districtsF
B #ight-clic, on the &egetasi layer in the -ayers list(
B &elect the option !ilter This opens the Auery Builder dialog(
B &croll down in the !ields list on the left of this dialog until you see the field <ec(
B )lic, on it once(
B )lic, the All button underneath the Ialues list:
Unit 2: QGIS and InaSAFE Beginner Level | 23
7e are going to build a 4uery( A 4uery is a statement that allows us to show only the data
that we want from a layer( n this case+ we want to instruct A2& to only show us farms
and dry fields which have a sub-district value e4ual to Ngempla,+ Turi+ or Pa,em(
B "ouble-clic, the word <ec in the !ields list(
B )lic, the W button (under %perators)(
B "ouble-clic, the value Ngempla, in the Ialues list(
B )lic, H%#G(
B #epeat these steps twice more+ using the values Turi and Pa,em instead of Ngempla,(
The 4uery should loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 24
B )lic, HAN"G(
B Now highlight guna>la)an in the !ields list+ and clic, the HAllG button to load the
values(
B "ouble-clic, guna>la)an( Then clic, the W button( Then double-clic, the value
M@B?N(
B )lic, H%#G(
B #epeat the previous step but instead of M@B?N use T@2A-AN( *our 4uery should loo,
li,e this:
B The idea is that 4uery will filter the data layer so that it will only show us features that we
want - that is+ farms and dry fields in Pa,em+ Turi+ and Ngempla,( But we need to add
one thing to our 4uery: parentheses( 7ithout these+ our 4uery won3t wor, 4uite right( 7e
need to add two pair of parentheses on each side of the word AN"+ li,e so:
B )lic, %M( %ur &egetasi layer has far fewer features now(
Unit 2: QGIS and InaSAFE Beginner Level | 25
7ell doneF 7e3ve applied our first criteria to begin solving the problemF
71 %)e Danger Eone
%ur ne>t criteria is that our chosen location should be outside of the danger =one+ which
is defined by the layer )6- III( !or this we can use the &patial Auery tool(
B 2o to Iector &patial Auery &patial Auery(
B ?nder H&elect source features fromG choose H&egetasiG( n the ne>t bo> choose Hs
dis6oint(G The third bo> should be set to HM#B G( The &patial Auery window should
loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 26
B )lic, HApply(G Then clic, H)loseG once the selection has been applied(
Unit 2: QGIS and InaSAFE Beginner Level | 27
Now the &egetasi layer loo,s li,e the image below( Notice that all the features have been
selected that fall outside the )6- III area(
The ne>t steps of our analysis will be easier if we save this selection as a separate layer(
B #ight-clic, on the &egetasi layer and clic, &ave &election As((((
Unit 2: QGIS and InaSAFE Beginner Level | 28
B Ne>t to the &ave as field in the dialog that appears+ clic, the Browse button(
B &ave the layer under e&a0uasi#,en*ana/+ as 0e,un#tegalan.shp
B )hec, the Add saved file to map bo> in the &ave vector layer as((( dialog(
Unit 2: QGIS and InaSAFE Beginner Level | 29
B )lic, %M( t will tell you that @>port to vector file has been completed(
B )lic, %M(
B #ight-clic, on the old vegetation layer and remove it( *ou should have these layers
remaining:
Unit 2: QGIS and InaSAFE Beginner Level | 3!
=1 Finding Im"ortant Roads
7e have a problem with our roads layer+ similar to that of our vegetation layer( %ur roads
layer has too many roadsF 7e only want to use main roads for our analysis+ so that we
can meet the criteria that our location is within /00 meters of a ma6or road( %nce again+
we will use the Auery Builder(
B #ight-clc, on the <alan layer and clic, !ilter
B Build a 4uery for the roads layer+ li,e you did above for the vegetation layer( *ou want
only the types primary and secondary+ so you need to build this 4uery:
"TYPE" = 'primary' OR "TYPE" = 'secondary'
B *ou can use the approach that we learned above+ or you can simply type this command
into the 4uery bo>( But be careful that you type it correctlyF
?1 Loo<ing for ealt) Facilities
B ?sing the same approach+ build a 4uery for the lo0asi#penting layer as shown:
"Fungsi" = 'Kesehatan'
B1 Buffering Roads
%,ay+ we3ve refined our data a bit so that it shows us the features we are interested in
analy=ing( #emember that according to our criteria our land area should be within /00
meters of a main road and close to a health facility( A2& allows us to calculate distances
from any vector ob6ect+ and we will use this functionality to help us reach a solution(
B 'a,e sure that only the <alan and 0e,un#tegalan layers are visible+ to simplify the map
while you3re wor,ing(
Unit 2: QGIS and InaSAFE Beginner Level | 3
B 2o to Iector 2eoprocessing Tools Buffer(s)(
B n the first dropdown bo> choose H<alanG
Unit 2: QGIS and InaSAFE Beginner Level | 32
B @nter H/00G ne>t to Buffer distance(
B )hec, the bo> ne>t to H"issolve buffer results(G
B )lic, Browse and type ,uffer#<alan#/00".shp for the filename(
Note that we input the buffer distance in meters( 2ood thing we used pro6ected dataF
B )lic, %M( A2& will create a buffer around the streets that e>tends /00 meters(
B 7hen you are as,ed to add the new layer to the T%)+ clic, H*es(G (HT%)G stands for
HTable of )ontentsG+ by which it means the -ayers list)
B )lose the Buffer dialog and witness your new layer:
Unit 2: QGIS and InaSAFE Beginner Level | 33
nterestingF Those big fat lines are actually areas that are within /00 meters of primary
and secondary roads(
,41 Buffering ealt) Facilities
B Now try it yourselfF ?sing the same approach+ create a new buffer layer around your
health facilities( The buffer should be <(: ,m in radius+
B "on3t forget to chec, the bo> H"issolve buffer resultsG so every overlapping buffer will
become 9 feature( Then save the new layer in the same directory as
,uffer#fas#0esehatan#2.10".shp( *our resulting map will loo, something li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 34
IN%C #emember that the buffer distance is in meters( Meep this in mind when you
want to create a <+: ,m bufferF
,,1 !&erla""ing Areas
Now we can see areas where a main road is /00 meters away and where there is a health
facility within <(: ,m( But we only want the areas where both of these criteria are
satisfied at onceF To do that we will use the ntersect tool(
B 2o to Iector 2eoprocessing Tools ntersect(
Unit 2: QGIS and InaSAFE Beginner Level | 35
B @nter ,uffer#fas#0esehatan#2.10" and ,uffer#<alan#/00" as the two input layers(
Name the output shapefile interse*t#,uffer#<alan#0esehatan.shp(
B )lic, %M and add the layer to the -ayers list when prompted(
Unit 2: QGIS and InaSAFE Beginner Level | 36
B f we hide the original layers+ we can see that our new layers shows us the areas where
they intersect( These are the areas where both of these criteria are satisfied(
,.1 #elect Farms and Dry Fields
Now we have the layer 0e,un#tegalan+ which satisfies two of our criteria+ and the layer
interse*t#,uffer#<alan#0esehatan.shp which satisfied two other criteria( 7e need to
,now where they overlapF
B 2o to Iector #esearch Tools &elect by location( A dialog will appear(
Unit 2: QGIS and InaSAFE Beginner Level | 37
B &et it up li,e this:
B )lic, %M and you3ll see the results are slected (they are yellow)
Unit 2: QGIS and InaSAFE Beginner Level | 38
-et3s save this selection as a new layer(
B #ight-clic, on the 0e,un#tegalan layer in the -ayers list(
B &elect &ave &election As((((
B Name the new file 0e,un#tegalan#lo0asi#terpilih.shp and chec, the bo> ne>t to HAdd
saved file to map(G
Unit 2: QGIS and InaSAFE Beginner Level | 39
B f we hide all the other layers+ we can see the resulting layer:
Unit 2: QGIS and InaSAFE Beginner Level | 4!
,01 #elect Land Areas of t)e A""ro"riate #iAe
$oorayF 7e have now found land areas that meet four of our five criteria( The only
remaining criteria is the si=e of the land( 7e need to ma,e sure that our possible
locations are between :0000-9:0000 mV(
B %pen the attribute table for the 0e,un#tegalan#lo0asi#terpilih layer( *ou3ll notice that
there is a column named luas!ha( This is the si=e of the area in hectares( 7e could use
this field to answer our 4uestion+ but let3s add another column that contains the si=e of the
area in s4uare meters(
B &elect the 0e,un#tegalan#lo0asi#terpilih layer and %pen Attribute Table
B @nter editing mode by clic,ing this button:
B &tart the field calculator (located in the Attribute Table window)
Unit 2: QGIS and InaSAFE Beginner Level | 4
B )hec, the bo> ne>t to H)reate a new fieldG( n the bo> type Hluas1m<(G
B )hange %utput field type as "ecimal number (real)+ then clic, on H2eometry+G and then
double-clic, HXarea(G
B )lic, %M(
B *ou should now see a new column on your attribute table+ named luas>m.( And A2&
has filled it in for us with s4uare metersF
Unit 2: QGIS and InaSAFE Beginner Level | 42
B )lic, the edit mode button again+ and save your edits(
B )lose the attribute table( Now we can 6ust do a simple 4uery(
B #ight-clic, on the 0e,un#tegalan#lo0asi#terpilih layer and clic, !ilter
B @nter the following:
:luas;m8: <= >0000 2N3 :luas;m8: ?= />0000
B )lic, %M(
Unit 2: QGIS and InaSAFE Beginner Level | 43
That3s itF 7e have eight pieces of land that meet A-- of our criteria( Any of these pieces
of land might be suitable for a location to place refugees( Then you can right-clic,
0e,un#tegalan#terpilih layer and &ave As a new layer( 2ive the file name
refugees#lo*ation.shp
Unit 2: QGIS and InaSAFE Beginner Level | 44
$odule ,,
Using $a" +om"oser
Learning !b(ecti&es
B Arrange map layout
B Adding new map
B Add title to a map
B Add graphic and numeric scales
B Add grid to a map
B Adding inset
B )ustomi=e the content of the legend
B @>port a map to different formats (pdf+ 6peg+ svg)
*our map is a means to communicate information (as well as new ideas and you) to the
map reader( *ou use symbology to convey the contents of your data so it can be easily
understood( 7hen you create a map layout+ you go one step further - you present your
map so that it becomes a means of information(
No matter what media you plan to distribute your map by (whether it3s printed or sent
over the internet)+ you must pay attention to how you compose your map elements in the
layout( n this chapter we will discuss the presentation of printed maps+ and create our
very own(
,1 %)e $a" +om"oser
The A2& 'ap )omposer allows you layout your map and prepare it for printing( Apart
from your map+ you are able to add additional information such as images+ labels+
legends+ and scalebars(
Unit 2: QGIS and InaSAFE Beginner Level | 45
B -et3s start with some data in the &leman regency that has already been symboli=ed( %pen
the pro6ect named print#2#99.!gs in the !gis/ directory(
B This map shows some familiar layers from the previous chapter( 7e have the roads and
vegetation of &leman+ along with the three impact =ones from a 'erapi eruption model(
B -et3s see how we can use 'ap )omposer to ad6ust the layout and prepare this map for
printing(
B 2o to Pro6ect New Print )omposer( Then+ give an uni4ue title name for your layout+ for
e>ample: 'y -ayout 9( )lic, %M+ then a new window will load that loo,s li,e this:
This is the window where you can compose the layout of a map that you want to print(
The blan, white area is your Hcanvas+G or in other words+ a model of the paper you are
going to print out( *ou can put various elements onto this canvas+ such as your map
(obviously)+ a title+ scalebar+ legend+ and so on( These are elements commonly used on
printed maps(
Ta,e a loo, at the right panel( n )omposition tab+ you change paper si=e+ number of
pages+ and 4uality of output(
Unit 2: QGIS and InaSAFE Beginner Level | 46
Ta,e a loo, at the icons across the top of the window( 7e will use some of these as we
lay our map out+ so here3s an overview of what they do:
Add Ne- $a" will add a map element( This is what we will use to add the map
from our pro6ect into our print layout( t should be noted+ however+ that if we change the
map in our A2& pro6ect+ it will not update the same map that we have added to our print
composer+ as we shall see later(
Add Image allows us to add a picture( *ou can add a company or organi=ational
logo+ or simply display images from a particular location( *ou can also add an image of a
compass (to point North)(
Add Ne- Label is used for adding te>t to the layout+ such as titles or other
information(
Add Ne- Legend is for adding a legend+ which will conform to the active layer
in the A2& window(
Add Ne- #calebar is used to add a scale to the layout(
Add *lli"se@%riangle@Rectangle is used to add one of these geometric shapes(
!or e>ample+ this might be used to indicate special areas or highlight things on the map(
Unit 2: QGIS and InaSAFE Beginner Level | 47
Add Arro- is used to draw an arrow on the map layout(
#elect @ $o&e Item allows us to move choose and move the elements that you
add to the map layout( 7ith this tool selected+ you can right-clic, on an element to loc,
its position(
.1 Add Ne- $a"
B n the Print )omposer window+ clic, on the HAdd new mapG icon(
B Ne>t+ clic, and drag your mouse across the canvas+ creating a bo>( *our map layout
should loo, similar to this when you are done:
B f you are not happy with the placement of your map+ you can drag the corners to change
the si=e+ or drag the entire element around the canvas(
B %nce you are happy set the scale of your map by going to the Htem PropertiesG tab on the
right panel(
Unit 2: QGIS and InaSAFE Beginner Level | 48
B @dit the &cale and press @nter( *ou3ll see that the scale (=oom level) of the map element
changes( A scale of about <00000 should be good for this pro6ect(
B *ou also can add frame by clic,ing bo> ne>t to H!rameG( And you can configure the
frame color and border thic,ness(
B Note that when you change the scale some parts of your map may become invisible(
)lic, on the H'ove item contentG button and drag the map so that it is all visible(
01 Add a %itle
B Now we3ve got the most important thing added to our map layout - the mapF But let3s
add some additional elements to ma,e it more informative(
Unit 2: QGIS and InaSAFE Beginner Level | 49
B -et3s add a title to our map( )lic, on the HAdd new labelG button(
B Ad6ust the si=e of the element( 7e will edit the te>t and the te>t properties in the panel
on the right(
B )lic, the H!ontG button and change the te>t si=e to 9N and ma,e it bold( )hange the
aligment to center( -astly+ add the following te>t+ or create your own:
B *our map layout should now loo, similar to this:
Unit 2: QGIS and InaSAFE Beginner Level | 5!
51 Add a #cale Bar
B -et3s add a scale bar+ so that anyone who loo,s at our map will have an idea what si=e
area this map shows( )lic, on the HAdd scale barG button(
B "raw the new scalebar element on your map( A good location for it is in the lower left
corner of your map layout(
B Ne>t we need ad6ust the scalebar options( &ince our pro6ect is in a P)& (Pro6ected
)oordinate &ystem)+ our measurements are in meters( @nter the following values in the
scalebar options:
Unit 2: QGIS and InaSAFE Beginner Level | 5
B This should result in a scalebar that loo,s li,e this:
61 +reate a 'rid
B Now let3s create a grid for our map(
B )hoose the H&electG tool and clic, on the map(
B n the panel on the right you should see the word H2rid(G )lic, on it(
B )hec, the bo> ne>t to H&how gridG and enter the following values:
Unit 2: QGIS and InaSAFE Beginner Level | 52
B )hec, the bo> ne>t to H"raw )oordinatesG and enter the following values:
Unit 2: QGIS and InaSAFE Beginner Level | 53
B *our map should now have a grid appear over it+ which will loo, something li,e this:
Tips:
" Play around a little bit with coordinate format(
*ou can change the coordinate format either with "ecimal li,e we set on the
e>ample+ or you can change it into "egree 'inute format ("" '') or "egree
'inute &econd ("" '' &&)(
2" Also you can play with coordinate placement(
*ou can place inside frame or outside frame( And the orientation either vertical or
hori=ontal(
3" *ou also can change the font type and font si=e
by clic,ing !ont on the panel
71 !&er&ie- Inset
B Ne>t+ let3s add an inset that gives views of our map a little more information about what
they are loo,ing at( 'inimi=e the Print )omposer and go bac, into A2&(
B Add the layer Indonesia.shp+ which is located in !gis/peta#dunia( )llic, HKoom !ull(G
B *ou will see the new layer load(
Unit 2: QGIS and InaSAFE Beginner Level | 54
B #eturn to the 'ap )omposer and create a new map with the HAdd new mapG button(
B "raw a small bo> on the right side of your map layout(
B The current view of your A2& pro6ect will appear in the new map element (but notice
that the old map element doesn3t changeF)( Add a frame for the inset+ so it will loo, li,e
this:
=1 Add a Legend
Unit 2: QGIS and InaSAFE Beginner Level | 55
Now let3s add a legend so that viewers of our map will ,now what our symbology
represents(
B )lic, on the HAdd legendG button(
B "raw a bo> in the remaining empty space on our map layout( *ou will see a legend with
all of our symbologies shown in a list(
B n the panel on the right+ clic, on H-egend items(G ?se the edit button to change the
names on the legend( ?se the R an - buttons to add or remove items from the legend(
*ou may choose which elements are important to include(
%ur legend has been made to loo, li,e this:
Unit 2: QGIS and InaSAFE Beginner Level | 56
7hen you are finished+ your map layout should loo, similiar to this:
Unit 2: QGIS and InaSAFE Beginner Level | 57
?1 Printing t)e $a"
B -astly+ you can print your map( This part is easy+ you can simply clic, the HPrintG button
and follow the dialog(
B *ou also can save the map as PN2 image(
B Additionally you can save the map as a P"!+ which you can easily send over email or
print later when you have a chance(
Unit 2: QGIS and InaSAFE Beginner Level | 58
$odule ,.
Understanding Ina#AF*
Learning !b(ecti&es
@>plaining the concept of $a=ard+ @>posure+ and mpact data
@>plaining how to get mpact
@>plaining na&A!@3s interface
Adding ha=ard data
Adding unprocessed e>posure data (vector and raster)
?sing ,eywords editor
Analysing mpact
mproving na&A!@ %utput 'ap
&aving and Printing scenario result
,1 aAardsF *G"osures and Im"act
-et3s being by reviewing the inputs and outputs of na&A!@ - )aAard+ eG"osure+ and
im"act( These terms are important for you to remember because the analysis process
will always depend on these three things(
aAards (also called disasters) are what we call the data layers (layers) that describe the
e>tent and magnitude of natural events (such as earth4ua,es+ tsunamis+ volcanic
eruptions) that could potentially cause an event or series of events that threaten and
disrupt the lives and livelihoods of people(
2enerally+ ha=ards that we model:
B are at a particular location
B have a measured intensity
B have a measured duration
Unit 2: QGIS and InaSAFE Beginner Level | 59
B have a certain time frame
n this chapter we will use a dataset modelled from an earth4ua,e in -embang(
*G"osure data represents things that are at ris, when faced with a potential ha=ard( This
can be man-made features such as public buildings+ houses+ roads+ and bridges+ or it can
be so-called natural features+ such as population+ rice paddies+ and la,es( These e>posed
elements can be divided into various categories+ including physical elements (houses+
power lines)+ economic elements (agricultural land+ access to employment)+ social
elements (vulnerable groups+ population density)+ and environmental elements (air+ water+
plants and animals)(
Previously we ran na&A!@ with e>posure data consisting of population data from
AsiaPop+ and building data from %pen&treet'ap( n this chapter3s analysis we will once
again use %&' data(
Im"act is the result we get after na&A!@ processes the effect of the ha=ard data upon the
e>posure data( !or e>ample+ if there is an earth4ua,e model in -embang+ and we process
it against building data in Bandung+ our impact layer may show those houses that would
be severely damaged+ those somewhat damaged+ and those mildly damaged( n other
words+ what goes in to na&A!@ are ha=ards and e>posure( 7hat comes out is impact(
.1 %)e Ina#AF* Interface
Before we run any scenarios+ let3s ta,e a closer loo, at the na&A!@ interface( 'a,e sure
you3ve installed na&A!@ plugins (see 'odule O for reference if you forgot how to do it)
%pen a new pro6ect in A2&(
f the na&A!@ toolbar is not visible+ right-clic, on the toolbars and ma,e sure that
HPluginsG is chec,ed( The toolbar loo,s li,e this:
+oggle InaS>?8 3o*0
This button enables and hides the na&A!@ doc,( After enabling the doc, you are able to
move it around your screen( "oc, and undoc, it wherever you want to have it and ,eep it
even as a separated window(
Unit 2: QGIS and InaSAFE Beginner Level | 6!
InaS>?8 )e(word 8ditor
The Meyword @ditor button opens the Meyword editor which basically enables you to
easily edit the Meywords needed for na&A!@ to create useful output(
InaS>?8 Options
This button opens the %ptions window(
InaS>?8 I"pa*t ?un*tions -rowser
This button opens the mpact !unction Browser(
t basically enables you to filter and browse impact functions that are available in
na&A!@(
InaS>?8 $ini"u" @eeds +ool
This tool will calculated minimum needs for evacuated people(
InaS>?8 %on&erter
This tool will convert an earth4ua,e Esha,emap3 that is in grid >ml format to a 2eoT!!
file(
InaS>?8 -at*h 6unner
The Batch #unner lets you load saved scenarios ((ave (cenario) and batch run them in
one go(
#a&e current scenario
This is the tool you need to prepare.save scenarios for the )na($*+ ,atch #unner Tool( t
lets you save the current visible scenario in A2& to a (t>t file( This file you can open as a
scenario again in Batch runner and recalculate it(
Unit 2: QGIS and InaSAFE Beginner Level | 6
Ina#AF* !"en#treet$a" Do-nloader
This tool will fetch building (Estructure3) and roads (Ehighway3) data from the
%pen&treet'ap pro6ect for you(
B To start using na&A!@+ activate the na&A!@ panel by clic,ing on the button named
HToggle na&A!@ doc,(G
B Note that 6ust li,e A2& toolbars+ you can drag and drop the na&A!@ doc, panel to
change its position on the A2& interface( *ou can pull it away as a separate window+ or
place it below the -ayers list( t3s 4uite convenient in its location on the right side of
A2&+ so we will leave it there(
Unit 2: QGIS and InaSAFE Beginner Level | 62
The na&A!@ panel consists of three parts: Auestions+ #esults and Buttons( The
4uestions are mi>ed in with dropdown bo>es - this is where we establish our input data
and define the scenario that we want na&A!@ to process( The purpose of na&A!@ is to
ma,e your impact analysis very simple and easy to do( The Auestions section provides a
simple way for you to formulate what you want to ,now( All 4uestions are created in the
following format:
In the event of hazard! ho" many exposure! might impact!#
@or example: :n the event of an earth'ua!e how many %uildings
might %e closed9:
The other parts of the na&A!@ we have seen in action( The #esults section is filled in
with information once na&A!@ is run+ and the Buttons allow us to run a scenario+ print+
and access help(
01 Adding aAard Data
$a=ards can be represented by vector layers or by raster layers( #emember that raster
layers are li,e images with many pi>els+ and each pi>el represents some data about an
area on the ground( A raster that shows elevation+ for e>ample+ will contain pi>els with
different values based on the altitude of the location( &imilarly+ a raster that represents an
earth4ua,e will contain the magnitude of the earth4ua,e at the time of the event in every
pi>el in the raster(
An earth4ua,e can also be modelled with vector data+ although the detail of the data will
most li,ely be lower( n this case vector polygons will represent the area where the
earth4ua,e occurred+ and possibly various polygons will show areas of differing
magnitudes(
-et3s begin by adding our ha=ard layer to A2&( t3s a raster model of an earth4ua,e in
-embang(
B )lic, the HAdd #aster -ayerG button(
Unit 2: QGIS and InaSAFE Beginner Level | 63
B Navigate to the !gis/-andung folder and add 'e",ang#8arth!ua0e#S*enario.as*( This
data is raster data (in A&) format) which represents the magnitude of the earth4ua,e(
The layer will loo, li,e this:
Try to change the layer band into &ingleband Pseudocolor until the layer loo, li,e this
image below (refer to 'odul N+ if you forgot how to do itF):
Unit 2: QGIS and InaSAFE Beginner Level | 64
*ou will notice that the ha=ard dropdown bo> has been automatically filled in the
na&A!@ panel( This is because the data file has already been prepared for us with
,eyword metadata (fancy words for settings) that tells na&A!@ whether it3s a ha=ard or
e>posure layer( 7hen we add the e>posure data+ we will learn how to do inform
na&A!@ ourselves(
51 *G"osure
@>posure can also be represented by vectors or rasters( n fact we3ve already seen this in
the ;a,arta flood scenario( 7hen we ran that analysis our population layer was a raster+
with each pi>el representing the population of a given area on the @arth( %ur buildings
on the other hand+ were vectors(
-et3s add our e>posure data to A2& - once again we will be using buildings obtained
from %pen&treet'ap(
B )lic, on the HAdd Iector -ayerG button(
B Add the file -angunan#-andung.shp+ which is located in the !gis/-andung folder(
Unit 2: QGIS and InaSAFE Beginner Level | 65
B Notice that unli,e the ha=ard layer+ it does not appear automatically in na&A!@F
61 Adding Hey-ord $etadata
n order for na&A!@ to ,now that our layers are ha=ard or e>posure datasets+ we need to
assign ,eywords to the layers using the na&A!@ ,eyword tool( -et3s ta,e a loo, at the
,eywords that have already been created on the ha=ard layer(
B &elect the earth4ua,e layer in the -ayers list+ and clic, on the Hna&A!@ Meyword
@ditorG button(
B *ou can see that this layer has already been assigned some ,eyword information for
na&A!@+ including its title+ a category+ and a subcategory(
Unit 2: QGIS and InaSAFE Beginner Level | 66
B )lic, %M+ and now select the -angunan#-andung layer and open the ,eyword editor(
B *ou3ll notice that title and category are set+ but not the subcategoryF
B )hange this to Hstructure+G and then clic, %M(
B Notice that the layer now appears in the na&A!@ doc, panel(
Now clic,+ #un to calculate impact analysis and wait for a moment(
71 Im"act Analysis
Now our ha=ard and e>posure data are set in the na&A!@ panel+ because the appropriate
,eywords have been added to our layers( Note that if we were to add a second e>posure
Unit 2: QGIS and InaSAFE Beginner Level | 67
layer to our pro6ect+ we would be able to choose which e>posure layer we wanted from
the na&A!@ dropdown menu( The same applies to ha=ard layers(
The third dropdown bo> is the impact function (H'ightG)( This concludes our 4uestion+
and defines the function that na&A!@ will run behind the scenes( na&A!@ developers
have written many of these functions to analy=e all sorts of ha=ard and e>posure layers(
The function that is selected for us here will process the ha=ard and e>posure layers
spatially to determine how the e>posure layer will Hbe affected(G
B )lic, the H#unG button at the bottom to start the impact analysis( n the end of the
process+ statistic will be shown on the result panel and new layer will be added into layer
list to e>plain the result of analysis(
=1 Im"ro&e t)e Ina#AF* !ut"ut $a"
7e can improve our impact map by editing the symbology in A2&( &tyles can be
changed+ other relevant layers can be added+ and the layout can be changed using the
Print )omposer(
-et3s add Bing aerial imagery as a bac,ground for our map(
B 2o to Plugins %pen-ayers plugin Add Bing Aerial layer(
Unit 2: QGIS and InaSAFE Beginner Level | 68
B "rag the layer below your new impact layer(
?1 Using t)e Print Button
The data displayed on the screen can be saved to a P"! file by clic,ing Print at the
bottom of the na&A!@ panel(
Mli, on na&A!@ result layer+ then clic, HPrintG
A window will show up+ you can choose the e>tent that you want to be
printed(
# Analysis e>tent if you want to print all the analysis result
# )urrent e>tent if you want to print analysis result based on A2& map
canvas
*ou also can pic, the template (basic or na&A!@)( f you have A2&
composer template file ((4pt format)+ you also can use it( !or now+ let3s
choose Basic(
Unit 2: QGIS and InaSAFE Beginner Level | 69
f you want to add additional information on your layout before it will be
printed+ you can clic, H%pen )omposerG( f you want to save it in P"!
format to print it+ clic, H%pen P"!G
)hoose your save location and clic, H&aveG(
Unit 2: QGIS and InaSAFE Beginner Level | 7!
Unit 2: QGIS and InaSAFE Beginner Level | 7
B1 #a&e :our Results
*ou can save the impact layer that na&A!@ created+ and you can save the A2& pro6ect
to come bac, to it later+ but note that the na&A!@ statistics cannot be saved (e>cept when
you save them in a P"!)( To get the statistics again in A2&+ you will need to run the
analysis again(
B To save the newly generated layer+ right-clic, on it in the -ayers list(
B )lic, &ave As(((
B &elect a name and location for the file( )lic, %M(
To save the pro6ect:
B )lic, on the H&ave Pro6ectG button at the top of A2&(
B 2ive a name to the pro6ect and put it in the directory you want to save your wor,( Then
clic, &ave(

Sa&ing (our s*enario
*ou also can save your scenario using( The &ave current scenario tool lets you save
scenarios and batch run them again in the batch runner tool in one go(
Unit 2: QGIS and InaSAFE Beginner Level | 72
)na($*+ (ave current scenario tool
This is the tool you need to prepare.save scenarios for the na&A!@ Batch #unner Tool( t
lets you save the current visible scenario in A2& to a (t>t file( %nce saved you can
reopen this file as a scenario again in Batch runner and recalculate it(
Please note that this tool currently does not store the impact function parameters you may
have set( )onse4uently all impact functions will run using their default options(
6unning s*enario using -at*h +ools
)na($*+ ,atch #unner tool
7ith Batch #unner tool you can setup numerous scenarios and run them all in one go( A
typical use case may be where you define a number of e(g( flood impact scenarios all
using a standard dataset e(g( flood(shp( As new flood data becomes available you replace
flood(shp and rerun the scenarios using the batch runner( ?sing this approach you can
4uic,ly produce regional contingency plans as your understanding of ha=ards changes(
7hen you run the batch of scenarios+ pdf reports are generated automatically and all
placed in a single common directory ma,ing it easy for you to browse and disseminate
the reports produced(
$odule ,0
'etting #u""ort
Learning !b(ecti&es
B ?sing social media to ,eep the interaction alive
B Accessing A2& tutorial website
,1 Faceboo<
7ith the development of social media today+ it is great that A2& and na&A!@ users can
e>change ideas online( %ne common platform that can be used is !aceboo,( *ou can
6oin the !aceboo, group ?oru" 2engguna QGIS dan InaS>?8 Indonesia to discuss
the e>periences or difficulties you have using A2& and na&A!@(
Unit 2: QGIS and InaSAFE Beginner Level | 73
.1 /'I# %utorials
*ou can also obtain a variety of tutorials and the latest information about A2& at
http:..osgeo(ft(ugm(ac(id. address( *ou can download more training materials here(
%n this page you will also find contact information for the A2& ndonesia forum+ if you
need assistance at any time regarding the use of A2& or na&A!@( Please stop by
whenever you wantF
Unit 2: QGIS and InaSAFE Beginner Level | 74
74

Vous aimerez peut-être aussi