Step 3: Importing Excel file to IDRISI

advertisement
World Food Programme
Southern Africa regional Office
A Guide to Mapping Selected Food Security Indicators
For
Vulnerability Analysis and Mapping
Prepared by:
Dr. Mahadevan Ramachandran
In Collaboration with the VAM Regional Office
March 1998
Maputo, Mozambique
Table of Content
1. Use of Vegetation Index data (NDVI) .................................................................................................. 1
1.1 Monthly Composite NDVI ........................................................................................................... 1
1.2 Creating Window .......................................................................................................................... 2
1.3 Difference between current month and long term average vegetation .................................... 2
1.4 Create Colour Scheme .................................................................................................................. 3
1.5 Growing season synoptic image ................................................................................................... 3
1.6 Note on Co-ordinate System: ....................................................................................................... 5
1.7 Export to Word Document as bitmap file ................................................................................... 6
1.8 Extracting vegetation information by political boundary. ........................................................ 6
1.9 Steps for IDRISI – EXCEL Conversion ..................................................................................... 8
2. Mapping Food Production Data ......................................................................................................... 10
Step 1: Prepare Your Database ....................................................................................................... 10
Step 2: Exporting Excel file to IDRISI ............................................................................................ 10
Step 3: Importing Excel file to IDRISI............................................................................................ 11
Step 4: Mapping Database ............................................................................................................... 11
Step 5: Desired Classes of Food Availability .................................................................................. 11
3. Mapping Livestock Data at district level ............................................................................................ 13
Step 1: Prepare Your Database ....................................................................................................... 13
Step 2: Exporting Database file ....................................................................................................... 13
Step 3: Importing Database file to IDRISI ..................................................................................... 13
Step 4: Mapping Database in IDRISI ............................................................................................. 13
Step 5: Desired Intervals (Classes) of Mapped Information ......................................................... 14
4. Mapping point data: Price and health centre data mapping ................................................................ 15
Step 1: Prepare Database ................................................................................................................. 15
Step 2: Exporting Data ..................................................................................................................... 15
Step 3: Importing Database file ....................................................................................................... 15
Step 4: Mapping point data: Now you have a vector file of market locations ............................. 16
5. Food Systems Approach ..................................................................................................................... 18
5.1 The Concept ................................................................................................................................ 18
5.1 Database and Layer Information requirement ........................................................................ 18
5.2 Procedures to Map different layers........................................................................................... 18
6. Flood Risk Mapping ........................................................................................................................... 24
6.1 General Guide ............................................................................................................................. 24
6.2 Zambezi River Flood Risk Analysis .......................................................................................... 27
6.3 Vector/ raster transformation ................................................................................................... 29
6.3 Combining Lines and polygons in MapInfo ............................................................................. 29
6.4 Procedures for Importing Tables (data) to MapInfo ............................................................... 31
7. IDRISI-MAPINFO STEP BY STEP CONVERSION PROCEDURE ............................................... 31
7.1 IDRISI TO MAPINFO ............................................................................................................... 32
7.2 MapInfo to IDRISI ..................................................................................................................... 34
8. General Guide: Area, Extract, formatting ........................................................................................... 35
8.1 Changing the legend: .................................................................................................................. 35
8.2 How to put Text into an image .................................................................................................. 35
8.3 Reclass ......................................................................................................................................... 36
9. Notes for Access to and from GIS ...................................................................................................... 39
9.1 Access—IDRISI—Access ............................................................................................................ 39
9.2 To MapInfo................................................................................................................................... 40
9.3 Notes on Plotting Point Data in GIS ......................................................................................... 41
2
Lab/Lecture Notes:
Stepwise Guide to Mapping Selected Food Security Indicators
1. Use of Vegetation Index data (NDVI)
OBJECTIVES:
Use Vegetation Index data for identifying vegetation performance.
 Simple difference - compare current vegetation data against long term normal for
six months of the predominant growing season in Southern Africa (Nov - Apr)
 Creating a composite image at the end of the season to show possible areas of
normal and below normal vegetation
 Extract information at administrative level (average vegetation for each
district/province) and graphing specific districts monthly vegetation difference in
Excel
Dekadal (10 day) images




Original raw NDVI data will be provided to you on a dekadal (10 day) basis or
monthly basis.
DISPLAY
NOV191 image file (this is the first 10 days of November 1991 vegetation)
Use CURSOR ENQUIRY (?) to get a sense of values
Most of our analysis will be on a monthly basis (month vegetation minus month
normal)
1.1 Monthly Composite NDVI
We need to take three 10-day images for the month and make them into one image
representing the whole month. Run -- ANALYSIS/CHANGE AND TIME SERIES/NDVICOMP

Maximum value

Number of image - 3

Enter the names of 3 images - NOV191 NOV291 NOV391

Output image - NOV91M

Title: November 1991 Maximum Value Composite Image
 DISPLAY NOV91M image.


Check values across the image.
Add Layer – COUNTRYH
1
1.2 Creating Window
Now we will subtract the long-term normal image from the current image, which in
this case is November of 1991 vegetation index. The long-term images have been
created for you from 14 years of Vegetation Index data for each month.
Before we do that, let us just window out the southern African region for our analysis.
The long-term average images have already been windowed out for you, and you will
now window the November 1991 monthly image using the same window size as the
long-term normal images. RUN -- REFORMAT/WINDOW

Input image: NOV91M

Output image: SNOV91M

Click on the “existing windowed image” option

Existing windowed image: SNOVAV14
1.3 Difference between current month and long term average vegetation
 ANALYSIS/DATABASE QUERY/OVERLAY

First image: SNOV91M

Second image: SNOVAV14

Output image: SNOV91DF

Click on “first-second” option

Title: November 1991 - November 14 year mean
 DISPLAY SNOV91DF image and check values across the image.
The negative values represent the areas where vegetation was below normal for
January of 1992 and the positive areas, where it was above normal. Based on earlier
research, negative values of below -15 are considered to be showing much below
normal vegetation. These might be the areas where crops might be doing badly. RUN
 Run ANALYSIS/DATABASE QUERY/RECLASS on SNOV91DF

Output image: SNOV91DR

Title: Vegetation Departures - November 1991

Assigning new values (as shown in the table)
Assign a new
value of
0
1
2
3
to all values
from
0
-256
-15
1
to
just
less than
1
-15
0
256
comments
background
much below normal
below normal
normal to above
normal
2
1.4 Create Colour Scheme
The output image now only has three classes showing much below normal, below
normal, and normal to above normal vegetation. We need to do two things with
this image. One is to create a colour scheme/palette that will allow us to express
the three classes intuitively. The other is to give legend names for the three
classes. OPEN / RUN -- DISPLAY/PALETTE WORKSHOP
Make the colour associated with zero, white (background), associated with
1 (which is reclassified value for old values ranging from -256 to -15) as
dark red, 2 as yellow, and 3 green. Save the palette file as VIDIF3 and quit.




DOCUMENT (under FILE menu) and enter the name of the reclassified
image (SNOV91DR)
.
Click on Legend Categories : 0 - non-study area, 1 - much below normal, 2
- below normal, and on 3 - normal/above normal.
DISPLAY SNOV91DR and choose the palette file you created VIDIF3.
Ask to display legend and title.
Add Layer Country boundary file; COUNTRYH
This image should give you an idea of likely areas of poor vegetation in November
of 1991. Now we will do a similar analysis with December 1991 data. We have
SDEC91M (monthly December 1991 composite image) and SDECAV14 images as
initial inputs to start with. Practice creating the December vegetation departure
output image.
This process would have be repeated for six months of the growing season
(November 1991 to April of 1992 in our case). In actual work, it would be good to
print out each monthly vegetation departure image and look at them visually across
the season. For the purpose of this training, the six vegetation departure images for
the 1991/92 season is given to you. On the final day of the training, provided we
have time, we will do the above analysis for data from November of 1997 to
February of 1998 to get an idea of the current growing season across Southern
Africa.
1.5 Growing season synoptic image
The next set of steps will go into the creation of one composite image
representing the overall season’s performance. There are many ways of
representing the status of a season. The one we use here is meant to be an
intuitive example rather than the scientifically most rigorous.
From the steps mentioned above we have six difference images that show us each
months vegetation departures in three categories (much below normal, below
normal, normal to above normal). The next step of steps will basically calculate a
3
final output image that will show the “number of months of much below normal”
vegetation during the six months of the growing season. Higher the number of
months, more likely it is that the area suffered from crop losses. To do this RUN - ANALYSIS/DATABASE QUERY/RECLASS
 Input image: SNOV91DF
 Output image: SNOV91MB
 Title: Areas of much below normal vegetation in November of
1991
 Assign values as shown in the table
Assign a new
value of
1
To all
from
-256
0
-15
values
to just less
than
-15
256
comments
much below
normal
Other values
The above Reclass module would give you a boolean image (an image of just
zeroes and ones) showing only areas of much below normal vegetation. Re-do the
same RECLASS steps for Dec 91, Jan 92, Feb 92, Mar 92, and Apr 92 using the
same reclass levels given above. Now we have six boolean images that show for
each month in the growing season, areas of much below normal vegetation.
Now we will run a module that will count the number of months of much below
normal vegetation within the growing season for each pixel in the image. RUN -- COUNT and specify the number of input images as 6.
 Enter SNOV91MB as image 1, SDEC91MB as image 2,
SJAN92MB as image 3, SFEB92MB as image 4, SMAR92MB as
image 5, and SAPR92MB as image 6.
 Output image: PROP92MB
 Title: Proportion of the growing season months that show much
below normal vegetation
 Count outputs an image that shows for each pixel, the proportion of
months that show much below normal. For example, if a pixel had
2 months out of 6 where it had much below normal value, the pixel
value in the COUNT module output would be .33 (2/6). If a pixel
had 5 out of 6 months of much below normal, then the count output
would be 0.8333 (5/6). We will now reclass this output image into
three classes to form a much more easy to read final output
composit image for the growing season.
 RECLASS on PROP92MB
 Output image: MBN9192
 Title: Number of months of much below mean vegetation (Nov
91 - Apr 92)
 Assign values as in the table
4
Assign a
value of
0
1
new
to all values
from
0
0.01
to just
than
0.01
0.17
2
0.17
0.49
3
0.49
1.1
less
comments
background
1 month much below normal vegetation
(slight to no crop damage)
2-3 months of much below normal
vegetation (possible heavy crop loss)
4-6 months of much below normal
vegetation (possible severe crop loss)
 Palette workshop: Use the palette workshop to create a palette where the
number ones gets a colour like blue, number two gets a colour like yellow, and
number three red. This image along with the six monthly images would
provide a very good synopsis of the growing season. Please note, that if for
example, the ground level information suggests that four months (say, DecMar) are the most crucial, then the same analysis (counting number of months
of below normal) could be run with four images only.
1.6 Note on Co-ordinate System:
1. Now we have two outputs: one is the set of six images showing vegetation
departures for each month and the other a synoptic image showing the
overall nature of the growing season. We might want to add layers (like
political boundaries, roads, market locations, EDP locations, etc.) on to
these images to get a better idea about the areas affected.
2. Most vector layers (like roads, rivers, boundaries, points, etc.) are files that
are in latitude/longitude co-ordinates. The NDVI data is processed in
another co-ordinate system called the Hammer-Aitoff system. We might
need to convert the vector layers into hammer-aitoff (from lat/long) or we
would need to convert the final output and the six month negative
departures images into latitude/longitude co-ordinates in order to use it
with some of the vector layers. It is easier to convert the vector layers
(political boundaries, roads, etc.) to hammer-aitoff. In the following step,
we will convert one vector file. The rest of the files can be done similarly.
You might also have vector layer data in Map-Info format in which case,
please refer to the notes from the earlier section which covered the issue of
converting these files to Idrisi vector format. To do this RUN the
following:
 REFORMAT/PROJECT and click on vector.
 Input file: COUNTRY
 Input reference files: This should fill automatically to lat/long
 Output file: COUNTRYH
 Output reference file: CLABSHA (stands for Clark Labs
Hammer-Aitoff)
5


Click ok and you will have the output file (countryh) in
hammer-aitoff format, ready to be used (by doing add layer
when you are viewing the NDVI departure image) with your
NDVI data.
We could also quickly practice by converting another layer
called SAFROAD.
If you want to convert the NDVI output image to lat/long from HammerAitoff (called Clabsha);
 REFORMAT/PROJECT.
 Select the input image name, the input reference file (should be
automatic), and the output image name and reference file.
 Click on continue and take the rows/columns/min x/max x/min
y/max y as suggested by the software.
 If you want to know more about how to change the parameters,
please read the help system on PROJECT.
1.7 Export to Word Document as bitmap file
Once we have the output NDVI departure images and the associated vector
files overlaid on them, we might want to take this image to a word
document and write text around it explaining the image and what the
output means. When you have the image displayed and the vector layers on
it and exactly the way you would like it in the word document;
 Save Composition in the composer box
 Take the option “screen dump map window as BMP file”
 Give it an output name.
 Now you can just go to your word document, do “insert
picture” and import this.
 We will test this with one of our outputs during the training
program.
1.8 Extracting vegetation information by political boundary.
1. Sometimes, you might want to extract vegetation departure values by
Provinces or at least for some specific districts. Basically to do any
operation that involves two images, the images have to be the same size (in
terms of rows/columns and min and max values). Hence, to extract the
statistics (say average vegetation) for a district, the district image has to be
in raster and also the same size in rows and columns. For the sake of this
exercise, we will do one district in Zambia. All of the NDVI images we
have been working with are for the whole region of southern Africa. Even
though the Zambia district data will only be a part of it, the rows and
columns and X and Y would still have to match the whole southern Africa
NDVI image. When each country office does its analysis, it can use the
6
earlier WINDOW command to only window out its country of interest area
from the region-wide or Africa-wide NDVI image.
2. From the earlier set of analysis, we have six monthly departure images
(month NDVI value minus long term monthly normal) called SNOV91DF,
SDEC91DF, …, SAPR91DF. We could extract the district level averages
of the departures and take them to an MS-Excel file to graph them out.
Keep in mind that departures below “-15” are usually indicative of severe
vegetation loss areas. We have a vector file of Zambia districts, which we
need to rasterize to the same dimensions of the NDVI southern Africa
images. RUN -- DATA ENTRY/INITIAL
 Output image: ZAMDISTC
 Image to copy parameters from: SNOV91DF (note all southern
Africa
 NDVI images have the same dimensions, so we can choose any
of them to copy parameters from). Say SNOVAV14
 Click OK.
 REFORMAT/Raster-Vector Conversion/POLYRAS
 Vector polygon file: ZAMDISTC
 Image file to be updated: ZAMDISTC
 Click OK.
Now we have the all the districts in Zambia in raster form ready to be used with the
NDVI images. The simplest visual way to check departures is to create a group file
within Idrisi listing all the six departure images and the district image. Then, when
you click on a district with your cursor inquiry, you will get a box with values from
all the six months. To do this RUN -- EDIT and choose the “Image Group File” option
 File name: MONTHDEP
 Click OK.
 Then choose the six monthly departure images (SNOV91DF,
SDEC91DF, ….., SAPR92DF) and the ZAMDISTC image and
“add” them to the group file, one by one.
 DISPLAY ZAMDISTC and
 use the cursor inquiry option to check the NDVI monthly
departures on the box next to the image.
 You can actually do a screen capture (Fn-Prt Scr) on your
computer and open PAINT software (free software with
Windows) and do a
 EDIT/PASTE to look at the whole screen dump. Then you can
actually draw an arrow from the district that you had your
cursor inquiry button,
7


window out everything else except the image and the departures
values box and save it as a bitmap file.
The way you would window out would be to use the
EDIT/CUT option in PAINT and only cut out the image and the
values box. Then you would open a new image (do not save the
earlier image) and do another EDIT/PASTE. Now you can save
this as a bitmap file and take it to your word document.
1.9 Steps for IDRISI – EXCEL Conversion
1. The more organised way of doing this would be to calculate average
departures for each district and take them to Excel. Then you could
graph out the districts of your choice and put in a Word document or
print out the graph directly. The steps for Idrisi-Excel conversion are as
follows. RUN - ANALYSIS/DATABASE QUERY/EXTRACT
 Feature definition image: ZAMDISTC
 Image to be processed: SNOV91DF
 Click on the “Average” option
 Output type, Values file: DNOV91DF
2. Do a similar operation for six monthly departure images. Now you will
have six values file which are basically two columns (first column;
district id, second column; average departures) of text showing the
departures for each district.







Open EXCEL and use the FILE/OPEN option
Go to the directory where the files are and type in DNOV91DF.VAL.
You will get a “Text Import Wizard” dialox box open automatically in
excel
Click on “next” and click on “space” as your delimiter.
Click on “next” and “finish” and you will now have a two column excel
file showing district ids on the left and vegetation monthly departures for
November on the right.
Do a similar operation and bring in DDEC91DF.VAL, DJAN92DF.VAL,
…., DAPR92DF.VAL.
You will now have six excel files open. Do a EDIT/COPY of the second
column of DDEC91DF and paste it to the third column on DNOV91DF.
Do January in the fourth column and so on till April. We now have six
monthly departure values across the excel table for six districts. Now we
can graph out whichever district we want in Zambia for NDVI departures
in 1991/92 growing season.
3. Examples: Let us take the district of Choma. This has an ID of 78. If you
shade the six monthly values across the id 78 and then click on graph
wizard icon, then INSERT/CHART/AS NEW SHEET. Click on “next”
and you will be prompted for a series of option on how you want to graph
8
this out. Go through, choose “Column” option, “next”, then number “6”.
Then click on next, look at the preview and click next again. Put in the title
as “Choma District”, the X axis as “Months” and the Y axis as “NDVI
departures”. Remember that departure values of under -15 are indicative of
severe crop loss areas. Similar graphs for other districts of interest could be
done.
4. Summary and Notes: The Choma district graph gives a very good
representation of the severity of the 1991/92 drought in that area. If you do
it for other years, you may not find such a convincing graph. You may see
one or two months showing much below normal, in which case it needs to
be related to local knowledge on critical crop growth periods to see if the
vegetation departure would have an adverse effect on crop production or
not.
The above set of analysis resulted in three major outputs:



Monthly images showing vegetation departures
One synoptic image to represent the status of the entire growing season
District/political boundary level graphs showing vegetation departures
on a monthly basis.
9
2. Mapping Food Production Data
The next set of analysis would look at the mapping of food production tables
on to district level maps. The analysis would convert the food production into
calories (supply calories), and divide the sum total by the population’s annual
demand calories and calculate the number of months of food availability in
each district.
Objectives:
1) To map out district level food availability in months based on production
and population
Step 1: Prepare Your Database
Here we only show you an example of a database. Use MS-Excel to open
and view the file called MOZKCAL.XLS. This file shows the production
of major cereals in each district in Mozambique. These were then
converted to supply calories (convert each crop into calorie equivalent and
add up all the cereals production). The total of KCAL is then divided by
total annual demand of population of each district (demand based on three
thresholds -- 1700 calories per day, 2200 calories, and 3050 calories).
Based on the demand and supply calories, we could now calculate the
number of months of production available in each district. Please refer to
Dr Getachew Diriba (VAM, UN-WFP, Maputo, Mozambique) for further
information on creating the excel spreadsheet and the calorie conversions.
Step 2: Exporting Excel file to IDRISI
We now need to bring this database into Idrisi and link it to a map of
Mozambique districts. This would allow us to map the number of months
of food availability for each district.
We need to make slight alterations to the excel spreadsheet so as to make it
compatible to Idrisi. We first need to convert each column heading to one
line and that too within 8 characters. Then we need to make sure that there
are no duplicate names (two columns with same name). Once we make the
necessary changes, basically all that should remain is the first line 8character name of the column and the data in numbers immediately
following it. THEN
 FILE/SAVE AS
 click on the save as type and
 choose the DBF 4 (dBASE IV) option.
 Call the output file MOZFOOD and click OK.
 Close Excel and open Idrisi for windows.
10
Step 3: Importing Excel file to IDRISI
 DATA ENTRY/DATABASE WORKSHOP
 FILE/CONVERT XBASE TO ACCESS.
 Select an input file: Click on MOZFOOD
 Output file name: MOZFDAVL
 Click OK and it will give a warning message that there are
fields of non-integer type, etc.
 Click OK to ignore that.
Step 4: Mapping Database
Now you will have the data base converted to Idrisi format. If you look at
the database, you can see the district names, ids, production of each crop,
population, etc.
 MODIFY/ADD FIELD and choose the Integer (2 Byte) option
 Name of the field: IDR_ID and click OK.
 You now have a new field with no values in it
 Click on += icon and type in the following after SET
 idr_id = idrisi (the field from excel that contains the idrisi id’s)
 then do the MODIFYADD FIELD again and this time choose
the Real (4 Byte)
 Name of the field: FDAV1700 and click ok
 Then click on the += icon again and type after SET
 FDAV1700 = AVMO1700 (the number of months of food
availability under the 1700 calorie per day assumption).
 And click OK.
 LINK/Assign Field Values to Image
 Feature definition image: MOZDIST (the district image with
the same ID values as those of the districts in the data base).
 Name of output image: AVMO1700
 Feature definition field: IDR_ID
 A data field from current database: FDAV1700 and
 click OK.
Step 5: Desired Classes of Food Availability
Now you will have an image showing number of months of food
availability. We will reclassify this into lesser number of categories to
understand the output better.
 DATABASE QUERY/RECLASS
 Input file: AVMO1700
 Output file: AVMO17RC
 Title: Number of Months of Food Availability
 Reclass
11
Assign
a
new value of
0
1
2
to all values
from
0
.5
6
to just less
than
.5
6
12
3
4
12
18
18
99
comments
background
Less than six months of food availability
Between six to twelve months food
availability
12-18 months of food availability
greater than 18 months of food availability
The output image will now give a very good idea of surplus and deficit
producing regions. It would be of interest to combine this with other forms
of data such as livestock ownership, access to markets, etc. to get an idea
of the vulnerability of population in deficit production areas.
12
3. Mapping Livestock Data at district level
The next set of steps will go into mapping livestock ownership at district level.
The steps are applicable to any variable that is available in the form of district
level data (for example, WFP assessment visited areas, population under 5,
average land holding, etc.)
Objective
1) To map out district level data on livestock. Specifically total number of cows
per thousand families
Step 1: Prepare Your Database
This has already been done for you. Just Open Excel and Click on
File/Open LIVESTOK.XLS. This gives you the table of livestock in
Mozambique. We will for this exercise, only map out total number of cows
per 1000 families in each district. The calculations have already been done
and the column COWPTHF has the values for cows per thousand families
in each district. The data as it stands now is incomplete, but we will map
out the data for districts where it is available.
Step 2: Exporting Database file

FILE/SAVE AS and click on the save as type and choose the DBF 4
(dBASE IV) option. Call the output file MOZLS and click OK. Close
Excel and open Idrisi for windows.
Step 3: Importing Database file to IDRISI
 DATA ENTRY/DATABASE WORKSHOP
 FILE/CONVERT XBASE TO ACCESS.
 Select an input file: Click on MOZLS
 Output file name: MZLSTOK
 Click OK and it will give a warning message that there are
fields of non-integer type, etc.
 Click OK to ignore that.
Step 4: Mapping Database in IDRISI
Now you will have the data base converted to Idrisi format. If you look at
the database, you can see the district names, ids, different livestock
numbers, number of families, etc.
 MODIFY/ADD FIELD and choose the Integer (2 Byte) option
 Name of the field: IDR_ID and click OK.
 You now have a new field with no values in it
 Click on += icon and type in the following after SET
13











idr_id = idrisi (the field from excel that contains the idrisi id’s)
then do the MODIFYADD FIELD again and this time choose
the Real (4 Byte)
Name of the field: TOTCOWS and click ok
Then click on the += icon again and type after SET
TOTCOWS = COWPTHF (number of cows per thousand
families). And click OK.
LINK/Assign Field Values to Image
Feature definition image: MOZDIST (the district image with
same ID values as those of the districts in the data base).
Name of output image: COWPTHF
Feature definition field: IDR_ID
A data field from current database: TOTCOWS and
click OK.
Step 5: Desired Intervals (Classes) of Mapped Information
Now you will have an image showing number of months of food
availability. We will reclassify this into lesser number of categories to
understand the output better.
 DATABASE QUERY/RECLASS
 Input file: COWPTHF
 Output file: COWPTHFR
 Title: Number of Cows per Thousand Families
 Reclass
Assign
a
new value of
0
1
to all values
from
0
.5
to just
than
.5
10
2
3
4
10
100
500
100
500
9999
less
comments
background/no data
Less than 10 cows per thousand
families
Between 10-100 cows
Between 100-500 cows
Greater than 500 cows
The output image will now give an
idea of the livestock ownership
among the population. As you can
see, the data is incomplete in a lot of
districts in the North. Any data
collected at district level in a country
can be mapped out by a similar
process as to the one we used for
mapping food production and total
number of cows.
14
4. Mapping point data: Price and health centre data mapping
The above two exercises (food production and cows) mapped out databases
that are linked to polygons such as districts. The next two examples will deal
with point data mapping. Price data though somewhat inconsistent across
countries, is a very valuable source of food security information. It would be
interesting to map out the points in terms of their price levels and changes if
the data is available. It would also be very interesting to visually compare the
price changes and the vegetation departures that we calculated before. If we
find an area where the vegetation is showing poor crop conditions and the
prices increase significantly, then we would need to be concerned about the
food security of these areas.
Objective
1) To create a point file showing price changes in percentage across major
markets in Mozambique.
Step 1: Prepare Database
We have data on 23 markets in Mozambique for which we have price data
from 1991 to current on a weekly basis. We will just map out the changes in
price between October of 1997 and December of 1997. Most of the
manipulation of the data is in Excel or a data base and this exercise will cover
the final step of mapping it out a set of points with some attribute information
(in our case attribute information refers to price changes at each of those
points).

Go to Excel File/Open XYZMKTS.XLS. As you can see this contains the
latitude and longitude co-ordinates of the 24 markets for which we have
price data on Mozambique along with their id’s and names.
Step 2: Exporting Data
We need to export this to Idrisi and map the points. Then we can add
information to the points to reflect actual prices or price changes.
 In Excel, delete the lat/long/id/names row. Also delete the column with
the names
 Then do File/Save as;
 File type: Text[tab delimited] and name it as XYZMKTS
 Exit Excel
The basic idea is to create a clean text file only with the three columns
showing lat, long, and id’s. Nothing else should be there.
Step 3: Importing Database file
15
 Go to Idrisi and Click on File/Import/Export option
 Import/Software specific options and choose the module XYZIDRIS
 Input ascii file with extension: XYZMKTS.TXT
 Output idrisi vector file: XYZMKTS
 Reference system: Lat/long
 Reference units: degrees
 Title: “Market Locations” and
 click OK.
Step 4: Mapping point data: Now you have a vector file of market locations
 Analysis/Database Query/Database workshop
 File/Create Vector text layer
 Name of vector point file: XYZMKTS
 Name for output vector file and associated database:
PRCCHNG
 Click ok and you will get all the 24 vector id with 0’s next to
them for symbol
 The symbol number with 0’s is for specific font size, font type,
bold, etc. information. For the sake of this exercise, we will fill
these two columns as follows;
IDR_ID
pricchngSYM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
pricchngTEXT
139
137
119
111
118
100
No data
128
120
No data
217
166
140
No data
183
No data
166
160
No data
133
166
140
No data
233
16
The figures in the 3rd column represent the December 1997 prices in these
24 markets as a percentage of September 1997 prices.

After you enter the numbers, save and exit.
 DISPLAY MOZPROV vector file
 Add Layer: XYZMKTS
 Add Layer: PRCCHNG
Now you will have a map showing price change percentage across the whole
country.
17
5. Food Systems Approach
5.1 The Concept
The food systems is a concept of identifying relatively homogeneous areas
of economic activity that will result in reasonably similar coping
mechanisms and exposure to risk factors. This system is essentially a form
of baseline map that combines a variety of indicators (like agro-ecological
zones (high lands, low and midlands, cropland use), river basin, coastal
areas, arid lands, etc.) (see Diriba 1991 & 1995). The basic idea is that a
drought problem within a country would have different manifestations in
terms of vulnerability depending on which food systems it happens to be
affecting. These systems should be used along with seasonal indicators
such as vegetation loss, price changes, food production, etc.
There is an understanding though that each country’s food system needs to
be thought out differently and the level of complexity (in terms of divisions
within the country) needs to traded off with availability of data and
analytical support.
Objective
1) To create a map of relatively homogeneous economic/physical activity zones
5.1 Database and Layer Information requirement
We will once again use the example of Mozambique to develop a first-cut
food system across the whole country.
The six basic systems that will be created are as follows;
1) River basin area
2) Semi-arid/arid lands
3) Coastal area
4) Lowlands
5) Midlands
6) Highlands
5.2 Procedures to Map different layers
To create the above six, we need the following base layers;
Map of rivers
Map of arid-lands based on local knowledge and NDVI long term data
Map of the coastline
Elevation data
18
Procedure 1: We will first look at creating the river basin areas
 DISPLAY the image MAJRIVER (major rivers in Mozambique)1.
 DISTANCE on this image (this will take some time because of the size of
the image).
 Input file: MAJRIVER
 Output file: RIVDIST
 Then Run ANALAYSIS/DATABASE QUERY
 Input file: RIVDIST
 Output file: RIVDIS10
 Reclass as follows
Assign a new
value of
1
to all values
from
0
to just less
than
0.15
0
0.15
999
comments
areas within 10-15 kms of a major river.
The distance is calculated in degrees where
one degree approximately works out to 100
kms
areas greater than 15 kms from river
Procedure 2: Now we will create the semi-arid land classification.
This has already been created for you based on two things; One is the local
knowledge of the traditionally semi-arid areas and the other is using the long
term variation in vegetation2.
 DISPLAY the image ARID
Procedure 3: Combine images (rivers and aridlands):
We will now combine this with the river basins image to get two classes
 EDIT and
 type in a new file name called ARID2
 In the blank edit box, type in just 1 2 (space in between 1 and 2,
this basically will help assign an ID of 2 to all the semi-arid areas)
 Run ASSIGN
 Feature definition image: ARID
 Attribute values file: ARID2
 Output image: ARID2
 Run CROSSTAB
 First image: RIVBAS10
 Second image: ARID2
1
An entire rivers layer of Mozambique was taken and the major rivers were visually identified. Each rivers had a separate ID
which we then reclassed to take only those ID’s that belonged to major rivers.
2
Arid lands were created based on two things; One was the Variation in Vegetation values over the last 15 years and the other
was the local knowledge of experts. These two were taken and using on-screen digitizing (refer earlier training notes on IDRISI
on-screen digitizing) areas belonging to the arid/semi-arid lands were delineated.
19
 Output cross classification image: TEMP
 Run RECLASS on the TEMP input image and
 call the output TEMPRVAR
 Reclass as follows
Assign a new
value of
0
1
2
1
To all
from
0
2
3
4
values
to just less
than
2
3
4
5
comments
background
River basins
Arid land
where there is a conflict, 1:2, id 1
which is river basin dominates
Now you have an image that has an ID of 1 for river basin areas and ID of 2
for arid lands.
Procedure 4: create a coastal zone map based on the coastline and the
distance from it.
 DISPLAY COASTLN3 image. This is the coast line of Mozambique
 Run DISTANCE
 Input image: COASTLN
 Output image: TMPCDIS
The distance image calculates for both sides of the coastline.
Procedure 5: Masking
We will now need to mask out non-land areas in Mozambique and only have
areas close to coast within the country.
 OVERLAY and choose the multiplication option
 First image: TMPCDIS Second Image: MOZMASK
 Output image: COASDIST
Procedure 6:
We now need to run a reclass operation to assign all areas within 40 kms of the
coast as belonging to the coastal food system.
 RECLASS with COASDIST as the input image
 Call the output image: COAST3
 Reclass as follows;
3
The coast line image was created using a technique called edge-enhancement filter process. The easier way to do this would be
take an NDVI image which has values for all of land and zero for the oceans and reclassify the oceans to have a value of 1 and
everything else zeroes (use edit/assign to do this). Then run DISTANCE from this new image which would give you distance
values from the oceans (because they are the only non-zero values in the image) and then you can use the reclass option to get
areas only within 40 kms of the ocean.
20
Assign a new value
of
3
To all values
from
0
to just less
than
0.40
0
0.40
999
comments
areas within 40 kms of the coast.
The distance is calculated in
degrees where one degree
approximately works out to 100
kms
areas greater than 40 kms from
coast
Procedure 7:
 Run Analysis\DBQ\Overlay:
 1st image:
coast3,
nd
 2 image:
Mozmask,
 output image:
coast33
Procedure 8
We assign a value of three to the areas within 40 kms of the coast so as to be
able to run CROSSTAB again with the earlier image (TEMP with 1 as river
basin and 2 as arid)
 Run CROSSTAB
 First image: TEMP
 Second image: COAST3
 Output cross classification image: TEMP1
 Run RECLASS on the TEMP1 input image and call the output TEMPRAC
 Reclass as follows

Assign a
value of
0
1
2
3
1
3
new
to all values
from
0
2
3
4
5
to just less
than
2
3
4
5
6
6
7
comments
background
River basins
Arid land
Coastal zone
where there is a conflict, 1:3, id 1
which is river basin dominates over
id 3 which is coastal zone
where there is a conflict, 2:3, id 3
which is coastal zone dominates
over id 2 which is arid lands
Now you have an image that has an ID of 1 for river basin areas, ID of 2 for
arid lands and ID of 3 for coastal zones.
Procedure 9: Create Lowlands, midlands & Highlands
21
 Reclass: We will now create a map of three elevation classes; one from 0200 meters (lowlands), 200-1000 meters (plan alto midlands) and > 1000
meters (highlands).
 We will give them id’s of 4, 5, and 6 respectively and
 DISPLAY ELEVMOZ and use the cursor inquiry option to check out the
values.
 Run RECLASS with ELEVMOZ as the input image
 Output image: ELEV45
 Reclass as follows;
Assign a new value of
0
4
5
6
to all
from
0
1
200
1000
values
to
just
less than
1
200
1000
9999
comments
Oceans
Lowlands
Plan alto midlands
Plan alto highlands
Procedure 10: Combine….
 Run CROSSTAB with TEMPRAC as the first image and ELEV45 as the second
image. Call the output image TEMP2.
 Display TEMP2 and choose to display legends along with the image. Check the
different legend categories (note id 1-riverbasins, id 2-arid, id 3- coasts id 4lowlands, id 5-midlands, and id 6-highlands).
 Run EDIT/ASSIGN operation to assign new id’s to the 15 categories output by the
cross tab operation to get our essential 6 classes in food systems.
 Run EDIT and ask to create a file called FSYST
 In the blank box enter as follows; (the text within parenthesis are
just comments and not to be entered in the edit box)
1 0 (background)
2 1 (river basins)
3 2 (arid lands)
4 3 (coastal zone)
5 4 (lowlands)
6 1 (1:4, in which river basin dominates over lowlands)
7 2 (2:4 in which arid land dominates over lowlands)
8 3 (3:4 in which coasts dominate lowlands)
9 5 (midlands)
10 1 (1:5 in which river basins dominate midlands)
11 2 (2:5 in which arid land dominates midlands)
12 3 (3:5 in which coasts dominate midlands)
13 6 (highlands)
14 1 (1:6 in which river basins dominate highlands)
15 2 (2:6 in which arid lands dominate highlands)
The output image will have six categories indicating six different food systems
within the country.
22
Procedure 10
 Open FILE./DOCUMENT for FOODSYST image and click on legend categories
option. Name the legends as follows
 1 River Basins
 2 Arid Lands
 3 Coastal areas
 4 Lowlands
 5 Midlands
 6 Highlands
 DISPLAY FOODSYST image with FOODSYS6 palette.
Food Systems in Mozambique
23
6. Flood Risk Mapping
6.1 General Guide
In years of excess rainfall, it is important to know areas that lie within the flood zone,
so that appropriate mitigation and relief strategies can be worked out. We have a map
of the major rivers in Mozambique and based on elevation around the rivers, we could
derive the flood risk zones.
Objective
1) To create a map of areas at risk of flooding in Mozambique
Procedure:
 DISPLAY the image called MAJRIVER
This is an image of major rivers across Mozambique.
 DISPLAY the elevation image called ELEVMOZ
This gives you elevation values in meters across the country.
 Use the Cursor Inquiry option to check values across the country
The idea behind the analysis is as follows; we need to find out all areas near to
major rivers that are within a certain flooding level of the river. For example,
if one part of a major river is at an elevation 300 meters and the flood level is 5
meter rise, all areas within 305 meter elevation near this part of the river would
get flooded.
To do this in a GIS, we need to allocate the river elevation values to the nearby
pixels and then subtract that elevation (the nearby area now has the river
elevation) from the actual elevation value. If it is within, say 5 meters, then
that area is under risk of floods.
We first need to create a boolean image of the rivers and then multiply that
with the elevation image to get the river elevation at each pixel.
 RECLASS MAJRIVER
 Input image: MAJRIVER
 Output image: RIVRBOOL
 Reclass as follows;
Assign a new To all values To just less than
value of
ranging from
0
0
1
1
1
999
Comments
Background
All rivers get an id of 1;
boolean image
24
 ANALYSIS/DATABASE QUERY/OVERLAY
 Choose the Multiply option
 First image: RIVRBOOL
 Second image: ELEVMOZ
 Output image: RIVRELEV
Now we have an image of actual elevation of the rivers along their course. We
now will assign each pixel outside the rivers, the elevation value of the part of
the river nearest to it. We need two things for the software to do this. One is a
distance image from the rivers and the other is the actual river image with
elevations for each pixel belonging to rivers.
 Running DISTANCE to this rather large image of Mozambique is a time
consuming process. We already have the output image in our directories.
 DISPLAY RIVRDIST with the idris256 palette.
This shows the distance of each pixel from its nearest river.
 Now we need to use this distance image to allocate all pixels in the image
the elevation value of the nearest river elevation. Once again, running the
module ALLOCATE4 (which allocates each pixel the nearest river
elevation) is a time consuming process. We have provided that image to
you.
 Analysis\ Distance Operators \Distance
Feature Image: ______________ (Zambelv)
Output Image: ______________ (Zambdist)
Value Units: ________________ (none)
Title: ______________________ (none)
 Analysis\ Distance Operators \Allocate
Distance Image: _________ (Zambdist)
Target Image: ___________ (Zambelv)
Output Image: ___________ (Zamballo)
 DISPLAY RIVRALLO image with the idris256 palette. Use the cursor
inquiry option to check the values along the rivers. You can see that there
is an elevation value in each pixel equal to the same elevation as the
nearest river elevation.
We now have river elevations and also the actual elevation. Suppose we had a
flood emergency with an expected rise in river level of 5 meters; we would
4
Extended use of ALLOCATE function: allocate model can be used to calculate distance to school,
health facilities, food distribution points. You could also extract total population from capture zone.
25
expect all the pixels near the river that are less than 5 metre height as
compared to the river height to be flooded.
 Run OVERLAY and choose the subtract option.
 First image: ELEVMOZ
 Second image: RIVRALLO
 Output image: DIFFELEV
Use the cursor inquiry option to check the values across this image. We would
expect all areas under 5 metre difference to get flooded. We also have to
satisfy another condition. Areas that are far away from rivers may not get
flooded. To be really conservative, let’s take the following criteria for
flooding;
a) areas less than 5 metre elevation and
b) within 15 kms of the river.
To satisfy the first criteria, we need to create a boolean image of DIFFELEV
showing areas below 5 meters as one and everything above as zero.
 RECLASS the input image DIFFELEV
 Output image: LOWELEV
 Reclass as follows;
Assign a new To all values To just less Comments
value of
ranging from
than
1
-999
6
Less than 5 meter elevation
from the river elevation
0
6
999
Areas that are higher than 5
meter from river level
The above boolean image satisfies the low elevation boolean criteria (criteria
a)
We have a distance from rivers image. We need to create a boolean of all areas
within 15 kms of the river to satisfy criteria b.

Run RECLASS on the input image RIVRDIST
 Call the output image CLSRIVR
 Reclass as follows;
Assign a new To all values To just
value of
ranging from
than
1
0
0.15
0
0.15
999
less Comments
Distance is calculated in degerees and each
degeree of distance corresponds to
approximately 100 kms. So .15 = 15 kms
Areas greater than 15 kms from the rivers
We now have two boolean images showing low elevations (LOWELEV) and areas
close to rivers (CLSRIVR).
Run OVERLAY and choose the multiply option
26
First image: LOWELEV
Second image: CLSRIVR
Output imge: FLDRISK
This output image gives us flood risk areas in Mozambique.
6.2 Zambezi River Flood Risk Analysis
The objective to analyse flood risk on Zamezi and Shire rivers for 1998 season
 Working director: d:\Moz-GIS3\Zambezi
 Basic Layers: Zambezi/ Mozriver/ Elevmoz
 We need to separate Zambezi river (id 18) and Shire river (id 3) from the rest of
rivers in order to run flood risk analysis for the two rivers. We need to run
Edit/Assign to perform this function.
 Data entry\ Edit
 Filename: Zambezi and then hit OK
 IDRISI Text editor window pops up, type
18=1
3=2, save and exit
 Data entry\assign
 Feature definition image: Mozriver
 Attribute value file: Zambezi
 Output file: Zambezi
 Analysis \DB Querry\overlay
27
 First image: Zambezi
 Second image: elevmoz
 Output image: Zambelv
use MULTIPLY option
 Analysis\distance operators\distance




Feature image: Zambelv
Output image: Zambdist
value units: ----Title: --------
 Analysis\distance operators\Allocate
 Distance image:
 Target image:
 Output image:
Zambdist
Zambelv
Zamballo
 Analysis/DBQ/Overlay
 First image: Zambelv
 Second image Zamball
 Output image: Zambdiff
(use subtract option)
 Analysis\DBQ\Reclass (reclassing Zambezi River Elevation)
 Analysis/DBQ/Reclass
 Input image =
Zambelv
 Output image = Zamblow
1
0
-999=
4
4
999
(assumption 2, 3, 4 meter water rise)
 Analysis\DBQ\Reclass (reclassing Distance from Zambezi River)
Assumption distance from Zambezi river within 10 km from the river
 Input image:
 Output image:
1
0
0
0.10
Zambdist
Zambcls
0.10
999
 Calculating Flood Risk areas around Zambezi River: Analysis/DBQ/overlay
 First image:
Zamblow
28
 2nd image:
 Output image:
Zambcls
Zambfld
 Composition file: Zambfld,
{use multiply option}
palette: Zambclr
6.3 Vector/ raster transformation
 Exporting layers from MapInfo to IDRISI
In Maputo Info, go to TABLE\EXPORT\SAVE AS:
File name
Mozriver
Save as:
MIF file
Ensure that vector objects are lines and polylines (in the case of receives).
 In IDRISI
File\Import\Export\Software Format MIFIDRIS\MIF to IDRISI




Input file name:
Output vector file
Output reference System: (Lat long)
Output reference unit: (degrees)
 Rasterizing the vector image
 Reformat\Raster/vector conversion
Pointras
Lineras
choose appropriate format
Polyras
Now we have Mozriver (vector) convert to Mozriver (Raster) images
6.3 Combining Lines and polygons in MapInfo
Combining Objects/Lines/Polygons
Activity 1 (e.g.): Combining different sections of Zambezi River into single
river layer
 Go to MapInfo
 Open a table (image that consists objects to be combined
 Go to MAP\Layer control:
 Turn the layer " editable"
 Ensure that the objects to be combine are of the same type (lines, points,
polygons)
 Select objects to be combined
 Click on the object(s) to be combined
29
 Go to Object\combine\ -- four options --- hit ok.
 That creates a single object
30
6.4 Procedures for Importing Tables (data) to MapInfo
Prepare your data in a designated software (excel, access, dbf, etc). This example
concentrates on the use of Excel. After you entered the data:
 Go to File
 Save as
 File name
 File type: (Text (Tab delimited *.txt)
Close the file
 Go to MapInfo
 File




Open Table
Specify location of the file (directory);
Specify file type (Delimited ASCII)
Specify the file name
 Open an existing MapInfo layer (and table) to which current data be mapped to
(updated with).
 Then Go to Table
Update coloumn
 Table to update: existing MapInfo Table (e.g. District)
 Coloumn to update: Add New Temporary Coloumn
 Get Value from: the newly imported table (e.g. EMOP)
 Calculate: Value
 Of:
:Choose the coloumn from which to update data,
e.g.colomn 5
 Then GO to JOIN
 Where:
District (existing map layer)
 Matches:
Coloumn that consists the matching ID
 Then you need to do other intermediate procedure before you map the data
 Go to File
 Save copy as : Take the District layer as NEWFILE. This will ensure that
you keep the original layer from the currently updated layer.
 This will allow you to open the new Table (image).
 Then you could do with Thematic Map or any other facility available.
7. IDRISI-MAPINFO STEP BY STEP CONVERSION PROCEDURE
This document describes the steps in converting GIS data from IDRISI to MapInfo
and back.
In both conversion directions, keep in mind the big picture:
31
 you can only convert IDRISI vector files into MapInfo (therefore, if you have
raster data you want to convert, you must vectorise it first, and
 unlike raster images where the attribute data is in the same file as the geographic
data (the .img file), vector coverages have the geograpic data stored in a separate
file from the attribute data (assuming there is indeed a data set associated with the
vector coverage). The vector geographic file in IDRISI has a .vec extension, and
the associated database has a .mdb extension (this database can be viewed in
IDIRSI by using DATABASE WORKSHOP. The point is this: we must
independently import and export the geographic and database files.
In the following example, geographic and database files can be identified by their
extensions. Any pulls down menus are written in CAPITOL LETTERS and will be
followed by hyphens for any submenus. Example:
 FILE—
IMPORT/EXPORT—
EXPORT--SOFTWARE SPECIFIC FORMATS—
MIFIDRIS.
The example data can be found in the IDRISI exercise data set, and will include the
Ethiopia data set on Awrajas.
7.1 IDRISI TO MAPINFO
 Open both the awrajas.vec coverage and the ethiopia.mdb database using
DISPLAY LAUNCHER and DATABASE WORKSHOP respectively.
Let’s first export awrajas.vec (the geographic data file) into the Mapinfo
import format
 FILE—IMPORT/EXPORT—EXPORT--SOFTWARE SPECIFIC FORMATS—
MIFIDRIS
 Specify that you want to go from idrisi to MIF
 select your input vector file (awrajas.vec)
 type output file name (e.g. awraj)
 specify the Mapinfo version number you are working with (e.g. 41) (note:
if the version number has a decimal (e.g. 4.1) you must write this without
the decimal point)
 type a field name for the ID column in the soon to be created mapinfo file
 specify the field width (the # of characters) for this field (this should be at
least as long as the longest number in the vector ids
 specify the number of decimal places in the vector ids (if it is only an
integer number, you can specify 0.
 click OK, and IDRISI will begin exporting the .vec file into a file type that
Mapinfo can understand, and thus we will use from within Mapinfo to
import it. This file type is called the Mapinfo Interchange Format, and has
a .mif extension.

 Now lets export the IDRISI database file into a file type that Mapinfo will
understand.
32
 With DATABASE WORKSHOP open and the Ethiopia.mdb database on the
screen, go to FILE—IMPORT/EXPORT EXTERNAL ASCII FILE.
 specify that you want to export current database to ASCII and click ok
 in the second dialogue box, specify a name for the output file (e.g. ethiop)
 specify a code number for null characters (places on the database that do
not have data (0 is the default)
 specify the text formatting type to be comma deliminated and click ok.
 now we have created an ASCII text file (ethiop.txt) that Mapinfo can read.







Now open Mapinfo, and lets first import the geographic file (awraj.mif)
go to TABLE—IMPORT
 specify the director and name of the awraj.mif file, and save as file type
Mapinfo (this will create a file with a .TAB extension). Call our file
awraj.tab, and click ok.
 now we can display awraj.tab
go to FILE—OPEN TABLE and specify that you want to open awraj.tab
 click ok, and the awrajas vector file will appear on the screen. You might
have to change the zoom factor in order to see the whole coverage.
 Now let’s import the database file ethiop.txt
go to FILE—OPEN TABLE and specify that you want to open a file of type
external ASCII.
 specify that it is comma deliminated and accept the other defaults
 Mapinfo will display the newly created ethiop.tab database
 Now we need to link theses two files: the geographic awraj.tab, and the
associated database ethiop.tab
go to QUERY—SQL SELECT
 leave the selected columns as is (with a * to designate all columns)
 put you cursor in the from tables box, and then click on the tables down
arrow to select first the geographic file awraj and then also add in there the
database file ethiop. It should look like: awraj, ethiop
 now put your cursor n the where condition box and click on the tables
down arrow. Select the awraj.awrajas. Then type an = sign. Then go back
to the columns down arrow and select the ethiop._col1.
 now enter a new name in the “into Table Named” box. Lets call this
awreth.
 Mapinfo will join these two databases and the associated geographic file
into a single file with the name awreth.tab. The database is automatically
displayed on the screen.
To display the geographic file, go to WINDOW—NEW MAP WINDOW and
specify the map table to be awreth.
 As a last step we need to save our joined table
go to FILE—SAVE COPY AS and specify the table to be awreth and click save
as. Now accept the default information (“awreth.tab” and Mapinfo file type) and
click save
 Now we have successfully imported and linked files into Mapinfo.
33
7.2 MapInfo to IDRISI
From MapInfo, we are going to have to separately export a .tab file as a geographic
file (.mif) and as a database file (.dbf) for import into IDRISI.
 In Mapinfo, open any .tab file (for this example we will use awreth.tab)
 Let’s first export the geographic data
 go to TABLE—EXPORT and specify that you want to export the awreth.tab into
the .mif format. Put this file in the c:\exercise directory
Now let’s export the database file
go to TABLE—EXPORT and specify the you want to export awreth into
the file type of dbase DBF. Again put this in the c:\exercise directory
 Now open IDRISI and lets first import the geographic file awreth.mif
 go to FILE—IMPORT/EXPORT—IMPORT—SOFTWARE SPECIFIC
FORMATS—MIFIDRIS
 specify mif to idrisi; the input file is awreth; the output file as awrvect; the
output reference systems as lat/long (this came from looking in the table
maintenance of Mapinfo); the output reference units as degrees; and the
output unit distance as 1 (this is pretty much always the case); specify
“regions” as the feature to import (if the map had points or lines we could
have selected them as such); click ok
 now we can go to DISPLAY LAUNCHER and view our awrvect.vec file
in IDRISI vector format.


Now let’s import the database file awreth.dbf
 go to DATABASE WORKSHOP—FILE—CONVERT XBASE TO ACCESS
 specify that you want to convert awreth.dbf and lets call the output
awrdata. This will create a file called awrdata.mdb
 Now you have both a .vec and a .mdb in IDRIS format. You can now link
these files as you would normally do in IDRISI.

34
8. General Guide: Area, Extract, formatting
I was trying to modify legend of a map, i.e. to put the legend in Portuguese. In order
not to tamper with the original map I saved the composition under different name.
Then I started modifying the component through the normal procedure. I saved the
composition file (this is foodsys file). Then I exited so that I could save changes to
the legend. I hit “yes” but then the reply was “access denied”. It sounds brutal cia. I
went through this no less than 100 times with exaggeration (I mean at least 20 times).
What went wrong? Please help
8.1 Changing the legend:
 Go to FILE/FILE MAINTANENCE
 Click on an image, (e.g FOOSYST) file and then click on the COPY
button.
 Call the copy file, say, FSYSPOR (Food system in Portuguese)
 Hit CANCEL
 Then go to FILE/DOCUMENT and put in the name of the image file FSYSPOR
 Change the TITLE and then hit the legend categories button on the right
bottom.

The type in the Portuguese names for the 1,2,3,4 and 5 according to the same order in our
earlier English image.
 Leave O blank.
 Say OK and OK again and get out.
 Now display the FSYSPOR image with the same legend as the FOODSYST (the
legend file is called foodsyst).
 Just go to properties and double click on the legend box and pick out a similar
named legend.
 Add vector file and add the MOZDIST with WHTPOLY symbol file.
 Add vector file again and add MOZPROV (or is it PROVINCE) with PROV as
the symbol file
 Then follow the steps I have outlined below to get the Portuguese text stuff (like
we did for the flood risk zone you have on the wall) on the image also.
8.2 How to put Text into an image
Objective: to add source, explanation about the map:
 Go to DATA ENTRY\EDIT and click on “Other file in data directory” (last but
one option).
35
 Give the file name, say FSYST.TXT then you will get a blank box where you can
type in ‘text image’, e.g. Portuguese or English or whatever you want. Type the
stuff in.
 Then hit enter twice or thrice and put WFP, VAM Mozambique there (the source
stuff you wanted). This way you will have the text explaining the image and also
the source stuff in the same file.
 Then go to the FSYSTPOR image you are looking at.
 Go to PROPERTIES in the composer.
 Click on MODIFY MAP COMPONENTS.
 Click on TEXT FRAME.
 TEXT FRAME visible and then enter the name of the text file you just
created (FSYST.txt).
 Choose the font and the size and the colour you want for the text
characters.
 Click on OK and then OK. You have your text on the screen now.
 You can click on it, resize it and also move it about freely across the image
box.
8.3 Reclass
 We managed running RECLASS (Analysis\DBQ\Reclass). Through the
RECLASS exercise, we discovered the notion that the flood risk assumption of the
elevation classes may be too high. We wanted to work with the following
classes:0-20, 20-50, 50-100 meters. The classes as per the above seems very
reasonable on the ground. We wanted to know how we could redo the flood risk
map.
 Two things we need for this. One is to be close to rivers, the other is to be within
the heights we want. I think there is already an image there showing areas close
to river. I think you can use RIVBASIN (major river basins), or NEARRIVR or
CLSRIVR (I am guessing the names here).
 You need to take MOZELEV and then run re-class on it as follows:
Assign a new value of
0
1
2
3
0
for values ranging from
-9999
0
20
50
100
to just less than
0
20
50
100
9999
 Call the output image what you want (NEWFLDR).
36
 In this image, value 1 would be first level flood risk, value 2would be second level
Flood risk and value 3 would be third level flood risk.
Assign a new value of
to all values ranging from
to just less than
0
0
1
1
1
2
0
2
99
 Call the output image NFLDRZ1 (New flood risk zone 1). Do similar things so
that only areas that show up with 2 (fld risk zone 2) and areas that show up with 3
form two separate images.
 Now you have three boolean (0,1) images for each of the three flood risk zones.
 Now run EXTRACT with MOZDIST as the feature definition image and
NFLDRZ1 as the image to be processed. Choose the TOTAL option and to save it
as value file DISTFLD1.
 Analysis\DBQ\Extract
 Feature definition image:
Mozdist
 Image to be processed:
NFLDR1, etc) --- choose “total” option
 Output type (Value or tabular output):
 Do the same for flood zone 2 and 3 (NFLDRZ2 and NFLDRZ3).
 Now you have three values file. Use EDIT to look at the value file, say
DISTFLD1. The numbers in the left are the Idrisi ID for the district, and the
numbers on the right are the areas under the flood risk zone 1. The other two
values file will have the same meaning with the left column as district id’s and the
right as the flood risk zone area.
 Then go into EXCEL. Run \File \open and ask to open DISTFLD1.VAL. This
will give you the option of importing a text file, \Ask for delimited as the option
and space as the field separator. This will bring in the idrisi values file as two
columns into excel. Do the same for flood risk 2 and 3 values files.
 Now you will have three excel files which you can copy and paste onto one file.
You have a database of flood risk zones in each district.
37
Monthly Analysis of NDVI Images (Regional)
1. One would normally receive monthly NDVI images from Rome
(Sa+3 letter month + year + M.img), e.g. SAFEB99M.IMG.
Rename this image to read as
S+3 letter month + year + M.img.
Note that S is standard pre-fix for all south Africa images;
2. Run OVERLAY procedure on IDRISI as follows
1st image
2nd image
Output image
CLICK on
S+3 letter month + year + M.img
S+3 letter month + av14.img
S+3 letter month + year + df.img
first – second option.
3. Run Reclass procedure as follows:
Type of file to reclass
Classification types
Input file
Output file
Reclass file name
use Image option
use file mode option
S+3 letter month + year + df.img
S+3 letter month + year + R.img
NDVICLR
4. Legend categories: Go to File \document \ file name \ legend
categories input the following
1. Much Below Normal
2. Below Normal
3. Normal to Above Normal
5. Title: Go to Properties \ modify map composition \ title and type
the following


Southern Africa: Mean NDVI Image for --- Month ---- Year
Use Times New Roman 12, Bold, Italic and underlined
6. Adding Country layer to the image:
Vector file to display
Countryh
Symbol file
user defined (thkblak)
38
9. Notes for Access to and from GIS
9.1 Access—IDRISI—Access
A. The IDRISI database workshop uses Microsoft Access directly. Thus one
can move back and forth from IDRISI to Access without any import or
export procedures.
B. One useful application is to extract data from a map into the IDRISI
database (such as rainfall, NDVI, numbers of health clinics, etc.), and then
use that database in Access.
1. Example of extracting NDVI averages into a table within IDRISI
and then opening the table in Access.
a. Within IDRISI, have MJAN91MM.IMG, EPA2.VEC,
AGPROD.MDB
b. Open all files within IDRISI
c. We want to extract the average NDVI value per EPA (extension
planning area) and put that information into a table which can
be read by Access
d. The extraction process requires 2 images: the feature definition
image (an image of EPA boundaries) and the image to be
processed (the NDVI image). We have the NDVI image, but
only have the EPA boundaries in vector format. Therefore,
need to convert the vector EPA map into raster.
e. Go to REFORMAT-RASTER/VECTOR CONVERSIONPOLYRAS
f. Put in EPA2 for the vector to be converted, and EPA2 as the
new raster image; click ok
g. When asked if you want to initialize a new EPA2 image click
yes.
h. Copy the parameters (mix/max X and Y, rows and columns)
from the NDVI image
i. Now you have a raster image of EPA boundaries
j. Within DATABASE WORKSHOP open database called
AGPROD.MDB. Add field called AVGNDVI and select real
as the datatype.
k. On the pull down menu, choose LINK-EXTRACT
STATISTICAL SUMMARY FROM IMAGE. Enter EPA2 as
the feature definition image and MJAN91MM as the image to
be processed. IDR_ID is the linking field and AVGNDVI is the
field to accept the extracted data values. For the summary
statistic, select average. Click OK
l. Now you have the average NDVI value per EPA. Save
database as NAGPROD.
m. You can now open this database in Access (if the database is in
an older version of Access, you can convert it if you want).
39
9.2 To MapInfo








Let’s first export epa.vec (the geographic data file) into the Mapinfo import
format
FILE—IMPORT/EXPORT—EXPORT--SOFTWARE SPECIFIC FORMATS—
MIFIDRIS
 Specify that you want to go from idrisi to MIF
 select your input vector file (epa.vec)
 type output file name (e.g. epa)
 specify the Mapinfo version number you are working with (e.g. 41) (note:
if the version number has a decimal (e.g. 4.1) you must write this without
the decimal point)
 type a field name for the ID column in the soon to be created mapinfo file
(e.g. “ID”).
 specify the field width (the # of characters) for this field (this should be at
least as long as the longest number in the vector ids
 specify the number of decimal places in the vector ids (if it is only an
integer number, you can specify 0.
 click OK, and IDRISI will begin exporting the .vec file into a file type that
Mapinfo can understand, and thus we will use from within Mapinfo to
import it. This file type is called the Mapinfo Interchange Format, and has
a .mif extension.
Now open Mapinfo, and lets first import the geographic file (epa.mif)
go to TABLE—IMPORT
specify the director and name of the epa.mif file, and save as file type Mapinfo
(this will create a file with a .TAB extension). Call our file awraj.tab, and click
ok.
now we can display epa.tab
go to FILE—OPEN TABLE and specify that you want to open epa.tab
click ok, and the epa vector file will appear on the screen. You might have to
change the zoom factor in order to see the whole coverage.

The table associated with epa.vec was called agprod.mdb. MapInfo can import
this table directly. Go to FILE--OPEN TABLE. For file type, specify Microsoft
Access Database, and select Agprod.mdb to be opened.

Now we need to link theses two files in MapInfo: the geographic epa.tab, and the
associated database ethiop.tab
go to QUERY—SQL SELECT
leave the selected columns as is (with a * to designate all columns)
put you cursor in the from tables box, and then click on the tables down arrow to
select first the geographic file epa and then also add in there the database file
agprod. It should look like: epa, agprod
now put your cursor n the where condition box and click on the columns down
arrow. Select the epa.id. Then type an = sign. Then go back to the columns
down arrow and select the agprod.idr_id.
now enter a new name in the “into Table Named” box.





40



Mapinfo will join these two databases and the associated geographic file into a
single file with the name you specify. This file will have a .tab extension. The
database is automatically displayed on the screen. To display the geographic file,
go to WINDOW—NEW MAP WINDOW and specify the map table to be your
new map.
As a last step we need to save our joined table
go to FILE—SAVE COPY AS and specify the table to be savedawreth and click
save as.
9.3 Notes on Plotting Point Data in GIS
These notes discuss two techniques for entering point data into a GIS layer. This is
process is distinct from merely drawing points or lines on a map in that drawn objects
are not georeferenced. The advantages of having georeferenced objects are that you
can link the point map to a table of data and you can conduct spatial analysis with the
georeferenced points.
Within IDRISI, there are two ways to enter point data:
1) From Tabular Data Using a module called XYZIDRIS
You can import any point data that is in the form of X Y Z. The X is the latitude,
the Y is the longitude, and the Z is the attribute (or feature identifier)5. Typically
this data can come from recordings of a global positioning system (GPS).
XYZIDRIS expects an ASCII text file of points that are in X,Y,Z format. The X,
Y and Z values for each point should be on a separate line with a carriage return
and line feed at the end, and should be separated by spaces. This file can be from
a spreadsheet/database (e.g. Excel or Access), or you can create a text file in
IDRISI using the EDIT module.
XYZIDRIS is located in File<Import/Export<Import<Software Specific
Formats<XYZIDRIS. XYZIDRIS first requires the name of the input ASCII file
(with extension) and a name for the output vector file. Then you must specify the
output parameters. Click on the down arrow next to the input boxes for reference
system and reference units for a list of choices or type them in manually. Then set
your unit distance. The default is set to 1. Finally, enter a title. When finished
you can view the points by displaying the vector file.
2) On-screen Digitising
With the cursor on the map, the location of the cursor is continuously displayed in
the lower status bar of IDRISI. If you know the location of a point of interest, or if
you just want to estimate the location (such as over a known city), you can use the
on-screen digitizing module in IDRISI to point with your mouse and click to add
new points (you can as well create lines and polygons).
5
This example is for the lat/long reference system. If you were using the UTM system, you would use
the appropriate units, such as meters.
41
In order to digitize on screen, the map window you wish to digitize must have
focus. Clicking on the DIGITIZE button (shaped like a cross in a circle) on the
toolbar will bring up the dialog box. You must first enter a name for the vector
file to be created. Then you must specify the type of feature to be digitized (point,
line or polygon). You are also required to enter the feature ID (identifier) to be
used for the first feature that will be digitized. You may enter any positive integer
value here. In addition, if the vector layer type is a point layer, you will need to
enter the step value (meaning, after each consecutive point digitized, should
IDRISI automatically increase the feature ID value). Finally, give the vector file a
title. Press OK and you may begin digitizing.
To digitize, use the left mouse button to identify points that define the position,
course or boundary of a feature. You will notice it being formed as you digitize.
To finish the feature (or the current sequence of points in the case of point
features), click the right mouse button.
Note very importantly that many of the interactive screen options will become
inactive (and will thus appear grey on the toolbar) while you are digitizing. To
restore them, you must terminate the feature you are working upon by clicking the
right mouse button while it is on the map window concerned.
To delete an entire feature, you can click on the DELETE button to the immediate
right of the DIGITIZE button). If you are currently digitizing a feature, this will
cause it to be erased from the screen and be deleted from the vector layer data file.
If you are not currently digitizing a feature, but have not yet closed the vector layer
data file (see below), clicking this button will have the effect of deleting the most
recently digitized feature from that file.
Once you have finished a feature by clicking the right mouse button, you can
continue to add further features to the same vector layer data file. Make sure that
the map window concerned has focus and then click on the DIGITIZE button on
the toolbar. This dialog box requires that you specify the feature ID of the new
feature, and step value if it is a point layer. You can then start digitizing again
once you press OK.
As you digitize features, they will each in turn be added to the vector layer data
file. In order to close this file, and stop the process of adding features to it, simply
click on the SAVE button (it looks like an arrow bent downwards). If you do this,
the next time you click on the DIGITIZE button, you will need to enter the name
of a new vector layer in which to save the data.
With either of these techniques, the spatial map created can be linked to a database
that has other attributes you want to associate with the point file. You would use the
feature ID value as the linking value to the database.
42
Download