QGIS/C2/Geometric-Properties-of-Vectors/English
| Visual Cue | Narration |
| Slide Number 1
Title Slide |
Welcome to this tutorial on Geometric Properties of Vectors. |
| Slide Number 2
Learning Objectives |
In this tutorial, we will learn to
|
| Slide Number 3
System Requirement |
To record this tutorial, I am using,
|
| Slide Number 4
Pre-requisites |
To follow this tutorial you should be familiar with QGIS interface.
|
| Slide Number 5
Example map to practise
|
To practise this tutorial,
|
| Show the map on desktop. | I have already downloaded the code file, extracted and saved in a folder on the Desktop. |
| Double-click on Code-files.
|
Double-click on Code-file folder on the Desktop to open it.
|
| Cursor on the map.
|
QGIS interface opens.
|
| Cursor on the map.
|
Map of India with lines representing railroads opens on canvas. |
| Cursor on the map. | We will calculate line lengths for rail roads which are operational.
|
| Right-click on IND_rails layer in the Layers Panel. | Right-click on IND_rails layer in the Layers Panel. |
| From the context menu select Open Attribute Table option. | From the context menu select Open Attribute Table option. |
| Cursor on attribute table. | Attribute table opens. |
| Point to EXS_DESCRI column.
|
The table has an attribute called EXS_DESCRI.
|
| Cursor on EXS_DESCRI column. | This column shows the status of a particular railway line.
|
| Cursor on EXS_DESCRI column. | We need to select the lines which are operational. |
| Click Select features using an expression tool in the attribute table tool bar.
(It will be seen in yellow color) |
In the attribute table window,
|
| Cursor on Select By Expression dialog-box. | A new dialog-box Select By Expression opens. |
| Click on black triangle next to Fields and Values option.
|
In the Function Editor panel,click on the black triangle next to Fields and Values option. |
| Double click on EXS_DESCRI.
|
From the list select EXS_DESCRI attribute.
Double-click on it and add it to the Expression text area. |
| Type the expression
= 'Operational'. Click Select button. Click Close button. |
Complete the expression by typing
|
| Cursor on the expression. | Please note, the syntax here is case-sensitive.
Type the words as they appear in the attribute table. Here “O” in Operational is capital letter. |
| Click on Select button followed by Close button at the bottom of the table. | At the bottom of the table, click on Select button followed by Close button. |
| Point to the selected category.
|
The Operational category are selected in the attribute table.
|
| Cursor on QGIS window.
|
On the map, you will see that all lines that fall in Operational category are selected.
|
| Right click on IND_rails from the context menu, select Save Selection As.... option. | Now let’s save our selection to a new shapefile.
|
| Cursor on Save Vector Layer as ….. dialog-box. | Save Vector Layer as ….. dialog-box opens. |
| Click on Browse button. | Click on Browse button, next to File name field. |
| In Save Layer As... dialog-box.
Type railway.shp in the name field. |
Save Layer As... dialog-box opens.
|
| Select Desktop.
|
Select a location, I will choose Desktop.
|
| Now let us select CRS for this layer.
| |
| Cursor on Coordinate Reference System Selector. | Coordinate Reference System Selector dialog-box opens. |
| Type Indian 1975 in the Filter search box. | Since we are interested in calculating length, let us select an equidistance projection.
|
| Select Indian 1975 EPSG:4240. | Under Coordinate Reference Systems of the world,
|
| Click on OK button. | Click on OK button. |
| Cursor on Save vector layer as... dialog-box. | In the Save vector layer as... dialog-box,
|
| Tick Save only selected features box. | Check Save only selected features check box. |
| Click on OK button. | Click on OK button. |
| Cursor on railway layer in Layers Panel. | Once the export process finishes, you will see a
new layer railway loaded in Layers Panel. |
| Uncheck the box next to IND_rail layer. | In the Layers Panel,
|
| Cursor on the canvas. | On the canvas you will see the map of India with only operational railway lines. |
| Right-click on the railway layer and select Open Attribute Table. | Right-click on the railway layer and select Open Attribute Table. |
| Cursor on attribute table. | Now we will add a column with length of each feature. |
| Click Toggle editing button on the tool bar. | Put the layer in editing mode by clicking on the Toggle editing tool on the tool bar. |
| Click on Open field calculator icon on the right-hand corner of the tool bar. | Then click the Open field calculator button, available on the right-hand corner of the tool bar. |
| In the Field Calculator dialog-box, check Create a new field option. | In the Field Calculator dialog-box, check Create a new field check box. |
| In the Output field name text box, type length-km. | Type length-km in the Output field name text box. |
| Choose Decimal number (real) as the Output field type. | Choose Decimal number (real) as the Output field type. |
| Increase the precision to 2. | Change the output Precision to 2. |
| Click the triangle next to Geometry, select $length.
|
In the Function editor panel,
|
| Double click on $length. | Double-click on $length to add it to the Expression text box. |
| Type, $length / 1000
|
Complete the expression as $length divided by 1000.
|
| Click on OK button. | We need to divide the output length by 1000,
|
| Click on Toggle editing tool. | Click on Toggle editing tool to stop editing. |
| In the Stop editing dialog-box,
|
In the Stop editing dialog-box, click on Save button, to save the changes to the attribute table. |
| Cursor on Attribute table.
Point to Length_km. |
Back in attribute table, a new column Length_km has been added. |
| Cursor on Length_km column. | Now we have length of each individual line in Railway layer.
|
| Cursor on Attribute table. | Close the attribute table. |
| Click on Vector menu on the menu bar.
Select Analysis Tools option.
|
Click on Vector menu on the menu bar.
|
| Basic Statistics for numeric tools dialog-box opens. | A dialog-box opens. |
| Click on Input vector layer, choose railway.
|
Select Input vector layer as railway.
|
| Click on Run button. | Click on Run button at the bottom right corner of the dialog-box. |
| Point to Sum value. | Results window opens.
|
| Cursor on the Results window. | Note, the answer may vary slightly if a different projection is chosen. |
| Cursor on the Results window. | In practice, line lengths for roads and other linear features are measured on the ground.
|
| Cursor on the Results window. | The method demonstrated above works in the absence of such attribute
|
| Slide Number 6
Summary |
Let us summarize,
In this tutorial we have learnt to,
|
| Slide Number 7
Assignment |
Assignment
|
| Cursor on the asignment. | Your completed assignment should look as shown here. |
| Slide Number 8
About the Spoken Tutorial Project |
The video at the following link summarises the spoken tutorial project.
Please download and watch it. |
| Slide Number 9
Spoken Tutorial Workshops |
|
| Slide number 10
Forum for specific questions: |
Please post your timed queries on this forum. |
| Slide number 11
Acknowledgements |
The Spoken Tutorial Project is funded by NMEICT, MHRD Government of India.
|
| Slide number 11
Acknowledgements |
This tutorial is contributed by Prajwal.M from NIT Surathkal and Snehalatha from IIT Bombay.
|