West African Drylands Project

Training module

  Lesson 1

  Thomas Gumbricht

ICRAF

West African Drylands Project

An Ecosystem Approach to Restoring West African Drylands and Improving Livelihoods through Agroforestry-based Land Management Interventions.

A United Nations Environment Programme (UNEP) project conducted in partnership with the World Agroforestry Centre (ICRAF), the Centre for Environmental Policy of the University of Florida, and the Governments of Burkina Faso, Mali, Mauritania, Niger and Senegal. The project is funded by the Government of Norway.

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

Last updated: March 2008

LESSON 1 – DIVA-GIS BASICS

  1. Lesson overview 

In this lesson you will learn about GIS data layers, and how to add and remove them from a DIVA-GIS project, how to turn layers on and off, and change the display order. You will also learn how to retrieve information about geographic features, and see the difference between vector and image data. The lesson introduces the concept of land degradation by using GIS data with maps from the Global Assessment of Land Degradation (GLASOD).

  1. Add layer to DIVA-GIS 
    1. Start DIVA-GIS 
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 the introduction (\data_spatial\sahel\my diva\lesson0.div) by either clicking the Open Project tool,
, or via the menu: Project – Open.
 

With the project opened, save it as a new project (e.g. with the name lesson1) via the menu: Project – Save As. See lesson 0 to repeat saving a project if you need.

    1. Add GIS map layer to DIVA-GIS 
To add a map layer to DIVA-GIS click the Add Layer tool,
, or use the menu: Layer – Add layer (most DIVA-GIS commands can be accessed either from the tool bars or via the menu system).
 
 

When you click Add Layer a standard windows Open folder and file navigation window will pop up. Navigate the folder \data_spatial\sahel\mapdata\politic.

As you can see in the lower section of the Open window DIVA-GIS can work with several types of files, including: shape files (shp – files with vector GIS data), grid files (grd, files with raster GIS data), and various standard image formats (tif, jpg, sid, arc). Do not worry about this now, it will be explained later. The most common format for GIS data is as vectors, and DIVA-GIS uses shape (*.shp) files for working with vectors.

Click the drop down menu for Files of type:, and select Shapefiles (*.shp) as shown below.

 

Add the vector layer  sahel_generalised_borders.shp (dependent on your computer setting you can also click or double click on the filename to add it).

DIVA-GIS displays the content of the shape file in the Data View, and the legend in the Legend, to the left. Note also how most of the tools became colored when you added the map layer – DIVA-GIS now has some data to operate on.

  1.  
     
  2. About the data on this CD 

The project CD contains around almost a hundred shape files for you to start working with. With each shape file follows a jpg-image file (*.jpg). The jpg file can be viewed with most image programs (paint, photoshop etc), or using a web-browser (Internet Explorer, FireFox, Netscape, Opera, Safari etc). The jpg-images can be viewed via the html-based project data catalog web-page. But they are also possible to view in DIVA-GIS (or any other GIS). The jpg-images are almost all symbolized (that is, have colors and patterns) that are standard. And you can use the jpg-images in your projects, just as background images, or as templates for symbolizing your own GIS data layers. If you have a license for ArcView or ArcGIS there is a ready-made project file that contains most of data layers available on the CD (except the time-series data, there are simply too many layers to include). The ArcView project file is in the directory \av on the project CD. You might have to install some of the included extensions (also under the \av folder on the project CD) if you want to see all the data in ArcView. Lesson 7 includes a tutorial for using Arcview and converting vector and grid data between DIVA-GIS and ArcView/ArcGIS and other GIS software.

  1. Working with layers 
    1. Turn layer on and off 
Use the Add Layer tool,
, and add the map layer sahel_rivers_large.shp, found in the folder data_spatial\sahel\mapdata\hydro. Then use Add Layer again to add a point layer (another word for layer is theme in GIS-jargon), this time navigate to the folder data_spatial\sahel\mapdata\infra and add the theme sahel_cities_large.shp. Your Data View and Legend should now contain three layers, one point layer (sahel_cities_large), one line layer (sahel_rivers_large), and one polygon layer (sahel_generalised_borders).
 
 

In the Legend View you select which layers to be shown in the Data View, and also which layer(s) the Tools should operate on. To turn on and turn off a layer, click the checkbox to the left of the layer name. In the example below the checkbox for sahel_cities_large is unchecked, and the cities are not shown in the Data View.

 

To check/uncheck all layers in the Legend hold down the ctrl-key and click any layer that is on.

    1. Active Layer(s) 

When you clicked in the checkbox the layer you clicked also got a highlighted frame around it (sahel_cities_large in the example above). The lifted frame of sahel_cities_large indicates that this is now the active layer. Any layer-related operation that you will now do will work on the highlighted layer(s) only. You do not need to check or uncheck the checkbox to highlight a layer – just click anywhere else on the layer in the Legend (e.g. on the small symbol or the text) and that layer will be selected as the active layer. To select more than one layer to be active, hold down both the ctrl and shift keys, then use the mouse to click on the layers you want to make active in the Legend. All active layers will appear lifted in the Legend View. You can also deselect layers in this way.

 
    1. Remove layers 
You can remove the active layer(s) by clicking the Remove Layer tool,
, or via the menu: Layer – Remove Layer. Before the layer is removed you are prompted to confirm the removal. If you remove a layer it is not deleted from the hard drive or CD, it is only removed from the DIVA-GIS Data View and Legend.
 
    1. Identifying features 
Click on the Identify Feature tool,
, or go via the menu: Layer – Identify Feature. Note how the tool appears pressed down in the menu, and how the cursor changes -
. From the look of the cursor, and the tool-button that appears pressed DIVA-GIS will tell you which command is active at any time.
 

Click on the layer sahel_generalised_borders in the Legend to make it active (it appears lifted), make sure the Identify Feature tool is active, and click inside the map (Mali in the example below).

 
A pop up window (called Identify) will show you information about the feature you clicked. A feature or record is a single point, line or polygon (as in the case above) that represent one particular phenomena in the map layer – in this case a country in the map layer sahel_generalised_borders. Close the Identify window by clicking the cross in the upper right corner,
.
 
  1. Zooming and panning 
Zooming in and out, and panning (moving) around in the map are key tasks that can be done with GIS. In DIVA-GIS there are several tools for zooming, and one for panning. If you did not try zooming on your own, the tool buttons will look like this -
. If you tried them out, the arrow tools will be black instead of gray – as they are for returning or go forward to a previous zoom (i.e. they are not activated until you actually do a zoom or pan). The Tools have the following functions:
 
Zoom to Full Extent, zooms the Data View to show all layers in the Legend,
 
Zoom to Theme, zooms the Data View to fit the active layer(s),
 
Zoom to Selected, zooms to selected features of the active layer(s) (you will learn to select features in the next lesson),
 
Zoom In, zooms in centering the Data View to the click point on single click, or to a defined box if the left mouse button is clicked and held down and the mouse is used for creating a rectangle,
 
Zoom Out, zooms out centering the Data View to the click point,
 
Zoom to Previous Extent, returns the Data View to the previous zoom,
 
Zoom to Next Extent, becomes active if Zoom to Previous Extent is used, and returns the Data View to the view before this tool was clicked,
 
Pan, used to move the position of the Data View by clicking and holding down the left mouse button, and then drag the mouse.
 

You can also get the zoom and pan functions from the menu, under the Map option.

 
  1. Map properties 

Under the map menu you also find the Properties option. Select the Properties option to see the Map Properties of your project.

 
All the data layers on the Project CD are in Decimal Degrees (Longitude and Latitude as X and Y). DIVA-GIS can reproject data in Decimal Degrees to many other projection, so if you later want to combine data from this project CD with data projected into your national (or other) projection, DIVA-GIS can do it for you (if you want to try it is in the menu under: Tools – Projection, explained in detail in lesson 7). In the Map Properties window you can also set the distance properties that you want DIVA-GIS to show you, e.g. when using the Measure tool,
. Set the Distance Measurement Units you feel most comfortable with from the drop down menu as shown above.
 
  1. Image data layer 

So far you have only worked with vector map layers. But DIVA-GIS can also work with images (jpg, tif, sid and arc) and grid files (introduced in lesson 4). Use the Add Layer tool to add both a vector file and an image file showing land degradation, navigate to \data_spatial\sahel\mapdata\landstatus and add both the jpg and shp file for the layer sahel_glasod – you can select both at the same time by holding down the ctrl key.

The Global Assessment of Land Degradation (GLASOD) was the first attempt to map global land degradation. Experts around the world used uniform guidelines and international correlation to map the extent and severity of land degradation. GLASOD was funded by UNEP (1987-1990).

 
 

In the Data View the added layers end up at the top in the Legend. As the jpg layer is an image it covers all the layers below in the Legend, hence you can only see the image and the layers positioned above it in the Legend.

  1. Change display order 

You can easily change the display order in DIVA-GIS. Use the mouse to grab the image layer for sahel_glasod (image), make it active and click and hold down the left mouse button, then drag the legend of the layer to the bottom of the Legend. A black frame will indicate the movement and position of the legend.

 

You can also change a layers legend position, and do other things, by making a layer active and then click the right mouse button pointing at the layer in the Legend. By doing that a small popup window will appear as shown below.

 
  1. Overview Map 

One of the options in the popup menu above is to include an overview map. To make an overview map you can also just click F7, or go via the menu: Map – Overview Map. You can toggle between including and excluding the map by clicking F7 (or one of the other options) again. Choose the layer you want to use for making an overview map, and make it active. Then right click on the legend, and click Add to Overview Map, in the popup window (the one shown above). In the example below, the sahel_generalised_borders layer was used to create the overview map. By right clicking in the overview map, you get different options for designing the overview map, including adding layers not used in the Data View.

 

With the overview map added you can use it for panning in the Data view. Simply click in the Overview map and the Data view will center on the point you clicked in the Overview map.

  1. Vector and image data 
Put the image (jpg) file to the bottom of the Legend, and turn the layers sahel_cities_large and sahel_rivers_large off  by unchecking their checkboxes. Use the Zoom In tool,
, to zoom in to one of the boundaries in the map as shown below, the overview map will show you the zoom position.
 
 
In the example above you can see one of the important differences between vector data on one hand, and image and grid data on the other. The vector data retains its width and size as you zoom in and out, but image (and grid) data turns up as pixels (pixel = picture element) when you zoom in beyond the image resolution. The positional accuracy of the image (jpg) is not as good as the accuracy for the vector. The image file does further not have any data associated with it; so clicking the Identify tool will just generate an error message (an image can be associated with a grid, in which case data from the grid can be identified, more about that in lesson 4). Instead make the shape file for sahel_glasod the active theme (click it in the Legend so it appears lifted up). Then choose the Identify tool,
, and click in the map.
 
 

In the Identify window information about land degradation for the feature you clicked will be shown. The legend for GLASOD as symbolized (colored) in sahel_glasod.jpg is shown below, to see the full documentation click here. All the documents and backgrounds on the data layers, as well as jpg image files, and most legends can be reached via the project data catalog web-page.

  1. Attribute data 
A GIS data layer can have a database (attribute table in GIS jargon) associated with it. When you pressed the Identify tool you got the attributes for the feature you clicked. To see the whole attribute table for a GIS layer, make the layer active by clicking it in the Legend (it appears lifted), and then click the Table tool,
(or go via the menu: Layer – Table). Open the table for the layer sahel_glasod, then use the scroll bar to see the fields (columns) to the far right in the attribute table for sahel_glasod, as shown below.
 
 

The four last columns show the land degradation classes that GLASOD defined. The classification as shown in the image (sahel_glasod.jpg) is from the column SEV_A_LB (short for severity classification type A labels). GLASOD also identified the major (MAJ_LBL) and minor (MIN_LBL)  causes for land degradation. In the folder that contains the GLASOD data, there are two jpg images showing the major and minor causes of land degradation. These images uses the standard symbolization for GLASOD major and minor causes, and you can use them as template if you want to recreate a symbolization for land degradation causes.

  1. Symbolization 

You can use DIVA-GIS to symbolize (i.e. put colors and patterns, text etc.) the GIS layers in the project. Lesson 2 focuses more on symbolization.

Make the shape theme (layer) sahel_glasod the active theme, and either double click in the Legend, or click the Layer Properties tool,
(or go via the menu: Layer – Properties). In the Properties window you can set the symbolization. There are three tabs in the Properties window for vector (shape) layers: Single, Unique and Classes.
 
 

Make sure the Single tab is selected (as shown above) and click the small symbol in the middle of the Properties window (empty rectangle by default).The Symbol setting window will open, and you can now set the color and pattern you want for the layer sahel_glasod. For now just change the Style to Solid Fill in the drop down menu as shown below.

 
Then Click the OK button,
in the Symbol window and the Apply button,
in the Properties window. The GLASOD layer (sahel_glasod) will now have a single color symbol. To set individual colors according to the GLASOD severity classification, click the Unique tab in the Properties window. From the drop down menu for Field select SEV_A_LB for symbolization as shown below. Then click the Reset Legend button,
. Then click Apply.
 
 

In the DIVA-GIS legend the GLASOD layer will be updated to show the color setting and the labeling will be taken from the field (column) in the attribute table used for symbolization. In the Data view the GLASOD map will have the corresponding color setting.

 

The colors that DIVA-GIS put for the GLASOD map were random, and you need to set more appropriate colors. You can use the layer for the image version of the GLASOD map sahel_glasod (image), to see the colors that GLASOD normally is shown with. To change the colors in the vector layer return to the Properties window, and just click on the individual rectangles for each feature class shown under the Unique tab. You can then set the colors for each feature class (Light, Moderate, None, Not Classified, Severe, Very severe) by clicking the small Color symbol in the Symbol window as shown below (left). This will open the Color window (below to the right). Just click on a color to select, click OK in the color Window, then OK in the Symbol window.

 
 

The standard colors that GLASOD uses are as follows:

Light: Yellow

Moderate: Green

Severe: Blue

Very severe: Red

None: Gray

Not classified: White

Try to set all of them using the symbolization options in DIVA-GIS. Remember to click the Apply button in the Properties window to apply the changes. If you got it right the vector layer for sahel_glasod should look similar to the pre-made image version of the same map. In the example below the layers showing cities (sahel_cities_large), borders (sahel_generalized_borders) and major rivers (sahel_rivers_large) are put on top of the GLASOD layer, and the symbolization is updated. You will learn more about symbolization in lesson 2.

 
  1. Database selection 

A key function of GIS is to select features from the database (attribute table) for information. Make the GLASOD vector layer (sahel_glasod) the active theme and

click the Query tool,  
, (or go via the menu: Layer – Select records). The Query dialog window has two tabs: Select by values and Select by Query, for now we shall only use the Select by values option (as shown below). In the drop down menu for Variable select the field SEV_A_LB (that you used for symbolizing the GLASOD vector layer).
 
 
All the unique feature classes in the selected field (SEV_A_LB) will be shown in the main window, and by default they will all be selected. Click the Clear All button,
to clear the selection, and then just click the checkbox for Very severe. Then click the Apply button,
and all the records (rows in the attribute table) will be selected and highlighted. The default color for showing selected features in DIVA-GIS is yellow, so to distinguish the selected features from other features with the color yellow is difficult (in lesson 2 you will learn how to change the default color for selected features). In the example below the color for symbolizing the degradation class Light is changed in order for the selected features (Very severe) to come out more clearly.
 
 

You will work more with GLASOD in other lessons. Before ending this lesson, save your project (e.g. as lesson1 under the my diva folder)

Try it on your own – add and symbolize districts

The dataset contains a layer with district boundaries that you find in the database under \data_spatial\sahel\mapdata\politic\ sahel_admin_districts.shp. Add this data layer to your DIVA-GIS project. Symbolize the borders of the district layer so that you can easily distinguish country and district borders, and then use the Zoom tool to zoom in to a district you are interest in. As you will need to zoom in quite far, your project should have an overview map showing the position of the district. In the example below the country borders are set to color black with a line width of 3, and district borders are set to dark gray with a line width of 2.