Gis
Gis
Lab Assignment of
Geographical Information System (CSC 468)
Submitted By:
Anil Kumar Shrestha
B.Sc. CSIT 076 Batch, 8th Semester
Symbol No: 23223
Submitted To:
Bishow Karn
Lecturer, Geographical Information System
Department of Computer Science and Information Technology
Contents
Prerequisites to GIS Practical .................................................................................................... 1
What is a Geographic Information System (GIS)? ................................................................ 1
Understanding QGIS ................................................................................................................. 3
What is Quantum GIS? .......................................................................................................... 3
Installation of QGIS ................................................................................................................... 4
Step By step procedure .......................................................................................................... 4
Understanding QGIS Desktop Environment. ............................................................................ 8
Quantum GIS toolbars and some other components .............................................................. 9
PRACTICAL – 1 ..................................................................................................................... 11
a) Creating Polygon vector layer ...................................................................................... 12
b) Creating Line vector layer ............................................................................................... 16
c) Calculating line lengths and statistics .............................................................................. 23
Prerequisites to GIS Practical
What is a Geographic Information System (GIS)?
A Geographical Information System (GIS) is an organized collection of computer
hardware, software and data used to link, analyze and display geographically
referenced information.
The foundation of GIS is the ability to locate objects and events (streams, villages,
disease cases) and link them with appropriate information in order to identify patterns
and provide a basis for map making and analysis. Key types of geographical data,
represented as separate map layers in a GIS, are outlined in the table below.
Sr. Data Type Example Layer on Map
No
1 POINT Building, Hospital, City,
Well.
3 POLYGON Administrative
Boundaries, Census
tacts.
1
Vector data: A representation of the world using points, lines, and polygons.
Vector models are useful for storing data that has discrete boundaries, such as
country borders, land parcels, and streets.
Point features: A map feature that has neither length nor area at a given scale, such
as a city on a world map or a building on a city map.
Line features: A map feature that has length but not area at a given scale, such as a
river on a world map or a street on a city map.
Polygon features: A map feature that bounds an area at a given scale, such as a
country on a world map or a district on a city map.
Raster data: A representation of the world as a surface divided into a regular grid
of cells. Raster models are useful for storing data that varies continuously, as in an
aerial photograph, a satellite image, a surface of chemical concentrations, or an
elevation surface.
With a GIS application you can open digital maps on your computer, create new
spatial information to add to a map, create printed maps customized to your needs
and perform spatial analysis.
2
Understanding QGIS
What is Quantum GIS?
Quantum GIS (QGIS) is a user friendly Open Source GIS application licensed under the
GNU General Public License. QGIS is an official project of the Open Source Geospatial
Foundation (OSGeo). It runs on Linux, Unix, Mac OSX, Windows and Android and supports
numerous vector, raster, and database formats and functionalities.
Like all GIS applications, QGIS provides a graphical user interface allowing display of map
layers and manipulation of data for analyses and map-making.
Many people mistakenly assume that geospatial applications just produce maps, but
geospatial data analysis is another primary function of geospatial applications. Some typical
types of analysis include computing:
The amount of area (e.g., square meters) within a certain geographic region
These may seem simplistic, but can be applied in all sorts of ways across many disciplines.
The results of analysis may be shown on a map, but are often tabulated into a report to
support management decisions. The recent phenomena of location-based services promises to
introduce all sorts of other features, but many will be based on a combination of maps and
analysis. For example, you have a cell phone that tracks your geographic location. If you
have the right software, your phone can tell you whatkinds of restaurants are within walking
distance. While this is a novel application of geospatialtechnology, it is essentially doing
geospatial data analysis and listing the results for you.
System Requirements
Windows OS:
3
Minimum: Pentium III / 256 MB RAM. Recommended: 1 GB of RAM and 1.6
GHz processor.
Operation System: Platforms Windows and Linux (Win XP or newer, Linux Suse
8.2/9.0/9.2, Linux Debian (Lliurex))
MAC OS:
Installation of QGIS
Step By step procedure
1) Create a folder on your D:/ drive on your computer called QGISlab by right
clicking on the D: drive and navigating down to the New / Folder.
2) Go to the QGIS download page and download the latest 64bit version of QGIS
for windows which is QGIS 3.4 'Madeira’ by clicking once.
3) If you have a 32 bit machine or using another operating system search the bottom
of the page for your operating system and download the correct operating system
version of QGIS. http://www.qgis.org/en/site/forusers/download.html
4) Your browser will download the file to the browsers default download directory.
By pressing the control key and the letter J at the same time a popup window will
show you the folder where the QGIS file has been downloaded. The QGIS file
will be called: QGIS-OSGeo4W3.36.3-1
5) Move or copy the above file to your D:/QGISlab folder and double click on the
file. You will get a popup window with a security warning.
4
6) Hit the run button to start the installation process and follow the prompts. There
is no need to install the data sets suggested by QGIS.
7) From the above window, click Next button and continue with the installation.
8) Please go through the license agreement and click on the button> I agree and
proceed with the installation as shown in the screen.
5
9) As the software is very heavy it is advisable to install it in the different drive
other than the windows drive. As per our example, we will be installing in QGIS
folder on D:\ drive.
10) After browsing the folder click the Next button and proceed with the
installation as shown in above figure.
6
11) Please reboot your machine once the installation is completed. Click finish to
complete the installation.
12) After machine is restarted, type QGIS on Run and open QGIS Desktop 3.4.2
7
Understanding QGIS Desktop Environment.
1
2
5
4
Quantum GIS interfaces change from one project to another depending on the
required interface of the project. Below are the basic menus that you will encounter
in Quantum GIS during the practical.
1. Title of the Project - Shows the title of project that you are going to view.
2. Menu Bar – This provides access to various Quantum GIS features using a
standard hierarchical menu.
3. Toolbars – These provide access to most of the same functions as the menus,
plus additional tools for interacting with the map. It shows the command for
zoom in, zoom out, pan, back to original view, go back to previous extent, go to
next extent, object-information, coordinate read-out, measure, print and help.
4. Table of Contents/Map Legend (TOC) - Shows the layers that can be turned on
or off and the legend, attributes symbols and query symbols available for the
corresponding project.
5. Display Window - Shows the feature/s that you have turn on from the TOC.
6. Status Bar - Shows you your current position in map coordinates (e.g. metres or
decimal degrees) as the mouse pointer is moved across the map view. To the left
of the coordinate display in the status bar is a small button that will toggle
8
between showing coordinate position or the view extents of the map view as you
pan and zoom in and out.
7. Data sources browser – In previous versions, QGIS browser was only provided as
an external application which enables us to explore our spatial data sets. In QGIS
2.0.1-Dufour this application is also integrated in the QGIS framework as an
additional panel just below the Table of Contents.
Key functions:
Here, you will learn how to QGIS‟ different mapping tools and other components
that you‟ll be using in this practical.
9
List of Sample/Data files used for Practical
IND_rails.zip
IND_adm0.zip
10
PRACTICAL – 1
B. AIM: - Creating and Managing Vector Data:
a)Adding vector layer
b)Setting properties
c)Vector Layer Formatting
Procedure:
1. Adding vector layers (Polygon, Line, Points)
• Polygon layers (We have taken 2 layers Matunga, Garden)
• Line layers (We have taken 3 layers Small_Roads, Road, Flyover)
• Point layers (We have taken 4 layers bank,college,Restaurants,ATM
Our aim is to create map representing a location and its surrounding as follows:
11
a) Creating Polygon vector layer
12
• Fill the appropriate information in each text box.
File name :
By default the file will be saved in bin folder.
To avoid it click on following button to change the
location of file.
• Field Panel o Add the Attribute you want to show. (Column Name
for Table) o Specify Type (DataType:Text Data/Decimal Data/Whole
Number/Date) of Attribute o Specify the Length of the Attribute.
Specify Precision (If Data Type is Decimal)
13
• Select Geometry Type as follows o Click on the following button
• The CRS dialog box will appear on screen. Click on the WGS84
option and it will be selected as follows. click on OK
14
Set style for polygon by using property window(Right click on
Matunga Layer)
15
Following screen will appear on the screen. Select pattern as you want
and click on OK.
Same way we can add one more polygon layer for Gardens.
16
Road layer :
17
set style for Roads in the same way as we have done for polygon
18
Road will look as below
To label your roads Right click on Road layer .Go to properties window then
select label and set single label property.
19
Roads will look like these
To label your roads Right click on Road layer .Go to properties window
then select label and set single label property.
To merge roads
o Go to properties of road then select symbology. Click on Advanced button
select Symbol levels.
20
o Check Enable symbol levels option
o Click ok & Road will appear as follows
21
Create Point vector layer
Repeat same steps to add point layers as we have done in previous layers.(For
ATM, Restaurants, Banks, Bus Stops etc)
Final Output
22
c) Calculating line lengths and statistics
Go to Layer > Add Layer >Add Vector Layer
Add the following file to project
23
In Layer Pane, Right click on IND_rails > Open Attribute Table.
24
Press CTRL+S or click on Save Edits option on tool bar
Close the attribute table window.
For calculating the total length of Railway tracks in India.
Select Vector > Analysis Tools >Basic Statics for Fields
25
Select IND_rails layer from input layer. And select Track_Len in field to
“calculate statistics on” and press Run.
26
Open the “output.html” file to get the field statistics.
Analyzed field: FID_rail_d
Count: 2012
Unique values: 1991
NULL (missing) values: 0
Minimum value: 144645.0
Maximum value: 170897.0
Range: 26252.0
Sum: 320970959.0
Mean value: 159528.30964214713
Median value: 158989.5
Standard deviation: 5309.7916503218385
Coefficient of Variation: 0.03328432215092562
Minority (rarest occurring value): 144645.0
Majority (most frequently occurring value): 152876.0
First quartile: 155823.0
Third quartile: 163016.0
Interquartile Range (IQR): 7193.0 The above statistics show that the total
length of Railway track in India is 60,479.32 KM.
27