Introduction To Basic GIS and Spatial Analysis Using Qgis: Applications in Bangladesh
Introduction To Basic GIS and Spatial Analysis Using Qgis: Applications in Bangladesh
QGIS:
Applications in Bangladesh
Applications in Bangladesh
CIMMYT, the International Maize and Wheat Improvement Center is the global leader on
publicly funded maize and wheat research and related farming systems. Headquartered near
Mexico City, CIMMYT works with hundreds of partners throughout the developing world to
sustainably increase the productivity of maize and wheat cropping systems, thus improving
global food security and reducing poverty. CIMMYT is a member of the CGIAR Consortium
and leads the CGIAR Research Programs on MAIZE and WHEAT. The Center receives
support from national governments, foundations, development banks and other public and
private agencies.
Correct Citation: Ahmed, Z.U., Krupnik, T.J., Kamal, M., 2018. Introduction to basic GIS
and spatial analysis using QGIS: Applications in Bangladesh. Cereal Systems Initiative for South
Asia (CSISA) and the International Maize and Wheat Improvement Center, CIMMYT. Dhaka,
Bangladesh.
Publication Design
Published by
CIMMYT- Bangladesh
House 10/B, Road 53, Gulshan 2, Dhaka 1212
Tel (Land/Fax): +880 2 9896676, +880 2 9894278
Post: P.O. No. 6057, Gulshan, Dhaka 1212, Bangladesh
Published in 2018
This set of training modules was developed by the International Maize and Wheat
Improvement Center (CIMMYT) as part of the Cereal Systems Initiative for South Asia
(CSISA) project.
CSISA was established in 2009 to promote durable change at scale in South Asia’s cereal-
based cropping systems. Operating in rural ‘innovation hubs’ in Bangladesh, India and Nepal,
CSISA works to increase the adoption of various resource-conserving and climate-resilient
technologies, and to improve farmers’ access to market information and enterprise
development. CSISA supports women farmers by improving their access and exposure to
modern and improved technological innovations, knowledge and entrepreneurial skills. By
continuing to work in synergy with regional and national efforts, and by collaborating with
myriad public, civil society and private sector partners, CSISA aims to benefit more than eight
million farmers by the end of 2020.
This publication was funded by the United States Agency for International Development (USAID and
Bill and Melinda Gates Foundation (BMGF). The views and opinions expressed in this publication are
those of the author(s) and do not necessarily reflect the views of BMGF, USAID or the US Government
and the other Donors.
Table of Contents
INSTRUCTIONS BEFORE YOU BEGIN USING THIS SET OF LEARNING MODULES ......- 1 -
MODULE 1: DOWNLOADING AND INSTALLATION OF QUANTUM GEOGRAPHIC
INFORMATION SYSTEMS (QGIS), GRASS 7 AND R ........................................- 2 -
MODULE 2: AN OVERVIEW OF THE QGIS INTERFACE .....................................................- 29 -
MODULE 3: LOADING SPATIAL DATA AND VISUALIZATION IN QGIS ........................- 39 -
MODULE 4: COORDINATE REFERENCE SYSTEMS IN QGIS ..............................................- 50 -
MODULE 5: WORKING WITH GPS DATA .............................................................................- 60 -
MODULE 6: WORKING WITH TABULAR DATA ..................................................................- 65 -
MODULE 7: WORKING WITH VECTOR DATA.....................................................................- 80 -
MODULE 8: WORKING WITH RASTER DATA ......................................................................- 90 -
MODULE 9: TERRAIN ANALYSIS ............................................................................................- 94 -
MODULE 10: SPATIAL ANALYSIS .........................................................................................- 107 -
MODULE 11: GEOREFERENCING GOOGLE EARTH IMAGERY .......................................- 115 -
MODULE 12: CREATING A NEW VECTOR DATASET.......................................................- 119 -
MODULE 13: MAP PRODUCTION IN QGIS .........................................................................- 126 -
GLOSSARY OF KEYWORDS ...................................................................................................- 135 -
Instructions before you begin using this set of learning
modules
Before you begin working with these learning modules, please take time to download the data
and other information you will need to complete the hands-on exercises detailed in this book.
You can download these files as described below:
1. Go to the following link by clicking here. The website that houses the data you need
to download looks like shown below:
2. You will find listed on this webpage all of the required files that you need to use for
each module exercises in this book in zip format, as shown below.
3. Download the ten individual .zip files (one for each of the modules in this book,
beginning on Module 3 and ending with Module 13). In total, the files are over 500 MB
in size, so they may take some time to download.
4. Keep the files on the local drive of your computer, in a location that is easy to access
such as the documents folder or root location of any drive.
5. As you work through the modules in this book, you will find instructions to load
different files that are in each of the folders in the zip files. Please open and make use
of the downloaded files as required to complete the exercises in each of the modules.
6. Keep these files available, as you will be requested to import them into QGIS for the
exercises in the different modules in this book.
-1-
Module 1: Downloading and Installationof Quantum Geographic
Information Systems (QGIS), GRASS 7 and R
Before downloading and installation of QGIS and other software in Windows, check your
Windows System type (32 bit or 64 bit) to assure compatibility.
1. Click the
Windows Start
button
Start
2. Type “System” in
the search bar,
and then click
System
Search bar
-2-
64-bit
Note that this set of training modules focuses on using Windows for QGIS, although QGIS is
also compatible with Macintosh computers. Instillation is similar and many online guides for
how to work with QGIS in a MAC environment are available. Please also note that new
versions of QGIS, GRASS, GDAL and R may have been released since this publication was
completed. Where this is the case, feel free to use the new versions, although you may need
to adapt portions of the instructions in each module to some mall extent.
The QGIS installer can be installed from the internet or you can download all required
packages beforehand and then apply them. The downloaded files are located in a local
directory for future installations. Steps of the downloading QGIS installer are:
-3-
1. Click Windows Start button
-4-
Installation of QGIS
For Windows XP through Windows 8 (both 32 and 64 bit), the OSGeo4W installer offers
many more choices since it includes the ability to install many other Open Source GIS
software packages and libraries such as: Quantum GIS, GRASS GIS, SAGA GIS, GDAL tools,
MapServer, OpenEV, uDig, and more.
Standalone Installer
4. Click Next
5. Click I Agree for the License agreement
-5-
-6-
6. Keep the default destination folder (C:\Program Files)and click Next
7. Click Install (at this point, there is no need to download training data – we will
return to this later). This part of the process takes several minutes.
-7-
8. Click Finish
-8-
5. Choose Install From Internet and click Next
6. Set root directory to: C:\OSGeo4W\ and check the radio button All Users,and
click Next
-9-
7. Select Local Package Directory (C:\Users\[yourusername]\Documents) as a
temporary directory, and click Next
- 10 -
9. Choose download site and click Next
10. Select Packages: In the "Categories field" as shown below, click on the + symbol
before "Desktop" to extend the folder tree.
- 11 -
11. Click + (expand) and select packages to Install.
- 12 -
13. Agree License Agreements (this will need to be done 4 times), and Click Next
- 13 -
Please wait, download and Installation will take several minutes, especially if you have slow internet.
- 14 -
14. Click Finish
The core engine of QGIS is coded in C++, but additional QGIS plugins are written in the
scripting language Python which is easy to learn. A growing community in the field of geo-
informatics use Python to extend the functionality of QGIS. You may install additional plugins
with your internet connection. PLUGINS --> MANAGER AND INSTALL PLUGINS -->
SETTINGS. Make sure that‘Show also experimental plugins’is turned on.
When the connection with python plugin repositories is established, it becomes possible to
install necessary plugins from:
PLUGINS --> MANAGER AND INSTALL PLUGINS --> NOT INSTALLED MENU
You can also activate and deactivate the plugins in the Installed tab of the Plugin Manager.
- 15 -
Download and Installation of R
Downloading
If you want to use R function in QGIS R will need to be installed in your computer. R is an
open-source statistical software program that is increasingly popular among scientists. R can
download from the R project website (www.r-project.org ), a repository CRAN (R
development Core Team, 2014). As R is a free program, no identification is required.
3. Select any CRAN Mirrors from the closest location on the globe proximal to your
location
- 17 -
4. Select Download R for windows
- 18 -
6. In this set of modules, we use R. 3.1.1. Note however that more advanced versions of
R have since been released, and you can also use these in place of version 3.1.1. Click
Download R. 3.1.1 for Windows
Installation
1. To download R-3.1.1 for Windows (32/64 bit)click here.
2. Navigate to the directory where the downloaded R-3.1.1-win.exe filejust
downloaded.
3. Double-click on it and follow the instructions.
4. Select Setup Language: click OK (Note: Keep default language English)
- 19 -
• GNU General Public License: click Next
- 20 -
• Select Destination Location as C:\OSGeo4W64\bin\R-3.1.1: click Next
- 21 -
• Start Option: click Next (No accept defaults)
- 22 -
• Select Additional Tasks: click Next (Keep default)
- 23 -
• Click Finish
- 24 -
R Packages and Libraries
Packages are collections of R functions, data, and compiled code in a well-defined format.
The directory where packages are stored is called the library.
Installation of R-packages
If the R program has already been installed, the installation of any ‘package’ can be done
directly from the console of R through the Internet or from the local drive.
- 25 -
QGIS configuration for R/SAGA/GRASS GIS
Display settings
In QGIS 2.4.0, the rendering speed of displaying large image data is much improved using
multi-threading, which allows the computer to receive multiple commands from the user
without significant delays in response. This option is not enabled by default, so it is a good
idea for you to turn it on. Go to SETTINGS --> OPTIONS --> RENDERINGand click the
checkbox Render layers in parallel using many CPU cores on. Once this is done, you will find
that zooming and moving layers is considerably faster, saving your valuable time.
The new spatial processing framework is a highlight of QGIS 2.4. It is based on the Python
plugin SEXTANTE coded by Victor Olaya, which integrates a large number of analysis
algorithms from different open source projects. The plugin functions are activated by default
- 26 -
and can be found under the main menu PROCESSING --> TOOLBOX. A Processing Toolbox
Window should open on the right side of the GUI after you click on PROCESSING --> TOOLBOX.
On the bottom of this window,you will find the drop list button‘Simplified interface’. Please
switch this to‘Advanced interface’.
If you correctly followed the guides for QGIS and R installation on the Windows new software
versions of GDAL, OTB, GRASS GIS and SAGA, you will find that they are already installed
and correctly configured for the Processing Toolbox.
- 27 -
- 28 -
Module 2: An overview of the QGIS interface
Note: Much of this module builds upon the online version of the standard QGIS manual (see:
http://docs.qgis.org/2.2/en/docs/user_manual/introduction/qgis_gui.html).Further modules
begin to use material specific to Bangladesh and South Asia with custom exercises. When you
launch QGIS, you will be presented with the GUI like the figure below (the numbers one to
six in the boxes below stand for the six major areas of the interface).
QGIS GUI:
8.Processing Toolbox
3.LAYER LIST/Map
Legend
7.Python console
5.STATUS BAR
Menu BAR
The menu bar is the most important area for accessing most QGIS features. It uses a standard
hierarchical menu format. Information on the menus and keyboard shortcuts to access them
are listed out below. The good news is that you can also customize and configure the
shortcuts as you wish (see using the [Configure Shortcuts] tool under ‘Settings’). Most of
the menu options have a tool that you can click on, although you need to remember that the
menus are not organized precisely like the toolbars. Instead, the toolbar with the tool can be
found after each menu option. Note that some menu options will only be visible if you have
loaded the plugin beforehand.
Project
- 29 -
Menu Option Shortcut Reference Toolbar
New from template ‣ see Projects Project
Open Recent ‣ see Projects
Edit
- 30 -
Menu Option Shortcut Reference Toolbar
View
Ctrl+Shift+I Attributes
Identify Features
Measure ‣ see Measuring Attributes
- 31 -
Menu Option Shortcut Reference Toolbar
see Spatial
New Bookmark Ctrl+B Attributes
Bookmarks
see Spatial
Show Bookmarks Ctrl+Shift+B Attributes
Bookmarks
Layer
Add SQL Anywhere Layer see SQL Anywhere Plugin Manage Layers
Add WFS Layer see WFS and WFS-T Client Manage Layers
Add Delimited Text Layer see Add Delimited Text Layer Manage Layers
- 32 -
Menu Option Shortcut Reference Toolbar
Save as...
See Working with the Attribute
Save selection as vector file...
Table
Labeling
Plugins
Vector
- 33 -
Menu Option Shortcut Reference Toolbar
see Loading OpenStreetMap
Open Street Map ‣
Vectors
Road Graph ‣ see Road Graph Plugin
Spatial Query ‣ see Spatial Query Plugin Vector
Topography Checker‣ Vector
Analysis Tools‣
Research Tools‣
Reprocessing Tools ‣
Geometry Tools‣
Data management Tools ‣
Raster
Database
Processing
- 34 -
Menu Option Shortcut Reference Toolbar
Toolbox see The toolbox Toolbox
Graphical Modeler see The graphical modeler
History and Logs see The history manager
see Configuring the
Options and configuration
processing framework
see Configuring external
Results viewer
applications
see The SEXTANTE
Commander Ctrl+Alt+M
Commander
Toolbar
The toolbar provides access to most of the same functions as the menus, plus additional tools
used when you are interacting with the map. Each toolbar item has “pop-up” help menus
available. Hold your mouse selection tool over the item and a short description of the tool’s
purpose will be displayed to guide you.
Every menu bar can be moved around according to your needs. Additionally, every menu
bar can be switched off using your right mouse button, obtained by holding the mouse over
the toolbars and right clicking (read also Panels and Toolbars).
If you have accidentally hidden all your toolbars, you can retrieve them by choosing menu option
Settings ‣ Toolbars ‣. If a toolbar disappears under Windows, which seems to be a problem in
QGIS from time to time, you have to remove \HKEY_CURRENT_USER\Software\QGIS\qgis\UI\state
in the registry. When you restart QGIS, the key is written again with the default state, and all
toolbars are visible again.
All the layers in your project will be listed in the map legend. If you check the box in each
legend entry, you can hide or reveal the layer of interest. You can drag around the layer once
you select it to change the Z-ordering. Z-ordering means that layers listed nearer the top of
the legend are shown on top of those below them in the legend. You can stop Z-ordering by
clicking ‘Layer order’ on the panel.
Your layers are organized into groups on the panel. This can be achieved in two ways:
1. Right click in the legend window and choose Add Group. Next type the group name as
you choose it, then hit enter. Next, click on an existing layer and drag it onto the
group – this will add it to the group you have named.
2. With the other method, you can choose some layers, right click in the legend window,
and select the option Group Selected. This will move the chosen layers into the new
group automatically.
- 35 -
To move a layer out of a group, you can either drag it out or right click and select ‘Make to
top-level’ item. Groups can be nested inside other groups to create hierarchies.
Remember: The checkbox for a group will show or hide all the layers in the group – this is
done with just one click. The content of the right mouse button context menu also depends
on whether the selected legend item is a raster or a vector layer. For GRASS vector layers, Toggle
editing
is not available. See sectionDigitizing and editing a GRASS vector layerfor information on
editing GRASS vector layers.
The right mouse button menu for raster layers reveals the following
information:
• Zoom to layer extent
• Zoom to Best Scale (100%)
• Stretch Using Current Extent
• Show in overview
• Remove
• Duplicate
• Set Layer CRS
• Set Project CRS from Layer
• Save as ...
• Properties
• Rename
• Copy Style
• Add New Group
• Expand all
• Collapse all
• Update Drawing Order
It is possible to select more than one layer or group at the same time by holding down the
Control (Ctrl) key while selecting the layers with the left mouse button. You can then move
all selected layers to a new group at the same time.You are also able to delete more than one
Layer or Group at once by selecting several Layers with the Ctrl key and pressing Ctrl+D
afterwards. This way all selected Layers or groups will be removed from the layer’s list.
Map View
This is the “core business” of QGIS - maps are displayed in this area. This is where you will
do most of your work. The types of maps you see here will depend on the vector and raster
layers you have chosen to load. The map view can be panned (moved so your view changes)
left and right (this shifts the focus so you can see different regions of the map) and zoomed in
and out. A number of other operations can be done to your map, as described in the toolbar
section above.. The map view and the legend are important to each other operationally - the
maps in view reflect changes you make in the legend area.
You can use the mouse wheel to zoom in and out on the map. Place the mouse cursor inside
the map area and roll the wheel forward to zoom in or backwards to zoom out. You can
customize the behavior of the mouse wheel zoom using the Map tools menu under the Settings
‣ Options menu.
Tip: Panning the Map with the Arrow Keys and Space Bar
The arrow keys can be used to pan the map to the left or right, or up and down. Place the
mouse cursor inside the map area. Next click on the right arrow on the keyboard to pan East,
- 37 -
or the left arrow key to pan West, or the up arrow key to pan North, and the down arrow
key to pan South. You can also pan the map using the space bar or the click on mouse wheel
by moving the mouse while holding down space bar (or clicking on the mouse wheel).
Status Bar
The status bar shows you your current position on the map (indicated by where the mouse
cursor is) in map coordinates (e.g. meters or decimal degrees). As you move the mouse, the
coordinates change. On the left of the coordinate display in the status bar you will find a
button toggles between showing your coordinate position, or the view extent resulting when
you pan in or out of the map.
Just adjacent to the coordinate display is the scale display. This shows the scale of the map at
the view setting you have chosen (it will change as you zoom in or out). Take note of the
scale selector that allows you to choose between predefined scales that range from 1:500 to
1:1,000,000.
The progress bar can be found in the status bar. This shows progress of rendering as you
bring each successive layer into the map view. This can take some time with data heavy layers.
If a new plugin or a plugin update is available for your QGIS, you will see a message that tells
you so on the far right of the status bar. On the right side of the status bar is a small check
box that can be used to temporarily stop layers being rendered into the map view (see Section
Rendering below). The icon immediately stops the current map rendering process. This is
useful if you realize you accidently brought in the wrong layer.
Just to the right of the rendering area you will find the EPSG code of the current project
Coordinate Reference System (CRS), and a projector icon. Click on it to open data on the
projection properties of the layer.
Degrees is the default unit when you boot up QGIS. Hence, any layer you add will
automatically be projected in degrees To change or get your corrected scale values, you can
either change this setting to meters manually in the General tab under Settings ‣ Project
Properties or, you can select a project CRS clicking on the CRS status icon in the lower right-
hand corner of the status bar. In the last case, the units are set to what the project projection
specifies, e.g. ‘+units=m’ for units as meters.
- 38 -
Module 3: Loading Spatial Data and Visualization in QGIS
The data set for this exercise is located in: MODULE_03\ Data\ directory:
1. Upazila boundary of Bangladesh (polygon- BD_UPZ_GCS.shp)
2. British Geological Survey (BGS) groundwater Arsenic data (point shape file-
bgs_groundwater.shp)
3. Road network maps of Bangladesh (BD_road_network.shp)
4. Landsat-5 image for Bangladesh (LT51370442010030KHC00_B4.TIF)
Vector Data
In this exercise, we will use three types of ESRI shapefiles (also called a shapefile). These
types include polygons, points and line or polylines. What is a shapefile? It is the most
common form of geospatial vector data used in GIS software and analyses. Shapefiles were
designed and are now regulated by ESRI, and are meant to work interchangeably to
communicate data between ESRI and GIS products. Shapefiles are built from a number of
constituent files. Three unique files are required to save the main data that is used to make a
shapefile, including: .shx (shape index format; this tags the shapefile with a position so users
can move it forward and backward among layers, a shp (shape format, which stores geometric
data, and a .dbf (attribute format file; which holds attributes (information) for the shapes in
the file). Some people refer to the .shp files as the unique shapefile itself. While this makes
sense according to name, all three files are actually required to use a shapefile.
Polygons
Polygons are two-dimensional geographical features covering a portion of the earth’s surface,
for example, forests, lakes, administrative boundaries, farmers’ fields, or any other
organizational unit the user defines. Polygons are important because their area and perimeter
can be measured.
In this exercise, we will use upazila (sub-district level) data from Bangladesh. These data
have been downloaded from
https://www.humanitarianresponse.info/applications/data/datasets/locations/bangladesh.
Steps:
- 39 -
7. Then click Open
8. After clicking Open, the map should appear on the QGIS canvas
- 40 -
9. In the Layers menu to the left of the map viewer, right-click on
BD_UPZ_GCS.shp and select PROPERTIES --> STYLE. Keep Single symbol and change
FILL from Simple fill to Outline: Simple line from Symbol Layer type, then click OK.
If done correctly, the resulting map viewer will look like the following image:
- 41 -
Points Vector
Zero-dimensional points are important for geographical features like wells, soil-sampling
locations that can be best expressed by a single reference point. These points confer the least
information about these file types, and are best to represent geographical data that are very
small scale and with limited area. Examples include cities, villages, wells, farms, markets, etc.
that you would not represent with polygons. The main drawback of a point feature, however,
are that they cannot be used to make measurements (as you can with a polygon).
In this exercise, we will use British Geological Survey Groundwater Quality data for Bangladesh
(http://www.bgs.ac.uk/research/groundwater/health/arsenic/Bangladesh/data.html) as CSV file.
This CSV file contains the results of a geochemical survey of 3,534 boreholes from 61 of the
64 districts of Bangladesh. All 3,534 boreholes were georeferenced. From this CSV file, we
have created a shape file (point vector map).
Steps:
- 42 -
6. Now right-click on bgs_groundwater.shp (note that it may simply be called
‘bgs_groundwater’ in the layers menu (to the left of the map viewer)and select
PROPERTIES --> STYLE.
7. Change Single symbol to Graduate symbol.
8. Select Colum “was” (groundwater arsenic concentration, ug/L)
9. Click Symbol: Change
10. From Popup-windows, select Marker Simple marker
11. Then, choose Size 1 mm and Outline style No Pen, then click OK.
12. Select Color ramp RdYIGn and check Invert
13. Choose Classes 10 and Mode Quantile
14. Click Classify and then OK
- 43 -
The resulting map should look like the display below. These steps are important if you wish
to display georeferenced data that have a gradient of values, for example in this case the
arsenic level in sampled groundwater for each of the points. Using this method, you can easily
visualize how arsenic concentrations appear to increase towards the southern region of
Bangladesh.
Note that if the color ram classification does not appear to be as shown below, you can go
to PROPERTIES -->STYLE and then click INVERT TO the left of the color ramp source.
You can also decide to use a different color ramp scheme all together, as you choose.
Lines or Polylines
One-dimensional lines, also called polylines, are used to represent geographical features like
rivers, roads, railroads, trails, and topographic lines. Note that these features are linear in
nature and do not have area like polygons. Hence, they can measure distance.In this exercise
we use road network maps of Bangladesh. This map has been downloaded from
https://www.humanitarianresponse.info/applications/data/datasets/locations/bangladesh.
Steps:
- 44 -
9. Select Colum “ROADCLASS” and Color ramp Random colors
10. Click Classify and then, OK
The resulting output should look like the below map, made more easily visible by deselecting
the groundwater and Upazila shapefiles in the layers menu.
- 45 -
Raster data
Raster data can be thought of as particular type of geographical information. Using a grid
format, it covers the space of each cell, the smallest measurement unit in the in the grid,
aligning it with a measured geographical feature in this location. Combined into a matrix, a
raster is a grid of cells. Some sources of raster data could include satellite or aerial images
and droneimager (though these types are rare) or maps that have been scanned. Data types
are flexible, including discrete and categorical data, such as those used in soil or land-use maps,
or continuous data as in digital elevation models, precipitationgradient maps, or pollutant
concentration maps, etc. Raster data are meant to be used in a complementary way to vector
data applications in GIS, so they are commonly integrated in analyses and map making.
In this exercise, we will use one scene (row 137 and row 44) of Landsat-5 TM satellite images
acquired on 30/01/2010. The Landsat-5 was collected and distributed by the USGS's Center
for Earth Resources Observation and Science (EROS) (http://eros.usgs.gov/satellite-imagery).
Steps:
1. Click the Add raster layer button and select the file
LT51370442010030KHC00_B4.TIF from
~\MODULE_03\Data\LT51370442010030KHC00. After clicking Open, the map
should appear on the QGIS canvas.
The resulting map should look roughly like the one below:
Use the tools for zooming in to increase the map scale and zoom in on the scene
of southern Bangladesh and its rivers. Use the panning tool to move the map in the
- 46 -
desired direction. If you get lost while moving the map around, you can always zoom
back to the map by clicking the Zoom to layer button.
- 47 -
3. To change map color and symbols, again select the layer with a right click and choose
PROPERTIES --> STYLE. From the pulldown menu,Render type, select Singleband
pseudocolor. A different menu will come up, where you may select the style of the
color map in the section Generate new color map. Also, make sure your color
interpretation is marked to ‘Linear’. Click Classify and confirm with Apply or OK.
- 48 -
Saving QGIS Project
Your QGIS session is considered as an individual Project. You can only work on one
project at a time in QGIS, and you can save your Project (or open a new one) in the
following ways.
PROJECT-->SAVE AS
Save you work
PROJECT-->SAVE
Load saved projects into a QGIS session using
PROJECT-->OPEN
If you wish to clear your session and start fresh, choose
PROJECT-->NEW
Either of these menu options will prompt you to save the existing project if changes
have been made since it was opened or last saved.
- 49 -
Module 4: Coordinate Reference Systems in QGIS
Coordinate reference systems use data presented in either projected or geographic
coordinate systems (see below), and are used to provide a framework to identify real-world
locations.
The earth is not a perfect sphere, despite being often depicted as such. Because of this,
different spheroid representations of the earth exist. Geographic coordinate systems use
latitude and longitude to measure and indicate locations on the globe, defined as a function of
direction and distance from a center point. Where representations of the globe however
differ, so will the central point from which coordinate systems are measured. This complicates
use of different coordinate systems, especially when they are to be compared, or data in one
system is imported into a GIS basal layer that uses a different system. This often requires
transformation of the coordinate system to assure alignment in the workspace. The most
common geographic coordinate system is the World Geodetic system 84 (WGS84) (EPSG:
4326), represented as follows:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS
84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.01745329251994328,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]
The most widely utilized two-dimensional Cartesian coordinate system is the Universal
Transverse Mercator (UTM) system. UTM is interesting in that it is a horizontal positional
representation of the globe, and can be used to identify positions without having to know
their vertical location on the ‘y’ axis. It is nonetheless different than geographical coordinate
systems in that it is not a single mapped projection. It also represents the earth as sixty
- 50 -
different zones, each composed of six-degree longitudinal bands, with a secant transverse
Mercator projection in each. The Bangladesh falls in zone 45N (EPSG1:32645) and zone 46N
(EPSG: 32646).
Everest-1830 ellipsoid
Semi-major axis a (+a) = 6377276.34518 m
Semi-minor axis b (+b) = 6356075.41511 m
- 51 -
Inverse flattening 1/f = 300.8017
Projection parameter
Projection method : Transverse Mercator
Latitude of origin (+lat_0) : 0° N
Central meridian (+lat_0) : 90° E
False Northing (+y_0 ) : -2,000,000 m
False Easting (+x_0) : 500000 m
Scale factor (+k) : 0.9996
In QGIS, the following parameters (PORJ 4) are needed for transforming CGS/ UTM with
WGS84 to BTM with a local Ellipsoid (Everest 1830)
PORJ 4 (EPSG_3106_BTM_D_GULSAN_NEW.PRJ4):
- 52 -
In ArcGIS, the following PRJ file is needed (EPSG_3106_BTM_D_GULSAN_NEW.PRJ) for
transformation.
PRJ:
The data set for this exercise is located in: MODULE_04\ Data\ :
1. Upazila boundary of Bangladesh (polygon- BD_UPZ_GCS.shp)
2. Landsat-5 image for Bangladesh (LT51370442010030KHC00_B4.TIF)
3. Four DEM raster in ALL_SHEETS_DEM_GCS sub-directory
- 53 -
Transforming Geographic Coordinate Systems to Projected coordinate
system
In this section, we will learn how to transform geographic Coordinate Systems to a projected
coordinate system in QGIS. First, we have to create a custom CRS in QGIS for
transforming from GCS or UTM with WGS-84 Ellipsoid to BTM with a Local Ellipsoid (Everest
1830)
6. Then Click OK
7. A new CRS named EPSG_3106_BTM_D_GULSAN_NEW will be created in
QGIS. We will use this CRS for all projection transformation in this exercise.
- 54 -
Vector Data CRS
1. If you have not done so already, launch QGIS Desktop 2.4.0 from your desktop
2. Click and load the BD_UPZ_GCS.shp file
3. To find the coordinate reference system (CRS) layer, first right click on the layer name
in the layer section, then click Properties. Next, click on the Metadata tab. The CRS
is displayed under the Layer Spatial Reference Systemheader under Properties.
The example below shows that the layer projection is Geographic coordinate
system and the datum is WGS84.
- 55 -
Projection of a Vector Data
We have already shown the BD_UPZ_GCS vector layer in a Geographic Coordinate Systems with
a datum WGS84 (EPSG:4326). In the following exercise, you will next learn how to convert GCS to
BTM using a custom CRS that we created before. This process is important to correct for incorrect
projections, and to align layers you are working with in an analysis.
1. Click and select BD_UPZ_GCS.shp file. After clicking Open, the map should
appear on the QGIS canvas (if not already completed in the step above).
2. Right click on the BD_UPZ_GCS.shp in the layers menu, then click Save as
3. Use the Save as Browse’option to choose (MODULE_04\Data) for the new layer
to be saved and give the layer name as BD_UPZ_BTM.shp, and hit return.
4. In the CRS section, select Project CRS and then Click Browse
5. Scroll down in the Coordinate reference system of world section of the
Coordinate Reference SystemSelector window, and select
EPSG_3106_BTM_D_GULSAN_NEW fromUser defined Coordinate
Systems(this may take time for you to find, but be patient).
6. Next, click OK.
7. Then Click OK again.
- 56 -
Raster Data CRS
In this exercise, which focuses on raster data as defined in Module 3, we will use Landsat 5
TM scenes downloaded from the http://glovis.usgs.gov/ website. These data have been
projected in Universal Transverse Mercator (UTM) Zone 46 with the WGS84 datum
(ESPG:32646). We can re-project a single file or multiple files with batch projection mode
from geographic coordinate systemto our custom CRS
(EPSG_3106_BTM_D_GULSAN_NEW).
1. Click the Add raster layer button and select the file srtm_55_08.tif from
ALL_SHEETS_DEM_GCS sub-directory of Chaper_03/Data folder.
2. After clicking Open, the map should appear on the QGIS canvas> If you encountered
an error, make sure you are opening the file under the raster prompt.
3. Check the MetaData tab in the Properties window for this raster to determine what
the Spatial Reference System (SRS) is. The SRS is displayed under the Layer Spatial
Reference Systemheader under Properties. The projection of this raster is
Geographic coordinate systemand the datum is WGS84.
- 57 -
Projection of a Single Raster:
- 58 -
- 59 -
Module 5: Working with GPS data
In this section, we will show how to create a point shape file from text delimited GPS data in
QGIS. In QGIS, text delimited file is an attribute table. Each separate column has a separate
and defined data character, and each row is independent. The first row references column
names. ACSV (Comma Separated Values) file is the most widely used type of text-delimited
file, with each column separated by a comma. Longitude and latitude measurements should
be in decimal degree (DD) format only. Other formats like degrees (d), minutes (m), and
seconds (s) will result in errors. Note that GPS unit coordinates are not always pre-formatted
to DD, hence where this is the case, conversion will be necessary. DD can be rapidly
calculated in Excel using the formula below.
𝑀𝑀 𝑆𝑆
𝐷𝐷𝐷𝐷 = 𝐷𝐷 + +
60 3600
After calculation, be sure to save your output as a CSV file for import into QGIS.
In this exercise, we will use Soil Resource Development Institute (SRDI) soil survey data of
Gopalganj District (Gopalganj_SoilData.csv). You will learn how to manipulate attribute tables
and how to join data. The soil samples were collected from 0-20 cm soil depth from > 460
locations across Bangladesh, and were analyzed for pH, SOC, P, K etc. The following steps
will be used to create a point shape file with GPS and attribute data:
1. Load GPS the coordinates as a delimited CSV file (with geometry – point coordinates)
2. Load soil attribute data (with no geometry)
3. Join soil data with GPS data to create an integrated file
4. Save as ‘GPS_CORDINATES’ layer file to point shape file
Steps:
- 60 -
Load soil attribute data (with no geometry)
Steps:
1. Click the Add Delimited Text Icon
2. or Click Layer on Menu bar and then Add Delimited Text
3. Click browse and select Data.csv from MODULE_05 \Datasub-directory
4. Select Checkbox First record has field name (default)
5. Check Geometry definition: No geometry (attribute only table)
6. Click OK
7. The data will appear on layer canvas
- 61 -
Join soil data with GPS data
Steps:
1. Right click on GPS_COORDINATES select PROPERTIES-->JOINS
- 62 -
2. Click +
3. Select Data as Join layer, ID as Join and Target field and then click OK (Add vector
join windows).
4. Click OK again
- 64 -
Module 6: Working with Tabular data
In this module, you will learn:
• how to calculate polygon area
• use the field calculator
• join attribute data with polygons
• generate simple statistics of a vector field
• select a polygon using an expression
- 65 -
9. Select the Checkbox Save to new shapefile and Browse to directory
(~MODULE_06\Data and save as BD_UPZ_BTM_GEO.shp
10. Select the Checkbox Add result to canvas and click on OK and then Close
11. Looking at the attribute table, BD_UPZ_BTM_GEO now has two addition
column titles Area (sq.m) and Perimeter.
- 66 -
1. If you have not already done so, right click on BD_UPZ_BTM.shp, select Open
Attribute Table
2. Click Toggle editing mode and then Open Field Calculator (Note: Field
Calculator is only activated in editing mode)
Field Calculator
- 68 -
8. Finally, click Toggle editing mode again and save your work. These data can be used
for a number of subsequent analyses
Vc
Vc
Vc
vc
vc
vc
- 69 -
1. Right click on BD_UPZ_BTM select Properties->Joins
2. Click +, select BBS_UPZ as Join and Target field. Do not alter the BBS_POP join
layer field. Then click OK to exit, and ok again to exit the layer properties.
In this section, we calculate population density per square kilometer using total upazila
population divided by upazila area.
7. Then, click OK
- 70 -
9. Finally, click Toggle editing mode again and save your work.
- 71 -
c
c c
c c
c c
c c
- 72 -
Selecting Area by Expression
In this section, we will show how to select upazila or thanas where population densities are
equal or higher than the country mean population density. First, we have to calculate simple
statistics of population density. In QGIS, we can calculate statistics of a field in different ways:
Option 1:
- 73 -
c
- 74 -
Option 2:
We can calculate simple statistics and histogram of a field of a vector layer using “Statist”
plugin. If “Statist” has not been installed yet, you have to install it in QGIS first. (Important:
your computer must be connected with internet for installation of any QGIS plugin)
c c
c
c
After installation, we will use Statist plugin to get descriptive statistics and frequency
distribution of population density data.
1. Select VECTOR-->STATISTSTATIST
2. Select BF_UPZ_BTM as Input vector layer
3. PopPer as Target field and check Show grid
4. Click OK and then, Close
5. We can save histogram as PNG file in your output directory.
- 75 -
c
Option 3:
We can use R-Script in QGIS to calculate simple statistics of population density data.
- 76 -
c
- 77 -
1. Right click on BD_UPZ_BTM.shp, select Open Attribute Table
2. Click Select by expression
3. From the Function list, select Fields and Values
4. Double click PerPop, type >=2272 in Expression window and
5. Click Select and then, click Close.
6. The newly assigned yellow color in the map shows the upazilas where population
density is equal or greater than the country mean.
Select by expression
c c
Population
density ≥ 2272
(country mean)
- 78 -
7. We can save these selected upazila as a new shape file. Just right click on
BD_UPZ_BTM.shp, select Save As. In Save vector layer windows, Browse to
destination location and check Save only selected features and then click OK.
- 79 -
Module 7: Working with Vector Data
In this module, we will show some important techniques for vector data geoprocessing and
analysis tools in QGIS.
Convex Hull
A convex hull takes the outer border nodes from a vector shape (which you will recall may
consist of points, lines or polygons) and uses them to develop a polygon of the minimum sized
area that surrounds all features in the dataset, but that also avoids any concave angles. Below,
we will use SRDI soil sampling point (GOLPALGANJ_SOIL_DATA_BTM) data from
Gopalganj district to create a convex hullusing geoprocessing tools.
- 80 -
Clipping
Clipping creates a new shape that is based on the area of the input layer, but that is overlapped
by a clipping layer. This is similar to the process of intersecting layers, but differs because the
attributes of the chosen layer are copied only to the new shape. Below, we will use Gopalganj
district boundary to clip road network polylines, inundation class land type polygons, and BGS
groundwater arsenic point data.
Polyline
1. First, load
GOPALGANJ_DIST_BD_BTM.shpandBD_ROAD_BTM.shp(~MODULE_07\Data)
files in QGIS canvas.
2. Click Vector -> Geoprocessing Tools -> CLIP
3. Select BD_ROAD_BTM as an Input vector layer and
GOPALGANJ_DIST_BD_BTM as aClip layer
4. Check Add result to canvas
5. Browse to the directory (~MODULE_07\Data) and then save as
GOPAL_ROAD.shp
6. Click OK and Close.
- 81 -
Point layer
- 82 -
Polygons
- 83 -
Buffer
Buffering creates an envelope of space around selected features in source layer or file. For
this reason, buffers are sometimes referred to as a zone of a specified distance around a
polygon, line, or point features. Buffering is often used for proximity analysis. In this section,
we will create 400 m buffer zones around the road network and BGS sampling points of
Gopalganj district. Such a buffer could be used later on to examine the extent of farmland or
sampling points within the buffer, etc. This activity thus has many uses for spatial quantification
and data analysis.
Buffering of Polylines
- 84 -
Buffering of Point layers
Dissolve
Dissolve separates overlapping areas in the same layer. Here, we will use a district shape file
to create a country boundary shape file after dissolving boundary all districts.
Here, you will learn how to merge multiple shape files to create a single shapefile. We will
use layers from seven divisions of Bangladesh to create the single layer file.
1. Click Vector -> Data Management Tools -> Merge shapefiles to one
2. Select Polygon as Shapefile type
3. Browse and select Input directory folder ~MODULE_07\Data\\BD_DIVISION
4. Browse to the directory folder (~MODULE_07\Data)and save as BD_DIV_GCS.shp.
5. Click Add result to canvass, then OK and then, close. Note that you may need to
accept each layer by clicking OK again if additional windows appear.
- 86 -
Using Query Builder to Select Areas
In this section, we will create a shape of the hilly districts using Query Builder. This is a useful
process that can be later employed to sort spatial data according to queries that you can build
(e.g., to show areas larger or smaller than a specified number or by capturing specified data).
8. Click TEST which will validate the expression. If correct, your result of the test will
indicate that the where clause returned five rows of data.
9. Then, click OK
10. Save selected districts as BD_HILLY_AREA.shpin ~MODULE_07\Data\
- 87 -
Polygon Editing
- 88 -
- 89 -
Module 8: Working with Raster Data
You will recall that raster data refers to a particular type of geographical model. Using a grid
format, data covers the space of each cell, the smallest measurement unit in the in the grid,
aligning it with a measured geographical feature for a particular location. When combined into
a matrix, a raster is a grid of cells. In this module, you will learn how to process information
from the SRTM (Shuttle Radar Topographic Mission) 90m Digital Elevation Database (v4.1)
that we have downloaded from their http://www.cgiar-csi.org/data/srtm-90m-digital-
elevation-database-v4-1 website. A total 4 sheets cover entirety of Bangladesh. These data
have been projected in a Geographic (Latitude/Longitude) projection, with the WGS84
horizontal datum and the EGM96 vertical datum. Processing such data is an important part of
the analytical process of working with raster data. We will use the following steps to process
these raster data:
The data for this exercise are located in: ~\MODULE_08\ Data\ directory:
Merge
- 90 -
3. Select the ALL_Sheets_DEM_GCS folder as an Input directory from
~\MODULE_03/Data
4. Select DEM_MERGE_GCS.tif as an Output file
5. Check Load into canvas when finished
6. Click OK and then, Close
Clip
- 91 -
Re-projection
The digital elevation model, or DEM, obtained in the last step is not yet suitable as an input
for digital terrain modeling (e.g.Slope, Aspect, Curvature, etc. are incorrect). This is because
while its elevation values are in meters, cell size of the rasters is not expressed in meters (this
is because that layer uses a CRS with geographic coordinates). Because of these issues, a re-
projection is needed. To reproject a raster layer, the Warp (reproject) algorithm can be used
again. We reproject into a CRS with meters as units, so we can then correctly all spatial
analysis function.
1. Click the Add raster layer button and select the file BD_DEM_GCS.tif
2. Click Raster->Projection->Warp(Repoject)
- 92 -
3. Define Output file as BD_DEM_BTM and file type GeoTIFF
4. EPSG:4326 will be popping up as Source SRS
5. Check Target SRS and Select EPSG_3106_BTM_D_GULSAN_NEW as Target
SRS
and click OK
6. No data value as -9999, and Load into canvas when finished
7. Click OK again and then, Close. Note that processing may take some time.
- 93 -
Module 9: Terrain Analysis
Terrain analysis or land surface analysis is a process that describes terrain, for example it’s
roughness, altitude, etc., quantitatively. Such analysis can be very useful in assessing land
suitability for agriculture, construction, roads, or in designing irrigation schemes, and other
land use features. They are also very important in site selection. The following terrain
parameters will be computed from DEM data using standalone QGIS software, as well as
GRASS and SAGA plugins in QGIS. In this module, you will learn how to create the
following DEM derived terrain rasters using these commands:
1. Hillshade
2. Slope
3. Aspect
4. Color relief
5. Terrain Ruggedness Index (TRI)
6. Topographic Position Index (TPI)
7. Roughness
8. Curvature
The following data is needed for this exercise and is located in: ~\MODULE_09\ Data\
directory:
After clipping, open Metadata tab in Layer Properties for HILLY_DEM_BTM. You will notice
that Pixel size is 89.6 x 89.6. This means each cell represents a 89.6 by 89.6 meter area. When
switching to the Style tab in Layer Properties, you will also notice that the minimum value
reads and the max value. For terrain analysis, we have to first select the grid cells where we
have elevations ranging from above sea level to mountaintops. This means excluding the
negative values. You can use the raster calculator to create a mask and apply it to your raster
all in one step.x
- 94 -
The expression looks like this:(HILLY_DEM_BTM@1 >= 0) * HILLY_DEM_BTM @1
The first part of the expression in parentheses effectively says: for every cell greater than
orequal to zero, set its value to 1, otherwise set it to 0. This creates the mask as you go
along. For the second part of the expression, the raster is multiplied (HILLY_DEM_BTM
@1) by the mask values. This sets every cell with an elevation less than zero to zero. When
you click OK, the calculator will create a new raster with the mask applied. Here is how to
do this.
1. Click the Add raster layer button and select the file HILLY_DEM_BTM.TIF
2. Click on the menu item Raster ‣ Raster Calculator
3. Write (HILLY_DEM_BTM@1 >= 0) * HILLY_DEM_BTM @1 expression in Raster
calculator expression window
4. Set the Output layer as HILLY_DEM_BTM_CORR.tif
5. Then click OK
In QGIS, select Raster> Analysis>DEM (Terrain Model) The below figure shows the
QGIS terrain model analysis tool menu, which is a fairly straightforward tool which allows us
- 95 -
to perform six types of raster based terrain analysis techniques, including hillshade, slope,
aspect color relief, terrain ruggedness index (TRI), topographic position index.
Hillshade
The hypothetical illumination of a surface according to a specified azimuth and altitude of the
sun. Hillshading creates a three-dimensional effect that provides a sense of visual relief for
cartography, and a relative measure of incident light for analysis. It is very useful for visualizing
the terrain. You can optionally specify the azimuth and altitude of the light source, a vertical
exaggeration factor and a scaling factor to account for differences between vertical and
horizontal units.
1. Click the Add raster layer button and select the file
HILLY_DEM_BTM_CORR.tif
2. Click on the menu item Raster ‣ Analysis ‣ DEM (Terrain models).
3. In the dialog that appears, make sure that the Input file is the DEM layer.
4. Set the Output file to HillShade.tif
5. Select Mode as Hillshade
6. Check the box next to Load into canvas when finished.
7. You may leave all the other options unchanged.
8. Click OK to generate the hillshade.
9. When it tells you that processing is completed, click OKon the message to get rid of
it. Click Close on the main DEM (Terrain models) dialog.
10. Your result should look like the image to the right.
A hillshade can provide very useful information about the pattern of shadow cast by sunlight
at a given time of day. It can also be used simply to improve the appearance of the map. Note
that you can also change the transparency of the HillShade and other raster layers.
- 96 -
1. Go to Layer properties then click style, from render type dropdown menu select
singleband pseudo color then click classify then click ok.
2. Hide all the layers except the DEM and hillshade layers.
3. Click and drag the DEM to be beneath the hillshade layer in the Layers list. Control
rendering order (beneath the list) on the bottom of your window should be checked as
well.
4. Set the hillshade layer to be transparent.
5. Open its Layer Properties and go to the Transparency tab.
6. Set the Global transparency to 50%:
7. Click OK on the Layer Properties dialog.
DEM
Hillshade
Hillshade
Slope
Slope is the incline and steepness of a surface. Slope can be measured in degrees from
horizontal (0–90), or percent slope (which is the rise divided by the run, multiplied by 100).
A slope of 30 and 45 degrees equals 58 and 100 percent slope, respectively. As slope angle
approaches vertical (90 degrees), the percent slope approaches infinity. The slope for a cell in
a raster is the steepest slope of a plane defined by the cell and its eight surrounding neighbors.
Here we will clarify how slope can be depicted with your raster data.
1. Click the Add raster layer button and select the file
HILLY_DEM_BTM_CORR.tif
- 97 -
2. Click on the menu item Raster ‣ Analysis ‣ DEM (Terrain models).
3. In the dialog that appears, ensure that the Input file is the DEM layer.
4. Set the Output file to HILLY_Slope.tif
5. Select Mode as Slope
6. Check the box next to Load into canvas when finished.
7. You can leave all the other options unchanged (though note that you also have the
option of indicating the type of slope value you want: degrees or percent slope)
8. Click OK and Close after generating the slope map in degree.
Aspect
The compass direction that a slope faces is most commonly measured from degrees north.
The Aspect command provides a 32-bit float raster that ranges from 0° and 360°. This
represents the azimuth (the angular distance from the north to south point of the horizon
that can be transversed by a vertical circle that intersects the horizon, which represents the
direction of an object from the observer) that slopes are facing. In other words, 0° means
that the slope is facing North, 90° indicates East, 180° indicates a Southward facing, and 270°
is to the west. This however requires that the top of your input raster is north oriented, as
most are. Values found in between these ranges assume a mixture of cardinal directions, ex.
250 indicates a hillside with a Southeast facing aspect. The aspect value -9999 is generally used
as the ‘nodata’ value to indicate use of an undefined aspect in areas lacking variation in
topography, with slope=0. You can also make use of the legend to indicate the appropriate
aspect for each hillside in your study area. The legend permits you to identify North (~ 0 or
- 98 -
360 degrees), South (~ 180 degrees), East (~270 degrees) or West (~90 degrees) facing
slopes.
1. Click the Add raster layer button and select the file
HILLY_DEM_BTM_CORR.tif
2. Click on the menu item Raster ‣ Analysis ‣ DEM (Terrain models)
3. In the dialog that appears, ensure that the Input file is the DEM layer
4. Set the Output file to HILLY_Aspect.tif
5. Select Mode as Aspect
6. Check the box next to Load into canvas when finished
7. You may leave all the other options unchanged
8. Click OK and Close after generating the aspect map.
Color relief
Color relief helps differentiate topography more clearly, by providing a 3-band (RGB) or 4-
band (RGBA) raster with values that is computed a color configuration file and also an
elevation file. The configuration file is based on text, and includes expressions of the
association between various elevation values and the color that is of interest to the user.
QGIS's default settings will automatically provide elevation values that are well blended,
- 99 -
making a nicely colored DEM that is easy to understand. Here is how to turn your DEM into
a color relief.
1. Click the Add raster layer button and select the file
HILLY_DEM_BTM_CORR.tif
2. Click on the menu item Raster ‣ Analysis ‣ DEM (Terrain models)
3. In the dialog that appears, ensure that the Input file is the DEM layer
4. Set the Output file to HILLY_ColorRelief.tif
5. Select Mode as Color relief
6. Check the box next to Load into canvas when finished
7. You may leave all the other options unchanged
8. Click OK and Close after generating the Color Relief map
Topographic Position Index (TPI) is defined as the difference between a central pixel and the
mean of its surrounding cells. The TPIare calculated at each cell of the DEM by calculating
the difference between the elevation of the cell and the mean elevation calculated for all cells
of a moving rectangular window centered on the cell of interest. Positive TPI values represent
locations that are higher than the average of their surroundings, as defined by the
neighborhood (ridges). Negative TPI values represent locations that are lower than their
- 100 -
surroundings (valleys). TPI values near zero are either flat areas (where the slope is near
zero) or areas of constant slope (where the slope of the point is significantly greater than
zero). Topographic position is an inherently scale-dependent phenomenon. TPI was generally
second most important predictive variable after elevation. With the combination with slope
raster, we can define cells with TPI values ≤ -8 m as valley bottoms, cells with TPI values ≥
8 m as ridgelines, and cells with TPI values between - 8 and + 8m and slope < 60 as gentle
slopes or slope ≥ 60 and TPI values between - 8 and + 8m as steep slopes (Dickson and
Beier, 2007)1.
1. Click the Add raster layer button and select the file
HILLY_DEM_BTM_CORR.tif
2. Click on the menu item Raster ‣ Analysis ‣ DEM (Terrain models).
3. In the dialog that appears, ensure that the Input file is the DEM layer.
4. Set the Output file to HILLY_TPI .tif
5. Select Mode as TPI (Topographic Position Index)
6. Check the box next to Load into canvas when finished.
7. You may leave all the other options unchanged
8. Click OK and Close after generating the TIP map.
1 Dickson, B.G., Beier, P., 2006. Quantifying the influence of topographic position on cougar (Puma concolor) movement in
southern California, USA. Journal of Zoology 271, 270-277.
- 101 -
Topographic Ruggedness Indices (TRI)
The Terrain Ruggedness Index (TRI) can be clarified as the mean difference between a central
pixel and its surrounding cells. Using this tool, terrain heterogeneity (variation) can be
calculated. This provides a relative measure of elevational changes between a specified grid
cell and neighbors. The TRI is useful for analyzing what environments might be suited to
particular crops or species which may be sensitive to particular sloped environments, or for
assessing the potential flow of soil during erosion events, and so on.
1. Click the Add raster layer button and select the file
HILLY_DEM_BTM_CORR.tif
2. Click on the menu item Raster ‣ Analysis ‣ DEM (Terrain models).
3. In the dialog that appears, ensure that the Input file is the DEM layer.
4. Set the Output file to HILLY_TRI .tif
5. Select Mode as TRI (Topographic Ruggedness Index)
6. Check the box next to Load into canvas when finished.
7. You may leave all the other options unchanged
8. Click OK and Close after generating the TRI map.
- 102 -
Roughness
When comparing among the differences in cells in a raster and a central pixel, you are making
a comparison of roughness. This is useful for helping to determine the overall variation and
frequency of change in elevation in a DEM, or particular selected parts of a DEM.
1. Click the Add raster layer button and select the file
HILLY_DEM_BTM_CORR.tif
2. Click on the menu item Raster ‣ Analysis ‣ DEM (Terrain models).
3. In the dialog that appears, ensure that the Input file is the DEM layer.
4. Set the Output file to HILLY_ROUGH .tif
5. Select Mode as Roughness
6. Check the box next to Load into canvas when finished.
7. You may leave all the other options unchanged
8. Click OK and Close after generating the roughness map.
- 103 -
Terrain Analysis using SAGA plugin in QGIS
SAGA (System for Automated Geoscientific Analyses) GIS is a free and open source
geographic information system used for editing spatial data. Initially developed by scientists at
the University of Göttingen in Germany, SAGA, like QGIS, is being continually developed and
updated by a community of GIS users. and click OK.
Before using SAGA commands in QGIS, you need to activate SAGA following way:
PROCESSING --> OPTIONS AND CONFIGURATION --> PROVIDERS ExpandSAGA
Switch Activate and Enable SAGA Import/Export optimization to ON and click OK.
1. Click the Add raster layer button and select the file
HILLY_DEM_BTM_CORR.tif
2. Expand SAGA ->Terrain Analysis – Morphometry in the Processing Toolbox (you
may have to select this option from the menu to load this window)
3. Click on Slope, aspect, curvature
4. Elevation: HILLY_DEM_BTM_CORR
5. Method: [5] Fit 2.Degree Polynom
- 104 -
6. Save to file
Slope: ~/MODULE_09/Data/SAGA_Slope
Aspect: ~/MODULE_09/Data/SAGA_Aspect
Curvature: ~/MODULE_09/Data/SAGA_Curvature
Plan Curvature: ~/MODULE_09/Data/SAGA_PlanCurvature
Profile Curvature: ~/MODULE_09/Data/SAGA_ProfileCurvature
Curvature
Curvature is the change in the degree of slope for a given distance on that slope. It is a very
helpful measure to understand the surface water flow through a landscape, and can be used
in part to help design an irrigation scheme, for example. It is widely used by hydrological
scientists. When interpreting data from a curve, any positive values indicate a convex (upward
bulging) slope, while negative values correspond to a convex (downward facing) curve. The
first is like a dinner bowl sanding correctly on a table, the latter is like a bowl that has been
flipped over and is facing down. Any pixels observed that show positive curvature indicate the
potential for liquid flow dispersal away from a central area, while and negative values indicate
accumulation. In combination, convex and concave surfaces approximate actual topography.
A Plan curve is the measurement of the rate at which a horizontal curve changes. Positive
and negative values respectively indicate divergence and convergence of a particular slope.
Highlight a divergent slope, negative values a convergent slope.
- 105 -
A Profile curve is conversely a vertical measurement of the change of a slope. Positive values
indicate convexity, while negative values represent concave profiles.
- 106 -
Module 10: Spatial Analysis
By examining locations, attributes, and relationships between and of features of spatial data,
we conduct spatial analysis. The analytical process proceeds by overlaying layers and using
many of the tools and techniques you have learned in module 1 – 9. The result of an analysis
is usually the summary or extraction of new data from spatial information. In thismodule, we
will cover the following analytical processes:
- 107 -
Extract grid values to point shape file
How can a regular grid of points and/or sample a raster dataset manipulated to extract the
individual pixel values? This is a very basic form of raster to vector point conversion.
1. Open QGIS Desktop 2.4.0.
2. Add the GOPAL_DEM raster (.tif file) and GOLPALGANJ_DIST_BD_BTM vector
layers to QGIS canvas
3. Select Vector > Research Tools > Regular Points
4. If necessary, change the Input Boundary Layer set to GOPAL_DEM.
5. In the Grid Spacing section set the point spacing value to 90 as that is the size of our
raster pixels
6. In order to make the regular points fall within the center of each pixel we will add an
offset of half our pixel size, i.e. (90 / 2) = 250. Set the Initial inset from corner (LH
side) value to 15.
7. Click the Browse button for Output Shapefile, navigate to ~\MODULE_10\Data\and
save the file as GOPAL_GRID.shp click OK or Save
- 108 -
8. By clicking OK, we clip GOPAL_GRID with GOLPALGANJ_DIST_BD_BTM
and create a new point layer (GOPAL_GRID_CLIP) using SAGA geo-processing
tools (SAGA->Shape->Cut shapes layer)
Reclassification
- 109 -
TPI TPI Values Slope Class Slope value
Class
1 ≤ -8 m 1 < 6°
2 - 8 to + 8 m 2 ≥ 6°
3 ≤ -8 m
After you have reclassified the slope and TPI data, we will work to recombine them to identify
valley bottoms (TPI ≤ -8 m), ridgelines (TPI ≤ -8 m), gentle hill slopes (TPI= - 8 to + 8 m and
slope < 60) and steep hill slopes (TPI = - 8 to + 8 m and slope ≥ 6°).
b. The first line tells QGIS to recode cells with TPI values < -8.0 m with a new value
of 1
c. Cells with TPI values from - 8 and + 8m will receive a new value of 2 and
d. Those cells with values ≥ 8 m will receive a new value for non-range cells (*) of
3
e. Save the text file to the ~MODULE_10 folder and name it TPI_rRecode_Rules.txt.
3. From the menu bar choose Processing Toolbox. Expand the GRASS commands
toolset Raster (r.*) r.recode - Recodes categorical raster maps.
a. Set the Input layer to HILLY_TPI.
b. Navigate to the ~\MODULE_10\DATA and select the
TPI_rRecode_Rules.txt as the File containing recode rules.
c. Name the output file RE_HILLY_TPI.tif
d. Click Run.
- 110 -
Reclassify Slope raster
a. The first line tells QGIS to recode cells with Slope values < 6.0 ° m with a new
value of 1 ° m
b. Those cells with values≥ 6° mwill receive a new value of 2° m.
c. Save the text file to the ~\MODULE_10 folder and
name it Slope_rRecode_Rules.txt.
- 111 -
Raster Overlay
After reclassification of the slope and TPI data, we will now work to combine them to identify
valley bottoms (TPI ≤ -8° m), ridgelines (TPI ≤ -8 m), gentle hill slopes (TPI= - 8° to + 8° m
and slope < 6° m) and steep hill slopes (TPI= - 8 to + 8° m and slope ≥ 6° m).
In this next step, you will learn how to use the Raster Calculator to combine the reclassified
slope and TPI data. This tool permits the user to combine raster datasets and produce new
outputs for further analysis. Raster datasets can be added, subtracted, multiplied and divided
in a process known as raster algebra.
The above code can be understood as the following set of instructions. For every cell having
a TPI class 2 that indicates a range from - 8° to + 8° m), reset this value to 1, otherwise reset
it to 0, which creates a new mask. The second segment of the code indicates that this raster
will be multiplied by the resulting mask values. In the last part of the code, QGIS will add
"RE_HILLY_TPI@1” to the corresponding mask layer build a new raster with four selected
Land form classes. This process is accomplished as follows:
- 112 -
3. Write above expression in Raster calculator expression window
4. In the Result layer section, name the output layer ~\MODULE_10\DATA
\HILLY_LandForm.tif
5. Then click OK
Zonal statistics
The zonal statistics function summarizes values of a selected raster within the zones that can
be found in another raster or vector dataset. The function reports the resulting data in tabular
- 113 -
form or as a vector layer file. In this exercise, we will calculate descriptive elevation statistics
for four districts of hilly areas (zones) in Bangladesh using the Zonal statistics tool in QGIS.
- 114 -
Module 11: Georeferencing Google Earth Imagery
Google Earth is a free program offered by the Google company that provides relatively high-
resolution satellite images online, which are updated on a regular basis. All imagery is open
source, with relatively good coverage. Where you are unable to access higher resolution or
proprietary satellite imagery, Google Earth offers a useful alternative. In this tutorial, we will
explain how you can obtain satellite imagery from Google Earth, and then export it and geo-
reference the image so that you can make maps or conduct further spatial analysis. We will
also explain how to use the clipping tool in QGIS to trim the raster imagery you will download
from Google Earth. To complete this tutorial you must have a copy of Google Earth desktop
application installed on your computer, and also have an active internet connection. Google
Earth can be downloaded here: https://www.google.com/earth/resources. Be sure to
download the most recent version of the software.
Before you can georeference an image downloaded from Google Earth in QGIS, it is important
to first set a few ground control points that have known coordinates. Without doing this, it
is impossible to georeferenced the image for further spatial analysis. In this learning session,
you will locate and indicate four basic ground control points, representing the lower left,
lower right, upper left and upper right corners of the satellite image downloaded from Google
Earth).
1. Open the Google Earth. IF you are not familiar with how to use Google Earth, it
operates similarly to QGIS or other GIS applications. Tutorials on its use can
nonetheless be located here:https://www.google.com/earth/resources
2. On the right side of the screen in the toolbar area, uncheck any borders and labels as
well as roads or boundaries as they may make the satellite image difficult to see and
read.
3. In the search bar, type Tajgaon, Dhaka Division, Bangladesh and then click the
Search button.
4. Zoom into the area of the National Parliament building.
5. Click the Add place mark button. In the Name field, enter “Corner 1”. After giving
the name, click on the place mark icon button on the right of the field. Next look at
the icon selection window. There will be a bull’s-eye mark, which you will place your
curser on and then click OK.
6. Now look for the Style toolbar. Select the, color tab set the opacity of labels to 0%.
This will hide the label so the screen and satellite image is easily visible. Nowdrag the
place mark icon to the uppermost left corner of the image, stopping wherever you
would like to delineate the boundary that will be the cut off of your satellite image.
7. Use the same process for the other corners of the image, which you will label
appropriately as corner 2, 3, and 4. When completed, you will have set up four ground
control points around the edges of the National Parliament area, delineating the
portion of the satellite image you will then extract.
8. When you are ready, position your curser the top left hand corner of Google Earth,
and select File > Save > Save Image. Give the image the title ‘Dhaka.jpg’.
9. If you have been working in fill screen mode, next press F11 to disable full screen
mode so you can see multiple programs and windows. Take a moment to note in an
- 115 -
excel spreadsheet the latitude and longitude values the four ground control points for
‘Dhaka.jpg’ that you just selected. Next, save the spreadsheet as Control_point.xls.
Next, right click on the Corner 1 place mark you set earlier, and select properties.
Go back to your spreadsheet, and copy the Longitude value and paste it into the X
column of your spreadsheet, then copy the Latitude value and do the same. QGIS
Georeferencing requires that locations be entered in X, Y pairs, which is why we have
advised this step. Repeat this process until you have X, Y pairs stored in Excel for all
four-place markers.
1. Open QGIS
2. Go to Raster->Georeferencer-> Georeferencer plugin
3. Click the "Open raster" icon to import your recently created satellite image.
4. Now find your way to Dhaka.jpg on your computer, select it, and click Open. The
image will then appear in the dialog box so you can work with it in QGIS.
5. Click on the zoom in tool and draw a box zoom around the Corner 1 bull’s-eye that
you will see.
6. You will now georeferenced the image in QGIS. Click the Add Point button and click
precisely in the center of the bull’s-eye. A pop-up window will then appear; that you
can add your X and Y coordinates to.
7. Using your spreadsheet as a guide, type or copy-paste the values for the lower left
bull’s-eye. It is important that you use the precise format that QGIS understands, so
your latitude and longitude values should look roughly like X: 90 22 12.31, and Y: 23
45 55.33. After you complete adding the coordinate values for Corner 1, you will see
the record appear in the GCP table below your satellite imagery in the Georeferencer
window of QGIS, as seen below.
- 116 -
8. Click OK to accept the changes you made.
9. Zoom out. Next, recreate the same steps but by entering the three other ground
control points until your image is fully georeferenced.
10. Once you have added all of the ground control points (remember, you can also add
more than four if you wish), select Settings > Transformation settings. We will be
keeping the default options of Linear transformation type, Nearest neighbor
resampling method and compression LZW
11. Once done, click on the output raster icon and find your way to the directory in which
you saved your original satellite imagery from Google Earth. Save the new file from
QGIS in the same folder, but with the name Dhaka_geo.tif.
12. For a target SRS , we suggest that you use the EPSG: 4326 coordinate system. This is
the WGS 84 global Latitude and Longitude projection.
13. It is important that you assure that the checkbox is enabled to Load in QGIS. When
you are done with this step, click OK so save the transformation settings.
14. In addition, remember to save your ground control points. This can be accomplished
by clicking Save GCP points as, and then save the ground control points into a file
called Dhaka.jpg
15. We are now ready to start georeferencing, click on the play button in the top left
hand corner of the Georeferencer window. Once the process is complete, you will
see your satellite imagery load in the main QGIS mapping area.
- 117 -
Clipping the Raster Image
You will now learn how to clip the raster image you just created, so you can work with it in
refined form.
- 118 -
Module 12: Creating a New Vector Dataset
All data has to be sourced from somewhere. For most common geospatial applications, data
can usually be found online or in open-access databases. However, the more particular and
specialized your project, the less likely it is that data will easily be available. In these cases, you
will may need to create your own new data from existing datasets, maps, images, or other
sources. The goal for this module is to create a new vector dataset. This will provide
background on how to create data that you can use for additional analyses.
Before you can add new vector data, you need a vector dataset to add it to. In our case, you
will begin by creating a new vector dataset entirely, rather than editing an existing dataset as
you have in previous modules. Therefore, you will need to start by defining your own new
dataset.
First, you will need to open the New Vector Layer dialog that will allow you to define a new
layer.
- 119 -
1. Click Point radio button from Type section of the New Shapefile Later window
2. Then under file encoding drop-down menu select file encoding UTF-8
3. Type class name in the name field
4. Keep textdata in type field
5. Leave length and precision at their default settings
6. Click ‘Add to fields list’
7. Click ‘ok’
8. ‘Save layer as’ window popup and save the shapefile as point in data directory of the
Module 12 directory.
This will create a point shapefile. In order to create a line or polygon, please select the line
or polygon radio button from the type field of new shapefile window accordingly.
- 120 -
Getting started with digitizing
- 121 -
5. After clicking a popup window of attribute table will appear, Type 1 in the id field
and National Parliament House in the name field.
6. A point has now been added after this attribute entry.
- 122 -
7. You can also add several additional points of interest throughout the image as you
choose.
8. Now click on the Save Layer Edits button to save your editing, and then on the
Toggle Editing button to close editing mode.
1. Create a line shapefile following the poitn shapefile creation steps except choosing
line radio button from Type section of the New Shapefile Later window.
2. ‘Save layer as’ window popup and save the shapefile as line in data directory of the
Module 12 directory.
- 123 -
Adding polygon features
1. Create a polygon shapefile following the poitn shapefile creation steps except
choosing Polygonradio button from Type section of the New Shapefile Later window.
2. ‘Save layer as’ window popup and save the shapefile as polygon in data directory of
the Module 12 directory.
3. Click the Toggle Editing button from the Digitizing toolbar
4. Now click on the Add Feature button from the Digitizing toolbar, as shown below:
5. Click and insert a node for the starting point of your polygon feature and continue
clicking along the edge of the waterbody (Hatir Jhil) until the temporary polygon
mathes the edges of the waterbody in the image. After inserting the end point, right
click to finish your polygon representation of the waterbody.
6. The atribute table will popup when you do this. Add the identification for this feature
by adding the waterbody name, or the name of any other feature you choose to
inlclude. This will add the polygon feature in the form of a polygon shapefile.
7. Now click on the Save Layer Edits button to save your polygon. Finally, click on Toggle
Editing button to close editing mode.
- 124 -
It is important to decide which kind of dataset you want at this stage. Each different vector
layer type is “built differently” (i.e. point, line, polygon) in the background, so once you’ve
created the layer, you can’t change its type. Once you have made your first vector layers, you
can add more features using each type shapefiles you learned how to create. An example of
a more detailed set of line and polygon vector files is shown below in the following figure.
- 125 -
Module 13: Map Production in QGIS
Congratulations! You have made it to the last learning module in this QGIS educational
training. This module will bring together the skills you have learned so you can make a map
in QGIS to represent your work. The production of maps involves the process of arranging
map elements on surface in such a way that, even without many words, numbers, or additional
information, an ordinary person can read the map and understand clearly most of the
information in the map. While maps are often produced with no specific audience in mind,
some maps are highly technical and for specific specialists in specific fields. But again, the
purpose of most maps is to clearly communicate. Any map you make therefore has to be
efficient in communicating spatial data to a wide audience, or even to a specialized technical
audience. Most maps have the following components, which you will need to think about in
making your map.
- 126 -
The Map/Print Composer
To make maps in QGIS, you will use the print composer window. It is in this window that
you will create, layout, and print all maps with their corresponding elements. The print
composer is relatively versatile, and can be used to align, change the size of, group, and arrange
all of the elements you want in your map. The print composer is also the place where you
will be able to adjust the properties of your layout. You can also export images in a variety of
different formats from the print composer. When carefully saved, you can open the layout
again to continue to work on it. Note that the tool is a bit touchy and takes some time to
learn how to efficiently make effective maps. Be patient and persevere in your learning, as it
will have great rewards. The print composer is shown below.
You will notice that the print composer has four important tabs. They are summarized below
• The first tab is the Composition tab. It is used to set the size of the paper you will print
on, orient your map, and change the quality if what you will print onto paper. This tab
also allows you to activate a grid that your image can be ‘snapped’ (positioned) to at a
resolution of your choice. You can also modify the number of pages you might expect
to print or layout your map on.
• The second tab is theItem Properties tab. This tab is used to show the properties of an
element that you can select in the map itself. To use the item properties tab, Click
the Select/Move item icon and choose an element (e.g. legend, scale, compass,
etc.) on the canvas. Watch as information about that element appears for editing.
• The third tab is particularly useful. The Atlas generation tab will generate an atlas. It also
grants you access to the atlas, which will help you to make more creative and clear
maps.
- 127 -
• The last of the tabs is the Command history tab, which is hidden by default. When
enabled, this tab displays historical accounting of each step and change that has been
made to the map while working in the print composite. By reviewing this history, you
can use a simple a mouse click undo and redo layout steps, which is very useful for
correcting errors and changing the map.
Now have a look at the icons across on the left hand size of your print composer window.
The table below reviews what some of the icons you see mean, and indicates what they do.
Display
Function
Icon
Add New Map icon is used to add a new element to your map. It is however very
important to note that if you change a map in a QGIS project, it does not automatically
update the same map that you have added to you print composer, as we shall see later.
Additional steps are needed to do this.
Add Image allows is used when you want to add a picture image to your map. Images
include compasses, or logos, or other media you think will be of use.
Add New Label. This is used when you want to add new text at a location of your
choice on the map.
Add New Legend is for adding a legend, which will conform to the active layer in the
QGIS window.
Add New Scale Bar is a self-explanatory button that adds new scales to your map to
measure length.
Add Ellipse/Triangle/Rectangle is used to when you are interested to add a shape to
your map. Use of shapes can enhance maps in many ways, ultimately to make the map
look more attractive.
Add Arrow is used to draw an arrow on the map. Arrows are useful to call the reader’s
attention to a particular element of the map.
Select / Move Item allows us to move choose and move the elements that you add to
the This is the map layout tool.With this tool selected, you can right -click on an element
to lock its position.
You will now learn how to work with print composer and make a map.
- 128 -
4. Once you have given a name you like, click OK, then a composer window will load on
your screen
- 129 -
9. Next check Draw coordinates
10. Select the format: DegreeMinute
11. On the left: Select outside frame and Vertical
12. Do the same for the right
13. Change your font size 12 or any size of your choosing.
14. Set the distance to the map frame (experiment with what looks good to you, but we
suggest starting with 2 mm)
15. Set coordinate precision to 1
16. You can next add a frame to your map by clicking ‘box’ next to Frame. Here you can
also change and set the frame color and line thickness to your preferences.
- 130 -
Give your map a title
1. Each map needs a good title to orient the map-reader. To add a title, click on the Add
new label button, which looks like this:
2. Adjust the size of the element to your choosing. The actual text and details of the
style and font elements are shown to the right.
3. Click the Font button and change the text size to 36 (or any size you prefer).
Experiment with making it bold, italic, or any style you choose. Change the alignment
to the center of the map (horizontal and vertical) to position the title correctly. Lastly,
add the type “Landtype Map of Gopalganj District”
- 131 -
Add a Scale Bar
1. Scale bars are crucial for giving the reader perspective on the size of the map, and to measure
distances. Click on the Add scale bar button.
2. Using your mouse, click and draw the new scale bar element on your map. Many
people prefer to place their scale on the left corner of your map layout, though you
can choose to put it anywhere you prefer.
3. You will next learn how to adjust the scrollbar options on your map. Since our project
is in a PCS (Projected Coordinate System), all of the measurements in the map will
appear in the metric system. Please enter the following information in the scale bar
options to create a standard quality scale bar, as follows:
- 132 -
Add a Legend
1. In order to add a legend to your map, first click on the Add legend button, which looks
like this:
2. Next draw a box in the area where you wish to see the legend appear in your
map. This will usually be one of the areas with blank space. After drawing the box, you
will see a legend with appear with all relevant symbols for the map elements in it.
3. What if you want to change the legend? You can do this by looking at the panel on the
right, and clicking Legend items. You cannot make use of the edit button to change the
names and other features on the legend, including the font, font size, and so on. If you
want to add or remove items from the legend, use the + and – buttons, respectively.
- 133 -
Printing the Map
• When you are done, you can print the map. Simply click on the Print button, which
looks like the symbol to the right, and follow the instructions..
• Maps can be saved in a variety of formats, including PNG images.
• Maps can also be saved as portable document viewers (PDFs), which many prefer for
emailing and printing, etc.
- 134 -
Glossary of keywords
Azimuth
The angular distance from the north to south point of the horizon that can be transversed by a vertical
circle that intersects the horizon, which represents the direction of an object from the observer.
Clipping
Action that creates a new shape based on the input layer's area, that is overlapped by a clipping layer.
Not to be confused with intersection.
Color ramp
A specified range of colors that change depending on the value of measured data, used to display
gradients on a map.
Convex hull
A convex hull takes the outer border nodes from a vector shape (which you will recall may consist of
points, lines or polygons) and uses them to develop a polygon of the minimum sized area that
surrounds all features in the dataset, but that also avoids any concave angles.
Curvature
The change in the degree of slope for a given distance on that slope.
Digitizing
The process of converting images into digital form that permits computer processing.
Dissolve
Separation of overlapping areas in the same layer.
Ellipsoid
In GIS, a regular oval shape, as a two dimensional representation of the globe as a spheroid.
EPSG code
A geodetic parameter dataset made up of coordinate reference systems (CRSs) that is widely available
online.
Field calculator
A tool for automatically calculating the area of a polygon.
- 135 -
Geographic coordinate system (GCS)
The earth is not a perfect sphere, despite being often depicted as such. Because of this, different
spheroid representations of the earth exist. Geographic coordinate systems use latitude and longitude
to measure and indicate locations on the globe, defined as a function of direction and distance from a
center point. Where representations of the globe however differ, so will the central point from which
coordinate systems are measured. This complicates use of different coordinate systems, especially
when they are to be compared, or data in one system is imported into a GIS basal layer that uses a
different system. This often requires transformation of the coordinate system to assure alignment in
the workspace.
Georeference
To mark a location by tagging it with latitude and longitude values.
Google Earth
Google earth is a freely available online virtual map of the globe and GIS. The homepage for Google
Earth is https://www.google.com/earth/.
Graticule
Networks of lines that when combined represent latitude and longitudes, as represented in a map.
Interpolation
The process of constructing new point data by relying on the range of discrete points available in a
given dataset.
Layer
Layer signifies different levels of information (for example shape files) that are arranged sequentially in
a geographical information system for viewing and spatial analysis.
Nearest Neighbor
An algorithm that interpolates adjacent elements to fill in surfaces with information.
One-dimensional lines
See 'polyline'.
Pan / Panning
To switch view between windows or images on a computer.
Profile-curve
A vertical measurement of the change of a slope over a given distance. Positive values indicate
convexity, while negative values represent concave profiles.
- 136 -
Plan curve
Measurement of the rate at which a horizontal curve changes. Positive and negative values, respectively
indicate divergence and convergence of a particular slope.
Plugin
Software that can be added or 'plugged in' to another piece of software.
Point
See 'Zero dimensional point'.
Point layer
A shapefile or layer that displays point data.
Point shapefile
Shapefile used to geo-locate and describe point features such as villages or cities.
Polygon
Polygons are two-dimensional geographical features covering a portion of the earth’s surface, for
example forests, lakes, administrative boundaries, farmers’ fields, or any other organizational unit the
user defines. Polygons are important because their area and perimeter can be measured.
Polyline
One-dimensional lines, also called polylines, are used to represent geographical features like rivers,
roads, railroads, trails, and topographic lines. Note that these features are linear in nature and do not
have area like polygons. Hence they can measure distance.
Progress bar
Located in the status bar, the progress bar shows progress of rendering as each layer is drawn to the
map view.
Raster algebra
The process of adding, subtracting, multiplying, or dividing data within raster files to create new
outputs.
Raster reclassification
The process of aggregating data values into specified data categories.
- 137 -
Re-project (re-projection)
To change the geographic coordinate system of a particular layer into another one.
Roughness
When comparing among the differences in cells in a raster and a central pixel, you are making a
comparison of roughness. This is useful for helping to determine the overall variation and frequency
of change in elevation in a DEM, or particular selected parts of a DEM.
Scene
Captured path image from a satellite or other aerial survey instrument.
Shape file
A popular geospatial vector data format for geographic information system GIS software. It is
developed and regulated by ESRI as an open specification for data interoperability among ESRI and
other GIS software products. A "shapefile" is actually a set of several files. Three individual files are
needed to store the core data that comprises a shapefile: .shp (shape format; the feature geometry),
.shx (shape index format; a positional index of the feature geometry to allow seeking forwards and
backwards quickly), and .dbf (attribute format; columnar attributes for each shape, in dBase IV format).
The actual shapefile relates specifically to .shp files, but alone are incomplete for distribution, as the
other supporting files are required.
Slope
Slope is the incline and steepness of a surface.
Status bar
The status bar shows you your current position in map coordinates (e.g. meters or decimal degrees)
as the mouse pointer is moved across the map view.
Text delimited
A data storage file in which each line of the file represents a different entry separated by a delimiter.
This allows data fields of any length that the user might want. In QGIS, text delimited file is an attribute
table. Each separate column has a separate and defined data character, and each row is independent.
The first row references column names.
Toggle
To switch between two modes, choices, or windows, or keys on a computer.
Vector
In vector data models, geographical features are represented using lines, points, and polygons. Vector
models conversely store date with discrete edges and boundaries, for example district or division
boundaries, country borders, road and river networks, etc.
- 138 -
Z-ordering
In the map layer, Z-ordering means that layers listed nearer the top of the legend are drawn over
layers listed lower down in the legend.
Zero-dimensional point
Considering mathematics, a zero-dimensional point is an abstraction of an object that can be
represented by latitude and longitude coordinates. Representative of geographical features like wells,
soil sampling locations, and so on,, that can be best expressed by a single reference point. These points
confer the least information about these file types, and are best to represent geographical data that
are very small scale and with limited area.
Zonal statistics
The zonal statistics function summarizes values of a selected raster within the zones that can be found
in another raster or vector dataset. The function reports the resulting data in tabular form or as a
vector layer file.
Zoom
To smoothly transition from a long-distance view to a close-up view, or vice versa, on a computer.
- 139 -
About the authors
Zia Uddin Ahmed
Dr. Ahmed has over 20 years of work experience in environmental
modeling and data analysis. His Areas of expertise include (1) data
mining, (2) geographic information systems (GIS), remote/proximal
sensing, and geostatistics (3) linear/non-linear model, mixed effect
model, multivariate statistics and machine learning and (4) database
management. He is currently a Research Associate Professor and
database and visualization specialist at the University of Buffalo’s
Research and Education in Energy, Environment and Water
(RENEW) Initiative. He holds a PhD in Soil Science from Cornell
University. Before RENEW, he worked for the International Maize
and Wheat Improvement Center (CIMMYT) as a Remote Sensing
Scientist in Bangladesh. Before CIMMYT, Dr. Ahmed also worked
for the Bangladesh Rice Research Institute (BRRI) and Cornell
University.
Timothy J. Krupnik
Dr. Timothy Krupnik is a Research Scientist and Systems
Agronomist with the International Maize and Wheat Improvement
Center’s (CIMMYT) Sustainable Intensification Program. He leads a
portfolio of applied research projects across South and South-East
Asia that deliver evidence-based knowledge and activities to improve
the sustainability and resilience of smallholder farming systems
considering agronomic, ecological, and socioeconomic objectives,
methods, and indicators. With core expertise in systems agronomy
and interests spanning socio-ecological systems analysis, climate
services, and science communication and extension, Timothy
prioritizes integrative, interdisciplinary, and multi-scale research. He
also serves as the overall CSISA coordinator for Bangladesh. Prior
to CIMMYT, Timothy was affiliated with the Africa Rice Center and
researched the agronomic, environmental and socioeconomic
consequences of water-saving irrigation technologies in West Africa.
He has also worked in East Africa and the Caribbean consulting for
donor agencies and NGOs.
Mustafa Kamal
Mustafa Kamal is a GIS and Remote Sensing professional with the
International Maize and Wheat Improvement Center’s (CIMMYT)
Sustainable Intensification Program. He has more than 8 years of
working experience and specializes in the effective and efficient use
of geospatial data applications across disciplines. With a background
in urban and rural planning and disaster management, he is expert
in the use of GIS, Remote Sensing (Optical, SAR, Thermal),
Unmanned Aerial Vehicle (UAV) technologies, and machine learning
algorithms for pixel and object based image analysis. He is also
interested in land use and land cover classification using machine
learning methods applied to remotely sensed data. Mustafa is
passionate about using cutting edge remote sensing science to
provide a better understanding of the complex relationships
between crop performance and environmental change, while
providing useful information and advisories for farmers.
- 140 -
Introduction to basic GIS and spatial analysis using QGIS:
Applications in Bangladesh
This book provides a set of learning modules introducing young scientists and researchers to
Geographic Information Systems (GIS) and spatial analysis using the open-source QGIS platform,
and complementary R, SAGA and GRASS Platforms. The modules can be used for self-directed
learning or to teach courses. Practical exercises that utilize spatial data for Bangladesh are included,
and all required spatial data can be downloaded from an open-source website. The modules provide
an overview of GIS, spatial data visualization techniques, and exercises in working with Global
Positioning System (GPS) data, tabular, and raster data. Students will also learn terrain and spatial
analysis, and also how to do georeferencing Google Earth image with QGIS and to develop new
vector datasets and digitizing. Exercises on how to produce aesthetically pleasing and informative
maps are also included. By the time students complete working with these modules, they should be
proficient in QGIS and spatial data analysis, and able to continue using these tools on an individual
basis without considerable extra coaching.
- 141 -