You are on page 1of 24

Geographic Information System Hazard Modeling Training for Improved Decision Making and

Early Warning Action of Local Government Units


13 – 24 June 2022

GIS Hazard Modeling Training for Improved Decision-Making


and Early Warning Action of Local Government Units

TRAINING MANUAL

An online public offering by the Development Academy of the Philippines –


Sustainable Human Development Program

November 14 to 25, 2022

0 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

Table of Contents

QGIS INTERFACE AND BASIC PROCESSES ....................................................... 2


QGIS GRAPHIC USER INTERFACE (GUI) ........................................................................... 2
BASIC QGIS FUNCTIONALITIES/PROCESSES .................................................................... 4
Adding/Loading Data to QGIS....................................................................................... 4
Manipulating Attribute Table of Vector Layer ................................................................. 8
Loading and Exporting Point Features from CSV tables ..................................................11
Loading and Exporting Features from KML....................................................................12
Data Conversion.........................................................................................................13

DATA SELECTION AND MAP LAYOUT .............................................................. 16


QUERYING AND SELECTING FEATURES...........................................................................16
DISPLAYING GIS THEMES AND LABELLING .....................................................................18
PRINT LAYOUT INTERFACE ............................................................................................20

1 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
13 – 24 June 2022

QGIS INTERFACE AND BASIC PROCESSES


OBJECTIVES
At the end of the exercise, the participants should be able to:
1. Familiarize the user interface of QGIS;
2. Add and explore GIS data; and
3. Utilize the GIS layer property functions.

QGIS GRAPHIC USER INTERFACE (GUI)


1. Open QGIS and explore the GUI. The panels and toolbars can be customized depending
on the preference of the user.

2. To add more panels and toolbars, right-click the open/empty space near the toolbars
and check the desired toolbars and panels.

2 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

3. To add the toolbox containing the some of the important tools and functions in QGIS, go
to Processing and select Toolbox.

3 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

BASIC QGIS FUNCTIONALITIES/PROCESSES

Adding/Loading Data to QGIS


4. Adding/loading data in QGIS can be done in two ways: (1) through the Manage Layers
Toolbar/Browser Panel or (2) the Main Menu Layer > Add layer, then select the type
of data you are going to add.

5. To add vector data (shp, kml/kmz, gpx, etc), select Add Vector Layer in the Manage
Layers Plugin. Browse the data (‘StaCruz_barangays.shp’) you are going to add, if you
have a lot of data in the folder, you can filter based on file format.

4 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

6. Use the Add Raster Layer when adding raster data (tif, jpeg, png, etc.). Browse
the data you are going to add, in this case the ‘Aster_DEM’.

5 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

7. Tabular data can also be added in QGIS. It usually comes in comma separated
values (csv) or text format. To add tabular data, use the Add Delimited Text

Layer then fill in the required fields. Add the ‘StaCruz_2015population.csv’.

Note: If your data is in MS Excel document (e.g. xlsx), you need to save it in comma separated
values (csv) format first before it can be loaded in QGIS.

6 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

8. The contents of a tabular data can be appended to a shapefile layer through the process
called Joining/Linking. This process requires fields (columns) with identical values
for both (Barangay names) the shapefile layer and the tabular data.
9. We will append the tabular data (2015 Population data) into the Santa Cruz barangays
shapefile.
10. Open the properties of the target shapefile where you intend to link the contents of
the tabular data.
11. Go to Joins and add a new Join. Fill-in required inputs.

7 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

12. To permanently store the appended columns in the shapefile, right-click the joined
shapefile then click Export > Save Feature As.

Manipulating the Attribute Table of a Vector Layer


13. Attribute table of a vector data has its own set of tools that can be used to manipulate
the columns and rows. In the attribute Table, Columns are referred as Fields and Rows
are called as Features. Each row is a representation of 1 feature in a vector file.

8 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

14. To delete fields, click toggle editing mode then select Delete Field .
15. Highlight the names of the fields you wish to delete then Click OK. Make sure to
highlight the correct field to avoid loss of data.

16. To add new field, click toggle editing mode then select New Field .

9 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

17. In the attribute table, you can use the Field Calculator to do mathematical
computations such as length and area computations.

18. In this part, we will calculate the population density (population/land area) of each
barangay in the municipality of Santa Cruz using Field Calculator.

19. Like the previous step, click the Field Calculator in the attribute table. Instead of
selecting Update existing field, select Create a new field to directly create a new
field/column through the field calculator.

10 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

20. Name the output field POPDEN with Decimal Number type, field length of 10, and field
precision of 2.
21. In the expression box, implement the formula for population density by selecting the
columns for Population and Land Area (previously generated) under the Fields and
Values. Save the Edits and Toggle off the editing session to save the computation.

Loading and Exporting Point Features from CSV tables


22. Follow the steps in adding Tabular data in QGIS. Use the Add Delimited Text Layer

to add the geographic coordinates of the evacuation centers (csv table).


23. Under the Geometry Definition, select Point Coordinates then select the columns
corresponding the X and the Y fields.
24. Set the Geometry Coordinate Reference System (CRS) to WGS 84 (EPSG:4326). The
selected CRS is based on the setting of the Global Navigation Satellite System (GNSS)
receiver.

11 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

Loading and Exporting Features from KML


25. Exported Keyhole Markup Language (KML) files from the Google Earth Pro can be added
as vector layer in QGIS. Select Layer > Add Layer > Add Vector Layer. In the file
type, select KML [Keyhole Markup Language] then add Builtup. The Builtup KML file
contains the digitized polygons from the Google Earth Pro.

12 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

26. To save the KML layer, right-click the added KML file then click Export > Save Feature
As.

Data Conversion
27. To convert vector to raster, we will use the Rasterize Tool under the main menu
Raster > Conversion > Rasterize.
28. To convert raster to vector, we will use the Vectorize Tool under the main menu
Raster > Conversion > Vectorize.

13 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

Converting Vector to Other File Formats


29. Converting vector to other file formats is very straightforward. Just right-click the
layer, go to Export > Save As, then fill in required fields.

14 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 – 25 November 2022

15 | QGIS User Interface and Basic Processes


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 - 25 November 2022

DATA SELECTION AND MAP LAYOUT


OBJECTIVES
At the end of the exercise, the participants should be able to:
4. Use the selection tools and querying selection;
5. Save selected features into new shapefiles; and
6. Familiarize with the print layout interface.

QUERYING AND SELECTING FEATURES


1. Add the LagunaBrgy shapefile from the dataset folder and into the Layers/Table of
Contents. This shapefile contains the barangay administrative boundaries of all the towns
in Laguna Province.
2. Right-click the shapefile then click “Open Attribute Table”. The attribute table
contains all descriptive information about the geometric feature. You can delete or add
new information and you can also query features using these tables.

The attribute table contains Fields (Columns) and Records (Rows).


3. In the Tools toolbar, click on the Select Features by Area to select some features on
the map. Hold left click on your mouse and drag over some towns to select them. Release
your hold once you’re done selecting. Check your attribute table, these selected features
are highlighted in yellow as well.

16 | Data Selection and Map Layout


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 - 25 November 2022

4. In the Table window, you can click the Show Selected Records icon (Lower Left) to
show only those features that are selected on the map. On the other hand, click the Show
All Features icon to show both selected and unselected features of the map. Click the
Deselect All icon to remove all selections.
5. From the Table window of feature, click on the Select features using an expression
icon and the Select by Expression Query builder window shows up. The middle pane
contains the function list where the fields and some query functions can be found.

The right-side pane shows the HELP or description for each function while the left-side pane is
where the condition/s for the selection is encoded.
6. In the Function List, drop down Fields and Values. Municipalities are listed under
NAME_2 column, hence we select it by Double-Clicking. Notice that “NAME_2” text
will appear inside the Expression Box. The Field Values window will then appear under the
Function List, click all unique. All Records under the NAME_2 field will appear.
7. To complete the expression, select the Equal (=) sign under Operators and select Santa
Cruz under the Field Values. Click Select Features. Upon making the correct expression
and clicking the Select Features, the selected areas will be highlighted. The selection will
also appear on the map area.

17 | Data Selection and Map Layout


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 - 25 November 2022

8. To save this selection as a separate layer, right-click the shapefile with the selection then
click Export > Save Selected Features As. The Save vector layer as.. window will
appear. Under the “Save As” row, click browse, name the output file, then click Save.
Leave the rest and click Ok.
9. The output shapefile can now be added using the Add Vector Layer tool. To clear the
selection made, open the Attribute Table then click Unselect All or use the Deselect All
Features from All layers icon at the Attributes Toolbar found at the top of the map
area.

DISPLAYING GIS THEMES AND LABELLING


The shapefile contains administrative boundary information from the Provincial, Municipal down
to Barangay level. The following information can be displayed in the map area using different
symbols (e.g. colors) assigned to each boundary.
1. To symbolize the shapefile according to its municipal boundaries, right-click the
shapefile under the layer/table of contents, then select Properties.
2. Select the Symbology tab on the left pane of the layer properties window.
3. In the first drop-down selection, select Categorized instead of Single Symbol.
4. The column drop-down should be NAME_2 which contain the entries for municipalities
then click Classify to populate all the unique values.
5. You may individually change the color for each municipality by clicking each symbol. To
remove unwanted entries/rows, select the delete button. Click Apply and Ok.

18 | Data Selection and Map Layout


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 - 25 November 2022

6. For the labels, add the Centroids shapefile into the Layers/Table of Contents. Right-
click the shapefile to be labelled then select Properties.
7. Select Labels on the left pane of the layer properties window.

8. Change the drop-down setting from ‘No Labels’ to Single Labels.


9. Select the column to be labeled under the ‘Label with…’. Click Apply and Ok.

19 | Data Selection and Map Layout


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 - 25 November 2022

PRINT LAYOUT INTERFACE


Maps are scaled drawings of the different physical features found on the Earth’s surface. The
print layout provides growing layout and printing capabilities. It allows you to add elements such
as the QGIS map canvas, text labels, images, legends, scale bars, basic shapes, arrows, and
attribute tables.
1. Click Project > New Print Layout. Enter a unique title that will describe the map.

2. After giving the print layout a unique title, Click OK. A blank print layout canvass will
appear.

20 | Data Selection and Map Layout


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 - 25 November 2022

3. To change the paper size and orientation, go to Layout > Page Setup. Vertical and
Horizontal Guides can also be added by selecting the Guides tab in the Properties window
at the right side.

4. The first important map element that should be added in the layout is the Map Element.
Click Add Item > Add Map tool found at the menu bar above and drag the element
towards the layout area.

5. Selecting a certain element in the layout allows you to change the item properties of that
specific element in the properties window at the right side.

21 | Data Selection and Map Layout


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 - 25 November 2022

6. Add more elements into the map layout such as Legend, Scale Bar, Meridian Arrow,
Mapped by, Data Sources, and Map Title using the Add Item menu bar or elements
toolbar on the right side. The Item properties of each element that is added into the layout
can also be modified.

7. To save the map layout as a jpeg file, click Layout > Export as Image.

22 | Data Selection and Map Layout


Geographic Information System Hazard Modeling Training for Improved Decision Making and
Early Warning Action of Local Government Units
14 - 25 November 2022

8. To save the layout project file (QGZ), click Layout > Save Project. The qgz file stores
that layout of the map but not the individual shapefiles.

23 | Data Selection and Map Layout

You might also like