0% found this document useful (0 votes)
4 views22 pages

Reclassifying LULC for WA+ Framework

The document outlines a training program for advanced QGIS techniques focused on reclassifying land use and land cover rasters for the Water Accounting Plus (WA+) framework. It details the methodology for reclassifying existing LULC data into WA+ land use classes, including the use of specific datasets and software tools within QGIS. The training includes exercises for handling raster data, addressing no data values, and merging classified rasters to produce a final reclassified raster based on the WA+ scheme.

Uploaded by

tariq.omer88
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views22 pages

Reclassifying LULC for WA+ Framework

The document outlines a training program for advanced QGIS techniques focused on reclassifying land use and land cover rasters for the Water Accounting Plus (WA+) framework. It details the methodology for reclassifying existing LULC data into WA+ land use classes, including the use of specific datasets and software tools within QGIS. The training includes exercises for handling raster data, addressing no data values, and merging classified rasters to produce a final reclassified raster based on the WA+ scheme.

Uploaded by

tariq.omer88
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ADVANCED QGIS

CERTIFICATION FOR
WATER RESOURCES
MANAGEMENT

RECLASSIFYING LANDUSE/LANDCOVER
RASTERS FOR THE WA+ FRAMEWORK

INSTRUCTOR: UJAVAL GANDHI

TRAINING PROGRAM FOR ADVANCED CENTRE FOR INTEGRATED WATER


RESOURCES MANAGEMENT (ACIWRM), 14-16 SEP & 22-24 SEP, 2020
CONTENTS 1

Contents
Lesson Overview 2

Datasets 3

Software 3

Working with Rasters in QGIS 4


No Data Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Raster Extent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Pixel Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Exercise 5

Assignment 21

Spatial Thoughts [Link]


2

Lesson Overview
Water Accounting Plus (WA+), is a water accounting framework that provides explicit
spatial information on water depletion and net withdrawal processes in complex river
basins. A key differentiating factor in this framework is that it explicitly describes the
influence of land use and landscape evapotranspiration on the water cycle by defining
land use groups with common characteristics. It is a multi-institutional effort from in-
ternational institutions IWMI, UNESCO-IHE, FAO, and WWAP.
The WA+ method provides a means to determine the output per unit of water effectively
depleted without a need to account for all the flows related to these processes. This is
done by explicitly providing information on water depletion processes for every land use
class.
The WA+ Land class system consists of 80 land use classes divided into 4 Water Man-
agement Classes (WMC) as defined below

• Managed water use: Land use classes in irrigated area


• Modified land use: Land that is significantly modified by humans, including rainfed
agriculture.
• Utilized land use: Natural ecosystems which have little human influence
• Conserved land use: Areas earmarked for conservation and protection

To utilize this framework, we must re-classify existing Land Use/Land Cover (LULC)
data into appropriate classes - taking into account which Water Management classes
they belong. In this lesson, we will take a LULC raster and see how we can use QGIS to
reclassify it into WA+ land use classes.

Spatial Thoughts [Link]


3

Datasets
We will be using the following datasets for this exercise

• Landuse Landcover for K3 Sub-basin for year 2018: K3_NRSC_LULC_2018.tif pro-


vided by NRSC
• K3 Protected Region: Protected_Area.tif provided by ACIWRM
• K3 Irrigated Region: Irrigated_Area.tif provided by ACIWRM

Software
We will be using QGIS 3.14 for this lesson.

Spatial Thoughts [Link]


4

Working with Rasters in QGIS


QGIS Processing Toolbox has grown to have a comprehensive toolset to work with rasters.
Most of the raster analysis depends on Raster Algebra - combining pixels from different
raster layers. QGIS has some rules on how raster calculations that needs to be called
out. Understanding these will ensure you are able to do raster calculations.

No Data Values
By default, a nodata pixel in ANY of the input layers will result in a nodata pixel in
the output raster. This is counter intuitive and is the cause of many unexpected results.
If you are performing any raster calculations in QGIS, it is advisable to replace No
Data values with appropriate pixel values.

Raster Extent
When you perform calculations on multiple rasters, the extent of the output raster is the
minimum covering extent calculated from the input layers. This also results in unexpected
outcomes. Therefore, it is recommended to resize all rasters to the same extent.

Pixel Sizes
When your input rasters have different pixel sizes, QGIS takes care of this situation
and automatically resamples input layers minimum cell size of their cellsizes with the
nearest neighbor algorithm. When working with discrete data, this sometimes results in
unexpected output. You may see edges or discontinuities if the rasters had different pixel
sizes. For this reason, you should always ensure that all rasters have the same pixel
sizes.
In the next exercise, we will learn about the tools and techniques available in QGIS to
do all of these.

Spatial Thoughts [Link]


5

Exercise
1. Open QGIS and locate the K3_NRSC_LULC_2018.tif file in the reclassifying_rasters/
directory using the Browser panel. Double-click to add it to the canvas. You will
see that this layer K#_NRSC_LULC_2018 consists of 17 unique classes.

2. Raster data is stored as a grid of pixels. The data formats allow only for rectangular
datasets, so for irregularly shaped data like this, all other pixels within the extent
are filled with No Data values. You can use the Identify tool and click anywhere
in this region to confirm that they are indeed no data values.

3. As discussed earlier, no data values are problematic and we must fill them with
actual pixel values. In our case, since the raster values range from 1-17, we can fill
the no data pixels with the value 0. Open Processing Toolbox. Search and locate
the Fill NoData cells algorithm.

Spatial Thoughts [Link]


6

4. Select K3_NRSC_LULC_2018 as the Raster input. Set the Fill value to 0. Save the
output to a file and name the output raster lulc_filled.tif. Click Run.

5. As the processing finishes, you will notice the no data pixels are now replaced by
black pixels with 0 value.

Spatial Thoughts [Link]


7

6. To apply reclassification on this raster, we need to divide this raster into 3 sepa-
rate regions representing different Water Management Classes. Each pixel will get
assigned a different output class depending on which region it falls in. To do this,
we can utilize the 2 input rasters supplied to us. The Irrigated_Area.tif for the
area that is irrigated in the given basin and Protected_Area.tif which is the area
under conservation. Add both to the canvas.

7. The first thing we need to address is to make the extent of these layers to be the
same as the LULC raster - allowing us to use them together. Search and locate the
Raster boolean AND algorithm from the Processing Toolbox.

Spatial Thoughts [Link]


8

8. This tool will take 2 or more layers and generate an output raster where each pixel
is 0 or 1 depending on whether there is valid pixel data in all the layers. It is a
handy way to resize out binary raster to another layer’s extent. Click the … button
next to Input layers.

9. Select the Irrigated_Area and lulc_filled layers. Click OK.

Spatial Thoughts [Link]


9

10. Select lulc_filled as the Reference layer. This layer will determine the output
pixel size and CRS. Also check the Treat nodata values as false option. Name the
output layer as irrigated_filled.tif and click Run.

Spatial Thoughts [Link]


10

11. Once the processing finishes, you will see the extent of the irrigated_filled layer
now matches the lulc_filled layer.

12. Repeat this process for the Protected_Area layer and name the output layer
protected_filled. Once created, remove unwanted layers from the Layers panel.

Spatial Thoughts [Link]


11

13. We now have rasters representing irrigated and protected area. Let’s use them
to divide the input LULC raster into separate rasters for irrigated, rainfed (non-
irrigated) and protected land uses. Search and locate the Raster calculator algo-
rithm from the Processing Toolbox.

14. Enter the following expression which calculates output pixel value by multiply-
ing pixels from lulc_filled and protected_filled layers. As the values in
protected_filled are either 0 or 1 - the result is the lulc_filled layer clipped
to the protected region. After entering the expression , click the … button next to
Reference layer.

Spatial Thoughts [Link]


12

"lulc_filled@1" * "protected_filled@1"

15. Select the lulc_filled as the reference layer. Name the output layer as
protected_lulc.tif. Click Run.

16. You will the newly created protected_lulc layer contains input pixel classes within
the protected region.

Spatial Thoughts [Link]


13

17. Now repeat the calculation for the irrigate_filled layer. The expression will
be different because we want to select pixels that are irrigated, but are not pro-
tected. Use the lulc_filled layer as the Reference layer. Name the output
irrigated_lulc.tif. Click Run.

"lulc_filled@1" * "irrigated_filled@1" * (1 - "protected_filled@1")

18. Confirm that the newly added irrigated_lulc does not have any data in the
protected region.

Spatial Thoughts [Link]


14

19. We need another raster representing rainfed area. This can be computed by select-
ing pixels in the extent that are neither irrigated nor protected. Enter the expression
below in the Raster Calculator and name the output as rainfed_lulc.tif.

"lulc_filled@1" * (1 - "irrigated_filled@1") * (1 - "protected_filled@1")

20. The rainfed_lulc layer now has the classified pixels in the rainfed region.

Spatial Thoughts [Link]


15

21. Now we are ready to reclassify each of these rasters to the WA+ land use classes.
Locate the [Link] file in the reclassifying_rasters/ folder. This excel
file contains 3 sheets which contain the mapping from the NRSC classes to the
WA+ classes. There is ambiguity in many mapping, particularly the crop classes.
These should be modified to appropriate crop classes based on local knowledge and
ground-truth data.

22. Load each of the sheets in the Excel file as separate layers in QGIS by dragging
them to the canvas. Search and locate the Reclassify by layer algorithm.

Spatial Thoughts [Link]


16

23. In the Reclasify by layer dialog, select ‘irrigated_lulc as the Rastr layer. Set
irrigated_reclass as the Layer containing class breaks. Both Minimum class
value field and Maximum class value field should be set to NRSC. Set the Output
value field to WA+.

24. Expand the Advanced Parameters section. Set the Range boundaries to min <=
value <= max. Name the output layer irrigated_reclass.tif. Click Run.

Spatial Thoughts [Link]


17

25. Repeat the process and reclassify other rasters to create rainfed_reclass and
protected_reclass layers. You will see that the pixel values now represent the
WA+ class values. Now we can merge all the 3 rasters to arrive at our final reclas-
sified raster. Run the Raster Calculator algorithm.

26. Enter the following expression to add the 3 rasters. Set any one of the inputs as
Reference layer. Name the output lulc_reclass.tif.

"irrigated_reclass@1" + "rainfed_reclass@1" + "protected_reclass@1"

Spatial Thoughts [Link]


18

27. The new lulc_reclass layer is the reclassified raster that is based in the WA+
scheme.

28. If you had removed the original raster, add the lulc_filled layer back. Let’s style
both input and result layers with recommended color scheme and legend labels.
Select the lulc_filled layer and click in the Open Layer Styling Panel button in
the Layers panel. Select the renderer to Paletted/Unique values.

Spatial Thoughts [Link]


19

29. QGIS can read a colormap file and assign the colors and labels to pixel values based
on that. The file format is CSV and it should have 1 line per class with values
specified in this order {pixel value},{red channel value}, {green channel
value}, {blue channel value},{transparency channel value},{label}.
Below is the sample file. In the Layer Styling Panel, click the … button and choose
Load Color Map from File... Select the supplied colormap_nrsc.csv file and click
Open.

0,255,255,255,255,No Data
1,255,0,0,255,Builtup
2,255,209,0,255,Kharif Crop
3,255,158,0,255,Rabi Crop
4,158,81,43,255,Zaid Crop
5,158,207,31,255,Double/Triple Crop
6,245,245,219,255,Current Fallow
7,0,204,0,255,Plantation
8,0,94,0,255,Evergreen Forest
9,107,120,31,255,Deciduous Forest
10,115,184,43,255,Degraded/Scrub Forest
11,5,130,94,255,Littoral Swamp
12,184,234,120,255,Grassland
13,158,31,235,255,Shifting Cultivation
14,209,181,133,255,Waterland
15,191,191,191,255,Rann
16,94,209,242,255,Waterbodies Max
17,0,158,222,255,Waterbodies Min
18,255,191,196,255,Snow Cover

Spatial Thoughts [Link]


20

30. Repeat the process for the lulc_reclass layer and apply the colormap from the
colormap_wa+.csv file.

31. You will see the rasters now have detailed legends and are colorized using the
recommended palette. Save the QGIS project as [Link].

Spatial Thoughts [Link]


21

Assignment
• Can you invert a raster? Take the Protected_Area.tif raster and invert it, so that
the pixels with 0 values are 1 and vice-versa. Use the Raster calculator algorithm.

Spatial Thoughts [Link]

You might also like