QGIS/C2/Vector-Data-Styling/English

From Script | Spoken-Tutorial
Revision as of 11:13, 11 December 2018 by Madhurig (Talk | contribs)

Jump to: navigation, search
Visual Cue Narration
Slide Number 1

Title Slide

Welcome to this tutorial on Vector Data Styling in QGIS.
Slide Number 2

Learning Objectives

In this tutorial we will learn to,
  • Load vector data in QGIS
  • Style vector data using,
    Single symbol styling
    Categorized styling
    Graduated styling, and
  • Labeling features.
Slide Number 3

System Requirement

To record this tutorial I am using,

Ubuntu Linux OS version 16.04.

QGIS version 2.18.

Slide Number 4

Pre-requisites

www.spoken-tutorial.org.

To follow this tutorial you should be familiar with QGIS interface.

If not, For relevant tutorials, visit our website.

Slide Number 5

Example map to practise

To practise this tutorial,

you need to download the folder given in the code-files link, located below the player.

Extract the contents of the downloaded zip file.

Locate world.shp file in the extracted folder.

Show the map on desktop. I have already downloaded the code file, extracted and saved in a folder on Desktop.
Double-click on code-files folder.

Right-click on world.shp file.

From the context menu select Open with, QGIS Desktop.

Double-click on the code-file folder to open it.

Right-click on world.shp file.

From the context menu, select Open with QGIS Desktop option.

Cursor on the QGIS interface.

Cursor on QGIS tips dialog-box.


Click on OK button

QGIS interface opens.

QGIS Tips dialog-box opens.

Click on OK button to close the dialog-box.

Cursor on the map. World map loads on the canvas in the default style.
Point to the world layer in the Layers panel. You can see the world layer in the Layers Panel.
Right-click on the layer name in the layer panel.

Select attribute table from the context menu.

Right-click on the world layer.


From the context menu, select open attribute table.

Cursor on attribute table. Attribute table for this layer opens.
Point to columns.


Point to ADMIN column.

Here we can see all the data of various features embedded in row and column format.

The country names are given in the ADMIN column.

Drag the slider at bottom of the table towards right. Drag the slider at bottom of the table and navigate to POP_EST column.
Navigate to POP_EST column.

Scroll down the list.

In this column population for various countries is listed.
Cursor on the POP_EST column. Next, we will depict the population data shown here, in various styles on the world map.
Click on the red x mark on the top-left corner. Close the attribute table.
Right click the layer in the layer panel.


Select Properties option from the context menu.

Right click on the world layer.


From the context menu select Properties option.

Cursor on the window. Layer Properties dialog-box opens.
Click on Style tab from the left panel. Click on Style tab from the left panel.


Various styling options are available in the Style tab.

Click on drop down button. Click on the drop-down button located on the top left corner of the dialog-box.
Point towards the various options You will see various styling options here.

We will explore the first three in this tutorial.

Select Single Symbol option. Select Single Symbol option.


This option allows you to choose a single style.


The chosen style will be applied to all the features in the layer.

Click on add Symbol layer button (+ button) under Fillpanel. Click on add Symbol layer button available under Fillpanel.
Point to options. Various style options appear below Symbol layer type.
Cursor on the dialog-box. Since this is a polygon dataset, we have two basic choices.
Cursor on the dialog-box. You can fill the polygon with the color and fill style of your choice.
Cursor on the dialog-box. Outline color, style and width can also be changed.
Click on the drop-down arrow next to Fill drop-down.

Rotate the color triangle.

Choose blue color.

Click on the drop-down arrow next to Fill drop-down.


Color triangle opens. Rotate the color triangle to choose the required color.

I will choose blue color.

Click on the drop-down arrow next to Outline text box.


Drag the color triangle to choose the yellow color.

Similarly, Select Outline color.


I will choose yellow.

Click on the drop-down arrow next to Fill Style text box.


Select Dense1 option.

Fill style as Dense1.
Click on the drop-down arrow next to Outline style text box.


Select solid line option.

Outline style, solid line.
Click on the drop-down arrow next to Outline width text box. Outline width, 0.46 millimeters.
Various other style options are available to explore.
Click on OK button. After you have completed the styling,


click on OK button at the bottom-left corner of Layers Properties dialog-box.

Point to the map on the canvas. On the canvas,


you will see the new style applied to the layer with the style pattern you chose.

Cursor on the canvas. Now we will see how to map the population data.
Cursor on the canvas. The Single Symbol style is not very useful in mapping the population data.
Right click on world layer,

Select Properties option.

Let us explore another styling option.


Right-click on world layer again and choose Properties option.

In the Layers Properties dialog-box, choose Categorized from the Style tab. In the Layers Properties dialog-box,

this time we will choose Categorized from the Style tab.

Cursor on Layers Properties dialog-box. Categorized means, the features in the layer will be shown in different shades of a color.

These color shades are based on the unique values in the attribute fields.

In the Column drop down, select POP_EST value. Since we are trying to map population data, in the Column drop down we will select POP_EST.
Select a colour ramp. Choose a colour ramp of your choice from the drop-down.

I will choose Blues.

Click on Classify button at the bottom of the middle panel. Click on Classify button at the bottom of the middle panel.

The panel in the middle shows various classes with corresponding values.

Click on OK button. Click on OK button at the bottom right corner.
Cursor on the map. On the world map, you will see different countries appearing in shades of blue.

Scroll down the central mouse button to zoom-in and zoom-out the map.

Lighter shades represent lower population.

Darker shades represent higher population.

Right click on world layer.

Click Properties option.

Once again open Layers Properties dialog-box.

In Style tab, click on drop drown button.

Click on the drop-down button.

Click on Graduated option.

Let us explore the Graduated symbology.

Select Graduated option.

Cursor on the dialog-box. Graduated symbology type allows you to break down the data in a column in unique classes.

We can choose a different style for each of the classes.

Select POP_EST From the Column drop-down, select POP_EST.
Click on the black triangle next to Classes text box. We can think of classifying our population data into 3 classes, Low, Medium and High.

So, under Classes drop-down, select 3.

Point to the panel. You will see that 3 classes show up in the panel with corresponding values.
Click on Classify button. Click on Classify button.
Click on Mode drop-down.

Point towards the modes.

Select Quantile option.

Click on Mode drop-down.

There are many Mode options available here.

To keep things simple, let us use the Quantile mode.

Point towards the modes. These modes use different statistical algorithms to break down the data into separate classes.
Cursor on the screen. Also note that for an attribute to be used in Graduated style, it must be numeric field.
Cursor on screen. The numerical values can be Integer or Real values.

Attribute field with String type cannot be used with this styling option.

Click on OK button. Click on OK button.
Point to the map. Now on the map you will see countries in 3 different shades of blue.

These color shades represents the population data for the country.

Point to Layers Panel. On the Layers Panel you will see 3 classes for this layer.
Cursor on the map. There are some more styling options available.

We can choose a different style and color for each of these classes.

Right click on world layer.

Click Properties option.

Open Layer Properties dialog-box again.
Double-click on the colored box under Symbol under Classes tab. In Classes tab, under Symbol column, double-click on the colored box.
Cursor on Symbol Selector dialog-box. Symbol Selector dialog-box opens.
In the Color drop-down option, click on the drop-down arrow. In the Color drop-down option, click on the drop-down arrow.

Color triangle opens.

Rotate the color triangle >> select red color. Rotate the color triangle to choose the required color.

I will choose red color to indicate low population.

Click on OK button at the bottom of Symbol selector dialog-box. Click on OK button in the Symbol selector dialog-box.
Double-click on the colored box under Symbol under Classes tab.

In the Color drop-down option, click on the drop-down arrow.

Rotate the color triangle and select the color.

Similarly change the color for other two classes.

I will choose yellow for the medium and green for high.

Double-click on the first row in Legend column.

Type low for the first row.

Double-click on the first row in the Legend column.

Type low for the first row.

Double-click on the second row in the Legend column.

Type Medium for the second row.

Type Medium for the second row.
Double-click on the third row in the Legend column.

Type High for the third row.

And High for the third row.
Double-click on the first row in the Value column. Double-click on the first row in the Value column to edit the selected ranges.
Cursor on the Enter class bounds text box.


Click on OK button.

Enter class bounds text box opens.

If you wish, you may edit lower value and upper value.

For now we will leave the values unchanged.

Click on OK button.

Click on OK button in the Layer Properties dialog box. Click on OK button in the Layer Properties dialog box.
Point to world map. Observe the world map.


Now we have 3 different colors to represent low, medium, high population.

Point to Layers Panel. Observe the Layers Panel.


There are clearly marked class names and

colors to represent our interpretation of the population values.

Cursor on the map. This style conveys a lot more useful map than the previous two attempts.
Cursor on the map. Let us learn how to label different features in a vector file.

For demonstration let us label the names of the countries.

Right click on world

Click properties

Open Layer Properties dialog box again.


From the left panel, select Labels tab.

Select Show labels for this layer in the first text box drop-down. In the first text box drop-down, select Show labels for this layer.
Select ADMIN in Label with drop down. ADMIN column in the attribute table has list of the names of the countries.

So in the Label with drop down, select ADMIN.

Select Buffer.

Check the check box for Draw text buffer.

In the style menu, Select Buffer.

Check the Draw text buffer check box.

Click on Size drop-down.

Click on Color drop-down.

Size of the text can be changed according to requirement.

Select a color from the color drop-down.

Click on OK button. Click on OK button.
Cursor on the map. On the world-map we can see the names of countries displayed.
Slide Number 6

Summary

Let us summarize,

In this tutorial we have learnt to

  • Load vector data in QGIS
  • Style vector data using,

Single symbol styling

Categorized styling

Graduated styling, and

  • Labeling features.
Slide Number 7

Assignment

As an assignment,

Categorise the data set POP_EST into 5 classes.

Use Graduated styling method, Equal Interval mode.

Point to the Assignments shown on screen. 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

* The spoken tutorial project team conducts workshops and gives certificates on passing online tests
  • For more details please write to us.
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.

More information on this mission is available at the following link.

This is contributed by Prajwal.M from NIT Surathkal and Snehalatha from IIT Bombay.


Thank you for joining.

Contributors and Content Editors

Madhurig, Snehalathak