You are on page 1of 157

Training Manual for

5-Day QIP & CEP Short Term Course

on

GIS for Civil Engineers

May 23-27, 2016

Course Coordinator

Dr. RAAJ Ramsankaran

Department of Civil Engineering

Supported by

Office of Continuing Education & Quality Improvement Programmes

Indian Institute of Technology Bombay

Powai, Mumbai 400 076

. i
Training Manual for 5-day QIP Short-Term Course on GIS
May 23-27, 2016, IIT Bombay.

Prepared by:
Shruti Upadhyaya, Research Scholar, Department of Civil Engineering, IIT Bombay.
Pratiksha Jain, Research Scholar, Department of Civil Engineering, IIT Bombay.
Sathya Kumar V, Research Scholar, Department of Civil Engineering, IIT Bombay.

Note:
This manual consists of materials collected from various sources that have been duly
acknowledged (See page 152).

. ii
PREFACE

Civil Engineering deals with the development and sustenance of infrastructure. The
applications of Civil Engineering may cover a broad range of fields such as Structural
Engineering, Water Resources Engineering, Transportation Engineering, Environmental
Engineering and Management etc. Working on these applications, a Civil Engineer is
required to handle large volumes of multidimensional geographical (spatial) information of
weather, soil, topography, water resources, socio economic status, etc. To handle these
datasets and integrate them in a consistent form, one requires the use of Geographical
Information Systems or GIS.

The knowledge and use of GIS is essential to any application that involves the spatial
component. GIS technology provides the tools for creating, managing, analyzing, and
visualizing spatially referenced data. In order to gain maximum benefits from GIS, one need
not depend on the Proprietary GIS Software packages which are highly expensive with
limited number of licenses for limited time period; rather one can opt for Open source GIS
tools that are freely available and can be developed by any user.

This short term program on GIS for Civil Engineers is mainly aimed to spread the
importance of GIS for civil engineers by teaching the basic concepts of GIS, and spread
awareness about the freely available Open Source GIS software packages. In line with these
objectives, this training manual has been prepared where the trainee is introduced to the
fundamental concepts of GIS and the tools available in QGIS, an open source GIS software
package. This manual also includes laboratory exercises to help the trainee gain hands-on-
experience in using QGIS. Using this training manual, the trainee will be able to work on
spatial and attribute data, and perform operations such as Watershed Delineation, and prepare
output maps using QGIS.

. iii
TABLE OF CONTENTS

Chapter No. Title Page No.

1 Fundamental Concepts of Geographic Information Systems 1

2 Laboratory Exercises 20
1. Introduction to QGIS 22
2a. Projection and Re-projection. 34
2b. Georeferencing and Image Registration 44
3. Digitization 55
4. Map Preparation 64
5. Urban Spatial Analysis 79
5a. Working with Tables 80
5b.Attribute Querying 86
5c. Spatial Querying 90
5d. Creating Heatmaps 98
6. Application of QGIS for Natural Resource Management 105
6a. Terrain Data Analysis 106
6b. Introduction to QGIS Plugins 111
6c. Watershed Delineation using GRASS Plugin 115
6d. Soil Erosion Hazard Mapping 123
7. WMS and WFS Services 138

3 Web Resources 148

Acknowledgement 152

. iv
CHAPTER 1

Fundamental Concepts
of
Geographical Information Systems

. 1
Fundamental Concepts of
Geographical Information Systems- An Overview

1.1. INTRODUCTION
Geography is the study of Earths features and patterns of their variations in spatial
location and time. Many questions of agricultural production are geographic in nature as the
production depends on the environment and prevailing socio economic conditions, both of
which vary spatially and in time. Examples are questions related to natural resources
management, precision agriculture, agro-ecological classification for land use planning,
regional trends and patterns in technology adaptation, agricultural productivity and income,
non-pont source pollution from agricultural lands, etc. Answering these questions requires
access to large volumes of multidimensional geographical (spatial) information of weather,
soils, topography, water resources, socio economic status, etc. Further, answers to even
apparently simple questions require that the data from several sources be integrated in a
consistent form. Geographical Information Systems or GIS enable representation and
integration of such spatial information.
The traditional method of presenting geographical information in two dimensions is in
the form of maps. Maps are graphic representations of the earth's surface on a plane paper.
They shape the way we visualize, assess and analyze spatial information. A map consists of
points, lines and area elements that are positioned with reference to a common coordinate
system (usually latitude and longitude). They are drawn to specified scales and projection.
Map scales can vary and depend on the purpose for which the maps are created. Projection is
a mathematical transformation used to represent the real 3-dimensional spherical surface of
the earth in 2-dimensions on a plane sheet of paper. The map legend links the non-spatial
attributes (name, symbols, colors, and thematic data) to the spatial data. The map itself serves
to store and present data to the user. Such, analogue maps (on paper) are cumbersome to
produce and use, particularly when there are a large number of them to be used for analysis.
Computer based GIS facilitates both creation of maps and using them for various complex
analyses. It allows working with geographic data in a digital format to aid decision making
in resources management
GIS is a generic term implying the use of computers to create and display digital
maps. The attribute data which describe the various features presented in maps may relate to

. 2
physical, chemical, biological, environmental, social, economic or other earth surface
properties. GIS allows mapping, modelling, querying, analyzing and displaying large
quantities of such diverse data, all held together within a single database. Its power and
appeal stem from its ability to integrate quantities of information about the environment and
the wide repertoire of tools it provides to explore the diverse data. The history of
development of GIS parallels the history of developments in digital computers and database
management systems on one hand and those in cartography and automation of map
production on the other. The development of GIS has also relied upon innovations made in
several other disciplines geography, photogrammetry, remote sensing, civil engineering,
statistics, etc.
A GIS produces maps and reads maps. Its major advantage is that it permits
identifying spatial relationships between specific different map features. It can create maps in
different scales, projections and colors. But it is not just a map making tool. It is primarily an
analytical tool that provides new ways of looking at, linking and analyzing data by projecting
tabular data into maps and integrating data from different, diverse sources. This it does by
allowing creation of a set of maps, each with a different theme (soils, rainfall, temperature,
relief, water sources etc.).
From its early beginnings, GIS has been an integrating technology both from the point
of view of its development as well as its use. This is because, once geographic information of
any kind is translated into the digital form in a GIS, it becomes easy to copy, edit, analyze,
manipulate and transmit it. This allows vital linkages to be made between apparently
unrelated activities based on a common geographic location. This has led to fundamental
changes in the way resource management decisions are made in a variety of situations - forest
management, marketing management, utility management, transportation, as well as in
agricultural, environmental and regional planning and management. Some potential
agricultural applications where GIS can lead to better management decisions are: precision
farming, land use planning, watershed management, pest and disease management, irrigation
management, resources inventory and mapping, crop area assessment and yield forecasting,
biodiversity assessment, genetic resources management, etc.

1.2. DEFINITION OF GIS


A GIS is basically a computerized information system like any other database, but
with an important difference: all information in GIS must be linked to a geographic (spatial)
reference (latitude/longitude, or other spatial coordinates).

. 3
GIS = G + IS

Geographic reference + Information system

Data of spatial coordinates Database of attribute data


on the surface of the earth corresponding to spatial
(Map) location data location and procedures to
provide information for
decision making

GIS = IS with geographically referenced data

There are different definitions of GIS, as different users stress different aspects of its use.
For example:
(i) ESRI defined GIS as an organized collection of computer hardware, software,
geographic data and personnel designed to efficiently capture, store, update,
manipulate, analyze and display geographically referenced information.
(ii) ESRI also provided a simpler definition of GIS as a computer system capable of
holding and using data describing places on the earths surface).
(iii) Duecker defined GIS as a special case of information systems where the database
consists of observations on spatially distributed features, activities or events,
which are definable in space as points, lines or areas. A GIS manipulates data
about these points, lines or areas to retrieve data for ad hoc queries and analyses.
The United States Geological Survey (USGS) defined provided A GIS as a computer
hardware and software system designed to collect, manage, analyze and display
geographically (spatially) referenced data. This definition is a fairly comprehensive and is
suitable for agricultural applications of GIS.

Note that a GIS does not store a map or image. What it stores is a relational
database from which maps can be created as and when needed. Relational database
concepts are particularly crucial to the development of GIS. Each map (say a soil map)
can be considered to hold a layer or a level of information. A GIS works with several
layers of such thematic data. It can answer questions by comparing the different layers
and also by overlaying them if all the layers are referenced to the same locations, i.e., the
location is the common key for all the thematic data sets. This ensures that every location
(spatial reference point) is exactly matched to its location on other maps. Once this is
done, the different layers can be compared and analyzed singly and in combination to
identify spatial patterns and processes. Thus, GIS are related to other database
applications, but with an important difference; all information in a GIS must be linked to a
spatial reference. Other data bases may contain locational information (addresses, pin
codes etc), but the GIS uses georeferences for storing and accessing information.

. 4
1.3. WHAT A GIS CAN DO?
There are five basic questions which a complete GIS must answer. These are:
What exists at a particular location? Given a geographic reference (e.g. lat, long) for a
location, the GIS must describe the features of that location

Where can specific features be found? This is the converse of the first question. For example,
where are the districts with rainfall greater than 500 mm and less than less than 750 mm?

Trends or What has changed over time? This involves answering both questions above. For
example, at what locations are the crop yields showing declining trends?

What spatial patterns exist? If occurrence of a pest is associated with a hypothesized set of
conditions of temperature, precipitation, humidity, where do those conditions exist?

Modelling or What if ? This is a higher level application of GIS and answers questions like
what would be the nitrate distribution in groundwater over the area if fertilizer use is
doubled?

The abilities to separate great quantities of information about the environment into
layers, explore each layer with a powerful suite of analytical tools, and then combine the
layered information to use it in an integrated fashion is what makes the GIS a powerful
and effective decision-support tool for agricultural and environmental management.

1.4. GEOGRAPHIC REFERENCING CONCEPTS


A GIS is to be created from available maps of different thematic layers (soils, land
use, temperature, etc). The maps are in two-dimensions whereas the earths surface is a 3-
dimensional ellipsoid. Every map has a projection and scale.
To understand how maps are created by projecting the 3-d earths surface into a 2-d
plane of an analogue map, we need to understand the georeferencing concepts.
Georeferencing involves 2 stages: specifying the 3-dimensional coordinate system that is
used for locating points on the earths surface that is, the Geographic Coordinate System
(GCS) and the Projected Coordinate System that is used for projecting into two dimensions
for creating analogue maps.

. 5
1.4.1. Geographic Coordinate System
The traditional way of representing locations on the surface of the earth is in the 3-
dimensional coordinate system is by its latitude and longitude (Figure 1.1).

Figure 1.1. Latitude and Longitude (Source: ESRI)


Note that the distance between two points on the 3-d earths surface varies with
latitude. The 3-d system therefore does not provide a consistent measure of distances and
areas at all latitudes.
The true surface of the Earth is not the smooth ellipsoid shown in the figure but is
quiet uneven and rugged. The GCS which is the surface used for specifying the latitude and
longitude of a point on the earths surface is also an approximation and a 3-d model of the
earth. Several standard models of the ellipsoid are available to define the GCS (WGS 84,
Everest ellipsoid) etc. The different models vary in their critical parameters (semi major or
equatorial axis and semi minor or polar axis of the ellipsoid and the point of origin). The
ellipsoid model that is used to calculate latitude and longitude is called the datum. Changing
the datum, therefore, changes the values of the latitude and longitude.
Specifying the Geographic Coordinate System therefore requires specifying the
Datum. The datum is a fixed 3-d ellipsoid that is approximately the size and shape of the
surface of the earth, based on which the geographic coordinates (latitude and longitude) of
a point on the Earths surface are calculated. In fact describing a place by its lat/long is
not complete without specifying its datum. In India the Everest Ellipsoid is used as the
Datum for the Survey of India maps.

The ideal solution to would be a spheroidal model of the Earth that has both the
correct equatorial and polar radii, and is centered at the actual center of the Earth. One would
then have a spheroid, that when used as a datum, would accurately map the entire Earth. All

. 6
lat/longs on all maps would agree. That spheroid, derived from satellite measurements of the
Earth, is GRS80, and the WGS84 datum matches this spheroid.

1.4.2. Projected Coordinate System


The development of GIS starts with an available map on paper (an analogue map).
This map therefore represents a projection of a 3-d GCS in 2-dimensional form (Figure 1.2).
Projection is a mathematical transformation used to project the real 3-dimensional
spherical surface of the earth in 2-dimensions on a plane sheet of paper. The projection
causes distortions in one or more spatial properties (area, shape, distance, or direction).

Geographic Projected coordinated


coordinate system system

Equations
and
parameter
s

Figure 1.2. Conversion of GCS into PCS (Adopted from ESRI)


There are many methods of map projections, since there are an infinite number of
ways to project the 3-dimensional earths surface on to a 2-dimensional planar surface. The
3-d to 2-d projections can be done to a plane or to the surface of a cone or cylinder leading to
azimuthal, conic or cylindrical projections respectively with many variations (Figure 1.3).

Types of Projections

Cylindrical Conical Planar/azimuthal


projection projection projection

Figure 1.3. Types of Projection (Adopted from ESRI)

. 7
MAP PROJECTIONS LEAD TO DISTORTIONS ..
Choice of Projections depends on allowable distortions in:

SHAPE

AREA

DISTANCE

DIRECTION
(Angle)
Adopted from ESRI

Figure 1.4. Distortions due to map projections


Depending on the scale and the agreeable tradeoffs with respect to distortions (Figure
1.4), a specific projection form is chosen. Different countries have adopted different standard
projections at different map scales. In India, the polyconic projection is commonly used by
Survey of India (SOI). All SOI toposheets prepared before the year 2000 are in the polyconic
projection. But the new updated SOI toposheets are prepared in UTM projection with the
WGS 84 datum.

1.4.3. Map Scale


Map Scale is the ratio of distances on map to distances to on the surface of the earth.
It is specified in verbal, numeric or graphical form on all standard maps.

Figure 1.5. Means of representing scale of a map.


A graphical scale should be present on all maps that are used in GIS as it ensures that
any changes in scale in photocopying, etc. are accounted for. The standard map scales are:
1:1,000,000 Country level or State level
1: 250, 000 State or District level
1: 50,000 District level
1: 12,500 Micro level
Survey of India maps are available at all the above levels except the micro-level.

. 8
1.5. CREATING A GIS
Like for any other Information System, creating a GIS involves 4 stages:
(i) Data input
(ii) Data Storage
(iii) Data Analysis and modelling, and
(iv) Data Output and presentation
The distinction from other Information Systems is that for a GIS the data inputs are of
two types, (as shown in Figure 1.6):
(i) Spatial data (latitude/longitude for georeferencing, the features on a map, e.g. soil
units, administrative districts), and
(ii) Attribute data (descriptive data about the features, e.g. soil properties, population
of districts, etc.)

Components of Geographic data


Attribute
Spatial data data

SPATIAL DATA SOURCES

Source: (Murai and Murai, 1999))

Figure 1.6. Components of Geographic Data


Spatial data sources for creating a GIS are analogue maps (soil map, land use map,
administrative districts, map, agro-ecological zone map etc.) or aerial photographs and
satellite imageries. Data input is the process of encoding analogue data in the form of maps,
imageries or photographs into computer readable digitized form and writing data into the GIS
database.

1.5.1. GIS Data Input


Spatial Data capture (representing locations in a database) can be in two basic
formats:
(i) Vector format
(ii) Raster format

. 9
In the Vector format, reality is represented as points lines and areas and in the raster
format, reality is represented as grid of cells/pixels. The Vector format is based on discrete
objects view of reality (analogue maps) and the raster format is based on continuous fields
view of reality (photographs, imageries, etc. In principle, any real world situation can be
represented in digital form in both raster and vector formats (Figure 1.7). The choice is up to
the user. Each format has its advantages and disadvantages.

Vector and Raster representations


Vector formats
Discrete representations of reality
X,Y X,Y X,Y

X,Y

Raster formats
square cells to model reality
Rows
Reality
(A highway)

X,Y
Columns
Source: ESRI

Figure 1.7. Vector and Raster Representations


1.5.1.1. Vector Data Capture
This is generally used for capturing data from analogue maps. It is based on the
observation that any map consists of 3 basic kinds of features
(i) Point features,
(ii) Line features and
(iii) Polygon or area features.
Points do not have length, width or area. They are described completely by their
coordinates and are used to represent discrete locational information on the map to identify
locations of features such as, cities, towns, wells, rain gauge stations, soil sampling points etc.
A line consists of a set of ordered points. It has length, but no width or area. Therefore
it is used to represent features such as roads, streams or canals which have too narrow a width
to be displayed on the map at its specified scale.
A polygon or area is formed when a set of ordered lines form closed figure whose
boundary is represented by the lines. Polygons are used to represent area features such as land
parcels, lakes, districts, agro-ecological zones, etc. A polygon usually encloses an area that
may be considered homogeneous with respect to some attribute. For example, in a soil map,
each polygon will represent an area with a homogeneous soil type.

. 10
A vector based system displays graphical data as points, lines or curves, or areas
with attributes. Cartesian coordinates (x, y) or geographical coordinates (latitude, longitude)
define points in a vector system. The generation of spatial data in vector format is shown in
Figure 1.8.
Data is captured from a map in the form of known x-y coordinates or latitude-
longitude by first discretizing the features on the map into a series of nodes (dots) and
digitizing the points one by one directly after placing the map on a digitizer. The digitizer can
be considered to be an electronic graph paper with a very fine grid. The map is placed on the
digitizer and the lines and areas are discretized into a series of points. The digitizers cursor is
used to systematically trace over the points. The points on the map are captured directly as
point coordinates. Line features are captured as a series of ordered points. Area features are
also captured as an ordered list of points. By making the beginning and end points/nodes of
the digitization the same for the area, the shape or area is closed and defined. The process of
digitizing from a digitizer is both time consuming and painstaking. Alternatively, the map can
be scanned and the scanned image digitized on-screen with appropriate software tools. The
latter process is relatively simpler, more accurate and is often preferred.
Digitization is usually done feature by feature. For example, all point features on a
map (say cities, towns etc.) are digitized in one layer. Similarly all line features (e.g. Roads,
rivers, drainage network, canal network etc.) are digitized as a separate layer. So are the
polygon features (soils, districts, agro-ecological zones etc.) For the points feature, the
digitization process builds up a database of the points identification number (ID) and their
coordinates. For the lines it builds up a database of their ID, the starting and end nodes for
the line and its length. In addition the GIS also creates a database of the topology (Figure
1.9); i.e. the spatial relationships between the lines. For the polygons also it develops the
database of their ID, lines or arcs which comprise it, its topology and its area and perimeter.
The identification number (ID) is the key field in each data base (points, lines, areas
databases) as it can be used to relate the spatial data with the attribute data. The data
resolution depends on the discretization of the digitized points on the initial map. Vector
systems are capable of very high resolution (<.001 in) and graphical output is similar to hand
drawn maps. But it is less compatible with remote sensing data for which the raster system is
preferred.

. 11
Spatial data Generation in Vector Format

discretize lines into points (nodes) and digitize as straight-


line segments called vectors or arcs.
data of X,Y coordinates of points and vectors and their
connections (topology) are generated and stored in a database
for areas, geometry (area, perimeter) data are generated
points, lines and areas have independent database tables
Add attribute data to database Adopted from FAO

Figure 1.8. Spatial Data Generation in Vector format.

TOPOLOGY

Source: http://www.colorado.edu/ geography/gcraft/notes

Figure 1.9. Topology created for various features by GIS

. 12
1.5.1.2. Map Projections and Scale
Note that all standard maps which are to be digitized are drawn to specific projection
and scale. But, the digitizer which facilitated the computerized map has its own scale and
units and the digitized maps are in these units and scale. Translating information from the
digitized map into the real world information of locations, lengths and areas requires
information about the mathematical equations used for the projection as well as the scale in
which the original analogue map is prepared. In case several map layers are to be digitized
(topography, soils, districts etc.), it is necessary to ensure that they are all assembled in the
same projection and scale before any spatial analysis is done using them. Most standard GIS
have the facility to convert from one map projection to the other and to transform scales from
the digitizer scale to map scale to ensure that all map layers have the same locational
reference.
1.5.1.3. Raster Data Capture
A raster based GIS locates and stores map data by using a matrix of grid cells or
pixels (Figure 1.10). Each cell or pixel is represented either at its corner or centroid by a
unique reference coordinate (cell address). Each cell also has discrete attribute data assigned
to it.
Spatial data Generation in Raster Format

map is represented by rectangular or square cells

each cell is assigned a value based on what it represents


attribute data are assigned by user to cells

Adopted from: FAO


Figure 1.10. Spatial Data generation in Raster format (Adopted from FAO).
The raster data resolution is dependent on the pixel or grid cell size. Data can be
conveniently captured from remote sensing imageries, aerial photographs, and other such
imageries of the earth's surface in a raster data format. In this format, the various features are
identified by superposing the imageries over a fine rectangular grid of the earth's surface
which they represent. Raster data capture does not build topology. But it facilitates simple
scalar operations on the spatial data which a vector format does not permit. Raster data

. 13
requires to be converted to vector format before topology can be built and spatial operations
can be carried out. The raster format also requires more storage space on the computer than
the vector format.
Most standard GIS software packages have the facility to transform maps from raster
formats and vice versa (Figure 1.11).

Figure 1.11. Conversion of data between Raster and Vector formats.

1.5.1.4. Comparison between Raster and Vector Methods

Figure 1.12. Comparison between Raster and Vector methods

. 14
1.5.1.5. Advantages and Disadvantages
There are several advantages and disadvantages for using either the raster or vector
data structure to store spatial data. They are summarized below:
Raster Model
o Advantages
Simple data structure
Efficient for remotely sensed or scanned data
Simple spatial analysis procedures
o Disadvantages
Requires greater storage space on computer
Depending on pixel size, graphical output may be less pleasing
Projection transformations are more difficult
More difficult to represent topological relationships
Vector Model
o Advantages
Data can be represented in its original resolution without
generalization
Requires less disk storage space
Topological relationships are readily maintained
Graphical output more closely resembles hand-drawn maps
o Disadvantages
More complex data structure
Inefficient for remotely sensed data
Some spatial analysis procedures are complex and process intensive
Overlaying multiple vector maps is often time consuming
1.5.1.6. Attribute data
Attribute data are descriptive data of point, line and area features. For points, this may
be the name of the location, its elevation, etc. For lines attribute data could be the name of a
road, or canal and other descriptions associated with them. For polygons, the attribute data
may relate to name of a district and its population, area, area under specific crops in the
district, etc.
Attribute data about points/lines/areas features can be entered into different database
files. The files can be linked to the default spatial database generated after digitizing by

. 15
creating an identification key in each data file which is also common to the spatial database
generated by the GIS after digitization.
Thus, the maps representing several layers of spatial and thematic or attribute
information (soil map, rainfall map, agro-ecozone map, district map, States map, etc.) can be
independently digitized in the fashion described above.

1.5.2. Data Storage and Retrieval


A GIS does not store maps. It stores data organized into a database. The locational
data of different features (coordinates, topology) are generated during the digitization
process. The attribute data of locations are created separately. The GIS must provide the link
between the locational and attribute data (Figure 1.13). The relational database model is most
suitable to ensure such linkage and the database query language can be used to retrieve data.
Relational database concepts are therefore central to organizing and managing data in GIS.
The specific format of data storage varies with the GIS software.

LINKING SPATIAL AND ATTRIBUTE DATA


Theme map of Rice_Kp

Attribute table of Dist

OBJECTIDID Dist_name Dist_ID Geometry1_


Shape_LengShape_Area
1 1 Adilabad 123 1Bo 753337 16838673859.80
2 2 Nizamabad 116 1BoG( 430537 7655003826.81
3 3 Karimnagar 122 1BoG 662231 11771979304.40
4 4 Medak 117 1BoG( 573986 9510748717.53
5 5 Hyderabad 115 1BoG\ 53851 203218046.01
6 6 Rangareddy 114 1BoG( 587854 7813591915.82
7 7 Warangal 120 1BoG 674389 12701135906.20

Rice_1995 table
OBJECTIDDISTID DISTNAME NO_ YEAR_1995 RICEKA RICEKP RICERA RICERP
23 123 Adilabad 113 1995 63 64 7 19
16 116 Nizamabad 78 1995 102 206 34 84
22 122 Karimnagar 108 1995 104 260 88 252
17 117 Medak 83 1995 64 111 41 78
15 115 Hyderabad 73 1995 1 1 1 1
14 114 Rangareddi 68 1995 22 47 18 35

Figure 1.13. Linking of Spatial and Attribute data


For example, Geomedia GIS stores the spatial and attribute data in a Microsoft
Access databases. The feature attribute database created during digitization is created in a
specific folder called Warehouse. The map connections are stored in a file created in the
Geo-workspaces folder. Retrieval of data is possible by employing the appropriate query
language for the database model. Other attribute databases can be stored as MS Access files
anywhere in the system and connections to them can be established if the share a common ID
with the feature attribute table.

. 16
1.5.3. Geographic Analysis
What distinguishes GIS from other databases or information systems are its spatial
analysis functions which use spatial and non-spatial data to answer questions about the real
world. The answers could relate to a presentation of the current data (first level use), some
patterns in the current data (second level use) and predictions of what the data could be at a
different place or time (third level use). Geographic analysis is carried out using the layers of
map information created in vector or raster data formats and associated attribute data to find
solutions to specific problems. In each case the problem needs to be defined clearly before
the relevant map layers and analysis procedures can be identified. For instance, if the problem
is to find optimal locations for siting of wells for conjunctive use in an irrigation project area,
information about the geographical features influencing the groundwater recharge will be
required. These will include maps of existing well locations, rainfall, land use, soils and
command area of the project, all of which influence recharge. Regions with recharge above a
selected threshold value may be considered suitable for additional wells. Further, if the area
happens to be near the coast, a buffer zone may be required within which no wells can be
sited to prevent sea water intrusion. Similarly buffer zones may be required on either side of
canals to prevent withdrawal of canal water by the wells. What could happen to the ground
water levels and quality in the area if the present use is persisted with or changed could be the
subject of another study where the GIS can help to provide more realistic answers.
Most standard GIS software come with basic analytical tools that permit overlays of
thematic maps, creation of buffers, etc., in addition to calculations of lengths and areas.
Overlay operations permit overlaying one polygon over the other to generate a new map of
their intersections which are new polygon combinations with desired homogenous properties
with respect to specified polygon attributes. A graphic representation of map layer overlay is
shown below.

Figure 1.14. Map layer Overlay (Source: FAO)

. 17
1.6. STEPS IN BUILDING A GIS
The way in which a GIS is built will depend on the way information will be used in
the decision-making process. Building a GIS proceeds through at least 4 stages:
(i) Defining the objectives
(ii) Building the spatial and attribute data bases
(iii) Database management for geographic analysis
(iv) Presenting results in the form of maps, etc.
The definition of objectives or the problem to be solved using GIS is critical to the
choice of spatial and attribute databases. Once the problem is defined and the relevant map
layers and attribute data are identified, building databases involves:
(i) Database design
(ii) Entering spatial data
(iii) Creating topology
(iv) Entering attribute data
Designing the database requires identification of the following:
(i) Study area boundaries
(ii) Coordinate system
(iii) Data layers
(iv) Features in each layer
(v) Attributes for each feature type
(vi) Coding and organizing attributes
Depending on whether the map sources are two dimensional maps of the area or
remote sensing imageries, data is entered in vector or raster format. In the vector format,
entering spatial data and creating topology are components of overall digitization process.
Raster data will need to be vectorized before topologies can be built. Attribute data is created
in the form of database files with one field, the feature identification field, in common with
the spatial data base created during the spatial data entry process.
Data base management refers to translating the digitized map into real world
coordinates, identifying coverages for analysis and maintaining the data base.
Presenting the maps for decision-making is facilitated by creating customized maps
using the various facilities available in GIS software.

. 18
1.7. SUMMARY
A GIS is a computer based tool for geographical analysis of information. It is not
simply a digitized map, nor does it hold maps. It holds a database of spatial data and attribute
or descriptive information about features on a map which can be used to create desired maps.
The crucial concept of GIS is the separation of spatial or geographic reference information
and attribute or descriptive information of map features for data entry and database
development, and their linkage during analysis. Central to both spatial and attribute
information is the database management concept. The separation of the two types of
information facilitates entering the spatial information (map) into computers in a digitized
form and establishing connectivity (topology) between different stored map features (points,
lines and polygons). The feature attribute data is entered independently taking care to
introduce an identification variable which is in common with the identification variable for
each feature that is common with the spatial database. For geographic analysis, the spatial
and attribute data are linked through this unique identifier variable common to the two types
of data bases.
Initially, spatial data capture is in spatial units and coordinates of the data capture
tool. To translate the map information into real world information of locations, distances and
areas these need to be translated to real world units through appropriate transformations of
scale and map projections.
The digitized maps and their associated feature attributes are the building blocks of
the GIS. The maps can be created and stored in different layers, with each layer containing
information about one feature. They can be overlaid over each other to obtain new maps
(coverages) with new polygons that are homogeneous with respect to specified feature
attributes of maps that were used in the overlays. The overlay operations must be between
maps with exact boundary fits. Exact fits are obtained between maps only if they are created
in the same projection and scale. To make exact fits, appropriate map projection and scale
transformation operations will be needed before geographic analysis can be performed using
overlay operations.

. 19
CHAPTER 2

Laboratory Exercises

. 20
Guidelines to Interpret the Figures in this Chapter

In order to help the users gain a better understanding of the steps listed in each
laboratory exercise, figures with suitable annotations are provided wherever necessary. The
following are the general guidelines to interpret the figures given in this section.

i) The annotations in the figures refer to the corresponding step number where relevant
information is given.
Example:

ii) Some figures are annotated with the step number along with letters in alphabetical
order; these annotations indicate the workflow as specified in the respective step.
Example:

21
Exercise 1

Introduction to QGIS

This exercise includes the following tasks:

Task 1 Become familiar with geospatial data models.

Task 2 Learn to work with QGIS Browser.

Task 3 Viewing geospatial data in QGIS Desktop.

Geospatial Data Models


Geospatial data models are the means used to represent various geographical features.
They are composed of two components: spatial features and the attributes that when
combined create a model of reality as illustrated by the figure given below.

. 22
There are two main geospatial data models: Vector and Raster.
Vector Data Model It is best suited for modeling discrete objects; Vector data comes in
three forms: Point, Line and Polygon.
Raster Data Model It is best suited for modeling continuous objects; A raster is composed
of a matrix of contiguous cells, with each cell (pixel) holding a single numeric value.

QGIS Browser
The first step in working on a project with geospatial datasets is to organize the
workspace. It is important that the datasets are logically organized on the computer and are
easy to find. In this task, explore how the data is organized using QGIS Browser.

Open QGIS Browser


1. Click Start All Programs QGIS EssenQGIS Browser 2.14.0.
The interface to QGIS Browser is a simple one (see the figure shown below). The File Tree
is displayed on the left. (Note: Your machine may have a different set and number of drives
listed here, which is perfectly alright.) Below the drives are the Database Connections.
(We are not connected to any databases at the moment). The Display Window takes up the
remainder of the window. There are Display Tabs above the Display Window that allow the
user to control the viewed information.

. 23
2. On the File Tree, click the arrow next to C:/; now, all the subfolders directly under
the C:\ folder will be displayed.

3. In the File Tree, click the arrows on the left of each folder to expand the drive and
navigate to the folder where the Data_Lab1 dataset is stored. The contents of the
Data folder for the lab will be displayed as shown in the figure given below).

4. Take a moment to read the names of the files. There are two folders and several files
listed with different icons. The icon indicates that the dataset is a vector layer. The
icon is used to represent raster data but is also used for other files such as the
XML files.

Familiarizing with geospatial data models:


1. Select the Hawaii_Counties.shp layer in the File Tree. The Display Window
automatically switches to the Metadata tab. This gives some basic information about
the dataset. Also, one can notice that the Storage type is ESRI shapefile. The
Display Window also tells that it has a Geometry type of polygon and that it has 9
features (see the figure on next page).

. 24
In addition to the data models (vector and raster), we have to understand the file formats.
Raster and vector data models have their own list of file formats. Shapefile is the most
commonly used vector file format; a particular shapefile can contain only one geometry type
(polygon/line/point). A shapefile is actually a collection of files on the computer with a
common name but with different extensions (.dbf, .prj, .qpj, .shp, and .shx).

2. Select PubSchools.shp; this is an ESRI Shapefile with a point dataset with 287
features.

3. Select SDOT_StateRoutes.shp; this is also an ESRI Shapefile with line geometry


and contains 122 features.

4. Select Hawaii_Counties.shp again and click the Preview tab. This shows the spatial
features of this GIS dataset (see the first figure on next page).

. 25
5. Click the Attributes tab; this shows the attribute information of the data model. Each
row corresponds to a polygon feature. Each column describes a particular information
about the polygons, such as island name (see the figure shown below).

6. Select the Oahu_Landsat_15m.jp2 dataset (which is a satellite image of the island


of Oahu, Hawaii, USA) and click the Preview tab (see the figure on next page). This
is a raster dataset, which is composed of cells, similar to a photograph.

. 26
Let us take a look at the file formats in a more detailed manner.
7. In the File Tree, select the Data_Lab1 folder. Now, the Param tab would show
all the files and folders available in the selected folder (see the figure given below).

. 27
8. This listing of files is similar to that in the Windows Explorer. It can also be noticed
that, though the File Tree shows the shapefile only as Hawaii_Counties.shp, the
folder actually contains multiple files named as Hawaii_Counties (with the
extensions .dbf, .prj, .sbn, .sbx, .shp, .shp.xml, and .shx). It is because the File Tree
actually simplifies the listing of data showing only the .shp and .xml files. (For more
information on ESRI shapefiles, refer this link:
http://en.wikipedia.org/wiki/Shapefile).

Viewing geospatial data in QGIS Desktop


1. Click Start All Programs QGIS Essen QGIS Desktop 2.14.0
2. QGIS Desktop is the application used for performing GIS analyses and preparing
maps. It is divided into two main sections: i) Table of Contents, and ii) Map
Window (see the figure shown below).

Table of Map
Contents Window

Now, let us try adding some data. QGIS has Add Data buttons for each major
geospatial data model (Vector and Raster).

. 28
3. Click the Add Vector Layer icon located on the toolbar, at the left of the
Table of Contents.

4. This opens the Add vector layer window. To add an ESRI shapefile (which is a
file-based dataset), set the Source type as File (selected by default) and click the
Browse button.

5. Now, the Open an OGR Supported Vector Layer window will open. (Note:
OGR is a FOSS4G project to read and write geospatial vector data files). By default,
the file type (shown next to the file name field) would be set as ESRI Shapefiles.
However, click on the file type field and take a moment to know the other options
available (displayed as shown in the figure given below).

. 29
6. Once the list has been explored, make sure that the file type is still set as ESRI
Shapefiles. This filters the contents of the folder to show only the shapefiles.

7. Select Hawaii_Counties.shp and click Open (see the figure shown below).

9. In the Add vector layer window, click Open. Now, the map features of
Hawaii_Counties.shp will be displayed in the map window with the filename added
to the table of contents. (QGIS displays vector layers in a random color pattern
which can be modified suitably; this will be dealt in subsequent lab sessions).

10. Lets examine the attributes. In the Table of Contents, right-click the Hawaii
Counties layer and select Open Attribute Table from the list (see the figure given
below).

. 30
11. Now, the attribute table will open. It contains 9 rows (corresponding to the 9 polygon
features) and 4 columns (each representing a particular attribute of the polygons).
Now, close the Attribute Table.

12. Another way to interact with both the spatial features and the attributes is by

using the Identify tool. Click the Identify icon on the tool bar.

13. Now, click any of the features on the map. The Identify results box will appear,
showing the attributes of the clicked feature.

Adding Raster data to QGIS Desktop

1. Click the Add Raster Layer icon .

2. The Open a GDAL Supported Raster Data Source window will appear (see the
figure shown below). The workflow is similar to that of adding a vector data.

3. To open raster data files, QGIS uses another FOSS4G project called GDAL whereas
it uses OGR to open vector data files. GDAL is a software library that QGIS uses to
read and write raster datasets.

. 31
4. By default, the windows raster data filter is set to [GDAL] All Files; hence, the
entire contents of the folder will be displayed.
5. Set the filter to [GDAL] ERDAS JPEG200 (third option from the top). Also note
how many formats it reads. In GIS, raster has more file types than the vector data
model.
6. Once the filter is set, only one dataset will be displayed: Oahu_Landsat_15m.jp2;
select this raster dataset and click Open.
7. This dataset covers only the island of Oahu, a part of Hawaii. In the Table of
Contents, right-click the Oahu Landsat 15m dataset and choose Zoom to Layer
Extent to zoom to the spatial extent of this raster.

In the Data_Lab1 folder, there are two more folders- hilloah and info, which together
constitute another geospatial dataset called GRID. The info folder holds the attributes and is
always called info. The other folder is the layer name and contains the spatial data.
8. Click the Add Raster Layer icon.

9. Set the filter to Arc/Info Binary Grid (usually the seventh item in the list). Then, to
add the raster data to QGIS, double click the hilloah folder, select the hdr.adf file,
and click Open. This raster is a hill shade image of the Oahu Island, and represents its
terrain.

About Browser Window


1. Right-click the blank space in the menu bar (next to the Help menu). This opens a
context menu showing all the toolbars and windows that can be added to the QGIS
interface. Check the box next to Browser (see the figure shown below). A Browser
window will be added as a tab on the left panel of the main window.

. 32
2. Click the Browser Tab.

3. Note that there is a Favourites item. This tool serves as a quicker way to add data to
the map; by identifying certain folders as favourites, one can save the trouble of
navigating deep inside the folders every time to access the data.

4. For example, let us add the Data_Lab1 folder to the Favourites list. In the browser
panel, navigate to the folder location, right-click the Data_Lab1 folder and choose
Add as a Favourite. Expand the Favourites section and check whether the folder
has been added to the list.

Note: Currently this function is reserved only for the Browser tab in QGIS Desktop.
However, once it is set it will show up as a Favourite in QGIS Browser as well.

5. To remove an item from Favourites, right-click the item and choose Remove
favourite.

6. To add any of the contents of the added folder to the main window, expand the lab
folder under Favourites, select the file (say, SDOT_StateRoutes.shp), and drag it
onto the map.

Note: Data can be added to QGIS Desktop by dragging it from the QGIS Browser
application as well.

. 33
Exercise 2a
Projection and Re-Projection

This exercise includes the following tasks:


Task 1 Understanding the different projection systems.

Task 2 Defining the projection of a layer.

Task 3 Re-projecting a layer into a different projection system.

Introduction
The Earth is near-spherical in shape with a surface dotted with mountains, valleys and
plains; this irregular topography of the Earth surface renders direct mathematical calculations
on its topography unsuitable. Therefore, the Earth surface is approximated to be a
mathematical surface of an oblate spheroid, known as Datum, which is then considered as a
frame of reference for measuring locations on the Earth surface. There are numerous datums
that may best fit either a limited area of the Earth (called Local Datum) or the entire globe
(called Global Datum). For example, the Everest ellipsoid, a local datum, is considered as
the best fitting datum for India and its neighboring countries. At the global scale, the WGS
84 ellipsoid is considered the best fitting model. Generally, the locations on the Earth surface
are represented using the Geographic Coordinate System (GCS) associated with the
respective datum; these measuring units are angular in nature.
However, the use of spherical coordinates makes it difficult to measure distance, area,
and other measurements on the Earth surface; also, for practical purposes, it is necessary to
represent the 3-D Earth surface onto a 2-D plane surface (e.g. a piece of paper/computer
screen). This can be done using a mathematical process called Projection. Based on the
projection surfaces used, the projection systems can be classified into Plain, Conical,
Cylindrical etc. (see the first figure on next page). Projecting a 3-D surface onto a 2-D plane
would always result in distortion of features in terms of area or distance or shape or direction.
Since all the geometrical properties cannot be preserved, it is upon the user to make a choice
on the properties to be preserved. For example, the use of Albers Equal Area Conic
projection system will preserve the area but will distort the shape. Hence, choosing the right
projection system is crucial for accomplishing a successful GIS project.

. 34
Identifying and defining the projection information of a layer
1. Open QGIS Desktop (StartAll Programs QGIS EssenQGIS Desktop 2.14.0).

2. Add the vector layer Pune_District_UTM43N.shp via Add Vector layer icon .
In the resultant window, click Browse and browse to the Data_Lab2_a folder.
Ensure that the file type is ESRI Shapefiles. From the folder contents displayed,
select Pune_District_UTM43N.shp. Click Open on both the windows displayed.

3. Right-click the Pune_Disctrict_UTM43N.shp layer in the Layer panel and select


Properties (see the figure given below).

4. In the resultant Layer Properties window, click the Metadata tab. Under the
Properties tab, scroll down to find Layer Spatial Reference System, which gives
the Coordinate/Spatial Reference System (CRS/ SRS) of the current layer (see the
first figure on next page). This layer is shown to be in UTM projections 43rd zone
based on WGS 84 datum in the northern hemisphere. Finally, click OK.

. 35
5. If the map layer does not contain any projection (CRS) information, QGIS prompts
the user to select the CRS information via the Coordinate Reference System Selector
window. Now, try adding the vector layer Haveli_Pune.shp (representing the Haveli
taluk of Pune district) to the QGIS Map Canvas (refer Step 2). Since, the layer does
not contain CRS information, the CRS selector window will appear (see the figure
shown below). From the Coordinate reference systems of the world section, select
WGS84/ UTM zone 43N (the filter option can also be used). Next, click OK.
Now the Haveli taluk will be added to the map canvas.

. 36
Note: The CRS prompt will work only if the corresponding radio button is ON. This can be
done via Main menu barSettingsOptionsCRS (see the figure given below). It is
recommended that the Prompt for CRS radio button is set ON always.

Use of On the Fly option

Enabling the On the fly option automatically reprojects the layers with different
CRS into the current project projection system. It should be noted that this reprojection is
only for visualization purpose and does not alter the actual projection system of the layers
involved.

6. Open a new QGIS project window via Main menu barProjectNew; click
Discard in the prompt window. Then, go to the Main menu barProjectProject
PropertiesCRS (see the figure given below). The Enable on the fly CRS
transformation check box can be found at the top of the window and it will be
checked by default. The usefulness of this option will become evident from the
following steps.

. 37
7. Disable the on the fly option by unchecking the check box; click Apply and OK.
8. Using the Add Vector layer icon , add the Pune_District_UTM43N.shp and
Pune_District_WGS84.shp shapefiles given in the Data_Lab2_a folder (refer step
2). After adding the layers, click the Zoom Full icon (see the figure given below).

9. It can be noticed that despite the shapefiles representing the same area on ground
(viz. Pune District), they appear at different parts of the map canvas (see the figure
given above). The reason is that the layers are of different CRS- one is of a
projected CRS while the other is of a geographic CRS. Now, try adding the same
two vector layers with the On the fly option enabled.
10. Go to the Main menu barProjectProject PropertiesCRS and check the
Enable on the fly CRS transformation checkbox. Click Apply and OK.
Then, add the same two shapefiles (as in step 8). Now, it can be noticed that both
the layers are placed one over the other in the map canvas (see the figure shown
below). Hence, it is recommended that the on the fly option remains enabled for
visualization purposes.

. 38
Reprojecting a Vector layer
As said in the previous section, the On the fly option helps only in viewing the layers at
the right location and does NOT alter the actual projection system of the layers. However, for
most geoprocessing analyses require the reprojection of vector layers from geographic CRS
to projected CRS or vice versa; this has been dealt in this section by demonstrating the
reprojection of a vector layer from a Geographic CRS (WGS84) to a Projected CRS (UTM-
Zone 43N).

11. Using the Add Vector layer icon , add the Places_Pune_District_WGS84.shp
vector layer from the Data_Lab2_a folder (refer step 2).
12. Check the projection information of this layer from the metadata (refer step 4). The
layer is shown to be of WGS 84 (i.e. GCS) projection (see the figure given below).

13. To reproject the layer, in the Layers selection, right-click the layer and click Save
As (see the figure given below).

15. In the resulting Save vector layer as window (see the first figure on next page), in
the Format field (figure: 15a), select the desired format (here: ESRI Shapefile).
Then, click the browse button (figure: 15b) next to the Save As field; navigate to
the desired folder and give a suitable filename (e.g.

Places_Pune_District_UTM43N). Then, click the Select CRS icon (figure:


15c) next to the CRS field; in the resulting Coordinate Reference System Selector
window, select the CRS as WGS84/ UTM zone 43N using filter (refer step 5).
Check the Add saved file to map check box (figure: 15d) and click OK (figure:
15e). The newly added layer will be added to the map canvas.

. 39
16. Check whether the newly added layer conforms to the desired projection system by
checking the projection information under the Metadata tab of the layer properties
window. It should be as shown in the figure given below.

Projecting a raster dataset


17. The projection information of a raster dataset can be identified by checking its
metadata (refer steps 3 and 4). If the raster dataset is not associated with any CRS,
then QGIS will prompt the user to choose a CRS, as told in step 5.

18. Add the raster layer KadakvasalaDam_Pune.tif (which shows the Kadakvasala Dam
located in Pune District) via Main menu barLayerAdd Raster Layer or by using

the Add Raster layer icon from the toolbar; browse to the Data_Lab2_a folder
and select the said raster layer. Click Open in the popup window.

19. Since the KadakvasalaDam_Pune.tif image doesnt contain any CRS information,
the CRS Selector window will appear, prompting to select a CRS.

. 40
20. Type WGS 84 in the filter; select the CRS WGS84: EPSG 4326 (see the figure
given below) and click OK; the KadakvasalaDam_Pune.tif layer will be added to
the map canvas.

21. Check the projection information in the metadata of the raster layer (refer steps 3 and
4); it should appear as WGS 84.

22. It can be noticed that the vector layer Pune_District_WGS84.shp and the raster
image KadakvasalaDam_Pune.tif do not match though the dam is located in Pune
district; this occurs despite enabling the On the fly option (in step 10) and assigning
a CRS to the raster image (in step 20). This is because assigning a CRS to an image
does not equate to georeferencing of the image.

Reprojecting a raster dataset


In this section, reprojection of a raster layer from a Geographic CRS (WGS84) to a
Projected CRS (UTM-Zone 43N) has been demonstrated.
23. Add the georeferenced raster layer Geo_KadakvasalaDam_Pune.tif given in the
Data_Lab2_a folder, to the map canvas (refer step 18) (see the first figure on next
page). Check the projection information of this layer (refer steps 3 and 4); it will
appear as WGS 84.

. 41
24. To reproject this raster layer, go to the Main menu barRasterProjectionsWarp
(Reproject) (see the figure given below).

25. In the resultant Warp (Reproject) window (see the first figure on next page), select
Geo_KadakvasalaDam_Pune.tif as the input file (figure: 26a). Then, click the
Select button next to the Output file field (figure: 26b) and browse to the desired
path; in the popup window, enter the file name as UTM_Kadakvasala_Pune and in
the Files of Type field, select [GDAL] GeoTiff (*.tif, *.tiff, *.TIF, *.TIFF). Click
Save. Then, check the Target SRS check box (figure: 26c) and click the Select
located right to Target SRS; in the resulting Coordinate Reference System Selector
window, select the CRS as WGS84/ UTM zone 43N using filter (refer step 5)..
Also, check the Load into canvas when finished checkbox (figure: 26d) and click
OK (figure: 26e).

. 42
26. The reprojection will take a few seconds and the output (reprojected) image will be
added to the map canvas (see the figure given below).

. 43
Exercise 2b

Georeferencing and Image Registration

This exercise includes the following tasks:


Task 1 - To georeference a toposheet by using graticule intersections in a known
coordinate system and datum.
Task 2 - To georeference a satellite image using a georeferenced toposheet.

Georeferencing:

Georeferencing is a process of establishing a mathematical relationship between the


image coordinate system and the real world spatial coordinate system. This mathematical
relationship can be assigned by using any of the transformation settings, viz. Polynomial
order 1, 2 or 3, Linear, Projective, Thin Plate Spline etc. In this exercise, the topographic Map
of South Pune, prepared by Institute of Environment Education and Research (IEER), Bharati
Vidyapeeth University (BVU), Pune, is used. This map is in the Universal Transverse
Mercator (UTM) projection based on WGS 84 Datum.

1. Open QGIS Desktop (Start All Programs QGIS Essen QGIS Desktop 2.14.0)

2. Open QGIS Georeferencer via main menu barRasterGeoreferencer Georeferencer


(see the figure shown below).

. 44
3. The Georeferencer window has two sections (see the figure given below): i) the
upper one is called 'Main Work Space' and is dedicated to the display of the Raster
Map to be georeferenced; it allows the user to input the geographic or projected
coordinates of control points. ii) The lower part, titled 'GCP table', is where the
Ground Control Point data and residuals will be displayed.

4. Add the toposheet to the Georeferencer from the File menu (File Open Raster) or

by clicking the 'Open Raster' icon .

5. Then, a popup window will appear; navigate to the tutorial data folder in which the
'toposheet.tif' file is kept. Click the drop down menu right to the 'File name' and select
'[GDAL] GeoTIFF' (see the below figure). Select toposheet.tif and click Open.

. 45
6. Then, the 'Coordinate Reference System Selector' window will appear. In that
window, select the 'WGS 84' under the Coordinate reference systems of the world
section (see the first figure given below).

7. The toposheet will be loaded in the Georeferencer window and will look as shown
below.

. 46
8. To georeference an image, Ground Control Points (GCPs) are used. GCP is a location
on the Earth's surface with known coordinates on both the Earth and
toposheet/imagery (i.e., geographic/pixel coordinates). In this tutorial, graticule
intersections are used as GCPs.

9. To start adding GCPs to our map, zoom (using the scroll wheel of the mouse) to the

intersection of the latitude and longitude at a corner of the map. Use the 'Pan' tool
when needed.

10. To add a GCP, click the 'Add point' icon or go via the menu (Edit Add
Point). The cursor will turn into a '+' sign; click the center of the intersection. Use the

'View tool' when needed.

11. The 'Enter map coordinates' window will pop up where the point coordinates (which
we take from the map) are to be entered. Always enter 'Longitude or Easting' in X
field and 'Latitude or Northing' in Y field. Use 'space bar' in the key board to separate
the degree and minute values. Then, click OK (see the first figure on next page).

. 47
12. In this exercise, 'Polynomial 2' transformation is used to georeference the image. For
this ('Polynomial 2') transformation, a minimum of 6+1(for check) i.e., 7 GCPs are
required. Also, ensure that the GCPs locations are spread out as much as possible and
they are not collinear. Use the above procedure to mark six more control points.

13. To set the spatial reference settings for the toposheet, click the 'Transformation

Settings' icon . The 'Transformation Settings' window will appear (see the figure
given below).

14

15

16

14. Click the 'Transformation type' drop-down menu and select 'Polynomial 2'. This
indicates that a second order polynomial transformation will be used.

15. Click the icon next to Output Raster'. A dialog box will appear in which the
name of the output file is to be entered. It is useful to include the name of the original
file in the output filename (e.g., 'Toposheet_WGS84_georef.tif ') for future references.

. 48
16. In the Transformation Settings window, check the 'Load in QGIS when done' and
'Use 0 for transparency when needed' boxes and leave the reset of the values as
default and click 'OK' (see the figure below point 13 on previous page).

17. Then, click 'OK'. Now, the last column ('residual [pixels]') displays some values.
These are the error values associated with the GCPs. An error value of 1 or less would
be satisfactory.

18. If the error value is greater than 1, double check and adjust the GCP locations. To

adjust a point, click the Move GCP Point' icon , and then click and drag the
point to the desired location. To delete an erroneous GCP, use the Delete Point'

icon . Also, disable certain GCPs (using the check boxes under the 'on/off'
column) and check whether or not the error value has decreased.

19. It is useful to save the GCPs for later use, if the georeferencing needs to be done again

or if corrections are required. To save them, click the 'Save GCPs as' icon . In
the pop up window, enter an appropriate name for the GCP file, preferably the same
as that of the image. This file can be loaded later using the 'Load GCP points' icon

in the 'Georeferencer' window.

20. Once the error is around (or preferably lesser than) 1, click the 'Start

Georeferencing' icon . The processing will take about 2 minutes. The


georeferenced image will be loaded in the QGIS Canvas once the processing is done.

. 49
Image Registration:

Image registration is the process of overlaying two or more images of the same scene
taken at different times, from different viewpoints or by different sensors (Zitova and Flusser,
2003). In a geospatial perspective, image registration refers to the establishment of a
relationship between the image coordinate system of the satellite imagery and the
georeferenced base imagery/toposheet. In this exercise, the georeferenced toposheet of south
Pune will be used as the base image, and the pixel based OrbView satellite imagery will be
warped to the georeferenced toposheet of South Pune.
21. Start by opening the georeferenced toposheet in QGIS by clicking on the 'Add Raster

layer' icon or via main menu barLayerAdd Raster.

22. A window will pop up in which various files will be displayed. Click the drop down
menu below and select '[GDAL] GeoTIFF'. Navigate to the output folder of
Georeferencing tutorial and select the georeferenced toposheet file
('Toposheet_WGS84_georef.tif) and click 'Open'.

23. Before starting the registration, the CRS of the toposheet must be known (as the
satellite image is ought to have the same CRS as that of the georeferenced toposheet).
Right-click the toposheet layer located under Layers' in the main window and select
'Properties' (see the figure given below).

. 50
24. The 'Layer properties' window will pop up (see the figure given below). Select the
'Metadata' tab and scroll down to the section 'Layer Spatial Reference System'. It
will have a line written as: +proj=longlat +datum=WGS84 +no_defs
This indicates that, the image is in a geographic coordinate system based on WGS 84
datum. Note down the parameters for the image file and click OK.

25. Open the 'Georeferencer' tool from the Raster tab in the Menu (Raster
GeoreferencerGeoreferencer).
26. In the Georeferencer popup window, go to File Open Raster (see the figure shown

below) or click the Open raster icon and open the OrbView_SouthPune.tif,
which needs to be georeferenced.

27. On opening the OrbView satellite image, a pop-up window will appear asking to
select the Coordinate Reference System. Look for the 'WGS 84' CRS under the
Geographic Coordinate Systems. To narrow down the search, type WGS 84 in the

. 51
filter. Select 'WGS 84' and click OK. Now the orbview image will be opened in the
Georeferncers workspace (as shown in the figure below).

28. Next, identify and zoom into a feature that is easily identifiable on the image.
Generally, features like road intersections or building corners are used. To zoom in to

a feature use the Pan , Zoom In , and Zoom Out icons located on the toolbar
or use the scroll wheel of the mouse.

29. To add a GCP, click the 'Add Point' icon . On clicking the button, the mouse
pointer will turn into a '+' sign. Use this pointer to click the feature that is easily
identifiable on both the image and the toposheet.

30. A dialog box will appear where the map coordinates are to be entered (see the figure
given below). Click 'From Map Canvas' and then zoom to/locate the corresponding
feature on the toposheet (loaded in the main window) using the scroll wheel of the
mouse. Click it and then click 'OK' in the dialog box. If the 'Zoom in'/ Pan
(Navigation) tools are used, right-click the mouse button for the '+' sign.

31. Now, the image pixel is tied to its corresponding location on the toposheet.

. 52
32. Similarly, identify at least six additional, well distributed tie points in the image and
repeat steps 8-11 for each tie point. While selecting the tie points ensure that the
points match accurately. The features selected for the GCPs should preferably be
towards the edge of the map, away from each other and not co-linear.

33. Set the transformation settings for the image by clicking the 'Transformation

Settings' icon . The Transformation Settings window will pop up (see the figure
given below).

. 53
34. Click the 'Transformation Type' drop down menu and select 'Polynomial 2'. This is
the second order polynomial transformation. This requires at least 6+1 tie points for
the transformation (see the second figure on previous page).

35. Click the icon next to Output Raster (see the second figure on previous page).
A dialog box will appear in which the name of the output file is to be entered. It is
useful to include the name of the original file in the output filename (e.g.
'OrbView_SouthPune_WGS84_georef.tif) for future references.

36. Check the 'Load in QGIS when done' box and leave the rest of the values as default
and click 'OK'.

37. Then, click 'OK'. Now, the last column ('residual [pixels]') displays some values.
These are the error values associated with the GCPs. Normally, an error value of 1 or
less would be satisfactory. In this case, consider it as 3 pixels.
Note: The accuracy of the georeferencing can be gauged from its Root Mean Square (RMS)
error which is seen in the last column in 'GCP table' of the Georeferencer. In this case, try
and get the error to be less than 3 pixels. If the error is higher than 3 pixels, adjust the GCPs
so that total error can less than 3 pixels and ensure that the GCP locations match properly
on both the imagery and the toposheet. In this exercise, the error cut-off is set as 3 pixels as
the OrbView image has a resolution of 1m and the plotable error of our toposheet is 2.5 m
(as it is of 1:10000 scale). Hence, theoretically it is not possible to achieve the accuracy less
than 2.5 m i.e., nearly 3 m because we dont have a concept of half a pixel in an image.

38. If the error value is greater than 3, double check and adjust the GCP locations. To

adjust a point, click the Move GCP Point' icon , and then click and drag the
point to the desired location. To delete an erroneous GCP, click the Delete Point'

icon . Also, disable certain GCPs (using the check boxes under the 'on/off'
column) and check whether or not the error value has decreased.

39. Once the error is around or lesser than 3, click the 'Start Georeferencing' icon .
The processing will take about 2 minutes and then the georeferenced image will be
loaded in the QGIS Canvas.

. 54
Exercise 3

Digitization

This exercise includes the following tasks:


Task 1 - To create a new point shapefile by digitizing toposheet.
Task 2 - To create a new line shapefile by digitizing toposheet.
Task 3- To create a new polygon shapefile by digitizing toposheet.

Introduction
Digitization is the process of converting analog data into digital data sets. In the context
of GIS, digitization refers to the creation of vector datasets viz., point, line or polygon from
raster datasets. It is a way of tracing/recording geographic features in vector format from
georeferenced images or maps. With the help of digitization, different set of layers viz.
Rivers, roads, schools, ward boundaries and building blocks can be created from a single
map; this process is known as Vectorization. Vector data are easy to edit, update and are
more accurate vis-a-vis raster data. Also, vector data are comparatively more efficient for
GIS analyses. Due to these reasons, vectorization is the first step in many GIS projects.
However, it is also a time consuming process and needs a lot of attention. Vector data is of
three types:
Point: It consists of single points having (X, Y) coordinates, for example lamp posts,
bus stops and postbox positions etc.

Line: It consists a series of (X, Y) coordinates in a sequence (from start node to end
node with a number of vertices joining these two nodes). For example roads, power
lines, ward boundaries and contours etc.

Polygon: It is a series of (X, Y) coordinates in a sequence closing a figure where first


and last points are the same. For example lakes, building blocks, village blocks, ward
areas and forests etc.

In this exercise, the output of Georeferencing a Toposheet tutorial is used as the input.
Open the georeferenced toposheet (raster) of the Exercise 2b in the map canvas of QGIS via

Main menu barLayerAdd Raster Layer or directly click the icon from the toolbar

. 55
browse and select the georeferenced raster layer in the tutorial data and click Open in the
popup window.

Point Layer Creation


1. To create a new point layer, go to main menu barLayerNewNew Shapefile
Layer.

2. Now, the New vector Layer window will popup. Select Type as Point (see the
figure given below).

3. Specify the CRS same as that of the original layer, i.e. EPSG:4326 - WGS 84. To do
this, click Specify CRS and select WGS 84 under the coordinate reference system
of the world (see the figure given below).

4. Also, required attribute fields can be added to the newly created vector layer. For
example, if a point vector layer of all hospitals is being created, then Name,Intake
capacity, Address etc. can be added as the attributes.

5. For each new attribute added, an appropriate name, type of the variable (like text,
whole number, decimal number and date) and width must be specified. Click Add to
attribute List and the attribute will be added to the list. Now, add the attributes
details shown in the first figure on next page.

. 56
*Note: For removing an attribute from the list, select it and click Remove attribute in New Vector Layer.

6. Once the required attributes have been added, click OK.

7. The Save As window will appear. Specify an appropriate name for the layer, e.g.
Hospitals_Pune.shp. Once the layer is saved, it will open as a point data layer in the
main window.

8. To start digitization, enable the editing mode of the corresponding vector layer. To do
this, right-click the Hospital_Pune.shp point layer and click Toggle Editing (see

the figure given below) or select the layer and click icon from the Digitizing1
toolbar.

9. If the layer is enabled for editing, a pencil symbol will appear on the left of the layer
name in the table of contents (see the figure shown below).

___________________________________________________________________________
1
If the Digitizing tool bar is not present in the QGIS window, right click the main menu bar area
and check Digitizing.

. 57
10. Zoom in the locations of hospitals on the toposheet (hospitals are represented as

on the toposheet) and click Add feature icon from the digitizing toolbar.

11. Place the pointer at the center of the feature of interest (see the figure given below)
and click it.

12. Once a point is clicked, the Attributes window will appear. Fill in the required
attribute information like id, Name and Intake_Cap (Intake Capacity), Address
(see the figure shown below) and click OK.

13. The point will be created with the specified attributes at the specified location. Now,
open the attribute table of Hospital_Pune.shp by right-clicking on the hospital layer
and selecting Open Attribute Table. If any field in the attribute table is to be
edited, simply double click the field and enter the value. Attempt changing the intake
capacity data of Bharati Hospital from 1000 to 1200 (see the figure shown below).

. 58
14. Similarly, digitize the other hospitals in the toposheet. Click Save Layer Edits
icon in the Digitizing tool bar to save the edits. Once the editing is done, click the
toggle editing icon to stop editing. This will save the Hospital_Pune.shp point
layer along with its attributes.

15. Go to attribute table of Hospital_pune.shp to check if the attributes are entered


rightly. If not, edit them as described in step 13.

Line Layer creation

Linear network such as road, railways drainage etc. on the map can be represented in
vector form as Line layers. In this exercise, digitization of roads in South Pune has been taken
up as the task.
16. To create a line layer, go to LayerNewNew Shapefile Layer. The New vector
Layer window will open. Select Type as Line specify CRS as EPSG: 4326
WGS 84 (see the figure on next page).

17. Add required attributes, for example Name as shown in the figure on the previous
page, and click OK. Now, the Save As window will open up; browse to an
appropriate location and give an appropriate name e.g. Roads_Pune and click Save
(see the figure on next page).

. 59
18. The layer will be created and it will be listed in the table of contents. To add features
to this layer, enable the layer editing by right-clicking the layer and selecting Toggle

Editing or by clicking the icon from the Digitizing toolbar.

19. Zoom in the toposheet where the Pune Bangalore Highway originates on the map
(the junction of the two prominent red lines on the right half of the map). Click the

Add feature icon in the Digitizing toolbar.

20. Now, trace the cursor along the middle of the road. To insert vertices at points where
the road changes its course, use the left mouse button. The more the vertices are, the
smoother the digitized road will be. Upon reaching a junction or the end of the road
segment, click the right mouse button to stop digitizing. Now, the Attributes
window will open. Fill in the appropriate attributes (e.g. Name=Pune Bangalore
Highway) and click OK (see the first figure on next page).

. 60
21. For effective digitization, it is necessary that the vertices of line/polygon features are
recorded accurately without undershoot/overshoot errors. For this, the Snapping
option can be used, by which, when a pointer is brought near the neighboring
feature- set within the tolerance limit- the pointer tries to snap to the neighboring
feature. To enable this option, go to Settings Snapping Options.

22. The Snapping Options dialog box will appear (see the figure below). Select
Current layer in the Snapping mode option and in the Snap to option, select
to vertex and segment. Then, specify a tolerance value of 5 pixels. Also, check on
the Enable topological editing and Enable snapping on intersection options,
and click OK

. 61
23. So, by using the snapping tool, it is possible to get an accurate intersection of roads.
Once all the roads in the toposheet have been digitized, save the edits and then click
the Toggle editing icon to stop editing. Now, the road network along with its
attributes will be saved.

The green cross in the


figure shows the snapping
tool functionality.

Polygon Layer creation:


Polygon vector layers are usually used to represent area features such as administrative
parcels, forests, buildup areas, water bodies etc. In this exercise, digitization of reserve
forests in South Pune has been taken up as the task.
24. To create a polygon layer, go to LayerNewNew Shapefile Layer. The New
vector Layer window will open. Select Type as Polygon and Specify CRS as
EPSG: 4326 WGS 84 (see the figure shown below).

. 62
25. Add required attributes (e.g. Name) and click OK. The Save As window will
appear asking for the file name. Give a suitable filename (e.g.
ReservedForest_Pune.shp).

26. The layer will be created and it will be listed in the table of contents. To add features
to this layer, enable the layer editing by right-clicking the layer and selecting Toggle

Editing or by simply clicking the icon from the Digitizing toolbar.

27. Zoom in the toposheet to identify a Reserve Forest (RF) land parcel. Click the Add
feature icon in the Digitizing toolbar.

28. Ensure that the snapping option for the Reserved Forest (RF) layer (and other required
layers consisting of the features that are along the boundary of the RF) is also enabled.

29. Start digitizing the reserve forest feature by tracing its boundary. To insert vertices, use
the left mouse button. Finish the tracing using the right mouse button and enter the
attribute details in the subsequently appearing Attributes window. Once the entire
reserve forest parcels have been digitized, save the edits and click the Toggle editing
icon to stop editing.

30. Try to digitize other features on the map. With the digitized feature layers, a new map
can be prepared. This has been dealt in the next exercise.

. 63
Exercise 4

Map Preparation

This exercise includes the following tasks:


Task 1 - To present given data in the form of a comprehensive map.
Task 2 - To learn how to edit layer symbology.

Introduction
A map is a graphical representation of a particular area or the whole Earth on a flat
surface. This flat surface may be a paper or a piece of cloth etc. A very common output of
any GIS/Surveying work is a map. A map conveys more information than words; a map also
portrays the results and efforts in a better manner. Cartography is a branch of art and science,
which deals with map making. There are a wide variety of maps available- topographical,
geological, thematic, climatic, military, guide maps etc.

The main objective of this tutorial is to guide the user how to prepare a basic map in
QGIS. This tutorial deals with the labelling and editing of the symbology of various features
to create a map showing hospitals and bus stops of South Pune. The output of the previous
exercise on Digitization will be the data used in this exercise for map making.

1. Start QGIS Essen and open the map layers via the menu LayerAdd Vector Layer.
In the appearing window, click Browse and navigate to the Data_Lab4 folder.
Change the layer type to ESRI Shapefiles (see the first figure on next page) and
select all the .shp layers by pressing CTRL+A. Finally, click Open on this window
and the subsequent one.

1
The supplied data is not a validated data. Hence, it is necessary to carryout topological and other
corrections before using it for any analysis.

. 64
2. All the layers will be displayed in the map canvas (see the figure given below) and
will be listed under the Layers section in alphabetic order, in the same way the files
are stored on the computer.

Note: The color scheme of features in your map canvas may be different from the above figure.

3. Rearrange the layers in such a way that all the point features are on top of line
features and the line features are on top of the polygon features. This can be done by
selecting the layer and holding the left mouse button over it (the mouse cursor will
turn into to a double headed arrow); then, drag them up or down (see the figure on
next page).

. 65
For better representation of classes on a map, we can make use of visual aids such as
color, symbols etc. The following points deal with how to apply suitable colors and symbols
to make our maps visually more appealing.

4. Start the map preparation by setting the colors for the base polygon layers. While
setting the colors for polygons, it must be remembered that they are larger than most
of the other features in the map and their presence is already felt by virtue of their
size. Therefore, assign light and pastel colors to make sure the polygons fall into the
background.

5. Double-click the Urban Areas layer to open the Layer Properties window and

select the Style tab (see the first figure on next page).

6. Click Simple Fill under the Fill button on the left half of the window (see the first
figure on next page).

7. Next, click the dropdown arrow next to Fill, in the Colors section on the right half
of the window. Here, choose one of the standard/recent colors.

8. In case of not wanting any of the standard/recent colors, click Choose Color,
present at the bottom of the list (see the first figure on next page). Now, the Select
Fill Color window will open. A suitable color can be chosen using any of the 4 tabs-
color ramp, color wheel, color swatch, and color picker.

9. Similarly, the border color can also be changed by clicking the dropdown arrow next
to Border, adjacent to the Fill button on the right half of the window (see the first
figure on next page).

. 66
10. After selecting suitable fill and border colors, click OK.

11. Similarly, try giving suitable colors for all other classes (layers). A sample color code
is given below.

12. In addition to colors, the visual appeal of a map can be enhanced by using symbols.
This would be particularly useful when two classes (layers) have similar colors. For
example, take a look at the Open Scrub and Urban Greens layers in the above
figure. For better visualization, different symbols can be assigned to these classes.

. 67
13. Open the Layer Properties window of the Urban Greens layer by double-clicking
it. Now, under the Style tab, click the Add Symbol Layer icon (see the first
figure given below).

14. This will add a new symbol layer under Symbol layer section. Select it and change
the Symbol layer type to SVG Fill.

15. Use the symbol from the SVG symbols; then, choose a suitable color and texture
width (here, 3.00 mm) (see the below figure) and click OK. Use the same method to
set the desired symbology to other polygon layers.

. 68
Now, having set the symbology of the polygon features, proceed to the line features.

16. Mark the Roads layer using orange with red as border. Double-click the Roads
layer to bring up the Layer Properties window. To emulate the effect of having an
orange fill with a red boundary, use two fill layers. The thinner orange layer will be
stacked on top of a thicker red layer.

17. Use the Add Symbol Layer icon to add another symbol layer. Select the
upper layer and change its color to Orange and its width to 0.7mm (see the below
figure). Similarly, select the lower simple line layer and choose the color as Red; set
the width as 1.00 mm and click OK.

18. For the Highways layer, the same approach can be used. Change the layer symbol to
a Red line of width 3mm stacked on a Black line of width 3.2mm.

19. Notice the road/highway junctions which may appear staggered. To smoothen the
intersections, open the Layer Properties window of the Highway layer and from
the Advanced menu, select Symbol levels (see the first figure on next page). In
the popup window, check Enable symbol levels and click OK. Now, one can
notice that the intersections have been smoothened (see the second figure on next
page). Do the same for the Road layer.

. 69
19

20. The point layers can be better identified if they are represented by respective symbols.
Hence, double-click the Bus stop layer and select Simpler Marker under
Symbol layers; change the Symbol layer type to SVG Marker and use the bus
stop icon. Enter the value for other fields as shown below and click OK.

. 70
21. Similarly, change the symbology of Hospitals layer to .

22. Click the Zoom Full icon to view the entire map. The map should now look
similar to the figure shown below. Also, ensure that the order of layers under the
Layer section is same as that shown in the figure.

Now, attempt labelling the point layers using the names provided in the attribute table
by following the steps 23-25.

23. Right-click the Hospitals layer and select Open Attribute table. Check whether
the name of each hospital feature is displayed (see the figure given below).

. 71
24. Double-click the Hospitals layer; the Layer Properties window will open. Select
the Labels tab on the left section of the window (see the figure given below).

25. The Layer Labelling settings window will appear (see the figure given below). Click
the dropdown arrow next to the button showing No labels; on that list, select Show
labels for this layer. In the Label with section below, select Name and click OK.

26. Now, the hospitals will appear with their names as label on the map canvas. Also, try
labelling the Bus Stops (layer) with their respective names.

Now, having added the required details (such as labels, symbols etc.) onto the map
canvas, start with map composition by following the steps 27-40:

A proper map should contain the following details- Title, Author, Legend, Date,
Orientation and Scale; these are the minimum necessary elements for any map. This
can be remembered as an acronym- TALDOS.

27. To prepare a map in QGIS, the Print Composer tool is used. Open it via Main menu
barProjectNew Print Composer. Assign a unique print composer title (here,
SouthPune) and click OK.

. 72
28. In the right half of the subsequent Print Composer window, under the
Composition tab, change the size of the paper to A2 (420x594mm) (see the figure
given below); to have a full view of the map layout, click Zoom Full icon in
the toolbar.

29. Click the Add new map icon on the toolbar (on the left section of the
window) and place the mouse pointer on the top-left corner of the composers
workspace. Now, holding the left mouse button, drag the pointer across the whole
page to add the map from the canvas (see the figure given below).

30. The map will be displayed in the composers workspace. Generally, it would be at a
higher/lower scale than the publishing scale. In this tutorial, let us consider 1: 15000
as the publishing scale. So, to set this scale, click the Item Properties tab (see the
figure on next page) and type 15000 in the Scale field and press the Enter key
on the key board.

. 73
31. Next, click the Move Item Content icon in the tool bar and drag and place the
map at a suitable space on the map layout.

The following points will guide on how to add the map components (TALDOS).

32. Add the map title by clicking the Add New Label icon on the toolbar and
then click at an appropriate location on the map layout. Now, holding the left mouse
button, drag the pointer to form a rectangular space which will contain the map title
(see the first figure on next page).

33. Now, on the right section of the Print Composer window, click the Label box under
the Item Properties tab and in the entry box, type the title- Hospitals and Bus-
Stops of South Pune (see the second figure on next page). Then, click the Font
button and set the font style and size as Bold and 36 points respectively. Then, set
the horizontal and vertical alignment to Centre and Middle respectively. Now
resize the rectangle box accordingly to fit the title text.

. 74
34. Similarly, use the Add new label tool and add the authors name and the date of
publishing/surveying of the map, at the right bottom of the map.

35. To add the map legend, click the Add new Legend icon on the toolbar. Now,
click at a suitable place in the workspace and the legend would appear (see the first
figure on next page)

. 75
Task: Explore how to adjust the legend font and symbols using the Item Properties tab.

36. To add the scale bar, click Add new scale bar icon on the toolbar. Now, click
at a suitable place in the workspace; the scale bar would have been added. Its
properties can be set using the options under the Item Properties tab. Set the
Segment Size (the length of the scale bar segment in map units; here, meters) to 500
and the Map units per bar unit to 1 (as both are in meters in this case) and all other
values as shown in the below figure.

37. To add the North arrow, click Add image icon on the toolbar. Place the
mouse pointer at the top right of the workspace and drag it, holding the left mouse
button. Next, under the Item Properties tab, click Search Directories to select a
suitable arrow (see the first figure on next page).

. 76
38. For more adjustments, click Rendering in the Item Properties tab. Slide the
Transparency slider down to five.

39. Click the center of the map to select the whole map extent. Then check the Frame
check box under the Item Properties. The map will look as shown in the next page.

. 77
40. Save the map composer by clicking the Save icon on the main toolbar. Then,

click the Export to PDF icon on the main toolbar; in the resultant window,
navigate to a suitable folder and enter the filename as SouthPune and click Save;
now, the map has been saved as a pdf.

. 78
Exercise 5

Urban Spatial Analysis

One of the main applications of GIS is Urban Planning. GIS serves not only as a spatial
database but also as spatial analysis and modelling platform. These multi-functionalities of
GIS are particularly useful for urban planners, who handle large volumes of spatial data. The
use of GIS is set to grow even larger with the advent of Smart Cities concept.

Some of the potential applications of GIS in urban planning are for:


Land Use Planning.
Identification of location of services.
Smart Governance.
Transportation planning.
Urban risk assessment.
Law enforcement.
Environmental management etc.

This exercise deals with the basic operations of urban spatial analysis such as joining
attribute and spatial (shapefile) data, adding columns to attribute table, attribute querying,
spatial querying, and creating heat maps. Accordingly, this exercise has been divided into the
following four sections:
Section 5a- Working with Tables
Section 5b- Attribute Querying.
Section 5c- Spatial Querying.
Section 5d- Creating Heat maps.

In the exercises of the first two sections, the Census 2011 data of Mumbai city has been
used as example for tabular data. In the remaining two sections, the crime statistics and its
associated data of Lincoln City, Nebraska, USA (available at:
https://www.icpsr.umich.edu/CrimeStat/download.html) have been used.

. 79
Exercise 5a

Working with Tables

This exercise includes the following tasks:


Task 1- To join Census 2011 data of the areas under Municipal Corporation of
Greater Mumbai (MCGM) as attribute data with the respective shapefile.
Task 2- To create an additional attribute field using the Field Calculator tool of QGIS.

Introduction
In a developing country like India, the data required for spatial analysis are mostly
aspatial (tabular) in nature. For example, the Indian census data, which is one of the
commonly used data for urban spatial analysis, are available only in tabular form (as .xls/.csv
files). This unavailability of spatial data often forces the user to create (digitize) their own
map and then link the attribute data with the respective spatial data. Thankfully, QGIS
provides a convenient way to perform this linking, which has been discussed below.
In this exercise, the Census 2011 data of MCGM (available at the level of Census-
Sections in .xls format) and the MCGM Census-Section boundary shapefile have been used
as examples of attribute and spatial data respectively.

Convert the Tabular Data into a Format Compatible with QGIS.


1. From the Data_Lab5_ab folder, open the Census_MCGM.xls file in MS
Excel. This file gives the following Census 2011 data of each of the 88 Census
Sections in MCGM: Number of Households (No_HH), Total Population
(Tot_Pop), Total Male Population (Pop_M), Total Female Population (Pop_F),
Total Literate Population (Pop_Lit), and Percentage of households availing
banking facility (Bank).

2. Open QGIS Desktop (Start All Programs QGIS Essen QGIS Desktop
2.14.0) Add the MCGM.shp shapefile available in the said folder to the map
canvas of QGIS window. This shapefile depicts the Census Sections falling under
the MCGM. Open its attribute table by right-clicking the layer name in the table of

. 80
contents and choosing Open Attribute Table. The attribute table will open (see
the figure given below); go through the column/field headings.

3. In order to join a tabular attribute data with a shapefile, it is necessary to have a


column (carrying unique row values) common to both the table and the attribute
list of the shapefile. If a common column is absent, then create such a column
before proceeding further.

4. In this case, notice that a column named id is common to both the Census file
and the attribute table of the MCGM shapefile.

5. Since .xls is incompatible with QGIS, it is necessary to convert the


Census_MCGM table into compatible .csv (comma separated values) format. To
save the file in .csv format, in MS Excel, go to FileSave AsBrowse. In the
resulting Save As window, give an appropriate file name
(e.g.Census_MCGM), select the file type as CSV (Comma Delimited) and
click Save. This will open up a new window seeking confirmation; click Yes.

6. Open the newly created .csv file in QGIS using the Main menu barLayerAdd
LayerAdd Delimited Text Layer (see the first figure on next page). The Create
a Layer from a Delimited Text File window will appear.

. 81
7. In the Create a Layer from a Delimited Text File window (see the figure given
below), click the Browse next to the File name field. In the subsequent
window, navigate to the location of the Census_MCGM.csv file, select it and
click Open. Then, select the First record has field names checkbox and the
No geometry (Attribute only table) radio button, as these cases apply to this
.csv file. Click OK; now, the .csv file will be added to the table of contents.

Appending the .csv File Data to the Shapefile


8. Open the layer properties of the MCGM.shp layer (right-click the layer name in
the table of contents and select Properties). Select the Joins tab of the Layer
Properties window (see the figure on next page).

9. To add the Census data to the shapefile, click the icon (in the figure given on
next page: 9). The Add vector join window will pop up.

. 82
10. In the Add vector join window, select the Join layer as Cenus_MCGM.csv, and
in the Join field and target field fields, click the drop-down arrow and select
id (see figure: 10). Select the Custom field name prefix checkbox, delete the
given text and click OK. Finally, in the Layer properties window, click OK.

11. Check whether the fields have been added to the attribute table of MCGM.shp. It
is to be noted that this joint is only temporary; the attribute data would be actually
added only when the current shapefile is saved as a new shapefile layer.

12. Right-click MCGM in the table of contents and select Save As. In the resulting
Save As window, give an appropriate output file name (e.g. MCGM_Census).
Let the other fields (projection, format etc.) remain as they are. Click Save and
then click OK. Now, the newly created shapefile layer (MCGM_Census.shp) that
contains the Census attributes will be added to the map canvas.

Field Calculator Tool


Often one may have to add more attributes (columns) to the attribute table; if such an
additional column has to be computed using the available column values, the Field Calculator
tool can be used. This tool can also be used to calculate the geometry (area, perimeter etc.) of
individual features.

. 83
For example, the sex ratio (number of females per 1000 males) in each census-section
of MCGM can be calculated using the Pop_M and Pop_F fields of
MCGM_Census.shp in the Field Calculator. The steps are as follows:

13. Open the attribute table of MCGM_Census shapefile (right-click the layer name
in the table of contents and select Open Attribute Table).

14. Click the Field Calculator icon present in the tool bar of the attribute table.
The Field Calculator window will appear (see the figure given below).

15. In the Field Calculator window, select the Create a new field checkbox (see
section 15 of the above figure) and enter the details as given below:

Output field name: Sex_Ratio.


Output field type: Whole Number (Integer).
Output field length: 4
16. In the Expression field (see section 16 of the above figure), type:
Pop_F/Pop_M*1000.

Note: Explore the panel adjacent to the Expression field; it lists the various operations that
can be done using Field Calculator. Filenames and operators can be included in the
Expression field by simply double-clicking the respective m fieldnames and operators listed
in this panel.

. 84
17. Once the expression is entered, click OK. Now, the Sex_Ratio field will appear
in the attribute table. Save the changes made to the table by clicking the Save

Edits icon in the tool bar of the attribute table.

18. By following steps 13-17, try adding a similar column called Lit_Rate that gives
the literacy rate of each census-section. Specify the field type as Decimal number
(real), and the field length and precision as 2. Once the field is added, save the
layer edits. Finally, the attribute table will appear as shown below.

. 85
Exercise 5b

Attribute Querying

This exercise includes the following task:


Task To identify the MCGM Census sections that match the given attribute query
criteria.

Introduction:
Query in GIS is a logical expression that selects and displays only the features
satisfying the user-defined criteria. This is a very useful tool for exploring the information
and spatial patterns in the given data. Generally, queries are of two types: attribute query and
spatial query. Attribute query, also known as 'aspatial query', purely depends on the attribute
information associated with geographical dataset. It uses relational operators and Boolean
logic to obtain the features of interest. Spatial query can be used to select features that share
the desired spatial relationships (e.g., adjacency, intersection, containment etc.).
For this exercise, the MCGM_Census shapefile of the previous exercise shall be used.
This shapefile is in the Universal Transverse Mercator (UTM-Zone 43N) projection, which is
based on the WGS 84 Datum.
1. Open QGIS Desktop (StartAll ProgramsQGIS EssenQGIS Desktop

2.14.0). Using the 'Add Vector layer icon , add the MCGM_Census.shp
shapefile. Open the attribute table of this shapefile layer (right-click the layer
name in the table of contents and select Open Attribute Table).

Query 1: Which are the three least populated MCGM census-sections?


Solution: a) Since the query is related to population, refer the Tot_Pop column in the
attribute table.
b) Click the Tot_Pop field once. An upward-pointing triangle will appear next to

the field name ( ), indicating that the data is arranged in the


ascending order. Therefore, the first three rows represent the three least
populated sections; they are: Manori Island, Gorai & Kulvem, and Madh.
c) To view these three census-sections on the map window, hold the Ctrl key and
click the left-most cells of those three rows (see the first figure on next page).

. 86
d) Once the rows are selected, the corresponding features will be highlighted
in yellow in the map canvas (see the figure given below).

e) To create a new shapefile containing only the selected features, right-click


the MCGM_Census layer name in the table of contents and select Save
As. In the resulting Save vector layer as window (see the figure given
below), give a suitable file name, select the Save only selected features
checkbox, and click OK.

. 87
Query 2: Which are the census-sections having sex ratio higher than the national average
(943)?
Solution: To perform this task, the Expression based filter has to be used.
a) Open the attribute table of the MCGM_Census shapefile. Click the Show
All Feature option located at the bottom left and select Advance Filter
(Expression) (see the figure given below).

b) The 'Expression based Filter window will appear (see the figure given
below). This window contains 3 panels: Expression panel, Function list
panel, and Function help panel. The query expression is displayed in the
Expression panel; the Function list panel lists the various
operations/functions available while their description can be found in the
Function help panel.

c) In the Function list panel, expand the Fields and Values option; this will list
all the field names available in the attribute table. From this list, double-click
'Sex_Ratio' so that it is added to the expression panel. Now, type >943 in
the Expression window. Then, click 'OK'.

. 88
d) Once the query is made, only the features satisfying the given criteria (Sex
Ratio>943) will be displayed in the attribute table. These features will also be
highlighted in the map canvas (see the figure given below). Save these features
as a different shapefile (refer (e) of the solution to query 1).

Query 3: Which are the census-sections having sex ratio and literacy rate below 900 and 75%
respectively?
Solution: To perform this task, the AND' operator is required; it is available under the
Operators option of the Function list panel of Expression based filter window.
a) Repeat step (a) of the solution to query 2.

b) As done in step (c) of the solution to query 2, choose the fields Sex_Ratio and
Lit_Rate from the Fields and Values option and construct the expression
Sex_Ratio <900 AND Lit_Rate <75.

c) On clicking OK, only the features that satisfy the given criteria will be
highlighted in the map canvas (see the figure given below).

. 89
Exercise 5c

Spatial Querying

This exercise includes the following task:


Task- To identify features based on the queried spatial relationships.

Introduction
As told in the introduction to previous exercise, spatial query can be used to select
features that share the desired spatial relationships (e.g., adjacency, intersection, containment
etc.). This exercise is focused on how to build spatial queries to retrieve the desired
information in a useful form, and export the results into new shapefiles.
The data used in this exercise is that of Lincoln City, Lancaster County, Nebraska,
USA. It contains shapefiles pertaining to crime locations, major roads, schools, parks, and
streams located within the Lancaster County. This data is freely available online as part of a
software package called CrimeStat, used by various police departments across USA.
1. Open QGIS Desktop (StartAll ProgramsQGIS EssenQGIS Desktop

2.14.0). Using the 'Add Vector layer icon , add all the seven shapefiles
given in the Data_Lab5_c folder. Arrange the layers such that the Line
features are at the top of Polygon features (see the figure given below). To
open the attribute table of any shapefile layer, right-click the layer name in
the table of contents and select Open Attribute Table.

Query 1: Which are the schools that are located within the city?
Solution: In order to solve this query, the schools and CityExt layers are to be used.
a) Open the Spatial Query tool via the Main menu barVectorSpatial
QuerySpatial Query (see the first figure on next page). The Spatial Query
window will open.

. 90
b) The Spatial Query window contains 4 sections (see the figure given below)-

i) Select source features from section- From the drop-down list, choose the
name of the layer from which the features are to be identified.

ii) Where the feature section- Select the relevant spatial criterion from the
drop-down list.

iii) Reference feature from section- From the drop-down list, choose the
name of the reference layer based on which the features are to be selected.

iv) And add the result to section- It remains as Create new selection by
default.

c) For the given query criterion, select the options as following (see the figure
shown above):

i) Select source features from- schools.

ii) Where the feature- within.

iii) Reference features from- CityExt.

. 91
d) Once the required inputs have been filled, click Apply. The features that
match the given query criteria will be displayed in the same window (see the
first figure given below); these features will also be highlighted in the map
canvas.

e) Save the selected features as a different shapefile by clicking the Create layer

with selected icon on the Spatial Query window. Upon clicking the icon,
these features will be shown in map window as schools selected layer; right-
click this layer and click Save as to save it with a suitable name
(e.g.CitySchools) at the desired location.

Note: Before proceeding to the next query, it is preferable to deselect all the selected
features. To do this, click the Deselect feature from All Layers icon from the attribute
toolbar (see the figure given below).

. 92
Query 2: Which are the parks that are adjacent to the schools within the city?
Solution: To answer this query, the CitySchools.shp layer (created from the results of
previous query) is to be used as it contains only the schools located within the city.

a) Open the Spatial Query window (refer (a) of the solution to query 1).

b) Specify the source layer as parks, the spatial criterion as Intersects and the
reference feature as CitySchools (see the figure given below). Then, click
Apply.

c) The query results will appear in the same window and the selected features
will be highlighted in the map canvas. Click the Create layer with selected

icon and save the layer as Parks_CitySchools.shp (refer step (e) of the
solution to query 1).

Query 3: Which are the schools in the city that are within 1Km from the streams?
Solution: To answer this query too, the CitySchools.shp layer (created from the results of
query 1) can be used as it contains only the schools located within the city. However, before
proceeding with the spatial query, a layer containing the 1Km buffer zone around the streams
has to be created.

. 93
a) Open the buffer function via the Menu bar VectorGeoprocessing
toolsBuffer(s) (see the first figure given below).

b) In the resulting Buffer(s) window (see the figure given below), select the
input vector layer as streams. Specify the buffer distance as 1000 (since
the current working unit is meters) and select the Dissolve buffer results
checkbox. Click Browse and give a suitable output name
(e.g.streams_buffer). Then, click OK. Now, the buffer layer will be created
and listed in the table of contents.

c) Having created the 1Km buffer zone for streams, proceed to Spatial Query
(VectorSpatial QuerySpatial Query) to identify the schools falling in this
buffer zone.

. 94
d) For the given query criterion, in the Spatial query window (see the figure
given below), select the source layer as CitySchools, the spatial criterion as
intersects, and the reference feature as streams_buffer. (Here,
intersects is used instead of within as even the schools partly falling
within the buffer zone are to be extracted).

e) The query results will appear in the same window and the selected features
will be highlighted in the map canvas. Click the Create layer with selected

icon and save the layer with a suitable name (refer step (e) of the
solution to query 1).

Query 4: Which are the major street segments in the city that cross a water body?
Solution: For the given query criterion, the MajorStreets and waterbodies layers are to be
used.
a) Since the given query criterion refers only to the major street segments
within the city, the MajorStreets layer has to be clipped to select only those
features located within the city limits (i.e. CityExt layer).
b) Open the Clip tool via the Main menu barVectorGeoprocessing
ToolsClip.

c) In the resulting Clip window (see the first figure on next page), select the
input vector layer as MajorStreets, and the clip layer as CityExt. Click
Browse and save the extracted features as a different shapefile with a

. 95
suitable name (e.g. City_Major_Streets.shp). Select the Add result to map
checkbox and click OK.

d) Having extracted the major street segments within the city, proceed to the
Spatial Query tool (Main menu barVectorSpatial QuerySpatial
Query).

e) Specify the source layer as City_Major_Streets, the spatial criterion as


crosses and the reference feature as waterbodies (see the figure given
below). Then, click Apply.

f)The query results will appear in the same window and the selected features
will be highlighted in the map canvas. Click the Create layer with selected

icon and save the layer with a sitable name (refer step (e) of the solution
to query 1).

. 96
Query 5: Which are the stream segments that are outside the city limits?
Solution:
a) Open the Spatial Query tool (Main menu barVectorSpatial
QuerySpatial Query).

b) Specify the source layer as streams, the spatial criterion as Is Disjoint and
the reference feature as CityExt (see the figure given below). Then, click
Apply.

c) The query results will appear in the same window and the selected features
will be highlighted in the map canvas. Click the Create layer with selected

icon and save the layer with a suitable name (refer step (e) of the solution
to query 1).

. 97
Exercise 5d
Creating Heatmaps

This exercise includes the following task:


Task To identify the crime hotspots in Lincoln City, USA based on the given crime
location and its associated data.

Introduction:
Heatmaps are one of the best visualization tools for dense point data. They are
particularly useful to identify clusters indicating high concentration of a particular activity. In
the context of urban planning, heatmaps are often used to represent the concentration of
diseases, crime, residential patterns etc. within a city.
Heatmaps can be generated in QGIS using the Heatmap plugin. (To know more
about plugins, refer exercise 6b); these heatmap layers are in raster format as they vary
continuously over the map surface.
This exercise demonstrates the generation of heatmaps in QGIS by discussing the
procedure to identify hotspots of residential burglaries in Lincoln City, Nebraska, USA as
example.

Procedure:
1. Open QGIS Desktop (StartAll ProgramsQGIS EssenQGIS Desktop

2.14.0). Using the 'Add Vector layer icon , add all the six shapefiles given in
the Data_Lab5_d folder. Arrange the layers such that the polygon features are
displayed below the other layers (see the first figure on next page). To open the
attribute table of any shapefile layer, right-click the layer name in the table of
contents and select Open Attribute Table.

___________________________________________________________________________
Note: Usually the crime records will be in a tabular (.csv/.xls) format. Hence, for generating
heatmaps, it is necessary to import the tabular data into QGIS (refer Ex.5a), and create a
(point) shapefile layer to represent the crime locations.

. 98
2. Open the Heatmap tool via the Main menu bar Raster Heatmap Heatmap
(see the figure given below).

3. In the resulting Heatmap Plugin window (see the figure given below), select the
input point layer as resburglaries. Click the button next to the Output
raster field and give a suitable file name to the output heatmap (e.g.
res_burglaries_HM). Set the radius1 as 1000 map units. Then, select the
Advanced checkbox, specify the desired cell size of the output heatmap as 100
(in both Cell Size X and Cell Size Y fields) and click OK.

___________________________________________________________________________
1
Radius refers to the area around each point of interest based on which the heat received
by a pixel is calculated.

. 99
4. Once the processing is completed, the heatmap will be loaded in the map
canvas (see the figure given below). Use the Identify tool to check the pixel
values1 of the heatmap layer.

5. As seen in the above figure, the heatmap displayed will be in greyscale by


default. To make the heatmap visually more appealing, the layer style has to
be changed in the Layer properties window. To open this window, right-
click the heatmap layer and click Properties.
6. In the resultant window, open the style tab (see the first figure on next page)
and select the Render type as Singleband pseudocolor (figure: 6a). Choose
a suitable colour ramp (e.g. YlOrRd- Yellow-Orange-Red; figure: 6b), and
click Classify (figure: 6c); now, the categories of values will appear in the
left panel (figure: 6d). If the categorization made is found satisfactory, click
OK (figure: 6e); else change the classification settings and try again.
7. Upon clicking OK, the heatmap will be displayed in the YlOrRd scale;
yellow and red represent the lowest and highest concentration of residential
burglaries respectively (see the second figure on next page).

___________________________________________________________________________
1 The pixel values of the heatmap layer represent how many points from the source layer are
contained within the specified radius (here: 1000m) around the pixel.

. 100
8. To identify the hotspots from the heatmap, the pixels carrying values higher
than a user-defined threshold (here: 4) are to be extracted; this can be done
using the Raster Calculator tool (dealt extensively in exercise 6d).
9. Open the Raster Calulator tool via the Main menu barRasterRaster
Calculator (see the figure on next page). In the resulting window, double-click
res_burglaries_HM@1 in the Raster bands section (figure: 9a) so that it
gets added to the Expression field. Then, in the Expression field, enter >4

. 101
(figure: 9b). Click the button (figure: 9c) next to the Output layer
field and enter a suitable filename (e.g. res_burglaries_hotspots.tif). Then,
click OK.

10. The output layer will be displayed in the map canvas. Since the result to the
given expression is binary, this layer will contain only 0 or 1 as pixel
values i.e. only those pixels of the source layer whose value is greater than 4
will hold a value of 1 in this result layer.
11. In order to identify these hotspots as vector features, the
res_burgalries_hotspots raster layer has to be converted into a vector layer;
this can be done using the Polygonize tool (Main menu
barRasterConversionPolygonize (Raster to Vector)).
12. In the Polygonize window (see the first figure on next page), select the input
layer as res_burgalries_hotspots.tif and enter a suitable output name in the
Output file for polygons field (e.g. res_burglaries_hotspots.shp). Select the
Field name and Load into canvas when finished checkboxes, and click
OK.

. 102
13. Once the conversion is complete, the vector hotspots layer will be added to the
map canvas; in this layer, the features holding 1 as value are the hotspots. To
extract only these features, right-click the layer and select Open Attribute
Table.

14. In the Attribute table, click the Select feature using an expression icon on
the toolbar. In the resulting window (see the figure given below), enter the
expression as "DN" = 1 and click Select. Now, the selected features will be
highlighted in the map canvas. Save these selected features as a different
shapefile (right-click the res_burglaries_hotspots.shp layer and select Save
as).

. 103
15. The resultant shapefile represents the hotspots of residential burglaries in
Lincoln City (see the figure given below; hotspots are shown in red). This
information can be used further for advanced analysis such as spatial
autocorrelation etc.

. 104
Exercise 6

Application of QGIS for Natural Resource Management

Natural Resources Management (NRM) refers to the sustainable utilization of major


natural resources, such as land, water, air, minerals, forests, fisheries, and wild flora and
fauna. Together, these resources provide the ecosystem services that underpin human life.
Hence, it is essential to know the spatial as well as temporal distribution of the resources if
they are to be properly managed in a sustainable manner.

Remote Sensing (RS) and Geographic Information System (GIS) technologies help us
to carry out a reliable, precise and efficient resource assessment, change detection, suitability
analysis, scenario analysis, environmental impact assessment etc.

Any resource assessment will involve various basic GIS operations such as
mosaicking, clipping, overlay analysis etc. Accordingly, this exercise is designed to
demonstrate the commonly used GIS operations in any resource assessment and management
project.

This exercise has the following four sections


Terrain Data Analysis- This section include contour, Hill shade, slope map
generation and visualization of data in Google maps which is essential for analyzing
the terrain data.
Working with QGIS Plugins- QGIS has huge plugin repository which can be used
for various applications. This section gives a brief overview on installing and using
the plugins.
Watershed delineation- This is an important step for any study related to land and
water resources management.
Soil erosion hazard mapping- This section deals with a case study to generate soil
erosion hazard map. This type of study helps in taking decision for soil conservation
and management programs.

. 105
Exercise 6a
Terrain Data Analysis

This exercise includes the following task:


Task - To create the contour and slope maps of the Krishna river basin.

Generation of Contour lines:


1. From the Data_Lab6 folder, add the krishnadem.tif file using the Add Raster

Layer icon on the toolbar.


2. The added raster (see the figure given below) represents the Digital Elevation Model
(DEM) of the Krishna River Basin. Each pixel in the terrain raster represents the
average elevation in meters at that location. The dark pixels represent areas with low
altitude while the lighter pixels represent areas with high altitude.

3. To generate contours from a DEM raster, the Contour tool of QGIS can be used.
(Main menu barRasterExtractionContour).
4. In the resultant Contour window (see the first figure on next page), specify the input
file as krishnadem.tif. Name the output file containing the contour lines as
krishna_contour.shp. Specify the contour interval as 100m. Also, check the
Attribute name checkbox so that the elevation value of each contour line is recorded
as an attribute. Finally, click OK

. 106
5. Once the processing is completed, the contour lines will be loaded onto the map
canvas. Each line in this layer represents a particular elevation. The closer the lines,
the steeper the slope. Right click the contour layer and choose Open Attribute Table
(see the figure given below).
6. It can be seen that each line feature has an attribute named ELEV, showing the
elevation (in metres) represented by that line. Click the column header twice to sort
the values in the descending order (see the below figure: 6); the first row represents
the contour line corresponding to the highest elevation in the Krishna Basin.

. 107
7. To visualize the contours layer in the Google Earth, right click the contours layer (see
the figure given below), and from the resultant drop-down list, select Save as.
8. Specify the format as Keyhole Markup Language [KML]. Name the output file as
contours.kml and then click OK (see the below figure: 8).

9. Open Google Earth. Go to File in menu bar and click open and browse to the
output file (contours.kml) on your disk (as shown below).

. 108
10. The Krishna contour KML file will open in Google Earth as shown below.

11. Zoom the area to verify the contours as shown below.

Generation of Slope map:


1. Open the Slope tool via the Main menu barRasterTerrain AnalysisSlope (see
the first figure on next page).
2. In the Slope window, select the input file as krishnadem. Name the output file as
slope.tif. Choose the output format as GeoTIFF. Leave all other options as they
are. Also check the Add result to project checkbox and click OK (see the figure:
2).

. 109
3. Once the processing is completed, the slope map will be loaded onto the map
canvas.
4. To view the entire extent of the slope map in the canvas, right click the slope layer
and choose Zoom to Layer. It will appear as shown in the below figure.

Note: Similar to the slope map, one can also generate the Hillshade and Aspect maps of
the basin using the respective tools given in the Terrain Analysis section under the Raster
menu.

. 110
Exercise 6b
Introduction to QGIS Plugins

This exercise includes the following task:


Task To enable Core Plugins as well as download and install External Plugins.

Core Plugins:
Core plugins are, by default, part of the standard QGIS installation. In order to use
these plugins, one must verify whether they have been enabled.
1. Open QGIS. Open the Plugin Manager window via the Main menu
barPluginsManage and Install Plugins (see the figure given below).
2. It can be seen that there are lot of plugins listed under the Installed tab (as shown in
the below figure: 1).This is because they are Core Plugins and were installed as part
of the installation of QGIS.

3. Let's enable one of the plugins. Check the checkbox which is next to Spatial Query
Plugin, this will enable the plugin. One thing to note is that plugins have the ability to
insert menu items at various locations and create new panels and toolbars. Sometimes
it is difficult to know how to find the newly enabled tools. One clue is to look in the
plugin description (refer the above figure: 1). Here, the description says Category:

. 111
Vector. That indicates that the plugin would be found under the Vector menu once
enabled. Then click Close.
4. Now that the Spatial Query Plugin is enabled, click Vector tab in main menu bar and
select Spatial Query (see the below figure) to use the functionality added by the
plugin.

External Plugins:
External plugins are available in the QGIS Plugins Repository and need to be installed
by the users before using them. An easy way to browse and install these plugins is by using
the Plugin Manager tool.
1. Open QGIS. In main menu bar, click Plugins tab and select Manage and Install
Plugins, to open the Plugin Manager window (see the below figure).
2. Click Not installed tab, note the list of plugins (as shown in the below figure: 1).

. 112
3. For this tutorial, let's find and install a plugin called 'QuickWKT'. Type quick in
Search filter, select QuickWKT plugin. Next, click Install plugin button to install it
(refer the above figure).
4. Once the plugin is downloaded and installed, a confirmation window will appear.
5. Noticed that, there was no mention of the plugin category in the description of
'QuickWKT' plugin. That makes it hard to determine how to access the newly
installed plugin. Most external plugins are installed under the Plugins menu itself in
QGIS. Click Plugins QuickWKT. Usually, external plugins also install a 'button
in the Plugins toolbar. This button can also be used to access this plugin (as shown in
the below figure).

Experimental Plugins:
The above content dealt with how to install and find an External Plugin in QGIS,
now let's explore some advanced options. Sometimes, a specific plugin is required, but it is
not available in All tab of Plugin Manager window. It maybe because the plugin is marked
Experimental. Here is how to enable the experimental plugins.
1. Open Plugin Manager window by clicking on Plugins tab in main menu bar and
select Manage and Install Plugins. Click the Settings tab. Notice the option called
Show also experimental plugins. Click the checkbox next to it, to enable it (refer the
first figure on next page).

. 113
2. The experimental plugins will be shown up in the All tab and Not installed tab.
Once any plugin is selected (for example DEMTools is selected here), the details
about the plugin (it is experimental plugin or not) is shown in the right panel as shown
in the below figure.

. 114
Exercise 6c
Watershed Delineation using GRASS Plugin

This exercise includes the following task:


Task To perform watershed delineation using GRASS Plugin

In hydrology, a watershed refers to an area of land in which all the precipitation


runoff drains into a common waterway, such as a lake, river, or ocean. In other words,
watersheds act as natural funnels, collecting the precipitation that lands within their borders,
and directing it into the common waterway outlet. Watersheds are arranged in hierarchical
order, where the size of a given watershed is determined by the location of its outlet. Thus, as
the outlet of a watershed moves downstream, the watershed becomes larger and consists of
more sub-watersheds. In hydrology, watersheds are extremely important since they delineate
regions that naturally contribute to flow in a given waterway.

Steps involved in this task:


1. Loading the Digital Elevation Model (DEM) in QGIS.
2. Creation of GRASS location and mapset.
3. Importing the DEM into GRASS.
4. Watershed Delineation.

Load the raster krishnadem.tif from the Data_Lab6 folder in a new QGIS project.

Creation of GRASS location and mapset:


Practically, a GRASS location is the location of the study area on the Earth
surface, and a GRASS mapset is the set of maps of the study area within the GRASS
location. Here, GRASS location is just a folder, and a mapset is a subfolder within it.
1. Click the Plugins tab in the menu bar. If GRASS is not checked, click on Plugin
manager and check the box next to GRASS.
2. Click the Plugins tab in the main menu bar (see the first figure on next page), go to
GRASS and select New mapset.
3. In resulting window (see the first figure on next page) (GRASS database), click the
Browse button and navigate to Data_Lab6 folder and then click Next.

. 115
4. To create new GRASS location, enter the location name as WGS84 in Create a
new location field (as shown in below figure), and then click Next.
5. In the subsequent window (as shown below), to set the Coordinate System, click on
the Projection and select Geographic Coordinate Systems and scroll down or type
in filter WGS / UTM zone 44N or 32644. Then click Next.

6. In the resulting window, to select the Default GRASS Region (see the first figure on
next page), set QGIS current extent as India from the dropdown list and then click
Next.
7. In the next window (see the first figure on next page), in the New Mapset field enter
krishna and then click Next.

. 116
8. In the subsequent window (see the figure below), select the check box of Open new
Mapset and then click Finish.

9. Check that the Display current GRASS region button is enabled (see the figure
given below) and zoom out until the red rectangle marking the current region is
visible.

. 117
10. The Grass tool window is open in right side (as shown in the figure on previous page).
To mark the new region, select the Region tab and click Select the extent by
dragging on canvas tab in GRASS Tools window. Using the mouse, drag exactly
over the krishnadem image, (from bottom left to top right). Also specify the new
values for the region resolution as 90 in both N-S Res and E-W Res (as resolution of
DEM is 90 m). Click Apply, the red rectangle should closely match the
krishnadem image as shown in the figure above.

Importing the krishnadem raster into GRASS


(Refer the below figure for steps 1 to 4)
1. Click on the Modules tab in GRASS Tools window.
2. Expand Create new GRASS location and transfer data into it.
3. Expand Create new GRASS location from raster data.
4. Double click on r.in.gdal.qgis option.

(Refer the figure on the next page for steps 5 to 7)


5. Under the option Loaded layer, select krishnadem.
6. Under the option Name for output raster map, type dem.
7. Click Run. After the process finishes (it should say Successfully finished), click
on View Output and then click Close.

. 118
Watershed Delineation:
There are two modules available in GRASS that allow watershed
delineation: r.watershed and r.water.outlet. Although these modules produce similar
output, they delineate watersheds in two different ways.
a) r.watershed- This method is designed for analysis in which the delineation of all
watersheds over a specified size is required.
b) r.water.outlet- This moduke is used if a watershed with a specific outlet point is
required. This module is discussed in exercise (6d)

Create basins and streams using the r.watershed module.


(Refer the first figure on next page for steps 1 to 4)
1. In GRASS Tools window, click Module tab, type r.water in Filter field and select
r.watershed.
2. In field Name of input elevation raster map, select dem from the drop down list.
3. Choose an appropriate threshold such that the minimum watershed size will be about
50sq.km. (The Krishna DEM data is 90 m resolution, the number of pixels/raster cells
covering the area of 50 sq. km is equal to 6172 (=50*10^6/90*90)). In field Minimum
size for each basin, enter 6172.
4. In field Name for output accumulation raster map, enter flw_acc. In field Name for
output drainage direction raster map, enter flw_dir. Also, in field Name for output

. 119
stream segment raster map, enter flw_str. In field Name for output basin raster map,
enter basin (unique label for each watershed).

5. Click Run and once processing is completed, click on View Output (output will be
similar to the below figure). The output map does not show all the sub basins, so proper
styling needs to be done. The output is a raster file which can show maximum 255 colors
and number of sub- basins are more than 255, so we need to first convert it to vector
layer.

. 120
6. Option r.to.vect can be used to convert the raster layer to vector layer. In GRASS
Tools window, select Modules tab. In Filter field type, r.to.vect (as shown in the
below figure) and select r.to.vect.area.

7. In the subsequent window (as shown in the below figure), in field Name of input raster
map, select basin from the drop down list. In field Name for output vector map, enter
basin_vect. Click Run and then click View Output.

. 121
8. For proper visualization of sub basins, set random colors for different sub-basins. Right
click wtrshd_vect layer in Table of Contents, go to Properties. In the resulting
window, select Style tab. In the top left of the style window, select Categorized from
the drop down list. In Column field select 123 value from the drop down list. In Color
ramp field, select Random colors from the drop down list. Click Classify tab. A
dialogue appears, click OK and then click Apply.

9. Click apply, the resulting image will be as shown below-

. 122
Exercise 6d
Soil Erosion Hazard Mapping

This exercise includes the following task:


Task- To generate soil erosion hazard map of a watershed.

Inputs:
STRM DEM .tiff images, Pour point (.shp file) and land use map (rater tiff format).

Steps involved:
Task 1: Mosaicking SRTM 90m DEM images (4 no. of images)
As the complete study area is not covered in one tile of SRTM DEM, it is necessary to
combine different tiles into a single tile. This step is called as Mosaicking.

Task 2: Re-Projection of the image to WGS84 43N projection


As the datasets used in this exercise are obtained from different sources, they are not
in same projection system. Therefore, it is the preliminary step in all the GIS projects
to bring the datasets into same projection system.

Task 3: Perform watershed delineation using pour points.


Task 4: Clipping and resampling the input data for the watershed
To perform all the analysis, the datasets have to be clipped to match with the
watershed boundary (which is the study area).
Also to perform raster overlay analysis all the dataset should be resampled to same
spatial resolution.
Task 5: Generate the soil erosion hazard map.

Task 1: Mosaicking
The SRTM DEM tiles are downloaded for the study area from the Earth explorer
website; now, these tiles need to be mosaicked. For mosaicking follow the steps below-
1. Open QGIS and go to Layer in main menu bar and select Add Raster Layer.

. 123
2. Browse to the srtm_30m_marol folder in Data_Lab6 folder. Hold down the Ctrl
key and click the image files to make a multiple selection and click Open. The
images will be as shown in the below figure.

3. Now create a single Mosaic image from all these individual images. Click Raster in
main menu bar, go to Miscellaneous and select Merge (as shown in the below
figure).

4. In the resultant window, click Select in Input files tab and browse to the directory
containing all the individual images which is to be mosaicked. Keep holding the Ctrl
key and select all the images. Click on Select in output file tab and name the output
as mosaic.tiff. At the bottom, select the check box next to Load into canvas (see
the above figure) and then click OK.

. 124
5. Once the processing is completed, the mosaic is created. Load the mosaic image to the
QGIS Canvas (mosaicked image will be same as shown in the below figure).

Task 2: Re- Projection


6. Observe that the coordinates are in decimal degrees, check for the projection of the
image. Right click mosaic.tiff layer in the table of contents and go to Properties,
select Metadata. In the Properties tab, scroll down to the Layer spatial reference
system (see the below figure). It can be seen that the image has WGS84 datum and
it is not projected. Hence, the image needs to be projected. Then click OK.

. 125
7. Click on Raster tab in the main menu bar, go to Projections and select Wrap (Re-
project) (see the figure given below).

8. Select input file as mosaic.tiff, enter output file name as dem. Source SRS will be
mentioned as EPSG: 4326 (see the above figure). Check the Target SRS box and
click on Select, then a window appears. In Filter tab, type EPSG: 32643 or scroll
down and search for WGS 84 / UTM zone 43N.

Task 3: Watershed Delineation:


Creating GRASS location and mapset:

Open a new project in QGIS and import the mosaicked and projected DEM image
(saved as dem.tif) and follow the same steps as discussed in the previous exercise (6c) for
creating a new mapset.
1. Click on Plugins in the menu bar. Click on Plugin manager, if GRASS is not in
selection, check the box next to GRASS.
2. To open new mapset (Plugins GRASS New mapset). In the resultant window
(GRASS database), click on the Browse button and navigate to Data_Lab6 folder
and click Select Folder, then click Next.
3. In the next window, in Create a new location field, type WGS84_43N. Then click
Next.

. 126
4. In the subsequent window, under Coordinate System, click on the Projection
button. In Geographic Coordinate Systems option, scroll down or type WGS / UTM
zone 43N or EPSG:32643 in Filter menu. Then click Next.
5. In the next Default GRASS Region window, select India from the dropdown menu
as the extent and click Set. Then click Next.
6. In the next window, type marol as the new mapset. Then click Next.
7. Check the Open Mapset option and click Finish.

Set GRASS region:

Be sure that the Display current GRASS region button is enabled and zoom out
until the red rectangle marking the current region is visible.
8. The Grass Tool window will open on right side. To mark the new region, select the
Region tab and click on the tab Select the extent by dragging on canvas. Using the
mouse, drag exactly over the dem image in the map canvas (from bottom left to top
right). Also specify the new values for the region resolution as 90 in both N-S Res
and E-W Res (as resolution of DEM is 90 m). Click Apply, and ensure that the red
rectangle should closely match the dem image as shown in the figure on previous
page.

Import the DEM into GRASS:


To perform Watershed Delineation, DEM needs to be imported in GRASS.
9. Click on the Modules tab in GRASS Tools window.
10. Expand Create new GRASS location and transfer data into it.
11. Expand Create new GRASS location from raster data.
12. Click on r.in.gdal.qgis.
13. A new tab opens in GRASS Tools window, Under Loaded layer menu select
dem from the drop down list.
14. Under the menu Name for output raster map type dem
15. Click Run. After the process finishes (it should say Successfully finished), click on
View Output and click Close.

. 127
Generation of flow direction, flow accumulation and stream maps using r.watershed
Watershed delineation using pour point requires flow direction and flow accumulation
maps as input. To generate these maps there is no separate tool in GRASS. So in the present
exercise, watershed delineation using the minimum area will be used for generating flow
direction and flow accumulation maps (the steps followed here are similar to that given in
exercise 6(c)).
1. In GRASS Tool window, click Module tab. In Filter field, enter r.water and
select r.watershed.
2. Run the module with the dem as the input raster.
3. Choose an approximate threshold for the minimum watershed size (take it as 55555),
this is not important here because we are only concerned with flow direction and flow
accumulation map. In field Minimum size for each basin, enter 55555.
4. In field Name for output accumulation raster map, enter flw_acc. In field Name
for output drainage direction raster map, enter flw_dir. Also, in field Name for
output stream segment raster map, enter flw_str. In field Name for output basin
raster map, enter basin (unique label for each watershed).
5. Click Run and then click View Output.

. 128
Watershed delineation using pour point (r.water.outlet)
1. The module r.water.outlet creates a single drainage basin by taking input as flow
direction and coordinates of pour point. The pour point must be exactly on a drainage
line.
2. Open the shape file named marol_pour_point.shp using import vector data.
3. In table of contents, check the flow_acc and marol_pour_point layer, and uncheck
all other layers. Ensure that marol_pour_point layer is above flow_acc layer, so
that pour point is visible. Zoom in very close to the pour point (as shown in the below
figure).

In the flow_acc map, black pixels represents the pixels with higher flow_accumulation
value i.e these pixels cover some drainage area, so these continuous pixels can be considered
as drainage line.

4. If pour point lies on the drainage line, then select the pixel or else select the drainage
line pixel which is nearest to the pour point. Enable the Identity cursor and select
flow_acc in table of content (see the first figure on next page). Click on the selected
pixel using Identity cursor. In the resultant window Identify Results, note the flow
accumulation value. Expand the option Derived and note the exact coordinates of
the pour point.

. 129
5. In GRASS tool window, select Modules tab and in Filter field, type water and
select the r.water.outlet module (see the below figure).

6. Select flow_dir as the drainage direction and enter the chosen coordinates as the
outlet point (as shown in the above figure). Name the output watershed basin as
watershed, then click view output.
7. The watershed layer obtained above is in raster format. Now to get the watershed
boundary, we need to convert the raster file to polygon vector file using
r.to.vect.area.

. 130
8. Select r.to.vect.area (refer the below figure), select watershed as input raster map
and enter the output vector map as wshd_boundary. Click Run and then click
View Output.

9. The Boundary layer is saved in GRASS mapset, save this layer in Data_Lab6
folder for further analysis in QGIS. Save the layer by right clicking on the boundary
layer in table of contents and select Save As. In the subsequent window select
Format as ESRI Shapefile and in Save as field browse to Data_Lab6 folder
give the output file name as boundary.shp. Then click ok (refer the figure below).

. 131
Task 4: Clipping and re-sampling
1. Open a new project and load DEM (dem), Land Use map and Marol watershed
boundary (as shown below).

Preparing Land use and slope map for Marol watershed:


2. Generate a slope map from DEM. Click on Raster tab in main menu bar, go to
Terrain Analysis and select Slope. In the resulting Slope dialog window, choose
dem as the Input file. Name the Output file as slope.tif. Choose output format as
GeoTIFF. Leave all other options as it is. Make sure to check Add result to project
and then click OK.
3. Clip slope map using watershed boundary (as shown in the figure given below). In
main menu bar, click Raster tab, select Extraction and click Clipper.

. 132
4. In the subsequent window (see the second figure on previous page), in the Input file
field, select slope from the drop-down list. In Output file field click Select and
brows to Data_Lab6 folder and save output as slope_clip. Enable the option Mask
layer and choose boundary from dropdown list. Select the check box crop the
extent of the target dataset to the extent of the cutline. Select the check box Load
into canvas when finished and then click OK.Check the properties of land use map,
the pixel size is 62m. To perform the overlay analysis pixel size should be same.
While clipping, resample the land use map to 90m.
5. Click on Raster tab in main menu bar, go to Extraction and select Clipper. In the
subsequent window (see the below figure), in Input file field select
karnataka_landuse from drop down list. In Output file field click Select and
browse to Data_Lab6 folder and save output as lulc_clip. Enable the option Mask
layer and choose boundary from dropdown list. Select the check box crop the
extent of the target dataset to the extent of the cutline. Select the option Set output
file resolution and enter X Resolution and Y Resolution as 90m. Select the check
box Load into canvas when finished and then click OK.

. 133
Task 5: Generate the soil erosion hazard map
The following methodology shall be adopted to generate the soil erosion map. The
table below shows the hypothetical criteria to construct a map of soil erosion potential zones.
Erosion Potential
Slope Land Use Type Erosion Potential
Index
0 2.5 Any Low 1
> 2.5 Forest Moderate 2
> 2.5 Agriculture High 3
> 2.5 Fallow land Very High 4

To implement this model use the following procedure. The first step is to create a new
variable (using algebraic operations) that has a different value for each combination of
vegetation type and slope.

Then the next step is to reclassify this variable into classes representing the different
levels of erosion potential. Initially, reclassify the slope map with two classes as 1 and 2
where 1 represents the slope between 0 and 2.5, and 2 represents the slope > 2.5. The
landuse map of the study region has mainly 5 classes with assigned values for each class as
follows: Forest = 1, Agriculture = 2, Fallow = 3, Water = 4, Built up = 5. For ease
of analysis in the present exercise, Water and Built up classes are not considered.
To create a raster layer with all possible combinations of slope class and vegetation
class, multiply the vegetation classes by 10 (as shown in Table below). Now once the new
values to slope and vegetation classes are assigned, both the files are added using raster
calculator to generate unique values for each combination (as shown in Table above). This
will generate unique values for each combination, for example slope class 1 and vegetation
class 2 is not confused with slope class 2 and vegetation class 1 (because (1+2)=(2+1) but
(1+2*10)(2+1*10). Then, reclassify this summed map into classes representing the different
levels of erosion potential as shown below.
Slope Vegetation Erosion Potential
Sum Erosion Potential
Classes classes Index
1 10, 20, 30 11, 21, 31 1 Low
2 10 12 2 Moderate
2 20 22 3 High
2 30 32 4 Very High

Here, Sum as 12 represents slope falling in class 2 and vegetation falling in class 1.

. 134
The steps to perform these operations in QGIS are given below.

1. To open raster calculator, in main menu bar click Raster and select Raster
calculator (see the figure given below).

2. In Raster calculator, name the output layer as slope_1 (for slope >= 2.5 degrees) (see
the figure given below). Specify the format as GeoTIFF. To create the Raster
calculator expression, double click on slope_clip@1 from the Raster bands options
(it contains the list of all the raster layers available in table of content) click the >=
button, and type 2.5 (refer the figure given below).

. 135
The output file slope_1will be a raster file containing 0 and 1 values (1 for pixels
having slope >=2.5 and 0 for pixels having slope <2.5). But slope map needs to be classified
into two classes (as 1 for slope <= 2.5 and 2 for slope > 2.5). Add 1 in slope_1 raster
layer to obtain reclassified slope layer.

3. In Raster calculator, name the output layer slope_cl. Specify the format as
GeoTIFF. Create the Raster calculator expression as slope_1@1+1
4. Now multiply land use map by 10 and create land use class layer having new
assigned values. In raster calculator, name the output layer as lulc_cl. Specify the
format as GeoTIFF. Create the Raster calculator expression as lulc_cl@1*10
5. Now to create a raster layer with the combination of slope and land use type. Add the
slope_cl and lulc_cl layer which has new assigned values. In Raster calculator, name
the output layer as sum. Specify the format as GeoTIFF. Create the Raster
calculator expression as slope_c1@1+lulc_cl@1
6. Now reclassify the sum layer into 4 classes (as given in table below). Create the
raster layer class_1 by the expression (sum @1 = 11) OR (sum@1 = 21) OR
(sum@1 = 31).

Slope Vegetation Erosion Raster calculator Class name


Sum
Classes classes Potential Index expression
11, (sum @1 = 11) OR class_1
1 10, 20, 30 21, 1 (sum@1 = 21) OR
31 (sum@1 = 31)
2 10 12 2 ( sum @1 = 12) class_2
2 20 22 3 ( sum @1 = 22) class_3
2 30 32 4 ( sum @1 = 32) class_4

7. Repeat this procedure for the remaining classes in the table. Pixels of these layers will
have value 0 or 1.
8. Finally, create the erosion potential layer as eros_poten by adding all the layers by
multiplying each class by its erosion potential index. In Raster calculator, name the
output layer as ero_poten. Specify the format as GeoTIFF. Create the Raster
calculator expression as
1*class_1@1+(2*class_2@1) +(3*class_3@1)+(4*class_4@1) +(5*class_5@1).
The output map will have the erosion potential value varying from 1 to 4 (the output
map will be as shown in the first figure on next page).

. 136
9. Prepare the Soil Erosion Potential map (refer the lab exercise 4) as shown in the
below figure.

LEGEND
Soil Erosion Potential

. 137
Exercise 7
WMS and WFS services

This lab includes the following task:


Task To import WMS and WFS data into QGIS desktop.

Web Mapping Services:


A Web Mapping Service (WMS) is a service hosted on a remote server. Similar to a
website, it can be accessed as long as connection is available to the server. Using QGIS, load
a WMS directly into existing map. A WMS is a live service that will automatically refresh its
view if pan or zoom on the map is done.
(Refer the below figure for steps 1 to 5)
1. To add WMS layers, click on the Add WMS Layer button .
2. To create a new connection to a WMS, in the resulting window, click New button.
Now WMS address is needed to continue. There are several free WMS servers
available on the Internet. One of these is terrestris, which makes use of the
OpenStreetMap dataset.
3. Specify the Name field as terrestris.
4. Specify the URL field as http: //ows.terrestris.de/osm/service.
5. Click OK.

. 138
6. Notice the new WMS server is listed (as terrestris), to connect this server click
Connect. In the list below, the new entries are loaded, these are all the layers hosted
by this WMS server.
7. Click OSM-WMS layer. This will display its Coordinate Reference System.
8. To change the CRS, click Change button.

9. In the resultant window Coordinate Reference System Selector, set the projected
coordinate system. In Filter field, enter WGS84/Psuedo, select WGS84/Psuedo
and then click OK.

. 139
10. In Add Layer window Click Add and the new layer (as shown in the below figure)
will appear in the map canvas as OSM-WMS.

The nature and limitations of WMS:


It can be noticed that this WMS layer actually has many features in it. It has streets,
rivers, nature reserves, and so on. Even though it looks like its made up of vectors, it seems
to be a raster, but its symbology cannot be change.
This is how a WMS works: its a map, similar to a normal map on paper that is
obtained as an image. What usually happens is that the vector layers is rendered as a map
using QGIS. But using a WMS, those vector layers are on the WMS server, which renders it
as a map and sends that map as an image. QGIS can display this image, but cant change its
symbology, because all that is handled on the server.

This has several advantages, the symbology is already worked out, and is nice to look
in any competently designed WMS. On the other hand, the symbology cannot be change if it
is not good, and if things change on the WMS server, then theyll change the map as well.
This is why sometimes it is required to use a Web Feature Service (WFS) instead of WMS, as
WFS gives a separate vector layers and which is not as part of a WMS-style map.

Web Feature Services:


A Web Feature Service (WFS) provides its users with GIS data in formats that can be
loaded directly in QGIS. Unlike a WMS, which provides only a map which cant be edited, a
WFS gives the access to the features themselves.

. 140
1. Start a new map. This is for demo purposes and wont be saved.
2. Ensure that on the fly re-projection is switched off. Bottom right of the QGIS
window shows the present projection system as EPSG: 4326 (see the figure given
below), click on it. In the resultant window uncheck the box of Enable on the fly
CRS transformation.

3. Click Add WFS Layer button, a window that appears click New button. In the
dialog that appears (as shown in the below figure), enter the name as nsidc.org and the
URL as http://nsidc.org/cgi-bin/atlas_south?version=1.1.0.

. 141
4. The new connection will appear in the Server connections. Click Connect. A list of
the available layers will appear (see the below figure). Find the layer with name
south_poles_wfs, type South Poles in Filter field. Click on the layer to select it
and click Add.

5. Similarly add antarctica_country_border type Antarctica border in Filter field.


Click on the layer to select it and click Add. (Map will appear as shown in figure
given below).

. 142
6. This WFS layer is different from WMS layer as WFS layer has the attributes table and
symbology can be changed as per the requirement. Now open the attribute table of
south_poles_wfs layer, right click on the layer and select open attribute table (refer
the below figure).

7. Add labels to the layer to take advantage of the attribute data in this layer. To add
label the points, rigjht click on the layer and select Properties. Select the Label tab
in the subsequent window (shown in figure below). At the top Select Show label for
the layer from the drop down list. In fields Select label, select Name from the
drop down list. Click Apply and then click OK.

. 143
8. The labeled image will be similar to the figure shown below.

Difference between WMS and WFS layers:

A Web Feature Service returns the layer itself, not just a map rendered from it. This
gives the direct access to the data, meaning that its symbology can be changed and run
analysis functions on it. However, this is at the cost of much more data being transmitted.
This will be especially obvious if the layers loaded have complicated shapes, a lot of
attributes, or many features; or even if lots of layers are loaded. Because of this, WFS layers
typically take a very long time to load.

Querying a WFS Layer

Although it is of possible to query a WFS layer after loading it in QGIS map canvas,
but its often more efficient to query it before loading in map canvas. As only the features
required are requested and very less bandwidth is used comparatively. For example, on the
WFS server which is currently use, there is a layer called countries (excluding Antarctica).
Now, to know where is South Africa located relative to the south_poles_wfs layer and the
antarctica_country_border layer.

. 144
There are two ways to do this. First is to load the whole countries layer, and then
build a query as usual once its loaded. However, transmitting the data for all the countries in
the world and then only using the data for South Africa seems a bit wasteful of bandwidth.
Depending on the connection, this dataset can take several minutes to load.

The second alternative is to build the query as a filter before even loading the layer
from the server.

1. Click Add WFS Layer button, in the Add WFS Layer window (see the below
figure), click Connect. The list of available layers appears, select the Countries
layer and then click Build query.

2. In the dialog that appears, build the query "Countryeng" = 'South Africa'. In the
middle window, extend Fields and values (as shown in the above figure), double
click on Countryeng and in the query edit window, type = 'South Africa'. Then
click OK.

. 145
3. The query will appear in the Filter field (next to countries layer) (as shown in the
below figure) and now click Add.

4. Only the country with the Countryeng value of South Africa will be loaded from that
layer (see the figure on next page).

. 146
It is rare to find a WFS hosting features for a very specific need. The reason why Web
Feature Services are relatively rare is because of the large amounts of data that must be
transmitted to describe a whole feature. It is therefore not very cost-effective to host a WFS
rather than a WMS, which sends only images.
The most common type of WFS encountered will be on a local network or even on
individuals computer, rather than on the Internet. WFS layers are preferable over WMS
layers if direct access to the attributes and geometries of the layers is required. However,
considering the amount of data that needs to be downloaded (which leads to speed problems
and also a lack of easily available public WFS servers) its not always possible to use a WFS
instead of a WMS.

. 147
CHAPTER 3

Web Resources

. 148
Web Resources

Here is a list of web resources for obtaining various data sets covering the entire globe as
well as only India, for carrying out GIS analysis for a variety of applications.
For information regarding sources for GIS Data:
http://freegisdata.rtwilson.com/
This page contains a categorized list of links to over 300 sites providing freely
available geographic datasets.
For information regarding sources for GIS Data for India:
http://data.geocomm.com/catalog/IN/
http://www.gisinindia.com/directory/gis-data-for-india
For list of various Open Source GIS software packages:
http://opensourcegis.org/
This page lists 100+ Open Source GIS software packages.
http://freegis.org/database/?cat=0&_ZopeId=83516767A6rWAcAFg4g
This page categorizes various Open Source GIS software packages based on
Operating System, Programming language, Applications (viz. Desktop GIS, Web
GIS, Mobile GIS) etc.
For shapefiles:
http://www.diva-gis.org/gdata
Download country level data for any country in the world: administrative boundaries,
roads, railroads, altitude, land cover, population density.
For information regarding Satellites and Sensors:
http://www.itc.nl/research/products/sensordb/AllSatellites.aspx
For downloading satellite imagery:
LANDSAT- http://earthexplorer.usgs.gov/
This website also provides other datasets such as AVHRR, ASTER Global DEM etc.
MODIS- http://modis.gsfc.nasa.gov/
BHUVAN (Only India)- http://bhuvan.nrsc.gov.in/data/download/index.php
MOSDAC (Only India)- http://www.mosdac.gov.in/home.do
http://landcover.usgs.gov/landcoverdata.php
This website lists sources for continent-wise Land Cover datasets.

. 149
Statistical information about various services in India:
http://www.data.gov.in/
This portal provides datasets, documents, services, tools and applications collected by
the various agencies and Ministries under Government of India for public use.
Information about Water Resource Systems in India:
http://www.india-wris.nrsc.gov.in/
This WebGIS portal contains centralized database of countrys water sources,
organized in standard GIS format.
Meteorological and oceanographic data for India:
http://www.mosdac.gov.in/home.do
This website archives meteorological and oceanographic data products from ISRO
scientific missions.

. 150
Acknowledgement

151
Acknowledgement

Chapter 1:
The coordinator is thankful to the National Academy of Agricultural Research
Management (NAARM), Hyderabad, India for giving open permission to reproduce the
materials from their virtual learning tutorials on GIS.
References
1. Aronoff, S. (1991) Geographic Information Systems: A management Perspective,
WDL Publications, Canada.
2. ESRI (1990) Understanding GIS.
3. FAO : http://www.fao.org/sd/eidirect/gis/EIgis000.htm
4. Heywood I, Cornelius S. and Carver, S. (1998) An Introduction to Geographical
Information Systems, Longman publishers, pp. 279-283.
5. Longley, P.A., Goodchild, M. F., Maguire, D. J. and Rhind, D. W. (eds.) (1999)
Geographic Information Systems, Volumes 1 & 2, Wiley publishers.
6. http://www.colorado.edu/geography/gcraft/notes

Chapter 2:
References
1. Ned Levine (2010). CrimeStat: A Spatial Statistics Program for the Analysis of Crime
Incident Locations (v 3.3). Ned Levine & Associates, Houston, TX, and the National
Institute of Justice, Washington, DC. [online] Available at:
https://www.icpsr.umich.edu/CrimeStat/download.html [Accessed 14 May 2016].
2. Zitova, B. and Flusser, J. (2003). Image Registration Methods: A Survey, Image
and Vision Computing, Vol. 21, No. 11, pp. 977-1000.

Below are the websites from where various laboratory exercises have been sourced
and suitably modified. The users are encouraged to refer these websites to learn more on
QGIS.
QGIS tutorial and tips by Ujaval Gandhi.
(http://www.qgistutorials.com/en/ )
Tutorials on Understanding on GIS developed by BVIEER.
(http://dst-iget.in/)

. 152
Introduction to Geospatial Technology Using QGIS, Free online course by FOSS4G
Academy @ Del Mar College.
(http://foss4geo.org/).
QGIS training manual.
(http://docs.qgis.org/2.2/en/docs/training_manual/index.html )
QGIS Tutorial Labs by Richard E. Plant.
(http://www.plantsciences.ucdavis.edu/plant/qgislabs.htm )

. 153