West African Drylands Project

Training module

  Lesson 2

  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 2 – SYMBOLIZATION

  1. Lesson overview 

In this lesson you will learn about different types of attribute data; nominal data like names, ordinal data that gives an order without numbers, interval data where a number denotes a difference but the difference is not absolute, and ratio data which is data with absolute numerical values. The symbolization of attributes vary dependent on which type of data the attribute represents, and the lesson introduces symbolization of GIS data in DIVA-GIS. The lesson uses national GLASOD data as example.

  1. 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 1 (\data_spatial\sahel\my diva\lesson1.div) by either clicking the Open Project tool,
, or via the menu: Project – Open. Dependent on your installation of DIVA-GIS there should also be a short cut indicating previous projects, and you can select your project from there as indicated below.
 
 

With the project opened, save it as a new project (e.g. with the name lesson2 in the my diva folder) via the menu: Project – Save As.

  1. Add and remove layer 

In this lesson we will use a national index for land degradation rather than the original GLASOD (Global Assessment of Land Degradation) map used in lesson 1. Start by making the vector and image layers for sahel_glasod active – by first clicking on one layer in the Legend, then hold down both the Ctrl and Shift keys and click the other. Then also add the vector layer for sahel_generalized_bordes to the selection.

 
With all three layers active, click the Remove Layer tool,
, or go via the menu: Layer – Remove Layer, and remove the GLASOD layers and the border layer. Diva-GIS will prompt you and ask if you really want to remove the layers, but do not worry the layers will only be removed from the project document, not from the hard drive.
 

Then add the layer for country statistics on land degradation (\data_spatial\sahel\mapdata\politic\sahel_country-index.shp). Grab the polygon layer sahel_country-index and drag it to the bottom of the DIVA-GIS legend in order for the other themes to be seen on top of the polygon (see lesson 1 to repeat changing the drawing order in the Legend).

  1. Attribute data 
In lesson 1 we used the Identify tool,
, to see information about single features in a map layer. Lesson 1 also introduced vectors as the most common format for representing GIS map data, and you now know vector data can represent points, lines or polygons. The project you are working with should also contain three layers, one point layer (sahel_cities_large), one line layer (sahel_rivers_large), and one polygon layer (sahel_country-index). If you do not have these layers in your project, use the Add layer to add them.
 
Use the Zoom to Full Extent tool,
to zoom to the full extent of your data layers.
 
 

A vector layer is actually composed of several separate files stored on the computer; one file for the geographic data (coordinates), one file that contains information on how the features relate to each other (called topology), and one file with attributes. Attributes are characteristics that describe the geographic feature. The attributes will vary dependent on if the geographic feature is a point, line or polygon, and what kind of phenomena the layer represents. Here are some examples:

Vector type

Example

Nominal attribute

Ordinal or interval attribute

Ratio attribute

Point

City

Type (capital – province capital - other)

Size (small-medium-large)

Inhabitants (nr)

Line

River

Name

Quality (good-bad)

Length, Width (m)

Polygon

Country

Name

Land degradation (light - severe)

Area (square km)

A city can be described as a point on a small-scale map with a specific geographic position. But a city also has other characteristics, called attributes in GIS-jargon. The city can be the captital, or a provincial capital, a coastal town etc. The city type is a typical attribute that can be stored in a database and linked to geographic feature. This is how it is done in GIS. Furthermore, the attribute city type as used here is a description without any rank or order (a capital is not better or worse, smaller or larger than a city in general). Such an attribute, without any rank or numerical value, is called a nominal attribute. The city size is another typical attribute, but sizes can be ranked. If the ranking is loosely done, like for instance small – medium – large, then the attribute is called ordinal. If it has an order (large is bigger than small) but we do not know how much larger – hence ordinal. A city also has a specific number of inhabitants. Also the number of inhabitants is a typical attribute of the city. If we know the exact number of inhabitants, we can also say that one city has double as many as another – this is a ratio, and hence the attribute is called ratio.

    1. Attribute data - points 
Now make the point theme sahel_cities_large the active layer by clicking on it in the legend. Choose the Identify Feature tool,
, and click on one of the points for sahel_cities_large.
 
 

In the Identify window the information about the point you clicked is displayed. There are 4 attributes for the theme sahel_cities_large (NAME, COUNTRY, POPULATION, and CAPITAL). The attribute POPULATION is a ratio (absolute number) and the other three are nominal (have no number).

    1. Metadata 

Ideally geographic data posted on the internet (or delivered on a CD like this project) should come with a full description of how the dataset was created, when it was done, how accurate it is, who did it etc. Such information is usually called metadata, and most layers on the project CD come with metadata. You can access all the metadata via the web-catalogue on the project CD.

    1. Attribute data - lines 

A river (or road) is represented as a line in GIS. In the data file with the geographical data it is represented as a series of connected points. A river also has some typical attributes. The length of the river (or river segment) is a typical ratio attribute, the name is a typical nominal attribute. River water quality on the other hand is typically ordinal: good – mediocre – bad. It is difficult to put numbers on water quality, but you can often rank water quality conditions.

Click on the theme sahel_rivers_large in the Legend to make this theme the active theme (it becomes lifted up). Turn it on by clicking the checkbox if it is not already on. Again select the Identify Feature tool and click on one of the rivers.

 

In the Identify window you see that rivers have 10 attributes, most coded (the coding is in the metadata, available in the web-catalog). The river dataset is assembled from various datasets, and is not absolutely accurate. But we can see that the length of the river segment you clicked is given as an attribute. As length is an absolute numerical value, the attribute length is of the type ratio (a river that is 8 km in length is twice as long as a river that is 4 km in length). The first two attributes (FNODE_ and TNODE_) are used to connect the river segments to build a full river. The CODE, RNK and REGIME attributes give the number of upstream branches the river has at this particular segment. CODE, RNK and REGIME are ordinal data indirectly describing river size. The coding can be found in the metadata on the project CD.

Click on some river segments in the river theme using the Identify Feature tool, and note how all features represent rather short river segments. If you look carefully you will see that single river segments are connected and that all places where the river branches are connected. You can see it when you click, as the segment is shortly highlighted before the Identify window pops up. Lines must be done in this way in order for the GIS to interpret how rivers are connected – that is how the topology of the river network is arranged. With the help of the topology, more advanced GIS programs can calculate the shortest path or flow route between two points. If there are breaks in the lines, or if river branches were not included, this could not be done. Having a correct topology is hence important.

    1. Attribute data - polygons 

A country is a typical polygon when represented as a vector in GIS. It has a boundary (line) that closes upon itself and hence forms a polygon. The country name is perhaps the most typical nominal attribute. The GLASOD data that you have used in lessons 1 and 2 are of interval type. A higher GLASOD value denotes higher land degradation.  The original GLASOD data has been used to construct national indexes of land degradation, which is also an interval value. Most indexes are interval attributes, where the interval between numbers denotes the same difference, but where the ratio between numbers has no meaning. The most common ratio attributes for countries are area and population. Not only is for example Mali larger than Burkina Faso, but we can also calculate that Mali is 5 times larger than Burkina Faso, which is a ratio.

Make the theme sahel_country_index the active theme and click inside Mali (or another country) in the Data View.

 

The attributes for Mali include all types of attributes: country name (CNTRY_NAME) and currency type (CURR_TYPE) are examples of nominal attributes; GLASOD land degradation (GLASOD_Z) is an interval attribute; and population (POP_CNTRY) and square kilometers (SQKM_CNTRY) are ratio attributes. The attribute GLASOD_Z is derived from normalization of the original GLASOD data, calculated per country. Normalization is a statistical technique for smoothing data and getting rid of extreme data values, and is discussed in detail in lesson 5.

    1. Attribute table 
Instead of using the Identify Feature tool to look at the database connected to a layer, you can use DIVA-GIS to view the full database (or attribute table). Make sure that sahel_country-index is the active theme, and open the table using the Table tool,
, or via the menu: Layer – Table. A window showing the content of the database that comes with sahel_country-index pops up.
 
 

You can make the window larger by sliding the mouse over the blue frame, clicking the mouse to grab the frame and then drag the mouse to change the size. You can also scroll in the database by clicking the slide button and dragging it. In the attribute table shown above you can see the database values for population (POPS_CNTRY) and country area in square kilometers (SQKM_CNTRY), and the currency used in the included countries (CURR_TYPE).

    1. Highlight feature 
From the attribute table you can interactively do some simple statistical analysis, and highlight, pan and zoom to selected features. Click the Statistic button,
(shown in figure above). In the Statistic window that pops up select the Field POP_CNTRY from the drop down menu (see below), and you will get basic statistics about the population in the countries included in the database.
 
 

Click on any cell in the database to select the record (row) that that cell belongs to (Mali in the example below). Then click the Highlight button and blinking will highlight the feature you selected.

 

If you click the buttons for Pan To and Zoom To, DIVA-GIS will pan/zoom to the geographic feature represented by the selected record, and then highlight it by blinking.

  1. Symbolizing features 
 A large part of GIS is to symbolize geographic features so they can be easily understood and interpreted, by yourself or by others. Symbolizing includes putting colors, patterns, texture, icons and text on the map. Make the point theme (sahel_cities_large) the active theme by clicking it in the Legend. Symbolizing in DIVA-GIS is done from the Properties window, and you can open the dialogue window for properties in three ways, by double clicking in the Legend, by clicking the Properties tool,
, or via the menu: Layer – Properties.
 
 

There are three alternatives, each under its own tab, for symbolizing a layer: Single, Unique and Classes. Single puts a single symbol on all features in a layer, and is what DIVA-GIS uses as default when you add a layer (all layers in the Data View are symbolized using the Single alternative).

    1. Symbolizing nominal data (points) 

For the city points the attribute data included in the attribute table is both nominal and ratio, and you should choose Unique to symbolize nominal data. Hence click the tab for Unique, as shown below. Then you have to choose which field (column) in the attribute table you want to use for the symbolization. As you saw above, the field CAPITAL contains nominal data separating capital cities from non-capital cities. Hence choose the field CAPITAL from the Field drop down menu.

 
With CAPTIAL selected as field, click the Reset Legend button,
, and the legend is reset. If, as in the example below, the checkbox for Use color of single tab was checked all symbols will be the same, if unchecked DIVA-GIS will generate a color scheme for you (just uncheck and click the Reset Legend button again to try it out).
 
 

The Properties window should now show all Unique entries found in the field CAPITAL (Y and N), as shown above. You can change the individual symbols for each Unique value, just click the little symbol icon as indicated above. The Symbol window will popup, and here you can choose the Style, Color, Outline and Border.

 
 

Select the Style of the symbol by clicking the drop down menu for Style (to the left above). To change the fill color of the symbol, double click the squared icon for color (to the right above). The Color window for selecting (or creating) colors will pop up. You can either select a predefined color or click the Define Custom Colors >> button to expand the window to allow your own definition of colors (indicate by the cursor in the image below).

 
You must click the OK button,
, in the Color window for the change to apply. To change the border color you instead double click the squared icon for Border Color (black as default), and the same Color window will open again. Once your symbolizing is ready you must also click the OK button,
, in the Symbol window.
 
Repeat the symbolizing steps for capital cities and non-capital cities in the Properties window, and when all are changed, click the Apply button,
, in the Symbol window.
 
 

In the example above, capital cities were symbolized using larger squares and non-capitals using smaller circles. The border and fill colors were set to black and red for both types.

    1. Symbolizing ordinal data (lines) 
The river theme (sahel_rivers_large) contains both nominal, ordinal and ratio data, and you should use the ordinal data to symbolize the roads. Open the Properties window for sahel_rivers_large, by first making sahel_rivers_large the active theme and then click the Properties tool,
.
 
 

The Properties window for lines looks similar to the one for points, and works much in the same way. If you remember from earlier in this lesson, the interval data for river size (number of upstream branches) is in the field RNK. Interval and ratio attribute data can be symbolized using either Unique or Classes. As there are only a few classes of rivers it is easier to use Unique again. Click the Unique tab, and the Symbol window for lines will popup.

 

In the Symbol window for lines you can set the Style of the line, the Color and the Width. Look above in this lesson to interpret the coding of the attributes for sahel_rivers_large, and symbolize the rivers. In the example below the river size (upstream branching) are visualized using line width with the color being the same for all features.

 
    1. Symbolizing interval/ratio data (polygons) 

Make the polygon layer (sahel_country-index) the active theme by clicking it in the Legend. Open the Properties window (e.g. double click the layer in the Legend). The attribute table for sahel_country-index contains nominal, ordinal and ratio data, and you should symbolize the layer using the GLASOD land degradation index (the field GLASOD_Z in the attribute table), which is an interval attribute (see above). First you must set the fill type using the Single tab. In the Properties window, select the Single tab, and click on the rectangular icon for polygon symbolization.

 

The Symbol window for polygons will then popup. Change the Style to Solid Fill, as shown below.

 

Remember to click the OK button in the Symbol window, and the Apply button in the Properties window. Then click the Classes tab in the Properties window.

 

By default DIVA-GIS suggests 3 classes and a predefined color scheme that starts with light yellow and ends with medium blue. From the attribute table DIVA-GIS also calculates class breaks and puts them in the Properties window. If you just click the Reset Legend button, DIVA-GIS will symbolize the countries in the databases using these default settings. Click the Apply button to see the result in the Data View. The Classes alternative for symbolization can only be used for symbolizing numerical data, i.e. data that represent interval or ratio attributes. You can check that out by clicking the drop down menu for Numeric Field, only those fields in the database that contain attributes with numerical value will show up.

 

Select the field GLASOD_Z, representing interval data on countrywide land degradation for symbolizing the countries included in the database. The higher the value of GLASOD_Z, the more severe is the land degradation. In the example below the symbolization is set to six classes, and DIVA-GIS automatically finds the natural breaks in the field to set the classes. The color scheme is set to start with light yellow and end with dark red. Then also the Label was changed to reflect the symbolization (at the top of the Properties window). Some countries lack values for GLASOD_Z (including Mauritania), and to exclude these countries from the legend you can set the color for values around 0 to white, as in the example below (you must enter a small number larger than 0 for the class range for white).

You must press the Reset Legend to apply the changes in the Properties window and the Data View.

 

The resulting map then looks like the example below. Note how the Legend label for the country layer also changed – in the example to Land degradation score.

 

More advanced GIS software can use different classification methods for grouping numerical data, including equal values, quartiles and standard deviation. Classifying data is a way to compress information and make map easier to read and interpret. But at the same time some information is lost.

  1. Map to image 
If you want to save a Data View and its symbolization for use in a another document (e.g. word or powerpoint) you can easily create an image file, either by clicking the Map to Image button,
, or via the menu: Map – Map to Image. A pop up window will allow you to set the output resolution, and then you can export both your Data view and your legend. You can also choose to export to a file, or directly to the windows clipboard. With the latter alternative you can directly paste the image into a word document by using the paste function in word (or Ctrl-v).
 
 

Remember to save the project before finishing the lesson

Try it on your own – Symbolize soil/geology map and export map and legend

The dataset contains layers with soil and geological data as given in the table below.

Data layer

Folder

File

Soil

\data_spatial\sahel\mapdata\soil

sahel_afscntl

Geology

\data_spatial\sahel\mapdata\geology

sahel_geo2_7g

Geological provinces

\data_spatial\sahel\mapdata\geology

sahel_prov2_7g

You will find both vector files (*.shp) and symbolized images (*.jpg) for each of the above themes. Select either the soil map or the geological map (not the geological provinces map) and add it to your DIVA-GIS project. Open the attribute table for the layer you selected, and find the best field for symbolizing your data. Symbolize the data, preferably using the same symbolization as in the associated image file. To find the correct symbol associated with the correct class you can either use the Identify tool in DIVA-GIS (put the jpg image on top of the shape layer, make the shape layer the active layer and then use the Identify tool to see which color goes with which feature class), or better, look in the metadata on the project CD (linked via the file name in the table above if you use the electronic version of this document). When the map is ready you should use the Map to Image tool in DIVA-GIS to export both the map and the legend, and paste them together in a word document (or other windows application). Below you see the soil map symbolized using DIVA-GIS, exported to the clipboard and then pasted into the document.

 

Soil map of West Africa

 

Map made for West African Drylands project

UNEP/ICRAF

Thomas Gumbricht, 2008