gispractical
gispractical
Practical 1
Aim: Creating and Managing Vector Data: Adding vector layers, setting
properties, formatting, calculating line lengths and statistics
2. Write your file name and browse through the file you wanted to save your file in. Select
“polygon” in the Geometry type option.
P age |3
3. Using the left click of your mouse, make a polygon layer. This will serve as the base of
you map. Once you’ve done with the desired shape of your base, click the “right click” of
your mouse and name the “id” and “area” to display the names of the layers.
P age |4
2. The only difference while creating line layer and polygon layer is selecting “LineString”
instead of “Polygon”.
P age |5
3. To Change the line type of line Vector, right on your particular line layer in the “Layer”
situated in the Left side of the window. Click on “Properties”. Select “Symbology” to
change the type of Line Layer.
P age |6
5. With following same steps and editing the points. The output is displayed below
P age |7
3. Add ‘IND_rails.shp’ and ‘IND_adm0.shp’ file to the project by clicking on add button.
4. Now, close the Data Source Manager and from Layer Panel double click on IND_adm0
5. Select Symbology and then select any outline style from given options and click on Apply
and Press OK.
P age |9
6. Now, In Layer Panel right click on IND_rails and open attribute table.
8. Set the output field name as “Track_Len” and field type to “Decimal Number”. Set
expression as $length/1000 and click on OK.
9. A new column is added to the attribute table with value representing the length of
track in Kilo Meter. Click on save edits in toolbar and close the window.
P a g e | 11
10. For calculating the total length of Railway tracks in India, we’ll Select Vector→ Analysis Tools→
Basic Statics for Fields.
11. Select IND_rails layer from input layer. And select Track_Len in “Field to Calculate
statistics on” and in statistics select save to file from drop-down list and name the file
Output.html.
P a g e | 12
13. Now, open Output.html file to get the field statistics that show Total length of Railway
track in India as ‘60479.320000000014’.
P a g e | 13
Practical 2
Aim: Exploring and Managing Raster data: Adding raster layers, raster styling
and analysis
1. Open a new Project and go in Layer in the menu bar. Layer -> Add Layer->Add Raster
Layer…
2. Such a dialog box opens from where you have to select the raster image (from path).
P a g e | 14
5. The Coordinate Reference System should be WGS 84 and Authority ID should be EPSG:
4326.
P a g e | 16
6. Go to Symbology section.
8. Click on ‘all Color Ramps’ in the dropdown list of Color ramp. Click on ‘YIOrRd’ option.
14. Locate the path in the ‘Output Layer’ in the Raster Calculator Dialog box. Click on OK.
15. Double Click on ‘Prac_2b output’, click on Symbology and select ‘Singleband
pseudocolor’ in Render type
P a g e | 21
16. Select Discrete in ‘Interpolation’ and follow the previous steps for Color Ramps section.
17. Select the rows and remove all the selected rows by click the minus ‘-’ sign.
P a g e | 22
19. Change the details in ‘Value <=’ and ‘Label’ section in the grid.
P a g e | 23
20. After changing the color, Click on Apply->OK to get the output displayed below.
P a g e | 24
24. Select all the files you want to merge in Input layers and click on OK
25. In Merged section, click on ‘…’, select on ‘Save a file’ and locate the folder you want to
save the output. Click on Run->Close to display the output.
P a g e | 27
29. Double click on the layer, click on Symbology and select ‘outline blue’. Click on Apply and
OK.
32. Locate the path where you wish the file and click on Save.
P a g e | 31
PRACTICAL – 3
AIM: Making a Map, Working with Attributes, Importing Spreadsheets or CSV
files Using Plugins, Searching and Downloading OpenStreetMap Data.
a. Making a Map
4. A new Print Layout will open. Now, Select Add Item → Add Map
5. After adding map go to Item Properties → Map1→ Layers. Check on Lock Layers and
Lock Styles for Layers
P a g e | 34
7. Add Navigation Symbol and adjust Image Rotation in Item Properties → Image Rotation
8. Using Add Item → Add Picture → Select an area to be highlighted on main Map. In Item
Properties of Map 1 → Overviews → using plus icon add an overview
P a g e | 35
10. Change the Label text to “Isha Padhiyar 53003210003”, Set appropriate font size and
colour using Item Properties→ Main Properties.
11. Add Item → Add Legend→ Place the legend indicator at appropriate location.
P a g e | 36
13. Add Item → Add Label →Add Label using HTML rendering
P a g e | 37
14. A Map can be saved in Image or PDF. Click on Layout → Export as Image / Export as PDF.
Save the Map to a location appropriate location.
1. Go to Layer → Add Layer → Add Delimited text Layer. Sample file for Earthquake data will
be used in this practical.
2. Select the file and set X field as Longitude and Y field as Latitude and press ADD.
c. Using Plugin
P a g e | 39
3. Click on Setting→ check on Show also experimental Plugin and Show also deprecated
plugin.
P a g e | 40
3. Go to Web → Open Layer Plugin and select Open Street Map. If an error occurs in loading
maps, go to project properties → CRS →No projection.
5.In OSM Place search Pane → Search any place name then click on -> this symbol, a list of
places will be displayed double click on the desired place in OSM Place search Panel.
PRACTICAL 4
Aim: Working with attributes, terrain data.
a. Working with Attributes
P a g e | 43
4.To find the Place with maximum population click on “pop_max” then click on expression
button.
5.Enter pop_max>100 and pop_max<10000 and click select Feature button to get all the
places with population between 100 and 10000. Places matching the criteria will appear in
different colour.
P a g e | 45
4.Select the raster layer then select Use Map Canvas Extent and select the location and file
name for storing clipped raster layer
5.Press on Run
8.Select the input raster layer name. Set Contour Interval 100 meters and select the output
file and name it.
9.Press on Run
P a g e | 49
10.Double click on HimalayaRegionContour Layer and select Label as ELEV and give
appropriate symbols for line
12.Arrange the table in descending order based on the value of “ELEV” column. Click on first
row and then click on search icon.
14.Select Layer and do the changes in Scale, Altitude and Press Run
15. After Raster styling the Output will appear like this
P a g e | 52
PRACTICAL 5
AIM: Working with Attributes, Terrain Data.
1. Click on Layer => Add Layer=>Add Vector Layer
4. Select ESRI Shapefile format and save the layer to an appropriate location.
9. Project => Project Properties. Add the OSGB 1936 /British National Grid coordinate reference
system.
P a g e | 55
Practical 6
Aim: Georeferencing Topo Sheets and Scanned Maps
1. Start a new project
2. Go to Layers → Add Layer → Add vector Layer
10. Select Transformation type → Thin Plate Spline. Re-sampling Method → Nearest
Neighbour. Target TRS → Everest 1830 datum: EPSG 4044. Select Output Raster
Name and Location. Check the Load in QGIS When Done Option.
11. Click on OK
15. The canvas area will now have the scanned map of Mumbai referenced with control
points
P a g e | 61
16. Click on modifies layer, Go to Properties - Set Transparency level of raster layer to
appropriate level.
4. Search for some place in OSM Search Panel and zoom in to appropriate level.
P a g e | 63
5. Go to Raster → Georeferencer
Output:
3. Choose the Pyramids tab. Hold the Ctrl key and select all the resolutions offered in the
Resolutions panel. Click Build pyramids then click ok.
4. Go to Settings →Options
P a g e | 67
5. Select the Digitizing tab. set the Default snap mode to vertex and press ok.
7. Select the name and location for Spatial database and save it
P a g e | 68
9. Click the Toggle Editing button to put the layer in editing mode
PRACTICAL 7
Aim: Managing Data Tables and Spatial data Sets: Table joins, spatial joins,
points in polygon analysis, performing spatial queries
3. Make a new .csvt file so that we can extract numeric information as well and save it in the
same folder as your .csv data file.
5. Select the .csv file now and Select the options as follows.
b) spatial joins
1. Layer->Add Layer->Add Vector Layer…
P a g e | 75
7. Click on Run button to run the algorithm with the provided inputs.
P a g e | 78
8. Select the ‘i’ kind of icon and draw an area you want to output. Output may look as
follows.
7. Use the select Feature button to check details and the output will look as follows.
P a g e | 82
4. Go to Vector → Research Tool → Select By Location and enter the following details
5. This will highlight only those rivers containing a populated place within 2 KM and the
output will look as follows.
P a g e | 85
Practical 8
Aim: Advanced GIS Operations: Nearest Neighbour Analysis, Sampling Raster
Data using Points or Polygons, Interpolating Point Data
a. Nearest Neighbour Analysis.
1. Layer > Add Layer > Add delimited text later
3. Layer > Add Layer > Add Vector layer and choose ne0_10m_populated_places_simple.zip
5. Choose the input and output parameters as shown, Keep the K value 1.
6. Layer > Add Layer > Add delimited text layer, the output file of the previous Step is added
here, select no geometry and add.
P a g e | 88
7. Go to the properties of .txt layer, Go in Joins and set the following parameters.
8. Open the attribute table of the EarthQuake layer. Scroll to extreme right and you will see
your table in now joined as follows.
P a g e | 89
10. Go to the properties of this saved vector layer, Go to Source > Query Builder
P a g e | 90
14. Plugins > Manage and Install Plugins, Add the MMQGIS plugin
P a g e | 93
9. Select the i tool and select a point on your layer to view its details
P a g e | 99
14. Style this layer to create a temperature map. Right-click the counties layer and select
Properties.
P a g e | 102
2. Raster > interpolation > interpolation, to enable output section set the following
parameters, click Add button then set the remaining attributes.
4. Select the following combinations or as per your choice for styling of your layer.
Practical 9
Aim: Advance GIS Operations 2: Batch Processing using Processing Framework
Automating Complex Workflows using Processing Modeler Automating Map
Creation with Print Composer Atlas
a. Batch Processing using Processing Framework
1. Layer > Add layer > Add vector Layer, Add ne_10m_admin_0_countries.shp, Go to Filter in
this layer.
3. Open ports, airports, and railways shape file. Processing > Toolbox, Search for the clip
algorithm, right click and run and set the following sets of inputs, overlay layers and
outputs. YOU NEED TO RUN IT THRICE FOR airports, ports and railways.
9. Layer > Add Layer > Add Raster layer, Add LC_hd_global_2001.tif.gz file
P a g e | 117
10. From the Processing toolbox select your model and run algorithm on your layer.
11. Let’s try to edit model by providing an input string as per user than keeping it constant
to 12.
P a g e | 118
12. Drag and drop the +String input parameter, Setting a default parameter to this defined
value, Click on the edit option of Extract Attribute, Set Value as class so that user’s input can
be taken dynamically.
15. Add one more Raster layer to check the accuracy of our model, Add
LC_hd_global_2012.tif.gz file, Run the model to compare this file results with the previous
one.
P a g e | 120
6. View > Panels > Check Atlas Option, Go to Atlas tabSet The following parameters.
8. Insert as Expression and at the following expression. concat(‘Country of,’ “Name10”), This
will create Dynamic label with respect to the current Atlas. Create a static label too
11. Again to the properties of the layer > Symbology > Inverted Polygons > Rule based and
apply the expression, Expression = $id=@atlas_featured, Click on Update Preview option to
apply changes.
P a g e | 126
Practical 10
Aim: Validating Map data
1. Open the Kenya_epiodemilogical_data file in Microsoft Office Excel, Open
Kenya_epiodemilogical_dict file in Microsoft Office Excel.
3. Select the child_id column. Home > Highlight Cells Rules > Duplicate Values, Data >
Remove Duplicates.
4. Replace M values with 1 and F values with 2. (select the sex column first)
P a g e | 130
5. View the Scatter Chart for age. Select age column > Insert > Scatter, Graph appears as
follows.
6. Enable filters, age > filters > Number filters > Greater than > 20
P a g e | 131
8. Drag and drop the following values and make the stool value as count instead of sum.
P a g e | 132
9. Add a new Colum as check and input the formula. (Check the rows before entering
formula in your sheet)
10. To apply the formula to entire worksheet select all rows and columns, enter the formula
and press Enter. Save it as .csv.
11. Layer > Add Layer > Add Vector Layer, Choose the Kenya_admin.shp file.
P a g e | 133
12. Layer > Add Layer > Add Delimited Text Layer, Choose Kenya_school_location.csv file
and set rest of the parameters as follows.
13. Try to make these separate layers as one as shown, Make the file as Kenya_schools.shp
and press OK.
P a g e | 134
18. Make the pivot table as shown with the following column as explained earlier, Copy only
the values of these columns to the data sheet. Remove the Total rows at the end. Save it
P a g e | 137
19. Layer > Add Layer > Add Delimited Text Layer, Select Kenya_schools_locations2.csv file
and click Add button.
20. Layer > Add layer > Add Vector Layer, Add file Kenya_epiodemilogical_data1.csv file.
P a g e | 138
21. Go to the properties of this layer, go in joins and press the add (+) button, Set the
following parameters and click OK.
22. Right click on that layer to view output and go to Open attributes table,
The output may look as follows