FFS – Land degradation assessment

Training module

  Lesson 4

  Thomas Gumbricht

ICRAF

 

Using Farmer Field Schools Approaches to Overcome Land Degradation in Agro-Pastoral Areas of Kenya

Land degradation assessment – Baseline survey on spatial analysis of land cover / degradation trends and Toolkit Development.

Training module created by Thomas Gumbricht, www.mapjourney.com

Last updated: October 2007

 

LESSON 4 – GRID/RASTER DATA

Lesson overview

In this lesson you will learn about the difference between vector and grid; to symbolize grid data, to work with stacks of multiple grid layers in DIVA-GIS, and the use map algebra to produce new grid layers. The lesson also introduces interpretation of data from multiple layers using both visualization and some built-in analysis tools in DIVA-GIS.

Vector and raster data

Open project

Start DIVA-GIS by clicking the icon for DIVA-GIS on the desktop (see lesson 0 to create an icon on the desktop if you do not have one). Open the project from lesson 3 (..:\data_spatial\ke\my diva\lesson3.div) by either clicking the Open Project tool,
, or via the menu: Project – Open.
 

Vector and raster data

Thus far you have worked mostly with vector data, and one example of image (jpg) data (in lesson 1). Now it is time to look at grid (or raster) data. Grid or raster data are built like image data, with rows and columns of cells or picture elements (pixels) that build up a data layer. Each pixel represents a value, like elevation, vegetation density or a land cover class. Each pixel is of a certain size, the land cover and vegetation data you will use for the whole Kenya in this lesson is built from raster data where each cell represents 1km * 1km. In the raster data the cell is carrying the information about the attribute, not like in vector data where the attributes are stored in a separate database.

Natural phenomena like vegetation density, rainfall, elevation and land cover tend to vary continuously over space. The temperature does not jump at a certain location, but changes gradually. As raster data is portraying a surface with small cells it is often better to use raster data for representing natural phenomena. Another advantage with raster data is that it is easy to compare two datasets, say for instance rainfall and vegetation growth. A disadvantage with raster data is that it takes more storage space in the computer memory, and that it is less precise than vector data.

Things of a human origin tend to be discrete (have abrupt boundaries). Hence vector data is more suitable for mapping out objects like roads, administrative boundaries and other phenomena that are of human origin. The advantage with vector data is that it is more precise, takes less storage space, and can be linked to a database containing many attributes. But it is troublesome to use vector data for map calculations and for portraying continuously varying phenomena.

Add grid data

The grid data available for Kenya is under the folder \data_spatial\ke\grid on the project CD. Navigave to the sub-folder  \data_spatial\ke\grid \landcover and add both the grid (*.grd) and image (*.jpg) file for af_igbp_lc. The image file is a ready-made image of the land cover, the grid file contains the data used for creating the image. As the image and the grid have the same name, DIVA_GIS links them and you can have the image as active theme, and use the Identify tool to get information from the grid theme. Note that for both the image theme and the grid theme the Table tool,
, remains inactive (appears grey) and you can not use it. That is because there is no attribute data associated with a grid or an image in DIVA-GIS. More advanced GIS packages have solutions for attaching a database also to grid files, but not DIVA-GIS.
 

Grid data properties

The grid file af_igbp_lc is not symbolized, and hence you need to symbolize it. Open the Properties window for the af_igbp_lc.grd, make it the theme active and e.g. double click it in the Legend. The Properties window for grid layers looks a bit different compared to vector files, but works in a similar way. It has three tabs, Legend, Info and History. Under the Info tab you can see size of the image (Columns and Rows), and the data type (in this case INT2BYTES, which means that the data is made up of integer values), the Min and Max values of the data in the grid (0 to 16 for af_igbp_lc.grd), and information about the extent, and which Projection the data is in.

 

Under the History tab, some metadata is usually found about how the layer was created. But for now we are mostly interested in the Legend tab.

 

Symbolize grid data

Symbolize nominal grid

In the Properties window click the Legend tab to get to the symbolization options for grid data in DIVA-GIS.

 
Under the Legend tab you can symbolize the grid theme. The af_igbp_lc.grd theme has 17 classes (0-16) as you saw under the Info tab. This is also reflected in the legend. The legend is defaulted to display numerical data of interval or ratio type, but we actually have nominal data (land cover types is a nominal data type, if you need to repeat the different data types in GIS, look at lesson 2). We need to create a symbolization that reflects the 17 classes. First you must create 17 entries (plus Nodata) in the Legend. Click on the Insert Row button,
, until you get 17 classes. If you added too many rows, use the Delete Rows button,
, to remove them. As we have nominal data we must fill in the values using the option manual from the drop menu next to the Label column as shown below. Then you must fill in values for each land cover class as shown below.
 
 

You can put a default symbolization using one of the options from the Select color scheme drop down menu.

 
If you set the colors of the first and the last rows (excluding Nodata) you can ramp the intermediate colors by pressing the Ramp button,
. You can also swap the colors by clicking the Swap button,
. As we, however have nominal data in af_igbp_lc, you can not escape setting the colors individually.
 

The symbolizing of the image file af_igbp_lc.jpg is done using standard colors for land cover also used elsewhere. You can get to the metadata and legend through the project data web-catalog, but the symbolization colors are also shown in the figure below.

 

Ideally you should now try to put the same colors in the Legend for the grid theme with same name, and at the same time enter the correct label in the Label field. To change a color in the Properties window, double click the cell for Color and set the color using the Color window (exactly as with vector data).

 

The land cover data that you have used is derived from satellite data. It was done from analyzing the 2001 annual cycle or vegetation growth (the vegetation phenology) using the MODIS (MODerate Image Spectrometer) sensor that takes a picture of the whole Earth every second day, see the project data web-catalogue for details.

Symbolize ratio grid data

MODIS data has also been used for creating global maps of woody cover, herbaceous cover and bare soil. These three data layers you can find in the folder \data_spatial\ke\grid\veg_fields. Use the Add Layer tool,
, to add them to the DIVA-GIS project. These vegetation field data layers have values from 0-100, with the value 253 denoting Nodata (water areas). They are hence of ratio type (60 % cover is double as much as 30 % cover). They are much easier to symbolize.
 
Make the layer for herbaceous cover (herbcov_2001) active and, and open the Properties window. Use the Insert Row button,
, to create 10 classes. Then select Auto Complete from the drop down menu to the right of the Label columns (as shown below). You now only need to fill in the values in the To column and DIVA-GIS will fill in the From column automatically (you only have to put 0 in the topmost From row).  Set the color of the first row (0-10) and the last row (90-100) and press the Ramp button,
.
 
 
Give the layer a more descriptive label, select the checkbox for NoData Transparent, and click the OK button. In the example below, the layer with selected districts was put on top in Legend, and with Nodata set to transparent the water color form the land cover layer is seen in those areas where there is no data for herbaceous cover. Then Zoom to Theme,
, was clicked to zoom into the selected districts.
 
 

Symbolize by loading legend from file

You can now symbolize the layers for woody cover and bare a bit easier. Make bare cover the active theme and open the Properties window, e.g. by clicking the Properties tool,
. In the properties window select the Legend tab, and click the Read From File button,
(see example below). Select herbcov_2000.grd and the symbolization you did above will be adopted also for barecov_2001. You now only need to change the colors of the first and last rows and click the Ramp button to generate a new color ramp. Click the Apply button to apply the changes to the map in the Data View.
 
 

Repeat the steps you just did for bare also for woody cover, and all the vegetation field datasets will be nicely symbolized.

Identify multiple features

You can retrieve information from more than one layer at a time using the Identify Feature tool,
. But first you need to have a better overview of your layers, hence hide all legends by right clicking on any Legend entry and select, Hide All Legends, as shown below.
 
 

Make the three themes with vegetation cover fields active, by clicking each of them while holding down both the Ctrl + Shift keys.

Then select the Identify Feature tool,
, and click in the map (e.g. in your selected district). The Identify window will popup and have as many tabs as there were selected data layers in the Legend. In the example below there are three tabs (for Tree cover, Herbaceous cover and Bare cover). The location that was clicked is indicated, and as you can see the cover is estimated to be 76 % forest. As the click-point is in the Mau forest reserve in Narok District, this is approximately right. If you look under each tab and calculate the sum of the values, it should sum up to 100 (%).
 
 

Visual interpretation

Now you should try visually to interpret some of the data on vegetation and land degradation that we have used so far, by relating it to protected areas (national parks, game and forest reserves etc). The project dataset includes international data on protected areas at three different levels. All data is prepared by the International Union for Conservation of Nature (IUCN) and you can find the data layers in the folder \data_spatial\ke\mapdata\protected. To get to the metadata (the documents describing the data layers), you should open the data web-catalog that is on the project CD.  

There are three layers included, each representing a different protection status (ke_national_otheraeras_poly.shp, ke_national_iucn1to6_poly.shp and ke_international_poly.shp), add them and then symbolize them so that you can differentiate them in the Data View. Open the attribute table for each of the three layers and look at the attributes, find out which attribute to use for labeling, and label each of the three themes. You can now zoom and pan in the Data View and visually explore the difference in vegetation coverage. Obviously the tree cover is higher in protected areas. Note that the datasets over protected area are from global datasets and their geometry is not completely accurate.

 

Visualization tools

DIVA-GIS comes with some visualization tools for grid data.

Transect tool

The first tool is a simple transect tool where you can visualize East-West or North-South transects. As these tools are a bit unstable, they can cause the DIVA-GIS program to stop responding, hence it is good to save your project before trying them out. Make one of the vegetation field grid themes the active theme, then use the menu: Grid – Transect, to open the transect window.

 
In the Transect window click on the Click on Map button,
, and then click in the map. The transect will show the values in the input file (treecov_2001.grd in the example below) from one edge of the grid to the other. The default is to visualize Columns (West to East), but you can change that to Rows (South to North) in the drop down menu to the left in the Transect window. In the example below the check box for Show moving average was checked, and the red line shows the moving average and the green dots the individual cell values. Remember that Nodata values in the vegetation fields are set to 253, and will show up as high peaks in the transects. The transect shown below is for East-West; the first high flat Nodata area is Lake Victoria, the second is Kisumu bay. Then the peaks are for the forest reserves, then comes the dry plains in Central-Eastern Kenya, and finally the more woody coastal strip furthest to the east (right in the image).
 
 

You can copy the generated transect either as values (and paste it into e.g. excel) or as a graph (and paste it into e.g. a word document or a presentation). Just click the Values to clipboard button, or the Graph to clipboard button, then open an excel sheet or word, and use the paste function (or simply click ctrl-v inside excel/word) and the data will be pasted and ready. Close the Transect window.

Grid stacks and map algebra

Make a stack

A more advanced tool is to analyze the data value of a point for two or more grid files at the same time. DIVA-GIS has built in function to create stacks of grid files that can then be analyzed together, both graphically and using advanced mathematical and statistical functions. You must first build the stack, and then you can use it for various analysis purposes. You build a stack via the menu: Stack – Make Stack.

 
In the Make Stack window that pops up, click the Add Grid button,
, and add the three vegetation fields to the stack.
 
 

Click the Apply button and then Close.

Plot stack

Go back to the Stack menu, but this time select the Plot option. The Stack Plot window opens. Click the Stack button,
, and select the stack that you just created. Then click on the Click on Map button,
, and click in the map. The values for the grid layers in the stack for the click-point will be displayed. You can zoom and pan with the Stack Plot window open, you must just click the Return button,
, that replaced the Click on Map button. Then zoom or pan, and click the Click on Map,
, button again. Also from the Stack Plot you can copy either the data or the graph into the windows built-in copy-paste system and hence take the data directly to other applications.
 
 

The mathematical and statistical tools you can apply to stacks in DIVA-GIS are rather advanced. But here we will just use one simple option, namely to find out those regions where the vegetation cover is dominated by a single class (woody, herbaceous or bare). But first you shall create a mask that identifies the cells with valid data for vegetation fields.

Reclass

DIVA-GIS contains many useful functions for doing calculations on grid maps (map algebra). You can reach them via the Grid menu. You should use the Reclass function to create a Boolean (0/1) mask for the vegetation field datasets. You want a mask that identifies cells with valid data for the vegetation fields (1 in the mask), and excludes the Nodata cells (0 in the mask). Go to the Reclass window via the menu: Grid – Reclass, and select any of the vegetation fields as Input (all three have Nodata in exactly the same cells). Click the Output button and create a new logical file name (veg_mask.grd in the example below). Then enter the reclass values as shown below. Remember that we are only interested in values from 0 to 100 (the valid data) and hence we reclass values in the range 0-100 to 1, other values will be set to 0 in the second row. Click OK to perform the reclassification.

 

The mask that you created should look like the one below.

 

Stack calculations

From the vegetation field data you shall now create a new grid that shows the dominating vegetation field (tree, herbaceous or bare). The stack calculation functions are reached from the menu: Stack – Calculations. Select the stack you created above as the Input Stack. Click the top radio button and select the calculation to be Layer with highest value.  The NULL as zero does not work, as we have not defined any NULL value (albeit we know that 253 is NULL, DIVA-GIS does not). Click the Output button and give the new layer to be created a logical name.

 

Click Apply to perform the calculation

The output grid is automatically added to your project, but it does not look too good. DIVA-GIS finds the dominating class where there are valid data, but somehow misses the cells were the stack images have equal values (the Nodata areas that have the 253 in all three grids included in the stack). But now we can use the mask we created before and get rid of those areas where there are no valid data.

Overlay

In GIS-jargon it is called overlay when two layers are used in an algebraic calculation. You shall use the overlay function of multiplication to get rid of the Nodata areas in your grid showing the dominating vegetation field. The overlay function is in the menu: Grid – Overlay. Select the First input file to be your dominating vegetation field that you just created, and the second to be your mask, then click the radio button for Multiply and give a logical name for the Output file, Click Apply to start the Overlay calculation.

 

The grid resulting from the Overlay calculation is automatically added to the project, and now the map looks better. In order to check out which of the colors (classes) represent the different vegetation fields, make all the original vegetation field layers active (see above). With the resulting grid file on top in the Legend use the Identify tool to understand the classes in the result file. When you know which class represent which dominating vegetation field, you must symbolize the grid file showing dominating vegetation fields, e.g. as in the example below (the grid to symbolize has nominal values).

 

Land degradation and land cover

With the datasets we now have created and symbolized, we should be able to find out if there is any relation between the estimated land degradation from GLASOD, and land cover. Use the Add Layer to add the original GLASOD map (ke_glasod_geo.shp), in the folder \data_spatial\ke\mapdata\landstatus.

To interpret the attribute data for ke_glasod_geo you need to read the document describing GLASOD, included in the web-catalog on the project CD, with a direct link here.

Below you see the GLASOD map symbolized using a cross fill style in order for the underlying maps to be seen through. Can you find any relation between vegetation cover and land degradation, or between the dominating vegetation field and land degradation?

 

It seems that you have to do more work to track down the causes of land degradation.

Save the project, e.g. as lesson4.