Sei sulla pagina 1di 22

Practical 1 

Aim :- ​Digitizing the features of our locality using OpenLayers Plugin 


 
Steps  
 
A] Install OpenLayers Plugin 
1. Open QGIS Desktop. 
2. Go  to  Plugins  Menu  →  Manage  and  Install  Plugins.  Type  OpenLayers  in  the 
search box.  
3. Select the Openlayers Plugin from the list displayed below.  
4. Click Install button from the pane on right side. 
5. Make  sure  that  the  OpenLayers  Plugin  is  checked.  Now  close  the  dialogue 
box. 
 
B] Load the Google Hybrid Layer 
1. Go to web menu → OpenLayers → Google Maps → Google Hybrid Layer 
2. Zoom to your locality. 
 
C] Digitize features on this Google Hybrid Layer 
1. Click  Layer  menu→  New  Layer→  New  Shapefile layer. The vector layer dialog 
box opens. 
2. Specify  the  type  of  (point  ,  line  or  polygon)  depending  on  the  feature  to  be 
digitized.  Specify  the  attributes  for  the  layer.  Add  the  attributes  to  the 
attribute list. If required , user can also remove the attributes. Click OK. 
3. The layer appears in the Layers panel 
4. Click “Toggle Editing” (pencil icon) on digitizing toolbar to edit the layer. 
5. Click  “Add  new  Feature”  on  digitizing  toolbar.  Click  to  digitize  the  feature. 
Right-click  (if  line  or  polygon  layer)  to  end  the  digitizing.  Enter  the 
attribute value in the attribute table. 
6. User  can  cut  ,  copy  ,  paste  ,  delete,  move  features  and  also  use  node  tool  to 
adjust the nodes of features all from digitizing toolbar. 
7. Click “Save” and “Toggle Editing” to make editing state as OFF. 
8. Right-click the layer → Open Attribute Table to open the attribute table. 
9. Right-click the Layer → Properties to change the style, labels, color, symbols 
etc. of a layer. 
10.   User  can  open  an  existing  vector  or  raster  layer  by  clicking  “Add  vector 
layer” or “Add raster layer” respectively from Layers Menu. 
11. Save the entire project to save your layer styles.  
 
 
Output :- 
1. Snapshot of created layers. Your snapshot will be of your locality. Example 
snapshot is shown below. 
 

 
 
 
 
2. Attribute table of any shapefile 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
P​ractical 2 

Aim :- ​Classification of Features ( Categorized , Graduated , Rule Based ) 


 
Steps :- 
 
A] For Categorized classification (Nominal Data) 
1. Load the Maharashtra districts shapefile.   
2. Right-click the shapefile → Properties → Style. 
3. Select “Categorized” , column name as “Name_2”. 
4. In color ramp select Random as color ramp. 
5. Click classify in the properties dialog box. Click OK. 
 
B] For Graduated classification  
1. Load the Maharashtra districts shapefile.   
2. Right-click the shapefile → Properties → Style. 
3. Select “Graduated”, column as ‘Area’. Choose a color ramp. 
4. Change the classes to 4. Click Classify. Click OK. 
 
C] For Rule based classification 
1. Load the Maharashtra districts shapefile. 
2. Right-click the shapefile → Properties → Style. 
3. Select “Rule Based”. 
4. Create a new rule. Give Label and develop an expression as filter. 
5. Create minimum two rules. 
6. Click OK. 
 
 
 
Output 
1. Snapshot of categorized classification. 
2. Snapshot of graduated classification. 
3. Snapshot of Rule based classification. 
   
Practical 3 

Aim :- Georeferencing 

Steps 

A] Activate the Georeferencer plugin 

1. Open QGIS Desktop. 


2. Go  to  Plugins  Menu  →  Manage  and  Install  Plugins.  Type  Georeferencer  in 
the search box.  
3. Select the Georeferencer Plugin from the list displayed below.  
4. Make  sure  that  the  Georeferencer  Plugin  is  checked.  Now close the dialogue 
box. 
 

B] Georeferencing the image by manual input of latitude and longitude. 

1. Go to Raster menu → Georeferencer.  


2. Click “Open Raster” to open the raster image of Maharashtra map. 
3. Click  “Add  Point”  to  add  the  control  points  with  known  latitude  and 
longitude.  Add  minimum  four  points.  These  control  points  can  be  saved 
as .GCP file for loading in future. 
4. Click  transformation  settings  to  set  the  parameters  and provide location 
and file name to save the output file. 
5. Click “Start Georeferencing” to georeference the raster. 
6. Open the georeferenced raster in the QGIS. 
7. The districts can be now digitized with proper spatial reference. 

C] Georeferencing the image by mapping from the canvas (shapefile) 

1. Go to Layers menu → Add Layer → Add vector layer. Load the Maharashtra 
districts shapefile. 
2. Click “Open Raster” to open the raster image of Maharashtra map. 
3. Click “Add Point” to add the control points. While adding control points 
do not enter the coordinates manually , but click on “From map canvas” 
to select the points from the shape file. 
4. Add minimum four points. These control points can be saved as .GCP file 
for loading in future. 
5. Click transformation settings to set the parameters and provide location 
and file name to save the output file. 
6. Click “Start Georeferencing” to georeference the raster. 
7. Open the georeferenced raster in the QGIS. 
8. Put the maharashtra districts shapefile on top of the image and set the 
layer transparency to view the image below. 

Output 

1. Snapshot of Georeferencing window when all the control points are 


selected. 
2. Snapshot of Shapefile on top of image. 

   
Practical 4 

Aim :- Raster Mosaicing , Raster Clipping , Usage of Raster Calculator  


 
Steps 
 
A] Raster Mosaicing  
1. Go to Layer → Add Layer → Raster Layer 
2. Select the .tif raster images for India from the Raster Merge Practical folder. 
3. Click Open and Add those images in Layers Panel 
4. Go to Raster menu → Miscellaneous → Merge 
5. In  Merge  browse  and  select  all  those  four  layers  ,  select  a  file  name  and 
location to save merged image. 
6. Click OK to run the merge operation. 
7. You  can  now  deselect  individual  layers  from  layer  pane  and  only  keep  the 
merged layers. 
8. Go  to  Layer  menu  →  Add  Layer→  Add  Vector  layer.  Select  Indian  Admin 
boundary and style the boundary line with thickness. 
 
 
Output  

 
 
 
B] Raster clipping 
1) Add Raster image from the Raster clipping folder. 
2) Add the ward shape file from Raster Clipping folder. 
3) Go to Raster menu→ Extraction → Clipping 
4) Select the raster image as input. 
5) Select No data Value as zero 
6) Provide filename and location for saving the output. 
7) Select option Mask Layer and select the ward shapefile. 
8) Check “Load into QGIS GIS when done” checkbox 
Output  
1. Snapshot of clipped raster image. 
 
 
C] Raster styling and Raster calculator 
1) Select both the raster images from the Raster Calculator practical folder. 
2) Right click the images → Properties → Symbology→ Render type as 
SingleBand Pseudocolor. Click Classify and then OK. 
3) Go to Raster menu → Raster Calculator. Subtract 2000 year raster from 1990 
raster.  
4) Provide filename and location for saving output . Press OK 
 
Output 
1. Snapshot of output layer as the difference of two images.  
   
Practical 5 

Aim : - Attribute Table manipulation and Attribute table query 


 
Steps  
 
A] Attribute table manipulation 
1. Load the Maharashtra districts shapefile. 
2. Right-click the layer → “Open Attribute table” 
3. Click the “Toggle Editing” to edit the table. 
4. User can add a new column, delete a column from table. 
5. Features can be selected using expression, deselected and filtered. 
6. Use the Field Calculator to populate a selected field with values calculated 
from an expression. 
7. The table view can be changed to Form view or tabular view by clicking the 
buttons in the bottom-right corner of the attribute table. 
8. Click “Save Edits” to save the changes . 
 
 
Output  
1. Snapshot of field calculator showing the expression used for the calculated 
column. < ​ Our case was of formula for Area2 of districts where Area was 
displayed as multiplied by 100> 
2. Snapshot of calculated column. ​<Our case was of Area2 of districts> 
 
B] Attribute query 
1. Click “Select features using an expression” button 
2. Develop expressions using various functions. Expand the Fields and values 
tab. It shows the column names present in the table. Click any one , click any 
one. Click Load all unique values in Field values section to see the distinct 
values present in that column. 
3. Double click the functions to record them as expressions. 
4. Click “Select” to select the features meeting the criteria of expression. You 
can also select ‘Add to Selection’, ‘Remove from Selection’ and ‘Select 
within Selection’ as per the requirement. 
 
Output :- 
Fire the queries for following and provide the snapshot of selections. 
a) Select Districts that have Area greater than or equal to 30. 
b) Select Districts which have ID between 35 to 40 or between 50 to 55.  
c) Select Districts which alphabets a, n anywhere in between their names. 
Practical 6 

Aim :-  

A ) Making A Map 

Steps : 

1. Load the shapefiles in QGIS 


2. Go to Project Menu -> New Print Composer . Give name to Print 
Composer 
3. Use the option ‘Add new map’ to insert the map. 
4. Click ‘Add image’ to add the image 
5. Click ‘Add new Label’ to insert title 
6. Click ‘Add new Legend’ to add legend of map. 
7. Click ‘ Add new Scale bar’ to insert the scale bar 
8. Click ‘Add attribute table’ to add the attribute table. 
9. You can click individual items and change their item properties 
10. Click composition tab to change paper settings 

Output 

Snapshot of your created map layout. 

   
B ) Importing .csv file 

Steps : 

1. Go to Layer → Add Layer → Add Delimited Text Layer 


2. Select the worldcities.csv from Practical Folder 
3. Set the other settings in dialogue box 
4. Click Add to add it as a layer 

Output  

Snapshot of shapefile add in QGIS  

C) Installing Plugins 

Steps : 

1) Plugins are either to be enabled or installed in QGIS 


2) Click on Plugins→ Manage and Install Plugins 
3) To  enable  a  plugin  ,  check  on  the  checkbox  next  to  Plugin.  This  will 
enable the plugin to use it. 
4) To  install  a  plugin  ,  type  plugin  name  in  search  box.  Once  the  plugin 
name appears , click it, then click Install Plugin. 

Output: 

Snapshot of any one plugin visible in menu that you have installed 

   
Practical 7 

Aim :-  

A) Geoprocessing Tools 

Steps 

Install mmqgis plugin and also enable processing plugin from plugins menu. 

1. Load the populated places and river centerlines layer. 


2. Click MMQGIS menu → Create → Buffers.  
3. Select  the  source  layer  as  river  centerlines.  Enter  2  in  Fixed  radius.  In 
radius  unit  select  Kilometres.  Click  browse  to  provide  location  and  file 
name for saving the output file. 
4. Click OK. 
5. The Buffers are created. 
6. Go  to  vector  menu→  Geoprocessing  tools  →  and  choose  operations  of 
Intersect  /  Union  /  Symmetrical  Difference  /  Difference  / Dissolve to fire 
the queries. 
7. The  output  layer  can  be  saved  by  right  clicking  the  layer  name  and 
clicking Save As.. 

Output 

1. Snapshot of Buffer created for 2km for river centerlines layer 


2. Snapshot  of  Intersect  operation  between  the  above  buffer and populated 
places layer. 
3. Snapshot  of  Snapshot  of  Symmetrical  Difference  operation  between  the 
above buffer and populated places layer. 
4. Attribute  table  of  Intersect  operation  output  layer  which  shows 
attributes  from  both  tables.  So  take  snapshot  on  that  position  by 
scrolling  horizontally  in  attribute  table  where  you  can  view  the  last 
buffer attributes and first attributes of populated places layer. 

 
B) Spatial Query 

Enable Spatial Query plugin from plugins menu 

Steps : 

1. Load the populated places and river centerlines layer. 


2. Buffer the river centerlines layer with radius as 2km. 
3. Go to Vector menu -> Spatial Query. 
4. Select  populated  places  layer  as  Source  features  ,  “within”  as  spatial 
relationship and river Buffer layer as reference features. Click Apply 
5. Once  the  query  is  complete  ,  a  separate  pane  is  displayed  named 
Selected  Features.  Click  icon  for  ‘Create  layer  with  selected’.  A  new 
layer will be added to the Layers Panel. Click Close. 
6. The  other  spatial  relationships  can  be  tried  out  by  loading  various 
point, polygon, and line shapefiles. 

Output : 

Snapshot of following queries with some area zoomed in for feature selected 
as output 

1. Populated places within buffer 


2. Buffers containing populated places 
3. Rivercenterlines crossing Buffer of populated places for 5km 

   
Practical 8 

Aim :-  

A) Basic Statistics 

Steps  

1. Go to Layer → Add Layer → Add Vector Layer 


2. Add the Shapefiles of India Polygon and railway lines 
3. Rt.click the layer and change the colors symbology of the layers 
4. In Layer Pane, Right click on IND_rails → Open Attribute Table 
5. Press Toggle Editing button using button, on Attribute table window 
toolbar. 
6. Press Open Field Calculator using button. 
7. Check Create new field - > Set the output field as “Track_Len”, field 
type to “Decimal Number”. 
8. From Function List search $length or go to Geometry → Select $length 
9. Set expression as $length / 1000 
10. Press “OK” 
11. A new column is added to the attribute table with value representing the 
length of track in KM. 
12. Press CTRL+S or click on Save Edits option on tool bar 
13. Close the attribute table window. 
14. For calculating the total length of Railway tracks in India , Select Vector→ 
Analysis Tools→ Basic Statistics for Numeric Fields 
15. Select IND_rails layer from input layer. And select Track_Len in “Field 
to Calculate statistics on” 
16. Provide the filename and location to save the output file. 
17. Click Run 

Output : 

1. Snapshot of the Basic Statistics file contents 

   
Practical 9 

Aim : Terrain Data and Hillshade Analysis 

Steps : 

1. Open the raster file named ​gmted_mea300.tif 


2. Paste 86.9253,27.9881 as coordinates of Mt. Everest, at the bottom 
of QGIS window where it says Coordinate and press Enter. The 
viewport will be centered at this coordinate. To zoom in, Enter 
1:1000000 in the Scale field and press Enter. You will see the 
viewport zoom to the area around the Himalayas. 
3. Select the Clipper tool from Raster ‣ Extraction ‣ Clipper. 
4. Keep the Clipper window open and switch to the main QGIS 
window. Hold your left mouse button and draw a rectangle 
covering the full canvas. 
5. Click OK 
6. For Contours go to Raster -> Extraction → Contour 
7. Select input file as the above clipped image. Put interval as 200 & 
attribute name as ELEV 
8. Click OK. The attribute table of output file will have ELEV field. 
9. For Hillshade go to Raster→ Analysis → DEM (Terrain Models) 
10. Choose our clipped image of Himalayas and Mode as Hillshade. 
Click OK. 
11. You can set the properties of Hillshade output for colors. 

Output : 

a) Snapshot of contour lines 


b) Snapshot of Hillshade 

 
 
Practical 10 

A] Aim : Table Joins 

Steps: 

1. Go  to  Layer  ‣  Add  Vector  Layer.  Browse  to  the  downloaded  zip  file 
tl_2013_06_tract.zip  and  select  it.  Select  the 
tl_2013_06_tract.shp​ layer and click OK. 
2. Open the CSV file ​ca_tracts_pop.csv​ in a text editor. 
3. Note  that  field  called  ​GEO.id2  in  the  CSV  matches  with  GEOID 
from  attribute  table  of  shapefile.  You  will  also  note  that  the  ​D001 
column has population value for each of the census tract. 
4. To  import  the  CSV  file  to  QGIS.  Go  to  Layer  ‣  Add  Delimited  Text 
Layer. 
5. Select  CSV  file.  Select  File  format  as  CSV  (comma  separated 
values).  Select  the  No  geometry  (attribute  only  table)  option. Click 
OK. 
6. Select  the  ​tl_2013_06_tract  layer.  Right-click  on  it  and  select 
Properties. 
7. In  the  Layer  Properties  dialog,  select  the  Joins  tab.  Click  on  the  + 
button at the bottom to create a new table join. 
8. In  the  Add  vector  join  dialog,  select  ​ca_tracts_pop  as  the  Join 
layer.  Next  we  have  to  select  the  field  with  unique  ids  in  both  the 
shapefile  and  the  CSV.  Select  GEO.id2  and  GEOID  as  the  Join  field 
and Target field respectively. Click OK. 
9. ca_tracts_pop_D001  field  added  to  each  feature  in  the  attribute 
table  of  tract  shp  file. Style the layer using graduated classification 
with population criteria.  

Output : 

a) Snapshot of attribute table containing c


​ a_tracts_pop_D001 field. 

 
 
 
   
B] Aim : Spatial Joins 

Steps : 

1. Go to Layer ‣ Add Vector Layer. Browse to the downloaded zip file 


nybb_12c.zip​ and select Open.Select the layer n ​ ybb.shp​ and click 
OK. 
2. Repeat the steps 3 and 4 for the another file 
OEM_NursingHomes_001.zip​ and load the 
OEM_NursingHomes_001.shp​ layer.  
3. Go to Vector ‣ Data Mangement Tools ‣ Join attributes by location. 
4. The Target vector layer will be the boroughs boundary ​nybb​ layer. 
The Join vector layer will be the nursing homes 
OEM_NursingHomes_001​ layer. As we want to sum the capacity 
of nursing homes, select Take summary of intersecting features 
and choose Sum. Name the output file as n ​ yc_borough_join.shp​. 
In the Output table select Keep all records`. Click OK. 
5. Right-click on the new layer ​nyc_borough_join ​ and select Open 
Attribute Table. 
6. You will see a column S ​ UMCapacit​ in the attribute table. This is the 
sum of the ​Capacity​ attribute for the nursing homes that fall 
within each borough feature. 

Output: 

a) Snapshot of attribute table containing column SUMCapacit 

   
C] Aim : - Points in Polygon 

Steps : 

1. Open  Layer  ‣  Add  Delimited  Text  Layer  and  browse  to  the  downloaded 
signif.txt​ file. c
​ hoose Tab as the File format. Click OK 
2. Go  to  Layer  ‣  Add  Vector  Layer.  Select  the 
ne_10m_admin_0_countries.shp  
3. Click on Vector ‣ Analysis Tools ‣ Point in Polygon 
4.   Select  the  polygon  layer  and  point  layer  respectively.  Name  the  output 
layer as e ​ arthquake_per_coutry.shp​ and Click OK. 
5. In  the  attribute  table,  you  will  notice  a  new  field named ​PNTCNT​. This is 
the  count  of number of points from the earthquakes layer that fall within 
each polygon. 
6. In  the  attribute  table  os  new  output  layer,  you  will  notice  a  new  field 
named  ​PNTCNT​.  This  is  the  count  of  number  of  points  from  the 
earthquakes layer that fall within each polygon. 

Output:-  

a) Snapshot of attribute table containing new field ​PNTCNT​. 


   
Practical 11 

A] Aim :- Nearest Neighbour Analysis 

Steps:-  

1. Open Layer ‣ Add Layer ‣ Add Delimited Text Layer and browse to the 
downloaded ​signif.txt​ file. c
​ hoose Tab as the File format. Click OK. 
2. Go to Layer ‣ Add Layer ‣ Add Vector Layer. open the Populated Places 
layer. 
3. Go to Vector ‣ Analysis Tools ‣ Distance Matrix. 
4. Select signif​ as the Input point layer and the populated places 
ne_10m_populated_places_simple​as the target layer.  
5. Select a unique field as I_D. Use only the nearest(k) target points, and 
enter 1. Click OK. 
6. Go to Layer ‣ Add Layer ‣ Add Delimited Text Layer.... Load the the output 
csv file of above operation with No geometry option. 
7. Create a table Join between output csv and signif csv 
8. Select few points from earthquakes. Go to MMQGIS ‣ Create ‣ Hub Lines. 
Input the parameters and Click OK. 

Output : 

a) Snapshot of Hublines 

B] Aim : Sampling Raster Data 

Steps : 

1. Go to Layer ‣ Add Raster Layer and browse to the downloaded 


us.tmax_nohads_ll_{YYYYMMDD}_float.tif​ file and click Open. 
2. Go to Layer ‣ Add Delimited Text Layer. Open 
2013_Gaz_ua_national.txt​. Choose Tab under Custom delimiters. The 
point coordinates are in Latitude and Longitude, so select INTPTLONG as 
X field and INTPTLAT as Y field. Check the Use spatial index box and click 
OK. 
3. Install the ​Point Sampling Tool​ plugin.  
4. Go to Plugins ‣ Analyses ‣ Point sampling tool. select 
2013_Gaz_ua_national​ as the Layer containing sampling points. Choose 
GEOID​ and ​NAME​ fields from the​2013_Gaz_ua_national​ layer. choose 
the u
​ s.tmax_nohads_ll_{YYYYMMDD}_float: Band 1​. Name the output 
vector layer as m
​ ax_temparature_at_urban_locations.shp​. Click the OK 
to start the sampling process.  
5. Go to Layer ‣ Add Vector Layer. Select the​tl_2013_us_county.shp​ as the 
layer and click OK. 
6. Enable the ​Zonal Statistics Plugins 
7. Go to Raster ‣ Zonal statistics ‣ Zonal statistics. 
8. Select us.tmax_nohads_ll_{YYYYMMDD}_float as the Raster layer and 
tl_2013_us_county.shp as the Polygon layer containing the zones. Enter 
ZS_ as the Output column prefix. Click OK. 
9. Color the output with graduated classification on ZS_mean column 

Output : 

a) Snapshot of Temperature data 

C] Interpolating Point Data 

Steps : 

1. Open QGIS. Go to Layer ‣ Add Layer ‣ Add Vector Layer. Select 


Arlington_Soundings_2007_stpl83.shp 
andBoundary2004_550_stpl83.shp layers. Click OK. 
2. Enable Interpolation plugin​ enabled. Go to Raster ‣ Interpolation ‣ 
Interpolation. 
3. select ​Arlington_Soundings_2007_stpl83​ as the Vector layers in the 
Input panel. Select ​ELEVATION​ as the Interpolation attribute. Click Add. 
Change the Cellsize X and Cellsize Y values to 5
​ .N
​ ame the output file as 
elevation_tin.tif​. CLick OK. 
4. Zoom to layer for interpolation raster. 

Output : 

a) Snapshot of Interpolation Raster in shades of black and white. 


 

Potrebbero piacerti anche