29
COWASH Training QGIS 1 Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used open source GIS software. Usage is very similar to market leader ArcGIS. This guide teaches the basics of QGIS and demonstrates how to check if the collected WASH facility points are correctly positioned inside the target woreda/kebele boundaries. Training is conducted using the Amhara region’s Yilmana Densa –woreda’s database as an example. Data is originally downloaded from National WASH-inventory database (NWI M&E MIS) and it has then been prepared for GIS-use in a way which is learned in OpenOffice CALC- and Excel trainings. CONTENTS Frequently used terms ................................................................................................................................................ 2 Requirements ............................................................................................................................................................. 2 Installing QGIS ............................................................................................................................................................ 2 Preparations ............................................................................................................................................................... 3 How to organize the tools............................................................................................................................................... 3 Selecting the correct coordinate system for your project .............................................................................................. 4 Adding new vector data .................................................................................................................................................. 5 Basic operations ......................................................................................................................................................... 7 Zooming the view and moving the map ......................................................................................................................... 7 Exercise 1 .................................................................................................................................................................... 7 Attribute table ................................................................................................................................................................ 7 Creating a new shapefile from selection ........................................................................................................................ 8 Exercise 2 .................................................................................................................................................................. 10 Clipping data ................................................................................................................................................................. 11 Exercise 3 .................................................................................................................................................................. 12 Importing the Comma Separated File (CSV) to QGIS ..................................................................................................12 Finalizing the map .....................................................................................................................................................14 Changing the name of the layer.................................................................................................................................... 14 Adjusting layer’s colors ................................................................................................................................................. 14 Labelling the layer ......................................................................................................................................................... 15 Exercise 4 .................................................................................................................................................................. 15 Changing label text style ............................................................................................................................................... 16 Adjusting the symbol for the map item ........................................................................................................................ 16 Using saved styles ......................................................................................................................................................... 17 EXTRA: Classifying the road-file .................................................................................................................................18 Excercise 5 ................................................................................................................................................................ 18 Preparing the map for printing ..................................................................................................................................19 Print composer preparations ........................................................................................................................................ 19 Adding the map in print composer ............................................................................................................................... 20 Adding the scale bar and north arrow in print composer ............................................................................................ 21 Exercise 6 .................................................................................................................................................................. 21 Adding the legend in print composer ........................................................................................................................... 22 Exercise 7 .................................................................................................................................................................. 23 EXTRA 1: Installing QGIS plugins (basic knowledge on computers is needed) ............................................................24 EXTRA 2: Creating and using KML-file in Google Earth and -Maps .............................................................................26 EXTRA 3: Creating relief from digital elevation model (DEM) ....................................................................................27 EXTRA 4: Check how many points are outside woreda borders (Spatial Query) .........................................................29

COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

  • Upload
    lamdien

  • View
    234

  • Download
    1

Embed Size (px)

Citation preview

Page 1: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 1

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

QGIS GUIDE FOR WASH FACILITY DATA

COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used open source GIS software. Usage is very similar to market

leader ArcGIS. This guide teaches the basics of QGIS and demonstrates how to check if the collected WASH facility

points are correctly positioned inside the target woreda/kebele boundaries.

Training is conducted using the Amhara region’s Yilmana Densa –woreda’s database as an example. Data is originally

downloaded from National WASH-inventory database (NWI M&E MIS) and it has then been prepared for GIS-use in a

way which is learned in OpenOffice CALC- and Excel trainings.

CONTENTS

Frequently used terms ................................................................................................................................................ 2 Requirements ............................................................................................................................................................. 2 Installing QGIS ............................................................................................................................................................ 2 Preparations ............................................................................................................................................................... 3

How to organize the tools ............................................................................................................................................... 3 Selecting the correct coordinate system for your project .............................................................................................. 4 Adding new vector data .................................................................................................................................................. 5

Basic operations ......................................................................................................................................................... 7 Zooming the view and moving the map ......................................................................................................................... 7

Exercise 1 .................................................................................................................................................................... 7

Attribute table ................................................................................................................................................................ 7 Creating a new shapefile from selection ........................................................................................................................ 8

Exercise 2 .................................................................................................................................................................. 10

Clipping data ................................................................................................................................................................. 11 Exercise 3 .................................................................................................................................................................. 12

Importing the Comma Separated File (CSV) to QGIS ..................................................................................................12 Finalizing the map .....................................................................................................................................................14

Changing the name of the layer.................................................................................................................................... 14 Adjusting layer’s colors ................................................................................................................................................. 14 Labelling the layer ......................................................................................................................................................... 15

Exercise 4 .................................................................................................................................................................. 15

Changing label text style ............................................................................................................................................... 16 Adjusting the symbol for the map item ........................................................................................................................ 16 Using saved styles ......................................................................................................................................................... 17

EXTRA: Classifying the road-file .................................................................................................................................18 Excercise 5 ................................................................................................................................................................ 18

Preparing the map for printing ..................................................................................................................................19 Print composer preparations ........................................................................................................................................ 19 Adding the map in print composer ............................................................................................................................... 20 Adding the scale bar and north arrow in print composer ............................................................................................ 21

Exercise 6 .................................................................................................................................................................. 21

Adding the legend in print composer ........................................................................................................................... 22 Exercise 7 .................................................................................................................................................................. 23

EXTRA 1: Installing QGIS plugins (basic knowledge on computers is needed) ............................................................24 EXTRA 2: Creating and using KML-file in Google Earth and -Maps .............................................................................26 EXTRA 3: Creating relief from digital elevation model (DEM) ....................................................................................27 EXTRA 4: Check how many points are outside woreda borders (Spatial Query) .........................................................29

Page 2: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 2

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

FREQUENTLY USED TERMS

Vector-file Scalable, computer generated data type

Raster-file Data type for images like aerial photographs, scanned maps, satellite images etc…

Shapefile Format of saved vector file. Generally used in GIS software. Either point-, line- or polygon type.

Layer When the data is imported to GIS-software, it is referred as layer in TOC

Attribute table Layer’s information in table-format

TOC Table of Content. This is the Layers –toolset which is normally on the left side of the screen showing all the layers used on the map

REQUIREMENTS

- Minimum system requirements: Computer with Windows XP or newer, 1GB of RAM, 1.6GHz processor.

- Database-file prepared for QGIS (Instructions to do the preparations can be found in OpenOffice-trainings). There is a

test-file from Yilmana Densa for training in the Original DATA-folder.

- Shapefiles of woreda- and kebele borders. Data can be found in training package.

Important! All data is government’s property. Publishing of the maps without permission is prohibited.

INSTALLING QGIS

QGIS is an open source GIS-software which has an active developer base. With QGIS user can visualize, manage, edit

and analyze data as well as compose printable maps. Many of the tools in QGIS are similar to ones in ArcGIS so the

skills learned with QGIS can easily be transferred to ArcGIS and vice versa.

There is installation file for QGIS in QGIS Training-folder. It is either for 32 or 64 bit depending on your operating

system. You can check the amount of bits in your Windows as follows:

Computers running Windows XP

Click Start, right-click My Computer, and then click Properties. If "x64 Edition" is listed under System, you’re

running the 64-bit version of Windows XP. If you don’t see "x64 Edition" listed under System, you’re running the

32-bit version of Windows XP. The edition of Windows XP you're running is displayed under System near the top

of the window.

Computers running Windows Vista or Windows 7

Click the Start button Picture of the Start button, right-click Computer, and then click Properties. If "64-bit

Operating System" is listed next to System type, you’re running the 64-bit version of Windows Vista or Windows

7. If "32-bit Operating System" is listed next to System type, you’re running the 32-bit version of Windows Vista or

Windows 7. The edition of Windows Vista or Windows 7 you're running is displayed under Windows edition near

the top of the window.

Install the correct QGIS, by double clicking installing package. Follow the instructions. After the installation is finished

you can delete all the other new shortcuts from your desktop except “QGIS Desktop X.X.X”.

If you are creating maps, data sources has to be mentioned in the map. Data sources are:

Woreda borders, roads, towns: EMA

Kebele borders: CSA

WASH facilities: NWI, your woreda’s water office

Page 3: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 3

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

PREPARATIONS

Always save your original data separately from your work files. When you start to work, copy the needed original data

for your work. This prevents you from losing any original data in case of mistakes or errors.

There is a QGIS-Data-folder in Training-QGIS -folder. This will be the storage for all GIS-data used in training.

HOW TO ORGANIZE THE TOOLS

1. Launch QGIS by clicking QGIS Desktop -icon in your desktop. You can also find the software in Start -> All

Programs -> QGIS Version -> QGIS Desktop X.X.X

2. Click the grey area of toolset bar with your right mouse button (Image 1) and check only toolsets marked in Image

2. You can also move the toolsets freely to where you want from the toolset handle in the top- or left side of the

toolset.

Image 2. Selecting the correct toolsets for the work

Image 1. First arrow showing the gray area and second one toolset handle

Page 4: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 4

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

SELECTING THE CORRECT COORDINATE SYSTEM FOR YOUR PROJECT

Coordinates are essential part of mapping. When the data is projected in GIS-software, the program has to be told

which coordinate system the data is using. If there is wrong coordinate system used the map will not project correctly.

Ethiopian Mapping Agency (EMA) is using Adindan UTM. UTM projection is divided to different zones when major part

of Ethiopia situates to zone N37 (Image 3). Numbers (36-38 in Ethiopia) run around Earth from 1 to 60. Letters in

alphabetical order (P-N in Ethiopia) indicate the vertical distance from South Pole. GPS-device recognizes correct

zones automatically.

Select the Adindan 37 N coordinate reference system (CRS) for your map

1. From the bottom right corner of the screen click the CRS status –button (Image 4)

Image 3. UTM zones in Ethiopia

Image 4. Button for adjusting the coordinate system

Page 5: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 5

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

2. From the opening window check the Enable ‘on the fly’ CRS transformation -check box.

3. Write “Adindan” to Filter-field to find the correct CRS and select it from the “Coordinate reference systems of the

world” -section (Image 5)

ADDING NEW VECTOR DATA

Maps consists of different kinds of data which are stacked upon each other as layers. In this exercise we are adding

woreda boundaries -data to the map. This file includes the areas of all the woredas in Amhara in the 2007 (CSA).

1. Click "Add Vector Layer" -tool in your "Manage Layers"-toolset (Image 6).

2. Click "Browse" button (Image 7) and locate the "Amhara_woredas.shp" -shapefile in the QGIS DATA/Shapefiles -

folder in Training QGIS-folder.

You can also use tools from the top menu bar: Layer -> Add Vector Layer...

Latitude/longitude coordinates (degrees) can be converted to coordinates in meters. The mathematic formula is

not in the scope of this training course, but you can find converter for example from the webpage:

http://www.dmap.co.uk/ll2tm.htm

Image 5. How to select the coordinate system in CRS-menu

Image 6. Selecting the Add Vector Layer -tool from the Manage Layers –toolset

Page 6: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 6

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

Working with GIS-software often involves lots of different file types. To make it easier to find the needed files it is

good to change the folder to show only those file types which are needed.

3. From the opening window’s bottom right corner it is good to select ESRI Shapefiles (*.shp *.SHP) as a default to

help selecting only shapefiles in future.

4. Select the Amhara_woredas.shp-file (Image 8)

5. After selecting the file, click again Open-button. You will see all the woredas in Amhara according to the year

2007.

Same process is always used to add more data to the map. Raster files, like satellite images or orthophotographs

are added with Add Raster Layer –button next to Add Vector Layer –button.

Image 7. Click Browse to select the place for saving the file

Image 8. Changing the folder to show only shapefile (.shp) –types of files

Page 7: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 7

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

BASIC OPERATIONS

ZOOMING THE VIEW AND MOVING THE MAP

Zoom your map using mouse roll or Zoom In-, Zoom Out-, Zoom to Selection- and Zoom Full tools (Image 9)

Get familiar with tools in Map Navigation-toolset (Image 10). Try Zoom In -tool dragging a square around desired area

with left mouse button pressed down. Try moving the map by keeping the mouse roll pressed down. If you don’t have

mouse, use Pan Map-tool. Test also right clicking the layer’s name in TOC and selecting Zoom to Layer Extent.

You can turn the layers visible or non-visible by checking the checkbox on and off in Layers-menu (Image 11)

EXERCISE 1

Add the “Amhara_kebeles.shp” –file to the map using the same process which was used for “Amhara_woredas”-file.

ATTRIBUTE TABLE

Attribute table shows the data of the layer in table-format. For example woreda’s WASH-facility Excel-database will be

managed in GIS-software as an attribute table.

1. To find the woreda according to its name, right click the “Amhara_woredas” layer name in the Layers-menu and

from the opening menu select Open Attribute Table (Image 12). You can also use hotkeys CTRL + ENTER (or

Return).

Image 9. Different zooming-buttons

Image 10. Map Navigation –toolset with "Pan Map" –tool selected

Image 12. How to open the attribute table

Image 11. Changing the visibility of the layers between On and Off

Page 8: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 8

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

2. Click the W_NAME –attribute of the first column from the top row of the attribute table. This will sort the

woredas into alphabetical order according to their names (Image 13). You might want to click it again to make the

database in reverse alphabetical order (Yilmana Densa is at the end of the alphabet).

3. Select your woreda from the list by clicking the row-number “140” on the left (Image 13). Minimize the attribute

table and see the woreda selected on the map.

CREATING A NEW SHAPEFILE FROM SELECTION

Woreda- and kebele maps are large in size which slows down the usage of the software considerably. In this exercise

we will select only the areas what we need. This allows better usability since the amount of data what computer has

to calculate is reduced.

Check that you have “Amhara_woredas”-layer active in your Layers-menu. If you have “Amhara_kebeles”-layer in the

TOC you can make it invisible by checking the checkbox on the left side of the layers-menu.

1. Select Yilmana Densa and the surrounding woredas with Select Features by area or single click –tool (Image 14)

You can select multiple woredas by keeping Control (CTRL) –key pressed down from your keyboard (Image 15).

Image 13. Listing the woredas alphabetically and selecting one woreda

Image 14. Selecting selection tool

Image 15. Multiple woredas selected

Page 9: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 9

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

After you have selected all the surrounding woredas around your study woreda you need to save the selected area.

2. Click the title of your “Amhara_woredas” –layer in the Layers-TOC with right mouse button and from the opening

menu, select “Save As…” (Image 16)

Give a distinctive name to your new shapefile. In this exercise “woreda_selection” is used.

3. Click Browse –button (Image 17). Search the folder where you want to save your new shapefile. In training we use

QGIS-DATA-folder.

You can also draw a square around the woreda by keeping left mouse button pressed down with Select Feature(s) -

tool. Change the selection tool from the tool’s submenu by clicking the small arrow next to the tool. Try also the

other selection methods.

Image 16. Saving selected area as a new shapefile

Page 10: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 10

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

4. Remember to check the Save only selected features and Add saved file to map –checkboxes. First assures that

you are only saving the area you selected and latter automatically adds new created layer to the map. After

clicking Ok, new shapefile is created.

5. Now you can remove the original “Amhara_woredas” –layer from the map by right clicking the name of the layer

in TOC (Layers-menu) and selecting Remove.

6. Next remove the selection to be able to do new selection. Click Deselect Features from All Layers -tool which is

on the right side of the Select Single Feature –tool in toolbar (Image 14)

EXERCISE 2

Do the same process to Amhara_kebeles-layer that we did for the Amhara_woredas-layer. Select all kebeles in the

Yilmana Densa -woreda. Make sure all the kebeles inside the woreda are selected when you are creating the new

shapefile. It doesn’t matter if there are some kebeles selected also from the neighboring woredas.

Image 17. Saving selection

Remember that you can check the layers visible and non-visible with the checkbox next to layer name

(Image 11) to help making the selection (too many visible layers can be confusing)

Make sure you are making the selection to correct layer! You are selecting kebeles, not woredas now so

the respective layer needs to be active in the TOC

Page 11: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 11

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

CLIPPING DATA

To make the map more informative add the road- and town data to the map. Add first the “Eth_road.shp” -shapefile

in a same way as was done in section “Adding new vector data” (Image 6).

These files are also too large for our purposes so we will reduce the size of the files according to the area of

woreda_selection–layer. For this we don’t need to make the selection ourselves but we learn to use Clip-tool instead.

1. From the top bar, select Vector -> Geoprocessing Tools -> Clip (Image 18)

2. From the Clip-window, select first the layer which is going to be clipped (Eth_roads) as “Input vector layer”. Then

select the layer which is going to be used as a clipping area (woreda_selection) as “Clip layer”. Next select the

folder where you want to save the file by clicking Browse-button and then give a name to your new clipped road-

shapefile. In the exercise QGIS-DATA-folder and the name “Roads_clip” are used (Image 19). Be sure to check the

“Add result to canvas” checkbox which will automatically add the new layer to map.

Now when you have the clipped data of your area you can delete “Eth_roads”-layer to improve usability of the map

Image 18. Launching the Clip-tool

Image 19. Selecting settings for clipping

Page 12: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 12

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

3. Right click the “Eth_roads” layer’s name in Layers-menu -> Remove

EXERCISE 3

Add the “Towns.shp”-shapefile to the map and do the clipping in a same way that was done to “Eth_roads” using the

same woreda_selection as “Clip Layer”.

Name the new file as “Towns_clip”. After clipping, remove the original “Towns”-layer to improve usability of the map

IMPORTING THE COMMA SEPARATED FILE (CSV) TO QGIS

In this exercise the CSV-database file from Yilmana Densa –woreda is used. Database has been prepared same way as

instructed in “OpenOffice Calc-training” part “Converting the NWI M&E MIS – Excel sheet for GIS”.

1. Select Add Delimited Text Layer-tool from the Manage Layers -toolset (Image 20).

Image 20. Selecting the tool for importing the Excel-file

2. Select Browse... and search the “Yilmana Densa.csv” file from the QGIS DATA/Database -folder.

Image 21. Choosing the correct settings for importing the Excel-file

Check the settings are according to Image 21. You can rename the file if needed. In this exercise yilmana_dens is used.

Page 13: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 13

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

3. Select CSV (comma separated values) as delimiter since we chose comma when we were saving the file in

OpenOffice Calc-exercise. This option tells how the cells are differentiated from each other. When the file is saved

in Excel, Excel can separate the cells with semicolons or with commas.

4. For Geometry definition, select “GPS - X” for the X-field and “GPS - Y” for Y-field. This is crucial step. It defines

which columns are used for coordinates of the GPS-points. When everything is correct, click OK

Important! As a result, the table should look similar to one in the window on bottom of the Image 21. (Each data

are on their own cells)

After approving the settings in the opening window select the Coordinate Reference System (CRS) for the points.

5. In “Selected CRS:” select Adindan / UTM zone 37N. Then click OK

Page 14: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 14

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

FINALIZING THE MAP

It is important that all the features of the map are clearly distinguishable from each other. It is also crucial that the

most important information is easily caught by the viewer. In this section some tuning options are practiced.

CHANGING THE NAME OF THE LAYER

Right click layer’s name in Layers-menu. From the opening window, select Rename and do the desired change. This

affects only the layer’s name in the Layers-menu it doesn’t affect the actual file’s name in file folder. This is important

when finalizing the map. Layer names will be shown in the key (legend) of the map. It is also often beneficial for the

usability to have clear, easily understandable names for the layers.

ADJUSTING LAYER’S COLORS

We need to be able to see the kebele-borders under the woreda-borders. The layer which is on top in Layers-menu is

the one which is seen. Try changing the order of the layers by dragging and dropping them in the Layers-menu to see

the effect.

Make sure that woreda-layer is on top of kebele-layer before next phase.

Go to the woreda-layer’s properties.

1. Right click the layer’s name and from the opening menu, select Properties (Image 22)

2. Select Style-tab from the left-side menu (Image 23)

3. From Symbol layer type-section select Simple fill (Image 23)

Change the color of the woreda borders from the Border-section if needed. Clicking small arrow on the right

opens the dropdown menu which allows you to select the color freely with Choose color… -option

From the Fill-section’s dropdown menu, select Transparent fill-option. This will make the area inside the

borders invisible

Image 22. How to reach the properties of the layer

Page 15: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 15

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

Change the Border width to 1,0 millimeter by writing or using small arrows on the right side of the field

LABELLING THE LAYER

1. To enable the labels for the map, click the “kebele_selection”-layer in Layers-menu with right mouse-button

(Image 22) and select Properties (as in previous exercise).

2. Select Labels-page from the left-side menu. From the Labels-section (Image 24) check the Label this layer with -

checkbox. Select FIRST_RK_N-option from the drop-down menu on the right side of the Label this layer with -

text. This column includes the kebele names in the database accordingly to CSA 2007. Click Apply-button and OK.

Image 24. Selecting the correct column for the labels

EXERCISE 4

Do the labelling for “Towns_clip”-layer in a same way we did for kebele names. In the “Towns-clip” -layer there is

Name-column to use for labelling.

Image 23. Adjusting the layer's appearance

Page 16: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 16

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

CHANGING LABEL TEXT STYLE

Next we need to distinguish the town-labels from kebele-labels.

1. Go to “Towns_clip”-layer’s properties and to Labels –tab and select from lower left side menu the option Text

(Image 25). In Text style –section, change the font to Arial Black and size to 10 points.

2. After this select Buffer from the lower left side menu. From the Text buffer –section check the Draw text buffer-

checkbox. This will create white area around the text which will distinguish the text from the background (Image

26). Finally click Apply and OK.

ADJUSTING THE SYMBOL FOR THE MAP ITEM

It is important to distinguish different layers from each other on a map. For example WASH-facility -symbols needs to

be clearly distinguishable from towns. In this exercise the town-symbol is adjusted.

Image 25. Choosing the settings for town names

Image 26. Creating a glowing buffer-area around the text

Page 17: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 17

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

1. Double click “Towns_clip” -layer’s icon in Layers-menu (this is faster way to get to Properties)

2. Change the appearance of the symbol according to your needs with the options in the Style-tab (Image 27)

USING SAVED STYLES

The “Eth_roads” file includes different kinds of road types. Each type can be formatted separately as was done in

previous exercise. Styles can be also saved and used in other layers to fasten the work flow. There is already saved

style for “Eth_roads” in QGIS-DATA/Style –folder.

1. Open the properties of “roads_clip” layer by double clicking the layer’s name or right clicking the layer’s name

and from the opening menu select Properties

2. From the left side panel, go to the Style-page (Image 28) and from the bottom of the window, click Load Style…-

button and locate the “Road-style.qml” -file in QGIS-Data/Styles –folder. Double click the file to get it into use.

3. You can now see in the Style-page that the icons for each road type have been changed. Click Apply and OK -

buttons. Close the window to see the result in the map.

Image 27. Changing the appearance of the map symbol

Image 28. Loading the style for the layer

Page 18: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 18

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

EXTRA: CLASSIFYING THE ROAD-FILE

This exercise demonstrates how the “Road-style” which was used in section “Using saved styles” was done.

“roads_clip”-file consists of several different types of roads but they are all shown with the same thin line with same

color. In this section the “roads_clip”-layer is classified and symbolized accordingly to the road type.

1. Right click “roads_clip”-layer and select Properties from the opening menu. From the drop-down menu on the

top of the Style-tab, select Categorized as classification method (Image 29). Select CLASS as a Column, since in

“roads_clip”-database (attribute table) that column defines the road class. Then click Classify-button which is on

the left under the white area with the symbols.

2. Next select correct symbol for each road type from the Symbol-section. Double click the symbol for getting to

Symbol selector and create the symbol for the road accordingly to your wishes by changing width and color. You

can also select default styles from the list on the bottom right side of the Symbol selector –window (Image 30).

You can also save the style if needed.

EXCERCISE 5

Follow the instructions from previous chapter and do following exercises

A. Classify the Yilmana Densa –water point database accordingly to the type of the facility (Source type –column).

B. Select different symbol for each water point type.

C. Save your classification to QGIS-DATA/Style -folder and name it as “Waterpoint_style”

Image 29. Selecting the correct classification method

Image 30. Changing the road symbols accordingly to the road type

Page 19: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 19

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

PREPARING THE MAP FOR PRINTING

There is a design tool for map printing purposes in QGIS called Print Composer. If you are familiar with ArcGIS, print

composer can be compared to switching from Data-View to Layout-View. With Print Composer you can adjust the

layout and add north arrow, scale bar, legend etc. for your map.

PRINT COMPOSER PREPARATIONS

1. Before you start to compose your map for printing in Print Composer, position the research area carefully in your

normal map-screen in a way you would like it to be in the final map.

2. From the top menu bar, select Project -> New Print Composer

3. In the opening Composer title -window give a name to your print composer. “Yilmana Densa” -is used in the

exercise. Click OK and the Print Composer window opens.

Print composer is now automatically saved in top menu bar’s Project–menu’s Print Composers-submenu.

When different tools are used in Print Composer, the options for the tool are available in the Item properties –tab in

the menu on the right side of the screen. Initial map settings can be done in the Composition-page in the same menu

(Image 31).

4. Select A4-paper size from the Paper and quality –section’s Preset-drop down menu.

Next select the orientation accordingly to your woreda’s shape. Yilmana Densa is more wide than high so Landscape is

used. When your woreda is higher than wide, use Portrait. From the Orientation-section change the orientation if

needed (Image 31).

If you are printing the map only as softcopy you can select the size more freely. The bigger the physical size the more

details you can show in the map. When you are printing the map as hardcopy then the size depends on your printer’s

capabilities.

Image 31. Adjusting the paper settings in Print Composer

Page 20: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 20

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

ADDING THE MAP IN PRINT COMPOSER

Add your newly created woreda map to the Print Composer. First it might be a good idea to move all toolsets to the

top of the screen. You can freely move them from the toolset handle (Image 1).

1. From the Composer Items -toolset, click Add new map –tool (Image 32).

2. Next “paint” the area from the paper where you want your map to be projected. For example start from top left

corner and drag to bottom right corner with your left mouse button pressed down.

3. If you need to move the map contents use the Move item content –tool. (Image 33).

Image 32. Composer Items –toolset with Add new map –tool selected

Image 33. Move item content –tool selected

If only digital version of the map is needed you can print the map to a file in XPS-format (XML Paper Specification).

Then you can also select larger size for the map for better detail. From the Print Composer’s top menu bar, select

Composer -> Print… From the Print-window, select Microsoft XPS Document Writer and check Print to file –

checkbox. Click Apply when finished.

Page 21: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 21

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

ADDING THE SCALE BAR AND NORTH ARROW IN PRINT COMPOSER

1. Click the Add new scalebar –tool in Composer Items –toolset

2. Click a point in your map where you want the top left corner of the scale bar positioned

3. Next open the Item Properties –tab from the right side menu (Image 34)

4. Open the Units, Segments and Display –sections and adjust the settings accordingly to your wishes. In Image 34

are shown the options which were used in the exercise.

EXERCISE 6

1. Add the North Arrow by clicking the Add arrow –tool in Composer Items –toolset.

2. Click and hold left mouse button on the point in your map where you want the bottom part of the North arrow

positioned then drag straight to up from that point and release the mouse button (North is straight up in our map

files). You can then adjust the arrow from the Item properties (Image 35).

You can move the item with left mouse button when you move the cursor above it and when the cursor

changes to cross of arrows. You can scale the item from the gray boxes on the corners and sides

You can lock the layers from the left side Items-tab by checking the layer’s name on the list. Locking

prevents you accidentally moving or scaling the items

Image 34. Item Properties settings used in exercise

Page 22: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 22

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

ADDING THE LEGEND IN PRINT COMPOSER

Legend defines what the used symbols mean in the map

1. Add the legend by clicking the Add new legend –tool in Composer Items –toolset (Image 36).

2. Click a point in your map where you want the top left corner of the legend to be positioned

3. When the legend is selected open the Item Properties –tab on the menu on the right. Legend is locked as a

default. If you want to edit its content uncheck the Auto update checkbox. You can change the position of the

label on the legend list with the blue arrows by first selecting the item and then clicking the arrow up or down.

You can alter the name with pen & paper icon and delete or add items with “–“ and “+” -signs (Image 37).

Image 36. Composer Item-toolset with Add new legend -tool selected

Image 37. Adjusting the settings for the legend

Image 35. Adjusting North arrow Item properties

Page 23: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 23

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

After the settings are set you are able to print the map. Printing is done similarly as in any other office-software after

selecting from the top menu bar Composer -> Print…

Final map should look more or less similar to one in Image 38.

EXERCISE 7

Print your map as PDF-softcopy and send it to [email protected].

Image 38. Final map of Yilmana Densa -woreda's WASH facilities

Page 24: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 24

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

EXTRA 1: INSTALLING QGIS PLUGINS (BASIC KNOWLEDGE ON COMPUTERS IS NEEDED)

Since QGIS has active developer base there are lots of new tools and features available as plugins. Easiest way of

enable plugin is to do it with internet connection. There is lots of information about how to do it in the internet. You

can get online help for example from sites: http://www.qgistutorials.com/en/docs/using_plugins.html or

http://www.qgisworkshop.org/html/workshop/python_in_qgis_tutorial1.html

In this chapter we assume that there is no internet connection available so we install the “xytools”-plugin manually.

Xytools-plugin enables the usage of Excel-files with QGIS. It is originally downloaded from the website:

https://plugins.qgis.org/plugins/xytools/ . After downloading it was unzipped (right clicked and selected Extract All…).

1. Copy the unzipped “xytools”-folder from Training package/Software/QGIS/Plugins/xytools. Note that there is

also manual for the usage of the plugin. To see the guide open xytools/docs/index.html.

2. Go to folder C:\Users\YOUR USERNAME HERE\.qgis2\python\plugins\ (in Windows XP there is “Documents

and settings-folder in between) and paste the xytools-folder there. If there is no such path available. You

need to create the “python” and “plugins” –folders first yourself. Check correct writing!

Plugin still needs to be activated before it can be used.

3. Restart QGIS

4. From the top toolbar open Plugins -> Manage and Install Plugins… (Image 39)

Next QGIS tries to connect to plugin-server which is the easiest way of installing plugins. In this exercise it is assumed

that the computer does not have internet connection so click Abort fetching –button to skip connection attempt.

5. From the opening list of plugins check the one which is being installed. In this exercise it is XyTools (Image 40)

Image 39. Opening the plugin-manager

Image 40. Activating the installed plugin

Page 25: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 25

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

You can now found the XY tools-tool from top toolbar’s Vector-menu or as a last icon in the Digitizing-toolbar (Image

41). If you don’t remember how to manage toolbars, check from the chapter “How to organize the tools” how it was

done.

After installing XY tools-plugin you can import Excel-files (.xsl) to QGIS without need to change them first to CSV-files.

Try bringing the Yilmana Densa.xls –file to QGIS (NOTE: Excel-file can only include one sheet when using XY tools!)

From the top toolbar open Vector -> XY tools -> Open Excel file as attribute table or Point layer (Image 42).

Locate the Excel-sheet in Training-QGIS / QGIS DATA / Yilmana Densa.xls. Next select correct coordinate system

(Adindan / UTM zone 37N). In the following ZYTools – Coordinate fields –window select correct columns for the axels

(X: = GPS X, Y: = GPS Y). When the volatile file is in TOC save it as a shapefile as was done in Image 16.

Image 41. Icon of the XY tools-plugin in the Digitizing-toolset

Image 42. Opening the Excel-file with XY tools

Page 26: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 26

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

EXTRA 2: CREATING AND USING KML-FILE IN GOOGLE EARTH AND -MAPS

KML-files are generally used in Google’s mapping environments such as Google Maps and Google Earth. In this section

we prepare a file that can be easily used in Google Earth.

1. Right click your woreda’s WASH-facility layer in TOC and from the opening menu select Save As …

2. From the Save vector layer as… -window select first the place where you want to create your file with

Browse-button and give it a name. Next change the file format to KML (Keyhole Markup Language –file,

generally used in online mapping) from Format-section select Keyhole Markup Language [KML] (Image 43).

3. Remember to change the coordinate reference system to WGS 84 which is generally used in Google Earth.

From the CRS-section click the Change-button and find and select WGS 84 (If you don’t remember how it was

done, you can check the process from the section “SELECTING THE CORRECT COORDINATE SYSTEM FOR

YOUR PROJECT”).

You can also uncheck Add saved file to map –option this time since there is no need to show the same data again on

the map.

Usage of the KML-file in Google Earth is easy. Launch Google Earth and now you can just drag the KML-file from your

file folder to the main screen of the Google Earth. By double clicking the water point icons you can see the data of

them.

You can also use the KML-file in Google Maps. You have to log in to Google Maps so that you can start My Maps –

editing mode. Click Add layer –text and from new layer click Import-text (Image 44). Then new windows open where

you can drag the KML-file from your file folder. After this all facilities are on Google Map.

Image 43. Creating a KML-file

Image 44. Add layer- and Import-buttons in Google Maps

Page 27: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 27

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

EXTRA 3: CREATING RELIEF FROM DIGITAL ELEVATION MODEL (DEM)

Since Ethiopia has huge areal differences in elevation, it is often useful to show the relief of the study area on the

map. In this section relief is built from 30 meter resolution digital elevation model (DEM) using Relief -tool.

1. Since we are now using raster image instead of vector layer what we have used so far, bring the DEM of the

Yilmana Densa area to the map by using Add Raster Layer-tool (Image 45).

2. Open Relief-tool from Raster -> Terrain analysis -> Relief… Select DEM as an Elevation layer (Image 46). Give a

name Yilmana_Densa_relief to Output layer and save new layer to DEMs-folder with …-button. Select GeoTIFF as

Output format. Let the Z factor to be default 50000. In Relief colors –section click Create automatically –button.

Check the Add result to project so that the new relief will appear on the map automatically. Then click OK.

Image 45. Adding DEM as a raster layer

Image 46. Correct settings for relief-image

DEMs are normally done with radars from airplanes or satellites and thus expensive. There are still many sources

for free DEMs in internet. Data used in training can be found from Training package/ORIGINAL DATA/DEMs. It is

good to copy the file first to Training QGIS/QGIS-DATA/DEMs–folder before using it.

Page 28: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 28

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

3. Next move the relief-layer to the bottom of the layers. Problem now is that it is hidden under kebele-layer so

kebele-layer needs to be made transparent as was done earlier to woreda-layer (Image 23). You can also set the

Fill style to No brush which gives the same result. Make also kebele-borders wider and color brighter. As a result

you will now have map similar to Image 47.

Image 47. Map of Yilmana Densa with relief in background

Page 29: COWASH Training QGIS 1 QGIS GUIDE FOR WASH FACILITY … basics.pdf · QGIS GUIDE FOR WASH FACILITY DATA COLLECTORS AND -MANAGERS QGIS (previously known as Quantum GIS) is widely used

COWASH Training QGIS 29

Kimmo Koivumäki [email protected] MoWIE / COWASH GIS Expert +251 939 175 931 Addis Abeba

EXTRA 4: CHECK HOW MANY POINTS ARE OUTSIDE WOREDA BORDERS (SPATIAL QUERY)

In this exercise it is inspected if all the collected water points are within woreda borders if they are not, then there is

an error in data collection or there has been a mistake when inputting the data to database. There are many ways of

doing this and in this exercise calculations are done with the Spatial Query –tool.

First create a layer where is only Yilmana Densa –woreda by following the steps in section “Creating a new shapefile

from selection”.

1. Select the Yilmana Densa woreda from the woreda_selection-layer and save it with the name “Yilmana Densa”.

Remember to check “Save only selected features” checkbox.

2. Select Spatial Query from Vector-menu from the top toolbar

We are selecting points which are not in the Yilmana Densa so next define what is going to be selected from where

3. For the Spatial Query –window’s Select source features from –section select Yilmana_Densa – water point layer

4. For the Where the feature – section select “Is disjoint”. This means that all points which are NOT in Yilmana

Densa –woreda’s area will be selected.

5. For the Reference features of –section select Yilmana_Densa area layer and press Apply (Image 48)

Spatial Query tool will now select all Yilmana Densa water points which are not in the Yilmana Densa woreda area.

After the processing is done the Spatial Query –window shows the results in the Result feature ID’s –section.

It is possible to make a new layer from all points which are not in the woreda-area by clicking the button in Selected

features -section

To view all water points which are not in woreda, open the attribute table of the Yilmana Densa –water point layer

To see only those points which are selected change the Show All Features –button to Show Selected Features from

the bottom left corner of the attribute table

Image 48. Setting up the Spatial Query