QGIS/C2/Raster-Data-Styling/English
Visual Cue | Narration |
Slide Number 1
Title Slide |
Welcome to this tutorial on Raster Data Styling in QGIS. |
Slide Number 2
Learning Objectives |
In this tutorial, we will learn,
|
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 for Demonstration |
Download the folder given in the Code files link, located below the player.
|
Point to Code-file folder on desktop.
Double-click on Code-file folder. |
Here is my Code files folder.
|
Point to glds00ag60.asc and glds90ag60.asc files.
|
In this folder you will find Population Density grid files for the entire world, for the year 2000 and 1990.
|
Open QGIS interface.
|
Here I have opened QGIS interface.
|
Point to Raster Data Source dialog-box.
|
A dialog-box opens. I will navigate to the Code file folder on the Desktop.
|
Click on Open button. | Click on Open button. |
Cursor on Coordinate Reference System Selector.
|
Coordinate Reference System Selector opens.
|
Select WGS 84 EPSG:4326 from the list.
Click on OK button. |
Here I will select WGS 84 EPSG 4326 from the list.
|
Cursor on Coordinate Reference System Selector. | Since we are adding two layers at the same time, Coordinate Reference System Selector opens once more here. |
Select WGS 84 EPSG:4326 from the list.
Click on OK button. |
Again select WGS 84 EPSG 4326.
|
Cursor on world map. | On the canvas you will see a world map rendered in grayscale.
Lighter pixels indicate higher population and darker pixels indicate lower population. |
Cursor on Layers panel. | In the Layers Panel, you will see both the raster layers loaded. |
Cursor on map.
(Zoom-in the map) |
Each pixel in the raster has a value of population density for that grid. |
Click on Identify Features tool on the tool bar. (blue square icon with small i) | To see the value of the pixel, click on Identify Features tool on the top-right corner of the toolbar. |
Click on a pixel on map.
Point to the value. |
Use the mouse wheel to zoom in the map.
Click anywhere on the raster map. The pixel value will be displayed in the Identify Results panel. |
Click on darker pixel.
|
Observe that lighter pixel has higher value the darker pixel has lower value.
|
Cursor on canvas. | Zoom out the map.
Click on Pan Map tool and adjust the map on the canvas. |
Population density pattern can be better visualized with an appropriate type of styling. | |
Right-click on the 1st layer in the Layers Panel.
|
Right-click on the 1st layer in the Layers Panel.
|
Cursor on Layer Properties dialog-box. | Layer Properties dialog-box opens. |
Style>>Render type>> Singleband pseudocolor | In the dialog-box box select Style tab.
|
Under Load min/max values, click on Colors text box drop-down.
Choose Spectral. |
Let the Interpolation be Linear.
In the Color drop-down, select Spectral. |
Click on Classify button. (Maximise the properties dialog-box). Cursor on Value column. |
Scroll down.
|
Cursor on the middle panel. | You will see 5 new color values created. |
Click on OK button. | Click on Apply button and OK button at the bottom right corner of the dialog-box. |
Cursor on QGIS Canvas. | Back in the QGIS Canvas, you will see the raster map displayed in 5 classes of spectral color rendering. |
Properties>>Style>>Render type>> Singleband pseudocolor>> Classify | Follow the same steps as shown for 1st layer and change the raster style for 2nd layer. |
Cursor on the canvas. | For our analysis, we would like to find areas with largest population change between years 1990 and 2000. |
Cursor on panel. | For this, we need to find the difference between each grid’s pixel values in both the layers.
For these calculations, we will use Raster Calculator tool. |
Click on Raster menu from the menu bar.
From the drop-down, click on Raster calculator. |
Click on Raster menu from the menu bar.
From the drop-down, click on Raster calculator. |
Raster Calculator dialog-box opens. | Raster Calculator dialog-box opens. |
Cursor on Raster bands section. | In the Raster bands section, the names of the bands are displayed.
Since each of our rasters have only 1 band, you will see only 1 entry per raster. |
Cursor on Raster bands section. | The raster calculator can apply mathematical operations on the raster pixels. |
Cursor on Raster bands section. | In this case we want to enter a simple formula
|
Double-click on the raster layer for the year 2000 (pop-2000@1). | Under Raster bands section, select the layer by double-clicking on the raster layer for the year 2000. |
Point to Raster calculator expression section. | The expression is now added to the Raster calculator expression section. |
From the Operators section, click on subtraction operator.
|
From the Operators section, click on subtraction operator button.
|
Cursor on formula.
pop-2000@1 - pop-1990@1 |
The formula for the calculation is now displayed in the Raster calculator expression section. |
Result Layer section, in the Output layer box,
|
Under Result Layer section, you will see Output layer box.
|
Output format as Geo TIFF. | In the Output format drop-down, select Geo TIFF. |
Cursor on Output CRS option. | Output CRS option is automatically selected. Leave as such. |
Check the box next to Add result to project. | Check the box next to Add result to project. |
Click on OK button. | Click on OK button at the bottom of the dialog-box. |
Cursor on Layers Panel. | You will see the new layer load in Layers Panel. |
In the Layers Panel, uncheck the check boxes for pop-2000 and pop-1990 layers. | To view the map for the 3rd layer, in the Layers Panel, uncheck the check boxes for pop-2000 and pop-1990 layers. |
Cursor on canvas. | We can create a much more informative map by changing the style of this layer. |
Right-click on the pop-density-change layer.
|
Right-click on the pop-change layer.
|
Cursor on Layer Properties dialog-box. | Layer Properties dialog-box opens. |
Cursor on the canvas. | We want to style the layer such that, pixel values in certain ranges get the same color. |
Click on Metadata tab
Scroll down and point towards minimum and maximum values.
STATISTICS_MINIMUM =-1840.7290039062 |
Click on Metadata tab, scroll down to Properties section.
|
Click on Style tab.
|
Go to the Style tab.
|
interpolation>> Discrete | Set the Interpolation to Discrete. |
Click the Add Values Manually (green plus symbol button located next to Classify button) button 4 times.
|
Scroll down.
|
Cursor on the values. | Here we have to change the values in each row.
|
Double click on value in the Value column. | Double-click on the first entry in the Values column to change the value. |
Type -2000.
|
We have observed, the minimum value in our metadata analysis is just above -2000.
|
Double-click on the color-box and change the color. Red color | Double-click on the color-box and change the color. |
Double-click on the Label column in the first row.
Type, No Data values. |
Double-click on the Label column in the first row.
Type, No Data values. |
Point to the table. | Similarly fill in all the values and labels as shown here. |
Point to the table.
Light Green |
In the 2nd row, -10 to denote Negative change. |
Point to the table.
Pink |
In the 3rd row, 10 to denote Neutral. |
Point to the table.
Blue |
Finally 6000 to denote Positive change.
|
Click on OK button. | At the bottom-right corner of the window, click on Apply button and then OK button. |
Point to the map on the canvas. | Now on the canvas you will see a much more powerful visualization of the population data.
|
Areas colored in blue denote the positive population.
Areas in green show negative change. Areas in pink have not see too much population change. | |
Slide Number 6
Summary |
Let's summarize,
In this tutorial we have learnt,
|
Slide Number 7
Assignment |
As an assignment
|
Your completed assignment should look as shown here. | |
Slide Number 8
About 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. |
Slide number 11 | This tutorial is contributed by Prajwal.M from NIT Surathkal and Snehalatha from IIT Bombay.
Thank you for watching. |