Professional Documents
Culture Documents
0 Academic
Users Guide
May 2001
Bug reports:
bugs.ilwis@itc.nl
Technical support:
support.ilwis@itc.nl
Contents
1.
2.
27
3.
71
4.
117
5.
167
6.
Image Processing
209
6.6.2
6.6.3
6.6.4
6.6.5
7.
277
8.
317
9.
351
387
417
11.4.2
11.4.3
11.4.4
11.4.5
11.5 Spatial
457
479
13.4
13.5
13.6
13.7
13.8
Preface
Preface
General information
In late 1984, the International Institute for Aerospace Survey and Earth Sciences
(ITC) was awarded a grant from the Dutch Ministry of Foreign Affairs. The funds
should be spent on research benefiting land and water development in developing
countries. ITC decided to concentrate these funds in a single multidisciplinary
research project into the methodology of a Geographical Information System, to be
used as a tool for land use zoning and watershed management studies. By the end of
1988, the project resulted in the official release of version 1.0 of the Integrated Land
and Water Information System (ILWIS). Two years later, ILWIS was launched
commercially and ITC started up a distributors network to distribute ILWIS and to
support its users worldwide. Since then ILWIS has been used extensively as a tool for
training, research and advisory services all over the world.
ILWIS was designed to respond to user demands, to be low-cost and application
oriented, entirely meeting one of ITCs main objectives, i.e. transferring appropriate
technology to developing countries. By now, over 5000 ILWIS systems are in use in
more than 100 countries.
ILWIS 2.0, the first ILWIS for Windows version was presented in August 1996; after
that several upgrades have been released of which the last one was ILWIS 2.23
(September 1999).
ILWIS 3.0 as released in May 2001 has a completely modernized user-interface, both
for the software and the help. Behind the scenes much has changed as well. ILWIS
The readme.htm file that is available on the ILWIS 3.0 CD-ROM contains
more detailed information about the new functionality of ILWIS 3.0.
Preface
What ILWIS needs: hardware and software requirements
To install ILWIS 3.0, please run the installation program that is available on the CDROM or download the program from our web site at http://www.itc.nl/ilwis/. ILWIS
3.0 can be installed under Windows 95, 98, Me, NT4 and 2000.
For best performance of ILWIS 3.0, we recommend a computer using a Pentium III
processor, 128 MB RAM or more, a 24 bit graphics Windows accelerator board with
a resolution of at least 1024768, a CD-ROM player, a mouse, a printer and a
digitizer.
The minimum requirements are: a Pentium with 64 MB RAM, 256 colors graphics
board with a resolution of 640x480, a CD-ROM drive and a mouse.
Furthermore, ILWIS requires that Internet Explorer version 5 or later is installed.
The ILWIS 3.0 Users Guide: Main objectives
The ILWIS 3.0 Users Guide is intended for those who want to know how ILWIS 3.0
is used in basic GIS and Image Processing operations. It trains the skills you need to
work with ILWIS, including explanations and procedures for first time users in
addition to topics for more advanced users. It provides numerous exercises to practice
GIS techniques and Image Processing operations and can be used both by persons that
want to learn how to work with ILWIS by themselves, or in a course environment.
Besides this guide, ILWIS HTML Help is available in the program itself. The Help
offers detailed descriptions of the functionality of ILWIS, its window types, the
objects, the operations, etc., and is illustrated with tips and examples.
Literature
The ILWIS 3.0 Users Guide is basically an exercise book. Therefore we have kept
the amount of theoretical explanations to a minimum. For a thorough introduction to
GIS and Image Processing, we recommend the following textbooks on GIS and on
Remote Sensing:
- Aronoff, S. (1995). Geographic Information Systems: A Management Perspective,
4th edition. WDL Publications, Ottawa, 294 pp.
- Barrett, E.C. and L.F. Curtis (1992). Introduction to Environmental Remote
Sensing, 3rd edition. Chapman & Hall, London, 426 pp.
- Bonham-Carter, G. F. (1996). Geographic Information Systems for Geosciences.
Modeling with GIS. Computer methods in the Geosciences. Pergamon Press,
Oxford, 398 pp.
- De By, R.A. (ed.) (2000). Principles of Geographic Information Systems: an
introductory textbook. ITC, Enschede, 230 pp.
ii
Preface
- Janssen, L.L.F. (ed.) (2000). Principles of Remote Sensing: an introductory
textbook. ITC, Enschede, 170 pp.
- Lillesand, T.M. and R.W. Kiefer (2000). Remote Sensing and Image Interpretation,
4th edition. John Wiley & Sons, New York, 724 pp.
- Sabins, F.F. Jr. (1996). Remote Sensing, Principles and Interpretation, 3rd edition.
W.H. Freeman and Co., New York, 494 pp.
Structure of the ILWIS 3.0 Users Guide
The ILWIS 3.0 Users Guide has been structured in a way that you can start with
any chapter. It is advisable, however, to follow the order of the book, since it reflects
the data flow of working with a GIS.
The ILWIS 3.0 Users Guide consists of 13 chapters:
- Chapter 1, Introduction to ILWIS, is intended to get you started with ILWIS, and
to show you the basics of the user interface.
- Chapter 2, Main concepts of ILWIS, presents key concepts of ILWIS.
- Chapter 3, Spatial data input, allows you to practice digitizing maps and
importing maps and images from other software packages.
- Chapter 4, Spatial data management, explains all ILWIS activities used to
arrange your spatial data in a way that it can be used for analysis.
- Chapter 5, Attribute data handling, deals with the use of tables, i.e. how to create
or import tables, and how to calculate with data in tables.
- Chapter 6, Image Processing, explains various operations that can be applied to
visualize, enhance, georectify and classify remote sensing images.
- Chapters 7, 8 and 9 all deal with Spatial data analysis. Various analysis
techniques, such as retrieval, (re)classification, measurement operations
(chapter 7), overlay operations (chapter 8) and neighbourhood and
connectivity operations (chapter 9) are demonstrated.
- Chapter 10, Using Digital Elevation Models, explains how to generate Digital
Elevation Models with ILWIS, and shows procedures to create derivatives, such as
slope steepness and slope direction maps.
- Chapter 11, Spatial data analysis: geostatistical tools, covers the use of
geostatistical tools for the analysis of point data.
- Chapter 12, Scripts and functions, is intended to show other functionalitys of
ILWIS for more advanced data analysis, including the use of the command line,
functions and script language.
- Finally, chapter 13, Presentation of results, is dedicated to the production of
output maps, the way to create annotations, how to treat colors, printing, exporting
data and creating demos.
The exercises in the ILWIS 3.0 Users Guide are designed not only to demonstrate
to you how certain ILWIS operations are used, but also give you a basic idea of when
they can be used in real applications. Therefore we used as much as possible
examples from a single region, surrounding the city of Cochabamba, in Bolivia. Only
when the Cochabamba data was not suitable for explaining certain operations, we
selected some other examples.
ILWIS 3.0 Users Guide
iii
Preface
The data set
All data files for the exercises in the ILWIS 3.0 Users Guide are included on the
ILWIS 3.0 CD-ROM and can also be downloaded from the ILWIS web site. On the
CD-ROM, the Users Guide data can be found in E:\Data\ILWIS 3.0 Users Guide
). For each chapter, there
Data (where E is the drive letter of the CD-ROM drive
is a subdirectory which stores the data that is required for the exercises of that
chapter, e.g. E:\Data\ILWIS 3.0 Users Guide Data\Chapter01.
During the installation of ILWIS, you can install the Users Guide Data directly on
your hard disk. The default installation directory for the Users Guide data is
C:\ILWIS 3.0 Data\Users Guide with subdirectories for every chapter. These
subdirectories of C:\ILWIS 3.0 Data\Users Guide will be the working directories
for the exercises of each chapter. For example, when you start with the exercises for
the first chapter, you should go to the directory C:\ILWIS 3.0 Data\Users Guide\
Chapter01. When you have finished the exercises for a certain chapter, and you
want to continue with the next one, you should change directory.
If you did not install the data files during the installation of ILWIS, you should do
so, before continuing. You can also use the Windows Explorer to copy the data
files from the CD-ROM to your hard disk. In case you use Windows Explorer,
you have to turn off the read-only attribute of the data files manually.
When you wish to repeat the exercises for a chapter, it is recommended that you
copy the original data files from the CD-ROM, or use the ILWIS Installation program, so that you always start with the original files, and not with files which
may have been altered.
The CD-ROM and the ILWIS web site furthermore include the ILWIS software, the
example data, and the text and data for the ILWIS 2.1 Applications Guide.
iv
Preface
Conventions used in the ILWIS 3.0 Users Guide
This manual is formatted in such a way that the specific actions dealing with the
software are separated from the accompanying text.
This is an exercise box. You can follow the instructions step by step.
Words in Times New Roman 10 Italics are keywords.
Formulas that should be entered are shown in Courier New 10 .
For example: MapC = MapA + MapB
The names of operations, dialog boxes and the options in dialog boxes are
shown in Arial 10.
For example: Display Options - Raster Map.
This is an arrow
. When you see this arrow you know that the exercise
continues on the next page.
We assume that after a certain procedure is explained a few times, such as opening or
closing maps and other objects, you will be familiar with it, and therefore basic
things are not repeated too often.
Using the ILWIS 3.0 Users Guide in courses
The ILWIS 3.0 Users Guide is intended to be used both on an individual basis, for
learning how to work with ILWIS 3.0, as well as in GIS and Image Processing
courses.
Since the ILWIS 3.0 Users Guide covers most of the functionality of ILWIS 3.0, it
is too large to be treated in a single course. In the following scheme the
recommended exercises are shown for courses with different duration:
Introductory GIS courses
Intended for persons without prior knowledge of GIS and ILWIS.
- 1 day course: Chapter 1, 2.
- 5 days course: Chapter 1, 2, and parts of chapters 5 (5.1 to 5.3), chapter 7 (7.1 to
7.3), and chapter 8 (8.1, 8.2 and 8.4).
- 2 weeks course: Chapter 1, 2, 3, 4 (4.1, 4.3 to 4.5), 5, 7, 8, 13 (13.3 to 13.5).
- 1 month course: Chapter 1, 2, 3, 4 (4.1, 4.3 to 4.5), 5, 7, 8, 9 (9.1, 9.3), 10, and 13.
Preface
Advanced GIS courses
Intended for students already familiar with the basics of GIS and ILWIS.
- 1 week course: Chapter 4 (4.1 to 4.3, 4.6), 9.
- 2 weeks course: Chapter 4 (4.1 to 4.3, 4.6), 9, 10.
- 1 month course: Chapter 4 (4.1 to 4.3, 4.6), 9, 10, 11, 12, 13 (13.7).
For advanced courses with a longer duration, it is recommended to also practice with
some of the case studies of the ILWIS 2.1 Applications Guide that are available on
the internet, depending on the professional background and interest of the
participants.
Image Processing courses
Intended for students without prior knowledge of Image Processing and ILWIS.
- 1 week course: Chapter 1, 2, 6 (6.1 to 6.4).
- 2 weeks course: Chapter 1, 2, 6 (6.1 to 6.5).
- 1 month course: Chapter 1, 2, 6.
The schedule can also be followed when learning ILWIS on an individual basis.
However, in the schedule of the courses about one third of the time will be spend on
lectures. Users that are already familiar with GIS and Image Processing will need a
much shorter time.
vi
CHAPTER 1
Figure 1.1:
The ILWIS Main window consists (by default) of a Title bar, a Menu bar, a Standard
toolbar, an Object selection toolbar, a Command line, a Catalog, a Status bar and an
Operations/Navigator pane with an Operation-tree, an Operation-list and a Navigator.
There is a possibility that the right-central part (i.e. the Catalog) of the Main window
on your screen does not look exactly the same as shown in Figure 1.1. This may be
due to the fact that you have another system configuration and/or that during the
installation of ILWIS you decided to copy the data files to a different directory than
the standard start-up directory C:\ILWIS 3.0 Data\.
Figure 1.2:
The Navigator lists all drives and directories (i.e. folders) in a tree structure. The
Navigator also has a History
to easily return to previously visited drives and
directories.
Click on the drives and folders in the Navigator until you are in the directory where the data for this chapter has been stored. By default the data is
located in C:\ILWIS 3.0 Data\Users Guide\Chapter01.
1.1.2 Catalog(s)
If you are in the correct directory C:\ILWIS 3.0 Data\Users Guide\Chapter01 you
will see, that the right hand side of the Main window, looks exactly the same as
Figure 1.3. This part of the Main window, in which maps, tables and other ILWIS
objects in the working directory are displayed each with its own type of icon, is
called the Catalog. When you double-click an object in the Catalog, it will be
displayed.
ILWIS 3.0 Users Guide
Figure 1.3:
The following objects, related to the area surrounding the city of Cochabamba in
Bolivia, can be seen:
Cochabamba
A domain, listing names of the mapping units in the Landuse map and the Landuse
table;
Landuse
A polygon map containing land use units in the study area (the city of Cochabamba
and surroundings in Bolivia);
Landuse
For a complete list of ILWIS objects and their icons, see the summary of section
1.1 or the ILWIS Help topic Basic concepts, ILWIS objects and icons.
The object Selection tab contains a list box in which the object types that are shown
in the Catalog appear highlighted. You see that all ILWIS objects are selected. To
show only the map and table objects, i.e. the objects with the icons
,
,
,
and :
On the object Selection tab, select the first object type (i.e. the
Raster
Map ), keep the left mouse button pressed and move the mouse pointer to the
last object you want to select (i.e. the
Table ).
You will see that the Catalog has changed and that now only the map and table
objects are shown in the current Catalog. The ILWIS Main window may show more
than one Catalog. You can thus keep your data organized in different directories.
You can open another Catalog by clicking the New Catalog button
in the
Standard toolbar and selecting a new directory. You can also select the New
Catalog command on the Window menu of the Main window.
Figure 1.4:
Figure 1.5:
Click Operations in the Menu bar. The Operations menu is opened. The
menu contains commands for all ILWIS operations, which are grouped. The
triangles to the right of the commands on a menu indicate that there is
another cascading menu.
Select the Filter command. The Filtering dialog box is opened. In this dialog
box you can select among other things the input maps for an operation.
Figure 1.6:
Position the mouse pointer on one of the operations, for example on the
Filter operation.
In the Operation-list, click with the right mouse button on an operation and
select Help from the context-sensitive menu. An Additional Help window
appears with a short explanation of the operation.
You can close the Additional Help window again by pressing the Close button
in the Title bar of the Help window or by double-clicking the control-menu icon
.
The Status bar also gives short information when you move the mouse pointer over
a menu command, over a button in the Toolbar or over an object in the Catalog.
In the Catalog, click with the right mouse button on polygon map Landuse
to get a context-sensitive menu.
A Context-sensitive menu is a menu, which gives only those menu commands that
are applicable to the moment you use the right mouse button; thus you will get a
different menu depending on where and when you use the right-mouse button. For
example, if you use the right mouse button on a polygon map, the context-sensitive
menu will only show the operations which can be applied on polygon maps. Contextsensitive menus are shortcuts for normal menu commands.
Figure 1.8:
Properties
Open Map
Customize Catalog
List
Copy
Details
Paste
cd..
Delete
When you leave the mouse pointer for a short period of time on top of a button a
ToolTip will appear with the name of the button/menu command that it will perform.
Also the Status bar gives some information on the working of the button. So far,
you have used the Customize Catalog button
.
Other buttons that you will probably use frequently are:
List. Show the objects in the current Catalog as a list of icons and object names.
Details. Show the details of the objects in the current Catalog in a table-like form.
Figure 1.9:
Only the object types of which the button appears down will be shown. For a list of
all ILWIS object types and icons, see the summary of section 1.1. The first button,
the ILWIS button
, is used to hide all objects (after which you can click specific
object buttons, to show only these object types), or to show all object types. To add
8
For beginners, the Command line is not so important yet. You can use the
Command line to type MapCalc formulas when you want to calculate with raster
maps (chapter 7) but also operations (like Filter, etc.) can be performed by typing an
expression on the Command line (see chapter 12).
The Command line has a History. You can use:
- the Arrow Up key of your keyboard to retrieve previously used expressions and
commands;
- the Arrow Down key to scroll forwards again, and
- the Arrow Down button
at the right hand side of the Command line to open a
list of previously used commands and expressions.
The ILWIS Help allows you to obtain information from any point within the
program. The Help menu differs per window. In the Main window the Help menu
has many options; we will explain a few of them now:
- Help on this Window. You obtain help on the current window. Depending on the
window from which you select this help option, you can get help on the Main
window, the map window, the table window, the pixel information window, etc.
- Related Topics. When this menu option is selected a dialog box appears with a
list of topics that are related to the current window.
- Contents. Displays the Help Contents. By clicking the links in the table of
contents you can go to any help topic you like.
ILWIS 3.0 Users Guide
From the Help menu, select the command Help on this Window. The
ILWIS Help viewer (Figure 1.11) is opened and the help topic Main
Window, Contents is shown.
Click the hyperlink Introduction. The ILWIS Help viewer refreshes and displays the topic Main window: Introduction, in which all parts of the Main
window are explained.
Click any of the links. Another topic appears explaining you more.
The ILWIS HTML Help viewer (Figure 1.11) has three parts:
- a Topic pane that shows the topic the user has selected;
- a Navigation pane with 4 tabs: a Contents tab, an Index tab, a full-text Search
tab, and a Favorite tab;
- a Toolbar which allows users to Show or Hide the Navigation pane, to move
Forward to the next topic or Back to the previous topic, to go to the
10
Use the browse buttons Back and Forward to go page by page through the
Help.
Practice a bit more with the ILWIS Help. When you have finished, close the
Help window by double-clicking the Control-menu icon
in the Title
bar of the Help viewer.
georeferences
polygon maps
coordinates systems
segment maps
point maps
tables
map lists
object collections
sample sets
map views
two-dimensional tables
layouts
matrices
(user-defined) filters
domains
user-defined functions
representations
scripts
11
12
In the following pages we will show you how to display spatial data and attribute data
in ILWIS. We will introduce you to the map window and you will practice displaying
a map. The map to be displayed is the polygon map Landuse that shows the
different land use types in the Cochabamba area in Bolivia. This map was digitized
from a paper map. A polygon map is a vector data object containing closed areas
including the boundaries making up the areas, which in this case represent land use
units. In chapter 2 there will be a more detailed explanation about polygon maps.
13
A dialog box allows the user to enter the information required by ILWIS to carry out
an operation. Dialog boxes differ depending on the application you are performing.
The dialog box, which is displayed now, is used to specify how you want to display a
polygon map. In general, an ILWIS dialog box can have features such as:
Title bar. Shows the name of the dialog box and can be used to move the dialog box
on the screen. In this case the title is: Display Options - Polygon Map.
Text box. A small box, which can be used for typing text or values. The dialog box
shown on your screen contains a Text box in which you can specify the Boundary
Width of the land use units lines.
Drop-down list box. A small box with an Arrow Down button
, which allows
you to select items. A list, including the available data, will be displayed when the
arrow button or list box is clicked. The button
on the right hand side is the create
button. The Create button can be used to create an object when the list excludes a
14
about the meaning of the land use units, once the map is displayed. The second box
Scale Limits allows you to define the scale limits of the map. The third check box
Mask allows you to selectively display some land use types. If the fourth box,
Boundaries Only is selected, only the boundaries of the land use units will be
shown. Finally, the fifth box, Attribute, can be selected if you want to display an
attribute value from a table connected to the map, instead of the land use units
themselves.
Command buttons are used to initiate an action. The OK, Cancel, and Help are
common command buttons.
OK button: whenever you click the OK button (or press Enter on the keyboard) the
mutually exclusive options. The selected option button contains a black dot. You can
select one option at a time. Selecting another Option button, clears the other. As you
can see, ILWIS gives suggestions for options in the dialog box, which are called the
defaults.
To select a check box or an Option button click the check box or press the
Spacebar. If the name of the option or check box has an underlined letter, you
can select the Option button or check box by pressing and holding down the Altkey while typing the underlined letter.
Select the check box Boundaries Only. Now you will see that the contents
of the whole dialog box changes. If you only want to show the boundary
lines of the units, no input is needed anymore on how you want to
15
display the units themselves. The contents of the dialog box depends on the
input of the user. That is why we call it context-sensitive.
Select the drop-down list box Boundary Color. You will see a list with all
different types of colors that you can select.
Practice some more with the different options in the dialog box. After that,
change all options again so that they are the same as in Figure 1.13. Then
confirm your input by clicking the OK button or by pressing Enter .
You can move through the various options within a dialog box by using the Tabkey or the Shift+Tab-keys on the keyboard.
A map window
The polygon map Landuse is displayed in a map window (see Figure 1.14). All
maps in ILWIS are displayed in a map window. The map window has many similar
features as the Main window of ILWIS, which we have seen before. It consists by
default of a:
Title bar: located at the top of the map window. The Title bar shows the name of the
Zoom Out
Redraw
Normal
Measure Distance
Add Layer
Pan
Remove Layer
Zoom In
Save View
Scale box: Text box in which you can type the scale on which the map(s) should be
displayed.
Layer Management pane: The left central part of the map window displays the
layers (maps) that are added to the map window and the legend of each map. In the
Layer Management pane, you can for instance change the order of the layers that
are displayed. The Layer Management pane will be extensively treated in the next
chapter.
Map viewer: The right central part of the map window where the maps are displayed.
16
Title bar
Menu bar
Status bar
Map viewer
The map window can be moved, like all windows, by activating it and dragging it to
another position. The size of the map window can be changed in several ways.
Move with the mouse pointer to a border or to a corner of the map window.
The mouse pointer changes into a two-headed arrow.
Drag (press the left mouse button and hold it down) the border or corner
until the window has the size you want and release the left mouse button. The
map window has been resized.
in the upper
17
To roam through the map on which you zoomed in, use the Pan button
or use the Left/Right/Up/Down scroll boxes in the horizontal or the vertical
scroll bar.
A fast scroll can also be achieved by dragging the scroll boxes in the scroll
bars Left/Right or Up/Down, or by clicking in the scroll bar itself.
Move the cursor (now in the shape of a magnifying glass) to the first corner
of the area that has to be displayed in detail and click on the left mouse button. Keep the mouse button down and drag the cursor a little bit to the second corner of the area of interest; then release the mouse button. Now the
selected area will appear enlarged. You can also click in the map window to
zoom in.
Activate the Scale box which is by default located next to the Toolbar of
the map window and type another scale factor for the map (e.g. 1:200000 )
and press Enter .
Next, we will pay attention to another part of the map window: the Status bar,
which can be found at the bottom of the map window. If you move with the mouse
pointer over the map, you will see that the Status bar displays the position of the
mouse pointer in the map. To specify the position in an absolute way a coordinate
system is used. There are many different coordinate systems in use around the world.
Coordinates can be displayed in two ways:
- as metric coordinates (X,Y), or as
- geographic coordinates (latitude, longitude).
The Status bar displays the coordinates in meters and/or geographic coordinates.
First, the X, Y values of metric coordinates are given; these are followed by the
degrees, minutes and seconds of the latitude and longitude (i.e. geographic
coordinates).
18
Move the mouse pointer through the map and verify in the Status bar that
the X values increase when going to the right of the map (towards the east),
and the Y coordinates increase when going to the top of the map (towards the
north).
Try to locate the mouse pointer on the following X and Y coordinates:
X=803384 , and Y=8074877 , and find the corresponding latitude and longitude.
Locate the mouse pointer somewhere in the map, and press the left mouse
button. Move to another point, while keeping the left mouse button pressed.
When you release the mouse button a message box appears.
Click OK in the Distance box and click the Normal button in the Toolbar
to go back to the normal view.
19
Domain
Press the left mouse button on different units in the map to find out what
they represent.
Find the land use class around the location: X=801830 and Y=8089283 .
As you can see, the units of the Landuse map are described by classes, with names
such as Forest , Grassland , Bare rock , Lake , etc. The list of all class names
that can occur in a map is called in ILWIS a domain. A domain defines the possible
contents of a map, a table, or a column. In other words, what do the items in a map,
table or column mean? Are they classes (such as land use classes), or values or
something else? The domain concept is very essential in ILWIS, and we will
therefore come back to it in chapter 2. The full list of class names of the land use
units can be seen in the Layer Management pane of the map window when the map
is displayed, but you can also open the domain of the polygon map Landuse
yourself.
Make the ILWIS Main window active. If the Main window is visible on the
screen, then you can just click any part of the Main window. If the Main window is not visible anymore, click the ILWIS button on the Windows
Taskbar at the bottom of your screen.
in the Object
The Domain Class editor is opened. The Title bar reads: Domain Class
Landuse - ILWIS. As you can see, the domain lists all possible class names of the
map. It is simply a list of all land use types, which can occur in the map. Since these
are different classes, we speak of a class domain. In chapter 2 you will also see some
other domain types.
and
We started this lesson by explaining the difference between spatial and non-spatial (or
attribute) data. From the map window, we can also obtain information on attributes,
related to the different land use units of the map, which is displayed.
20
In the map window, double-click with the left mouse button a unit in the
polygon map Landuse .
Now you will see a small window appearing with the title Attributes. Inside the
window you will see two lines. The first line contains the land use class name of the
unit you clicked, and the second line contains the word Landvalue followed by a
number, which is the average monetary value of this land use type. The line with
Landvalue information is a line from an attribute table Landuse , which is linked
to the map.
Let us look now in more detail to tables, but first close the map window.
Close the map window by opening the File menu in the map window and
choose Exit, or click the Close button
in the map window.
A table window
Table
We will finish this chapter by showing you how to display attribute data.
The table Landuse is now displayed in a table window (Figure 1.15). As you can see
from Figure 1.15, a table window contains many of the features we have already seen
in the Main window and in the map window. It has a Title bar, a Menu bar with the
menu options: File, Edit, Columns, Records, Graphs, View and Help and a
Toolbar with the buttons:
Copy
Paste
Delete
Goto Record
Properties
21
Close button
Title bar Maximize button
Minimize button
Column properties
Control menu icon
button
Record view button
Command line
Toolbar
Statistics pane
Status bar
Table viewer
Split bar
Scroll bar
Furthermore, there is a Command line, a Table viewer, a Split bar with the
Statistics Pane below it and a Status bar.
The table contains two columns. The left column, in gray color, has no header. If you
look closely to the names in this left column you will remember that those are the
names that you have seen also in the map Landuse . This is again the domain; a
domain can thus define the contents of a map, but also the contents of a table.
Next to the left gray column containing the domain items, the table has one more
column, called Landvalue . This column is an attribute column that contains the
average value of the land in fictive monetary values. As you can see, this column
contains values.
22
Double-click the Column header with the name Landvalue on it. The
Column Properties dialog box (Figure 1.16) appears.
This dialog box contains information on column Landvalue . The dialog box shows
for instance the domain of column Landvalue : Default Value Domain. The next
line gives the Value Range of column Landvalue : between 0 and 10000 . The
actual values in the column are also shown: Minimum: 50 , Maximum: 1000 .
Click the Cancel button to close the Column Properties dialog box.
Information on the Minimum (Min) and Maximum (Max) values in the column,
together with the Average (Avg), Standard Deviation (StD) and Sum of the
column, is visible in the Statistics Pane in the lower part of table Landvalue .
You will now practice with the various items related to the display of tables. First we
will show you how to switch between Table View (in which you will see the table
ordered in such a way that the information of one record is displayed in different
columns) and Record View (in which you will see only the information related to
one record):
In the table window, click a Record button, for example the Record button
Grassland (the left gray button with the name Grassland on it). A small
Record View window appears. It shows the current record
23
(Grassland ) and the attribute value(s) we have for this unit (in this case
only the Landvalue ).
In the Toolbar of table Landuse , click the Goto Next Record button
or the Goto Last Record button
to go to the next or to the last
record respectively.
By default, data in a table are sorted on the domain of the table. The records of a
table can also be sorted on one of the columns in the table.
Open the Columns menu and select the Sort command. The Sort dialog box
is opened.
By clicking the Column option in the dialog box, you can select the column which
you wish to sort. The record order of the table will change as well.
In the Sort dialog box, select the Column option, and then select column
Landvalue from the drop-down list box. Accept the Sort Order
Ascending and click OK. Now the table is ordered ascendingly according
to the values in the column Landvalue .
In chapter 5 many more options of the table window are treated. For now, close the
table.
From the File menu, select Exit or double-click the Control-menu icon
of the table window.
25
Click OK.
The picture which is displayed is a three dimensional view of the Cochabamba area.
This picture was made by the Display 3D operation which will be treated in chapter
10, using a Digital Elevation Model (DEM) and a False Color Composite (FCC)
derived from Landsat TM bands.
26
Close the map View3D1 , and open raster map . Have a look at it, and close it
when you have finished.
CHAPTER 2
27
Figure 2.1:
Vector and raster representation of points, lines and areas. The code of a feature is
either a class name, an ID, or a value.
Vector model
In a vector model the position of each spatial feature is defined by (a series of) X and
Y coordinates. Besides the location, the meaning of the feature is given by a code
(label).
Points
28
The location of a point is described by a single XY coordinate pair. Points are stored
ILWIS 3.0 Users Guide
characteristics. The points are connected by straight lines. In ILWIS line features are
called segments. A segment is described by the coordinates of its starting and ending
points (its nodes) and the intermediate points. The code of a segment defines what
the segment represents (e.g. road, state boundary, contour value, etc.).
Polygons
Areas are represented by their borders or boundary lines, which are in fact lines
stored in the same way as segments. A polygon is a closed area of one or more
boundary segments and a code. Boundary segments define both the boundary of the
polygon to their left as to their right (topological structure). An area defined by its
boundary line and by its code is called a polygon. The code of a polygon defines the
contents of the polygon (e.g. forest, city, sandstone, etc.).
In ILWIS vector maps are either point, segment, or polygon maps. Most of these
maps are obtained by digitizing or by importing them. Vector maps require less disk
storage space and are suitable for creating high quality outputs. They are less suitable
for a number of GIS operations, especially those dealing with map overlaying. You
can rasterize the vector maps into raster maps (this will be explained in chapter 4). In
ILWIS, most of the analysis operations are raster-based.
Raster model
In a raster model, spatial data are organized in grid cells or pixels. Pixels, a term
derived from picture element, are the basic units for which information is explicitly
recorded. Each pixel is only assigned one value. The maps stored in ILWIS according
to the raster model are called raster maps. Pixels in a raster map all have the same
dimensions. Thus, it is not necessary to store all pixel coordinates as the pixels are
arranged in a regular pattern. It is enough to determine the pixel size and the
parameters to transform between X and Y coordinates of a map and the pixel
locations in the raster map (rows/lines and columns). The process to establish this
relationship is called georeferencing. Through a georeference you thus know the
relationship between a coordinate system and pixel locations in the image.
A point is described in the raster model by the position of a single pixel. The position
of each cell is defined by a row and column number. A pixel is assigned a code
(label). A line and an area are described by a set of connected pixels having the same
code (label). In the raster model there is no basic difference in how points, lines and
areas are stored.
Through rasterization vector data (points, segments or polygons) can be converted to
the raster format. Apart from this source of raster maps, there are imported images,
either satellite images, scanned aerial photographs or imported raster maps from other
sources. Most ILWIS analyses are based on the raster data model. The results of most
of the operations are also raster maps.
ILWIS 3.0 Users Guide
29
Accept the defaults in the Display Options - Polygon Map dialog box by
clicking OK. The polygon map is displayed.
Click the Title bar of the map window, keep the left mouse button down, and
move the map window to the side of the screen. Then release the left mouse
button. This is called dragging.
you want to see the raster map. Note that there are less options than in the
Display Options Polygon Map dialog box.
Accept the default values in the dialog box by clicking OK. The raster map is
displayed in another map window.
Drag and successively resize both windows so that they are next to each
other.
The first impression is that both maps are the same. They are similar with respect to
the information they contain. You can check this by clicking the same unit in both
maps. The units of both maps are also displayed in the same colors. The difference,
however, is in the way the information is stored in both maps; one in vector format
and the other in raster format. The best way to evaluate this is by zooming in on both
maps.
Repeat this procedure for the polygon map. Zoom in on the same area.
Now you can see quite some differences between the two maps. The polygon map
displays smooth boundaries between the units, whereas the raster map has a blocky
appearance. If this is not clear then zoom in further. The blocky appearance of the
raster map is due to the regular arrangement of the pixels. You are able to see
individual pixels and the land use unit they represent.
31
Move the map window with the raster map Landuse to the side of the
screen, by dragging its Title bar.
Make the ILWIS Main window active. If the Main window is visible on the
screen, then you can just click any part of the Main window. If the Main window is not visible anymore, click the ILWIS button on the Windows
Taskbar at the bottom of your screen.
From the Catalog, drag the raster map Tmb1 to the raster map window (click
the map with the left mouse button and move it while keeping the left mouse
button pressed, and release the mouse button when you are in the map window). The Display Options - Raster Map dialog box is opened. As you
can see the Tmb1 map has a domain image.
Now the raster map Landuse in the map window is substituted by the raster map
Tmb1 . It is only possible to display one raster map in a map window at the same time,
since you cannot see two colors of two pixels on top of each other.
Zoom in on a part of the raster map Tmb1 until you clearly see the different
pixels of which this image is composed.
In a satellite image nearly each of the individual pixels has a different value than its
neighbours, due to the different reflectance values of the earth surface as recorded by
the sensor of the satellite. To read some of the pixel values:
Image
32
The values that you can read from the map are whole numbers between 0 and 255.
This means that whenever we work with satellite images (such as SPOT or Landsat)
the domain of these images is called image. Domain image is used for satellite
images, and scanned black and white aerial photographs. Pixel values in a band of a
satellite image represent reflection values in a certain wavelength interval.
Close the map window that displays the raster map Tmb1 .
In the Catalog of the Main window select satellite image Tmb1 and drag it
to the map window containing polygon map Landuse . The Display
Options - Raster Map dialog box is opened.
Accept the defaults and click OK. Raster map Tmb1 is now added to the map
window.
In the map window, polygon map Landuse is displayed on top of raster map Tmb1 .
A map window can contain only one raster map, but it can be combined with several
segment, polygon or point maps. Each of the maps displayed in a map window is
called a data layer.
In the Layer Management pane, drag and drop the Landuse data layer
below the Tmb1 data layer. Now raster map Tmb1 is displayed on top of
polygon map Landuse .
Move with the mouse pointer through the map while keeping the left mouse
button pressed. The values that can be read from the map are the values of
raster map Tmb1 .
In the Display Options Raster Map dialog box clear the Info check box.
This means that you will not see the values of the pixels anymore when
clicking in the map.
Accept all other defaults and click OK. Note that in the Layer Management
pane the i in front of the Tmb1 check box has disappeared.
Move again with the mouse pointer through the map while keeping the left
mouse button pressed. The classes that can be read from the map viewer are
the class names of polygon map Landuse .
In the Layer Management pane, select polygon map Landuse . Press the
right mouse button and choose the Remove Layer command or click the
Remove Layer button
in the Toolbar of the map window. The Remove
Layer box appears with the question Remove Polygon Map Landuse
Are you sure?
Let us now look at another polygon map. We have already seen the polygon map
Landuse , which has a class domain. We will now look at the polygon map
Cityblock , which contains the city blocks of a part of the city of Cochabamba.
Open the Layers menu and select the Add Layer command or click the Add
in the Toolbar of the map window. The Add Data Layer
Layer button
dialog box is opened.
33
In the Add Data Layer dialog box select polygon map Cityblock and
click OK. The Display Options - Polygon Map is opened.
Accept all defaults and click OK. Polygon map Cityblock is now added to
the map window. The polygon map Cityblock only covers the lower right
part of the map window.
Zoom in on the lower right part where the polygon map Cityblock is displayed and click the different city blocks to know there content.
You will see that each city block is identified by a number. These numbers, however,
do not represent measured, calculated, or interpolated values. Each city block has its
own code and information from each individual block can be obtained from a table
connected to the map. The polygon map Cityblock has an identifier domain (ID
domain).
Until now you saw two polygon maps (Landuse and Cityblock ) and two raster
maps (Landuse which was obtained by rasterizing the polygon map Landuse and a
satellite image Tmb1 ).
Now we will have a look at the other types of vector data: segment maps and point
maps.
Press the Add Layer button in the Toolbar of the map window. The Add
Data Layer dialog box appears.
In the Add Data Layer dialog box, select segment map Drainage from the
list box and click OK. The Display Options Segment Map is opened.
Select the Info check box and click OK. Segment map Drainage is now
added to the map window and is displayed on top of raster map Tmb1 and
polygon map Cityblock .
Click the drainage lines to learn the contents of the map Drainage .
As you can see, segment map Drainage contains three units: Drainage , Lake and
Main river . These are the names of three classes. The contents of the segment map
Drainage therefore, consists of classes. In ILWIS terms it is said that the segment
map Drainage has a class domain.
Let us now add another data layer to the map window: a segment map containing
digitized contour lines.
34
Open the Layers menu and select the Add Layer command.
In the Add Data Layer dialog box, select segment map Contour and click
OK. The Display Options - Segment Map dialog box is opened.
Select the Info check box, accept all other defaults and click OK. Segment
map Contour is now added to the map window.
Click the contour lines and read their meaning. Note that you can also read
the meaning of the drainage lines and the city blocks when you click them.
The contents of segment map Contour are different from segment map Drainage .
The contour lines are all coded according to their elevation. In this case the contents
cannot be represented as classes, but as values. The map Contour therefore has a
value domain.
Finally, let us have a look at a point map. The point map that will be displayed shows
the location of rainfall stations in the area (it is a fictive map, only meant for this
Users Guide and not representing the real situation in Cochabamba).
In the Catalog of the Main window, select point map Rainfall and drag it
to the map window. The Display Options - Point Map dialog box appears.
Please note that point map Rainfall also uses an ID domain. The domain of a map
is always indicated at the top of a Display Options dialog box. In the dialog box
there is an option to show the names of the points as well.
Select the check box Text. Some extra text options appear.
In the Symbol dialog box select Symbol Type: Simple , Symbol: Square ,
Size: 5, Fill Color: Green , Line Width: 1, and Color: Red .
Click OK in the Display Options - Points dialog box. The point map is
now added to the map window.
Note that the names of some of the rainfall stations are only partially shown, because
those stations are situated just outside the area covered by the satellite image.
Practice some more with the Layer Management pane. Add some other
polygon and segment maps, and see the domain used by the maps. Practice
also in changing the order of the layers by dragging a layer up or down
35
in the Layer Management pane. You can also choose not to display a data
layer by clearing its check box.
36
In several other raster-based GIS systems, and also in the previous DOS versions
of ILWIS, you always had to remember what each pixel represented. For example,
if you had a land use map with 4 classes (in which 1 = Agriculture , 2 =
Forest , 3 = Grassland and 4 = Shrubs ) and when you wanted to find the
areas which are suitable for further development (e.g. the current shrub area).
Then, to show the suitable areas you had to use a map calculation formula (this
will be explained in depth in chapters 7 and 8) which had the following form:
Result = IFF(Landuse=4, 1, 0)
This formula meant: if the Landuse map has a pixel value of 4 (shrubs), then the
resulting map will have a value of 1 (meaning that it may be used for further
development), and otherwise a value of 0 (not suitable).
From ILWIS 2 onward, you use domains and you no longer need to know the relation
between the pixel values and the classes, since ILWIS keeps track of that. In ILWIS,
your map calculation formula reads:
Result = IFF(Landuse=Forest, Suitable, Not suitable)
The resulting map is also a class map, so you directly know what the units mean.
Lets us look now at some other advantages of domains.
More about class domains
Class
A class domain consists of a list of class names and optionally class codes. Elements
in a map (points, segments, polygons or pixels) which uses a certain class domain,
are coded by the class names and codes present in that class domain; elements
37
without a class name are considered undefined. The same class name can be used for
several points, segments, polygons or mapping units in one map. As you will
remember from the previous exercise, polygon map Landuse had a class domain,
which contained the names of the different land use types.
The Domain Class editor allows you to add new items to the domain, and to change
or delete existing ones. One should be careful, however, with deleting domain items,
since this may cause problems in the maps and tables that use this domain. For
example, if you delete the Forest item, there will be polygons in the map Landuse
with an internal code that is not present anymore in the domain. The forest unit in the
map will then be represented as undefined (?) and will also loose its color. You
should always take care that a domain contains all the items that can occur in a map
or a table.
A domain may contain more items, however, than are present in the map. This is very
useful if you have different maps dealing with the same topic, for example multitemporal land use maps of a certain area, or various geological maps with the same
legend.
What is the advantage of the domain approach? Let us give an example:
Suppose you have two land use maps of different regions in the same country.
Suppose in one map you have land use types agriculture, grassland and shrubs,
and in the other map agriculture, forest and shrubs. In the DOS versions of
ILWIS, pixel values of your units might be Agriculture = 1, Grassland = 2
and Shrubs = 3 for the first map, and Agriculture = 1, Forest = 2 and
Shrubs = 3 in the second map. So, pixel value 2 is once forest and once grassland, which is very confusing!
However, if you use one domain containing all the possible land use classes, you
do not need to care about pixel values of separate maps since all the necessary
information for all your land use maps is stored in one domain. The domain then
contains the class names: Agriculture , Forest , Grassland , Shrubs .
Open the File menu in the Domain Class editor, and select the Properties
command or click the Properties button
in the Toolbar of the editor.
The Properties of Domain Class Landuse sheet appears, which
describes among others what this domain is used for.
You see a list of objects that are using this domain Landuse : raster map Landuse ,
polygon map Landuse , table Landuse , and representation Landuse .
38
Click the Cancel button in the Properties sheet and close the Domain
Class editor.
This is the domain of the geomorphologic map. The list of classes in this domain
looks a bit different to the one of the land use classes. You see first a Class Name
and then a Code. Since some of the class names can be very long, ILWIS allows the
use of abbreviations, or codes for the domain items. This is very handy when you
want to do calculations with maps, or columns. Instead of having to write a
expression like:
Result = IFF(Geomorphology=Accumulation of debris on slope,
Possible landslide, Not a possible landslide)
Codes can be entered, edited and deleted with the Add Item, Edit Item and Delete
in the Toolbar of the
Item commands on the Edit menu, with the buttons
Domain Class editor or by using the right mouse menu on a domain item.
ID
In the Catalog, click domain Cityblock with the right mouse button and
select Open from the context-sensitive menu.
39
Domain Rainfall is also an ID domain (you can check this for instance by opening
the Properties of the domain). In this domain, the individual items are the unique
names of the rainfall stations. It is not a class domain, since each name is only valid
for one rainfall station only. If it would be related to more rainfall stations, the system
would not know to which station the data in the corresponding table Rainfall are
referring.
Value
Height .
Domain Height is used for segment map Contour which contains contour lines. A
value domain looks quite different from a class or ID domain. It is not a list of names
or codes, but it is a definition of certain values that should be used in a map or a
column. In this example, domain Height describes the Height in meters .
For the Cochabamba area, height values range from 2500 to 4600 meters. These are
the minimum (Min) and maximum (Max) values of the domain Height .
The Precision of a value domain determines the increment between two possible
successive values. The precision determines for instance the number of decimals that
are used to store the values. When you use a precision of 0.1 the values are stored
with 1 decimal. You can also store values with a certain step size, for example only
the values ending on 5, 10, 15, 20, 25, etc. In that case you use a precision of 5. You
can use any value for the precision, as long as it makes sense with respect to the
minimum and maximum value, and the meaning of the values. For instance, it would
be quite useless to use a precision of 0.001 for the domain Height , since the altitude
of the contour lines are in meters on the topographic map from which they were
digitized.
It is important to keep in mind, that if you use very small values for the precision (for
40
There are also a number of system-defined value domains. These value domains are
defined by the system and are stored in the ILWIS\System directory. System-defined
value domains can be displayed in the Catalog but it is not possible to change them.
In the Main window open the View menu and select the Customize
in the
Catalog command or click the Customize Catalog button
Standard toolbar. The Customize Catalog sheet appears.
On the Selection tab, select object type Domain in the list box and click
Apply. Now you will see only the user-defined domains in the Catalog.
These domains have been made especially for the data set.
On the Selection tab, select the check box Include System Objects and
click OK. Now also the system-defined domains are listed in the Catalog.
The most important system-defined value domain is the one called Value. In fact you
can make all other value domains with this domain. The others are given to prevent
you from needing to define domains too often. Let us look at some examples.
Open the system domain Value . As you can see, the minimum value that
can be stored is -9999999.9 and the maximum is the positive equivalent of
that. So it is safe to conclude that you can store all possible values which
may occur in maps and tables in the value domain.
Close domain Value and open domain Perc . This is a special value domain
which is intended for storing percentage values with a default value range
between 0 and 100, and a precision of 0.01 (two decimals).
Close domain Perc and open the Bool domain. This is the Boolean domain,
which only allows two situations: False (0) or True (1). Like most other
41
value domains also undefined values can be used in the Bool domain. In
maps and columns, undefined values are represented by a question mark (?).
Have a look at some other system value domains. When you have finished,
select all object types again via the Customize Catalog sheet and clear the
check box Include System Objects.
There are some domain types that we have not yet treated so far, because they are
specific for certain operations. They will be discussed later on in this book. A
complete overview of domains can be obtained from the ILWIS Help topic ILWIS
Objects, Domains.
Summary: About domains
- A domain stores the set of possible data values that are used by a map, table
and/or column. All ILWIS data objects (vector maps, raster maps and tables) always
have a domain.
- The same domain can be used by a vector map, a raster map and a table.
- The four most important types of domains are: class domains, identifier domains,
value domains and the image domain.
- Class domains are used for data objects that contain classes. A class domain may
for instance store the names of land use units or geomorphological units.
- ID domains are used for data objects that contain unique identifiers. An ID domain
may for instance store the unique IDs of city blocks, or the unique IDs of rainfall
stations.
- Value domains are used for data objects that contain measured, calculated or interpolated values. A value domain may for instance store the values (range and precision) needed to define heights or to define concentrations.
- The system Image domain is used for satellite images or scanned aerial photographs containing values between 0 and 255. This domain is a special type of
value domain, as the image domain cannot contain undefined values.
- Class and ID domains are always user-defined. Value domains can be user-defined,
or system-defined.
42
Class domains have the most straightforward representation. A map with a class
domain should have a representation, otherwise it is impossible for ILWIS to know
how to display it. A representation for a class domain is always user-defined. The user
should set the color for each class in the class domain.
Accept the defaults in the Display Options - Polygon Map dialog box by
clicking OK. The polygon map is displayed.
The Layer Management pane shows the Legend of the Landuse map,
which is in fact, representation Landuse . Double-click the word Legend in
the Layer Management pane. The Representation Class editor is opened
in the polygon mode (e.g. the Polygon tab is active).
Each item in the domain has a color assigned to it. The colors can be edited by
clicking on an item, and then changing the Red/Green/Blue amount by dragging the
slide bars in the Color Slider, by selecting a color in the Color Selector or by
double-clicking an item in the editor.
Practice with changing colors as explained above. Change also some colors
by using the Edit Item(s) button
or by opening the Edit menu and selecting Edit Item(s).
Select the Segment tab and look at the representation. After that, select the
Point tab. Since we can use the same domain, and the same representation
for raster, polygon, segment and point maps, these options can used to see
what a line would look like, or a point, or an area.
Identifier domains (ID) do not need a user-defined representation because the IDs are
usually just numbers without a certain meaning.
43
For an identifier map such as the map Cityblock it would be useless to spend
much time in defining the color of each individual item by hand, since different
colors do not represent any thematic difference. The colors are only used to make a
differentiation between the units. Therefore, a user-defined representation is not
needed.
Furthermore, you will generally display ID maps by one of the attributes found in the
attribute table of the map. For more information see section 7.2.
Value
In the Catalog, click domain Height with the right mouse button, and
select the Properties command from the context-sensitive menu. The
Properties sheet is opened. As you can see, domain Height has a representation value called Height .
Close the Properties sheet and open representation Height by double-clicking the object in the Catalog. The Representation Value editor is opened.
44
Select the Limit 3500 , open the Edit menu and select the Edit Limit command or click the Edit Limit button
in the Toolbar of the
Representation Value editor.
In the Edit Limit dialog box, change the color to LawnGreen and click OK.
Open the Edit menu and select Stretch Steps. The Stretch Steps dialog
box is shown. Change the Stretch Steps value to 30 and click OK.
Select the word Stretch in the editor. A drop-down list box appears.
From the Edit menu choose Insert Limit. The Insert Limit dialog box
appears.
Click once more to open the list box and select the word Upper. This means
that all values between the limits are displayed in the color of the upper limit.
Insert a new limit (Value 4000 , Color Gold ) and click OK in the Insert
Limit dialog box.
Click the Customize Catalog button in the Standard toolbar of the Main
window. The Customize Catalog sheet appears.
On the Selection tab, select object type Representation in the list box,
select the check box Include System Objects and click OK. Now you will
see only the representations, including the system-defined ones.
Open some of these representations to see how the colors are assigned to different percentage values.
Click again on the Customize Catalog button. Select all the objects from
the list, clear the check box Include System Objects and click OK.
45
46
Accept all defaults in this dialog box and click OK. Polygon map Landuse
is displayed.
Move the mouse pointer through the map and verify the display of coordinates in X and Y values, as well as in degrees, minutes and seconds in the
Status bar.
Click the Customize Catalog button in the Standard toolbar of the Main
window. The Customize Catalog dialog box is opened.
The Catalog now only shows coordinate systems. One coordinate system was made
especially for the data set: Cochabamba . The other three (Latlon , LatlonWGS84
and Unknown) are standard ones.
A coordinate system defines the possible minimum and maximum Xs and Ys that
can be used in a map, and in case of a coordinate system of type projection, you can
also store information on a maps projection, ellipsoid and/or datum. Normally
locations on the earths surface are shown in geographic coordinates.
47
Figure 2.2:
The shape of the earth is like a ball (spherical) or like a horizontal rugby ball with
flattened poles (ellipsoidal). To represent areas from this sphere or ellipsoid into a
plain surface, you need a map projection. The earths surface can even be better
approached if a projection uses a datum. With the help of a map projection,
geographic coordinates are converted into a metric coordinate system, measuring the
X and Y directions in meters. Practically every country in the world uses its own
coordinate system, based on a certain projection. One of the most used projections is
the so-called Universal Transverse Mercator (UTM).
The UTM is an international metric coordinate system, which covers the whole earth
and divides it into 60 zones each covering 6 Longitude. Because of the small area
covered by each zone, a high degree of accuracy is possible.
In ILWIS you can digitize a map either in metric or in geographic coordinates. The
conversion from geographic to metric coordinate is done via a map projection. For
example, point data obtained from GPS (Global Positioning Systems) may have been
registered in geographic coordinates.
ILWIS has three standard coordinate systems:
- Latlon : Geographical coordinates in degrees.
- LatlonWGS84 : Geographical coordinate system using the WGS84 datum.
- Unknown : When coordinates are not known. This coordinate system should not be
used.
For more information on types of coordinate systems and transformations, see section
4.2. In general its best to create a coordinate of type projection and specify the
minimum and maximum X and Y coordinates of your study area. Projection
information may be added to the coordinate system in a later stage or not at all.
48
Note that the Projection in the coordinate system Cochabamba is UTM , with
the Ellipsoid International 1924 and that the Datum is Provisional
South America 1956 , with the Datum Area Bolivia .
49
Check if the pixel size given in the GeoReference Corners editor is correct; subtract the minimum X value from the maximum X value. Then divide
the resulting value by the number of columns.
For such calculations you can also use the Command line of the Main window.
Position the mouse pointer on the Command line and type an expression
such as:
?(maxX-minX)/nr. columns
Close georeference Cochabamba after you have seen the result of the
expression in the Calculation Result box.
For satellite images, scanned aerial photographs and other imported images, which
may not be north-oriented, we have another type of georeference: a georeference
tiepoints.
50
In the Catalog double-click georeference Tmgeo . The Display Options Raster Map dialog box of Tmb1 appears. Accept the defaults and click OK.
The GeoReference Editor: Tmgeo is opened.
In the satellite image you will see seven points displayed, which are related to the
seven points in the Tie Point Table of the GeoReference Tiepoints editor. For each
point the X- and Y-coordinates are given, along with the Row and Column locations
of these points in the image. On the basis of these coordinates using an Affine
transformation, all rows and columns will be assigned X- and Y-coordinates, with a
certain error, expressed as Sigma. In Chapter 6 we will treat the GeoReference
Tiepoints editor in much more detail.
What is important to note here is that the image is not oriented perfectly to the north.
The image is distorted with respect to a topographic map. When you want to overlay
images in combination with north oriented maps, you need to remove the distortion
of the image by resampling it (see chapter 6).
Close the GeoReference Tiepoints editor by opening the File menu and
selecting the Exit Editor command or by clicking the Exit Editor button
Do not close the map Tmb1 .
Click the Add Layer button. The Add Data Layer dialog box appears.
Open the Layers menu and select Add Grid Lines. The Display Options
Grid dialog box is opened.
In the Display Options Grid dialog box change the Color to Yellow ,
accept all other defaults and click OK. The grid layer is now displayed on top
of the two map layers.
In the Add Data Layer dialog box, select segment map Contour and click
OK, and again OK in the Display Options - Segment Map dialog box. The
Contour map is now displayed on top of the image.
The grid lines are displayed in a rotated way. From this you can conclude that the
image is distorted and not oriented to the north.
Drag and drop raster map Landuse in the map window. Raster map Tmb1
will be replaced by raster map Landuse . You will see that the display of grid
lines and the contour lines now changes. They are now displayed in a northoriented way.
51
52
In the Catalog, select domain Landuse , table Landuse and polygon map
Landuse (hold the Ctrl-key down while selecting the objects).
Click the right mouse button and select Open from the context-sensitive
menu. All three objects are opened.
Move the three windows in such a way that you can see all three next to each
other. Resize the windows if necessary.
Click several units in the polygon map. Note that the class names appear in
the map, in the table and in the domain.
When finished activate the Main window, open the Window menu and select
Data Windows, Close All. All three windows will be closed.
In the Catalog, select table Landuse , click it with the right mouse button
and select Properties. The Properties of Table Landuse sheet is opened.
Note that the domain of the table is Domain Class Landuse. Click the
Cancel button.
Click with the right mouse button on polygon map Landuse , and select
Properties. The Properties of Polygon Map Landuse sheet appears.
Note that this map also uses the Landuse domain. Close the Properties
sheet by clicking Cancel.
So we can conclude that maps and tables can be linked if they have the same domain.
However, there is a very important restriction that should be mentioned here. It is
only possible to have an attribute table with a class domain, or with an ID domain.
Tables with a value domain are not possible. The reason for that is:
- Suppose you have defined a value domain with minimum 0 and maximum 10000,
and a precision of 0.01. In that case, a table connected to the map should have a
very large number of records (10000*100 = 1,000,000). The number of records and
the extreme size of a table will become a problem.
- A more important reason, however, is that value maps themselves do not contain
information to which attributes they can be linked. They are in fact attribute maps,
and not thematic maps. The Landuse map (with a class domain) can have an
ILWIS 3.0 Users Guide
53
54
Position both windows next to each other and move the mouse pointer over
the map.
In the map window, open the File menu and select Open Pixel Information.
The pixel information window (Figure 2.3) is opened.
A pixel information window consists of many items that you have seen before in map
and table windows, such as a Control-menu icon , Title bar, Menu bar, Status
bar, etc. Some special items in this window are:
Top left button: the upper left gray button in the pixel information window can be
used to open the Customize Pixel Info dialog box.
Information viewer: where the information of the selected data objects for the actual
position of the mouse pointer in a map window is displayed.
Menu bar: the menus of the ILWIS pixel information window are: File, Edit,
Options and Help.
Figure 2.3:
55
If you want to display information on maps and tables in the pixel information
window, you must make sure that at least one map is displayed in a map window, and
that the maps are linked to their attribute tables.
We will now add map Geomorphology to the pixel information window to read the
information from this map, along with that of the Landuse map.
Drag and drop the polygon map Geomorphology from the Catalog to the
pixel information window.
Move the mouse pointer over the map to display the information continuously.
In the pixel information window, you can read the information of the mapping unit in map Geomorphology , and of the mapping unit in map
Landuse at the same location.
Click the Top left button in the pixel information window or open the
Options menu and select the Customize command. The Customize Pixel
Info dialog box appears. continuously.
The Customize Pixel Info dialog box shows a list of maps, tables and columns that
are presently visible in the pixel information window. The list box Show values of
can be used to select the maps, tables or columns you would like to see. You can
select or deselect them by clicking on them. Selected items appear highlighted. With
the check boxes you can define if the information is displayed when working with a
Mouse pointer or with a Digitizer cursor, and whether the information should be
displayed continuously (while moving over the map), or only when you click a unit.
56
57
In the Main window open the View menu and select Details or click the
Details button
in the Standard toolbar. The Catalog, which is
currently active, changes from a List View into a Details View.
The Details View is a table with columns that give you extra information on
individual objects such as: dependent or not, used domain/georeference/coordinate
system, description, expression, etc. To change the order of the columns in the
Catalog:
Drag the vertical line which separates two column headers to the left or right.
The Catalog is by default ordered ascendingly by Name but you can order the objects
descendingly or use another sorting method (e.g. by Type, Size, Attribute, etc.).
Click column header Name. The objects will now be sorted descendingly.
Click the column header Name once more. The objects are sorted ascendingly again.
Click the right mouse button in the white space of the Catalog, choose the
Sort By command from the context-sensitive menu, and select sorting
method Type. The Catalog is now ordered by object type (i.e. coordinate
system, domain, georeference, etc.).
Open the View menu in the Main window, select Sort By and the sorting
method Object Size.
Sorting ascendingly and descendingly can be used on any column. You can also sort
objects when in List View. To return to the original situation:
Open the View menu in the Main window, select Sort By and sorting
method Name or click the column header Name in the Catalog.
By using a Catalog query, ILWIS will scan the contents of all object definition files
in the current Catalog and show only those objects that are the result of the query.
58
Open the View menu in the Main window, select Catalog Queries and the
predefined query Maps with georef tiepoints.
In this Catalog, raster map Tmb1 is the only map that uses a georeference tiepoints.
The query that is in use is shown in the Status bar of the Main window. Besides
using predefined queries it is also possible to construct your own queries.
Click the Customize Catalog button in the Standard toolbar of the Main
window. The Customize Catalog sheet is opened.
Select the Query tab and click the Help button to get information about
defining your own queries.
To turn off the query, type Dir on the Command line, or open the View
menu, and select the Catalog Queries, All command.
59
Click in the Catalog with the right mouse button on class domain
Landuse , and select Properties from the context-sensitive menu. The
Properties sheet is opened.
A list of objects is shown which use this domain Landuse : raster map Landuse ,
polygon map Landuse , table Landuse , and representation Landuse .
To understand the Figures 2.4 and 2.5 it is good to look at the properties of
several maps.
60
In the Catalog click with the right mouse button on domain Cityblock
and select Properties from the context-sensitive menu. The Properties
sheet appears.
Figure 2.4:
The properties of vector maps with a Class, Identifier and Value domain in ILWIS. The data objects are
shown in a shaded box.
61
Figure 2.5:
The properties of raster maps with a Class, Identifier, and Value domain in ILWIS. The data objects are
shown in a shaded box.
Compare the result with Figure 2.4 and close the Properties sheet afterwards.
Repeat this for value domain Height . This domain is used by segment map
Contour and by representation Height . Compare with Figure 2.4.
The properties of tables and columns are schematically represented in Figure 2.6. A
table should have a class or ID domain. A table contains a number of columns. Each
column also has a domain (e.g. class, ID, value or other special domains such as
color, string, Bool, etc.).
62
Figure 2.6:
In the Column Properties sheet you see that column Landvalue uses the
system Value domain. Click Cancel to close the Column Properties
sheet.
To view the properties of the table, open the File menu and select
Properties. The Properties sheet of table Landuse is opened. You see that
the table has class domain Landuse .
Dependencies
The relationships between a data or service object and several service objects are
called the properties of the object.
When maps are used to create other maps, for instance by performing an operation or
executing an expression, then this operation or expression and the input map name(s)
are stored inside the new map. This is what ILWIS calls dependency.
63
Figure 2.7:
The dependency link between objects. The output raster map is made from a polygon map and a georeference, using the Polygon to Raster operation.
The dependent raster map, which is the result of the Polygon to Raster operation
(i.e. the Rasterize Polygon Map operation), contains information on the source
objects from which it was created. In this case a polygon map and a georeference. Let
us check this example in the data set.
64
Click in the Catalog with the right mouse button on raster map Landuse
and select Properties from the context-sensitive menu. The Properties
sheet with the title Properties of Dependent Raster Map Landuse is
opened (see Figure 2.8).
Figure 2.8:
The Raster Map tab gives you information on the service objects of this map and
information on how the map was made (i.e. the Definition):
MapRasterizePolygon(Landuse.mpa,Cochabamba.grf)
Where:
MapRasterizePolygon is the Polygon to Raster operation;
Landuse.mpa is the polygon map Landuse used to generate this map, and
Cochabamba.grf is the georeference Cochabamba used to generate this map.
Why does ILWIS keep track of the objects that are used to generate another one?
When you update input source maps, tables or columns by editing, the dependent
output maps, tables or columns which use these source objects can be easily
recalculated.
65
Click on the Dependency tab. Note that the line below the expression
MapRasterizePolygon(Landuse.mpa, Cochabamba.grf) says:
Object is up-to-date.
This means that none of the source objects (i.e. polygon map Landuse and
georeference Cochabamba ) have been updated since the dependent raster map was
generated. You can verify this by examining the Catalog.
In the Catalog click with the right mouse button on polygon map Landuse
and select Edit from the context-sensitive menu.
In the Polygon editor change for example the polygon Lake, near the Urban
centre, into Urban periphery and close the window afterwards.
The polygon map is updated now. In the Catalog of the Main window you can see
that the polygon map Landuse has been modified and that raster map Landuse is
now Dependent (D), Calculated (C) and Not Up-to-Date (N).
It is important to keep in mind that dependent maps are not automatically updated.
ILWIS does keep track of the dates and times at which the source objects were
modified. Only when you click the button Make Up-to-Date on the Dependency
tab of the Properties sheet, ILWIS will ask you if you want to recalculate the map.
66
In the Preferences of the Main window, you can select the check box Give a
Warning when an object is not up-to-date. If you select this check box ILWIS
gives you a warning when you want to open an object that is not up-to-date anymore.
Click the button Release Disk Space. The Release Disk Space dialog
box appears.
Click Yes in the Release Disk Space dialog box. The Properties sheet
closes.
Now the actual data file of the raster map is deleted. Only the definition of the map
remains, so the map can always be recalculated. In the Catalog of the Main window
you see that the raster map Landuse is now Dependent (D), Not Calculated (N)
and Not Up-to-Date (N). We will recalculate the data file of the raster map below.
In this example the raster map had 932 lines and 637 columns. Each pixel was stored
as 1 byte. So you save 932*637 = 593684 bytes of disk space, without losing any
actual information.
You will see that the contents of the sheet have changed. On the General tab, note
the size of the object: 814 bytes. This amount of storage space is needed for the
information of the object definition file. On the Dependency tab, you now find a
button Calculate. By pressing this button you can recalculate the map using the
expression which is available in the object definition file of raster map Landuse .
67
Now the dialog box looks like it was in the beginning. Note the object size is almost
600000 bytes.
It is also possible to convert a map (or a table, or a column) from being a dependent
object to a source object. In that case you will break the dependency link. After that,
the map cannot be updated anymore from the Properties sheet. You actually need to
do the operation again.
The Properties sheet will not contain information on the dependency links anymore
(i.e. the Dependency tab is not available anymore in the Properties sheet).
In chapter 7, the link between maps and tables is explored further and in chapter 8
you will practice some more with dependencies.
Summary: Object properties and dependency links
- The relation between a data object and service objects, or between service objects
among themselves, is specified by the properties of the object.
- The properties are different for vector maps, raster maps or tables. The properties
depend largely on the type of domain which is used.
- The link between output data objects, obtained from other input data objects
through an ILWIS operation is defined by dependency links.
- Maps, tables and columns are originally when they are digitized, imported or created by typing. These objects are called source objects
- Output maps, tables and columns which are created through a calculation or an
operation are called dependent objects.
- The concept of dependency has a number of important advantages:
Easy update: when you have new information and you edited input maps, tables
or columns accordingly, the dependent output maps, tables or columns can be
68
69
70
CHAPTER 3
Introduction to digitizing
The most common method of entering spatial data in ILWIS is digitizing. Features on
a paper map or other analog documents (e.g. a photo-interpretation on a piece of
tracing film) can be digitized. This can be done using a device called a digitizing
tablet, or digitizing table, or simply digitizer. A digitizer contains a pointing device
(digitizer cursor) to trace spatial features. The position of the digitizer cursor is
registered electronically to a precision of fractions of a millimeter. This is done
through a fine grid of wires embedded in the digitizer (Figure 3.1).
The vertical wires record the X-coordinates; the horizontal ones the Y-coordinates.
The range of digitizer coordinates depends, amongst other things, on the density of
the network of wires: digitizer resolution. The cursor contains a small transparent
window with a cross-hair, and a number of buttons (at least four buttons are needed
ILWIS 3.0 Users Guide
71
Figure 3.1:
72
73
74
Note that if you want to extend your study area and digitize adjacent areas you
need to extend the range of coordinates as defined in the coordinate system.
Click the Datum button and select the Datum: Provisional South
American 1956 and select the Area: Bolivia .
If you now click the Ellipsoid button, you can see that the ellipsoid
International 1924 is used. Click Cancel in the Select Ellipsoid dialog box.
Coordinate system Cochabamba is now created and you can proceed with the
digitizer installation and configuration.
75
For more information see the ILWIS Help topics How to set up a digitizer and
start digitizing and Digitizer Setup Wizard.
where:
ai,j and bi are the affine transformation coefficients.
76
Figure 3.2:
To determine the six transformation coefficients, at least three coordinate pairs are
required. If three or more coordinate pairs are entered, the equations are complete and
the coefficients are calculated. Using the affine transformation, new sets of
coordinate pairs are calculated for the control points. The differences between the
actual and the calculated coordinates of the control points (the residuals), indicate
how well the control points have been digitized and entered. Errors in location or
typing result in large residuals.
To digitize a map, the coordinate system of the map must be referenced to that of the
digitizer. In this exercise the point map shown in Figure 3.3 will be referenced.
From the File menu of the Main window, select Map Reference.
Position this map in the center of your digitizer and fasten it to the digitizer
with tape. With some digitizers you can also place the paper under a plastic
cover, so that it remains fixed.
The first Map Referencing dialog box is opened. In this box you can select or create
a coordinate system, which stores the minimum and maximum X and Y coordinates
of the map, and optionally a projection for the map. The information is used to
describe how coordinates on the earth surface are related to corresponding
coordinates on the map.
The check boxes in the dialog box are used to select metric or geographic
coordinates. Note, if you choose geographic coordinates, a projection and associated
ILWIS 3.0 Users Guide
77
You can use the Transform Coordinates operation, to check whether the transformation from metric to geographic coordinate system and vice versa is correct
(see also chapter 4, section Map projections).
The second Map Referencing dialog box (Figure 3.4) and the Map Referencing
command box (Figure 3.4) are opened. The Map Referencing command box shows
the coordinates of the digitizer cursor location and contains the options: Digitize
Point, Next Point and Delete Point. The numbers (0, 1, 2, 3) refer to the digitizer
cursor buttons which are normally labeled 0, 1, 2, 3, or 1, 2, 3, 4, or A, B, C, D. The
commands in this window are used for digitizing control points and have the
following meaning:
- Button 0: To digitize a control point on the map.
- Button 1: To move to the next control point.
- Button 2: To delete the currently active control point.
78
Move your digitizer cursor over the digitizing table. When you do so, you
should see the coordinates change in the upper part of the Map Referencing
command box.
When you dont see any coordinates in the Map Referencing command box, or
when the coordinates remain the same while you move the digitizer cursor over
the digitizer, your digitizer is not set-up properly. Check the digitizer installation
(See section 3.2.1 or refer to ILWIS Help, topic How to set up a digitizer and
start digitizing).
Figure 3.3:
79
Position the digitizer cursor at point A of the map and press the 0 button.
Make sure the mouse pointer is located in the first (left hand) coordinate text
box. Type 795000 for the X coordinate and press the Tab key. The mouse
pointer is now located in the right hand coordinate text box. Type 8071500
for the Y coordinate of the point.
Type 808500 for the X coordinate and 8071500 for the Y coordinate of the
point.
Move the digitizer cursor to point C and press the 0 button.
Type 808500 for the X coordinate and 8090500 for the Y coordinate of the
point.
Move the digitizer cursor to point D and press the 0 button.
Type 795000 for the X coordinate and 8090500 for the Y coordinate of the
point.
You can use Ctrl+C and Ctrl+V to copy and paste coordinate values.
Figure 3.4:
The Map Referencing dialog box and the Map Reference command box (upper
left). The actual values displayed on your computer may be different from the ones
shown in the figure, depending on the type of digitizer you used, the precision (lines
per inch), and the accuracy with which you digitized the four points.
Accept the default Affine transformation and click the OK button if the
Sigma is less than 1.
If the Sigma is larger than 1, repeat entering the control points until the
sigma is less than 1 and then click the OK button.
The Map Referencing dialog box will be closed. The digitizer is now referenced to
the map. The map reference settings are stored and will remain unchanged until you
enter a new reference setting. If the position of the map on the digitizer has changed,
or if you start to digitize another map, it is necessary to reference the map again.
ILWIS 3.0 Users Guide
81
When you digitize paper maps that are quite old, or that have been exposed to
sunlight, the paper may not contain the same scale in X and Y direction, due to
shrinking. In such a case you will also not reach a sigma that is around 1, and you
either have to get a better paper copy to digitize, or accept that it is less accurate.
When producing a map from image interpretation that is to be used for digitizing,
it is therefore recommended, not to use paper, but a transparent film type that will
not shrink.
82
It is assumed that the photocopy of Figure 3.3 is still attached in the same position
on your digitizer table. If you removed the map, you will have to repeat the map
referencing (explained in the previous exercise), since the position of the control
points on the digitizer may have changed.
In the Operation-tree in the Main window, expand the Create item and
double-click New Point Map. The Create Point Map dialog box is opened.
Click the Create button next to the Domain list box. The Create Domain
dialog box is opened.
The domain type identifier (ID) is selected for this point map, because each point in
the map is identified by a unique number. Selecting the domain type identifier, a text
box with the default value 0 appears. Optionally, you can use the text box to define
the number of items in the domain. It is then also possible to give each item a prefix
(e.g. nr , or point ).
83
Close the Domain Identifier editor. You are now back in the Create Point
Map dialog box. Note that the domain Mountain_top , which you just
created, is indicated in the list box Domain.
The Point editor and the Point editor command box are opened (Figure 3.5).
Figure 3.5:
The Point editor command box shows the position of the digitizer cursor and
consists of the following commands:
- Button 0: Add Point: For digitizing a new point.
- Button 1: Move Point: Allows you to move a point.
- Button 2: Change Window: For changing the window displayed on the screen.
- Button 3: Edit Point: For editing the label of a point.
The following buttons on the Toolbar of the Point editor window are shortcuts to
84
segment) with the mouse and drag it to a new position. When you click the Move
Point Mode button, the mouse pointer appears as a pair of tweezers.
Insert Mode: this allows you to insert new features with the mouse. When in the
Insert Mode, the mouse cursor appears like a pencil.
Undo All Changes button: to undo all changes since you last used the Save
button. If you havent used the Save button sofar, the original map will be
restored.
Save button: to save your map to disk.
Exit Editor button: used to exit the editor.
The Point editor works in the Select, Move Points and Insert Modes.
You can work with the Point editor by using the mouse or the digitizer apart or
simultaneously.
Digitizing points
In this exercise you will digitize new points using the digitizer cursor.
Position the digitizer cursor at point 1 and press button 0 (Add Point).
Digitize the rest of the points (Figure 3.3) and label them as follows:
A small box is opened at the digitized point. Type P1 in this box and press
Enter .
Table 3.1: The codes used for digitizing the points in Figure 3.3.
Point #
Point label
Point #
Point label
Point #
Point label
1
2
3
4
5
P1
P2
P3
P4
P5
6
7
8
9
10
P6
P7
P8
P9
P10
11
12
13
14
15
P11
P12
P13
P14
P14
When you enter the label P14 for point 15, a message appears indicating that the
label P14 is used for another point. Although the ID domain allows duplicate names,
it is not very logical to have two points in an ID domain with the same name. To
ILWIS 3.0 Users Guide
85
Click No in this box and enter a new name for this point.
Type P15 and press Enter .
It is recommended to save your work regularly during the digitizing process: you
can either use the Save button or the Save command on the File menu. When
you leave the editor using the Exit Editor button, your work is saved automatically.
Editing a point
The label (ID) of a point can be edited or changed if incorrectly entered. To edit or
change the label of a point:
Position the digitizer cursor at the point which has to be edited, in this case
point 15 and press button 3. Type a new label for this point, e.g., P16 and
press Enter .
Moving a point
A point can be moved either by choosing the Move Points Mode in the Toolbar or
by using the digitizer cursor:
Position the digitizer cursor at the point which has to be moved, in this case
point 14 and press button 1. The digitizer cursor on your screen changes
from an x to a +.
The Move Point command box (Figure 3.6) is shown. It has the following options:
- Button 0: New Position: Specifies the new position for the selected point.
- Button 1: No function.
- Button 2: Change Window: Changes the window displayed on the screen.
- Button 3: Return: Returns to the Point editor command box.
Figure 3.6:
86
Move the cursor about a centimeter above the point 14 and press button 0.
In the Toolbar, choose with the mouse the Select Mode button
Multiple points can be selected by pressing the Shift, or the Ctrl key while you select
more points. The digitizing of points is now finished, so you can exit the Point editor.
in the Toolbar.
87
Figure 3.7:
When you digitize a polygon, the boundary lines of this polygon should be
connected. The connection of one line to another is called snapping. Snapping always
takes place at a node (the end of a line). Snapping is needed for polygons, and for
segment maps that represent a network (e.g. a drainage network, or a road network).
Snapping is not required for other segment maps, such as a contour map. When you
digitize a contour map, you can only snap lines that have equal altitude.
You can digitize a line, by holding down the cursor button and simultaneously
moving the cursor on the line (digitizing in stream mode). The line coordinates are
recorded at regular time intervals. The disadvantage is that many points are needed to
define the segment. Many of these points do not improve the accuracy of the line and
are considered redundant.
You can also digitize a line, by pressing the cursor button only when a point in the
segment needs to be digitized (digitizing in point mode). In this way coordinates are
only recorded if the button is pressed. The number of points used to store a segment
depends on the complexity of the line, and on the accuracy of the person digitizing.
88
Figure 3.8:
The process of tunneling using two different tunnel widths. See text for explanation.
In this exercise, a segment map which contains information about the road network in
the area will be created. This segment map is presented in Figure 3.9.
From the File menu of the Main window, select Map Reference. The first
Map Reference dialog box is opened.
Remove the photocopy of Figure 3.3 if it is still on the digitizer. Position the
photocopy of Figure 3.9 in the center of your digitizer, and fasten it to the
digitizer with tape. With some digitizers you can also place the paper under a
plastic cover, so that it remains fixed.
When a new map is placed on the digitizer, or when you have moved the map that
you were digitizing before, you will have to reference the map again. However, the
Map Reference dialog box still contains the X and Y values of the control points of
the previous map. So if the new map uses the same control points, the only thing to
do is to digitize the four points. Once a map is referenced, it remains like that, until
you make a new map reference. So even if you turn off the computer and when later
89
Digitize the four control points of Figure 3.9. Make sure to digitize the correct points for the XY coordinates that are already given in the Map
Reference dialog box. Click OK when the error is tolerable (Sigma value is
around 1 or lower). Otherwise digitize the four points again.
From the File menu of the Main window, select Create, Segment Map. The
Create Segment Map dialog box is opened.
Type Road in the text box Domain Name, make sure the option Class is
selected as the domain type and click OK. The Domain Class editor is
opened.
It is possible to write the names of the domain items in the Domain Class editor
directly. In this exercise, however, you will create the names during digitizing.
Close the Domain Class editor. You are back in the Create Segment Map
dialog box.
The Segment editor and the Add Segments command box are opened. The
Segment editor works in Select Mode, Move Points Mode, Split/Merge Mode
and Insert Mode.
Split/Merge Mode: This is only used in the Segment editor. It allows the
splitting of segments and the creation of a node. It also allows the removal of
unnecessary nodes. When you click this button the mouse pointer changes to a
pair of scissors.
90
LEGEND
Segments EF, PQ, HR and RNO
Segments LFMN, MGH, HID and ISQ
Segments KLG, CS and TCD
Segments MU, DJ and IR
Figure 3.9:
= highway
= main road
= motorway
= earth road
The segment map road (not according to the real situation). The nodes of each line
have a code in this example to facilitate the explanation on how to digitize.
91
Move the digitizer cursor away from the part of the digitizer covered by the
map. You will hear a beeping sound. This is to remind you that the digitizer
cursor is outside of the georeferenced area.
Move the digitizer cursor back inside the part of the digitizer covered by the
map. The sound stops.
Zooming in
Before you start digitizing a part of the map, we recommend you to zoom in on that
area, so that you can digitize as detailed as possible. This is especially important
when you are going to connect segments.
Position the digitizer cursor on the upper left corner of the box indicated in
Figure 3.9 with a hatched line. Press digitizer button 1 (1st Point).
Move the digitizer to the lower right corner of the box with a hatched line
and press digitizer button 2 (2nd point). The map window now only displays
the area inside the box. Check this by moving your digitizer cursor through
the box.
Note that you can use button 0 (Entire Map) to zoom out again. You can also zoom
in by using the mouse pointer. In that case, click the Zoom In button on the Toolbar
of the Segment editor and define the area you want to zoom in.
Digitizing segments
In Figure 3.9 each node has a code. This is only used here so that we can explain
better how to digitize. To digitize the segment QHISQ:
92
Press digitizer button 0 to enter the point (starting point of the segment).
ILWIS 3.0 Users Guide
(A)
(B)
Figure 3.10: The Digitize Segment command box (A), and the End Segment command box (B).
Move the digitizer cursor along the line QHISQ while holding down the button 0 of the digitizer cursor.
Note, since the button 0 is continuously pressed the coordinates are recorded at
regular time intervals (see section 3.2). This is digitizing in stream mode.
Release the button 0 when you are just before the starting point Q of the line
QHISQ .
It is important to stop digitizing a little bit before you reach the actual point where
you want to connect the segment. This is done to ensure that no additional
intermediate coordinate is digitized, which is in fact on the other side of the
connection point, and which will cause an error when you check the segments later.
Move the digitizer cursor to point Q while not holding down the button 0 of
the digitizer cursor.
The snap segment ensures that the segment is linked to the starting node. The
program proceeds with the End Segment command box (Figure 3.10B). In this box,
you can select:
- Button 0: Accept. To accept the point to which the segment will be snapped.
- Button 1: Snap Other. To select another node, within the snap tolerance, to snap
the segment to.
ILWIS 3.0 Users Guide
93
Press the 0 button to snap the last point to the starting point.
The Edit dialog box is opened. In this box you can select one of the existing classes
or new to enter a new name for the digitized segment or for the segment which will
be digitized. In this exercise, the domain does not yet contain any class. Therefore,
you have to select <new> in order to enter a label for the digitized segment.
The Add item to Domain dialog box is opened. Here a Name, a Code and a Color
for the digitized segment can be entered.
It is advised to enter codes (letters or numbers), especially, when the class names
are long and you intend to use the map for further MapCalc operations. The
codes can be used in the map calculation formula instead of the class names.
The Segment editor will by default display all segments in the same color (default
Green). If during digitizing you want to check on segment names/codes and have the
segments drawn in the color of the representation, open the Customize Segment
Editor dialog box (File, Customize) and select Segment colors Domain .
The lines EF , PQ , HR and RNO represent highways in the map. Before digitizing the
lines, we will add a new class Highway to the domain. To add a new class:
94
From the Edit menu of the Segment editor, select Insert Code. The Edit
dialog box is opened.
Select <new> from the list box Class Name. The Add item to Domain dialog box is opened.
Type Highway in the text box Name and Hw in the text box Code.
Select a color in the list box Color and click OK in the Add item to
Domain dialog box. You are back in the Edit dialog box.
Now you can also digitize the lines representing highways. It is advised to save your
work regularly.
Zoom in on the lower half of the map between point E and the lower right
corner of the map.
Digitize segment HRNO similarly. To start segment HRNO at H, press respectively digitizer button 1 (Snap Segment), button 2 (Snap Split) and button
0 (Accept). In this way node H connects segments HISQ and HRNO . Move
the cursor while pressing button 0. End the segment by pressing button 1
(End Segment).
Also digitize segments KLG and TCD . You will edit the codes of the segments
later.
Keep pressing this button and move the cursor along the line EF .
Release the button when the cursor is at point F and press the 2 button (End
Segment).
Now, if you want to digitize segment CS , there is a problem. Since there is no node
yet at point C, the segment TCD should be split first before you can digitize segment
CS . You can split a segment during digitizing, as you did before, but now we will use
the Split/Merge Mode.
Click the Split/Merge button on the Toolbar. The mouse pointer changes to
a pair of scissors.
Position the mouse pointer at point C (check with digitizer cursor) and click
with the mouse. The following message is shown:
Click Yes. The segment is now split and an intermediate node is shown.
Click the newly created node. The message appears:
Merge segment hi: Highway with hw: Highway? Click No.
With the Split/Merge Mode you can split segments into two, connected by a node.
You can also use it to remove unnecessary nodes.
95
Position the digitizer cursor at point C and press button 1 (Snap Segment).
Press digitizer button 0 (Accept).
Press digitizer button 0 and move along the line CS until you are near to S.
Position the mouse pointer on point S and press digitizer button 1 (snap end
segment). With a sound it is indicated that the segment cannot be connected
to point C, since there is no node yet. The End Segment command box
appears.
Press digitizer button 2 (Snap Split) to split the segment QHISQ .
Press digitizer button 0 (Accept) to accept the location where the segment
QHISQ will be split and where the segment CS will be connected.
The previously digitized segments KLG , CS , TC and CD were coded as Highway, but
in fact they represent Motorways . Since no new class name has been defined for
them yet, they automatically got the same class name (Highway ) as the last digitized
segment. Hence, the names of the segments need to be changed to Motorway . You
will use the mouse to change the class names of these segments.
Press the Select Mode button on the Toolbar with the mouse pointer.
Do the same for the segments TC and CD . Note that TCD now consists of two
segments, since you have split it.
Click the right mouse button, to open the context-sensitive menu and select
Edit. The Edit dialog box is opened.
Select <new> in the Edit dialog box. The Add item to Domain dialog box
is opened.
Type Motorway in the text box Name, type Mw in the text box Code, select
a color in the list box Color and click OK.
Position the mouse pointer on the segment KLG and select it.
Press the Shift key and put the mouse pointer on the segment CS and select
it. In this way you can select multiple segments.
The names of the segments can also be changed by double-clicking the segment.
As you have seen, the connection of one segment to another is done via snapping.
This is to ensure that the segments are linked precisely through the nodes. Snapping
only succeeds if a point exists within the snapping tolerance distance. A beep warns if
96
From the File menu of the map window, select Customize. The Customize
Segment Editor dialog box is opened.
Within the Customize Segment Editor dialog box you can see that the default
value for the Snap tolerance is 190 meters. This means that if you want to connect
two segments, and the cursor is less than 190 meters from a node, this node will be
used to connect the two segments. The snap tolerance is defined by the system when
you start the Segment editor, based on the coordinate boundaries (and the scale) of
your map. The user may enter another value if needed. A large value for the snap
tolerance will make the map less accurate. A very small value for the snap tolerance
will make the digitizing difficult, since you have to zoom in a lot before you can
snap. When you work with the mouse, the option Snap tolerance (pixels) is used.
The default value is 5 pixels.
Note also another value in the Customize Segment Editor: The Tunnel tolerance.
This value (in this case 19 meters) defines the width of corridor between the first and
last of three points (see Figure 3.8). If the second point falls within this corridor, it
will not be used as intermediate point, and therefore not stored. If it falls outside the
corridor, it will be used as intermediate point. So by selecting the tunnel tolerance
you can influence the detail of the lines that you digitize. If you increase the tunnel
tolerance, the segments will be digitized rather coarsely, with only a few intermediate
points. If you make the tunnel tolerance very small, many intermediate points will be
stored and the size of your segment map will become large.
Note also that the default setting for Auto Snap in the Customize Segment Editor
is selected. This means that when you end a segment with the mouse, the system will
automatically try to snap it.
Now you will practice some more with snapping segments.
Put the digitizer cursor at point F and press the button 1, to snap the starting
point of the new segment to point F of the segment EF and press button 0 to
accept.
Press button 1 to snap this segment to point L of segment KLG . The program
proceeds to End Segment command box.
97
Press button 2 (Snap Split) to split the segment KLG to segments: KL and
LG.
Return to the Add Segment command box. Press button 3 to select the
Move Point Mode.
The program proceeds to the Move Points command box. In the Move Points
Mode, all segment nodes appear as little boxes and all intermediate coordinate pairs
appear as small crosses.
The Move Points Mode can also be selected from the Edit menu or from the
Toolbar of the Segment editor.
The commands in the Move Points command box (Figure 3.11A) are:
- Button 0: No function.
- Button 1: Take Point. To select a point to be moved.
- Button 2: Change Window. To change the window displayed on the screen.
- Button 3: Return. To return to the Add Segments command box.
The program proceeds to the Retouch Point command box (Figure 3.11B). The
commands in this command box are:
- Button 0: New Position. To drop the point at a new position.
- Button 1: Take Point. To select another point to be moved.
- Button 2: Snap. To drop the point at an existing node (snap) or to drop the point
on an existing segment to a point on the segment on which it has been positioned.
- Button 3: Return. Return to the Move Points command box.
98
(A)
(B)
Figure 3.11: The Move Points (A) and Retouch Point (B) command boxes.
Position the cursor at the new position, point Z and press button 0.
You can also use Move Points Mode to correctly snap nodes, for example the end
point of segment EF .
Put the cursor at node F, and press button 1. The Retouch Points command
box is opened.
To connect it to another segment, press button 2.
Deleting a segment
Incorrectly digitized segments can be deleted with the mouse. Suppose the segment
UM was incorrectly digitized, and you want to delete it:
Deleted segments can be undeleted. If the segment UM was deleted by mistake and
you want to undelete it:
Open the context-sensitive menu and select Undelete segments. The deleted segments will be displayed in the map window with a different color.
Deleted segments, which can be undeleted, are shown in a color specified in the
Customize Segment Editor dialog box.
99
Open the context-sensitive menu in the map window by clicking the right
mouse button, and select Customize. The Customize Segment Editor dialog box is opened.
From this box you can choose to display the segments in Normal color, colors
defined in the representation (Domain), or in Primary Colors.
The final part of segment digitizing is the checking of the segments. The items that
are checked are intersections of lines without a node, dead ends in segments, self
overlapping segments and consistency of the codes.
The checking of segments is not treated here. In section 3.5, a detailed explanation
will be given of the procedure for checking segments and correcting errors.
100
From the File menu of the Main window, select Map Reference. The Map
Reference dialog box is opened.
Click the Create Domain button. The Create Domain dialog box appears.
Close the Create Domain dialog box by clicking OK. You are now back in
the Create Segment Map dialog box. Click OK.
Remove the photocopy of Figure 3.9 if it is still on the digitizer, position the
photocopy of Figure 3.12 in the center of your digitizer, and fasten it to the
digitizer.
The Segment editor and the Add Segments command box are opened.
101
From the Edit menu of the segment editor, select Insert Code.
The Edit dialog box is opened.
Type the value: 2560 . This will be the default value for all segments that you
will digitize from now on. Click OK.
Digitize the contour lines with the altitude 2560. After you finished digitizing each line, click OK in the Edit dialog box.
Subsequently digitize a first contour line of altitude 2580. In the Edit dialog
box, which appears after you finished digitizing the line, change the value
into 2580 and click OK.
When you finish digitizing the contours, you can easily check whether an error
was made, by checking the code consistency. The code consistency check finds
segments that are connected, but have different values. This cannot be true for
contour lines.
From the File menu of the segment editor, select Check Segments, Code
Consistency.
Accept the defaults in the Check Segments dialog box and click OK. If the
program finds an error, it will indicate the place of the error with a red box
and a dialog box appears stating the nature of the error: Different codes
value and value at node. Zoom in on error?
102
Click Yes to zoom in and correct the errors (if any) by recoding the wrong
segments.
Press the Exit Editor button when the digitizing is finished. When the
segment editor is closed, the segments are displayed in a map window;
segments are displayed with system representation Pseudo .
Close the map window when you have seen the result.
103
The Segment editor and the Add Segments command box are opened.
Checking segments
After you finished digitizing segments, you should check whether all segments are
correct. The most important errors that may occur during digitizing are shown in
Figure 3.13:
Figure 3.13: Different types of digitizing errors that are detected during the checking of seg-
104
From the File menu of the editor window, select Check Segment and Self
Overlap. The Check Segments dialog box is opened.
Accept the defaults and click OK. The map is now checked for segments that
overlap themselves. The program checks and a Check Segments message
box with the question Zoom in on error? appears.
Click Yes to automatically zoom in on the part where the error occurs. This
is near D in the map and the error is indicated with a red box.
The situation near point D is shown in Figure 3.14A. As you can see the segment
crosses itself. To correct it automatically, there are two possibilities:
- Remove the false polygon (shown in Figure 3.14B).
- Split the segment (shown in Figure 3.14C).
Figure 3.14: Self overlap error near point D in Figure 3.15. A: Original situation showing the
105
106
The program will give an error message: Segment unitbound (nr 4) crosses itself. Remove false polygon?
Click Yes. The false polygon is removed and the program will continue to
check for other segments that overlap themselves. It will give again the message Zoom in on error?
Drag the Check Segments message box outside the map window and compare the segment map near point D with Figure 3.14B. Then click Yes in the
message box to zoom in on the area near M. The message Segment unitbound (nr 21) crosses itself. Remove false polygon? appears.
It is in general not advisable to use the automatic editing options (such as Remove
false polygon, or Split Segment), since this may lead to many small polygons (if
you use the Split Segment option), or to unwanted generalization of the segment (if
you use the Remove false polygon option). Instead it is often better to edit the error
manually using the Move Point Mode.
Click Yes to zoom in on the area with the red box (between M and L). An
error message Segment unitbound (nr 25) crosses itself. Remove false
polygon? is shown.
Click Cancel.
Click the Select Mode button and the Entire Map button when finished.
Press the Zoom In button on the Toolbar and zoom in on the lower part of
the lake between M and L.
From the File menu in the Segment editor, select Check Segments, Self
Overlap. The Check Segments dialog box is opened.
Select the check box Start at Number. The number of the last checked segment is shown.
Click OK. The checking is resumed and, if you made the corrections well, no
other self overlapping segments are found and the Segment Editor message
OK: Segments are not overlapping themselves appears.
107
From the File menu in the Segment editor, select Check Segments and
Dead Ends. The Check Segments dialog box is opened.
Click OK. The map is now checked for segments that are not connected to
others (dead ends). An error message will appear: Dead end in Segment
unitbound (nr 14). Zoom in on error?
Click Yes to zoom in on the area around H. The situation near H is shown in
Figure 3.16.
Figure 3.16: Dead ends in segments, near H in the map of Figure 3.15.
As you can see there are three segments at point H which are not properly connected.
Use the mouse pointer to move the nodes of the segments until they connect.
Return to Select Mode and click the Entire map button when finished.
From the File menu of the Segment editor, select Check Segments, Dead
Ends. The Check Segments dialog box is opened.
Select the option Start at Number and click OK. The checking is resumed.
Again an error message will appear, now near point J.
Correct the error at point J and resume checking dead ends. You may need to
extend the map window (via the Options menu) a bit on the left (e.g. 10%).
There will be another error at point D. Continue checking dead ends until no
more error messages appear.
The last check that will be made is on intersections without nodes (see Figure 3.13
examples 2 and 3).
108
Click OK. The map is now checked for segments that are intersecting without
a node. The message Zoom in on error? appears.
From the File menu of the Segment editor, select Check Segments and
Intersections. The Check Segments dialog box is opened.
Click Yes.
The situation near point E after automatic correction is shown in Figure 3.17 B. As
you can see, it is not always advisable to use the automatic editing option since this
may lead to many small polygons. Instead it is often better to edit the error manually
using the Move Point Mode. You will now correct the error near L manually using
the Move Points Mode.
The program resumes checking intersections and will display an error message for an error near L (after you clicked Yes in the Zoom in on error message box). Do not accept automatic correction and select No.
Use the mouse pointer to move the nodes of the segments so that the two
segments no longer intersect. Click the Entire Map button when finished.
From the File menu in the map window, select Check Segments and
Intersections. The Check Segments dialog box is opened.
109
Select the option Start at Number and click OK. If you corrected the previous errors well, no more errors are found.
There is one more option to check segments: Code Consistency. This is useful only
in situations where you want only segments with the same code to be connected. For
example, in the case of contour lines, where only lines with the same altitude code
should be connected. In the example of the segment map Checkseg this is not a
useful option, since there is only one segment code (Unitbound ).
To better see the effect of automatic editing, you will now correct for the small
polygons that were generated during the automatic editing in point M and point E. You
will do this with the mouse pointer.
Repeat the procedure for the area around point E and click the Save button
when you are finished with the exercise.
Choose the Select Mode, select the small unwanted segments and delete
them by pressing Delete.
. You will
The segments of segment map Checkseg are now error free, and you can proceed
with the creation of the polygon map.
Creating a label point file
When you create a polygon map, the best procedure is to digitize the boundary lines
of the segments in a segment map, and the labels or names of the polygons as points
in a point map. Now you will digitize a point map, containing the names of the units
in the map of Figure 3.15.
110
In the map window displaying the corrected segments, open the File menu
and select Create, Point Map. The Create Point Map dialog box is
opened.
Click the Create button next to the Domain list box. The Create Domain
dialog box is opened.
Select the option Class and click OK. The Domain Class editor is
opened.
Add the domain item: Alluvial fan and click OK. Add also the domain
items: Infilled lake , Lake and Mountain .
Close the Domain Class editor. You are now back in the Create Point Map
dialog box.
Click OK. The Point editor and the Point Editor command box are opened
(Figure 3.5).
Digitize a point within each of the units indicated in Figure 3.15. See section
3.2 on how to digitize points (you can also do this with the mouse pointer).
When you are finished digitizing the points, click the Exit Editor button in
the Point editor. The point map Landunit is displayed on top of segment
map Checkseg .
Click with the right mouse button on the segment map Checkseg in the
Layer Management pane, and select Edit Layer.
From the File menu of the Segment editor, select Polygonize. The
Polygonize Segment Map dialog box is opened.
At this point you have the possibility to polygonize the map using a point map with
labels (containing the name of the polygons), to use a domain, or to auto identify the
polygons (in which case default names will be assigned to the polygons).
Select the option Label Points and select the point map Landunit .
Type Landunit for Output Polygon Map.
Type: Polygon map of land units for Description, accept all other
defaults and click OK. The segments are checked again and the map is now
polygonized. After the Polygonization the Display Options dialog box is
opened.
Click OK. The polygon map is shown. Click the units to find out their
names. You can also check the units in the legend.
The last step is to edit the polygons. In order to be able to edit it, you should first
break the dependency link between the polygon map Landunit and the segment
map Checkseg .
ILWIS 3.0 Users Guide
111
Select the Dependency tab, click the Break Dependency Link button and
confirm with Yes.
In the map window open the Edit menu and select Edit Layer 1 Landunit .
Editing polygons
The Polygon editor and the Polygon Editor command box are opened. The
Polygon Editor command box only contains two options:
- Button 0: Edit Value: To change the name of a polygon.
- Button 1: No function.
- Button 2: Change Window: To change the area displayed on the screen.
- Button 3: No function.
If you forgot to add a label point to the three small lake polygons before, you
can edit the names of the polygons now. Double-click the units, select Lake
and press Enter .
The polygon map Landunit is now ready. Close the map window when
finished.
If you want to practice some more with the creation of a polygon map, you can
digitize the landunit segments of Figure 3.14 yourself, do the segment check and
polygonize the segments.
112
113
114
115
CHAPTER 4
117
118
From the File menu of the Main window, select Import, Map. The Import
dialog box is opened. Click the Help button if you like.
As you can see the import of black and white TIFF images, results in an image
domain for the output map.
When you import a TIFF image, the domain of the imported image depends on the
storage type of the TIFF file. ILWIS can import raster data with 1 bit/pixel (into
domain bit), 4 or 8 bits/pixel (into domain image), 4 or 8 bits/pixel with a color
lookup table (into domain picture), up to 24 bits per pixel (RGB, into domain color).
The same is true for files that are in Windows bitmap format (.BMP).
The user has no control over the selection of output domains of these maps. Methods
to convert domains of maps are explained in section 4.6.
Now some examples of importing Windows bitmap files will be shown: one of a
map showing the country of Bolivia (Bolivia_mask) . The other map is a
hillshading image of Bolivia and its surroundings (Hillshad ) with 8 bits/pixel, with
a color lookup table, resulting in an ILWIS map with a picture domain.
From the File menu of the Main window, select Import, Map. The Import
dialog box is opened.
119
Close the map windows. The maps will be used later on.
Open the raster maps Bolivia_mask and Hillshad and check the domain
types and other properties of both maps.
Other file formats, such as the ERDAS .GIS, ERDAS .LAN and IDRISI .DOC/.IMG,
also allow for the conversion of coordinate information. The conversion of these file
formats will result in maps with a georeference corners.
Close the object collection and the map windows after you have finished the
exercise.
In the next exercise you will import an IKONOS image with a 1 meter resolution. As
this file is almost 90 MB, we will use the Use As option (see section 4.1). The file is
furthermore in GeoTiff format so that coordinates will be preserved. You will obtain
an object collection which contains a map list and the definitions of three bands.
120
From the File menu of the Main window, select Import, Via GeoGateway.
The Import dialog box is opened.
Double-click the map list in the object collection and click the Open As
ColorComposite button. The Display Options Map List as
ColorComp dialog box appears.
Adapt the default stretch values to 1% intervals. For the minimum and the
maximum stretch values, use for the Red Band 36 and 328 , for the Green
Band 37 and 332 , and for the Blue Band 39 and 338 . Click OK.
The interactive color composite is shown in a map window.
Zoom in on the image; close the map window, the map list and the object
collection after you finished the exercise.
This option does not automatically read the header line of the file that normally
contains information about the map's dimensions, coordinates, data type, etc.
The user is asked to enter required information manually, therefore you should have
some knowledge about the header size and the structure of the file.
In this exercise, a global 30 Arc Second Elevation Data file will be imported which is
part of a global Digital Elevation Model. The file covers part of South America.
This file has been downloaded from the USGS EROS Data Center at
http://edcdaac.usgs.gov/gtopo30/gtopo30.html. As exercise material it is also
available on the ILWIS CD-ROM and the ILWIS web site.
121
Accept the Output Filename W100S10 and click OK. The Import General
Raster dialog box is opened.
Make sure the option Use General Raster Import is selected in the Import
Format list box.
If you would like to edit the contents of the map, you need to convert the data file to
ILWIS data format. In this case, you will not edit the map nor use it in another
exercise. Therefore it is sufficient to use the data file in the original file format.
Make sure that the check box Use data file in original format is selected.
Accept the Output Name W100S10 and click OK. The map W100S10.DEM
is now imported.
The map window shows part of the continent of South America. The imported map
has system domain value. When moving the mouse pointer in the map window, you
will see that the map has no coordinates. Before you can use this imported map
together with other data in ILWIS, you need to create a georeference for the map.
122
In the Main window, open the File menu and select Create, GeoReference.
The Create GeoReference dialog box is opened.
Accept the GeoRef Corners option.
Select the Coordinate System LatLonWGS84 .
Type for Pixel size 0 0 30.
Type for Min Latitude 60 0 0 S.
Type for Min Longitude 100 0 0 W.
Type for Max Latitude 10 0 0 S.
In the Catalog, click with the right mouse button on raster map W100S10
and select Properties from the context-sensitive menu. The Properties
sheet is opened.
Make sure the option Center of Corner pixels is not selected and click OK.
The georeference is created.
Raster map W100S10 is now displayed with the proper coordinates and can be used
in combination with other data in ILWIS.
Note that pixels in the ocean area have a value 9999 , which indicates that there is
no data available, while in ILWIS this should be undefined. You can correct the map
with a Map Calculation in which you replace value 9999 by ?.
Type the following formula on the Command line of the Main window:
CorrectDEM = IFF(W100S10=-9999,?,W100S10)
The map is calculated and the Raster Map Definition dialog box is opened.
Close all map windows after you have finished the exercise.
Accept the defaults in the Raster Map Definition dialog box and click OK.
The output map is now displayed with undefined values where no data is
available, and with a proper stretch for elevation data.
123
From the File menu of the Main window, select Import, Map. The Import
dialog box is opened.
Open the Properties sheet of segment map Dnnet , and change the
coordinate system to Latlon . The coordinates in this drainage map are
geographical coordinates.
Display the segment map Dnnet , check the names of the segments, and
check the coordinates.
If you like, add segment maps Contour and Drainage to the map window,
and zoom in.
Select the file: Dnnet.E00 . Accept the Output Filename and click OK.
The map Dnnet.E00 is now imported.
The conversion from AutoCad .DXF may be a segment map, a polygon map and/or a
point map, depending on the contents of the file. If the codes in the .DXF file only
contain numerical values (as is the case for contour lines), the output domain will be
value. Otherwise it will be a class domain (if there is more than 1 code).
In this example a map of South America, in AutoCad .DXF format (Samerica ),
will be imported as a polygon map with a class domain. Note that in this case each
polygon has a separate boundary line, without topology.
From the File menu of the Main window, select Import, Map. The Import
dialog box is opened.
Open the Properties sheet of the polygon map Samerica , and change the
coordinate system to LatLon . The coordinates in this map are geographical
coordinates.
Display the polygon map Samerica , check the coordinates and the names
of the polygons and close the map window after you have finished the exercise.
124
From the File menu of the Main window, select Import, Via GeoGateway.
The Import dialog box appears.
Clear the check box Combine compatible vector layers and click OK.
The Cochabamba.pix file is now imported.
Open the map list and click the Open As ColorComposite button. The
Display Options Map List as ColorComp dialog box appears.
Adapt the default stretch values to 1% intervals. For the minimum and the
maximum stretch values, use for the Red Band 7 and 74 , for the Green
Band 9 and 71 , and for the Blue Band 10 and 49 . Click OK.
The interactive color composite is shown in a map window.
Drag and drop the segment layers on top of the color composite and close the
map window, the map list and the object collection after you finished the
exercise.
For more information on the import of vector and raster data, see the ILWIS Help.
Summary: Importing data
- Raster maps can be imported from a number of file formats. Some of these formats
do not allow for the storage of coordinates, for instance the Windows Bitmap
(.BMP) format. The Tagged Image File format (.TIF) only stores coordinates
when it has been exported as GeoTIFF. Other file formats, such as the ERDAS
.GIS, ERDAS .LAN, and the IDRISI .DOC/.IMG generally contain coordinate
information.
- Frequently used file formats for importing vector data into ILWIS are the Arc/Info
.E00 format, the Arc/View .SHP format and the AutoCad .DXF format.
- To import external raster and vector file formats into ILWIS, you can use the
normal ILWIS Map Import, but you can also Import via GeoGateway, which
supports many current raster and vector file formats.
- Import General Raster is designed to import raster maps which formats are not
directly supported by ILWIS nor by GeoGateway. Files to be imported may have a
band sequential, a band interleaved, or a pixel interleaved structure.
125
Figure 4.1:
Because of the earths rotation, the shape of the earth is not a perfect sphere. The
earth is flattened towards the poles: The equatorial axis (line from the center to the
equator) is longer than the polar axis. The earths shape can be represented by an
ellipsoid, or as it is sometimes called, a spheroid (shapes that are generated by
revolving an ellipse around its minor axis).
A spheroid has 2 different semi-axes a and b, where a is the radius of the equator
circle and b is the half axis of rotation ( b < a). See Figure 4.1B.
126
It follows that the ellipsoid shape is also completely defined by a and f or by a and e.
Nearly 93% of the earths land surface is mapped using only four of these ellipsoids:
International, Krassovsky, Bessel and Clarke (1880). Table 4.1 lists the ellipsoids
available in ILWIS. They are stored in text file Ellips.def . In this file, for each
ellipse the value of a (equatorial radius) and 1/f (the inverse of the flattening) are
listed.
If no ellipsoid is known, the choice by default is a sphere with a = b = 6371007 m.
The choice of the ellipsoid, which fits best a given region of the earths surface to be
mapped, depends on the surface curvature and geoid undulations in that region.
Hence every country has its own best ellipsoid. See also the ILWIS Help topic
Select Ellipsoid.
Table 4.1:
Airy 1830
ATS 77
Australian National
Bessel 1841
Bessel 1841 (Japan by Law)
Bessel 1841 (Namibia)
Clarke 1866
Clarke 1880
Clarke 1880 (IGN)
D-PAF (Orbits)
Everest (India 1830)
Everest (India 1956)
Everest (Malaysia 1969)
Everest (E. Malaysia and Brunei)
Everest (Malaysia and Singapore 1948)
Everest (Pakistan)
Everest (Sabah Sarawak)
Fischer 1960
Fischer 1968
GRS 80
Helmert 1960
Hough 1960
Indonesian 1974
International 1924
Krassovsky 1940
Modified Airy
Modified Fischer 1960
New International 1967
SGS 85
South American 1969
WGS 60
WGS 66
WGS 72
WGS 84
The surface of the earth is curved but this should be presented in maps as a plain
surface. This will always result in some deformation or distortion, unless you use a
spheroidal map (a globe). To correctly represent the curved earths surface on a flat
map, you need a special map projection. With the help of a map projection,
geographic coordinates are converted into a two dimensional metric coordinate
system, measuring the X and Y directions in meters. Each map projection has unique
equations for the transformation from geographic to metric coordinates.
127
Figure 4.2:
Cylindrical, azimuthal and conical projections. For each projection a tangent (touching the globe), and a secant (intersecting the globe) version is shown. The lower
right part of the figure illustrates two aspects: Normal (oriented parallel to the
earths axis) and transversal (oriented perpendicular to the earths axis)
Projections can also be subdivided according to their aspect: The direction in which a
cylinder, plane or cone is oriented with respect to the globe. In Figure 4.2 two
possibilities are given: Normal and transverse aspects. For cylindrical projections a
normal aspect is a cylinder that touches the equator. A transverse aspect is a cylinder
that touches the poles. Similarly the normal and transverse aspects of azimuthal
projections can be visualized. The aspect may also be oblique; in that case the
cylinder, plane or cone is not horizontally or vertically oriented, but something in
between.
128
Type 20 for Graticule Distance, accept all other defaults and click OK.
The graticule is now added to the map window, showing parallels and meridians every 20.
In the map window, open the File menu, choose Properties and select the
segment map World . Check the coordinate system on the Segment Map
tab of the Properties sheet.
Now the effect of several map projections on the display of the world map will be
demonstrated. For each projection a new coordinate system should be created.
129
The Coordinate System dialog box now displays more information, relevant for this
projection. The central cylindrical uses the equatorial radius of the earth, since the
cylinder touches the earth at the equator. See Figure 4.2.
The false easting, false northing and central meridian are used to define the X, Y
coordinates of the map. False easting: Overall increase of map x-coordinates
(eastings), indicating the eastward shift of the origin of the projection relative to the
redefined origin (negative if projection origin is west of false origin). False northing:
Overall increase of map y-coordinates (northings), indicating the northward shift of
the origin of the projection relative to the redefined origin (negative if projection
origin is south of false origin). We wont change them now.
Type some positive values for Max X,Y. These coordinates will be adapted
automatically, based on the map displayed in the map window.
Drag and drop coordinate system Centcyl to the map window in which the
map World is displayed.
Zoom in on the central part of the world, around the equator.
The map you see is neither conformal nor equal area. It is projected perspectively
from the center of the earth onto a cylinder tangent to the equator (see Figure 4.2).
The equator and other parallels are straight lines (spacing increases towards the poles)
and meet meridians (equally spaced straight lines) at right angles. Parallel spacing
increases towards the poles. The poles cannot be shown. Scale is true along the
equator. Shape, area and scale distortion increases rapidly away from the equator.
This map projection only shows the areas surrounding the equator correctly. All other
areas are too much distorted.
130
Type some positive numbers for Max X Y. These coordinates will be adapted
automatically, based on the map displayed in the map window.
Some of the projections available in ILWIS. See for other projections and descriptions also the ILWIS
Help topics Select projection and Suggested projections.
Projection
Remarks
Cylindrical
Cassini
Map is equidistant. Used in ellipsoidal form for topographic mapping of Great Britain
before the 1920s (supposedly Airy ellipsoid) and detailed mapping of German states in the
same period; also used for topographic mapping of France in the 18th century.
Central Cylindrical
Map is perspective but neither conformal nor equal area. Projected perspectively from the
center of the earth onto a cylinder tangent to the equator. Only used for teaching purposes.
Eckert I
Pseudo-cylindrical projection. Map has equally spaced parallels and is neither conformal
nor equal area. Used for showing straight line equal-area graticule.
Eckert II
Pseudo-cylindrical projection. Map is equal area. Meridians are equally spaced straight
lines broken at the Equator. Used for showing straight line equal-area graticule.
Eckert III
Pseudo-cylindrical projection. Map has equally spaced parallels and is neither conformal
nor equal area. Used for showing straight line equal-area graticule.
Lambert Cylind
Equal Area
Also called Cylindrical Equal Area. Mainly used for educational purposes.
Mercator
Conformal. Designed for navigational use; standard for marine charts. Recommended use
for conformal mapping of regions predominantly bordering the equator. Often inappropriately used as a world map.
Miller
Compromise between Mercator and other cylindrical projections. Used in numerous world
maps.
Mollweide
Pseudo-cylindrical projection. Map is equal area. Occasionally used in thematic world maps.
Oblique Mercator
Map is conformal. Oblique aspect of Mercator. Used for larger scale mapping in
Switzerland, Madagascar and Borneo, and for atlas maps of regions having a greater
extent in an oblique direction, such as Hawaii.
Plate Carree
Also called Simple Cylindrical or Equidistant cylindrical. Used for raster maps which store
information of the whole world: Each pixel represents a square block of LatLon coordinates, i.e. information is stored per degree, per minute, etc. Used for mapping the earth
taken as a sphere.
Plate Rectangle
Also called EquiRectangular. Variant of Plate Carree. Used for raster maps which store
information of the whole world: Each pixel represents a rectangular block of LatLon coordinates.
Robinson
Pseudo-cylindrical projection for world maps compromising distortion. Map is neither conformal nor equal area. Used for world maps, for example, by Rand McNally in Goodes
Atlas for thematic world maps. Only used in spherical form.
Transverse Mercator
Also called Gauss Conformal, or Gauss Krger. Transverse form of the Mercator Projection
(conformal). Used for many topographic maps at scales from 1: 20000 to 1: 250000.
Recommended for mapping regions that are predominantly north-south in extent.
UTM
Universal Transverse Mercator. Map is conformal. Widely used for topographic maps and
military maps.
Azimuthal
Azimuthal Equidistant Commonly used in the polar aspect for maps of polar regions and the Northern and
Southern hemispheres. The oblique aspect is frequently used for world maps centered on
important cities and occasionally for maps of continents.
Gnomonic
Map is perspective and neither conformal nor equal area. It is used to show great circle
paths as straight lines and thus to assist navigators and aviators.
Hammer Aitoff
Lambert Azimuthal
Equal Area
Used for maps of continents and hemispheres. Also suited for regions extending equally in
all directions from a center point, such as Asia and the Pacific Ocean.
Orthographic
Known by Egyptians and Greeks 2000 years ago. Map is perspective and neither conformal nor equal area. Only one hemisphere can be shown. The earth appears as it would on
a photograph from space.
131
continued:
Projection
Remarks
Stereographic
Apparently invented by Hipparchus (2nd century bc). Used in combination with UTM projection as Universal Polar Stereographic (UPS) for mapping poles and in navigation charts for
latitudes above 80. Recommended for conformal mapping of regions that are approximately circular in shape. For example, used for topographic maps of the Netherlands.
UPS
Conical
If the pole is one of the standard parallels, it is equal to Lamberts Equal Area Conic.
Frequently used for maps of the United States, for thematic maps and for world atlases.
Recommended for equal area maps of regions that are mainly east-west in extent.
Bonne
Pseudo-conic projection. Map is equal area. Frequently used until mid-20th century for atlas
maps of continents and for topographic mapping of some countries.
Equidistant Conic
Also called Simple Conic. The most common projection in atlases for small countries.
Lambert Conformal
Conic
Polyconic
or American Polyconic (Hassler, 1820). Map is neither conformal nor equal area. The sole
projection used for large scale mapping of the United States by the USGS until the 1950s.
Other projections
Dutch RD
Dutch topographic map projection. Map is conformal. The stereographic projection of the
Netherlands is a so-called double projection. The datum Rijksdriehoeksmeting, which
implies the Bessel 1841 ellipsoid, will be used automatically.
Gauss-Boaga (Italy)
Gauss (Colombia)
Gauss-Krger
(Germany)
General Perspective
Lambert Conformal
Conic (France)
Sinusoidal
used since 16th century. Also called Mercator Equal Area. Pseudo-cylindrical projection.
Map is equal area. Used in atlas maps of South America and Africa. Occasionally used for
world maps. Modifications are called Sinusoidal Interrupted, Sinusoidal 2x Interupted and
Sinusoidal 3x Interrupted.
Shows the entire earth within one circle. All areas, shapes and angles are greatly distorted.
You will see that the world is projected in a circular way on a plane which touches the
earth at 0 degrees latitude and longitude. Therefore, the equator and the 0 degrees
meridian are straight lines.
132
Type some positive numbers for Max X, Y, enter for the Sphere Radius:
6356007 and click OK.
Drag and drop coordinate system Lambert_CC to the map window displaying the map World and zoom in on the centre of the map.
Now only the area surrounding the North Pole is displayed, in a very distorted way.
Type some positive numbers for Max X, Y, enter for the Sphere Radius:
6356007 and click OK.
Drag and drop coordinate system Orthographic to the map window displaying the map World .
The world map is now displayed as if you look at the earth from space.
133
See the effect of the Plate Carree , the Mercator , the Mollweide and
the Sinusoidal projection.
Up to now you have only seen the different projections displayed on the screen. To
actually transform the map, you need to use the Transform Segment operation in
this case, since the map world is a segment map. For points you use the Transform
Points, and for polygons the Transform Polygons operation. They work basically
the same.
In the Catalog, click segment map World with the right mouse button and
select Vector Operations, Transform Segments. The Transform
Segment Map dialog box is opened.
Figure 4.3:
- The UTM has a special convention for recording the Northings. For the Southern
Hemisphere the equator is assigned the value 10,000,000. For the Northern
Hemisphere the value at the equator is assigned as 0.
- The UTM might use one of the following definitions of the shape of the earth:
International Spheroid, Clarke 1866 (Africa), Clarke 1880 (North America),
Everest or Bessel (both for smaller parts of Southern and South East Asia).
One of the objections to the introduction of the UTM map projection, was the method
of dividing the world into 60 zones. A country was likely to be divided into several
UTM zones, each having its own coordinate definition and origin. Still the UTM
system was accepted worldwide. Many maps show the coordinates of the national
system as well as those of the UTM.
For large scale mapping, if an area lies within more than one UTM zone, the entire
area has to be mapped as if it lies in that zone. One should select the zone that
occupies the major part of the area, extending the borders of the zone over the +3
and -3 boundaries.
Likewise, if the country covers both sides of the equator, the coordinates from the
Southern Hemisphere are extended for the part on the Northern Hemisphere (so
larger than 10,000,000).
The data on the projection used should be found on the topographic map, from which
you have digitized the information. On the topomap of Cochabamba, the following
information is given:
ILWIS 3.0 Users Guide
135
Ellipsoid: International.
Projection: Transverse Mercator.
Vertical Datum: Sea level.
Horizontal datum: Provisional South America 1956.
UTM zone: 19 K.
Click the Datum button and select the Datum: Provisional South
America 1956 , select the Area: Bolivia and click OK.
Click the Ellipsoid button and select the Ellipsoid: International 1924
and click OK.
Enter for the (UTM) Zone: 19 and click OK in the Coordinate System
Projection dialog box.
Suppose you want to convert data from the Cochabamba area from UTM zone 20 to
UTM zone 19. To illustrate the transformations you first create a coordinate system
for the adjacent UTM zone 20.
Open the File menu in the Main window and select Create, Coordinate
System. The Create Coordinate System dialog box is opened.
In the Create Coordinate System dialog box type Cocha20 for the
Coordinate System Name, select the option CoordSystem Projection
and click OK. The Coordinate System Projection dialog box appears.
Enter some positive values for Max X, Y and click the Projection button.
Click the Ellipsoid button, select the Ellipsoid: International 1924 and
click OK in the Select Ellipsoid dialog box.
Click the Datum button and select the Datum: Provisional South
America 1956 , the Area: Bolivia and click OK.
In the Select Projection dialog box, select the Projection: UTM and click
OK.
Enter for the UTM Zone: 20 and click OK in the Coordinate System
Projection dialog box.
Now that a new coordinate system is made for UTM zone 20, you can link this
coordinate system to the maps digitized in that projection.
Checking coordinate transformation
Before making a coordinate transformation, it is wise to check the transformation for a
few coordinate pairs. This can be done with the Transform Coordinates dialog box.
136
The options in this box can be used to check whether the transformation is correct. It
allows you to select an input and output coordinate system, to type the X and Y
coordinates of a point to be transformed and to interactively view the output
coordinates for the selected point.
Figure 4.4:
The corner of the topomap of sheet Cochabamba indicated the grid in UTM 19
coordinates, the tickmarks in UTM 20 coordinates and the upper left corner in geographic coordinates.
First you will check whether the conversion from latitude/longitude to metric
coordinates of a certain UTM zone is correct.
Select the Output Coordinate System Cochabamba in the list box Output
Coordinate System.
Check the metric coordinates of UTM zone 19 with those in the map in
Figure 4.4. Write them down.
Type the latitude and longitude as indicated in the corner of the map in
Figure 4.4.
137
Check the metric coordinates of UTM zone 20 with those in the map in
Figure 4.4 and write them down.
Now you will check if the conversion of coordinates from UTM zone 20 to 19 is
done correctly.
Type the X and Y values that have been noted down for the conversion from
Latlon to UTM 20 .
Check the metric coordinates of UTM zone 19 with those that you have written down for UTM 19.
The calculated coordinates for this point in other projections will be displayed in the
box. You should check the X and Y value with the ones you have noted from the
paper map with the UTM projection. Small differences may occur, due to rounding
errors. If the calculated coordinates are very different, you better check whether the
projection parameters in the input coordinate system are correct. If the calculated
coordinates are the same, follow the next steps to transform the actual map.
Transforming vectors
After checking that the transformation of some known points in two maps with
different projections is done correctly, you can do the actual transformation. In this
example, we have a map City20 , in which the outline of the city of Cochabamba is
digitized in UTM 20 coordinates. This polygon file will be temporarily transformed
to UTM zone 19, for display purposes. There is also a segment map City19 , with
which you can check the result.
Display polygon map City20 . This map has coordinates in UTM 20.
Display segment map City19 . This map has coordinates in UTM 19.
Drag-and-drop polygon map City20 into the map window displaying
City19 .
Accept the defaults by clicking the OK button. Polygon map City19 is displayed.
Compare the input polygon map City20 with the transformed output polygon map City19 .
Check the result by adding segment map City19 to the map window and
zoom in where the lines are doubled.
Add gridlines every 1000 meters (in Blue ), and a graticule (in Green )
every 5 minutes.
Close the map window when you have finished the exercise.
139
Expand respectively the Vector Operations item and the Segments item in
the Operation-tree.
Type 805300 for maximum X and 8083300 for maximum Y in the text box
Max X, Y.
Type Drainsub in the Output Segment Map text box and click Show.
The Display Options - Segment Map dialog box is opened.
Type 797200 for minimum X and 8078200 for minimum Y in the text box
Min X, Y.
Compare the Drainsub map with the map Drainage and close both map
windows when you have finished the exercise.
The output map of this operation may have double segments, which can be
removed by editing the map (see chapter 3 on editing segments).
The segments that are supposed to continue in two or more sheets are not
automatically connected to each other in the output map. They can be connected
in the Segment editor using the Move Points option.
Suppose you have digitized contour lines for the Cochabamba area from two map
sheets. Now you want to combine them into one single map. Suppose also that you
only want the hundred meter contour lines. This means you have to use a mask.
Display segment map Connorth . This segment map contains the contour
lines for the northern part of the study area.
Also display Consouth . This map contains the segments for the southern
part of the area.
Close both map windows and double-click the item Glue Segment Maps in
the Operation-list. The Glue Segment Maps dialog box is opened.
Select the map Connorth and Consouth in the list boxes Map.
Type ??00 in both text boxes Mask. This has the effect that only the contour
lines with 100 meter contour interval are copied.
Select the check box Clip Boundary.
This check box is used when a user wants to specify different coordinate boundaries
for the output map than those of the combination of the input maps. Otherwise, by
default, the output map comprises the whole area of all input maps.
Leave the Min X and Max X unchanged and type for Min Y: 8071798 . Type
for Max Y: 8090600 .
Type Concomb in the New Domain and the Output Segment Map text
boxes.
Accept the defaults by clicking the OK button in this dialog box. The new
segment Concomb is displayed.
Close the map window when you have finished the exercise.
141
Display the segment map City19 , and open the domain to look at the
domain items.
Click Show. The Display Options - Segment Map dialog box is opened.
Type Grid19 in the text box Mask and in the text box Output Segment
Map.
Accept the defaults by clicking the OK button in this dialog box. Now only
the grid lines are shown.
Close the map window when you have finished the exercise.
142
Type Grid19new in the text box Output Segment Map and click Show.
The Display Options - Segment Map dialog box is opened.
Accept the defaults by clicking the OK button in this dialog box. The map is
now displayed. Apparently there is no difference.
In order to be able to compare the output segment map Grid19new with the input
map Grid19 , you need to look at both maps in the Segment editor, which allows
you to see the intermediate coordinates as crosses. The editor can only be used on
maps that are not dependent, so the dependency link should be broken first, for both
maps.
In the Catalog click the map Grid19 with the right mouse button and select
Edit from the Context-sensitive menu. The Segment editor is opened.
Zoom in on a part of the map and select the Move Point Mode. As you can
see each gridline only has a starting and ending point. Close the Segment
editor.
Click the map Grid19new with the right mouse button and select Edit from
the Context-sensitive menu. The Segment editor is opened.
Zoom in on a part of the map and select the Move point mode. As you can
see there are now intermediate coordinates at regularly spaced intervals of
200 meter.
Close the Segment editor and the map windows when you have finished the
exercise.
Tunnel segments
This is more or less the opposite of the densify coordinate operations. The aim of this
operation, is to reduce the number of intermediate points and remove superfluous
nodes within segments of the input map. This operation can also be used when you
want to generalize your maps. The principle of tunneling was explained in chapter 3.
143
Close the map windows when you have finished the exercise.
Repeat the exercise twice: once with a Tunnel Width of 50 meters (Output
Segment map Draintun50 ), and the other with a Tunnel Width of 100
meters (Output Segment map Draintun100 ).
In ILWIS several other vector operations are possible. An overview is given in table
4.3. For more information see also the ILWIS Help topic Vector operations.
Table 4.3: Overview of vector operations in ILWIS.
Operation
Point
Segment
Polygon
Attribute map
Attribute Map of
Point Map
Mask Points
SubMap of
Point Map
Glue Point Maps
-
Attribute Map of
Segment Map
Mask Segments
Labels to Segments
SubMap of
Segment Map
Glue Segment Maps
Densify Segment
Coordinates
Transform Segments
Tunnel Segments
Attribute Map of
Polygon Map
Mask Polygons
Labels to Polygons
-
Mask
Assign labels
Sub map
Glue map
Densify coordinates
Transform
Tunnel
Transform Points
-
Transform Polygons
-
Click the Show button. After creating the polygon map, the Display
Options - Polygon Map dialog box is opened.
The resulting polygon map uses system domain unique ID, indicating the different
polygons as Pol 1, Pol 2, etc. If you want to change these IDs, create an attribute
table for the map, create in the table an attribute column with correct (class) names
and create an attribute map.
A better option would be to polygonize the map using label points. The label points
can be generated from another polygon map using the Polygon to Point operation,
or digitized as a point map. In this case a label point map was already made (point
map Landunit ).
Type for Output Polygon Map: Landunit2 and click the Show button.
Make sure the Label Point check box is selected and use the point map
Landunit as Label Points.
145
Click OK in the Display Options Polygon Map dialog box. The polygon
map Landunit2 now contains the correct names.
Close the map window when you have finished the exercise.
Display polygon map Landuse , and click several polygons to find out their
names. Close the map window.
Select the polygon map Landuse in the list box Polygon Map.
Make sure the check box Single Name is cleared. If this check box is selected all segments get the name: Segments .
Type Landuse_bound in the text box Output Segment Map and click
Show. After creating the segment map the Display Options Segment
Map dialog box is opened.
Several other conversion options between tables, point, segment and polygon maps
are possible. An overview is given in Table 4.4. The operations are described in the
ILWIS Help topic Vectorize.
Table 4.4:
Data type
to Segment
to Polygon
to Table
Open as Table
from Segment Segment to Point
Segment to Polygon
from Polygon Polygon to Point Polygon to Segment
from Table
Table to Point
from Point
146
147
Expand the Create option in the Operation tree and double-click the New
GeoReference item. The Create GeoReference dialog box is opened.
Accept all other defaults and click OK in the Create GeoReference dialog
box.
Create also the georeference Cocha25 with Pixel size 25 meters and
Cocha100 with 100 meters Pixel size.
148
Select polygon map Landuse in the list box Polygon Map and type
Accept the defaults by clicking the OK button of this dialog box. The raster
map Land10 is displayed.
Repeat the procedure, and create raster map Land25 with georeference
Cocha25 , and raster map Land100 with georeference Cocha100 .
Zoom in on the same part of the map in the three map windows. Drag-anddrop polygon map Landuse to each of the three map windows. Display only
the boundary lines.
Compare the three maps and evaluate the effect of different pixel sizes and
close all map windows when finished.
In ILWIS, two other rasterization operations are available, i.e. Point Density and
Segment Density. For each output pixel the total number of points respectively the
total length of segments is calculated. For more information, see the ILWIS Help
topic Rasterize.
Summary: Vector to Raster conversion
- Conversion from vector to raster format (rasterization) is often a necessary step
preceding data analysis.
- Points, segments and polygons are represented by grid cells (pixels) in the raster
data structure.
- In order to convert a map from vector into raster format, a mesh with pre-defined
cell size is positioned over the map. The size of the grid cells is a crucial aspect of
the raster data structure.
- Before starting the rasterization, a georeference should be created. A georeference
contains the minimum and maximum X and Y coordinates of the raster map, the
number of rows and columns and the pixel size.
149
Open the map Bolivia_mask , and find out the area that should be extracted (expressed in first line, first column, nr. of lines, nr. of columns).
Close the map window and double-click the SubMap of Raster Map operation in the Operation-list. The Sub Map of Raster Map dialog box is
opened.
Select raster map Hillshad in the list box Input Raster Map.
Type for Output Raster Map: Hillshad_sub and click the Show button.
The map is created and the Display Options Raster Map dialog box is
opened.
Click OK in the Display Options - Raster Map dialog box and close the
map window after you have seen the result.
You can use the same method to extract the same area from the map Bolivia_mask ,
and then create a final map only showing the hillshading for the country of Bolivia.
150
unique ID
ID
class
value
bool
image
color
picture
bit
Possible combinations of domains of input raster maps and the resulting domain of
the output raster map.
unique ID
ID
class
value
bool
image
color
picture
bit
unique ID
ID
ID
-
ID
ID
ID
-
ID
ID
class
color
class
color
color
color
color
color
value
value
value
color
color
value
class
value
bool
value
color
color
bool
color
value
value
image
color
color
value
color
color
color
color
color
color
color
color
color
color
color
color
color
color
color
value
bool
value
color
color
bit
In this exercise two parts of a TM image, one covering the northern (Tmb1_north )
and the other covering the southern part (Tmb1_south ) of the study area, are glued
together. Both maps have the image domain.
151
Click OK in the Display Options - Raster Map dialog box. The map is
shown.
Display also the raster maps Tmb1_north en Tmb1_south and close the
map windows when you have finished the exercise.
If you select the Last Map on Top check box, the values of the pixels defining the
overlap are taken from the second input map. Clear this check box if these values
should be taken from the first input map.
Mirror rotate
The Mirror Rotate operation allows you to mirror a raster map in a horizontal,
vertical, or diagonal line, to transpose (switch) the maps rows and columns, or to
rotate a raster map 90, 180, 270 (clock-wise). There are no special requirements
for the input map. The output raster map uses the same domain as the input raster
map. The operation creates a new georeference for the output map which obtains the
same name as the output map. The new georeference depends on the georeference of
the input map. This operation may be needed if you get an input raster map from
another source, which is rotated or mirrored. For example, when you use a scanned
image and the image was not properly oriented on the scanner. As an example there is
a 3D view, which is upside down.
Display the map View3D and close the map window again.
Select raster map View3D in the list box Raster Map and select the option
Mirror Horizontal.
152
Double-click Mirror Rotate in the Operation-list. The Mirror Rotate dialog box is opened.
From the Edit menu in the GeoReference Tiepoints editor select Add Tie
in the Toolbar of the editor.
Point or press the Add Tie Point button
The Add Tiepoint dialog box is opened.
Type the Row , Column , X and Y coordinates for the first point as shown in
Table 4.6.
Repeat this for the other 9 tiepoints. The transformation should display
Affine, and the Sigma (the error) should be lower than 1.
Close the GeoReference Tiepoints editor by clicking the Exit Editor button
. Raster map Geology is now georeferenced.
From the File menu of the map window select Create, GeoReference. The
Create GeoReference dialog box is opened.
Accept the default option GeoRef Tiepoints.
Select the Coordinate System: Cochabamba and click OK. The
GeoReference Tiepoints editor is opened.
If a digital table with tiepoint data is available, you can also use Copy and Paste
to insert your data in the Georeference Tiepoints editor.
153
Row
Column
797955
804195
804915
797415
800078
802343
800835
796455
796050
802973
8088615
8087085
8080185
8080335
8083830
8081985
8073450
8072865
8083628
8089080
127
229
689
679
446
569
1138
1177
460
96
165
581
629
129
306
457
357
65
38
499
Now that the raster map Geology is georeferenced, you can resample it to another
raster map, for example Landuse , which uses the georeference Cochabamba .
Select raster map Geology in the list box Input Raster Map.
Click OK in the Display Options - Raster Map dialog box. The map which
is now displayed has the same pixel size and the same number of rows and
columns as the raster map Landuse .
Close the map window when you have finished the exercise.
If you want to practice some more with resampling, you can generate control
points from the polygon map Cityblock (city blocks of Cochabamba), and use
these to georeference the raster map Airphoto (scanned aerial photograph of the
center of Cochabamba). Then rasterize the polygon map Cityblock (with a
pixel size of 5 meters) and resample the map Airphoto .
154
Display the raster map Wrong . As you can see there is a part that needs to be
edited: the word EDIT .
From the Edit menu in the map window, select Edit Layer, and 1 map
Wrong . The Pixel editor is opened.
Press the right mouse button and select Edit from the Context-sensitive
menu. The Edit dialog box is opened.
Select with the left mouse button a part of the letter E which is surrounded
by green pixels by dragging a box.
To see the result press the Redraw button in the Toolbar of the Pixel editor.
In the Pixel editor, you can select one or more pixels by clicking them or dragging a
box around them, in order to change their class name, ID, or value. You can add
pixels to a selection, clear a part of a selection or toggle between select and deselect
pixels.
- To add pixels to a selection:
Press and hold the CTRL key and click the other pixels you want to select.
- To clear a part of a selection:
Press and hold the CTRL+SHIFT keys, then click previously selected pixels or
drag a box around them.
155
Practice with these various options. Edit the map so that the word EDIT is
replaced by the pixel values of the areas surrounding it.
156
Figure 4.5:
Conversion of a raster map to a segment map (see the text for explanation).
In the Catalog, click with the right mouse button on raster map
Slopeclass and select Vectorize, Raster to Segment.
The Segments of Raster Map dialog box is opened.
Click the Show button. The segment map Slopeseg is calculated and the
Display Options - Segment Map is opened.
In the Display Options Segment Map dialog box, select the Info check
box and click OK.
Find out the class names of the segments via the attribute table Slopeseg
and close the map window when you have finished the exercise.
Type Slopeseg in the text box Output Segment Map and type Segment
map slope class in the text box Description.
157
158
In the Catalog, click the domain Landuse with the right mouse button and
select Properties. The Properties sheet is opened. As you can see the
domain contains 12 domain items.
Open the Properties sheet of the domain Landuse again. Now you can see
that it reads: Domain Identifier Landuse.
159
a segment, polygon or point map. The results of the operation are a map and an
attribute table with the same name. The output map uses the system domain Unique
ID. The output table has the same domain as the output map and consists of two
columns, containing the original class names and the areas of each polygon. The
information in the column consists of the classes, IDs or values of the original map
per ID in the output map.
Click OK to display the map and click the polygons in the map window to
view the IDs.
Open the table Landid to view the original class name of the polygons and
the assigned ID.
Close the map window and the table when you have finished the exercise.
The Unique ID operation can only be performed on vector maps. The equivalent
operation for raster maps is called Area Numbering, which will be treated in
Chapter 9.
Converting a class or an ID domain to a value domain
The conversion from a class or an identifier domain to a value domain, can best be
done by creating an attribute map from a value column of the maps attribute table.
Take for example the map Cityblock , which is a map using an identifier domain,
in which each building block of the city of Cochabamba has a separate code. Linked
to that map is an attribute table Cityblock which contains, amongst others,
information on the number of persons living in each cityblock (column
Population ).
160
Open the polygon map Cityblock and double-click some units to find out
the information from the attribute table Cityblock .
Select the Attribute: Population and type for Output Polygon map:
Population .
Click Show. The map Population is created and the Display Options dialog box opened.
The simple conversion of the map Cityblock from identifier to value domain
would make no sense. If you do that the values have no logical meaning, and besides
that, the map can no longer be linked to an attribute table.
Converting a value domain to a class or an ID domain
The conversion from a value or an image domain to a class domain may sometimes be
necessary. For example, when you have imported a scanned thematic map as a gray
scale TIF file. When you want to convert from a value map to a class map, you should
know the names of the legend units that should be assigned to the different values.
For the conversion from a value map to a class or ID map, there are two possibilities:
- When you have a value map that has values with a precision other than 1, you
should create a group domain (in which the boundary values and the class names
are indicated) and use the Slicing operation as described in chapter 7. An example
of this is the classification of a Digital Elevation Model into a classified altitude
map.
- When you have a value map that has values with a precision of 1, which actually
display thematic information instead of measured data, the procedure is as follows:
1. Create an ID domain with a sufficient number of items.
2. Change the domain from value to the ID domain in the Properties sheet of the
map.
3. Edit the domain while keeping the map open.
4. Convert the IDs to classes if necessary.
This is illustrated with a map that was imported as if it had an image domain. It is,
however, not an image but a class map with information on land use types.
ILWIS 3.0 Users Guide
161
nr
nr
nr
nr
nr
nr
nr
nr
nr
nr
nr
nr
162
1
2
3
4
5
6
7
8
9
10
11
12
Agriculture
Agriculture (irrigated)
Airport
Bare rock
Bare soils
Forest
Grassland
Lake
Riverbed
Shrubs
Urban centre
Urban periphery
Open the raster map Landimage and click some pixels in the map. As you
can see the map displays numbers instead of class names.
Close the map window and select Create, Domain from the File menu in
the Main window. The Create Domain dialog box is opened.
Type for the Domain Name: Luse . Select the option Identifier, and type for
the Nr of items: 12 .
Accept the default Prefix and click OK. The Domain Identifier editor is
opened. No changes will be made now.
Close the Domain Identifier editor and open the Properties sheet of map
Landimage .
Change all the domain items and replace them by the land use type,
according to Table 4.7.
You can edit the representation and the conversion from value to classes is
ready.
Open the map Landimage look at the result and close it afterwards.
Click some pixels in the map. As you can see the map displays a combination
of Red, Green and Blue instead of class names.
Close the map window and open the Properties sheet of the domain
Landpicture .
Change all the domain items and replace them by the land use type according
to Table 4.7. Deleting the domain items that are not used is not necessary.
Close the Domain Class editor.
Now you can edit the representation and the conversion from picture to
classes is ready.
Open the map Landpicture and the domain Landpicture . Click a unit
to find out its class name.
163
Open raster map Hillshad , check that it has a picture domain and close the
map window.
In the Catalog, click raster map Hillshad with the right mouse button and
select Properties from the context-sensitive menu. The Properties sheet is
opened.
Close the map window when you have finished the exercise.
Open raster map Hillshad again. From the Display Options Raster
Map dialog box you can see that the map has domain Image .
From
To
Recommended procedure
Class
Class or ID
Color
ID
Picture
Picture
String column
ID
Value
Image
Class
Value
Class
Class or ID
Value
Value*
Class
Value
* Domain type value includes all value domains (e.g. system domains Image, Radar, Bool, Bit, etc. and
your own value domains).
164
165
CHAPTER 5
Figure 5.1:
In this chapter you will see how you can create a table, how to import it from another
software package, how to edit it, and various ways to display table data. The main
part of this chapter is dedicated to calculating with table data.
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter05, where the data files for
this chapter are stored.
ILWIS 3.0 Users Guide
167
Open polygon map Cityblock and double-click a few different city blocks
to know their contents.
You will see that each city block is coded by a unique number, so that it can be identified separately and information from each individual block can be obtained from the
table connected to the map. The polygon map Cityblock has a domain ID
(Identifier).
The table Cityblock contains the following 4 columns:
- Area : a column with a value domain, containing the area of each city block in
square meters.
- Landuse : a column with a class domain containing the prevailing land use type
within the city block.
Residential : city blocks used primarily for housing.
Commercial : city blocks primarily containing buildings used for commercial
activities such as shops, offices, banks, hotels, restaurants etc.
Institutional : city blocks that contain buildings such as schools, universities, hospitals, churches, museums, governmental offices etc.
Industrial : city blocks with buildings primarily dedicated to processing,
manufacturing, and storage of goods.
Recreational : city blocks used for any community or socio-cultural activity, indoor or outdoor, such as sport fields, stadiums, parks etc.
Transport : city blocks used for transport related services such as bus station, railway station etc.
Vacant : city blocks within the urban area that are not used for any urban
activity, such as abandoned buildings, undeveloped plots, bare hills, forested
areas etc.
Water : includes all water bodies such as lakes and rivers.
Airport : the airport of Cochabamba.
- District : the city of Cochabamba is divided into a number of districts. Each district contains a number of city blocks. Since the districts have unique codes, the
District column has also an ID domain.
168
Double-click the titles of the columns and look at the Column Properties
dialog boxes.
At the bottom of the table window you can also see a statistics pane, showing statistical data for value columns: minimum value, maximum value, average, standard deviation and the sum of all values in a column.
The data used for this exercise is partly invented. In table Cityblock, the location
of the generalized city blocks, the land use and the cadastral districts reflect the actual situation, but the population column and the data related to the districts that will be
shown later have been made up for this exercise.
In the exercises of this chapter you will evaluate the following:
- The population density per building block.
- The total population per district.
- Land use proportions per district.
- The number of schools in relation to the number of schoolchildren in each district.
169
Housecon
Schools
Pchildren
nr 1
nr 11
Moderate
Good
Good
Good
Good
Moderate
Moderate
Moderate
Moderate
Bad
Moderate
8
7
2
10
10
4
5
5
8
5
5
31
22
24
18
15
29
34
33
32
42
35
nr 12
nr 13
Bad
Bad
1
7
40
35
nr 2
nr 3
nr 4
nr 5
nr 6
nr 7
nr 8
nr 9
nr 10
Expand the Create item in the Operation Tree and double-click the New
Table item. The Create Table dialog box is opened.
Now the table window is opened. The table has 13 records with the identification
codes of the 13 districts (nr 1 up to nr 13 ).
170
Open the Columns menu and select the Add Column command. The Add
Column dialog box is opened.
Enter the first class name: Bad . There is also an option to enter a code, which
is useful when the class names are large. In this case no code is entered. Click
OK.
Then add the second class by pressing INS. Type for the name of the second
class: Moderate . Then add the third class: Good .
From the Edit menu, select the option Manual Ordering. Select the word
Moderate and place it above Good .
Click the Create Domain button (the small button to the right of the arrow
of the Domain list box). The Create Domain dialog box is opened. Type the
domain name Housecon in the text box, and make sure that the option Class
is selected.
The Domain Editor is opened. Open the Edit menu and select the Add Item
command. The Add Domain Item dialog box is opened.
Type the description in the Add Column dialog box: Average housing
condition per district .
Click the first field of column Housecon . A drop-down list is opened. If you
click the small arrow, the three classes of the domain of this column are
shown. Select the class Moderate .
Press the arrow down () key on the keyboard, to go to the next field. You
can use the left () and right () arrows to move through the items in the
domain list. Select Good from the list for district nr 2.
Enter the rest of the data for this column Housecon according to Table 5.1.
Then create the second column for this table: Schools (number of schools in each
district).
171
Double-click the gray column header to the right of the column Housecon .
This is another way of adding a column.
The Add Column dialog box is opened. Enter the Column Name:
Schools . Select the default domain: Value, and enter for the value range: 0
to 50 , and the precision: 1.0 .
The last column to add is called: Pchildren (the percentage of the population consisting of schoolchildren).
Add the column: Pchildren . For the domain of this column select the system domain Perc, with a value range of 0 to 100 , and a precision of 1.0 .
Editing a column
You can edit any field in a table by clicking it and typing the new contents. You can
use the following keys on the keyboard to edit a table:
- The UP or DOWN ARROW keys, to move one field up or down.
- The TAB key, to move one field to the right.
- The SHIFT + TAB keys, to move one field to the left.
- The ESC key to stop editing.
For editing columns you will work with the table Cityblock . You will add one extra
column, called Tourism , containing the most important touristic sites within the city
center of Cochabamba.
172
Go to the records indicated in Table 5.2 and type the text shown in the table.
Close the table window.
Table 5.2:
city block
Tourism
017
Cathedral
Central Park
Post office
University
Stadium
Memorial hill
Statue
018
075
267
553
700
707
173
To view the dBase file in the Catalog, open the View menu and click Customize
Catalog. On the Selection tab, type DBF in the External File Extensions text
box.
Expand the Import/Export item in the Operation Tree and double click the
Import Table command. The Import Table wizard is started.
On the Specify Input Table page, select the file HOUSES.DBF . Click Next.
On the Edit Column Details page, check the properties of all columns.
On the Select Table Format page, make sure the right table format is selected: Dbase DBF. Click Next.
The Edit Columns Details page gives you an overview of columns that are detected
in the dBase file, and allows you to check and modify how these columns should be
imported. You can for instance specify other output column names, the domain (type)
of each output column and whether or not a certain column should be the domain of
the output table. Every default listed on this page can be double-clicked and changed
according to your wishes.
In this case, you can use the existing ID domain Cityblock for the Name column,
instead of creating a new domain for it. This column will also be used as the domain
of the output table.
174
For the Name column, under New Domain, double-click the default Yes and
change it into No .
Click Next.
Double-click the Houses table in the Catalog and check the results.
On the Specify ILWIS Table Name page, type Houses for the Output File
Name and click Finish.
Also open table Cityblock .
Check the domain of both tables by opening the Properties sheets.
Both tables use domain Cityblock . Because of this common domain, you can join
the column Houses from table Houses into the table Cityblock .
In table Cityblock , open the Columns menu and choose the Join command.
On the first page of the Join Wizard, select table Houses, accept column
Houses and click Next.
On the second page of the Join Wizard, accept the default Output Column
Name, and click Finish.
Click OK in the column Properties dialog box and inspect the results.
Close the table windows when you have finished the exercise.
175
or
Outputcolumn:=Expression
When the Output column does not exist, a new column is created in the table. When
the Output column exists in the table, the content of the column is replaced by the
result of the formula.
Column names generally start with a non-numeric character (A-Z) and have no limitation on length. Column names may not contain any of the following characters: \ /
:
* ? < > | %
the column name must be enclosed by simple quotes in any further calculations on
the command line. If a column name contains a simple quote, this quote must be
duplicated.
- When the assignment symbol (:= ) is used, a column is created, that is not depending on other columns (a source data object, see section 2.5). You can edit the data
stored in such a column directly, e.g. by double-clicking on the field to be edited.
- When the definition symbol (=) is used and the output column does not exist yet, a
dependent column is created. The data in a dependent column depend on data from
other columns via the formula which was used. When data in one of the source
columns is changed, the result will also change, when you make the column up-todate. Fields of a dependent column cannot be edited directly; results of calculations
are protected.
An expression usually contains operators and/or functions to specify the calculation
to be performed. The expression calculates results for all records of the output column. The available TabCalc operators and functions are listed in the ILWIS Help.
You can press F1 at any time in the table window to access detailed information
about them. You can also choose the Help on this Window command or the
Related Topics command from the Help menu.
176
for example:
? 7 + 8 returns 15.
? MAX(ColumnName) returns the maximum value of a column.
? Columnname[Recordnr] returns the contents of a column at a certain record-
number.
For more information about the Pocket Line Calculator and the use of complicated
expressions, refer to ILWIS Help, topic Table calculation: pocket line calculator.
Calculations with value columns
You will now practice with calculations using columns. There are considerable differences in the way you calculate with value columns on the one hand, and with class
and ID columns on the other. Lets start by using some operators on columns with a
value domain. We use the table Cityblock to calculate the area of each city block
in hectares, by dividing the column Area with 10000.
(1 hectare = 100*100 = 10,000 square meters).
Press Enter.
Now the Column Properties dialog box is opened. Since the column Areaha did
not exist in the table, it now has to be defined. This dialog box provides possibilities
to define for the new column: domain type, range, precision, position of the
ILWIS 3.0 Users Guide
177
range defines the range of possible output values in the output column. Calculated
values outside this range are assigned the Undefined value (indicated by a question
mark: ?). It is thus important to select a range which encompasses all the possible
output values.
In the Column Properties dialog box, the value range is defined in two text boxes:
the minimum value in the first text box, and the maximum value in the other one. The
precision text box is used to define the resolution of output values in the output column. A precision of 1 means that output values will be rounded to whole numbers. A
precision of 0.1 means that the output values will have 1 decimal. The description
text box can be used to enter a text explaining what the column represents. The use of
the description text box is optional, but it is highly recommended, as it helps to
remind you what the data means.
The rest of the properties we will leave as they are; accept the default values
suggested by ILWIS by clicking OK.
The dialog box is closed, and the program executes the formula. The results are displayed in the column Areaha .
Operators for value columns
There are several types of operators and functions that can be used in expressions
with value columns.
You can get an overview of all operators and functions that can be used for value
columns in the ILWIS Help. Open the Help menu, and select Help on this
Window. The Help is opened on the Table window page. Select the hypertext
link Command line. Select the hypertext link Table Calculation. Select the
hypertext link Operators and functions on value columns. Now you will see
an overview of the operators and functions on value columns. Click the hypertext
links to get more information and examples of the various operators. You can also
use the Related Topics command on the Help menu.
Arithmetic operators
These are the most simple operators, which are used for the multiplication, division,
subtraction or addition of columns. Another example of these arithmetic operators
will be used to calculate the population density per city block.
178
In the table window, position the mouse pointer on the command line and
type the following formula:
Popdens=Population/Areaha
From now on the symbol will be used to indicate that you have to press
Enter.
The Column Properties dialog box is opened.
Click OK.
The table window now also contains the column Popdens with the population density for each city block.
Relational operators
Relational operators (=, <, <=, >, >=, <>) test whether one expression is equal,
smaller, smaller or equal, larger, larger or equal, or different than another expression.
Let us find out, for example, which city blocks have a population density of more
than 200 persons per hectare.
Note that the suggested domain in the Column Properties dialog box is Bool. A
Bool domain (abbreviation of Boolean) has only three possible values: True, False
and undefined.
Logical operators
Logical operators such as AND, OR, XOR and NOT, compare two expressions and
check if both are true (AND), at least one is true (OR), or only one is true (XOR).
The NOT operation checks if an expression is true or false. If the expression is true,
the NOT operation will result in false and vice versa. As an example, the AND operator is used to find the city blocks that have a population density between 200 and 300
persons per hectare.
179
Highdens1=(Popdens>200)and(Popdens<300)
Click OK in the Column Properties dialog box and check the results in the
table.
Conditional function
The examples that we have used for the relational and logical operators all give output values, which are either true or false or undefined. In practice we use these operators mostly in combination with the conditional IFF function, which has the form of
an IF...THEN..ELSE statement. The format for a conditional statement in ILWIS is:
IFF(a,b,c). If condition a is true, then return expression b, otherwise return expression c.
Highdens3=IFF((Popdens>200)and(Popdens<300),Popdens,?)
The resulting column (Highdens3 ) contains values for those records where the condition (Popdens>200)and(Popdens<300) was true. The other fields contain a
question mark (?). These are so- called undefined values.
Conditional functions are used extensively in ILWIS. You will find that 3 out of 4 formulas you create will contain an IFF statement.
Conditional functions can also be part of another conditional function. In that case we
call them nested IFF functions. The calculation performed above can also be written as such a nested IFF function.
180
Highdens4=IFF(Popdens>200,IFF(Popdens<300,Popdens,?),?)
Select the columns Highdens2 , Highdens3 , and Highdens4 with the left
mouse button, while holding the Shift key. Press the right mouse button and
choose Delete or click the Delete button
in the toolbar. Confirm the deletion for all columns.
Resnr7=(Landuse=Residential)and (District=7)
181
Note that in the Column Properties dialog box the suggested domain of the output
column is City_Landuse . This is because the possible results of the formula are
either Residential or Commercial , which are both items of the domain
City_Landuse , or ? (undefined).
The new column Newlanduse shows the names of the non-residential city blocks, as
in the column Landuse , and the new name Houses for the residential city blocks.
Let us now look at situation 3: IFF(expression, domain1, domain2). If there is information in column Tourism (which you generated in exercise 5.1), then we will use
that information, otherwise we will take the names of the land use classes.
Newlanduse2=IFF(ISUNDEF(Tourism),Landuse,Tourism)
What we have done here, is to look at whether fields in the column Tourism have
undefined values, using a special function ISUNDEF. If that is the case, the names
from the Landuse column are used, otherwise the names from the column Tourism .
Since the items in the column Tourism also refer to land use, we can add the items of
the existing domain City_Landuse to it, so there is no need to create a new domain.
Press OK in the Column Properties dialog box. The Merge domain dialog
box appears, asking you to Merge strings of domain
City_Landuse into domain Tourism . Answer with Yes.
183
In this formula two functions are combined. The formula first selects the last two
characters of the strings in column District with the function
RIGHT(District,2) , and then these characters are converted to values with the
function Value() .
Select the default domain Value in the Column Properties dialog box, with
a minimum 1 and maximum 13, and a precision of 1. Click OK. Now you
have values and can perform the actual calculation.
Now the calculation formula is much shorter, and the INRANGE function, which
works on value columns, can be used to see if the district number of the district is
between 4 and 9.
In this case it would make no sense to add the new names Center and Not in
center to an existing domain. They contain a different type of information than that
of the domains City_Landuse or District .
Since the ELSE and THEN parts of the IFF function contain names that ILWIS cannot identify as being part of an existing domain, the program will display the String
domain as the default domain for the output column. In this case, however, we would
like to make a new domain: Center .
184
Click the Create domain button (located next to the arrow of the domain list
box). The Create Domain dialog box is opened.
Enter the Domain Name: Center , select the Class option and click OK.
The Domain Editor is opened. Add the two items: Center and Not in
center . Close the Domain Editor. Now you are back in the Column
Properties dialog box. The domain Center is now selected. Click OK.
Note that you could have also calculated the entire formula directly, by combining
a series of functions in one expression, without the need to generate a value column first:
Center=IFF(INRANGE(VALUE(RIGHT(District,2)),4,9),Center,
Not in center)
There are many more operators and functions that can be used for class or ID
domains than the ones we have treated in this exercise.
You can get an overview of all operators and functions that can be used for class
or ID columns in the ILWIS Help, topic Table calculation: Operators and
functions on Class, ID, Group or String columns.
You can also check the topics Table calculation special: calculation on coordinates and calculation on colors, etc.
Before you continue with the next exercise, it is better to delete most of the columns
created in this exercise.
Select column Resnr7 by clicking the name of the column, and press the
Delete key on the keyboard. Confirm the deletion.
185
186
One of the columns in this table that was created in the previous exercise is called
Popdens (population density of each city block, expressed as number of persons per
hectare).
If you dont have this column you can generate it by typing the following command on the command line of the table window:
Popdens=10000*Population/Area
Domain Group
The column Popdens shows different values for each city block. To simplify this
information it would be handy if we could classify it into a number of classes. This is
done with the CLFY function. This function classifies values into a number of classes.
The classes should be defined beforehand, and are stored in a so-called domain
Group. A Group domain is a special type of class domain, in which for each class an
upper boundary value is given.
Table 5.3:
Upper Bound
Name
0
50
100
200
10000
0 persons/ha
1 - 50 persons/ha
50 - 100 persons/ha
100 - 200 persons/ha
> 200 persons/ha
Activate the Main window of ILWIS, open the File menu, select Create, and
choose the Domain command. The Create Domain dialog is opened.
Type for the Domain Name: Popdensclass . Select the option: Class and
the check box Group. Click OK. The Domain Editor is opened.
From the Edit menu, select the Add Item command or click the Add Item
button
in the toolbar. The Add Domain Item dialog box is opened.
187
Now that the group domain is created we can classify the population density values in
the table.
Activate the table window with the table Cityblock , and type the following
formula on the command line:
Popdensc=CLFY(Popdens,Popdensclass)
Click OK in the Column Properties dialog box. Now you will see a new
column with the description for each city block.
You can also use the Column Slicing command on the Columns menu. Group
domains can also be used on value maps, while using the Slicing operation (see
chapter 7).
Summary: Classifying data in a column
This exercise dealt with the classification of values in a column.
- Classification can be done with the CLFY function or the Column Slicing command on the Columns menu.
- A classification uses a so-called Group domain, which is a special type of class
domain. For each class name, there is a boundary value to be used in the classification.
188
189
The X- and Y-columns show the coordinates for the odd-numbered locations. The
table contains information about two environmental variables, moisture availability in
% (Moist ) and mean annual rainfall in mm (Avrain ), and about the number of bird
species (Richness ) for each location.
The relation between species richness and moisture availability, as one of the environmental variables, can be visualized in a graph.
In the Graphs menu of the table window select New Graph Window. The
graph dialog box is opened.
Select the checkbox X-column and select Moist . Select Richness for the
Y-column.
!
190
When you click in the graph window, ILWIS returns the corresponding X and Y
values.
ILWIS 3.0 Users Guide
Open the Columns menu in the table window and select Least Squares.
The Least Squares Fit dialog box is opened.
Select Moist for the X-column and Richness for the Y-column.
Select Polynomial for the type of function to describe the relation.
Type 2 for the number of terms to be used in the formula.
Type LSF for the name of the output column.
Click OK. The Column Properties dialog box is opened.
Click the Additional Info button to view the resulting least square fit formula.
Write this formula down, as this is the regression equation you will use later to predict species richness.
The new column LSF shows the transformed Y-values (Richness), obtained by
applying the least squares fit formula to the independent X-variable (Moist).
You can also perform a Least Squares Fit directly in a graph window. The resulting
best fitting relation between two columns in your table will be directly drawn in the
graph window.
Click the right mouse button in the graph window, choose Add graph and
select Least Squares Fit.
The Add Graph Least Squares Fit dialog box is opened.
The least squares fit is shown in the graph window, as a line, representing the relation
between the independent variable Moist and the dependent variable Richness.
ILWIS 3.0 Users Guide
191
Type the following formula on the command line of the table window:
PredRichness = 45.265 + 4.193 * Moist
You will see a new column PredRichness , containing the predicted values for
species richness based on moisture availability of the even samples.
Correlation between variables
To evaluate the reliability of your prediction, you can calculate the correlation
between the predicted and the observed species richness.
In the table window open the Columns menu and select the Statistics command.
The Column Statistics dialog box is opened.
The result of the calculation is shown in a message box. The correlation between the
predicted and the observed species richness is 0.666, which implies a plausible, positive relation between moisture availability and species richness.
While the table contains X- and Y-coordinates, you can display the predicted and the
observed species richness as attribute point data in a map window. However, a point
map representing biodiversity (species numbers) has limited value for visual interpretation purposes. A better option is to rasterize the point map and to choose an appropriate representation (e.g. Pseudo).
The point map can also be used as input map to perform a point interpolation, such
as for instance Moving Average. The output of a point interpolation is a raster map.
For each pixel in the output map, a value is calculated by an interpolation on input
point values.
192
Figure 5.2:
An example of the use of the aggregation function SUM for three situations.
Group by: none: all values are summed up. Group by the column District: all values are summed up for each District. Group by: column Landuse.
Aggregation commands can be selected from the Columns menu in a table window,
or by typing a statement on the command line of a table window. The first method is
ILWIS 3.0 Users Guide
193
Select for the Column: Area , the function: Sum, and type as Output
Column: Totalarea . Click OK.
Open the Columns menu, and select the Aggregation command. The
Aggregate Column dialog box is opened.
You will see that the column Totalarea contains the value 10678499.792 for all
records. That is because you have calculated the total area summing up all records. It
is evident that the column Totalarea is not useful in combination with a map. Since
the column only contains 1 value, it says nothing about the different units in the map.
Instead, you can also calculate the total area per district. Then, areas are summed up
only for those records that have the same name in the column District . The column District is used to group the records. In this way we can calculate the total
area of each district, or of each land use type, or any other group-by column.
Open the Columns menu and select the Aggregation command. The
Aggregate Column dialog box is opened.
The values in the column Areadistrict now show different areas for different districts.
194
Check this by opening the Columns menu, and choosing the Sort command.
The Sort dialog box is opened. Click Column, and select the column
District . Click OK. The table is sorted according to the column
District .
In the table window, use the scroll button on the right-hand side and check
whether the values in column Areadistrict change for each district.
Perform the same aggregation; use the same name for the output column, but
choose to write the output in the table: District .
Now the data is stored in a more useful way. The table has 13 records (13 districts),
and each district has a value for Areadistrict .
You will now use another aggregation function: Average.
The Column properties dialog box is now displayed. The output column
will have a String domain. Click OK.
The new column Distrlanduse now contains the unique combinations of the district numbers and the land use types. So now we can calculate with an aggregate
ILWIS 3.0 Users Guide
195
Change the name of the domain to Dlanduse . Note that the check box
Apply domain to column is selected. Click OK. The domain of the column
Distrlanduse is now a class domain, called Dlanduse .
Open the Columns menu and select the Aggregation command. The
Aggregate Column dialog box is opened.
Now you know the area of each district, and the area of each land use type in each
district. The combination of the two will give us the percentage of each district occupied by several land use types.
In the Column properties dialog box, select domain Perc, and click OK.
The column Residential shows the percentage of each district occupied by houses.
Now do the same thing for the land use types Commercial and Institutional .
Locate the mouse pointer on the command line, and press the up arrow. The
previous formula is displayed again.
196
Open the Columns menu and select Sort. Sort the table on the column
Distrlanduse and compare the names in that column with the values in
the columns Residential , Commercial and Institutional .
Whenever there is a combination of a district with the land use type Residential ,
the column Residential displays the value of the area within the district occupied
by residential buildings.
It is quite obvious that the way the columns Residential , Commercial and
Institutional are ordered, is not efficient. The data in these columns all relate to
the district, and should be written only in the 13 records of the table District , in
stead of the 717 building blocks. We will use these columns in a later exercise to join
them in the table District . Most of the other columns created in this exercise can
be deleted.
Select column Totalarea by clicking the name of the column, and press
the Delete key on the keyboard. Confirm the deletion.
197
from the second table: the link between the two tables is through the common
domain of both tables.
Figure 5.3:
Two different ways of table joining. Dark shaded columns are used as key. The
arrows indicate how the link is made. Fig 5.3-A (left): The domain of the current
table is the same as the domain of the other table from which you want to obtain
data. Fig 5.3-B (right): The domain of a column in the current table is the same as
the domain of the other table from which you want obtain data.
2. The domain of a column in the current table is the same as the domain of the
other table from which you want to join a column (see Figure 5.3-B). Specify a
key column, in the current table; you can then directly obtain data from the second
table. The link between the two tables is through the selected key column in the
current table (key 1) and the domain of the second table (key 2).
198
sibilities:
- The key column in the other table contains unique class names, IDs or values.
In that case you only have to specify the key column in that table (key 2) (see
Figure 5.4-A)
- The key column in the other table does not contain unique class names, IDs or
values. In that case direct joining is not possible, since there may be more than
one possibility to join. To solve that, you need to aggregate the values via the
key column (Figure 5.4-B)
Figure 5.4:
The domain of the current table is the same as the domain of a column in the other
table from which you want to join a column. Dark shaded columns are used as key.
The arrows indicate how the link is made. Fig 5.4-A (left): The column in the other
table contains unique class names, IDs or values. Fig 5.4-B (right): The column in
the other table does not contain unique class names, IDs or values.
4. The domain of a column in the current table is the same as a domain of a key column in the other table from which you want to obtain data. In this case we also
have the same two possibilities as in the third situation shown above (see Figure
5.5).
199
Figure 5.5:
The domain of a column in the current table is the same as a domain of a key column in the other table from which you want to obtain data. Dark shaded columns
are used as key. The arrows indicate how the link is made. Fig 5.3-A (left): The key
column in the other table contains unique class names, IDs or values. Fig 5.2-B
(right): The key column in the other table does not contain unique class names, IDs
or values.
You have not yet worked with histograms in the previous exercises. Histograms
will be treated extensively in chapters 6 (histograms for satellite images) and in
chapter 7 (histograms of maps).
The polygon histogram Cityblock has the same domain as the attribute table
Cityblock . Note that the column NrPol (number of polygons) only contains the
value 1. This is logical, since each city block has a unique identifier, and therefore
occurs only once. The column Perimeter contains the length of the border of each
city block (in meters). We want to read this column into the attribute table Cityblock.
200
From the Columns menu, select the Join command. The Join Wizard is
started.
Select for the Table: the polygon histogram Cityblock and for the
Column: Perimeter .
Figure 5.6:
The Join Wizard used for joining a column from two tables with the same domain.
Click Next in the Join Wizard. Accept the name Perimeter for output column and click Finish.
Column Perimeter is now added to the attribute table Cityblock . We could use
this column, together with the column Area (that was in fact also obtained from the
polygon histogram through the same procedure) to evaluate the shape of the city
blocks. A shape factor can be obtained by the ratio of the perimeter and the area.
If you want to use a column stored in a table, other than the one you are working
with, you can explicitly refer to it without importing it into your active table. You
can use the following general syntax:
Table.Column
where Table is the name of the external table and Column is the name of the
201
Open table District and open table Cityblock . Check if the domain of
the column District in table Cityblock is the same as the domain of
table District .
Make the table window that displays table Cityblock the active window.
Select for the Table: District , for the Column: Pchildren . Click Next.
The second page of the Join Wizard is to select and confirm the Join method, i.e. the
link between the two tables. You can see in this case there is only one option: to
choose a key Column from the current table and to use the Domain of the selected
table. The Join wizard now looks like Figure 5.7.
Figure 5.7:
202
The Join Wizard - Join method page, using a key column in the current table to join
a column from another table. The other table has the same domain as the key column in the current table.
Check if the option Choose key Column from current table (key1) and
use Domain of selected table (key2) is selected and click Next.
The column Pchildren is now added to attribute table Cityblock . We could use
this column, together with the column Population to calculate the number of
schoolchildren in each city block.
Design the formula yourself for calculating the number of schoolchildren per city
block.
Also join the table Cityblock with the table Houses (that was imported from
dBase in section 5.2). Use the column Houses and the column Population to
calculate the average number of persons per house for each cityblock, and for
each district.
Make the table window that displays the District table the active window.
Read the Join Method page; in this case there is only one way of joining
possible. Click Next.
203
On the Link between two tables page, select column District as Key2.
Click Next.
Figure 5.8:
The Join Column dialog box using an aggregation function (SUM) to join a column
(Population) from another table (Cityblock) via a group by column (District)
into the current table (District) which also has the domain (District). The
aggregate function is needed since the table Cityblock contains many records
for the same item of the domain District, while table District only contains
one record for each domain item.
Click Next.
Accept the Output Column name Population and click Finish.
Accept the defaults in the Column properties dialog box and click OK.
The Column Population is now added to the attribute table District . We could
use this column, together with the column Pchildren to calculate the number of
schoolchildren in each district.
Design the formula yourself for calculating the number of schoolchildren per district.
Finally, you can also join the columns Residential , Commercial and
Institutional into the table District . In table Cityblock , information on
the areas of residential, commercial and industrial land use types is available per city
block. These columns were created in section 5.6.
204
Repeat the same procedure as described above for these three columns. Select
the aggregation function AVG (average). For the output columns, select
domain Perc (percentage) with a Precision of 0.01.
205
If you did not succeed in the last exercise, or if you start with this exercise without having done section 5.7, you can use table Distric1 , which already contains
the joined columns, and use table Distric1 whenever we speak of the table
District .
The dialog box Graph is opened. In this dialog box, the columns of the table are presented in the X-Axis (optional) and Y-Axis list boxes which can be used to select the
X and Y axes of the graph.
The Graph Options dialog box is opened, in which you can select a graph type and
a display color.
Click OK.
On the tab Y-Axis (left), type for the Axis text: Percentage . Type for the
Y-Axis Min - Max: 0 and 100 .
The Graph window is opened. The graph shows the percentage cover of residential
buildings in each district.
You can add the other two graphs showing the percentage of commercial and institutional buildings.
206
Click the right mouse button in the Graph window and select Add Graph,
from Columns from the context-sensitive menu. The Graph dialog box is
opened.
207
CHAPTER 6
Image Processing
ILWIS contains a set of image processing tools for enhancement and analysis of data
from space borne or airborne platforms. In this chapter, the routine applications such
as image enhancement, classification and geo-referencing are described. The image
enhancement techniques, explained in this chapter, make it possible to modify the
appearance of images for optimum visual interpretation. Spectral classification of
remotely sensed data is related to computer-assisted interpretation of these data. Georeferencing remote sensed data refers to geometric distortions, the relationship
between an image and a coordinate system, the transformation function and resampling techniques.
Introduction to remotely sensed data
Remotely sensed data, such as satellite images, are measurements of reflected solar
radiation, energy emitted by the earth itself or energy emitted by Radar systems that
is reflected by the earth. An image consists of an array of pixels (picture elements) or
gridcells, which are ordered, in rows and columns. Each pixel has a Digital Number
(DN), that represents the intensity of the received signal reflected or emitted by a
given area of the earth surface. The size of the area belonging to a pixel is called the
spatial resolution. The DN is produced in a sensor-system dependent range; the radiometric values. An image may consist of many layers or bands. Each band is created
by the sensor that collects energy in specific wavelengths of the electro-magnetic
spectrum.
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter06, where the data files for
this chapter are stored.
209
Image Processing
210
Image Processing
Display a satellite image
Display the image Tmb1 (the blue band) of the area near Cochabamba.
In the Display Options - Raster Map dialog box, it is shown that the image
Tmb1 has domain Image , has digital numbers ranging from 25 to 162 and
will be displayed in gray tones (Representation: Gray ).
Click OK in the dialog box to accept these display settings. The image will be
displayed in gray tones from black (lowest reflectance) to white (highest
reflectance).
The image Tmb1 is now displayed in a map window. The map window can be moved,
like all windows, by activating it and dragging it to another position. The size of the
map window can be changed in several ways.
Close the map window by opening the File menu in the map window and
choose Exit, or click the Close button
in the map window.
Open Tmb1 again, accept the defaults in the Display Options - Raster Map
dialog box and click OK.
Move the cursor (now in the shape of a magnifying glass) to the first corner
of the area that has to be displayed in detail and click on the left mouse button. Without releasing the button, drag the cursor a little bit to the second corner of the area of interest. Releasing the mouse button will result in an
enlarged display of the selected area. You can also click in the map window to
zoom in.
211
Image Processing
By repeatedly zooming in or by zooming in on a very small area, the pixel structure
of the image becomes clearly visible by the blocky appearance of the displayed
image.
Zoom in on the displayed image till you can clearly see the blocky pixel
structure of the image. If necessary, change the size of the map window.
Press the left mouse button in the map window and the corresponding DN
value of the pixel will appear. Move over some pixels with the cursor, selecting dark and bright toned pixels and note the changes in DN values.
A fast scroll can also be achieved by dragging the scroll boxes in the scroll
bars Left/Right or Up/Down, or by clicking in the scroll bar itself.
212
Double-click Tmb1 in the Catalog and click OK in the Display Options Raster Map dialog box. Move the map window to a corner of the screen.
Image Processing
In the Open Object dialog box select Tmb3 and click OK. The Display
Options - Raster Map dialog box is displayed.
Accept the defaults and click OK. Move the window to a position close to the
Tmb1 window.
Select Open and accept the default display options, by clicking OK in the
Display Options - Raster Map dialog box. Move the window to a position
close to the Tmb3 window.
Drag-and-drop polygon map Landuse from the Catalog into the map window which displays Tmb1 . Select the option Boundaries Only in the
Display Options - Polygon Map dialog box. Select Boundary Color Red ,
make sure that the check box Info is selected and click OK.
Do the same for the other two map windows. When you click in any of the
map windows you will see the land use type.
Study the individual windows and try to explain the gray intensities in terms
of spectral response of water, urban areas, agriculture and grasslands for the
individual bands. Write down the relative spectral response as low, medium or high, for the different land cover classes and spectral bands in Table
6.1.
Close all map windows after you have finished the exercise.
Table 6.1:
Band
Relative spectral responses per band for different land cover classes.
Fill in the table with classes: low, medium and high.
Water
Urban area
Agriculture
Grassland
1
3
4
213
Image Processing
There are several ways to open and add maps to the pixel information window.
Make sure that the pixel information window can be seen on the screen.
Select Tmb3 and Tmb4 in the Catalog and drag these maps to the pixel information window: hold the left mouse button down; move the mouse pointer to
the pixel information window; and release the left mouse button; The images
are dropped in the pixel information window.
Display Tmb4 , click OK in the Display Options - Raster Map dialog box.
Make sure that the map window does not overlap with the pixel information
window.
In the pixel information window the DNs of all three selected bands will be
displayed. Zoom in if necessary.
From the File menu in the map window, select Open Pixel Information. The
pixel information window appears.
You can also add maps one by one to the pixel information window (File menu Add
Map).
Roam through image Tmb4 and write down in Table 6.2 some DN values for water,
urban area, agriculture, scrubs and grassland. For ground truth, the land use map of
Cochabamba (map Landuse ) can be used.
Table 6.2:
Band
DN values of different land cover classes of selected spectral bands. Fill in the DN
values yourself.
Water
Urban area
Agriculture
Shrubs
Grassland
1
3
4
It is also possible to use the Command line of the Main window to add multiple
maps to a pixel information window.
214
Image Processing
Pixels and real world coordinates
When an image is created, either by a satellite, airborne scanner or by an office scanner, the image is stored in row and column geometry in raster format. There is no
relationship between the rows/columns and real world coordinates (UTM, geographic
coordinates, or any other reference map projection) yet. In a process called geo-referencing, which is discussed in section 6.4, the relationship between row and column
number and real world coordinates can be established.
Double-click the map Tmb4 in the Catalog. The Display Options - Raster
Map dialog box appears.
Click OK in the Display Options - Raster map dialog box and maximize
the map window.
Move the cursor to the lake area near the city of Cochabamba and note the
Row/Col and XY, Lat/Long figures as given in the Status bar. Zoom in if
necessary.
Move to the mountain area in the NW corner of the image. Note the change
in real world coordinates and the row/col numbers.
Move the mouse pointer to the northern edge of the lake (starting point) and
click, hold the left mouse button down, and release the left mouse button at
the southern edge of the lake (end point). The Distance message box
appears.
215
Image Processing
216
Image Processing
217
Image Processing
The linear stretch (Figure 6.1) is the simplest contrast enhancement. A DN value in
the low end of the original histogram is assigned to extreme black, and a value at the
high end is assigned to extreme white. The remaining pixel values are distributed linearly between these extremes. One drawback of the linear stretch is that it assigns as
many display levels to the rarely occurring DN values as it does to the frequently
occurring values. A complete linear contrast stretch where (min, max) is stretched to
(0, 255) produces in most cases a rather dull image. Even though all gray shades of
the display are utilized, the bulk of the pixels is displayed in mid gray. This is caused
by the more or less normal distribution, with the minimum and maximum values in
the tail of the distribution. For this reason it is common to cut off the tails of the distribution at the lower and upper range.
The histogram equalization technique (Figure 6.1) is a non-linear stretch. In this
method, the DN values are redistributed on the basis of their frequency. More different gray tones are assigned to the frequently occurring DN values of the histogram.
Figure 6.1:
Figure 6.1 shows the principle of contrast enhancement. Assume an output device
capable of displaying 256 gray levels. The histogram shows digital values in the limited range of 58 to 158. If these image values were directly displayed, only a small portion of the full possible range of display levels would be used. Display levels 0 to 57
and 159 to 255 are not utilized. Using a linear stretch, the range of image values (58
to 158) would be expanded to the full range of display levels (0 to 255). In the case
of linear stretch, the bulk of the data (between 108 and 158) are confined to half the
output display levels. In a histogram equalization stretch, the image value range of
108 to 158 is now stretched over a large portion of the display levels (39 to 255). A
smaller portion (0 to 38) is reserved for the less numerous image values of 58 to 108.
218
Image Processing
The effectiveness depends on the original distribution of the data values (e.g. no
effect for a uniform distribution) and on the data values of the features of interest. In
most of the cases it is an effective method for gray shade images.
Density slicing and piece-wise linear contrast stretch, two other types of image
enhancement techniques, are treated in section 6.6.1 and 6.6.2 respectively.
The material for this exercise consists of a Landsat TM band 1 of the area near
Cochabamba valley, Bolivia: Tmb1 .
Calculation of a histogram
Before stretching can be performed, a histogram of the image has to be calculated.
Select the raster map Tmb1 and click the Show button.
Write down in Table 6.3 the DN values that belong to the corresponding
cumulative percentages.
Table 6.3:
Cumulative Percentage
0.5
10
100
99.5
99
98
95
90
DN value
Cumulative Percentage
DN value
For an optimal stretching result, the histogram shape and extent has to be studied.
This can be done using the numerical listing but a better picture can be obtained from
a graphical display.
Use the graph and the histogram table to answer the following questions:
1) What is the total number of pixels of the image?
ILWIS 3.0 Users Guide
219
Image Processing
2) How many pixels have a digital number of 68?
3) How many pixels have a DN more than 93?
4) Which DN represents the predominant value (most frequently occurring) of the
image?
In order to get an overview of the most important image statistics, open the
View menu in the histogram window and make sure that the Additional Info
command is active. Check if the DN values in Table 6.3 are correct. Check
also your answer to question 4.
Linear stretching
After a histogram has been calculated for a certain image, the image can be stretched.
A linear stretch is used here. Only the pixel values in the 1 to 99% interval will be
used as input; pixel values below the 1% boundary and above the 99% boundary will
not be taken into account.
In the Main window, open the Operations menu and select Image
Processing, Stretch. The Stretch dialog box is opened.
Accept all other defaults and click the Show button. The raster map
Tmb1_stretch is calculated after which the Display Options - Raster
Map dialog box appears.
220
Display the original image Tmb1 and the stretched image Tmb1_stretch ,
each in a map window next to each other and assess visually the effect of linear stretching. Do not forget to set the minimum Stretch to 0 and the maximum Stretch to 255 for both images.
Write down in Table 6.4 the DN values belonging to the stretched image
using the Additional Info. Indicate the major changes compared to the data
written down in Table 6.3.
Image Processing
Table 6.4:
Cumulative Percentage
0.5
10
100
99.5
99
98
95
90
DN value
Cumulative Percentage
DN value
Figure 6.2:
! Indicate for each line in Figure 6.2, which linear stretch function is shown.
ILWIS 3.0 Users Guide
221
Image Processing
Histogram equalization
The histogram equalization stretching technique takes into account the frequency of
the DNs. Just as in linear stretching, percentages for the lower and upper DN values
can be specified, but also user-specified minimum and maximum values of the DNs
themselves can be given instead.
222
Image Processing
Low pass filters. Applying a low pass filter has the effect of filtering out the high and
medium frequencies and the result is an image, which has a smooth appearance.
Hence, this procedure is sometimes called image smoothing and the low pass filter is
called a smoothing filter. It is easy to smooth an image. The basic problem is to do
this without losing interesting features. For this reason much emphasis in smoothing
is on edge-preserving smoothing.
High pass filters. Sometimes abrupt changes from an area of uniform DNs to an area
with other DNs can be observed. This is represented by a steep gradient in DN values. Boundaries of this kind are known as edges. They occupy only a small area and
are thus high-frequency features. High pass filters are designed to emphasize highfrequencies and to suppress low-frequencies. Applying a high pass filter has the
effect of enhancing edges. Hence, the high pass filter is also called an edge-enhancement filter.
Two classes of high-pass filters can be distinguished: gradient (or directional) filters
and Laplacian (or non-directional) filters. Gradient filters are directional filters and
are used to enhance specific linear trends. They are designed in such a way that edges
running in a certain direction (e.g. horizontal, vertical or diagonal) are enhanced. In
their simplest form, they look at the difference between the DN of a pixel to its
neighbor and they can be seen as the result of taking the first derivative (i.e. the gradient). Laplacian filters are non-directional filters because they enhance linear features in any direction in an image. They do not look at the gradient itself, but at the
changes in gradient. In their simplest form, they can be seen as the result of taking
the second derivative.
A filter usually consists of a 3x3 array (sometimes called kernel) of coefficients or
weighting factors. It is also possible to use a 5x5, a 7x7 or even a larger odd numbered array. The filter can be considered as a window that moves across an image and
that looks at all DN values falling within the window. Each pixel value is multiplied
by the corresponding coefficient in the filter. For a 3x3 filter, the 9 resulting values
are summed and the resulting value replaces the original value of the central pixel.
This operation is called convolution. Figure 6.3 illustrates the convolution of an
image using a 3x3 kernel.
The material used for this exercise consists of a Landsat TM 4 band: Tmb4 .
223
Image Processing
Low pass filters
To remove the high frequency components in an image, a standard low pass smoothing filter is used. In this activity a 3x3 average filter is going to be used.
Select Raster Map Tmb4 , use the Linear Filter Type and the standard low
pass filter Avg3x3 . Enter Tm_average as Output Raster Map and click
the Show button.
Display the filtered and the unfiltered image next to each other and make a
visual comparison.
Open the Create Filter dialog box by selecting New Filter in the
Operation-list.
Enter the name Weightmean for the filter to be created, accept the defaults
and click OK. The Filter editor is opened.
Table 6.5:
1
2
1
2
4
2
1
2
1
224
Filter the image Tmb4 using the smoothing filter just defined. Select the created filter Weightmean from the Filter Name list box. The Domain for the
output map is Image . Type Weightmean as Output Raster Map and click
the Show button.
Compare this filtered image with the image filtered using the standard
smoothing filter.
Image Processing
Figure 6.3: Convolution, using a 3x3 filter with all coefficients equal to 1/9.
225
Image Processing
High pass filters
To enhance the high frequency components in an image, a standard high pass filter is
used. The applied filter is a 3x3 edge enhancement filter with a central value of 16,
eight surrounding values of -1 and a gain of 0.125.
Open the Filtering dialog box by selecting the Filter operation in the
Operation-list.
Select Raster Map Tmb4 and select the Linear filter Edgesenh . Enter the
name Edge for the Output Raster Map. The Domain should be Value
(negative values are possible!).
Accept the default value range and precision and click the Show button. The
raster map Edge is calculated and the Display Options - Raster Map dialog
box is opened.
Use a Gray Representation, accept all other defaults and click OK.
Display the unfiltered and the filtered image next to each other and make a
visual comparison.
Open the Create Filter dialog box by selecting New Filter in the
Operation-list.
Enter the Filter Name Laplace_plus accept all other defaults and click
Show. The Filter editor will be displayed.
In the empty filter enter the values as given in the table below.
Values for the Laplace Plus filter.
Table 6.6:
0
-1
0
226
-1
5
-1
0
-1
0
Image Processing
What is the function of the gain value here?
Filter image Tmb4 using the previously defined Laplace_plus filter. Use
Domain Value and the default value range and step size.
Filter image Tmb4 using a standard Laplace filter. Use the Domain Value
and the default value range and precision.
Compare both filtered images by displaying them in two different map windows using a Gray Representation.
Directional filters
A directional filter is used to enhance specific linear trends. They are designed in
such a way that edges running in a certain direction are enhanced. To enhance lineaments running north-south, an x-gradient filter can be used.
Create a directional filter according to the table below using the same procedures as given in the former exercise.
Values for the directional filter.
Table 6.7:
1
1
1
0
0
0
-1
-1
-1
Display the original image Tmb4 and the two filtered images.
Create the same type of directional filter, but now a filter to enhance the lineaments in an east-west direction and filter also the image Tmb4 .
227
Image Processing
Figure 6.4:
228
Image Processing
Summary: Image enhancement
- Contrast enhancement, also called global enhancement, transforms the raw data
using the statistics computed over the whole data set.
- Techniques used for a contrast enhancement are: the linear stretching technique and
histogram equalization. To enhance specific data ranges showing certain land cover
types the piece-wise linear contrast stretch can be applied.
- The linear stretch is the simplest contrast enhancement. A DN value in the low end
of the original histogram is assigned to extreme black, and a value at the high end
is assigned to extreme white.
- The histogram equalization technique is a non-linear stretch. In this method, the
DN values are redistributed on the basis of their frequency. More different gray
tones are assigned to the frequently occurring DN values of the histogram.
- Spatial enhancement procedures result in modification of an image pixel value,
based on the pixel values in its immediate vicinity (local enhancement).
- Low pass filters are designed to emphasize low frequency features and to suppress
the high frequency component of an image. High pass filters do just the reverse.
- Two classes of high-pass filters can be distinguished: gradient (or directional) filters and Laplacian (or non-directional) filters.
- Gradient filters are directional filters and are used to enhance specific linear trends.
- Laplacian filters are non-directional filters because they enhance linear features
having almost any direction in an image.
- A filter usually consists of a 3x3 array (sometimes called kernel) of coefficients or
weighting factors.
- Each pixel value is multiplied by the corresponding coefficient in the filter. The 9
values are summed and the resulting value replaces the original value of the central
pixel. This operation is called convolution.
229
Image Processing
Image Processing
Figure 6.5:
Color cube.
The pixel values from the three input images are used to set values for corresponding
pixels in the composite. One input band gives the values for red (R), another the values for green (G) and the third for blue (B) (Figure 6.6).
Figure 6.6:
The link between a color composite, the source images and the representation. n is
the number of colors.
Spectral range
TM band number
To be shown in
Near infrared
Visible Red
Visible Green
231
Image Processing
Which bands have to be selected, to create an interactive pseudo natural color composite using three TM bands?
Write down the color assignment in Table 6.9.
Table 6.9:
Spectral range
TM band number
To be shown in
Visible Red
Visible Green
Visible Blue
In this exercise, an interactive color composite is created using TM band 4, 3 and 2. Red
is assigned to the near infra red band, green to the red, and blue to the green visible
bands. The created color composite image should give a better visual impression of the
imaged surface compared to the use of a single band image. Before you can create an
interactive color composite you should first create a map list.
In the Operation-tree expand the Create item and double-click New Map
List. The Create Map List dialog box is opened.
Type Tmbands in the text box Map List. In the left-hand list box select the
TM images Tmb1-Tmb7 and press the > button. The TM images of band 1
through 7 will appear in the list box on the right side. Click OK.
Double-click map list Tmbands in the Catalog. The map list is opened as a
Catalog.
Select image Tmb4 for the Red Band, Tmb3 for the Green Band and Tmb2
for the Blue Band.
Accept all other defaults and click OK. The interactive color composite is
shown in a map window.
You can save the interactive color composite by saving the map window as a map
view.
Open the File menu in the map window and select Save View or click the
Save View button
in the toolbar. The Save View As dialog box is
opened.
Type Tmcc432 in the Map View Name text box, optionally type a title in the
Title list box and click OK. The interactive color composite is now saved as a
map view.
232
Image Processing
Display both interactive color composites and add the polygon map Landuse
to the map windows (display only the boundaries).
How can the color differences between the two displayed images be explained?
Close both map windows when you have finished the exercises.
Select image Tmb4 for the Red Band, Tmb3 for the Green Band and Tmb2
for the Blue Band .
Type Tmccp432 in the Output Raster Map text box, accept all other default
and click Show. The permanent color composite is calculated and the
Display Options - Raster Map dialog appears.
Click OK to display the map and close it after you have seen the result.
233
Image Processing
band, the green color to the red visible band and the blue color to the green visible
band.
- In a Pseudo Natural Color Composite, the output resembles natural colors.: water is
displayed in blue, (bare) soil as red and vegetation as green.
- In ILWIS, there are two ways in which you can display or create a color composite:
interactive by showing a Map List as Color Composite and permanent by using
the Color Composite operation.
234
Image Processing
The different distortions of the image geometry are not realized in certain sequence,
but happen all together and, therefore, cannot be corrected stepwise. The correction
of all distortions at once, is executed by a transformation which combines all the
separate corrections. The transformation most frequently used to correct satellite
images, is a first order transformation also called affine transformation. This transformation can be given by the following polynomials:
X = a0 + a1rn + a2cn
Y = b0 + b1rn + b2cn
where:
rn is the row number, cn is the column number, X and Y are the map coordinates.
To define the transformation, it will be necessary to compute the coefficients of the
polynomials (e.g. a0, a1, a2, b0, b1 and b2). For the computations, a number of points
have to be selected that can be located accurately on the map (X, Y) and which are
also identifiable in the image (row , column ). The minimum number of points
required for the computation of coefficients for an affine transform is three, but in
practice you need more. By selecting more points than required, this additional data is
used to get the optimal transformation with the smallest overall positional error in the
selected points. These errors will appear because of poor positioning of the mouse
pointer in an image and by inaccurate measurement of coordinates in a map. The
overall accuracy of the transformation is indicated by the average of the errors in the
reference points: The so-called Root Mean Square Error (RMSE) or Sigma.
If the accuracy of the transformation is acceptable, then the transformation is linked
with the image and a reference can be made for each pixel to the given coordinate
ILWIS 3.0 Users Guide
235
Image Processing
system, so the image is geo-referenced. After geo-referencing, the image still has its
original geometry and the pixels have their initial position in the image, with respect
to row and column indices.
In case the image should be combined with data in another coordinate system or georeference, then a transformation has to be applied. This results in a new image
where the pixels are stored in a new row/column geometry, which is related to the
other georeference (containing information on the coordinates and pixel size). This
new image is created by applying an interpolation method called resampling. The
interpolation method is used to compute the radiometric values of the pixels, in the
new image based on the DN values in the original image.
After this action, the new image is called geo-coded and it can be overlaid with data
having the same coordinate system.
Image Processing
- Georeference Direct Linear: A georeference direct linear can be used to add coordinates to a scanned photograph which was taken with a normal camera, and when
you have an existing DTM to also correct for tilt and relief displacement (Direct
Linear Transformation). With this type of georeference you can for instance add
coordinates to small format aerial photographs without fiducial marks and for subsequent screen digitizing or to resample the photograph to another georeference
(e.g. to a georeference corners).
- Georeference Orthophoto: A georeference orthophoto can be used to add coordinates to a scanned aerial photograph with fiducial marks, taken with a photogrammetric camera with known principal distance, and when you have an existing DTM
to also correct for tilt and relief displacement (Differential rectification). You can
use this type of georeference to add coordinates to professional near vertical aerial
photographs and further monoplotting on the photograph and as the first step in
creating an orthophoto (the second step is to resample it to a north-oriented georeference).
- Georeference 3D: A georeference 3D can be used to obtain a 3 dimensional picture
of a raster map overlaid by vector maps. A DTM of the area is required. Georef 3D
will be explained in section 10.5.
Figure 6.7:
The principle of Georeference Corners. The coordinates are defined by the coordinates of the corners and the pixel size.
In this exercise we will create a north-oriented georeference corners to which all the
maps will be resampled in a later stage.
Open the File menu in the Main window and select Create, GeoReference.
The Create GeoReference dialog box is opened.
Enter Flevo for the GeoReference Name. Note that the option GeoRef
Corners is selected.
Type: GeoReference Corners for the Flevo Polder in the text box
Description.
Click the Create button next to the Coordinate system list box. The
Create Coordinate System dialog box is opened.
237
Image Processing
As already mentioned in chapter 2, a georeference is linked to a coordinate system;
the coordinate system contains the minimum and maximum coordinates of the study
area, and optional projection parameters. It is always advised to create a coordinate
system of type Projection for the study area in which you are working, even if
you do not have projection information, instead of using the coordinate system
Unknown . This is important if you want to transform later on other data that have different coordinate systems and/or projections.
In the dialog box type the following coordinates for Min X, Y: 188000 and
510000 , and for Max X, Y: 201000 and 522000 and click OK. In a later
stage we may add possible projection information.
You are back in the Create Georeference dialog box. Enter for the Pixel
size: 10 (meters).
Use the same coordinates for Min X, Y and Max X, Y as for Coordinate
System Flevo , clear the check box Center of Corner Pixels and click OK.
Type Coordinate system for the Flevo Polder in the text box
Description, select CoordSystem Projection and click OK. The
Coordinate System Projection dialog box is opened.
For a number of points that can be clearly identified, both in the image as on a topographic map, the coordinates are determined. Reference points have to be carefully
238
Image Processing
selected. Corresponding locations of objects in the image and on a map, have to be
carefully addressed and measured, especially when there is a large time difference
between the production of the map and the acquisition date of the image. Examples
of good reference points are highway intersections, fixed river crossings (bridges),
railway crossings, runways/airports, etc.
The entered reference points are used to derive a polynomial transformation of the
first, second or third order. Each transformation requires a minimum number of reference points (3 for affine, 6 for second order and 9 for third order polynomials). In
case more points are selected, the residuals and the derived Root Mean Square Error
(RMSE) or Sigma, may be used to evaluate the calculated equations.
After geo-referencing, the corresponding X, Y coordinate is returned each time a
pixel is addressed in the display window. Note that the scanned image is not actually
transformed. The original arrangement of the pixels is still intact and no resampling
has taken place yet.
In the following exercises we will use raster map Polder which is a scanned topographic map of part of the Flevopolder near Vollenhove, the Netherlands. An analog
map of the area is also available (see Figure 6.9).
Display the scanned topographic map Polder and zoom in to see more
detail. As you can see this map is a bit rotated.
Move the mouse pointer over the map and note that on the Status bar of the
map window, the row and column location of the mouse pointer is shown and
the message No Coordinates. This means that the image is not geo-referenced yet.
Study the coordinates on the analog topographic map. The georeference is going to
be created using reference points. Selection of the reference points (in ILWIS also
called tiepoints or Ground Control Points (GCPs)) is made on a reference map.
In the map window, open the File menu and select Create, GeoReference.
The Create Georeference dialog box is opened.
Type Georeference Tiepoints for the Flevo Polder in the text box
Description.
Select Coordinate System Flevo (the one you created in the previous exercise) and click OK.
239
Image Processing
Figure 6.9: The topographic map of the Flevo Polder (The Netherlands). Note that the coordinates are in kilometers.
240
Image Processing
The GeoReference TiePoints editor (Figure 6.10) is opened. It consists of the map
window, in which you will see the mouse pointer as a large square, and a table with
the columns X, Y, Row , Column , Active , DRow , Dcol . For more information about
the Georeference Tiepoints editor see section 6.4.3 or the ILWIS Help topic
Georeference Tiepoints editor: Functionality.
Zoom in on the map to a point where horizontal and vertical gridlines intersect (for example P1: x=191000 and y=514000 ).
Locate the mouse pointer exactly at the intersection and click. The Add Tie
Point dialog box appears. The row and column number of the selected pixel
are already filled out. Now enter the correct X, Y coordinates for this pixel
(x=191000 and y=514000 ). Then click OK in the Add Tie Point dialog
box. The first reference point (tiepoint) will appear in the tiepoints table.
Repeat this procedure for at least 3 more points. You can use for instance the
following points:
P2 (x=199000 , y=514000 );
P3 (x=199000 , y=519000 );
P4 (x =191000 , y=519000 ).
in the
You will return to the map window. Move the mouse pointer over the map and
note that on the Status bar of the map window the row and column location
of the mouse pointer as well as the X and Y coordinates are shown. The
image is now geo-referenced.
241
Image Processing
The registration operation does not imply correcting any geometric errors inherent in
the images, since geometric errors are immaterial in many applications e.g. in change
detection. For referencing an image to any geometric system, tiepoints are needed.
These points should not be named ground control points or geo-reference points,
since no relation is specified between the selected point and a location expressed in
any map projection system. However, the master image has to be linked in an earlier
process to a reference system. The slave image will inherit this reference system after
registration. The definition of the transformation used for the registration and the
resampling is further identical to the geo-referencing. The transformation links the
row/column geometry of the slave to the row/column geometry of the master.
Now that the scanned topographic map Polder is georeferenced, we will use it (as
master) to georeference the images Spotb1 , Spotb2 and Spotb3 (the slaves) of the
same region.
242
In the map window, open the File menu and select Create, GeoReference.
The Create GeoReference dialog box is opened.
Type: GeoReference for the Flevo Polder in the text box
Description.
Image Processing
At this point you can start entering the reference points (tiepoints) by clicking pixels
in the slave (to obtain Row /Column numbers) and then clicking at the same position
in the master (to obtain X,Y coordinates).
The following procedures can be used to enter tiepoints in the Georeference
Tiepoints editor (Figure 6.10):
- Firstly, click with the mouse pointer at a recognizable point in the background map
without coordinates (the slave). The Add Tie Point dialog box appears. In this dialog box, the row and column values at the position of the click are shown. When
already sufficient tiepoints are selected, the dialog box will come up with a suggestion for the XY coordinates (which should never be accepted without reflection).
Then:
- Click at the same position in a map of the same area which is already georeferenced (the master) and which is displayed in another map window (in this case the
map Polder ), or;
- Digitize the same point in an analog paper map which is fixed onto a digitizer, or;
- Read the correct XY coordinates for this point from an analog paper map or a
table, and type these XY coordinates in the dialog box.
Choose a location in the slave image Spotb3 for which you can find the
coordinate pair in the master image Polder .
Zoom in on the chosen location, and click the reference point in the slave
image as accurately as possible. The Add Tie Point dialog box appears.
Go to the map window with the master raster map and click the pixel, which
corresponds to that position. In the Add Tie Point dialog box, the correct X
and Y coordinates are filled out now.
When three control points are entered, a Sigma and residuals (DRow and DCol ) are
calculated. Columns DRow and DCol show the difference between calculated row and
column values and actual row and column values in pixels. Very good control points
have DRow and DCol values of less than 2 pixels.
The Sigma is calculated from the Drow and DCol values and the degrees of free-
243
Image Processing
dom, and gives a measure for the overall accountability or credibility of the active tiepoints. The overall sigma value indicates the accuracy of the transformation.
Based on the expected geometric distortions in the background image a transformation method can be selected. By default, an Affine transformation is used. You can
choose another transformation method in the Transformation dialog box (Edit menu,
or context-sensitive menu) as well as in the drop-down list box in the toolbar of the
GeoReference Tiepoints editor.
A tiepoint can be selected or excluded from the transformation computation by putting True or False respectively in the column Active . By excluding tiepoints, you
can for instance evaluate the performance of the transformation; assuming that the
excluded tiepoints are correctly chosen. Furthermore, in the Georeference
Tiepoints editor, good tiepoints are shown in green, medium good tiepoints are
shown in yellow, bad tiepoints are shown in red, and passive tiepoints are shown in
blue. You can set these colors in the Customize Georeference Tiepoints editor dialog box.
A tiepoint is considered well positioned if:
(DRow 2+DCol 2)<=(1.2*Sigma)
A tiepoint can be deleted by clicking its record number and by selecting Edit, Delete
Tiepoint, or by pressing <Delete> on the keyboard. If confirmed, the tiepoint will be
deleted.
Inspect the DRow and DCol values and inspect the Sigma .
Close the GeoReference Tiepoints editor when finished.
You will return to the map window. See that the image Spotb3 now has
coordinates. Move the mouse pointer around in the image and determine for
some easy identifiable pixels the accuracy of the transformation. Use the
zoom in option if necessary.
The georeference Flevo3 created for Spotb3 can also be used for other bands
(Spotb1 and Spotb2 ) since all bands refer to the same area and have the same
number of rows and columns.
244
Image Processing
In the Catalog click Spotb1 with the right mouse button and select
Properties. In the Properties of Raster Map Spotb1 sheet, change the
GeoReference of the image to Flevo3 . Close the Properties sheet.
Do the same for Spotb2 and close all windows when all three SPOT bands
are georeferenced.
245
Image Processing
output image is determined by the value of the nearest pixel in the input image
(Figure 6.13 A).
- Bilinear. The bilinear interpolation technique is based on a distance dependent
weighted average, of the values of the four nearest pixels in the input image (Figure
6.13 B).
- Bicubic. The cubic or bicubic convolution uses the sixteen surrounding pixels in
the input image. This method is also called cubic spline interpolation.
For more detailed information about the different interpolation methods see the
ILWIS Help topics Resample: Functionality and Resample: Algorithm.
The images used in the previous exercises are the scanned topographic map Polder
and the three Spot bands Spotb1 , Spotb2 and Spotb3 . Up to now, they all use a
georeference tiepoints. Now we will resample all maps to a north-oriented georeference. First the map Polder will be resampled to the north-oriented georeference corners Flevo ; then you will resample the Spot images to the same georeference corners Flevo .
Display the scanned topographic map Polder and indicate with a drawing
how the map should be rotated.
Enter Polder for the Raster Map and accept the default Resampling
Method Nearest Neighbour .
Double-click the Resample operation in the Operation-list in order to display the Resample Map dialog box.
246
Image Processing
Repeat this procedure for Spotb1 , Spotb2 and Spotb3 successively. Call
the output maps for instance Spotb1_resampled , Spotb2_resampled
and Spotb3_resampled .
What will happen to output pixel values if you use a bilinear or a bicubic
interpolation during resampling?
All the maps now have the same georeference Flevo and it is possible now to combine the maps with other digitized information of the area (that is rasterized on georeference Flevo as well).
Adding projection information to a coordinate system (additional exercise)
Coordinate system Flevo as created in section 6.4.1 and used by georeference
Flevo , did not yet have projection information. However, we know that the topographic map of the Flevopolder area uses the standard Dutch RD projection
(Rijksdriehoeksmeeting). We will now add this information to coordinate system
Flevo .
Display the map Polder or Polder_resampled again and note that the
Status bar now also displays geographical coordinates in latitudes and longitudes.
247
Image Processing
- The geometric correction is executed by a transformation. The transformation most
frequently used to correct satellite images, is a first order transformation also called
affine transformation.
- To define the transformation, it will be necessary to compute the coefficients of the
polynomials. For the computations, a number of points have to be selected that can
be located accurately on the map (X,Y ) and which are also identifiable in the image
(row , column ).
- The overall accuracy of the transformation is indicated by the average of the errors
in the reference points: The so-called Root Mean Square Error (RMSE) or Sigma.
- After geo-referencing, the image still has its original geometry and the pixels have
their initial position in the image, with respect to row and column indices.
- In case the image should be combined with data in another coordinate system or
with another georeference, a transformation has to be applied. This results in a
new image where the pixels are stored in a new line/column geometry, which is
related to the other georeference. This new image is created by means of resampling, by applying an interpolation method. The interpolation method is used to
compute the radiometric values of the pixels, in the new image based on the DN
values in the original image.
- After this action, the new image is called geo-coded and it can be overlaid with
data having the same coordinate system.
248
Image Processing
In the individual Landsat-TM bands 3 and 4, the DNs of the silt stone are lower in the
shaded than in the sunlit areas. However, the ratio values are nearly identical, irrespective of illumination conditions. Hence, a ratioed image of the scene effectively
compensates for the brightness variation, caused by the differences in topography and
emphasizes by the color content of the data (Table 6.10).
ILWIS 3.0 Users Guide
249
Image Processing
Table 6.10: Differences in DN values of selected bands and the ratio values.
TM Band 3
TM Band 4
Ratio: Band3/Band4
94
76
42
34
2.24
2.23
Sunlit slope
Shaded slope
In this section, ratioed images are created in order to minimize the effects of differences in illumination.
To show the effect of band ratios for suppressing topographic effects on illumination,
Landsat TM bands 4 and 5 are used. The northern part of the image displays mountainous areas, where variation in illumination due to the effect of topography are
obvious.
The creation of the ratio of the two bands is done with the Map Calculator. In chapters
7, 8 and 9 the various functions of the map calculator will be treated in detail.
In the Expression text box type the following map calculation formula:
Tmb5/Tmb4
Enter Shadow for Output Raster map, select as system Domain Value,
click on the Defaults button and click Show. The map Shadow is calculated
and the Display Options - Raster Map dialog box is opened.
Evaluate the effect of shadow suppression by means of this band ratio. Select
pixels on the sunlit and the shadow side of a water divide.
Image Processing
image might be useful for differentiating between areas of stressed and non-stressed
vegetation.
Various mathematical combinations of satellite bands, have been found to be sensitive
indicators of the presence and condition of green vegetation. These band combinations are thus referred to as vegetation indices. Two such indices are the simple
Vegetation Index (VI) and the Normalized Difference Vegetation Index (NDVI). Both
are based on the reflectance properties of vegetated areas as compared to clouds,
water and snow on the one hand, and rocks and bare soil on the other. Vegetated areas
have a relatively high reflection in the near-infrared and a low reflection in the visible
range of the spectrum. Clouds, water and snow have larger visual than near-infrared
reflectance. Rock and bare soil have similar reflectance in both spectral regions. The
effect of calculating VI or the NDVI is demonstrated in Table 6.11.
Table 6.11: Reflectance versus ratio values.
Green vegetation
Water
Bare soil
TM Band 3
TM Band 4
VI
NDVI
21
21
123
142
12
125
121
-9
2
0.74
-0.27
0.01
It is clearly shown that the discrimination between the 3 land cover types is greatly
enhanced by the creation of a vegetation index. Green vegetation yields high values
for the index. In contrast, water yield negative values and bare soil gives indices near
zero. The NDVI, as a normalized index, is preferred over the VI because the NDVI is
also compensating for changes in illumination conditions, surface slopes and aspect.
To create a NDVI map, Landsat TM imagery of Cochabamba, Bolivia, is used. The
following bands are used: Tmb3 and Tmb4 .
The creation of the NDVI is done with the map calculator.
In the Expression text box type the following map calculation formula:
(Tmb4-Tmb3)/(Tmb4+Tmb3)
Enter NDVI for Output Raster map, select system Domain Value, change
the Value Range to -1 and +1 , and the Precision to 0.01 .
Click Show. The map NDVI is calculated and the Display Options - Raster
Map dialog box is opened.
In the map window open the pixel information window and add the maps
Tmb3 and Tmb4 to it.
251
Image Processing
Move through the image with the mouse pointer and study the DN values of
the input maps and how they are combined in the NDVI map.
Calculate also a NDVI image using the images of the Flevo Polder, The
Netherlands. As these are SPOT images, select the appropriate bands (band
1=green, band 2=red and band 3=near infrared). Repeat the procedure as
described above. Before you create the NDVI image, first make sure that all
three bands (Spotb1 , Spotb2 and Spotb3 ) are georeferenced.
252
Image Processing
Figure 6.15: Scatter plots showing a strong positive covariance (A) and zero covariance (B).
The individual bands of a multi-spectral image are often highly correlated, which
implies that there is a redundancy in the data and information is being repeated. To
evaluate the degree of correlation between the individual bands a correlation matrix
can be used. This matrix (a normalized form of the covariance matrix) has values in
the range of -1 to 1, representing a strong negative correlation to a strong positive
correlation respectively, where values close to zero represent little correlation. Using
the correlation coefficients of the matrix, bands can be selected showing the least
correlation and therefore the largest amount of image variation/information to be
included in a multi-band composite.
In this exercise variance/covariance and correlation matrices are calculated for
Landsat TM, including all bands.
Select Tmbands for the Map List name and click OK.
The correlation, mean and standard deviation for these bands are calculated and
presented in the Matrix viewer. Study the correlation matrix and answer the following
questions:
1) Which band(s) in general show the least correlation and why?
2) Are the visible and the infra red bands highly correlated?
3) Select a band combination using three bands, showing most of the information or
in other words, those bands having the least correlation.
Display the three bands with the least correlation and combine them by constructing a color composite.
253
Image Processing
You can also have a look in the Properties of the map list. On the Additional Info
tab, Optimum Index Factors are listed. Click the Help button for more information.
The second principal component is the widest transect of the ellipse that is
orthogonal (perpendicular) to the first principal component. As such, Principle
Component 2 (PC2) describes the largest amount of variance that has not yet been
described by Principle Component 1 (PC1). In a two-dimensional space, PC2
corresponds to the minor axis of the ellipse. In n-dimensions there are n principal
254
Image Processing
components and each new component is consisting of the widest transect which is
orthogonal to the previous components.
Figure 6.17 graphically shows the result of a Principal Components transformation in
which the data are presented without correlation.
Through this type of image transformation the relationship with raw image data is
lost. The basis is the covariance matrix from which the eigenvectors and eigenvalues
are mathematically derived. It should be noted that the covariance values computed
are strongly depending on the actual data set or subset used.
In this exercise, a principal components analysis is done using seven TM images in
the data set: Tmb1 , Tmb2 , Tmb3 , Tmb4 , Tmb5 , Tmb6 and Tmb7 .
The Principal Components dialog box is opened. In this dialog box you can select
or create a map list.
The principal component coefficients and the variance for each band can be viewed
in this table. Since the number of principal components equals the number of input
bands, seven new images named Tm PC1 to Tm PC7 are also created. These output
images will by defaults use domain value. Write down the eigenvalues of the
principal components in Table 6.12.
255
Image Processing
Table 6.12:
Eigenvalues.
Tmb1
Tm
Tm
Tm
Tm
Tm
Tm
Tm
Tmb2
Tmb3
Tmb4
Tmb5
Tmb6
Tmb7
PC1
PC2
PC3
PC4
PC5
PC6
PC7
Tm
Tm
Tm
Tm
Tm
Tm
Tm
Variance explained.
Variance %
PC1
PC2
PC3
PC4
PC5
PC6
PC7
Open the Properties of map Tm PCl to check the expression of the first axis:
Tm PC1= 0.27*Tmb1 + 0.21*Tmb2 + 0.33*Tmb3 + 0.3*Tmb4
+ 0.72*Tmb5 + 0.19*Tmb6 + 0.37*Tmb7
Double-click raster map Tm PCl in the Catalog to calculate the first principal component.
Compare the values in the expression with the eigenvalues noted in Table 6.12. Check
whether your answer given to the question: Explain the contribution of the TM bands
in principal components 2 and 3? is correct?
256
Calculate Tm PC3 .
Image Processing
A color composite can be created of the images produced by the principal component
analysis. To create such a color composite, the domain type of the images should be
changed from value to image.
Compare this color composite map with color composite Tmcc432 created
in section 6.3.
Close the map windows when you have finished the exercise.
Display raster maps Ers1 and Ers2 , using the default display options.
Position the map windows next to each other. Check the values of these two
images, compare them and close the map windows again.
Type the following MapCalc formula on the Command line of the Main
window:
Ers_average =(Ers1+Ers2)/2
Accept the defaults in the Raster Map Definition dialog box and click
Show.
Select maps Ers1 , Ers2 and Ers_average in the Catalog, click the right
mouse button and choose Open Pixel Information.
Move the mouse pointer over some pixels in the map window and check the
results.
Type the following map calculation formula on the Command line of the
Main window:
Ers_difference = Ers1-Ers2
Accept the defaults in the Raster Map Definition dialog box and click
Show.
257
Image Processing
Close the map windows and the pixel information window when you have
finished the exercise.
Display raster maps Irs1C and Btm3 , using the default display options.
Position the map windows next to each other. Check the values of these two
images and compare them.
258
Type IrsBtm34 in the Map List box. Select the maps Irs1C , Btm3 and
Btm4 and press the > button to add the images to the map list. Click OK.
Image Processing
Select for the Red Band: Irs1C , for the Green Band: Btm3 and for the
Blue Band: Btm4 . Accept the other defaults and click OK to display the
map.
Click the Open As Color Composite button to open the Display Options Map List as ColorComp dialog box.
In the next step, the data sets are fused by means of a replacement of the combined
intensity of the three TM bands, by the intensity of the panchromatic image. This
results in a sharpening of the image due to the higher spatial resolution of the
panchromatic image. The results are again displayed as a color composite.
Make sure the Domain Image is selected in the Raster Map Definition dialog box and click Define.
For the intensity replacement, enter the expressions given below, choose for
each output map the Image Domain and accept the other defaults in the
Raster Map Definition dialog boxes.
Intensity1=Btm3/Intensity*Irs1c
Intensity2=Btm4/Intensity*Irs1c
Intensity3=Btm5/Intensity*Irs1c
Create a map list Intensity , add the three intensity maps and show a color
composite as follows:
for Red Band: Intensity1 ;
for Green Band: Intensity2 ;
for Blue Band: Intensity3 .
What can be concluded when the fused image is compared to the image created in the
previous exercise?
Close the map windows when you have finished the exercise.
259
Image Processing
Summary: Multi-band operations
- To enhance or extract features from satellite images, which cannot be clearly
detected in a single band, you can use the spectral information of the object
recorded in multiple bands.
- The operations of addition, subtraction, multiplication and division are performed
on two or more co-registered images of the same geographical area.
- Brightness variations: a ratioed image of the scene effectively compensates for the
brightness variation, caused by the differences in topography and emphasized by
the color content of the data.
- Normalized Difference Vegetation Index (NDVI): Ratio images are often useful for
discriminating subtle differences in spectral variations, in a scene that is masked by
brightness variations.
The utility of any given spectral ratio, depends upon the particular reflectance
characteristics of the features involved and the application at hand.
- Various mathematical combinations of satellite bands, have been found to be
sensitive indicators of the presence and condition of green vegetation. These band
combinations are thus referred to as vegetation indices. Two such indices are the
simple vegetation index (VI) and the normalized difference vegetation index
(NDVI).
- The NDVI, as a normalized index, is preferred over the VI because the NDVI is
also compensating for changes in illumination conditions, surface slopes and
aspect.
- Multi-band statistics
The distribution of data values in a single band could be mathematically
represented by the variance statistics, which summarize the differences between all
the pixel values and the mean value of the channel.
The correlation between two (or more) channels can be mathematically shown by
the covariance statistics.
The values in a covariance matrix indicate also the correlation: Large negative
values indicate a strong negative correlation, large positive values show a clear
positive relation and covariance values near to zero indicate a weak or no
correlation. The covariance values indicate the degree of scatter or shape of the
spectral cluster and the major direction(s).
The individual bands of a multi-spectral image are often highly correlated, which
implies that there is a redundancy in the data and information is being repeated. To
evaluate the degree of correlation between the individual bands a correlation matrix
can be used. This matrix (a normalized form of the covariance matrix) has values in
the range of -1 to 1.
260
Image Processing
- Principal Components Analysis
Principal Components Analysis (PCA) can be applied to compact the redundant
data into fewer layers. Principal component analysis can be used to transform a set
of image bands, as that the new layers are not correlated with one another. The first
two or three components will carry most of the real information of the original data
set. Therefore, only by keeping the first few components most of the information is
kept. Through this type of image transformation the relationship with the raw
image data is lost. It should be noted that the covariance values computed are
strongly depending on the actual data set or subset used.
- Image fusion is the process of combining digital images, by modifying the data
values, using a certain procedure. Data sets are for example fused by means of a
replacement of the combined intensity of the three TM bands, by the intensity of a
panchromatic image.
261
Image Processing
Table 6.14:
Cover class
Land
Water
Image Processing
B and C several options are possible, but all will result in an improper slice
assignment. To classify cover class B, the slice DN 1 to DN 2 will include the lower
DN values of B and the higher DN values of B are excluded. To include all the
pixels belonging to B, the slice assignment is from DN 1 to DN 4. This slice
assignment is including even more pixels that belong to cover class C. When trying to
classify C, the same problem occurs.
Figure 6.18: Distribution of ground cover classes over the digital range.
Interactive slicing
Before a slicing operation is performed it is useful to firstly apply a method which
shows the map, as if it was classified, by manipulating the representation.
Open the Edit menu and select Insert Limit. The Insert Limit dialog box is
opened. Enter the limit you have written down in Table 6.14 to differentiate
land from water, and select the color Blue .
Insert also the other limit shown in the table and select the color Green for it.
Reopen the Display Options - Raster Map dialog box and click the Create
button next to the Representation list box. The Create Representation
dialog box is opened.
Open the list box, which appears after you click the word Stretch between
the two limits. Select Upper. Do the same for the other.
263
Image Processing
The representation can thus be edited, and the result shown on the screen (by using
the Redraw button in the map window). This allows you to interactively select the
best boundaries for the classification.
Slicing operation
Now you will do the actual classification, using the Slicing operation.
For a group domain, you can enter an upper boundary, a name and a code for each
class/group. This domain will be used to slice or classify the raster map Spotb3 . The
upper boundaries and group names that you have entered in Table 6.14 will be used in
this exercise.
Click the
button in the toolbar of the Domain Group editor.
The Add Domain Item dialog box appears.
Type the value from Table 6.14 in the Upper Bound text box.
264
Type Water in the Name text box. The use of a Code and a Description is
optional. It will not be used now.
Click OK.
Press the Insert key of the keyboard to enter the next upper boundary and
name.
Double-click a color box in the editor and select a pre-defined color, or create
your own color.
Exit the Representation Class editor when you are satisfied with the colors.
Exit the Domain Group editor.
Image Processing
Click Show in the Slicing dialog box. The Display Options - Raster Map
dialog box is opened.
In the map window open the pixel information window and compare the values of the original map with the names in the classified map.
Figure 6.19: Upper boundary method (left) and stretched method (right).
The piece-wise linear contrast stretch is very similar to the linear contrast stretch, but
the linear interpolation of the output values is applied between user-defined DN
values. This method is useful to enhance a certain cover type, for example water.
In the Display Options - Raster Map dialog box click the Create
Representation button. The Create Representation dialog box is opened.
265
Image Processing
Make sure that in between two limits, the coloring method Stretch is
selected and increase the Stretch Steps to 10 .
Close the Representation Value editor to return to the Display Options Raster Map dialog box.
266
Image Processing
In order to make the classifier work with thematic (instead of spectral) classes, some
knowledge about the relationship between classes and feature vectors must be given.
Theoretically, this could be done from a database in which the relationships between
(thematic) classes and feature vectors are stored. It is tempting to assume that in the
past, enough images of each kind of sensor have been analyzed, as to know the
spectral characteristics of all relevant classes. This would mean, for example, that a
pixel with feature vector (44, 32, 81) in a multi-spectral SPOT image always means
grass, whereas (12, 56, 49) is always a forest pixel.
Unfortunately, the observed feature vectors in a particular image are influenced by a
large amount of other factors than land cover, such as atmospheric conditions, sun
angle (as function of latitude, time of day, date and terrain relief), soil types, soil
humidity, growing stage of the vegetation, wind (affecting orientation of leafs), etc.
The problems we meet when trying to take all these influences into account vary
from quite easy to practically impossible; at least, vast amounts of additional data
(DEMs, soil maps, etc.) would be required.
Sampling
Therefore, supervised classification methods are much more widely used. The
process is divided into two phases: a training phase, where the user trains the
computer, by assigning for a limited number of pixels to what classes they belong in
this particular image, followed by the decision making phase, where the computer
assigns a class label to all (other) image pixels, by looking for each pixel to which of
the trained classes this pixel is most similar.
During the training phase, the classes to be used are defined. About each class some
ground truth is needed: a number of places in the image area that are known to
belong to that class. This knowledge must have been acquired beforehand, for
instance as a result of fieldwork, or from an existing map (assuming that in some
areas the class membership has not changed since the map was produced). If the
ground truth is available, training samples (small areas or individual pixels) are
indicated in the image and the corresponding class names are entered.
A sample set has to be created in which the relevant data regarding input bands (map
list), cover classes (domain codes) and background image for selecting the training
areas is stored. The map presented below is giving the ground truth information, as
well as the cover classes to be used. The images used in this exercise are SPOT
images from the area of the Flevo Polder, The Netherlands:
SPOT-XS band 1: Spotb1
SPOT-XS band 2: Spotb2
SPOT-XS band 3: Spotb3
As the selection of the training areas is done on a color composite, it has to be
created beforehand.
ILWIS 3.0 Users Guide
267
Image Processing
Create a map list which contains the SPOT bands and display this as a color
composite. Use Spotb3 for Red, Spotb2 for Green and Spotb1 for Blue.
You may save the color composite as a map view. In the following steps a sample set
will be created. This will be used for the actual sampling procedure.
In the map window, choose Create Sample Set from the File menu.
In the Sampling dialog box enter Spot_classes for the Sample Set
Name.
Create a domain for the classes to be sampled by selecting the Create
Domain button. The Create Domain dialog box is opened.
Enter Spot_classes for the Domain Name and click OK. The Domain
Class editor appears.
In the Domain Class editor, click the Add Item button. The Add Domain
Item dialog box is displayed.
Enter the Name: Forest , and the Code: f. Click OK. Repeat this for all
classes as given in Table 6.15. New classes can always be added later on.
Table 6.15:
The land-cover classes in the sample set for a supervised image classification.
Class name
water
forest
grass land
crop1
crop2
crop3
Code
w
f
gl
c1
c2
c3
After having entered all classes, open the Representation Class editor by
pressing the Open Representation button in the toolbar of the Domain
Class editor. Select each class by double-clicking it and choose a color from
the color list or define your own color.
Close the Representation Class editor and close the Domain Class editor
to return to the Create Sample Set dialog box.
The Sample Set editor will be started. Two windows are displayed: A map window
showing the false color composite and a window showing the sample set statistics.
During the sampling procedure, consult also the topographic map of the Flevoland
region, shown in Figure 6.9.
268
Image Processing
Zoom in on an area with water and press the Normal button in the toolbar to
return to the normal mode. To select pixels press the left mouse button and
drag the cursor. When the mouse button is released, the statistics of
the current selection of pixels are shown in the Sample Statistics window,
Current Selection (Figure 6.19).
Click the right mouse button to reveal the context-sensitive menu and select
Edit. Select the appropriate class from the class list (w: Water ). Once this
selection is added to the class, the total class statistics are shown in the upper
part of the table.
One can always compare the statistics of a sample with the statistics of a
class, by selecting the class in the class list.
Repeat the sampling procedure for a number of water samples and then continue with sampling the other land cover classes.
If a land cover class has not yet been defined and, therefore, does not appear
in the class list, a new class can be created by selecting <new> .
Add a new class (Name: Urban , Code: u). Take samples of this class.
To select multiple training pixels you can drag rectangles or you can hold the
Ctrl-key.
The Sample Statistics window contains the code and name of the selected class as
well as the number of bands. The following statistics are shown for a selected class
(see Figure 6.20):
-
269
Image Processing
Displaying Feature Spaces
The classes can be plotted in distinct colors in the feature space, which enables a
judgement of whether the classes can really be spectrally distinguished and whether
each class corresponds to only one spectral cluster (if not, it is advisable to create
sub-classes, which must be joined after the classification is finished). After training is
done, a feature space with training samples may look like Figure 6.21.
The number of training samples should be between 30 and some hundreds of samples
per class, depending on the number of features and on the decision making that is
going to be applied. The feature space is a graph in which DN values of one band are
plotted against the values of another. To view a feature space:
Click the Feature Space button in the toolbar of the Sample Set editor.
The Feature Space dialog box is opened.
Select two bands for which a feature space should be created. Select Spotb1
for the horizontal axis (band 1) and Spotb2 for the vertical axis (band 2).
Click OK. The feature space of Spotb1 against Spotb2 is displayed.
Try also the other band combinations for the feature space display.
You will probably see some overlapping classes in the feature space.
What can be said about the standard deviation for the urban area and how can this be
explained?
270
After you have finished the sampling, close all windows and return to the
ILWIS Main window.
Image Processing
6.6.4 Classification
It is the task of the decision-making algorithm to make a partitioning of the feature
space, according to our training samples. For every possible feature vector in the
feature space, the program must decide to which of the sets of training pixels this
feature vector is most similar. After that, the program makes an output map where
each image pixel is assigned a class label, according to the feature space partitioning.
Some algorithms are able to decide that feature vectors in certain parts of the feature
space are not similar to any of the trained classes. They assign to those image pixels
the class label Unknown. In case the area indeed contains classes that were not
included in the training phase, the result unknown is probably more realistic than to
make a wild guess.
To find the relationship between classes and feature vectors is not as trivial as it may
seem. Therefore, various decision-making algorithms are being used; they are
different in the way they partition the feature space. Four of them are:
- The Box classifier is the simplest classification method: In 2-D space, rectangles
are created around the training feature vector for each class; in 3-D they are
actually boxes (blocks). The position and sizes of the boxes can be exactly around
the feature vectors (Min-Max method), or according to the mean vector (this will
be at the center of a box) and the standard deviations of the feature vector,
calculated separately per feature (this determines the size of the box in that
dimension). In both cases, the user is allowed to change the sizes by entering a
multiplication factor. In parts of the feature space where boxes overlap, it is usual
to give priority to the smallest box. Feature vectors in the image that fall outside all
boxes will be unknown.
- The Minimum Distance-to-mean classifier, first calculates for each class the mean
vector of the training feature vectors. Then, the feature space is partitioned by
giving to each feature vector the class label of the nearest mean vector, according
to Euclidean metric. Usually it is possible to specify a maximum distance
threshold: if the nearest mean is still further away than that threshold, it is assumed
that none of the classes is similar enough and the result will be unknown.
- Minimum Mahalanobis Distance classifier. For the spectral values of a pixel to be
classified, the distances towards the class means are calculated as Mahalanobis
distance. The Mahalanobis distance depends on the distances towards class means
and the variance-covariance matrix of each class. The class name with the shortest
Mahalanobis distance is assigned, if this distance is smaller than the user-defined
threshold value. Else, the undefined value is assigned.
- Gaussian Maximum Likelihood classifiers assume that the feature vectors of each
class are (statistically) distributed according to a multivariate normal probability
density function. The training samples are used to estimate the parameters of the
distributions. The boundaries between the different partitions in the feature space
are placed where the decision changes from one class to another. They are called
decision boundaries.
ILWIS 3.0 Users Guide
271
Image Processing
In this exercise, different types of land-cover in the area will be detected by
implementing a supervised classification, using the sample set prepared in the
previous exercise on sampling. The output will be a map with domain type class
representing land-cover units in the area.
The four standard techniques for classifying an image in ILWIS are:
1) The Box classifier;
2) The Minimum Distance classifier;
3) The Mahalanobis Distance classifier, and
4) The Maximum Likelihood classifier.
Each classifier uses a sample set, only the procedure to classify an image is different.
Classification methods
The box classifier uses class ranges determined by the DN values observed in the
training set. These intervals result in rectangular spaces or boxes; hence, the name
box classifier.
Having sampled a representative amount of pixels per class, the mean DN values of
the class are used, together with the standard deviation of the sample and a
multiplication factor, to determine the extent of the box. The boundaries of the box
are defined by the product of the standard deviation and the multiplication factor.
A pixel not falling within a box, is not classified. If a pixel lies within two or more
overlapping boxes, the pixel is classified according to the smallest box.
The bands used in this exercise are from a SPOT image of the Flevo Polder, The
Netherlands:
SPOT-XS band 1: Spotb1
SPOT-XS band 2: Spotb2
SPOT-XS band 3: Spotb3
When performing an automated box classification, the different land cover classes in
the area will be detected by implementing a programmed classification rule, using a
specified sample set. The output map will be a map with classes representing the land
cover units in the area. The sample set, to be used, has been created in the part about
sampling.
272
In the Catalog, click the sample set Spot_classes with the right mouse
button and select Classify. The Classify dialog box appears.
Image Processing
Visually compare the results with the classified map using the default multiplication factor.
Close all map windows when you have finished the exercise.
Open the pixel information window and add the maps Spotb1 , Spotb2 ,
Spotb3 and Spot_Box .
Evaluate for pixels the different cover classes defined and the result of your
classification.
To get a better idea of the overall accuracy of the classification, use has to be made of
the test set which contains additional ground truth data, which have not been used to
train the classifier. Crossing the test set with the classified image and creation of a
confusion matrix, is an established method to assess the accuracy of a classification.
See the ILWIS Help topic How to calculate a confusion matrix for more
information about creating a confusion matrix.
It is not recommended to use the same sample map for both the classification and the
accuracy assessment, because this will produce figures that are too optimistic.
Post classification operations
The final classification may not meet the expected results. This can be due to spectral
overlap in the sample set, or because the classifier has not been trained properly. If
this is the case the classification process should be repeated, incorporating for
example more spectral classes. Defining sub-classes, when a bi-model distribution or
large standard deviation/variance exists in a class, will improve the classification
ILWIS 3.0 Users Guide
273
Image Processing
results. After the classification process these classes can be merged again. If the
obtained results are still not according to expectations, incorporation of ancillary nonspectral information might be considered, for example elevation information might be
useful to distinguish certain forest types.
In a classified image small areas occur, consisting of one or a few pixels, to which
another class label has been assigned, compared to the larger homogeneous classified
surrounding areas. Individual non-classified pixels may also occur throughout the
classified image. If there is, for example, a need to integrate the results with other
data sets, a large number of small individual units will occur which can not be
properly represented on a map. To circumvent these problems the classified image
may be generalized in order to remove these small individual areas. Spatial filters are
a mean to achieve this objective, e.g. individual pixels may be assigned to the
majority of the surrounding pixels.
Undef majority filter
A standard filter, which can be applied, is the majority filter. The majority filter
selects the predominant (most frequently occurring) value of a pixel and its 8
neighbors. The undef majority filter selects only the predominant value if the central
pixel is zero, which thus removes isolated unclassified pixels and assigns the pixel to
the surrounding class.
Click one of the classified output maps with the right mouse button and
select Image Processing, Filter from the context-sensitive menu. The
Filtering dialog box is opened.
In the Display Options - Raster Map dialog box accept all defaults and
click OK to display the Majority map.
Display also the original classified output image and compare both images.
Enter Majority as Output Raster Map name, accept all other defaults and
click Show. The map Majority will be created.
These post classifier operations should be used with care: small areas are of high
relevance for some applications. A further generalization can be achieved if the
majority filter is applied several times.
Close the map windows when you have finished the exercise.
274
Image Processing
Select Spotb1 , Spotb2 and Spotb3 . Use the same number of classes as
when performing the supervised classification.
Type Unsupervised for the Output Raster Map name, clear the check
box Output Table and click Show. The supervised map is calculated and
after the calculation the Display Options - Raster Map dialog box is
opened.
Accept the defaults in the Display Options - Raster Map dialog box by
clicking OK. The map is displayed.
Display one of the maps produced with the supervised classification method
and compare the results.
Close the map windows when you have finished the exercise.
275
Image Processing
Summary: Image classification
- In order to extract information from the satellite images, the relationship between
pixel values and land cover types must be found. The process to find the
relationship is called classification.
- Density slicing is a technique, whereby the DNs distributed along the horizontal
axis of an image histogram, are divided into a series of user-specified intervals or
slices. Density slicing will only give reasonable results, if the DN values of the
cover classes are not overlapping each other.
- Multi spectral image classification is used to extract thematic information from
satellite images in a semi-automatic way. The values of the various bands found for
1 pixel in several bands are called feature vectors. Such a vector can be plotted in a
3-dimensional space, called feature space. Pixels belonging to the same (land
cover) class and having similar characteristics, end up near to each other in the
feature space. In order to make the classifier work with thematic (instead of
spectral) classes, some knowledge about the relationship between classes and
feature vectors must be given.
- The classification process is divided into two phases: a training phase, where the
user trains the computer, by assigning for a limited number of pixels to what
classes they belong in this particular image, followed by the decision making phase,
where the computer assigns a class label to all (other) image pixels, by looking for
each pixel to which of the trained classes this pixel is most similar.
- About each class some ground truth is needed: a number of places in the image
area that are known to belong to that class. It is the task of the decision- making
algorithm to make a partitioning of the feature space, according to our training
samples. For every possible feature vector in the feature space, the program must
decide to which of the sets of training pixels this feature vector is most similar.
After that, the program makes an output map where each image pixel is assigned a
class label, according to the feature space partitioning.
- Various decision making algorithms are used: box classifier, minimum distance to
mean classifier, minimum Mahalanobis distance classifier and Gaussian maximum
likelihood classifier.
- Unsupervised classification. One way to perform a classification is to plot all
pixels (all feature vectors) of the image in a feature space, and then to analyze the
feature space and to group the feature vectors into clusters. In this process there is
no knowledge about thematic land cover class names. The user must specify
some parameters such as the number of clusters (approximately) you want to
obtain, the maximum cluster size (in the feature space), the minimum distance (also
in the feature space), that is allowed between different clusters, etc.
276
CHAPTER 7
277
278
To view attribute information in a pixel information window, you have to add one or
more maps that have an attribute table to the pixel information window. You should
display at least one map in a map window.
In this exercise you will start to read the information from four polygon maps
Geology , Geomorphology , Landuse , and Catchment (watersheds in the
mountain area) together with their tables. In the map window, you will display a false
color composite made of the TM bands 4, 3 and 2.
When you move the mouse pointer in the map window, you will see information on these maps in the pixel information window.
For this exercise we have also prepared some maps that are made from the segment
map Contour : a Digital Elevation Model (Dem ) and a slope map (Slope ). The
ILWIS 3.0 Users Guide
279
Also add the raster maps Dem and Slope to the pixel information window.
You can do this for instance by using the Add Map command in the File
menu of the pixel information window.
Firstly, the pixel information window receives the XY-coordinate from the mouse
pointer (located in a map window) or the digitizer cursor (located on a referenced
paper map on the digitizer). Then, for this received coordinate, information of all
raster, polygon, segment and point maps that were added to the pixel information
window is retrieved and displayed simultaneously. For raster maps, the retrieved
information refers to the pixel pointed at with the mouse pointer, hence pixel info.
Click somewhere in the map window. You can see the corresponding information of that location in the pixel information window.
Move the mouse pointer through the map to continuously display the information.
The three polygon maps do not cover the entire area displayed in the false color
composite. If you move to the right of the image, you will see that the information
from the geologic and geomorphologic maps is missing (it says for the maps: ?
outside map , and for attribute data: ?).
You can use pixel information to become familiar with the data and to find out
certain relations between one map and another.
To find such relations it may be useful to display these maps on top of the false color
composite.
When the Display Options - Polygon Map dialog boxes appear, specify:
Boundaries Only and choose for:
Catchment (Boundary Color: White )
Geology (Boundary Color: Magenta )
Geomorphology (Boundary Color: Yellow )
Landuse (Boundary Color: Green ).
For more information on how to manage data layers we refer to chapter 2 and to the
ILWIS Help topic Basic concepts: Layers in a map window.
280
In the Layer Management pane, clear the Show check boxes of the layers
Geology , Geomorphology and Catchment .
Now you only see the green boundary lines of the land use polygons on top of the
false color composite.
Position the pixel information window and the map window in such a way on
your screen that you can easily see both.
Move the mouse pointer through the map, while keeping the left mouse button pressed. You can read simultaneously the land use information in the map,
and all other information from the pixel information window.
By manipulating layers that are displayed in a map window and information shown in
the pixel information window, you can easily evaluate your data.
Find the answer to the following questions (use the information in the pixel
information window, and change the displayed polygon layers using Layer
Management in the map window as you wish):
- What is the predominant land use type on the alluvial fans, just north of the
city of Cochabamba?
- What is the maximum elevation at which we still find forest?
- For which catchment do we not have geological nor geomorphologic information?
- Are there parts of the city of Cochabamba that may be flooded?
- Which one of the geomorphologic zones (column zonation ) has the steepest slope? In which range are these slopes?
281
Open table Cityblock and inspect the properties of the various columns, by
double clicking the column titles. As you can see, the column Landuse has a
class domain (City_Landuse ), the column District has an ID domain
(District ), and the columns Area , Population , and
Population_Density all have a value domain. When you have seen the
properties of the columns, close the table again.
The Cityblock map is now displayed in seven different colors. Each city block has
a unique code.
Click some of the units in the map and find out their codes.
Double-click a unit in the map to find information in the attribute table that is
connected to the map.
If you wish you can drag the Edit Attributes window into the map window,
and dock it.
The polygon map window with the Edit Attributes pane docked into the map
window is shown in Figure 7.1.
As you can see, there is information on each city block. The white areas (the roads
in-between the city blocks) have no information. Although you could, for example,
double-click each city block to find out its land use, it is obvious that this is a tedious
procedure. ILWIS has a more flexible way: you can display a map by one of its
attributes.
282
Close the Edit Attribute pane by clicking the cross in the upper-right.
Figure 7.1:
A polygon map window with both the Layer Management pane and the Edit
Attribute pane docked in the map window.
In the Layer Management pane of the map window, double-click the map
Cityblock . The Display Options - Polygon Map dialog box is opened.
In the Display Options - Polygon Map dialog box select the check box
Attribute. Now a list box appears to the right of the word Attribute, containing columns of the attribute table Cityblock .
Select the column Landuse . This column contains the dominant land use
type of each cityblock.
The map Cityblock is re-displayed, but now in such a way that the colors no longer
represent the various codes of the city blocks. The colors now show the land use
types according to representation City_Landuse .
283
Click on the different units in the map. You can see that for each city block
the land use type is shown as well as the code of the city block.
Displaying a map by one of its attributes allows you to get a good idea on the
distribution of the different attribute values throughout a map.
You will display another attribute of the Cityblock map: District . Each city
block forms part of a cadastral district of the city. The District column uses an
identifier domain.
Click with the right mouse button while the mouse pointer is in the map window. Select Display Options from the context-sensitive menu and click on
the polygon map name Cityblock .
Select the check box Attribute, and select column District . Since this column uses an identifier domain, you cannot select a representation. Instead,
you can display districts in 1, 7, 15 or 31 colors.
Select the option Multiple colors, and 15 . Click OK. Now the map is displayed according to the districts of the city.
Now the map Cityblock will be shown by the attribute population density. The
column Population_Density uses a value domain
Change the options in the Display Options dialog box in such a way that the
attribute Population_Density is displayed with the Representation
Pseudo . Stretch between 0 and 1000 .
You can display both raster and vector maps by one of its attributes, as long as the
map has a class or ID domain and an attribute table is linked to the map. This is
defined in the Properties sheet of the map.
Retrieval with a mask
Finally, you will have a look at some other useful options in the Display Options
dialog box that can help you to evaluate the data.
We will switch to another example: the land use map of the region around the city of
Cochabamba, called Landuse . You can selectively display units in a map, e.g. only
the land use type Forest .
284
In the Catalog, double-click polygon map Landuse . The Display Options Polygon Map dialog box is opened.
Select the check box Mask, type the class name Forest in the appearing
text box and click OK.
Only the land use unit Forest is shown in the map window. Suppose you want to
show the following four units: Bare rock , Bare soils , Agriculture , and
Agriculture (irrigated) . Instead of typing full names or codes you can use
wildcards: the asterisk * to replace zero or more characters, and the question mark
(?) to replace one character.
Open the Display Options dialog box of polygon map Landuse again.
Select the check box Mask, and type the following search strings in the
appearing text box: Bare*,Agri*
Now only four units of the map are displayed: Bare rock , Bare soils ,
Agriculture and Agriculture (irrigated) .
A mask can be used to selectively display vector data. For maps with many different
units this can be quite useful, e.g., to show specific contour lines.
Select the check box Info and click OK. Only the contour lines from 3000 to
3440 are displayed.
Click OK in the Display Options Segment Map dialog box. Only the
hundred meter contour lines are displayed.
In the Display Options Segment Map dialog box, select the check box
Mask, and type the following search strings in the appearing text box: 30* ,
31* , 32* , 33* , 34* .
In the Display Options Segment Map dialog box, select the check box
Mask, and type the following search string in the appearing text box: ??00 .
For more information about using wildcards in Mask, we refer to the ILWIS Help
topic How to use masks.
285
286
Figure 7.2:
Type the following formula on the Command line in the Main window:
Rocks=iff(Landuse=Bare rock,Landuse,?)
In words this formula means: If the land use type is Bare rock , then the resulting
map (Rocks ) will contain the information from the Landuse map (thus class Bare
ILWIS 3.0 Users Guide
287
Press Enter after typing the formula. The Raster Map Definition dialog
box is opened. Accept the defaults, and click Define.
At this stage, only the definition, i.e. the formula to calculate the output map (listed
in the Expression text box in the Raster Map Definition dialog box) is saved, but
the actual calculation has not yet been performed. When you now open the map, the
formula will be calculated.
The map Rocks is displayed on the screen. It only contains one unit: Bare rock .
The rest of the map is undefined (?).
Double-click the raster map Rocks in the Catalog. The Display Options Raster Map dialog box is opened. Accept the defaults by clicking OK.
It is important to note that this is an example of a rather inefficient way to carry out
data retrieval. To get an answer to our question: Where are the bare rocks we have
created another raster map, which occupies a considerable amount of disk space, and
which contains about 90 % undefined values. The information where bare rocks can
be found, could be obtained more easily by displaying the polygon map land use with
the mask Bare rock , as was demonstrated in the previous exercise.
Type the following formula on the Command line of the Main window:
Grass = Landuse = Grassland
The Raster Map Definition dialog box is opened. As you can see, the suggested domain is called: Bool (for Boolean). Click Show.
Accept the defaults in the Display Options - Raster Map dialog box by
clicking OK. The map is displayed.
Click the various units to find out what they mean.
288
Press Enter and answer the question Overwrite? with Yes. In the Raster
Map Definition dialog box, select domain Bit .
Display map Grass (now with the Bit domain), and close the map window
when you have finished the exercise.
If you use the Bit domain, undefined values also become 0 (false). It is generally
better to use the Bool domain.
Simple reclassification with a MapCalc formula
The previous examples were more intended for data retrieval rather than for
reclassification. No new values were assigned to pixels in the output map. Let us now
look at a simple example in which we do want to give the output map a meaning,
which is different from the input map.
Suppose, in this example (similar to the one shown in Figure 7.2), that you are
interested to differentiate between land and water in the area. The land use units are
reclassified into new names, either Land or Water . These two class names
(Land , Water ) do not occur in domain Landuse .
Type the following formula on the Command line of the Main window:
Landwater=iff((Landuse=Lake)or(Landuse=
Riverbed),Water,Land)
The Domain list box in the Raster Map Definition dialog box is empty. This is
because the program does not know which domain to select, since both the names
Water and Land do not occur in the domain of the input map Landuse . Now
there are two options:
- Either you add the items Water and Land to the domain Landuse , or
- you create a new domain with these two class names.
We will select the latter option here. Since Land and Water are not really land
use types, it is better to put them in a separate domain.
ILWIS 3.0 Users Guide
289
Click the Create button to the right of the Domain list box. The Create
Domain dialog box is opened.
Type the Domain Name Landwater . Click OK. Now the Domain Class
editor is opened. Close the Domain Class editor. You are back in the Raster
Map Definition dialog box. Click Show.
The Merging domains dialog box appears, with the question: Add string
Water to domain Landwater . Answer with Yes.
The Merging domains dialog box appears, with the question: Add string
Land to domain Landwater . Answer with Yes.
The Display Options - Raster Map dialog box appears. Accept the defaults
by clicking OK. The map Landwater is displayed.
Use the left mouse button to inspect the meaning of the units.
Close the map window.
This is another way to work with MapCalc; of course you can also type the formula
directly on the Command line of the Main window.
290
Accept the defaults by clicking the OK button in the dialog box. The Domain
Class editor is opened. Close the Domain Class editor.
Accept to add the following items into domain Demclass : Low , Moderate
and High .
Accept the defaults and click OK. The map is displayed. Click the units to
find out their meaning.
Close the map window when you are finished with the exercise.
We can draw the same conclusion as before: MapCalc formulas are suitable for
simple classifications. If we want to make more complex classifications, we would
need to make many nested IFF statements, which would make the formula too long
and too complex. Unlike class and ID maps, there is no possibility to reclassify value
maps by an attribute table as value maps cannot have an attribute table.
To solve this problem of complex classifications, we can make use of a special
operation, called Slicing. This will be explained in section 7.5.
Summary: Using MapCalc formulas for retrieval and (re)classification
- In this exercise we have seen that it is possible to retrieve information from a map,
using a Map calculation formula.
- The expression of a Map calculation formula often has the notation iff(.... , ... , ...)
which is called an IFF function with conditional, then and else parts.
- The result of a Map calculation formula is a new output raster map. The domain of
this output map depends on the contents of the formula. The domain of the output
map can either be class, ID or value. A combination of the three is not possible.
- If you use a Map calculation formula for the retrieval of one unit in a map, you can
use the same domain for the output map as for the input map, and assign undefined
to all other classes.
- Another option for data retrieval using a Map calculation formula is to use a socalled Boolean statement, which can either be true or false.
ILWIS 3.0 Users Guide
291
292
Figure 7.3:
In this exercise you will first use the polygon map Cityblock to create a new
polygon map representing the land use of the city blocks of Cochabamba. The
polygon map Cityblock has an identifier domain; each unit is codified by an ID
from 1 to 717. This map has an attribute table, which is also called Cityblock . One
ILWIS 3.0 Users Guide
293
In the Display Options - Polygon Map dialog box, accept the defaults by
clicking the OK button.
In chapter 5 (attribute data handling) you have created a table District with
information on each district of the city. Now that you have also generated a district
map, and as both the map and the table use the same domain (District ), you can
link the table District to the map District .
294
In the map window, open the File menu, select Properties and click on the
polygon map District . The Polygon Map Properties sheet appears.
Click the check box Attribute. Select the table District . Click OK to close
the dialog box.
Open the pixel information window, and drag the polygon maps Cityblock ,
City_Landuse and District to it. Evaluate the contents of the maps and
tables while moving with the mouse pointer over the map.
Position the mouse pointer on the Command line of the Main window and
type the following command:
Landvalue=Landuse.Landvalue
295
Figure 7.4:
In this exercise the Slicing operation is performed on the raster map Dem in order to
group the altitude values (ranging between 2520 to 4560 meter) into five relative
altitude classes, shown in Table 7.1.
296
Upper
boundary
Group name
3000
3500
4000
4500
5000
<3000 m
3000-3500
3500-4000
4000-4500
4500-5000
m
m
m
m
The raster map Dem has a domain type value in which pixel values refer to the height
of the terrain.
Temporary classification for display options
Before the Slicing operation is demonstrated, it is useful to firstly apply a method,
which shows the map, as if it was classified, just by manipulating the maps
representation.
Double-click raster map Dem in the Catalog. The Display Options - Raster
Map dialog box is opened. Click OK to display the map.
In the Layer Management pane double-click the raster map Dem to open the
Display Options - Raster Map dialog box again.
In the dialog box click the Create button next to the Representation list
box. The Create Representation dialog box is opened.
Type for Representation Name: Demclass2 . Accept the other defaults and
click OK. The Representation Value editor is opened.
Press the Insert Limit button in the toolbar. The Insert Limit dialog box is
opened. Enter the limit 3000 and select the Color Red and click OK.
Insert also the other limits shown in the Table 7.1 (3500 , 4000 , 4500 ) and
select a color for each.
Click the word Stretch between two limits. A list box appears.
Click once more to open the list box and select Upper. Do this for all ranges
in between limits.
Close the Representation Value editor. You are back in the Display
Options - Raster Map dialog box. Click OK. The map is now displayed as
if it was classified.
The representation can be edited, and the result shown on the screen. Use the
Redraw button in the map window, to redraw the map with the updated
representation. This allows you to interactively select the best boundaries for the
classification.
297
For a group domain, you can enter an upper boundary, a name and a code for each
class/group. This domain will be used to slice or classify the raster map Dem . The
upper boundaries and group names, shown in the Table 7.1, will be used in this
exercise.
Click the Add Item button in the toolbar of the editor. The Add Domain
Item dialog box is opened.
Type altitude <3000 m in the Name text box. The use of a Code is
optional. It will not be used now.
Click OK.
Click the Add Item button again, or press the Insert-key of the keyboard to
enter the next upper boundary and name.
Repeat the steps and add the other classes with boundary values, according to
Table 7.1: 3500, 4000, 4500 and 5000 .
Open the File menu in the Domain editor and select Open Representation.
You can also click the Open Representation button in the toolbar.
The Representation Class editor is opened, showing the five groups/classes that
are present in the domain with different colors.
298
To edit colors of multiple classes (groups), select the first class, press the
Shift-key and select the last class. Use the right mouse button and select Edit
items from the context-sensitive menu.
In the Edit Multiple Items dialog box, make sure the option Color Range is
selected.
Select two colors (e.g. White and Brown ) for the color range between From
Color (until 3000 ) and To Color (4500-5000 ) and click OK.
You can use the Variation check box when a random color variation should be used
with a certain margin around the straight line between the specified From Color and
To Color in the RGB color cube. Subsequently, specify a value between 1 and 255
for the maximum variation allowed. See also Figure 7.5.
Figure 7.5:
Two dimensional representation of a color range without variation (solid dots) and a
color range with variation (open dots). In the Edit Multiple Items dialog box, you can
select the option Variation to use a random color variation with a certain margin (V)
in the Red, Green and Blue color cube.
299
Close the Representation Class editor when you are satisfied with the colors.
Accept the defaults by clicking OK. The map and the legend are displayed on
the screen.
If you wish, you can change the colors again by double-clicking the word
Legend in the Layer Management pane. Press the Redraw button in the
toolbar of the map window to apply the changes.
Use the pixel information window to compare the values of the original map
(Dem ) with the names in the classified map (Classified_Dem ).
Click the Show button in the Slicing dialog box. The Display Options Raster Map dialog box is opened.
in which:
OUTMAP
CLFY
InputMapName
DomainGroup
300
Use the left mouse button in the map window to inspect the result.
Edit the colors if you wish, e.g. Low = Yellow , Moderate = Orange , High
= Red .
Close the map window when you finished the exercise.
301
302
Select the Polygon Map Geomorphology . Type for the Output Point
Map: Geompoint .
Click Show. The point map is calculated and the Display Options - Point
Map dialog box is opened.
Click OK in the Display Options - Point Map dialog box. The point map is
displayed.
The points you see are the center points of the geomorphologic polygons. The colors
are according to the geomorphologic representation (Geomorphology ).
The histogram table shows the number of points for each geomorphologic class.
In the table window, press the New Graph button on the toolbar. The Graph
dialog box appears.
In the Graph dialog box deselect the X-column check box and click OK. The
Graph Options sheet is opened.
On the X-Axis tab type for the Axis Text: Geomorphologic unit .
On the Y-Axis (left) tab change the Axis Text to: Number of points and
click OK in the Graph Options sheet. The Bar graph is displayed.
Close the graph window and the table window.
Point density
Another measurement operation for points is Point Density. This operation
calculates the number of points that fall within each pixel. This depends of course on
the size of the pixel, which is defined in the georeference. All raster maps (except the
satellite images) in the demo data set have the georeference Cochabamba , which has
a pixel size of 20 meters. Counting the number of points that fall in each pixel with
such a small size, will not make much sense (there will be always only one point in
the cell, unless the points are very close). Therefore we will generate another
georeference with a much larger pixel size. The same point map (Geompoint ) as in
the previous exercise will be used.
ILWIS 3.0 Users Guide
303
Click the point map Geompoint with the right mouse button.
Select Rasterize, Point Density from the context-sensitive menu. The Point
Density dialog box is opened. Since you used the context-sensitive menu on
the point map Geompoint , this map is already shown as the input Point
Map. Defaults are available for the Point Size and the Output Raster Map
name. Accept these defaults.
Click the Create button next to the Georeference list box. The Create
GeoReference dialog box is opened.
Change the Pixel Size to 400 . The number of lines of the raster map will
only be 47 and the number of columns 28. Click OK. You return to the Point
Density dialog box. Type the description: Number of points within
pixels of 400 meters .
Click Show. The map is calculated and the Display Options Raster Map
dialog box appears.
Select the Representation Pseudo and click OK. The map is displayed.
Press the left mouse button on a few pixels in the map. The points are widely
spaced, even with a pixel size of 400 by 400 meters, we only get a maximum
of 3 points in 1 pixel.
The Point density operation is useful, when you are working with point maps that
are derived from detailed surveys in which points are measured at close intervals. It
may then happen that several points occur within one pixel of the thematic raster
maps that you are using. For example, when you are using GPS (Global Positioning
Systems), you may take a number of very closely spaced (X,Y,Z) coordinates in the
field. An example of an engineering geological application: sample points for soil
tests taken in a certain area may be so close to each other that several sample points
fall in the same pixel of the soil map that you are using.
Distance between points
With the distance tool distances and directions (angles) can be measured.
304
Click a point of interest somewhere in the map (starting point), hold the left
mouse button down, and release the left mouse button at another position
(end point). The Distance message box appears.
Point in Polygon
The last measurement operation that will be shown here is the so-called point in
polygon operation, that allows you to rapidly find out in which mapping units the
points of a point map are located. This information can be obtained after opening the
point map as a table.
Click point map Geompoint in the Catalog with the right mouse button and
select Open as Table from the context-sensitive menu. The point map is now
opened as a table, with two columns: Coordinate and Name . Now it is also
possible to use table calculation expressions.
If you do not see the Command line in the table window first open the View
menu and choose Command Line.
Type the following formula on the Command line of the table window:
Geology=Mapvalue(Geology.mpa,Coordinate)
The Mapvalue function extracts thematic information from any map at a specific
location. In this case, information is extracted from polygon map Geology
(Geology.mpa ) using the X and Y coordinates of the points in the current point
map.
The Column Properties dialog box is opened. Accept the defaults and click
OK. The column Geology now appears in the table window.
Check the ILWIS Help topic Table calculation: Special calculations, for other
useful functions to calculate with coordinates of a point map.
305
306
In the Catalog, click with the right mouse button on segment map Faults .
Click Show.
The segment histogram table shows that there are 17 segments with the code Fault ,
with a total length of 71 km, and 72 segments with the code Lineament , with a total
length of 219 km. In the Statistics pane at the bottom of the table window you can
find additional statistical information. You can open the Statistics pane by choosing
the Statistics Pane command from the View menu.
It is also possible to calculate the length of every individual segment. In this case you
need to convert the Faults map, which has a class domain with two classes, to a
unique identifier map. You can do this with the operation UniqueID. This operation
calculates unique codes for all points in a point map, segments in a segment map, and
polygons in a polygon map.
In the Display Options - Segment Map dialog box select the Info check
box and select the option Multiple colors, and 15 .
Press the left mouse button on some of the segments to check their codes.
You will see that each segment now has a different code.
307
Locate the mouse pointer on the Command line of the table window, and
type the following formula:
Mainfault=(Faults=Fault)and(Length>5000)
The formula can either be true or false. This is called a Boolean statement,
and it results in a column with the domain Bool . Click OK in the Column
Properties dialog box. The new column contains the words True and
False .
Select the check box Attribute, select the column Mainfault and select
White as False Color.
The histogram table for segment maps with a value domain contains more columns:
- Value : the altitude of the contour lines, which have this value code. So the lowest
contour line is 2520 meters and the highest is 4560.
- NrSeg : the number of segments occurring for each value.
- NrSegCum : the cumulative number of segments. For each altitude value the number of segments of all the contour lines with a lower or equal altitude is indicated.
- Length : the length of all segments with the same value.
- LengthCum : the cumulative length of segments. For each altitude value the total
length of all the contour lines with a lower or equal altitude is shown.
308
In the Catalog, click segment map Faults with the right mouse button.
Select Statistics, Direction Histogram from the context-sensitive menu.
The Segment Direction Histogram dialog box is opened. Since you used
the context-sensitive menu on segment map Faults , this map is shown
already as the input map. Type the name of the Output Table: Faults .
Click Show. The table is shown.
The table shows 180 records; one for each degree of the northern part of the
geological compass. Record 1 shows the east-west direction. Record 91 shows the
north-south direction. It is possible to display the directional data in the form of a
Rose Diagram.
In the table window, open the Graphs menu and select the Rose Diagram
command.
In the Graph dialog box select Direction for the X-column, Length for
the Y-column and click OK
In the Graph Options - Direction x Length sheet, select Needle and click
Show.
This Rose Diagram shows in which direction faults have the largest length. It is also
possible to display the number of segments instead of the length.
In the Graph Options - Direction x NrLines sheet, select Needle and click
Show. The rose diagram now shows the number of segments for the different
directions.
309
In the Catalog click with the right mouse button on segment map
Drainage .
Select the check box Mask and type the mask Drainage .
Click Show.
The drainage density is now being calculated. After that the Display Options Raster Map dialog box is opened.
Zoom in on one of these lines so that you can see only about 20 individual
pixels. Click a few pixels to read the values.
Open the Layers menu and select Add layer. In the Add Data Layer dialog
box select the segment map Drainage and click OK. The Display Options
Segment Map dialog box appears.
Select the check box Mask and type Drainage in the text box.
Click OK. The map is displayed. You will see a number of colored lines within a blue map.
Select the option Single Color and choose the color Red .
Click OK. The segment map Drainage is displayed on top of the drainage
density map.
Close the map window after finishing the exercise.
If the window is sufficiently enlarged, you can see the individual pixels and the red
line of the drainage passing over it. The value of the pixel through which a line is
passing indicates the length of that line within the pixel. The pixel size of the map is
20 by 20 meters (check this in the Properties sheet of the raster map). So if the
drainage is crossing the pixel in an exact north-south or east-west direction, the
length of the line in the pixel is also 20 meters. If the line is oriented in NW-SE or in
NE-SW direction, it crosses the pixel diagonally. In that case the length of the
segment in the pixel is 28.28 meters (Pythagoras rule). So this is also the maximum
possible length of a segment in the pixel, unless you have two segments in the same
pixel.
The segment density map by itself is not so useful. It is just showing the length of
segments covering each pixel. It is, however, an important input map for calculating
the segment density of another thematic map, such as a catchment map. In order to
310
311
Click Show.
312
The value 593684 in column Npixcum represents the total number of pixels in the
map (provided that there are no undefined pixels, which are not used in the histogram
calculation). Lets check this.
The georeference determines the pixel size and the minimum and maximum X and Y
coordinates in the map. These determine the number of lines and columns in the map.
As you can see we have 932 lines and 637 columns.
As we have 932 lines and 637 columns, the total number of pixels is 932*637 =
593684, which is the same as the number we have just seen.
ILWIS 3.0 Users Guide
313
Part of the raster map Landuse contains question marks (?). These are undefined
values for which no land use information is available.
Select as Table the histogram of raster map Landuse . Select the Column:
Area , click Next, and type the Output Column Arearaster .
Click Finish.
In the table window, open the Columns menu and select the Join command.
The Join wizard is opened.
You can see from the values in column Area_difference that the Landuse area
values as calculated from the raster map are quite different from those calculated
314
315
CHAPTER 8
317
or
Output_map := Expression
The result of a Map Calculation formula is a raster map. This may be a new map, or
it may be an existing map, which will be overwritten. There are two ways to generate
output maps with Map Calculation:
- When the definition symbol (=) is used, a dependent map is created. Data in a
dependent map depend on data of input maps via the formula, which was used.
When data in the source maps is changed, the results of the calculation in the
output map can be recalculated.
- When the assignment symbol (:= ) is used, a map is created that is independent of
other maps (a source data object, see chapter 2). You can edit the data stored in
such a map using the Pixel editor.
An expression usually contains operators and functions to specify the calculation to
be performed. The map names and the constants that are used in a formula are called
operands. When the expression is executed, the program will perform the calculation
on a pixel by pixel basis, starting from the first pixel in the first line, and continuing
till the last pixel in the last line.
The available MapCalc and TabCalc operators and functions are listed in the ILWIS
Help topic Map and Table calculation. Table 8.1 presents an overview of the
MapCalc functions.
318
You can also use the history of the Command line. Press the Arrow Up key to
retrieve previously used expressions, the Down Arrow key is used to scroll
forward again. You can also open the list of previously used commands and
expressions by clicking the arrow at the right hand side of the Command line.
The amount of commands and expressions that can be retrieved can be set in the
Preferences.
In the following exercises, you will see a number of examples of Map Calculation
formulae, first some that will produce value maps (section 8.1), then some that will
give output maps with a class or ID domain (section 8.3). You will also look at how
dependency links can be used to update maps made with Map Calculation (section
8.2).
Table 8.1:
Some ILWIS functions used in Map Calculation. All the functions in this table can be used on maps with
a domain type value. The Conditional IFF and Undefined functions can also be used on maps with a
domain type class or ID. For a complete overview see the ILWIS Help topic Map and Table calculation.
Functions
Syntax
Operation
Conditional IFF
IFF (a,b,c)
Relational
INRANGE (a,b,c)
Undefined
ISUNDEF (a)
IFUNDEF (a,b)
IFUNDEF (a,b,c)
IFNOTUNDEF (a,b)
IFNOTUNDEF (a,b,c)
POW(a,b)
EXP(a)
Logarithmic
LOG(a)
LN(a)
Random
RND(a)
RND(0)
RND( )
Sign
- (a)
NEG(a)
ABS(a)
SGN(a)
returns a multiplied by 1.
returns a multiplied by 1.
Returns the absolute (= positive) value of a.
Returns -1 for negative values of a, 0 if a= 0, and 1 for positive values of a.
Exponential
SQ(a)
SQ(a,b)
SQRT(a)
HYP(a,b)
319
Table 8.1:
(continued)
Functions
Syntax
Operation
Rounding
ROUND(a)
FLOOR(a)
CEIL(a)
MinMax
MIN(a,b)
MIN(a,b,c)
MAX(a,b)
MAX(a,b,c)
Returns
Returns
Returns
Returns
NDVl
NDVI(a,b)
Trigonometric
SIN(a)
COS(a)
TAN(a)
ASIN(a)
ACOS(a)
ATAN(a)
ATAN2(y,x)
Hyperbolic
SINH(a)
COSH(a)
TANH(a)
Pre-defined values
and variables
PI
PI2
PIDIV2
PIDIV4
EXP(a)
%X
%Y
%L
%C
Value : 3.141592653589793
Value 2 : 6.283185307179586...
Value 1/2 : 1.570796326794896
Value 1/4 : 0.785398163397448
Returns exponential: ea ; Value e : 2.718281828459045...
Variable to calculate with X-coordinates in a map.
Variable to calculate with Y-coordinates in a map.
Variable to calculate with Line or Row numbers in a map.
Variable to calculate with Column numbers in a map.
Special function to
classify values
CLFY
(a , DomainGroup)
320
the
the
the
the
List of the ILWIS arithmetic operators used in the MapCalc with a domain type
value or image.
Syntax
Operation
Example
+
*
/
^
a MOD b
a DIV b
Add
Subtract
Multiply
Divide
Exponential operator; POW(a,b); ab
Returns the remainder of a divided by b (e.g. returns 1 if a=10 and b=3)
Returns the quotient of a divided by b (e.g. returns 3 if a=10 and b=3)
a
a
a
a
a
a
a
+b
-b
*b
/b
^b
MOD b
DIV b
In the Figure 8.1 some examples of these arithmetic operators are given.
Figure 8.1:
Some examples of arithmetic operations in ILWIS. The input maps have domain
type value
This means: Add a constant factor of 10 to all pixel values of raster map MapA and
store the result in output map MapC . In other words, output MapC is equal to the sum
ILWIS 3.0 Users Guide
321
This means add the pixel values of MapA and MapB and store the result in MapC1 .
The third calculation is:
MapC2 = ((MapA - MapB) / (MapA + MapB)) * 100
This means: Store raster map MapC2 , which is the result of the subtraction of MapB
from MapA , divided by the sum of MapA and MapB ; then multiply this by 100 . This
formula when applied on two satellite bands (MapB with visible or red values and the
MapA with near-infra-red values) is called the NDVI (Normalized Difference
Syntax
Operation
Example
=
<
<=
>
>=
<>
Equal to
Less than
Less than or equal to
Greater than
Greater than
Not equal to
a
a
a
a
a
a
eq
lt
le
gt
ge
ne
=b
<b
<= b
>b
>= b
<> b
Relational operators (see Table 8.3) test whether one expression is larger than,
smaller than, equal to another expression, etc.
Figure 8.2:
322
This means: For pixels in MapA that have a value greater than 20 , the expression is
true and True (1) is assigned to those pixels in output MapC . For pixels where the
expression is false, a False (0) is assigned (Bool domain).
MapC = MapA <> MapB
In this statement it is checked whether MapA is different from MapB . This statement
can be either true or false. The output map, MapC , will therefore only contain two
different values: True (1) or False (0) . Such a statement would be useful for
change detection, for example to compare two land use maps of different periods.
Logical operators
Logical operators used in MapCalc. They can be used on maps, with
all types of domains.
Table 8.4:
Syntax Operation
AND
OR
XOR
NOT
Returns
Returns
Returns
Returns
true
true
true
true
Example
if
if
if
if
Logical operators (see Table 8.4) compare two expressions and check if both are true
(AND ), at least one is true (OR ), only one is true (XOR ), or one is not true (NOT ).
Figure 8.3:
Examples of logical operations in ILWIS. MapA has domain type class and MapB
has domain type value. The output is either True (1), False (0) or undefined (?).
These operators are also called Boolean operators. Examples of Boolean operators
(AND , OR , XOR , NOT ) are presented in Figure 8.3.
MapD = (MapA=Forest) AND (MapB<500)
323
The expression is true if only 1 of the expressions is true or both of the 2 expressions
are true:
- if a pixel in mapA has class name Forest and in MapB not smaller than 500 .
- if that pixel in mapB has a value <500 and in MapA not Forest .
- if a pixel in mapA is Forest and if that pixel in MapB <500 .
Otherwise the who le expression is false.
MapD2 = (MapA=Forest) XOR (MapB<500)
Conditional functions
The examples that we have used for the relational and logical operators all give
output values, which are either true or false. In practice we use these operators mostly
with the so-called conditional iff function. The general syntax for the conditional iff
functions is:
Output_map = IFF (Condition, Then Expression, Else Expression)
or
Output_map := IFF (Condition, Then Expression, Else Expression)
Where:
Is the name of output map.
Is the definition to create a dependent output map.
Is the assignment to create a non-dependent (editable) output map.
Is the conditional function.
Condition
Is the condition to be met.
Then Expression Is the calculation that has to be performed when the condition
is met.
Else Expression Is the calculation that has to be performed when the condition
is not met.
Output_map
=
:=
IFF
Some examples of the use of conditional functions in ILWIS are given in Figure 8.4.
324
Figure 8.4:
Examples of conditional functions in ILWIS. MapA has domain type class and
MapB has domain type value.
For simplification purposes, we will not use an expression for the Then condition
and the Else condition but we will simply put a value.
MapC = IFF (MapA=Forest , 1, ?)
In words: If a pixel in MapA has a class name Forest , then assign a value 1 to this
pixel in the output map (MapC) . If the pixel does not have the class Forest , then
assign the undefined value (?).
MapC1 = IFF ((MapA=Forest) AND (MapB=700) , 1, 0)
In words: If a pixel in MapA has a class name Forest and at the same time this pixel
in MapB has a value equal to 700 , then assign a value 1 to this pixel in the output
map; else assigns value 0.
325
SL = Slope>20
To get a quick idea of where the steep slopes are type on the Command line
of the Main window:
To get an idea where the landslides are, type on the Command line of the
Main window:
LSL =(Geomorphology=OL)OR ( Geomorphology=AL)
Inspect the values of the maps. Move with the mouse pointer through the
Landuse map and look at the information of the three maps in the pixel
information window.
Close the map windows and the pixel information window when you think
you have a good idea of the content of the maps and attribute tables connected to it.
You start the GIS analysis with an operation that you are already familiar with:
Reclassification (see section 7.3). The land use map has an attribute table, in which
the average land value (per hectare) is stored for each land use type. So you will
reclassify the class map Landuse with the Landvalue column, which will result in
a value map. Since the average land values are given per hectare (100*100=10000
m2), and you are working on maps with a pixel size of 20 meters (i.e., 400 m2 per
pixel), you need to divide the land values by 25 in order to obtain the average value
per pixel.
326
Type the following formula on the Command line of the Main window:
Landvalue = (Landuse.Landvalue)/25
Accept the defaults in the Raster Map Definition dialog box and click
Show.
In this formula, you combine a reclassification expression (of the form: map.column)
with an arithmetic operator (divide). The attribute table name should not be
mentioned unless the table is not linked to the map or to the domain in the
Properties sheet.
Now you will take into account the first criterion: If the slope is more than 20, the
land price will only be 70% of the average.
In this formula, you combine an IFF function with a relational operator in the
conditional part, and an arithmetic operator in the then part. Pixels in the new map
Landvalue1 either have a value which is only 70% of the value as in map
Landvalue , or the same value as in map Landvalue .
Accept the defaults in the Raster Map Definition dialog box and click
Show.
Now lets look at the second criterion: If a pixel is located on an old landslide, then
the value is only 60% of the average land value. If the pixel is on an active landslide
or on an active erosion area, the value is only 40% of the average.
Accept the defaults in the Raster Map Definition dialog box and Click
Show.
For clarification purposes, we used capitals in the expression but you can type small
letters.
327
If you get an error message, you may have made a typing error with the brackets
or the commas. Use the history (Arrow Up key) to correct your formula. Then
press Enter again.
There are several things that need to be explained about this formula. First of all, we
have an example here of a nested IFF function, i.e. an IFF function within another
one. When you use a nested IFF function, you have to make sure that every
individual IFF function has the syntax IFF (Condition, Then Expression, Else
Expression); i.e. an opening bracket, three components separated by commas and a
closing bracket. Furthermore, in this formula, codes are used instead of the names of
the geomorphologic class names. Unit Old landslide in the domain
Geomorphology has code OL . If you use codes, the formulae can be much
shorter. Lastly, the relational operator OR was used, since both the geomorphologic
units Active landslide , code AL and Heavily eroded area , code
HE should give the same decrease of the land values.
Now you have generated two maps each based on one criterion (Landvalue1 , and
Landvalue2 ). What should you do for pixels where more than one of these criteria
occur, e.g. pixels with a slope more than 20, located on an active landslide? As
explained before, the minimum condition determines the result (since 40% of a value
is less than 70% of the same value). Therefore, the minimum of the two maps is
taken. For this you can use the function MIN .
Type the following formula on the Command line of the Main window:
Landval_combined = MIN (Landvalue1 , Landvalue2 )
Undefined values
Note that the colored areas in map Landval_combined occupy a smaller part of
the map than in map Landvalue . The white areas in both maps represent undefined
values. Since the geomorphologic map has a larger part which was not mapped (so a
larger part with undefined values), the formulas, in which this map was used, resulted
in maps which have undefined values for those pixels where any one of the input
maps has undefined values. An undefined value in ILWIS can mean several things:
- No data is available for a pixel. In this case a question mark in the map indicates
that the part of the area lacks data, and data should be supplied in order to do the
analysis properly.
- A pixel is located outside the study area. No action is required from the user.
- The result of a calculation was wrong. In this case a question mark indicates that a
certain operation was wrongly made. This may happen when you make a typing
328
b=True
b=False
b=Undefined
a=True
a=Undefined
True
False
Undefined
False
False
False
Undefined
False
Undefined
a OR b
b=True
b=False
b=Undefined
a=True
a=Undefined
True
True
True
True
False
Undefined
True
Undefined
Undefined
a XOR b
b=True
b=False
b=Undefined
a=True
a=Undefined
False
True
Undefined
True
False
Undefined
Undefined
Undefined
Undefined
NOT b
returns:
b=True
False
True
Undefined
a=False
a=False
a=False
b=False
b=Undefined
329
If you did not notice before that the lower right part of the map
Landval_combined seems to be missing, display map Geom next to the
other maps and check.
Type the following formula on the Command line of the Main window:
Landval_final = IFUNDEF(Geom , Landvalue1 ,
Landval_combined)
The IFUNDEF function tests whether the condition part, i.e. map Geom , is undefined.
In words this formula means: If a pixel in map Geom is undefined (which means no
information on geomorphology is available), than we take the value from the map
Landvalue1 (which includes the slope related land prices), otherwise the value
from the map Landval_combined .
In ILWIS the function IFF(ISUNDEF( a ), b, c ) gives the same result as the
expression IFUNDEF( a, b, c ).
330
Accept the defaults in the Raster Map Definition dialog box and click
Show.
331
Move with the mouse pointer over map Landval_final . On the Status
bar you see on the right-hand side D, C, U. This means that map
Landval_final is Dependent (D), Calculated (C) and Up-to-Date (U).
On the Dependency tab one can read: Object is up-to-date. This means
that no changes were made in the input maps after the time that the map
Landval_final was created.
Another way to see if an object is Dependent (D), Calculated (C) and/or Upto-Date (U) is by switching the Catalog to Details View (by choosing the
Details command from the View menu or by clicking the Details button
in
the Standard toolbar of the Main window).
This table contains the column Landvalue (the average value of the land per hectare
for the different land use types). The values for the units Lake and Riverbed are
undefined.
Now suppose there is a shortage of water in the Cochabamba area, then the price of
water will increase considerably. Many factories would like to have their own lake, as
is the case for the large beer brewery Taquina. So there should also be a value added
to the land use type: Lake .
332
Double-click the Lake in the map window; the landvalue of the lake will now
be 400. Close the map and table when done.
In the attribute table Landuse , edit the Landvalue field for the Lake
record. Type 400 .
As you can see the lakes in the map Landval_final still have undefined values.
Although we have edited the land values in the table Landuse for the lakes, the final
result is still not updated. Updating does not happen automatically, but is decided by
the user.
It is indicated (day, month, year, time) when you have updated the column
Landvalue (if it is correct that should be about a minute ago).
Go to the Catalog and move with the mouse pointer over map
Landval_final .
On the Status bar you see the characters D, C, N. This means that the map
Landval_final is Dependent (D), Calculated (C) but that the map is
Not Up-to-Date (N).
On the Depencency tab, press the Make Up-to-Date button. The Check
Up-to-date dialog box appears.
The program now starts to recalculate all the maps that were used to make the final
map Landval_final . In fact it will do the previous exercise for you again. First the
map Landvalue is recalculated, in which the column Landvalue from the table
Landuse was used (the one that you just updated). Then the maps Landvalue1 ,
and Landvalue2 are recalculated. These are combined in the map
Landval_combined , after which the undefined values are removed and the final
map Landval_final is made. The entire recalculation may take a minute. You will
see the progress bars of the various calculations. When the progress bars disappear,
the calculation is finished.
333
Move with the mouse pointer over map Landval_final . On the Status
bar you see again the characters D, C and U.
Open raster map Landval_final and click the location of one of the lakes.
As you can see the map Landval_final is now updated.
Close raster map Landval_final .
334
Type the following formula on the Command line of the Main window:
Slide = IFF((Geom=AL)OR(Geom=OL) , Geom , ?)
Note that in the Raster Map Definition dialog box, the default domain for the
output map is Geomorphology . This is correct.
335
Accept the defaults by clicking the Show button in the Raster Map
Definition dialog box.
In an expression, you can use different maps with different domains. Suppose you want
to find out the geological unit of the landslides that are between 3500 and 4000 meters.
You can use the history of the Command line to adapt the previously used formula.
Type the following formula on the Command line of the Main window:
Slide1 = IFF (((Geom=AL)OR(Geom=OL))AND INRANGE(Dem ,
3500 , 4000) , Geology , ?)
In the condition part of this formula, we first evaluate whether the geomorphologic
unit is either an active or an old landslide, and secondly whether the altitude is
between 3500 and 4000 meters.
The special function in the expression INRANGE(Dem , 3500 , 4000) checks whether
the values in the map Dem are between 3500 and 4000 meters.
Furthermore, the part dealing with the geomorphologic units is put between brackets,
because otherwise the statement would be very different: If a pixel in the
geomorphologic class is Active landslide or, on the other hand, if it is an
Old landslide located between 3500 and 4000 meters.
Display the map Slide1 , check its contents and close it.
336
Type the following formula on the Command line of the Main window:
Slide2 = IFF((Geom=AL)OR(Geom=OL) , Geom , No landslide)
The Raster Map Definition dialog box indicates the default domain
Geomorphology .
Click Show.
If you answer No, the name No landslide will not be added as a class to the
domain Geomorphology . Since the name No landslide is not in the
Geomorphology domain, the program will treat the pixels that should obtain the
name No landslide as undefined pixels, and the map will be exactly the same
as the one you previously made.
If you answer Yes, the name No landslide is added to domain
Geomorphology .
A formula may also have the form IFF (expression, name, domain1). For example,
if we want to make a map where Old landslide and Active landslide
are changed to Landslide , and for the rest of the map the geomorphologic units
are shown.
Type the following formula on the Command line of the Main window:
Slide3 = IFF ((Geom=AL)OR(Geom=OL) , Landslide , Geom)
The Raster Map Definition dialog box indicates the default domain
Geomorphology .
Click Show.
Answer the question: Add string Landslide to domain
Geomorphology with Yes.
Inspect the results in map Slide3 . You can change the color of unit
Landslide by double-clicking the Landslide item in the legend (Layer
Management pane).
337
Type the following formula on the Command line of the Main window:
Slide4 = IFF ((Geom=AL)OR(Geom=OL)OR (Geom=HE) ,
Geom , Landuse)
The Raster Map Definition dialog box indicates the default domain
Landuse .
Click the Create button. The Create Domain dialog box is opened.
Close the Domain Class editor. Now you are back in the Raster Map
Definition dialog box. You will see that the domain is now Slide4 .
Click Show.
Now the two domains Geomorphology and Landuse are merged into a new
domain Slide4 . This is much better than adding the contents of one domain to the
other, since the domains of the original maps remain unchanged.
IFF (expression, name, name)
In this last example, we will look at a formula where both the then and else parts
contain new names. In this situation, ILWIS does not know the output domain, and
will not provide you with a default domain in the Raster Map Definition dialog box.
To continue with our example on landslides: You will now make a map with only two
units: Landslides or No landslides .
338
Type the following formula on the Command line of the Main window:
Slide5 = IFF((Geom=AL)OR(Geom=OL) , Landslides , No
landslides)
In the Raster Map Definition dialog click the Create Domain button. The
Create Domain dialog box appears.
Type Slide5 for the Domain Name. Make sure the option Class is selected
and click OK. The Domain Class editor is opened.
Press the Add Item button on the toolbar. The Add Domain Item dialog box
is opened.
You could have created a new domain beforehand as well. Note that you can also use
a Bool domain (containing the possibilities True , False and undefined ? )
or a Yesno domain for the output map. This domain uses Yes and No instead
of True and False . In that case the formula would be:
Slide6 = (Geom=AL)OR(Geom=OL)
Select domain Yesno in the Raster Map Definition dialog box.
Summary: Map Calculation formulas resulting in Class or ID maps
- When the result of an IFF statement is not a value, you can have 4 possibilities:
1. IFF (expression, domain1, ?)
2. IFF (expression, domain1, name)
3. IFF (expression, domain1, domain2)
4. IFF (expression, name, name)
- For each of these combinations, you can choose to add classes or IDs to an existing
domain, to merge two domains, or to create a new domain.
- When two domains contain related information, one domain could be merged into
the other domain. When two domains contain information of different kinds, it is
better to generate a new domain.
339
Figure 8.5:
Example of a cross operation. The maps Landuse and Geology are combined. A
cross table and a cross map are made.
340
Display the maps Landuse and Slope_classes and check the meaning of
the units. Close the map windows.
It contains quantitative information on the combinations of the two input maps. You
can increase the display width of the domain of the table by dragging the first column
header separator to the right.
Display the output cross map Landuse_slope and check the meaning of
the units by clicking them. As you can see the name consists of the names of
the maps Landuse and Slope_classes .
In the table all combinations of the land use and slope classes are shown, together
with the number of pixels and the area. Now you will use this cross table to calculate
the percentages of the three slope classes occurring within each land use type. Firstly
you will calculate three columns, Flat , Moderate and Steep , in which only the
records that are actually a combination of flat, moderate or steep slopes will have a
value for the area, and not the others.
Then you apply Aggregation functions combined with table joining as you have seen
in Chapter 5. The aggregation function sums the values of column Area , grouped by
the Landuse classes, and stores the result in the column Totalarea of table
Landuse .
341
Type the following formula on the Command line of the table window:
Flat = IFF(Slope_classes=Flat , Area , 0)
Select the Column: Area , select the Function: Sum , select the check box
Group by and select the column Landuse , select the Output Table check
box and type the table name: Landuse . Type for the Output Column:
Totalarea .
Click OK in the Aggregate Column dialog box. Column Totalarea , containing area sums per landuse class will be added to table Landuse .
From the Columns menu in the table window select Aggregation. The
Aggregate Column dialog box is opened.
Select the Column: Flat , select the Function: Sum , select the check box
Group by and select the column Landuse , select the Output Table check
box, and type the table name: Landuse . Type for the Output Column:
Flat .
Press the Arrow Up-key and edit the previous formula, so that it is:
Moderate = IFF(Slope_classes=Moderate , Area , 0)
Press the Arrow Up-key and edit the previous formula, so that it is:
Steep = IFF(Slope_classes=Steep , Area , 0)
From the Columns menu in the table window select Aggregation. The
Aggregate Column dialog box is opened.
Repeat this for the columns Moderate and Steep , so that the Landuse
table will contain the columns Totalarea , Flat , Moderate and Steep .
Open the table Landuse . As you can see it contains the columns
Totalarea , Flat , Moderate and Steep that you just generated.
Now you will calculate the percentage landuse found on flat, moderate and steep slopes.
Type the following formula on the Command line of the table window:
Pflat = 100*(Flat/Totalarea)
342
Select the Domain Perc (percent) and enter for the Precision 1.0 . Click OK.
Create also the columns Pmoderate and Psteep with similar formulas.
Select Domain Perc for these columns and use a Precision of 1.0 .
Evaluate whether the results make sense and close the table Landuse when
done.
Open the Operations menu in the Main window, select Raster Operations,
and choose the Cross command.
You can inspect the Properties of the table to find out the number of records in the
cross-table.
The result is a large cross-table which contains the combinations of the catchment
names and the number of pixels with a certain drainage length per pixel. The total
area of each catchment, as well as the total drainage length per catchment is needed.
The first thing to do is to calculate for each catchment the total length. The map
drainage shows the length for each pixel. So if you multiply this value by the number
of pixels, you know for each length interval what the total length is.
343
Type the following formula on the Command line of the table window, containing the table Catchment_drainage :
Length = Drainage * npix
The Column Properties dialog box appears. Accept the defaults and click
OK.
From the Columns menu in the table window select Aggregation. The
Aggregate Column dialog box is opened.
Select the Column: Length , select the Function: Sum , select the check box
Group by and select the column Catchment , select the Output Table
check box, and type the table name: Catchment . Type for the Output
Column: Totallength .
With this aggregation formula, the total length of the drainage lines within each
catchment is calculated and stored in the table Catchment . You can open table
Catchment to check this; then close the table. Now you also need to know the total
area of each catchment. The output column Totalarea is calculated by using the
Sum aggregation function on the column Area grouped by the catchments (column
Catchment ).
From the Columns menu in the table window select Aggregation. The
Aggregate Column dialog box is opened.
Select the Column: Area , select the Function: Sum , select the check box
Group by and select the column Catchment , select the Output Table
check box, and type the table name: Catchment . Type for the Output
Column: Totalarea .
Now that you know the total length of drainage lines in each catchment and the total
area of each catchment, you can calculate the drainage density for each catchment.
Type the following formula on the Command line of the table window:
Drainagedensity = 1000*Totallength/Totalarea
The drainage density is expressed in kilometers per square kilometers. Since the
original data is in meters and square meters, we need to multiply with 1000. Now you
see the final result: the drainage density per catchment.
344
345
Figure 8.6:
Example of the use of a two-dimensional table, used to combine two input maps.
The user can determine for each combination of classes in the input maps, what
will be the result in the output map. In this example Forest and Alluvial, and Grass
and Bedrock result in Suitable.
The number of combinations in two maps should be fairly limited, since you have to
manually enter the resulting class, ID or value for each specific combination of input
classes and/or IDs.
Therefore, the selection of a value map as input for a two-dimensional table is not
possible: It will result in too many combinations. Also, for large ID maps this method
will not be very suitable. Take for example the map Cityblock , with 717
346
identifiers. If we would use it in combination with the Landuse map (which has 12
classes) you would have to fill in 717*12 = 8604 different combinations. This method
is thus mostly used for combining class maps with relatively few classes.
In this exercise, we will evaluate which areas are suitable for the extraction of gravel
material, which is used for building purposes (road-construction or for the production
of concrete for buildings). We do this by combining two maps: Geology (containing
information on the geological units) and Landuse (with the land use types). For each
combination of a geological and a land use unit, we will indicate whether it is suitable
or unsuitable for gravel extraction.
In the Catalog, click with the right mouse button on domain Geology .
Select the command Create 2-Dimensional Table from the context-sensitive
menu. The Create 2-Dimensional Table dialog box is opened.
Enter for the Table Name: Gravel . Type for the Description:
Suitability for gravel extraction . Select the Secondary Domain:
Landuse . The Primary Domain: Geology is already indicated.
Click the Create button next to the drop-down list box of the domain. The
Create Domain dialog box is opened.
Type for the Domain Name: Gravel . Select Type Class . Type the
Description: Suitability for gravel extraction and click OK. The
Domain Class editor is opened.
Press the Insert-key, and enter for the Name: Suitable , and the Code: S.
Click OK.
Press the Insert-key, and enter for the Name: Unsuitable , and the Code:
U. Click OK.
Close the Domain Class editor. You are now back in the Create 2Dimensional Table dialog box. Click OK.
Now the two-dimensional table Gravel is opened. The records show the units of the
geological map, and the columns of the units of the land use map.
The suitability classes for each combination of the geological and the land use units
are shown in Table 8.5. Only the geological units Glacial deposits , Old
alluvial deposits and Recent alluvial deposits can be used for the
extraction of gravel material, but only in combination with the land use units Bare
soil , Grassland , Riverbed and Shrubs .
347
Table 8.5:
Gl
Ld
Oa
Qu
Ra
Sh
Si
Sd
Ag
Ai
Ap
Br
Bs
Fo
Gr
La
Ri
Sh
Uc
Up
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
S
U
S
U
S
U
U
U
U
U
S
U
S
U
S
U
U
U
U
U
S
U
S
U
S
S
U
S
U
S
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
U
In the Edit selected field(s) dialog box select the class Unsuitable .
Click the right mouse button in the selection, and choose Edit from the context-sensitive menu. The Edit selected field(s) dialog box appears.
Subsequently, edit all the fields in the columns Forest , Lake , Urban centre and Urban periphery to Unsuitable .
Edit the fields of column Bare soils one by one. Then select all fields of
column Bare soils and use the Copy and Paste (on the context-sensitive
menu) to paste the values into columns Grassland , Riverbed and
Shrubs .
Where:
two-dim_tablename is the name of the two-dimensional table
map1
corresponds with the records in the 2D table
map2
corresponds with the columns in the 2D table
348
Make sure that you use square brackets [ ]instead of curly brackets ( )
Type the following formula on the Command line of the Main window:
Gravel = Gravel[Geology , Landuse]
349
CHAPTER 9
Figure 9.1:
The calculation window starts with the first pixel on the first row of the map. The
result of the calculation is stored in the central pixel. Then the calculation window
moves to the second pixel in the first line, and the calculation is repeated. In this way
the calculation window moves over the entire map.
For some of the calculations, an iterative procedure is required, in which the
calculation window, after finishing the calculation at the last pixel in the last line, will
start a reverse operation, using the data of the previous run as input. The calculation
will be repeated several times until no more changes occur in the map or a predefined
number of iterations.
351
352
9.1 Filtering
In chapter 6, the filter operation has been discussed for the use on satellite images.
Filtering is a process in which each pixel value in a raster map is replaced with a new
value, provided that a condition or a set of conditions is satisfied. The new value is
obtained by applying a certain function to each input pixel and its neighbours. There
are many types of filters available in ILWIS. Some of these are especially designed
for the use on thematic or value maps, some are especially for satellite images, and
some may be used for both.
The following filters are useful to apply on maps:
- Filters used on Digital Elevation Models. With the help of the filters working
on DEMs, you can calculate slope steepness, slope direction, slope convexity/concavity and hillshading. These filters will be treated in the next chapter, which is
completely dedicated to the generation and use of DEMs;
- Majority filters. These filters allow you to calculate for each pixel the predominant (most frequently occurring) value or class name, of each input pixel and its 8
neighbours (when using a 3x3 filter);
- Smoothing filters. This filter is used on value maps and will calculate for each
pixel the average value of the central pixel and its 8 neighbours (when using a 3x3
filter);
- Rank order filters. This filter is used on value maps and can be used to calculate
the median value or any other rank of the central pixel and its 8 neighbours (when
using a 3x3 filter);
- Binary filters. Binary filters regard the input map as a binary map. This means
that zero values are regarded as zero, and all other values as one. Depending on the
central pixel value and its 8 neighbours, the filter produces a zero or one as output
value. These filters are used in what is called mathematical morphology. You can
use them for dilation (the growing of true pixels in a certain direction) and erosion (the shrinking of true pixels in a certain direction);
- Counting filters. Counting filters are used to count the number of pixels within a
certain search radius around each central pixel. They can be used to count the number of point features, such as houses, wells or landslides.
You can also define filters of other sizes. In the following sections examples will be
given of the use of these different filters.
Majority filters
These filters allow you to calculate for each pixel the predominant (most frequently
occurring) value or class name, of each input pixel and its neighbours. You can use
this filter to reduce a large variation in classes or values for neighbouring pixels.
A simple example will be used in this exercise: a small suitability map. It has 41 rows
and 54 column so that you can clearly see the effect of the filter on the map. The map
Suitability is a value map, and contains the values 1 to 6 for showing the
suitability of an area for growing maize. The area that has not been rated is undefined.
ILWIS 3.0 Users Guide
353
Now we will apply a majority filter. The standard majority filter MAJORITY is a 3x3
filter. As output value for each central pixel, the filter selects the predominant (most
frequently occurring) value or class name, of each input pixel and its 8 neighbours. If
all 9 pixels have a different value or class, the first value or class name encountered is
used as output.
Click the map Suitability with the right mouse and select Image
Processing, and the command Filter from the context-sensitive menu. The
Filtering dialog box is opened.
Select the Filter Type: Majority , and the Filter Name: Majority .
Compare the maps Suitability1 and Suitability and close the two
map windows afterwards.
Type for the Output Raster Map name: Suitability1 and click the
Show button.
The result of the majority filter is that single undefined pixels that were within the
different areas are now filled up, and the linear features of 1 pixel wide have
disappeared.
There is also a majority filter that is used only on undefined values. The undefmajority filter (MAJUNDEF) is a 3x3 filter that selects the predominant value or class
name if the central pixel is undefined. If the central pixel is defined, the value or
class name will not be changed.
Now filter the map Suitability with the majority filter Majundef , and
create output map Suitability2 .
Display all three maps (Suitability , Suitability1 , and
Suitability2 ) next to each other and compare them.
The result of the undefined majority filter, is that single undefined pixels disappear
and the mapping units expand into the undefined areas.
Similarly to the undefined majority filter, there is a zero majority filter (MAJZERO),
which only selects the predominant value or class name if the central pixel has value
zero. If the central pixel is not zero, the value or class name remains the same.
354
Smoothing filters
These filters calculate for each pixel the average value of the central pixel and its 8
neighbours (if using a 3x3 filter). To see the effect of smoothing filters, we will
change the undefined values of the map Suitability into zero values first, before
running the filter AVG3X3 . This filter calculates the average value of each 9 pixel
values considered (3x3 matrix).
Click Show in the Raster Map Definition dialog box, and select the
Pseudo Representation in the Display Options dialog box. Check
whether the undefined values are now zero.
You can clearly see that the sharp edges of the filtered map Suitability3 are
blurred now. Whereas the unfiltered map Suitability_null contains the integer
values from 0 to 6, the filtered map has intermediate values. The smoothing will even
be larger when we use a larger filter size (say 5x5).
Filter map Suitability_null with the Average Filter Type, now with 5
Rows and 5 Columns.
355
Filter map Suitability_null with the Filter Type Rank Order and
Filter Name Med3x3 . Create Output Raster Map Suitability5 . Do not
change the Precision since that will have no effect with a median filter.
The result of this filter is rather similar to the output of the majority filter. The effect
can be better seen when we filter a map with more diverse values, such as the Slope
map.
Filter map Slope with the Rank Order Filter Type and the Filter Name
Med5x5 . Create Output Raster Map Slope_filter . Do not change the
Precision.
Display map Slope_filter next to map Slope (both with the Pseudo
Representation) and compare them. Click the pixels in both maps to find
out their values.
Binary filters
Binary filters regard the input map as a binary map. This means that zero and
undefined values are regarded as zero and all other values as one. Depending on the
central pixel value and its 8 neighbours, the filter produces either value zero or value
one as output values. These filters are used in what is called mathematical
morphology. You can use them for dilation (the growing of true pixels in a certain
direction) and erosion (the shrinking of true pixels in a certain direction). Let us try
some of these filters, using the map Suitability_null . First we will use the
Dilate8 filter, which will make the suitable areas grow in size.
356
Filter map Suitability_null with the Binary Filter Type, and the
Filter Name Dilate8 . Create Output Raster Map Suitability6 . Note
that the Domain of the Output Raster Map is Bool .
Filter map Suitability_null with the Binary Filter Type and the
Filter Name Shrink8 . Create Output Raster Map Suitability7 . Note
that the Domain of the Output Raster Map is Bool .
Next, we will use some filters that extract boundaries of units in a map. For example,
the filter Inbnd8 assigns a 1 when the central pixel is 1 and at least one of the 8
neighbours is 0 (meaning it is located at the edge of a group of true pixels). The
result of using this filter is that areas of 8-connected true pixels are replaced by their
8-connected outline (an 8-connected boundary of true pixels).
Filter map Suitability_null with the Binary Filter Type and the
Filter Name Inbnd8 . Create Output Raster Map Suitability8 . Note
that the Domain of the Output Raster Map is Bool .
Display map Suitability8 next to map Suitability_null and compare them. Click the pixels in both maps to find out their values.
The reverse of the Inbnd8 filter is the Outbnd8 filter, which extracts the outer
boundary of areas of 8-connected pixels (3x3 matrix). So instead of extracting the
boundary of the true pixels (pixels with a value larger than 0) it will extract the
boundary of the false pixels (pixels with a value 0).
Filter map Suitability_null with the Binary Filter Type, and the
Filter Name Outbnd8 . Create Output Raster Map Suitability9 . Note
that the Domain of the Output Raster Map is Bool .
Display map Suitability9 next to map Suitability_null and compare them. Click the pixels in both maps to find out their values.
357
Click with the right mouse button on segment map Drainage and select
Rasterize, Segment to Raster from the context-sensitive menu. The
Rasterize Segment Map dialog box is opened.
Filter the map Drainage with the Binary Filter Type and the Filter Name
Conn8to4 . Create Output Raster Map Drain4connected . Note that the
Domain of the Output Raster Map is Bool .
Zoom in on a part of the map containing drainage lines to see that the lines
are sometimes 8-connected. The undefined pixels neighbouring these
drainage lines are thus also 8-connected.
Zoom in on a small section of both maps with the same drainage lines and
compare them. You can see that all drainage lines are now 4-connected. In a
distance calculation they can now act as a closed barrier.
358
rows
-10 -9
-1
10
-10
-9
-8
-7
-6
-5
-4
-3
-2
-1
10
Figure 9.2:
-8
-7
-6
-5
-4
-3
-2
You will first have to create the binary map with the landslides, using the information
from the geomorphologic map Geomorphology .
Type the following formula on the Command line of the Main window:
Landslide = IFF(Geomorphology = AL, 1, 0)
The Raster Map Definition dialog box is opened. Click the Show button
and click OK in the Display Options Raster Map dialog box. The map is
now displayed.
The gain is the value with which the result of the filter will be multiplied. When a
linear filter is placed over the raster map, the filter will multiply all the values of the
filter with the corresponding pixel values in the same position in the map. In our case
this will result either in a 0 or in a 1. Then all the results of the individual filter cells
are summed up and multiplied by the gain. For a counting filter the gain should be 1,
since we want to know how many pixels there are with landslides, within the
specified search radius of 10 pixels around every pixel. The resulting value will be
ILWIS 3.0 Users Guide
359
Click the map Landslide with the right mouse button and select Image
Processing, and the command Filter. The Filtering dialog box is opened.
In the Filtering dialog box select Filter Type Linear and Filter Name
Counting and type the name of the Output Raster Map: Landslidenr .
Note that the value domain is automatically set with the maximum value
being the total number of 1 values in your filter.
Click Show in the Filtering dialog box. The map Landslidenr is now calculated and the Display Options dialog box is opened
360
Figure 9.3:
The 3x3 neighbourhood matrix with the identifiers for the positions of the neighhour
pixels (1, 2, 3, 4, 6, 7, 8, 9) with respect to a central pixel (5).
Type the following formula on the Command line of the Main window
(note the square brackets!):
Dem_uppervalue = Dem Dem#[2]
Click Show in the Raster Map Definition dialog box. The map is calculated.
By this calculation, for every pixel, the value of a pixel from map Dem will be
retrieved (first part of expression), and simultaneously, a neighbourhood matrix will
be moved over map Dem (second part of expression), which will retrieve the value of
the neighbour on position [2]. These two values will then be subtracted from one
another. Refer to Figure 9.3 for the positions of neighbours. So, in this calculation the
value of a pixel in the first input map is subtracted by the value of the pixel on
position [2] (upper center) as found by the matrix which moves over the second map.
The Display Options Raster Map dialog box is opened. Click OK.
Check the result and close the map window.
In the next example you will calculate the altitude difference of a map in the X and Y
direction. The Dx (difference in X direction) and Dy (difference in Y direction) maps
are the output maps using a Digital Elevation Model (Dem ) as input map.
Type the following formula on the Command line of the Main window:
Dx = Dem#[4] - Dem#[6]
This formula means: Subtract the value of the pixel on the [6] position (the right
neighbour of the central pixel) from the value of the pixel on the [4] position (the left
neighbour of the central pixel). The result will be assigned to the central pixel in map
Dx .
362
Press Show in the Raster Map Definition dialog box. The map is calculated
and the Display Options dialog box is opened. Select Representation
Pseudo and click OK.
Check the result with the pixel information window (using the map Dem and
the map Dx ).
where:
is the name of the output map.
is a neighbourhood function to be used on the values as found by a
neighbourhood matrix. Some available functions are: NBMIN ,
NBMAX , NBAVG , NBSUM , NBPRD , NBSTD , NBMINP , NBMAXP ,
NBPRDP , and NBCNT . For more information, see Table 9.1.
[neighbour, neighbour, ]
if the neighbourhood function is followed by a list of neighbours
[neighbour, neighbour, ], then the neighbourhood function will
only work on the values of these selected neighbours.
As in section 9.2.1, neighbour is a number between 1 and 9 which
indicates the position of a certain pixel in the neighbourhood matrix
(refer to Figure 9.3).
(NbExpression) is a neighbourhood expression: a neighbourhood expression is any
expression which contains the name(s) of the input map(s) and
which contains at least one neighbour operator #.
OutMap
NbFunction
363
NBMIN
NBMAX
NBAVG
NBSUM
NBPRD
NBSTD
NBCNT
Counts the number of values as found by a neighbourhood matrix which are not
undefined nor false.
NBDIS
Returns the distance between the central pixel and its neighbouring ones.
NBPOS
NBMINP
NBMAXP
NBPRDP
NBCNDP
Tests for which of the neighbouring pixels a certain condition is true; when none
of the neighbours satisfies the specified condition the outcome value is 0.
NBFLT (filter) Applies a linear filter on the values found by a neighbourhood matrix.
OUT = NBMINP(Map1#)
364
NbFunction
NbExpression
NBFLT
FltName
Apply the edge enhancement filter on input map Map1 and sum the
values of each neighbourhood matrix (same as using the edge
enhancement filter in the Filter operation).
Calculating a classified slope direction map
In chapter 10 a method is presented to calculate a slope direction map. A simple
classified slope direction map (aspect map) can also be made using the
neighbourhood function NBMINP and a DEM. This function returns the position of
the neighbour with the lowest value. Because we want all the neighbours to be
checked for the lowest value, we use the operator #.
Type the following formula on the Command line of the Main window:
Aspect = NBMINP(Dem#)
If more pixels have the same minimum value, then the precedence of the pixels is
determined by the pixel identifier value (see Figure 9.3): 5, 1, 2, 3, 4, 6, 7, 8, 9. The
position of the first pixel with the lowest value in this precedence will be assigned to
the pixel of the output map.
The result of the calculation is a raster map with values ranging from 1 to 9 (the
position identifiers, see Figure 9.3).
For example, if the neighbour with the lowest value is the lower left (southwest) pixel,
the result of the calculation is 7; if the lowest neighbour is the left (west) pixel, the
result is 4, etc. The different directions are listed in Table 9.2.
365
Northwest
North
Northeast
West
Flat
East
Southwest
South
Southeast
Relation between the values of the output map and the direction.
Value
1
2
3
4
5
6
7
8
9
Press Show in the Raster Map Definition dialog box. The map is calculated. The Display Options dialog box is opened. Select Representation
Pseudo and click OK.
Type the following formula on the Command line of the Main window:
Flow_direction = 10 - NBMINP(Dem#)
The result of this calculation is a raster map with values ranging from 1 to 9,
indicating from which neighbour the cell receives the liquid. A 1 indicates for
example the cell in the Northwest direction. The result can be used in other
calculations that predict spreading phenomena (such as the spreading of a pollutant, a
landslide, or in runoff modeling). The direction matrix value can be compared with
the position identification value, in any 3x3 neighbourhood of which the cell is part.
If the pixel value in the direction matrix equals its position number in any 3x3
neighbourhood, then water (or other feature) will flow from this pixel towards the
center of this window for which the statement is true.
366
Press Show in the Raster Map Definition dialog box. The map is calculated and the Display Options dialog box is opened. Select the
Representation Pseudo and click OK.
Type the following formula on the Command line of the Main window:
Flat = NBCNT(Dem# = Dem) = 9
Press Show in the Raster Map Definition dialog box. The map is calculated
and the Display Options dialog box is opened. Click OK.
A so-called pit is a pixel that has a value lower than all of its surrounding pixels. We
will check the map Dem for the presence of pits, using the following expression:
NBMINP(Dem#)= 5. In other words, if the central pixel has the lowest value in the
matrix, that central pixel will be assigned True (1), or else False (0). This results in a
map with domain Bool .
Type the following formula on the Command line of the Main window:
Pit = NBMINP(Dem#) = 5
Press Show in the Raster Map Definition dialog box. Make sure the map
has a Bool domain. The map is calculated and the Display Options dialog
box is opened. Click OK.
This calculation identifies pits in the Dem of one pixel. These pits can now be
removed by editing the raster map manually or by using some further calculation.
367
Iteration functions.
As you can see, the raster map Damsite contains the location of the dam, indicated
with the word Damsite . The rest of the map has undefined values.
368
Type the following formula on the Command line of the Main window:
Dem_with_damsite = IFUNDEF(Damsite, Dem, 3300)
Press Show in the Raster Map Definition dialog box. The map is calculated
and the Display Options dialog box is opened. Select the Representation
Pseudo and click OK.
You will see that the dam site now has the elevation 3300 meters. Check this
by clicking some pixels of the dam. By overlaying the polygon map
Damsite it is easier to find the position of the dam.
To determine the area that will be flooded, we need to create a map indicating one
pixel in the future reservoir area. Using neighbourhood calculations this pixel acts as
the starting point for the calculation. You will use the pixel editor to create the new
raster map.
From the File menu in the map window, select Create, Raster Map. The
Create Raster Map dialog box is opened.
The Pixel editor is opened; on the Status bar a message appears: Please
zoom in to edit. Zoom in on the dam site until you see the individual pixels.
Select a pixel just upstream of the dam site, press the right mouse button and
select Edit from the context-sensitive menu. Type the value 1, and press Enter.
Press the Exit Editor button. Now you have a raster map Start with 1 pixel
that has the value 1. All other pixels are undefined.
Now you can perform the actual calculation of the flooded area. Iteration with
propagation is used until there are no changes anymore in any of the pixel values.
You can perform iterations by including the iteration statement in a Map Calculation
formula. You can also use the dialog box of the Iteration operation. Since the top of
the dam has an elevation of 3300 meter and the freeboard of the dam is 20 meter, the
actual water level upstream the dam has an elevation of 3280 meter.
369
This means: if the altitude in the new Digital Elevation Model is more than 3280
meter, then return the pixel values of raster map Start (which are undefined).
Otherwise, assign the maximum value of the neighbouring pixels found in raster map
Start (which is a value of 1). In the first iteration there is only one pixel that has
value 1 (the starting pixel). In every iteration, the neighbouring pixels that satisfy the
conditions (altitude < 3280 meter) will get the same value as that starting pixel. This
will continue until the next neighbouring pixels have an altitude of more than 3280
m. In all areas lower than 3280 meter other than upstream the dam site, there is no
start pixel defined. Therefore the neighbours will always be undefined and therefore
the areas will also stay undefined.
Accept the default value for the Stop Criterium: Until No changes . This
means that the iteration continues until no changes occur anymore.
Make sure that the option Propagation is selected, so that the new pixel
value is immediately used in the calculation of the next line.
The calculation may take a minute. The program will calculate in a downward,
upward, left and right direction. When no changes occur after a full iteration, the final
map is generated, and the Display Options dialog box is displayed.
Use the pixel information window and add the maps Dem_with_damsite ,
Start and Flooded . Check the results.
The output map Flooded can now be used to calculate the volume of the water in
the reservoir.
370
Cross the raster map Flooded with the raster map Dem_with_damsite .
Name the Output Table Volume and click Show.
In the Column Properties dialog box accept the defaults and click OK.
Calculate the volume of the area with the formula:
Volume = Difference * Area
In the Column Properties dialog box accept the defaults and click OK.
The concept of map iterations is very powerful. It allows you to create your own
models for different types of applications. For more examples of neighbourhood
calculations, consult the ILWIS Applications Guide and the topic How to calculate
(advanced) in the ILWIS Help.
Summary: Neighbourhood functions
- Neighbourhood calculations are a special type of spatial analysis in ILWIS. They
are calculations on pixels in which the outcome depends on the neighbouring pixels.
- Neighbourhood calculations may be performed on user-selected pixels as well as on
whole maps.
- Just as in filtering procedures, neighbourhood calculations make use of a matrix.
This imaginative window of 3x3 cells is moved over the raster map. Each cell of
the output map is calculated according to the specified neighbourhood expression.
- Neighbourhood calculations can make use of neighbourhood functions.
- Iterations are a special type of calculation. They are a successive repetition of a
mathematical operation, using the result of one calculation as input for the next.
- In iterations, the calculation stops when the difference of the output compared to
the input is negligible, or if the number of iterations as defined before is reached.
- Iterations are always used in combination with neighbourhood calculations. Such
an application might be for instance the selection of an item or area that fits a certain condition, starting from one pixel (for example the calculation of a flooded
area, or the spreading of a pollutant).
371
Figure 9.4:
A source map for distance calculation can be any raster map with domain type class,
ID or value. This map should contain pixels with class names, IDs or values and
pixels with undefined values. All pixels with a class name, ID, or value in a source
map, are considered as source pixels and distance values will be calculated for all
pixels that are undefined. The distance filter will first calculate the distance in
number of pixels. The distance from a source pixel to its horizontal or vertical
neighbours is 1, and the distance from a source pixel to its diagonal neighbours is the
square root of 2. The filter will move first from the first pixel on the top line to the
last pixel of the last line. Then, it will do the same operation in the reverse direction.
Once the distance, in number of pixels, to the nearest source pixel is known, the final
distance in meters is obtained by multiplying this with the pixel size.
If not all parts in the source map are equally accessible, a so-called weight map can
be used. A weight map contains pixels with values (weight factors) referring to the
degree of accessibility and inaccessibility. In a weight map, accessible pixels are
assigned positive values. A higher positive weight value for accessible pixels means
that the area covered by these pixels (swamps, forest, bad roads, etc.) are more
difficult to cross than other areas. Inaccessibility can be introduced in the weight map
by negative weight factors. Pixels with a negative value (river, dens forest or
372
The program will calculate first in a forward direction (starting from first pixel in the
first line to the last pixel in the last line), after which it calculates in the backward
direction. After a while the Display Options Raster Map dialog box is displayed.
The distance map is displayed on the screen. This map is a value map, in which the
pixel values refer to the distance of this pixel towards the nearest source pixels. You
ILWIS 3.0 Users Guide
373
One of the input maps required for this operation, is a source map in which only the
central plaza has a value and the rest of the map has undefined values. The central
plaza has the ID 018 (you can check that if you like).
374
Type the following formula at the Command line in the ILWIS Main window:
City_source = IFF(Cityblock = 018, Cityblock, ?)
The second input map required for this operation, is a weight map where all the
pixels, except the source pixels, are assigned weight factors to simulate the difficulty
of crossing pixels, which form barriers such as building blocks, the river, the lake,
mountain ridges, etc. In this exercise the roads are assigned a value 1, the recreational
areas a value 4 and the rest of the city blocks will receive the value -1 (negative
weights make the pixels inaccessible). Note that the weight factors are inversely
proportional to the speed. In this exercise the maximum speed (20 km/h) is set to
weight factor 1 (along the streets) and to obtain the minimum speed of 5 km/h in the
recreational areas we use a weight factor 4.
Type the following formula at the Command line of the ILWIS Main window:
City_weight = IFUNDEF(Cityblock, 1, IFF
(Cityblock.Landuse = Recreational, 4, -1))
In this formula, first the roads (which have undefined values) are assigned a value 1.
Then, if the land use type (in the column Landuse of the table Cityblock ) is
Recreational , the resulting value is 4. All other pixels (the other city blocks)
will get a value -1 . Note that these type of calculations only work when the attribute
table of a map is connected to that map, i.e. that in the property form of the map the
option Attribute Table is switched on and the correct table is selected in the list
box.
Third step: Calculating distances
Expand the Raster Operations item in the Operation-tree and click the
Distance Calculation operation.
Click the check box Weight Map and select raster map City_weight .
Type City_distance in the text box Output Raster Map.
Accept the other defaults and click the Show button.
The distance calculation takes quite some time. The program calculates forward
(from left to right and from the first line to the last line) and backward (the reverse).
The tranquilizer shows the number of changes that are made, as well as the line that
is being calculated.
The calculation is done iterative until there are no more changes. When the
calculation is finished, the Display Options - Raster Map dialog box is displayed.
ILWIS 3.0 Users Guide
375
Select Representation Pseudo and click OK. The weighted distance map is
displayed on the screen.
Find out the distance from the airport to the city center.
Now that the weighted distances from each part in the map towards the central plaza
are known, we only need to convert the distance values (in meters) to time units
(minutes). The maximum speed in the city is assumed to be 20 km/h in the streets
and 5 km/h in the parks. To create the travel time map:
Check how much time it takes to travel from the airport to the center.
Close the map window when you are finished.
Click with the right mouse button on point map Rainfall and select
Rasterize and the Point to Raster command from the context-sensitive
menu. The Rasterize Point Map dialog box is opened.
Click OK in the Display Options - Raster Map dialog box. The map is
now displayed. Since each point is represented by one single pixel the map
appears to be empty. Only if you zoom in deeply on a point location, you can
see the rasterized points.
376
The Thiessen map shows the areas, which are nearest to each one of the rainfall
stations. We can also display the attribute data (rainfall values) instead of the rainfall
stations. We will first calculate the total rainfall per year for each of the stations.
The Thiessen map can be used to calculate the total rainfall per year for each
catchment of the map Catchment .
Calculate the annual rainfall per catchment. First use the Attribute Map of
Raster Map operation to generate a map Rain_total from the Thiessen
map Rain_area , and use column Rain_total from the attribute table
Rainfall .
377
Calculate the total rainfall per catchment in the cross table with the
Aggregation Function Sum in the table window.
When you have finished, close all the map and table windows that are open.
A Thiessen map can also be created, using the Nearest Point interpolation method
(see chapter 11).
Summary: Distance calculation
- The Distance operation calculates the distance (in meters) from user specified
source pixels to all other pixels in a raster map.
- All pixels with a class name, ID, or value in a source map, are considered as source
pixels and distance values will be calculated for all pixels that are undefined.
- A weight map contains pixels with values referring to the degree of accessibility.
Negative weights indicate inaccessibility, and positive values, higher than 1, indicate areas that can be crossed with more difficulty.
- The units in a distance map are meters. They can be converted with Map
Calculation formulas into time.
- A by-product of distance calculation is a Thiessen map, in which the service area
of source pixels, based on the shortest distance is indicated. Thiessen maps can also
be made from point maps using the Nearest Point interpolation.
378
Select class raster map Geomorphology in the list box Raster Map.
Type Geomorphology_numbered in the text box Output Raster Map.
Accept the defaults (note that you use the 8-connected option) and click the
Show button. The Display Options - Raster Map dialog box is opened.
379
Select the option Multiple Colors 31 and click OK. The map is displayed.
Check the meaning of the mapping units. Double-click a unit. The Edit
Attribute dialog box is opened, in which you can also read the geomorphologic class name.
Close the map window when you finished the exercise.
Figure 9.5:
Simple example of Area numbering. The pixels that are connected are assigned the
same code. Different results are obtained when only the horizontal and vertical
neighbours are considered (4-connected) or whether all neighbours are considered
(8-connected).
380
the same land use have the same class. However, we cannot work on mapping units.
We have to know the information for each individual polygon. In order to do so we
apply the operation Unique ID. This operation will transform a class map into a
unique identifier map, in which each polygon receives a single code.
381
Click OK in the Display Options - Polygon Map dialog box. The map is
now displayed.
Apart from the map LandID , a table with the same name is also generated in which
the land use type for each polygon is stored. The next thing we need to know is which
are the neighbouring polygons of each polygon. For this you can use the operation
Neighbour Polygons. This operation will calculate for each polygon in the map,
what its neighbours are, and what the length of their boundary lines is.
In the table open the Columns menu and select the Join command. The Join
Wizard appears.
Since the column PolName1 has the same domain as the table LandID , the joining
is fairly simple.
382
Now we know for each of the polygons IDs in column PolName1 what the land use
is. We also need to know the land use of their neighbouring polygons, listed in
column PolName2 .
Do the same Join operation, but now select the Key-Column: PolName2
and type the Output Column: Landuse2 .
Now that we know the land use type of each polygon and its neighbours, we can start
to evaluate which one of the forest polygons has no borders with agricultural or urban
polygons. We can do this with a calculation formula. There are four types of land use
which we want to exclude: Agriculture , Agriculture (irrigated) , Urban
center and Urban periphery . To simplify the formula, we already know that
none of the forested area is bordering the urban area. The formula would become
very large if we would have to type the full names. Fortunately we can use a shortcut.
If we use the function Left(column, length) in the following way:
- Left(Landuse2, 2) = Ag , this will incorporate both the land use types
Agriculture and Agriculture (irrigated) .
Locate the mouse pointer on the Command line of the table window and
type (case sensitive!) the following formula:
Good = (Landuse1 = Forest) and (left(Landuse2, 2) <>
Ag)
The column Good has a Bool domain. You know now all the polygons with the land
use type Forest , that are not bordered by agricultural or urban polygons. These
are classified as True in the Good column.
Open the Columns menu and select Sort. The Sort dialog box appears.
In the Sort dialog box select the Column Landuse1 accept the other
defaults and click OK.
Scroll down until you see the records with the land use type Forest in the
column Landuse1 .
383
Select the Table LandIDnb and select the Column Good . Click the Next
button.
Accept the default option Use Domain of current table and click the
Next button.
Open the Columns menu and select the Join command. The Join Wizard is
opened.
Now the table LandID contains the column Good , that indicates with True those
polygons that have forest, and have a neighbour polygon which is not agriculture nor
urban.
The calculation for the first requirement is finished. Now we still need to know
which of the forest polygons has an area larger than 200 hectare. We can obtain this
information from the polygon histogram.
Click with the right mouse button on the polygon map LandID and select
Statistics, Histogram from the context-sensitive menu. The Calculate
Histogram dialog box is opened.
Now that the area of the polygons is known, we can make the final evaluation.
384
Select the check box Attribute and select the Column: Finalgood .
Check the result by clicking on these polygons and close the map window
afterwards.
Double-click the polygon map LandID . The Display Options dialog box is
opened.
Click OK. The polygon map is displayed and you can see the suitable polygons displayed in green.
385
CHAPTER 10
387
In the Properties of a DEM raster map, you can switch on the Interpolation
check box. This will calculate height on the fly within pixels. This is extremely
important when using a georeference Direct Linear or a georeference
Orthophoto (see section 6.4.1.).
Digital Elevation Models have a very wide range of applications. They form one of
most frequently used spatial data sources in GIS projects. They are also the basis for
a large number of derivative information. The most important application areas of
DEMs are:
- Slope steepness maps, showing the steepness of slopes in degrees, percentages,
or radians for each location (pixel).
- Slope direction maps (also called slope aspect maps), showing the orientation
or compass direction of slopes (between 0-360).
- Slope convexity/concavity maps, showing the change of slope angles within a
short distance. From these maps you can see if slopes are straight, concave or
convex in form.
- Hill shading maps (or shadow maps), showing the terrain under an artificial
illumination, with bright sides and shadows. Hill shading is used to portray relief
difference and terrain morphology in hilly and mountainous areas. The gray tones
in a hill shading map represent the amount of reflected light, depending on the
relative orientation of a certain location towards the illumination source. The
illumination source is usually chosen at an angle of 45 above the horizon in the
northwest.
- Three dimensional views showing a birds eye view of the terrain from a user
defined position above the terrain.
- Cross-sections indicating the altitude of the terrain along a line and represented
in a graph (distance against altitude).
- Volume maps (or cut-and-fill maps), generated by overlaying two DEMs from
different periods. This allows you to quantify the changes in elevation that took
place as a result of slope flattening, road construction, landslides etc.
- Creation of Ortho-images from aerial photographs or satellite images. With the
help of DEMs, aerial photographs and satellite images can be corrected for tilt
distortion and relief displacement.
388
389
Figure 10.1: Two contour lines (H1 and H2) and the shortest distances (d1 and d2) towards an
390
Click with the right mouse button on segment map Contour and select
Contour Interpolation from the context-sensitive menu.
The Interpolate Contour Map dialog box is opened.
The calculation may take some time, depending on the computer configuration and
other programs that are working simultaneously. It is advised to close other programs
while performing contour interpolation: this will speed up the process considerably.
The Display Options - Raster Map dialog box will be opened after the operation is
finished.
The default representation which is indicated in the Display Options dialog box is
the same one as was used for the segment map Contour : the user-defined
Representation Height .
Click OK in the Display Options Raster Map dialog box. The map is displayed.
Click several places in the map and read the altitude values.
Double-click the map Dem in the Layer Management pane. The Display
Options Raster Map dialog box is reopened.
Select Representation Clrstp12 and click OK. The map is now displayed
with a Representation Clrstp12 .
Now we will show you that even within pixels an interpolation can take place.
391
From the File menu, choose Properties, and select the Interpolation check
box. Click Apply.
Check the height value within a pixel once more and close the map window
when finished.
Selecting the Interpolation check box is especially important when you want to use
the DEM in a georeference Direct Linear or a georeference Orthophoto. In regular
map calculations, however, still 1 value per pixel will be used.
If you wish you can create a new representation to make the Dem appear sliced. A
DEM can also be classified or sliced permanently through the operation Slicing.
Ranges of values of the input map are grouped together into one or more output
classes. The output map resulting from the Slicing operation is a map with the
domain type group. A domain group should be created beforehand or during the
operation using the Slicing dialog box. The domain group lists the upper boundaries
of the groups and the group names. A detailed description of the Slicing procedure
was given in the sections 6.6.2 and 7.5.
Use of additional point heights
The interpolation of contour lines will give wrong results for hilltops, which are
enclosed on all sides by a contour line. They will appear as flat areas with the same
altitude as the contour line surrounding it. To improve this, it is possible to combine the
segment map, containing the contour lines, with a point map, containing the altitudes of
the hilltops. Both maps should first be converted to raster and then combined into one
raster map. This raster map will serve as the basis for the interpolation.
When you zoom in on one of the crosses you will see that it is located within a
closed contour line on a hilltop. Of course the same procedure is valid for closed
depressions.
392
Now that both the point map and the segment map are rasterized, you can combine
them.
Type the following formula on the Command line of the Main window:
Combination = IFUNDEF(Spotheight,
ContourRasterized,Spotheight)
The Raster Map Definition dialog box is opened. Click Show to calculate
and display the Combination map. After the calculation the Display
Options - Raster Map dialog box appears.
In the MapCalc formula above, it was tested whether a pixel in the map
Spotheight is undefined. If that is so, the map Contour is used in the output
map. If not, then the values from the raster map Spotheight are taken.
With the Combination map you can do the actual interpolation. The interpolation
expression on the Command line will be used instead of the Contour Interpolation
dialog box, since the dialog box only accepts a segment map as input.
Type the following formula on the Command line of the Main window:
Dem1 = MapInterpolContour(Combination)
The Raster Map Definition dialog box appears. Click Show. The map
Dem1 is calculated; when the Display Options dialog box appears click OK.
The map is now displayed.
From the Layers menu, select Add Layer. The Add Data Layer dialog box
appears
In the Add Data Layer dialog box select point map Spotheight and click
OK. The Display Options - Point Map dialog box is opened.
393
Select Symbol: + Plus . Clear the check box Stretch. Accept all other
defaults and click OK. You are back in the Display Options - Point Map
dialog box.
Select the check box Text and click OK. The point map Spotheight is displayed on top of Dem1 .
From the File menu in the map window, select Open Pixel Information.
The pixel information window is opened.
Add map Dem via drag and drop to the pixel information window and check
the altitude values of the hilltops with the mouse.
The combination of contour lines with additional point heights is very important for
hilly areas, where a lot of isolated hills can occur. Normally the altitude of isolated
hilltops is indicated on topographical maps. If they are not available you will have to
make an educated guess, taking into account the value of the enclosing contour
line, the contour interval and the overall steepness of the terrain.
If you only have elevation data stored as points, the contour interpolation cannot be
used for generating a Digital Elevation Model. In that case you will have to use a
point interpolation operation, such as Moving Surface or Kriging. This will be
demonstrated in chapter 11.
Summary: Contour interpolation
The creation of a Digital Elevation Model from a segment map is done with the
Contour Interpolation operation. This operation works in two steps:
394
Filter type
Application
DFDX
DFDY
DFDUP
DFDDN
D2FDX2
D2FDY2
D2FDXDY
LAPLACE
SHADOW
Accept all other defaults and click Show. After the map has been calculated,
the Display Options - Raster Map dialog box will appear.
395
Figure 10.2: The filtering procedure, applying a horizontal gradient filter on a DEM. The direction
The simple horizontal gradient filter shown in Figure 10.2 is not an ILWIS standard
filter; it is just an understandable example. The standard gradient filters DFDX and
DFDY in ILWIS are a little more complicated and give a better estimation of the first
derivative. They are presented in Figure 10.3.
396
Figure 10.3: The vertical (DFDY) and horizontal (DFDX) gradient filters used in ILWIS.
To inspect the contents of standard filters, choose Customize Catalog from the
View menu in the Main window, and select the Include System Objects check
box. You can open the standard filters now by double-clicking them in the
Catalog.
Click OK in the Display Options - Raster Map dialog box. The map is
now displayed.
In the map window, open the pixel information window and add the map
Dem . Zoom in on the map until you can see individual pixels. Compare the
values of the map Dx for a certain pixel, with the difference of the altitude of
its left and right neighbours in the map Dem .
Repeat the procedure to create a gradient map in the y-direction, but select
the Filter Name DFDY and type Dy for the Output Raster Map name.
Close the map window and the pixel information window when you have finished the exercise.
397
Click raster map Dem with the right mouse button and select Image
Processing, Filter. The Filtering dialog box is opened.
Click OK in the Display Options - Raster Map dialog box. The map is
now displayed.
Check some of the pixel values and close the window afterwards.
The map shows many different values, showing the degree of concavity/convexity of
the slope. Negative values indicate convex slopes while positive values represent
concave slopes. Values close to zero represent straight slopes or flat areas.
It would be better to classify this map into three classes: Convex , Straight and
Concave . We can do this by reclassifying the map. We can use the Slicing operation
(as was explained in chapter 7) for classifying the value map Shape , but since there
are only three units, we can also use a MapCalc formula. The resulting map will be a
class map with three classes. The domain will be created semi-automatically after
writing the formula.
Type the following formula on the Command line of the Main window:
Shapeclasses = IFF(Shape<-0.5,Convex slope,
iff(Shape>0.5,Concave slope,Straight slope))
398
Click the Create button next to the drop-down list box of the Domain. The
Create Domain dialog box is opened.
Enter the Domain Name Shapeclasses and click OK. The Domain
Class editor is now opened
Close the Domain Class Editor. You are now back in the Raster Map
Definition dialog box. Click Show.
Open map Shapeclasses and check its contents. Close it when you are
finished.
Filter the map Shapeclasses using the Majority filter and generate the
result map Shapeclasses_final .
Select raster map Dem in the Catalog, press the right mouse button and
select Image Processing, Filter. The Filtering dialog box appears.
We want to use a 5x5 filter so enter 5 for the number of Rows and 5 for the
number of Columns.
Enter the value 1 for the Rank. This will give us the minimum value.
Type Demmin for the Output Raster Map, accept all other defaults and
click Define.
The map Demmin , giving the minimum altitude within each hectare will be
calculated later. Now we also need to define a map for the maximum altitude value
per hectare.
ILWIS 3.0 Users Guide
399
Repeat the procedure as described above but with the following exceptions:
- The Rank should now be 25 (the maximum value of 5x5 pixels).
- The Output Raster Map name should be: Demmax .
Click Define. Type the following formula on the Command line of the
Main window:
Internal_relief = Demmax-Demmin
The Raster Map Definition dialog box is opened.
First the maps Demmin and Demmax will be calculated, then map
Internal_relief will be calculated, and the Display Options dialog box
of the last map will appear.
Add maps Demmin and Demmax to the pixel information window and check
some values by clicking in the map.
Close the map and the pixel information window when done.
From the File menu in the map window, select Open Pixel Information. The
pixel information window is opened.
400
Figure 10.4: Slope steepness calculation. h is the height difference between two points and d is
In ILWIS, the slope angle or slope percentage can be calculated in X and Y direction
using a digital elevation model (DEM), gradient filters (DFDX and DFDY) and a
map calculation formula. The following steps have to be done to calculate a slope
map:
- Constructing a DEM (see section 10.1).
- Calculating gradient maps in X and Y direction (see section 10.2).
- Calculating the slope angle or slope percentage using map calculation formulas.
In this exercise the gradient maps Dx and Dy (created in the previous section), are
used to generate a slope map. The pixel size in these gradient maps is 20 meters and
the domain type is value.
Type the following formula on the Command line of the Main window:
Slope_percentage = ((HYP(Dx,Dy))/pixsize(Dem)) *100
Type for the Description: Slope map in percentages and click Show.
The map is calculated and after that the Display Options - Raster Map
dialog box is opened.
401
ATAN and RADDEG are internal MapCalc/TabCalc functions. The ATAN function
calculates the arctan (tan-1), and returns real values in radians in the range
-1/2 to 1/2 . The function RADDEG is used to convert the radians to degrees.
402
From within the map window, open the pixel information window and add
the map Slope_ percentage to it. Compare the values and calculate if
both maps are correct in respect to each other.
Type the following formula on the Command line in the Main window:
Aspect = RADDEG(ATAN2(Dx,Dy)+pi)
gradient map. The formula results in values between 0 and 360, according to the
degrees of the geological compass. For flat areas no slope direction can be calculated.
They will obtain an undefined value. In order to be able to display them correctly we
need to make a domain Compass , for which we will create a special representation
later on.
In the Raster Map Definition dialog box click the Create button next to the
drop-down list box of the Domain. The Create Domain dialog box is
opened.
Reopen the maps Display Options dialog box and click the Create representation button. The Create Representation dialog box is opened.
403
Degrees
Color
360
270
180
90
0
Gray
White
Gray
Black
Gray
Open the Edit menu and select the Insert Limit command or press the Insert
Limit button. The Insert Limit dialog box is opened.
Insert the limits and edit the colors according to Table 10.2.
Select from the Edit menu the command Stretch Steps. The Stretch Steps
dialog box appears.
Now the representation is ready. It goes from white for western aspects to gray for
northern and southern aspects to black for eastern aspects.
Add the segment map Drainage and/or Contour to the map window.
Display the segments in a single color (e.g. Blue or SandyBrown ).
Check the slope directions by clicking on the pixels and close the map window afterwards.
It is also possible with the Slicing operation to classify the aspect map. The
procedure how to do this is clearly described in the ILWIS Help topic How to
calculate an aspect map.
404
10.5 Display 3D
A Digital Elevation Model (DEM) can be visualized in 3 dimensions using a
georeference 3D. The DEM or perspective view will initially appear as a line grid. It
is possible to superimpose on this DEM/perspective view any map (satellite images,
thematic maps) with the same coordinate system. The initial 3D grid lines of the
georeference 3D have to be edited so that the user can specify the view parameters
(altitude, rotation, distance, vertical exaggeration, etc.). This defines the perspective
of the observer in relation to the 3D model.
In the following exercise the Digital Elevation Model Dem created in section 10.1 is
displayed as a three dimensional view. A line grid in X and Y directions will be
displayed. By modifying the view parameters you can adapt the grid so that the 3D
model meets your requirements.
In the Display 3D dialog box, click the Create button next to the
GeoReference drop-down list box. The Create GeoReference dialog box
is opened.
The 3-D view is now displayed with default values. These default view parameters
can be modified by editing the georeference 3D.
Maximize the window so that the whole 3D view (grid lines) and all parameters in the 3D View Parameter pane are visible.
By changing the values in this editor you can change the view direction, altitude, etc.
This is explained in Figures 10.5 and 10.6.
You can imagine a 3D view as the view that you would have from an area when you
are in a helicopter, which is at a fixed position. This position is called the view point.
The view point is at a certain height (i.e. view height) in meters and at a certain X
and Y coordinate in the map. From the view point you are looking at the study area.
The point in the center of your study area is called the focal point, which also has a
ILWIS 3.0 Users Guide
405
Figure 10.5: The parameters used to define a 3D view. The view point is the point from which
you look, and the focal point is the center of the area to which you look. The view
point is at a certain height (view height), and at a certain horizontal rotation with
respect to the N-S line. The line between the view point and the focal point is
called the view axis and has a certain distance and a certain angle with respect to a
vertical line through the focal point (vertical rotation).
The focal point is at a certain distance from the view point. This distance is the real
distance between the view point and the focal point.
The viewing axis also has a certain horizontal rotation with respect to a line in N-S
direction. This is called the horizontal rotation (angle). The horizontal rotation angle
is taken as a negative value when the viewing axis is rotated in western direction and
positive when rotated in eastern direction. For example: when you are looking from
the SW, the horizontal angle is -45, and when you are looking from the NE, the
horizontal angle is +135.
The viewing axis also makes an angle with respect to a vertical line. This is called the
vertical rotation (angle). The vertical rotation angle is 0 when you are exactly above
the focal point, and it is 90 when your helicopter is at the same level as the focal
point (i.e. as if you were standing on the ground at a certain distance).
The viewing angle is defining the opening angle with which you are looking to the
focal point. You can imagine it as a cone, with the viewing axis as the center, starting
at the view point. When the viewing angle is 180 degrees, it is as if you are looking
at the terrain with a fish eye lens.
The last parameter to explain is the scale height. With the scale height, you can
exaggerate the height differences in Z (as compared to X and Y).
406
Figure 10.6: Parameters used to define the 3D view. The coordinates of the view point and the
focal point can be entered, as well as the distance between the two (real distance).
The horizontal rotation angle is the angle between the line connecting the focal
point and the view point with respect to a N-S oriented line. The viewing angle is
the angle with which you look to the focal point (it is the sum of the two angles at
both sides of the view axis which connects the view point and the focal point).
In the following exercise you will learn how to work with the different parameters, in
order to get an optimal 3D view. The first impression is that it is quite complicated to
enter so many parameters manually. However, many of these are interrelated, and
there are a few which are crucial: Horizontal Rotation, Vertical Rotation,
Distance, Viewing Angle and Scale Height.
First, we will adapt the 3D view to simulate that you are looking from the south to
the terrain and from a position close to the ground surface (high vertical rotation).
407
Figure 10.7: A 3D view from the south with a high vertical rotation.
To evaluate the effect of using a higher view point (i.e. a smaller vertical angle), you
will now change the 3D view again.
Change the Vertical Rotation to 40 , and press Enter. Note that the View
Point and the View Point Height change automatically.
The view should now be similar to the one shown in Figure 10.8. Note that you now
see a larger part of the area but less height differences.
Now you will see the effect of changing the horizontal rotation. We will change the
vertical rotation back to the original value.
408
Change the Horizontal Rotation to 30 . This means you are now looking
from the south-southeast towards the north-northwest.
Figure 10.9: A 3D view from the south-southeast (30 rotation from the south).
The next parameter that we will change is the Viewing Angle. Decreasing the
viewing angle is similar to zooming in with a camera. You will see a smaller area, but
in more detail.
The view should now be similar to the one shown in Figure 10.10. Note that you will
see a smaller area than before.
Finally, you will look how you can change the position of the focal point. The focal
point is always in the exact center of the 3D view in the window. It is the point to
which you are looking and this point will be displayed at the center of the window.
You could change the focal point location by typing the coordinates, but this is rather
tedious. There are much faster methods to change the focal point location and the
other interrelated parameters. You can also set the focal point interactively by clicking
in the grid line window.
Open the Edit menu and select the Focal Point command and click with the
mouse pointer somewhere in the grid line map (e.g. near the small mountains
at the foreground) to set the new focal point.
409
In the Extend Window by Percentage dialog box extend all four sides of
the window with 50 %.
If you like, adapt the Viewing Angle to a somewhat larger value, e.g. 95 .
Click somewhere in the white space in the small DEM window, e.g. somewhere at the bottom left; keep the left mouse button down and move the
pointer to the center of the map; then release the mouse button. The 3D view
will change immediately.
Practice some more until the grid lines nicely fill the area of the georeference
3D window.
Selecting the best parameters for defining a 3D view seems quite difficult when you
are doing it for the first time. However, if you practice some more with the editor,
you will see that a number of parameters are interrelated.
When you have finished editing the parameters of the GeoReference 3D, you can
leave the editor by pressing the Exit Editor button
on the Toolbar in the
GeoReference 3D editor.
Click the Exit Editor button in the Toolbar of the GeoReference 3D editor
or open the File menu and choose Exit Editor.
Clear the check box Grid, select the check box Raster Drape and select
raster map Shadows from the drop-down list box.
Click OK. The Shadows map is now draped over the 3D view.
As you can see the display is still rather course. This is because you accepted the
default pixel size of 3. With the pixel steps, you can define the number of rows and
410
Change the Pixel steps to 1 and click OK. The 3D view is redisplayed slowly, but more accurately.
In the map window, press the right mouse button and select Display
Options. The Display Options 3D Grid dialog box appears.
In the Display Options 3D Grid dialog box, select the Grid check box,
change the Grid Distance to 1000 m and click OK.
Close the map window when you have seen the result.
Once you finished creating and editing the georeference 3D, you can display any
existing raster map as a 3D view by using the Display 3D operation.
In the Display 3D dialog box, select Dem3D1 from the GeoReference dropdown list box and click OK. The Display Options - 3D Grid dialog box is
opened.
Clear the Grid check box, select the check box Raster Drape and select
raster map Landuse .
Accept the default Representation and click OK. The Landuse map is now
draped over the 3D view.
In the map window open the File menu and select the Save View command.
The Save View As dialog box appears.
In the Save View As dialog box type 3Dmapview for the Map View Name
and click OK. The map is saved as a map view.
411
Change the Boundary Width to 0. In this way only the polygons are shown
in color, without boundary lines.
Change the amount of Multiple Colors to 31 and click OK. The polygon
map is drawn in the perspective view.
In the map window, open the File menu and select the Open Pixel
Information command. The pixel information window is opened. You may
have to add raster map Landuse yourself to the pixel info window.
Move with the mouse pointer to one of the city blocks displayed in the 3D
view, and read the information from the pixel information window.
To obtain a new raster map in 3D, you can use the Apply 3D operation.
Select Raster Map Landuse , GeoReference Dem3D1 and type for the
Output Raster Map name 3DLanduse .
Click Show. The new map is now created. This will take a while.
After that the Display Options - Raster Map dialog box is opened. Click
OK to display the 3D view and close it after you have seen the result.
The resolution of the output raster map may be rather course. The resolution is
determined by the size of your georeference 3D (default 300 lines x 400 columns)
when the georeference 3D was created, and how well you made the initial 3D grid
lines fit into this when you edited the georeference 3D.
Summary: 3D-display
- A Digital Elevation Model (DEM) can be visualized in three dimensions by
creating and editing a Georeference 3D.
- A georeference 3D can be created with the Display 3D operation.
412
413
Click with the right mouse on the segment map Profile , and select
Vectorize, Segment to Point from the context-sensitive menu. The
Segments to Points dialog box is opened.
Select the option button Distance and enter 50 for the Distance. This
means that along the segment, points will be stored at every 50 meters.
Type for the Output Point Map Profile and click Show. A point map is
made containing points at every 50 meters along the profile line. The
Display Options - Point Map dialog box is opened.
Now that the point map is generated, we can open it as a table, and read the altitude
values from the DEM for each point.
414
Click with the right mouse on the point map Profile , and select the command Open as Table from the context-sensitive menu. The point map is
now shown as a table with two columns: Coordinate and Name .
Open the View menu in the table window and select the Command Line.
The table window should now give you a Command line.
Type the following formula on the Command line of the table window:
Distance =(%R-1) * 50
The objective of this formula is to use the record indexes (the values shown in the left
gray column). The predefined variable %R refers to these record indexes. The formula
results in distances in meters from the start of the profile.
Now we will read for all the points, the values of the Digital Elevation Model, from
the pixels with the same coordinates as shown in the table. This can be done with the
MapValue function.
Type the following formula on the Command line of the table window:
Altitude = MapValue(Dem,Coordinate)
Now we have the distance as well as the altitude, and the profile can be drawn.
From the Graph menu, select the command New Graph Window or press
the New Graph Window button in the Toolbar of the table window. The
Graph dialog box is opened.
In the Graph dialog box select the column Distance for the X-column and
the column Altitude for the Y-column and click OK. The Graph Options
sheet is opened.
Accept the default settings and click OK. The profile is now shown.
If you like, you can adapt the descriptions for the X and Y-axis in the Graph
Options sheet; on the X-axis tab and the Y-axis (left) tab. On the X-axis
tab, you can also rotate the values along the X-axis (e.g. 90).
In the previous exercise vector data (a segment map) is used to create a cross-section
through the terrain. It is also possible to use raster data as basis for the selection and
creation of a cross section e.g. using a particular line or column from a raster map.
How to do this is clearly described in the ILWIS Help topic How to calculate a
cross-section through the terrain (Advanced).
ILWIS 3.0 Users Guide
415
CHAPTER 11
417
Figure 11.1: Schematic representation of a potential oil reservoir. Given are the vertical dis-
The spatial distribution of the points in the maps can be examined to acquire more
knowledge about the phenomenon and the responsible process.
418
Double-click point map Top in the Catalog. The Display Options Point
Map dialog box is opened.
In the Display Options Point Map dialog box accept all defaults by clicking OK. The map is displayed in a map window.
Visually inspect the point map. Move with your mouse pointer over the map window
and keep the left mouse button pressed. Notice that the point values are displayed if
you position the mouse pointer near a point in the map. In the Status bar, you see
the map coordinates changing while moving the mouse.
Open the Layers menu in the map window and choose Add Grid Lines.
Accept the defaults and click OK.
Estimate the size of the map (X- and Y-extent) and verify this using the Measure
Distance tool.
Press the pair of compasses in the toolbar of the map window and measure
some distances.
Press the pair of compasses in the toolbar of the map window and measure some
distances.
Measure the length of both the smallest and the largest point-pair vector i.e. the
shortest distance between two points and the longest distance between two points.
Find also the angle between each of these two point pairs.
In the Properties sheet, press the right mouse button on the text Point Map
Top to open the context-sensitive menu.
419
In case your points are regularly distributed, e.g. as a regular grid, it is advised to
directly rasterize the points with the Points to Raster operation and further interpolate the raster map with the Densify or Resample operation or with the
Kriging from Raster operation.
Figure 11.2: Fundamental types of patterns: Complete Spatial Randomness (CSR), Clustered
There are two two basically different techniques that are used in ILWIS to examine
the spatial pattern of points in a point map:
420
421
Display the table data in graphs and compare them with the graphs in Figure 11.2, to
define a pattern for the point map. You can also use additional information to define
how the points are distributed in the point map. To create a graph from the output
table data:
From the Graphs menu in the table window, select the New Graph
Window command. The Graph dialog box appears.
Select column Distance for the X-Axis and column ProbAllPnt for the
Y-Axis and click OK. The Graph Options sheet is opened.
Compare the shape of the graph with Figure 11.2. From the graph, you can see that
beyond distances of about 2200 m always all other points will be found.
Repeat the exercise: select this time column Distance for the X-Axis and
column Prob1Pnt for the Y-Axis and click OK. The Graph Options sheet
is opened.
On the X-axis tab, type Min Max 0-750 , Grid Step 50 and Text
Rotation 90 and click OK.
From the graph, you can see that for any point in the point map at distance 225 it is
certain that at least 1 other point is found.
422
In the table, find the distance at which at least 6 points will be found for any
point. Are 6 points, which will form 6 point vectors for any point, enough to perform an interpolation?
From the View menu of the table window, select Additional Info. The additional information is displayed in a separate window.
Close the additional information window, the graph windows and the table
window when you have finished the exercise.
423
424
Do you think these number of point pairs are sufficient to determine a suitable
semi-variogram model later on?
Calculate the total number of point pairs and compare with the answer on page
407.
The next two columns, I and c give the calculated values for the point pairs in a
specific distance class. Column AvgLag gives the calculated average distance
between points of the point pairs in a certain distance class. Column SemiVar gives
the semi-variogram values. This will be explained in section 11.4 (kriging).
Interpretation of the data in the output table will be done by means of graphs. The
spatial autocorrelation function, shown in a graph is referred to as spatial
autocorrelogram, showing the correlation between a series of points or a map and
itself for different shifts in space or time. It visualizes the spatial variability of the
phenomena under study. In general, point pairs that are close to each other have on
average a lower variance (i.e. are better correlated), than point pairs at greater
distances to each other. The autocorrelogram quantifies this relationship and allows to
gain insight into the spatial behavior of the phenomenon under study.
Two graphs will be prepared for the depth to the top of the reservoir rock. One graph
will show the change in correlation with distance and the other graph will show the
change in variance with distance.
In the table window, open the Graphs menu and select the New Graph
Window command. The Graph dialog box appears.
In the Graph dialog box select the column Distance for the X-axis and the
column I for the Y-axis and click OK. The Graph Options sheet is opened.
On the Distance x I tab, select the Point option, the Color Red and click
OK. The graph is displayed, showing the distance against the spatial autocorrelation (as Morans I ).
Click the New Graph Window button in the Toolbar of the table window.
The Graph dialog box shows up.
Select column c for the Y-axis and click OK. The Graph Options sheet is
opened.
On the Distance x c tab, select the Point option, the Color Green and
click OK. The graph is displayed, showing the distance against the spatial
variance (as Gearys c).
425
427
Figure 11.3: (A) An input point map. (B) The output map obtained as the result of the interpola-
To interpolate the point map Top with the Nearest Point interpolation method:
428
Select point map Top in the Catalog. Use the right mouse button and select
Interpolation, Nearest Point from the context-sensitive menu. The Nearest
Point dialog box is opened.
Now that you know the depth of the top and the depth of the bottom of the sandstone
unit, you can calculate the thickness of the unit.
Type the following formula on the Command line of the Main window:
Thickness_np = Top_np Bottom_np
Accept the defaults in the Raster Map Definition dialog box and click
Show. The map is calculated and the Display Options Raster Map dialog box is opened.
Click OK and check the values of the map and those of the input maps using
the pixel information window. If you like, you can open the Display Options
of map Thickness_np again and Stretch from e.g. 0-400 m.
Get an idea of where the sandstone unit is thick and where it is thin.
Drag and drop point map Sandstone from the Catalog in to the raster map
Thickness_np . The Display Options Point Map dialog box appears.
In the Font dialog box select Font Arial , Font Style Regular and Size
8. Click OK.
Click the Symbol button and select Symbol +, Size 4 in the Symbol dialog
box.
Click OK in Display Options Point Map dialog box. The point map
Sandstone with attribute Thickness is now displayed on top of raster
map Thickness_np .
Notice that the thickness observed in the isochore map diminishes towards an area
stretching from the middle lower left-hand side of the mapped area to the upper righthand side of the area. This is caused by a normal fault dipping south, cutting out part
of the reservoir sandstone in the central part of the area. From the interpolated map
ILWIS 3.0 Users Guide
429
Additional exercise: create a cross section through the area from the north to
the south, with the method explained in section 10.6.
See the ILWIS Help topic How to calculate a cross section through the terrain for more information about creating a cross section through the terrain.
Moving Average
The Moving Average method performs a weighted averaging on point values of a
point. The output value for a pixel is calculated as the sum of the products of weights
and point values, divided by the sum of weights. Weight values are calculated in such
a way that points close to an output pixel obtain large weights and points further away
obtain small weights. Thus, the values of points close to an output pixel are of greater
importance to the output pixel value, than the values of points that are further away.
You have the inverse distance and linear option to specify the method to calculate
weight values (see the ILWIS Help topic Moving average Algorithm for more
information). Furthermore, you also have to specify a limiting distance. Points that
are further away from an output pixel than the limiting distance, obtain weight zero
and thus have no influence on the output value for that pixel. This speeds up the
calculation and prevents artifacts. It is however important to choose a limiting
distance that contains enough data points.
430
Repeat the procedure for point map Bottom and call the Output Map
Bottom_ma .
Check the values of the maps and those of the input maps using the pixel
information window.
Now that you know the depth of the top and of the depth of the bottom of the unit,
you can calculate the sandstone thickness in the same way as during the nearest point
interpolation.
Type the following formula on the Command line of the Main window:
Thickness_ma = Top_ma - Bottom_ma
Accept the defaults in the Raster Map Definition dialog box and click
Show. The map will be calculated and the Display Options - Raster Map
dialog box will be opened.
From the output map you can conclude that the Moving Average interpolation
method is a useful method for this specific problem. The erratic behavior near the
fault trace can be due to natural variation/inhomogeneity. A more continuous area of
low values could be achieved by directional interpolation (i.e. using a search ellipse
instead of a search radius). Anisotropic Kriging, an interpolation method that will be
treated in section 11.4, is a method that takes spatial dependencies into account.
Trend Surface
In the Trend Surface method, pixel values are calculated by fitting a surface through
all point values in the map. The surface may be of the first up to the sixth order. A
trend surface may give a general impression of the data. Surface fitting is performed
by a Least Squares Fit (LSF).
431
Close all map windows when you have finished the exercise.
From the output map you can conclude that the Trend Surface method is not useful
for this particular data set. The result only shows a very general trend, without any
local detail.
Moving Surface
In the Moving Surface method pixel values are calculated by fitting a surface through
weighted point values. Weights for all points are calculated by a user-specified weight
function. Weights may, for instance, equal the inverse distance. The weight functions
are implemented in such a way that points which are further away from an output
pixel than the user-specified limiting distance obtain weight zero. Surface fitting is
performed by a least squares fit.
432
Accept all other defaults and click the Show button. The calculation will
start and after the calculation the Display Options - Raster Map dialog box
will be opened.
Calculate the thickness of the sandstone unit. Call the Output Map
Thickness_ms .
Display the thickness map of the Moving Average operation and the thickness map of the Moving Surface operation next to each other
Close all map windows when you have finished the exercise.
433
434
435
Open the Layers menu in the map window and choose Add Grid Lines.
Estimate the size of the map and verify this using the Distance tool.
Accept the defaults and click OK. The grid layer is displayed on top of the
point map.
Measure the length of both the shortest and the longest point-pair vector. A point-pair
vector is the distance (and the angle) between two points. Zoom in if needed. Find
also the angle and the difference in 14C percentages for each of these 2 point pairs.
In the Properties sheet, press the right mouse button on the text Point Map
C14 to get the context-sensitive menu.
From the context-sensitive menu, select Open as Table. The point map is
opened as a table.
How can you verify that the map is from an area in Botswana?
Also open table C14 . In Layer Management pane, expand Properties and
double-click the table C14 to open it.
In the C14 attribute column you will find the percentages of 14C content, measured in
well water at all locations appearing in the point map. Percentages are given with
respect to a stabilized 14C/12C ratio (p.m.c. = percents modern carbon).
436
Select point map C14 in the Catalog, press the right mouse button and select
Statistics, Spatial Correlation. The Spatial Correlation dialog box
appears.
Accept all other defaults and click Show. The spatial correlation is
calculated and the output table appears.
Inspect the different columns and their properties by double-clicking the column
names and viewing the details, i.e. the Column Properties. Explain the contents of
these columns, and compare in particular the Distance column with the AvgLag
column.
What does 37 in the first field of the NrPairs column mean precisely?
How many point-pair vectors are longer than 55 km?
Do the six longest vectors show the expected semi-variance?
Open the C14 map with attribute C14 selected and square the 14C differences
between the most remote point pairs.
The next step is to create a point graph, i.e. a discrete experimental semi-variogram
from the columns Distance and SemiVar of the Spatial Correlation table.
Choose the option New Graph Window from the Graphs menu in the table
window.
In the Graph dialog box, choose the Distance column for the X-axis and
the SemiVar column for the Y-axis and click OK. The Graph Options
sheet appears.
On the Distance x SemiVar tab, select Point and change the Color into
Red .
What is the unit used for distance (X-axis) and what is the unit used for the semivariogram values (Y-axis)?
437
Compare both output tables and explain the differences in the NrPairs column.
To which distance interval refers the value 20,000 in the Distance column in the
tables Omnidirectional_10 and Omnidirectional_5 ?
When the distance between sample points is 0, the differences between sampled
values is also expected to be 0. Thus, the semi-variogram value at distance 0 equals
0, i.e. (0)=0. Samples at a very small distance to each other are expected to have
almost the same values; thus, the squared differences between sample values are
expected to be small positive values at small distances. With increasing distance
between point pairs, the expected squared differences between point values will also
increase. At some distance the points that are compared are so far apart that they are
not any more related to each other, i.e. the sample values will become independent of
one another. Then, the squared differences of the point values will become equal in
magnitude to the variance of the variable. The semi-variogram no longer increases
and the semi-variogram develops a flat region, called the sill. The distance at which
the semi-variogram approaches the variance is referred to as the range or the span of
the variable.
A semi-variogram with a nugget effect is a semi-variogram that goes from 0 to the
level of the nugget effect in a distance less than the sampling distance. The semivariogram model shows the semi-variogram value 0 at distance 0 and a discontinuity
(jump) to a semi-variogram value at an extremely small distance. A nugget effect
438
In the Add Graph Semi Variogram dialog box, choose Spherical Model
for the SemiVariogram model, use values 200 m, 800 m and 40 km for the
Nugget, Sill and Range respectively and click OK. The Graph Options
sheet appears.
At which distance do you find the greatest discrepancy between the semivariogram model and the measured values?
In the graph window, click the right mouse button to open the context-sensitive menu and select the Graph Options command. The Graph Options
sheet appears.
On the Spherical Model tab, modify the Sill until you obtain a good fit
between curve and plotted points until distances 40000 m.
In the Graph Options sheet, click the Graph Management tab, click the
Add Graph button, and select Semivariogram Model.
Add a Circular semi-variogram model using the same values for Nugget,
Sill and Range as before. Use a different color to display the model.
439
Select Distance for the Distance column, choose Spherical Model for
the SemiVariogram model and use values 200 , 750 and 40000 for the
Nugget, Sill and Range respectively.
Call the Output Column SemiCol_Dist and click OK. The Column
Properties dialog box is opened.
Repeat the procedure but use this time AvgLag as Distance column and
call the Output Column SemiCol_Avg .
Make graphs of these 2 output columns. Plot respectively SemiCol_ Dist
against Distance , and SemiCol_Avg against AvgLag .
You can also test which semi-variogram model fits your data best by calculating the
Goodness of Fit (R2).
where:
are the experimental semi-variogram values calculated by the Spatial
Correlation operation;
are the semi-variogram values calculated by the Column SemiVariogram operation;
N is the total number of distance classes/intervals.
The numerator of the fraction gives the sum of the squared differences between the
experimental semi-variogram values and the semi-variogram values calculated by a
user-specified semi-variogram model.
The denominator of the fraction gives the sum of the squared differences between the
experimental values and the average experimental semi-variogram values of all
distance classes/intervals.
The Goodness of Fit indicator can be calculated using TabCalc statements. The terms
in the numerator are computed by first making a new column in the
Omnidirectional_10 table with an expression as:
440
Type the following formula on the Command line of the table window:
G_Gam_Sqr = SQ(SemiVar-SemiCol_Avg)
The terms in the denominator first require the value of (hi)/N (i.e. the average
experimental semi-variogram values) in a new column:
Type for example the following formula on the Command line of the table
window: Mean_G = AVG(SemiVar)
Type the following formula on the Command line of the table window:
G_Avg_Sqr = SQ(SemiVar Mean_G)
The maximum value of R2 is 1, meaning an exact match of calculated semivariogram values and experimental semi-variogram values.
One can obtain a better fit by excluding the distances beyond the range. See the
ILWIS Help for more information.
The TabCalc statements mentioned above are also available in an ILWIS script.
You can run the Goodness of Fit script by expanding the Script item in the
Operation-tree, then double-click the R2 script.
Once you have decided which semi-variogram model and which values for sill, range
and nugget fit your data best, you can continue with the kriging interpolation.
Kriging estimation and Error map
The final step in the kriging process is the calculation of the kriging estimations and
the estimation errors.
ILWIS 3.0 Users Guide
441
Double-click the Kriging operation in the Operation-list. The Kriging dialog box is opened.
Select point map C14 with attribute column C14 as input Point Map.
Accept the default Spherical Model and for Nugget, Sill and Range fill
out the values as used before.
Specify a Limiting Distance of 25 km.
Take 4 for the Minimum and 14 for the Maximum number of points.
Call the Output Raster Map Ord_krig25 .
Use GeoReference C14 and select the Error Map check box.
Accept all other defaults and click Show. The kriging map with its error
map is calculated and after you click OK in the Display Options dialog box,
it is displayed.
Which parameters influence the calculation speed? Explain the numbers in the
progress bar.
Use the right mouse button in the Catalog to view the Properties of raster
maps Ord_krig25 and Ord_krig25_Error .
What are the units in which the values of the output kriging map and the output
error map are expressed?
442
This time use, a Limiting Distance (search radius) of 40 km and specify all
other parameters as used before.
Call the Output Raster Map with the kriging estimates Ord_krig40 .
Open both error maps Ord_krig25_Error and Ord_krig40_Error and
close all other map windows.
Drag the input point map C14 on top of each of the error maps.
In the Font dialog box use the Font Arial , Font Type Regular , Size 8pt
and click OK.
Click the Symbols button and use Crosses for the Point Symbols
In the Display Options Point Map dialog box select Attribute C14 ,
select the Text check box and press the Font button.
Find the point with the best and the point with the worst kriging estimate in
both error maps and close the window afterwards.
Type the following formulae on the Command line of the Main window:
Over30 = IFF(Ord_krig25 - Ord_krig25_Error > 30,1,0)
Under30 = IFF(Ord_krig25 + Ord_krig25_Error < 30,1,0)
These expressions produce raster maps with values 1 and 0, and give with a
probability of about 84% (the sigma limit), that the 14C p.m.c. is over respectively
under the reference value of 30.
Combining both maps produces a 3-valued occurrence map.
Type the following formula on the Command line of the Main window:
Occurrence_3_valued = Over30 + Under30
For more information about creating confidence interval maps, see the ILWIS Help
topic How to calculate confidence interval maps.
Find the point with minimum and the point with maximum error variance
(uncertainty).
Drag the input point map C14 over raster map Simple_krig40_Error in
the same way as before, and compare the result with the previously
calculated error maps.
443
Open table C14 that contains the attributes of the point map C14 .
Column Over50 has values 0 and 1 which indicate whether a 14C sample surpasses
a cutoff of 50 p.m.c. or not.
Indicator Kriging can be carried out by considering the attribute Over50 as point
measurements with values 0 and 1, which have spatial continuity and are modelled by
a semi-variogram.
Make an Omnidirectional Spatial Correlation table and find a semi-variogram model, which reasonably fits the experimental values.
Perform an Ordinary Kriging operation with these model settings, call the
Output Raster Map Indicator_kriging and make sure that also an
error map is created.
Interpolate the C14 point map using Universal Kriging. Use the linear
option as well as the quadratic option.
Use the same Variogram Model with the same parameter values as in the
Ord_krig25 interpolation.
Can the results of this operation be compared with the outputs of the Ordinary
Kriging operation? Explain!
Remark:
Extrapolation outside the default value range causes that many pixels in the output
map get an undefined value. This can be avoided by setting a relatively large value
range for the output kriging map, either on the Command line or in the dialog box.
444
Call the Output Raster Map Var_surf55 , accept the other defaults and
press the Show button. The variogram surface is calculated and the Display
Options Raster Map dialog box appears.
Accept the defaults in the Display Options Raster Map dialog box by
clicking OK. The variogram surface is displayed.
The output of the Variogram Surface operation is a plot with the origin in the
center. Each cell in the plot (each pixel in the output map) has the size of the userspecified Lag spacing. The number of cells of the output surface (from the central
ILWIS 3.0 Users Guide
445
For the Input Map, use point map Artificial , attribute Samples .
For the Lag spacing, use 100 , 200 , 500 and 900 m respectively.
For the Number of lags, use 10 . Use of 100 m and 10 .
Name the Output Raster Maps: Var_surf_100 , Var_surf_200 ,
Var_surf_500 and Var_surf_900 .
446
Figure 11.5: Schematic explanation of the input parameters for Spatial Correlation bidirectional
The direction angle is measured clockwise from the Y-axis and defines the direction
in which points should be located relative to each other. When you use a direction
angle of 90, it means that only point pairs for which the points are located in westeast or in east-west direction will be considered (i.e. +90 clockwise from the Y-axis).
The tolerance angle is a parameter with which you can limit the number of point
pairs. When a tolerance of 45 is used, all point pairs in the map will contribute to
calculated semi-variogram values. When using a tolerance of 10, the direction of
every 2 points may differ -10 or +10 from the specified direction (90). So, in fact,
all points that are found in a position within 80 to 100 to one another are valid
pairs. Then, for the valid point pairs, the distance class to which they belong will be
determined.
Optionally, you can set a third parameter, the band width (m), to limit the tolerance to
a certain width.
You should find the values for these parameters from your variogram surfaces as
created in the previous exercise. To calculate the spatial correlation table for Point
Map Artificial :
ILWIS 3.0 Users Guide
447
Select Point Map Artificial , press the right mouse button and choose
Statistics, Spatial Correlation from the context-sensitive menu. The
Spatial Correlation dialog box appears.
Inspect the columns of the table Artificial_bidirect and explain the main
differences between the columns NrPairs1 and NrPairs2 and the columns
SemiVar1 and SemiVar2 .
Semi-variogram models
In the table window, open the Graphs menu and select New Graph Window. The
Graph dialog box is shown.
Do the same for SemiVar2 against AvgLag2 . Use this time the Color
Green as point color.
Create also a third graph. Plot the NrPairs against Distance . Take now
Needle as graph presentation and select again a different color. Set the maximum X-axis bound at 1000 and leave the Y bounds unchanged.
Note that the first distance class contains very few point pairs. When this first point
in the graphs is neglected, one can fit Power models through both graphs.
only need one semi-variogram model and the scale factor. If we consider a Range or
Limiting Distance of 600 meter, a Ratio of 6/5 (= 1.2 ) can be taken.
Anisotropic Kriging
We are now going to use the anisotropy found in the Variogram Surface operation
of point map Artificial in the Anisotropic Kriging interpolation. Anisotropic
Kriging is a variant of the Ordinary Kriging operation. Anisotropic Kriging
incorpotates the influence of direction dependency, i.e. anisotropy in the kriging
process.
Select the Error Map checkbox and click the Show button to start the calculation. After the calculation, the Display Options dialog box shows up.
Accept all defaults and click OK to display the map.
Close the map window when you have finished the exercise.
449
11.4.5 CoKriging
Often, data may be available for more than one attribute per sampled location. One
set of samples may be expensive or difficult to measure and is therefore sampled
infrequently while another variable may be cheap or easy to measure and has more
observations or more accurate ones. If the correlation between the two variables is
high (positive or negative), then it may be possible to use the information about the
spatial variation of a well-sampled variable (the covariable) to help to interpolate a
sparsely sampled variable (the predictand). This estimation method, in fact the
multivariate variant of Ordinary Kriging, is known as CoKriging.
Cross Variogram
Before Cokriging, you should perform the Cross Variogram operation. The Cross
Variogram operation calculates experimental semi-variogram values for two
variables (the predictand and the covariable) and cross-variogram values for the
combination of both variables. As two variables are handled simultaneously, the
Cross Variogram operation can be seen as the multivariate form of the Spatial
Correlation operation. From the output table of the Cross Variogram operation, you
can create semi-variogram models for both variables, and a cross-variogram model
for the combination of the variables. The models do not need to be identical but
should obey the Cauchy-Schwarz inequality. For more information, see the ILWIS
Help.
In this exercise, point map Mander with moisture deficit observations near Mander,
Overijssel, the Netherlands will be used. The map is linked to an attribute table
Mander . The table has 3 columns: column Moist76 (with moisture deficit values
for the year 1976), column Sub76 (with a subset of column Moist76 ) and column
Avg30 (with moisture deficit values for a 30 year average).
The coordinates, which you see on the Status bar when moving the mouse pointer,
are meters in the Dutch national grid system (RD) with stereographic projection.
Open table Mander and notice that column Sub76 is a subset of column
Moist76 .
In the Column Statistics dialog box select the Correlation function and
select the attribute columns Sub76 and Avg30 .
Also make a Cross Variogram table (Lag spacing 200 meter) for the correlated attributes Sub76 and Avg30 .
Display the graphs of the 2 semi-variograms and the cross-variogram and try
to fit them with Power models. Hint: the slopes are small values (about
0.02 or less) and the Power exponents are around 1.5 .
In the Graph window, use the context-sensitive menu to modify the way the
different variograms are displayed. Use Red for the Predictand Sub76 ,
Green for the Covariable Avg30 and Blue for the Cross-Variogram.
Write down the parameters for the Nugget, Slope and Power from the best fitting
models. Use these models in the Cokriging operation such that the interpolation of
the Predictand Sub76 values is supported by the Covariable Avg30 .
Start the CoKriging operation and fill out the parameters as found above.
Use for the Limiting Distance 800 meter and for the Minimum and
Maximum number of sample points 1 and 8 respectively.
Create a GeoReference. Use a Pixel size of 10 or 20 m and call the new
georeference Mander10 or Mander20 .
Select the Error Map check box, and click the Show button to execute the
operation.
Use the same Variogram Model with the same values for the parameters as
given above and call the Output Raster Map Ord_krig_Sub76 .
Compare the error maps of both the CoKriging and the Ordinary Kriging
operation and observe the error reduction due to the use of a correlated
covariable.
451
453
Accept all default settings and press OK. The map is shown.
Check the values in this map by clicking some pixels. Close the map window.
Now you will calculate and display semi-variograms for the three lithologies.
454
From the Graphs menu select the New Graph Window command. The
Graph dialog box appears.
Select column Distance for the X-axis, select column HorCorr for the Yaxis and click OK. The Graph Options sheet is opened.
On the Distance x HorCorr tab, select Point, the Color Red and click OK.
Select the column VertCorr for the Y-axis and click OK. The Graph
Options sheet appears.
On the Distance x VertCorr tab, select Point, choose Color Green and
click OK again.
Click the New Graph Window button. The Graph dialog box is opened.
On the Distance x HorSemVar tab, select the Point option, the Color Red
and click OK.
In the graph window, click the right mouse button to open the context-sensitive menu. Select the Add Graph, from Columns command. The Add
Graph dialog box appears.
Select the column VertSemVar for the Y-axis and click OK. The Graph
Options sheet appears.
On the Distance x VertSemVar tab select the Point option, choose Color
Green and click OK again.
Repeat the previous described procedure for the maps Schist and
Carbonate .
Type Autocorr_Gneiss in the text box Output Table. Accept the default
Maximum Pixel Shift and click the Show button. The result of the operation is displayed in a table window.
In the graph window, click the right mouse button to open the context-sensitive menu. Select the Add Graph, from Columns command. The Graph
dialog box shows up.
In the Graph dialog box, select column Distance for the X-axis, select
column HorSemVar for the Y-axis and click OK.
In general, the semi-variograms show low values for short lag spacings, indicating
that pixels that are close or adjacent are relatively similar (i.e. the variance is low). In
some cases the curve does not seem to approach the origin of the plot, but tends to
reach a small Y-intercept known as nugget. This indicates that there is variability at
very short (almost zero pixel) distances. In remote sensing, this variance can be
attributed to noise in the images. At larger lag spacings, the increase in semi-variance
tends to level off to a constant value, known as the sill of the semi-variogram. The
distance at which this sill is reached is known as the range of the variogram.
ILWIS 3.0 Users Guide
455
Close the graph and the table windows when you have finished the exercise.
If the Gneiss , Schist and Carbonate maps would not have been surfaces yet but
would have been real sample point surrounded by undefined values, you could have:
- Performed the Variogram Surface operation to determine the anisotropy for
Gneiss , Schist and Carbonate .
- Perform AutoCorrelation Semivariance operation again for Gneiss , Schist
and Carbonate .
- Displayed the experimental semi-variograms for Gneiss , Schist and
Carbonate .
- Chosen an appropriate model, to determine the parameters for sill, nugget and
range.
- Performed the Kriging from Raster operation.
For more information, see the ILWIS Help topic Kriging from Raster.
Summary: Autocorrelation
- AutoCorrelation - Semivariance calculates autocorrelation and semi-variogram
values for a raster map and is more or less similar to the bidirectional Spatial
Correlation operation for point maps.
- The AutoCorrelation - Semivariance operation should be used prior to a raster
interpolation operation like Densify, Resample or Kriging from Raster.
456
CHAPTER 12
457
To perform an ILWIS command, you just type it on the Command line. Some
examples of commands are listed in Table 12.1. Since the Command line is case
insensitive, it doesnt matter if you type them in upper or lowercase. A complete
overview of ILWIS commands can be found in the ILWIS Help topic, Appendices
ILWIS script language (syntax).
458
Open Help, go to the Appendices and browse through the following topics:
ILWIS commands and expressions: ILWIS commands, ILWIS expressions, ILWIS expressions (alphabetic), Construction of expressions,
ILWIS script language (syntax).
Table 12.1:
Command
Example
Description
Open object.ext
Open Geomorphology.mpr
Edit object.ext
Edit Geomorphology.mpa
Del object.ext
Del temp.mpr
Md directory
Md temp
Help
Help
The Open Object dialog box appears from which you can select any object.
Select raster map Geomorphology and click OK. The Display Options Raster Map dialog box is opened. Click OK. The raster map
Geomorphology is displayed.
Type the following command on the Command line:
Open Geomorphology
You will notice that you get an error message when you type: Open
Geomorphology .
This is due to the fact that ILWIS doesnt know which object with the name
Geomorphology should be displayed: a raster map, a vector map, a table, a domain,
etc. You have to use the name of the object and its extension.
The extension .mpr is the extension of raster maps. In Table 12.2, the extensions of
some ILWIS objects are listed.
ILWIS 3.0 Users Guide
459
Extension
Example
Description
.mpr
Geomorphology.mpr
.mpa
.mps
.mpp
.tbt
.mpv
.mpl
.ioc
.ilo
.his
.hsa
.hss
.hsp
.rpr
Cityblock.mpa
Contour.mps
Rainfall.mpp
Cityblock.tbt
Cochabamba.mpv
Tms.mpl
Bolivia.ioc
Cochabamba.ilo
Slope.his
Landuse.hsa
Drainage.hss
Wells.hsp
Landuse.rpr
To practice with some commands, expressions and script language, we will now
calculate a landslide risk map. When a unit in the Geomorphology map is classified
as active landslide (AL) or old landslide (OL), we will classify it as landslide in the
new map. The new map Slide will contain 2 classes, Landslide and No
Landslide . We will therefore start with the creation of a new domain containing
these 2 classes.
In the next part of this chapter we will create the same landslide map, but then using
a script.
The domain Slide now has two items. Check this by opening the domain.
The class domain Slide is created, but it still doesnt contain any items.
Type the following command on the Command line:
Additemtodomain Slide Landslide
Additemtodomain Slide No Landslide
Enter the following MapCalc statement:
Slide{dom=Slide}=IFF((Geomorphology=AL)OR
(Geomorphology =OL),Landslide,No Landslide)
460
Click Show in the Raster Map Definition dialog box and OK in the
Display Options dialog box.
Select Create Script from the File menu of the Main window. The Script
editor (Figure 12.1) is opened.
The script that is needed to calculate the landslide map is shown below and as you
can see that language is fairly similar to the Command line syntax. Instead of
typing, you can also copy part of the statements from the Command line or from the
log file into the script. Note that the filenames have changed so that we do not
overwrite the objects of the previous exercise.
1
2
3
4
5
6
461
Type the following lines in the text box of the Script tab:
Rem ILWIS script for calculating a landslide map
Crdom Landslide
Additemtodomain Landslide Landslide
Additemtodomain Landslide No Landslide
Landslide{dom=Landslide} = IFF ((Geomorphology=AL)
OR(Geomorphology=OL),Landslide,No Landslide)
Calc Landslide.mpr
Open Landslide.mpr
Click the Save button in the Toolbar of the Script editor and save the script
as Landslide .
The script Landslide is created. Note that the first line starts with Rem . This
indicates that this line contains a remark and will not be executed by ILWIS. To run
the script:
The results of running this script are the map Landslide and the domain
Landslide .
462
Check the contents of the raster map Landslide and the domain
Landslide and close the map window, the domain and the Script editor
afterwards.
Where,
is the name of the output object.
is a definition symbol to indicate that a dependent output object is to
be created, when the assignment symbol := is used, an independent
output object is created.
Expression is an expression consisting of an operation name followed by the
parameters required by this operation (between brackets, and separated
by commas), or a MapCalc expression.
Outmap
=
For example, to sum maps Map1 and Map2 to create Map3 , type in the script:
Map3 = Map1 + Map2
When using TabCalc expressions in a script, it is required that the word TabCalc
and the table name used for the expression are added to the syntax.
The general syntax for TabCalc expressions in scripts is:
TabCalc Tablename Expression
Where,
Tabcalc
is to indicate that the following is a table calculation syntax.
Tablename is the name of the table used for the expression.
Expression is the Command line syntax that you would use on the Command
line of a table window to perform table calculations.
For example, to sum columns Col1 and Col2 in table MyTable and to store the
results in column Col3 , you can type in a script:
TabCalc MyTable Col3 = Col1 + Col2
You can also perform table calculations on other objects that can be opened as a
table, e.g. histograms, point maps, class representations. Then, specify the extension
(see Table 12.2) of the object after the object name:
TabCalc Objectname.ext Col3 = Col1 + Col2
When you use long object names for maps or tables, and when the names of
objects start with a digit, or start with or contain a space, or a special character,
then these names must be enclosed in single quotes. The extension should be left
outside the quotes. For more information, see the ILWIS Help topic, How to use
long object names.
463
Geomorphology = MapRasterizePolygon(Geomorphology,Cochabamba.grf)
Landuse = MapRasterizePolygon(Landuse,Cochabamba.grf)
Landvalue = (Landuse.Landvalue) / 25
Landvalue1 = IFF(Slope > 20 , Landvalue * 0.7 , Landvalue)
Landvalue2 = IFF(Geomorphology = OL, Landvalue * 0.6, IFF
((Geomorphology = AL) OR (Geomorphology = HE), Landvalue * 0.4,
Landvalue))
6 Landval_combined = MIN(Landvalue1, Landvalue2)
7 Landval_final = IFUNDEF(Geomorphology, Landvalue2, Landval_combined)
The line numbers in the table do not form part of the script. They are only used here
to comment on the various expressions.
For a better understanding of the script statements it is recommended to repeat the
exercise in section 8.1. Below, only a brief explanation on the script lines is given.
- In lines 1 and 2, the maps Geomorphology and Landuse are rasterized, using the
georeference Cochabamba .
- In line 3, the map Landuse is renumbered, with the values from the column
Landvalue in the attribute table linked to the map Landuse . The land use map is
linked to an attribute table, in which the average land value (per hectare) is stored
for each land use type. Since the average land values are given per hectare, and you
464
Since all the expressions in script Landvalue are written with the definition symbol
(=) only the definitions of the maps are stored. The maps are not calculated until you
open them. When you open the last map (Landval_final ) all previous maps are
also calculated.
Open the map Landval_final . The calculation starts with the first map
that was defined in the script. Have a look at the result and close the map
window and the Script editor.
465
Opentbl Cityblock.tbt
Tabcalc Cityblock Areadistrict = ColumnAggregateSum(Area, District, 1)
Tabcalc Cityblock Distrlanduse = District + Landuse
Tabcalc Cityblock Areadistrlu = ColumnAggregateSum(Area,
Distrlanduse, 1)
Tabcalc Cityblock Residential {dom = perc;::1} = IFF(Landuse =
Residential, 100 * Areadistrlu / Areadistrict, 0)
Tabcalc Cityblock Commercial {dom = perc;::1} = IFF(Landuse =
Commercial, 100 * Areadistrlu / Areadistrict, 0)
Tabcalc Cityblock Institutional {dom = perc;::1} = IFF(Landuse =
Institutional, 100 * Areadistrlu / Areadistrict, 0)
Closetbl Cityblock.tbt
Rem Open the table District
Opentbl District.tbt
Tabcalc District Residential = ColumnJoinMax(Cityblocks.tbt,
Residential, District, 1)
Tabcalc District Rommercial = ColumnJoinMax(Cityblocks.tbt,
Commercial, District, 1)
Tabcalc District Institutional = ColumnJoinMax(Cityblocks.tbt,
Institutional, District, 1)
Tabcalc District Population = ColumnJoinSum(Cityblocks.tbt,
Population, District, 1)
Tabcalc District Children = Population * Pchildren / 100
Tabcalc District Childpschool = Children / Schools
Closetbl District.tbt
Open District.tbt
The line numbers in the table are not part of the script. They are only used here to
comment on the various expressions.
466
Double-click the script Urban in the Catalog. The Script editor is opened,
in which you will see the script language.
Have a look at the result and close the table District afterwards.
467
The line numbers in the table are not part of the script. They are only used here to
comment on the various expressions. The script contains the following expressions:
- In line 1, a contour vector map, indicated with parameter %1 , is interpolated using
georeference %2 to create a Digital Elevation Model Dem .
- In line 2, the digital elevation model is filtered using a DFDX filter, creating a new
map Dem_dx containing the first derivative in x-direction (df/dx) per pixel.
- In line 3, the digital elevation model is filtered using a DFDY filter, creating a new
map Dem_dy containing the first derivative in y-direction (df/dy) per pixel.
- In line 4, a slope map in percentages %3 is calculated.
- In line 5, a slope map in degrees %4 is calculated.
- In line 6, output map %4 is calculated and therefore all maps created by the script
are calculated.
Note that this script contains four parameters: %1 till %4.
When you run a script with parameters these parameters should be defined either
before or when the script is run. The parameters can be defined in the following
ways:
- In the Script editor you can fill out the Parameters tab. Parameter Name and
Type can be entered here and will later on appear in a Run Script dialog box when
a user runs the script. The user can then select object names for input parameters
and/or type object names for output parameters.
468
ILWIS will replace every parameter definition (%1.%9) by the specified parameter.
For this exercise the parameters of Table 12.3 are used.
Table 12.3:
Script parameters.
Type
%1
%2
%3
%4
Segment Map
Georeference
Filename
Filename
Contour.mps
Cochabamba.grf
Slopepct.mpr
Slopedgr.mpr
We will first run the script from the Command line of the Main window.
Have a look at the resulting maps Slopepct and Slopedgr . Note that the
calculations start when you open the maps.
We will now enter the parameters in the Parameters tab and run the script from the
Script editor.
ILWIS 3.0 Users Guide
469
470
Open script Slope and click the Parameters tab. Set the number of parameters to 4.
The Run Slope Script dialog box now opens. Select the correct input map
and georeference and type for the Output Slope map in Percentage
Slopepct2 and for the Output Slope map in Degrees Slopedgr2 .
Click OK.
Have a look at the resulting maps Slopepct3 and Slopedgr3 . Close the
map windows and the Script editor.
s%1 = TableCross(%1,Slide)
calc s%1.tbt
tabcalc %1 AreaClass = ColumnJoinSum(s%1.tbt,Area,%1)
tabcalc s%1 AreaSl = iff(Slide="landslide",Area,0)
tabcalc %1 AreaSlide = ColumnJoinSum (s%1.tbt,AreaSl,%1)
tabcalc %1 Density {dom=perc} = 100 * AreaSlide/AreaClass
calc %1.tbt
As before, the line numbers are only used to explain the script. In short:
- A cross table is calculated from a variable input map (%1) and raster map Slide.
- In the cross table, the total area of each class is calculated and written into the attribute
table of the variable input map (AreaClass).
- Then, if landslides occur, the total area with landslides is calculated per class, and
written into the attribute table of the variable input map (AreaSlide).
- In the attribute table, the density of landslides is calculated by dividing AreaSlide by
AreaClass.
With script DensIn we can now call script Density and use various input maps:
Rem Script DensIn that serves as input for the Density script
1 Run Density Geology
2 Run Density Slope_classes
3 Run Density Catchment
Create a script DensIn and enter the lines as given in the example.
471
Command
Example
Description
Begincomment
begincomment
Open Geomorphology.mpr
endcomment
Pause seconds
Pause 20
Message text
Endcomment
Closeall
Closeall
Summary: Scripts
- Scripts are used to automate the operations in ILWIS.
- A script is a list of commands, calculations and expressions.
- With the help of a script, a complete GIS or Remote Sensing analysis can be performed automatically.
- A script may contain all the commands and expressions as listed in the
Appendices, ILWIS commands and expressions section of the ILWIS Help:
opening dialog boxes, MapCalc, TabCalc, performing operations and some other
actions.
- A script consists of an object definition file with extension .isl (ILWIS Script
Language) and a data file with extension .isf (ILWIS Script File).
- A script can be made by copying an expression from the Command line after you
have filled in all required parameters in the dialog box of a certain operation, and
clicked Define. At that moment the expression for that operation is shown on the
Command line. You can copy this expression from the Command line into your
script.
472
473
12.6 Functions
In Chapter 5 you have seen the use of calculation formulas to work with tables, and
in chapters 7 and 8 those to work with maps. As you have seen, there are many
different operators and functions that can be applied on value maps and on class or
ID maps. A complete overview of the operators and functions available in Table
Calculation and in Map Calculation can be found in the ILWIS Help, together with a
series of examples.
In this exercise you will first have a look at some examples of functions that are
already present in the system (pre-programmed functions), before you will practice
with the creation of your own functions (user-defined functions).
System-defined functions
A number of these functions where already treated in chapters 5, 7 and 8. Here, only
some examples of system-defined functions are given. One of the most important
functions is the Conditional IF function.
IFF(a,b,c)
Type the following expression on the Command line of the Main window:
Result1 = IFF(Dem > 4000, 10, 0)
Click Show, evaluate the result and close the map window.
It means: If a pixel in map Dem (Digital Elevation Model) has a value greater than
4000 , then assign the value 10 to this pixel in output map Result1 , or else assign a
0.
Random functions
For statistical purposes you might need a map with random values.
RND(long)
RND(0)
Returns a 0 or 1 at random.
RND( )
Returns random real values in the range [0;1> , i.e. between 0 and 1,
including 0 but excluding 1.
For example, if you want to subdivide your map randomly into two groups of pixels,
474
The Raster Map Definition dialog box is opened. Select system Domain
Value , and set the Value Range from 0 to 1, and the Precision to 1.0 .
Click Show.
Type the following expression on the Command line of the Main window:
Random = RND(0) * Map1
in which Map1 is a georeferenced value map with value 1 for every pixel. Map1 can
be calculated from any map using the appropriate georeference. Random uses the
same georeference as Map1 . The pixels in the output map will randomly get the value
0 or 1. Random functions are very useful for all kinds of statistical testing.
The Raster Map Definition dialog box is opened. Select system Domain
Value , and set the Value Range from 0 to 1, and the Precision to 1.0 .
Click Show.
MinMax functions
MIN(a,b)
MIN(a,b,c)
MAX(a,b)
The Raster Map Definition dialog box is opened. Select system Domain
Image and click Show.
User-defined functions
Besides many internal pre-programmed functions, ILWIS gives the user an
opportunity to create new functions. They may be used in all four calculators in
ILWIS 3.0 Users Guide
475
The Function editor appears showing your newly created function. If necessary, you
can edit your function. The different parameters in your function may be names of
maps or table columns, or you use characters (a, b) which you may specify later when
you apply the function.
The function in the Function editor is defined as follows:
1 Function Average_2(Value a, Value b) : Value
2 Begin
3
Return (a+b)/2;
4 End;
The line numbers do not form part of the function. They are only used here to explain
the contents.
-In line 1, the function name is given and the parameters are listed between brackets.
In this case there are two parameters: Value a and Value b. Also the output domain is
given: Value .
-In line 2, the word Begin indicates the beginning of the actual function expression.
-In line 3, the actual function is given. Note that the expression ends with a
semicolon (;).
-In line 4, the end of the function is indicated with the word End .
Now you can use your function on the Command line of the Main window or table
window. Type an expression that starts with an output map name (or column name)
followed by the definition symbol (=), then the name of your function and fill out the
parameters. The parameters, replacing the characters a and b in your function, have to
be entered in brackets separated by commas. The parameter that is filled in first is
taken as the first parameter encountered in your user-defined function.
476
The Raster Map Definition dialog box is opened. Select the system
Domain Image and click Show.
You can use this function also on the Command line of a table window to calculate
the average of two value columns.
The following example shows a more complex expression. We will calculate the
direction of slopes and create an aspect map (see chapter 10). An aspect map (slope
direction map) is calculated using the formula:
Aspect = RADDEG(ATAN2(Dx / Dy) + PI)
When you want to use this formula more often it is convenient to put the formula in a
function. You can create the function Aspect which has two variables: Dx and Dy .
Later, when we apply the function, you substitute the Dx and Dy parameters with the
real names of the maps for the horizontal and vertical gradient.
As you can see in the first line of the function definition, ILWIS assumes that PI is
another variable (a map or value). But in fact PI represents here the system-defined
variable. So you should edit the function to remove the variable declaration Value PI .
The correct definition of the function should be:
Function Aspect(Value Dx, Value Dy) : Value
Begin
Return RADDEG(ATAN2(Dx, Dy) + PI);
End;
477
Type the following expression on the Command line of the Main Window:
Aspect = Aspect(Dem_dx, Dem_dy)
The Raster Map Definition dialog box is opened. Select system Domain
Value , and set the Value Range from 0 to 360 and the Precision to 1.
Click Show.
Examine the results in map Aspect and close the map window.
Now you can easily calculate several aspect maps of other areas. You only have to fill
out your new input variables for the function; you have to specify the new Dx and Dy
map names of the other area.
Summary: Functions
- ILWIS contains over 50 different functions that are pre-programmed and that can
be used in Table Calculation, in Map Calculation, Script and in the pocket line calculator.
- Besides many internal pre-programmed functions, ILWIS gives the user an opportunity to create new functions.
- A user-defined function is an expression, which may contain any combination of
operators, functions, maps and columns.
- User-defined functions are especially useful when you need to execute certain calculations, which require a lot of typing effort on the Command line.
- To apply your function, type an expression on the Command line of the Main
window or table window. Start with an output map name (or column name) followed by the definition symbol (=), the name of your function and fill out the function parameters. The parameters, replacing the characters a, b, c, etc. in your function, have to be entered in brackets separated by commas. The parameter filled out
first is taken as the first parameter encountered in your user-defined function.
478
CHAPTER 13
Presentation of results
Data presentation is the procedure by which information from a GIS is presented in a
form suitable for the user. Remember that the results of a GIS analysis are used in
planning and management. Normally, data analysis is not done by the decision
makers and planners, therefore, information should be presented to them in such a
way that they are able to make sound decisions. If the information is presented to
them in a vague, unclear way, wrong decisions may be taken.
A map contains information, presented in a graphical form, intended for the map
user. A map is a means of communication, just as spoken text, video images, graphics
and sounds. A map should be well designed, so that the user can retrieve the
information quickly and easily.
Although ILWIS is not a cartographic package, it does provide the basic tools for the
creation of annotation and to convert digital spatial data (maps) to a hard copy print.
In the first part of this chapter, an introduction is given to the use of color, both for
display on the screen and for printing. The second part of the chapter explains how to
produce an output map. The selection of colors, patterns and point symbols is
demonstrated, and the Layout editor is used to create a complete land use map. The
procedure for printing a map is shown after that, followed by the methods for
converting your data to other (cartographic) packages. The last part of this chapter
deals with the generation of demos in ILWIS.
Before you can start with the exercises, you should start ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter13, where the data files for
this chapter are stored.
479
Presentation of results
13.1 Introduction
When you prepare a map, you should be aware of the requirements of the map users.
A map intended for decision-makers, containing clear data without details, will be
very different from one made for scientists, which should contain as much factual
information as possible.
A map may be multi-purpose, such as a topographical map, which may be used by
many different people, for different purposes. A map can also be a single-purpose
map, displaying only one theme, for example, the annual rainfall distribution.
A map has a primary content (the main theme of the map), a secondary content (base
map information, such as roads, contours, drainage), and a supportive content
(legend, scale, north arrow, location map, etc.).
When you prepare a map for presentation you should decide on the scale of the map
you want to produce on paper. The scale of the output map should be based upon
considerations, such as: the purpose of the map (regional planning versus detailed
design), the requirements of the map user, the contents of the map, the size of the
area mapped, the size of the output map (paper format), and the required accuracy.
Displaying data to be used in the final map
In ILWIS, the map making-process starts with the visualization of the mapped area
and the selection of the spatial and attribute data to be presented. You will first have
to investigate which data you want to display on your map as primary content (main
theme) and secondary content (base map information). Users should always be able
to locate themselves on a map, so each map should contain sufficient base map
information. On a large scale map, this base map information can be quite extensive
including contour lines, drainage lines, roads and other infrastructure, and the
location of villages and towns. On small scale maps, maybe only the main roads and
main towns can be displayed as base information. Putting too much base information
on a map is confusing.
It is possible to make use of one, or a combination of data layers (raster, segment,
polygon or point maps) to compile a final output map. In the Display Options dialog boxes, which appear just before a map is displayed in a map window, you can
specify how each map should be displayed.
The objective of the exercises in this chapter is to produce a complete land use map.
The first step of the preparation process for producing an output map in this exercise,
is to display the map Landuse. Visualization of the map area is an important stage
in the preparation of the map for final printing, since further planning of the layout
can only be decided after viewing the map. For example, by visualization you are able
to check whether enough space is available for annotation or whether the map area
has to be extended and whether the contrast between colors representing different
mapping units is satisfactory or not.
480
Presentation of results
In this exercise, the following data layers will be combined into a single map:
The polygon map Landuse : Forming the primary content. The map is displayed as
colored patterns.
- The point map Labels , containing text labels of the land use polygons.
- The raster map Shadows , containing the hillshading of the study area.
- The segment map Contour , containing the contour lines.
- The segment map Drainage , containing the drainage network.
- The segment map Roads , containing the road network.
- The point map Places , containing the location and names of the most important
locations in the area.
The various steps required to display maps and adding data layers to a map window
were explained in chapter 2.
The map Landuse is displayed in the map window. You can add several data layers
(polygon, segment and point maps) to this window, as long as they are using the same
coordinate system.
Add the other data layers mentioned above to this map window: the segment
maps Contour , Drainage and Roads , the point maps Labels and
Places , and the raster map Shadows . Always use the default parameters in
the Display Options - dialog boxes.
It is clear that the complete map may become difficult to read because if you use all
layers as they are the map will contain too much base map information. Especially
the contour lines are too densely spaced. Later on, you will make a selection of the
contour lines.
Close the map window when you have finished the exercise.
481
Presentation of results
13.2 Colors
One of the most important aspects in the design of presentable maps is the selection
of the most appropriate colors.
In ILWIS, the colors of objects are defined in the representation. In chapter 2 several
aspects of representations were already discussed.
Click with the right mouse button on representation Colors and select
Open from the context-sensitive menu. The Representation Class editor is
opened.
You will see a display of 20 colors. Every color may be seen as a combination of
different amounts of the primary colors: Red, Green and Blue (see Figure 13.1).
Figure 13.1: Color systems. Left: The RGB color system. Right: The HSI color system.
In ILWIS, you can work with three color systems (see Figure 13.1):
- The RGB (Red, Green, Blue) color system, which is used for display on most computer screens.
- The YMC (Yellow, Magenta, Cyan) color system, often used to describe the color of
an image produced by several hard copy devices.
- The HSI (Hue, Saturation, Intensity) color system, used for image processing.
In theory there is an infinite number of colors possible. ILWIS uses contributions of
each of the colors Red, Green and Blue in the range from 0 to 255. A value of 255
refers to the full intensity of a basic color.
The notation:
(0, 0, 0)
returns black,
(255, 255, 255) returns white,
482
(0, 0, 255)
(255, 255, 0)
returns blue,
returns yellow,
ILWIS 3.0 Users Guide
Presentation of results
(255, 0, 0)
(0, 255, 0)
returns red,
returns green,
(255, 0, 255)
(0, 255, 255)
returns magenta,
returns cyan.
Click on the color Yellow . You can see that the three slide bars on the lefthand part of the window change. Red will be 255 , Green will also be 255
and Blue will be 0.
Check the Red/Green/Blue components of the other 19 colors and close the
Representation Class editor afterwards.
Besides manipulation of colors in the representation of maps, ILWIS also has the
possibility to retrieve and/or assign colors in calculations. Calculations on colors
require maps or table columns with a color domain or a picture domain. You can also
see the color assignments of the items represented in the representation Colors in a
table.
Click in the Catalog with the right mouse button on representation Colors
and select Open as Table from the context-sensitive menu. The representation is now shown as a table.
Double-click the column header Color . The Column Properties dialog box
is opened. As you can see, column Color has domain Color .
Domain Color is a domain in which the colors are stored as Red, Green and Blue.
You can convert the colors as stated in the Color domain to the values of separate
Red, Green and Blue colors (or YMC or HSI as explained earlier) with a number of
statements (see Table 13.1).
Table 13.1:
CLRRED (colorexpr)
CLRGREEN (colorexpr)
CLRBLUE (colorexpr)
CLRYELLOW (colorexpr)
CLRMAGENTA (colorexpr)
CLRCYAN (colorexpr)
CLRGREY (colorexpr)
CLRHUE (colorexpr)
CLRSAT (colorexpr)
CLRINTENS (colorexpr)
By using one of these statements you can either convert the colors in a representation,
shown as a table, using map calculation formulas, or you can use them on a map with
a color domain or picture domain.
483
Presentation of results
Type the following formulas on the Command line and click OK each time
the Column Properties dialog box shows up:
Red = CLRRED(color)
Green = CLRGREEN(color)
Blue = CLRBLUE(color)
Yellow = CLRYELLOW(color)
Magenta = CLRMAGENTA(color)
Cyan = CLRCYAN(color)
Grey = CLRGREY(color)
Hue = CLRHUE(color)
Sat = CLRSAT(color)
Intensity = CLRINTENS(color)
Make the Command line appear in the table window by choosing the
Command Line from the View menu.
Now you can see the 20 colors of the representation, expressed in the components of
the three color systems explained earlier. The first three columns Red , Green and
Blue , are simply the same values as in the appropriate part of the column color. The
second group of three columns (Yellow , Magenta , and Cyan ) show the colors in
the YMC color system. Note that the calculation is made in the following way:
Yellow = 255 - Blue
Magenta = 255 - Green
Cyan
= 255 - Red
Next, there is a column showing the gray tones of the colors. The gray component is
useful when you want to produce a gray tone map out of a color map.
The last three columns (Hue , Sat , Intens ) show the values according to the HSI
color system:
- Hue is the direction of the color in a three-dimensional color cube;
- Saturation is the purity of the color;
- Intensity is the brightness of the color.
Note that the values for Hue, Saturation and Intensity range from 0 to 240, because
that is the standard HSI color range in Windows. For the exact conversion formulas,
see the ILWIS Help topic Color Separation.
484
Compare the values in the columns you have just calculated with the color
cubes in Figure 13.1 in order to get an idea of the three color systems.
Presentation of results
Hints for appropriate use of colors:
- For large areas in a map, the saturation of a color seemingly increases for the eye.
A color that looks okay in the legend may be too dominating in the map.
- Two rather similar colors can only be differentiated when they appear next to each
other in the map.
- Hues in the red-yellow region are said to be warm colors. Blue colors are said to
be cold.
- There are generally accepted color order scales. For example:
- Evidently: blue for water, green for vegetation, yellow for sandy areas.
- Some colors are more powerful and are used to indicate important features:
red for high hazard areas.
- To indicate increasing order scales, decreasing values are used: dark to light.
- It is not advisable to use more than 4 to 6 steps of the same hue.
- To indicate increasing positive and negative values use two base colors: red/yellow
& blue.
- The same colors are perceived lighter on a computer screen than on a paper map,
especially if you use high contrast and high brightness settings for your monitor.
485
Presentation of results
Presentation of results
- Identifier domains: Maps with domain type ID do not have a user-defined representation. They can be displayed:
- in 1, 7, 15, or 31 system colors via the Display Options - dialog box;
- by selecting a (class or value) column in the attribute table, e.g. in the Display
Options - dialog box.
- by calculating colors in a column with the color domain in the attribute table
(see paragraph 13.3.2).
In this paragraph you will edit visual variables through a representation. Table 13.2
shows for which type of maps and domains a representation is available. Identifier
domains and some system domains (Bit, Bool) do not have a stored representation on
disk. Editing visual variables if no representation is available will be discussed in
paragraph 13.3.2.
Table 13.2:
Type
Domain Class
Domain Identifier
Domain Value
Point map
Representation
Class
Stretched Symbols
Segment map
Representation
Class
1, 7, 15, 31 Colors
Representation
Value/Gradual
Polygon map
Representation
Class
1, 7, 15, 31 Colors
Representation
Value/Gradual
Raster map
Representation
Class
1, 7, 15, 31 Colors
Representation
Value/Gradual
For maps which use system domain Value , you can create a representation and
you can choose to work with either percentages (0-100%) or with values
(-99999.99 to 99999.99).
From the Edit menu, select the Representation command and select raster
map Landuse .
487
Presentation of results
The Representation Class editor (Figure 13.2) is opened. The tabs in this
representation editor can be used to see the colors for raster, polygon, segment or
point maps using this class domain. In the central part of this window, the class
names and their colors can be viewed. In the upper left part just below the Toolbar of
the window you will see the Color Selector and in the lower left part the Red,
Green and Blue Color Sliders are visible.
Figure 13.2: The Representation Class editor showing the Raster, Polygon, Segment and Point
tabs, the Color Selector (upper left part) and the Color Sliders (lower left part).
!
488
When you change the color of a class in a representation class, the color of this
class will also be changed in all other maps that use the same domain and thus the
same representation.
ILWIS 3.0 Users Guide
Presentation of results
Use the Red, Green and Blue Color Sliders to compose the correct color
for this class.
Move the Green (color) scroll bar to value 84 .
Move the Blue (color) scroll bar to value 84 .
Select the class Agriculture(irrigated) .
Change the colors to: Red = 0, Green = 176 and Blue = 20 .
Double-click the class Forest . The Edit Repr. Item dialog box is opened.
The selected class is shown as text at the top of the dialog box. The color list box
displays a number of pre-defined colors. If you want to select your own color, you
can click the Custom Color button; then the custom Colors dialog box appears. You
can also double-click Custom at the bottom of the list of colors.
The standard Windows Color dialog box (see Figure 13.3) provides another way to
create an appropriate color for a class. The pre-defined colors are shown in the group
Basic colors. You can make a new color by clicking the Define Custom Colors >>
button, dragging the cursor in the Color Refiner box, and adjust the brightness in the
bar next to it. You can also enter the color as values of Hue/Saturation/Luminosity
(=Intensity), or as Red/Green/Blue. When you are satisfied with a certain color, you
can press the Add to Custom Colors button: the new color will be added to the
selected box in the Custom colors palette.
489
Presentation of results
Now, you will edit the colors for the various mapping units.
Edit the Red, Green, and Blue colors of each class according to the colors in
Table 13.3.
Click the Redraw button in the map window to see the result.
Table 13.3:
490
Class
Color Name
Red
Green
Blue
Agriculture
Agriculture (irrigated)
Airport
Bare rock
Bare soils
Forest
Grassland
Lake
Riverbed
Shrubs
Urban centre
Urban periphery
Green
LimeGreen
Red
DimGray
LightGray
ForestGreen
Custom
Custom
Custom
Custom
Custom
Custom
0
0
255
84
68
48
159
0
182
106
195
129
255
176
0
84
168
128
255
146
182
126
35
40
0
20
0
84
168
76
0
255
255
0
35
0
Hatching polygons
Horizontal
Vertical
Upwards
Solid
Solid
Solid
Solid
Solid
Solid
Solid
Diagonal
Crossing
Presentation of results
Unit hatching
Besides colors, the Representation Class editor contains a number of hatching
types which can be used to represent units in a polygon map.
Add polygon map Landuse to the map window and switch off the raster
layer in the map window.
Note that there is now an extra option Hatching in the lower part of the dialog box.
With this option, you are able to select a hatching type and/or a background color for
a selected class.
Double-click the item Main river . The Edit Repr. Item dialog box is
opened. Change the Line width to 0.2 and the Color to Blue .
Change the Color of the item Drainage to Blue , and the one of the item
Lake to Cyan . Leave the Line width 0 for these two.
Click the Redraw button in the map window, look at the result and close the
Representation Class editor.
491
Presentation of results
Similarly, change the representation of the segment map Roads . Change the
Color of item Main roads to Red , Line Type to Double and the Line
width to 0.2 . Change the Color of Secondary road to Red .
Click the Redraw button in the map window and close the Representation
Class editor after you have seen the result.
The segment map Contour has a value domain Height , which also has a value
representation Height . However, we do not want to display the contour lines in
different colors. They should be shown in gray, and we want to display only the main
contour lines (those every 100 meters).
Drag-and-drop the segment map Contour to the map window. The Display
Options Segment Map dialog box is opened.
Select the check box Mask and type the following mask: ??00 . This will
result in the display of the 100 meter contour lines only.
Click the option Single Color and select the color Gray . Click OK.
Close the map window after you have seen the result.
492
Specify Symbol Square, Size 4, Fill Color Yellow, Line Width 1 and
Color Red for this point and click OK to see the result.
Presentation of results
Specify the symbol representation for the other points according to Table
13.4.
Close the map window when you have finished the exercise.
Table 13.4:
Symbol
Size
Cerveceria Taquina
Simple
Square
Yellow
Red
Cochabamba
Laguna Largon Mayu
Airport
Simple
Simple
Wingdings
Circle
Diamond
6
4
8
Red
White
2
2
Black
Blue
Red
Fill Color
Line Width
Color
You can also create an annotation text object (see section 13.4) which can be
based on a map. In this way you obtain all class names, IDs, or values of the
points in your map, while you can edit the exact positions, fonts, font sizes, etc. of
the texts later on in the Annotation Text editor.
In the Display Options Point Map dialog box, select the Attribute check
box, and select column Total .
493
Presentation of results
Accept the defaults for Symbol Type, Symbol, Fill Color, Line Width and
Color.
Select the Stretch check box and accept the default stretch range.
Click OK in the Display Options - Point Map dialog box. Point map
Rainfall is now displayed with a point radius proportionally to the total
annual rainfall.
Accept Linear and Radius for the stretch method and click OK in the
Symbol dialog box.
Drag and drop point map Rainfall into this raster map window. The
Display Options - dialog box of point map Rainfall is opened.
494
Presentation of results
The points are displayed as pie charts, showing the rainfall values per quarter. The
total size of each pie chart is proportional to the total annual rainfall at that location.
If you like, repeat the exercise and try other possibilities like Compose Bar and/or
Line Graphs.
User-defined coloring of maps with an ID domain
In general, maps with an ID domain are displayed with a system representation. Units
are represented in a fixed number of system colors (1, 7, 15 or 31 colors) that cannot
be assigned to specific map elements (domain items). However, in most cases, you
will wish to show an attribute value of the ID map.
In case, you really wish to show the mapping units as IDs themselves, you can use in
the attribute table of the ID map some table calculations: for each ID a different color
will be generated. The colors will be stored in an attribute column with the color
domain.
Every color may be seen as a combination of different amounts of the primary colors
Red, Green and Blue. The easiest way to create distinct colors for all domain items is
to use a formula that will assign random colors to the domain items. Another option
is to enter values for Red, Green and Blue manually. For more information, see ILWIS
Help, topic Table calculation, Calculations on colors.
In this exercise, you will create a user-defined representation for polygon map
Cityblock , which has an ID domain. You will create a new column with a color
domain in the attribute table, and calculate random colors for all city blocks. To
display the polygon map Cityblock with the new distinct colors, you need to select
the option Attribute Column in the Display Options Polygon Map dialog box.
495
Presentation of results
In the Column Properties dialog box accept Domain Color and click OK.
Type the following formula on the Command line of the table window:
Random:= COLOR(RND(255),RND(255),RND(255))
In column Random , you will see the newly calculated values Red, Green and Blue.
The formula returns a color composed by the random RND function, resulting in
random values for Red, Green and Blue (each ranging from 0 to 255 ).
You can now display polygon map Cityblock by its attribute column Random .
Polygon map Cityblock is now displayed with random colors for all map units. If
necessary, you can change individual colors manually. This map could be saved as a
map view and used to create a layout.
Presentation of results
symbols of a map with:
- Class domains: Colors and patterns can be assigned to the classes of the map.
- Value domains: For maps with a value domain you can have two types of representations:
- Representation Gradual, using percentage values as limits. This representation can be used to display maps with any value domain.
- Representation Value, using actual values as limits. This representation can
be used only for the user-defined value domain for which it was created.
- Identifier domains: Maps with domain type ID do not have a user-defined representation. They can be displayed:
- in 1, 7, 15, or 31 system colors via the Display Options - dialog box;
- by selecting a (class or value) column in the attribute table, e.g. in the
Display Options - dialog box.
- by calculating colors in a column with the color domain in the attribute table
(see paragraph 13.3.2).
- Editing visual variables of maps without a user-defined representation:
- Point maps with a value domain. For interpretation purposes, a point map with
a value domain can be displayed using a stretch option for the symbol size.
- Point maps with an ID domain. When the attribute table of an ID point map
contains comparable value columns of various categories, you can display the
points as:
- Single Symbol;
- Symbols by Attribute;
- Symbols as Arrows, or
- Symbols as Graphs.
- User-defined coloring of maps with an ID domain. If you prefer to display an
ID map in a user-defined way, instead of using system colors, you can calculate
for instance random colors in a column in the maps attribute table. The column
should use the color domain.
497
Presentation of results
498
Select the Light option and click OK in the Display Options Raster
Map dialog box. The map is displayed.
On the Toolbar of the map window, click the button Add Layer. The Add
Data Layer dialog box is opened.
Select the polygon map Landuse and click OK. The Display Options Polygon Map dialog box is opened.
Accept the defaults and click OK. The polygon map Landuse is added to
the list of data layers.
Click the Add Layer button again and select segment map Contour in the
Add Data Layer dialog box.
Click OK. The Display Options Segment Map dialog box is opened.
Select the Mask check box and type the following mask: ??00 .
Select the Single Color option and select the color Brown .
Click OK in the Display Options dialog box. The map Contour is now
displayed and added to the list of data layers.
Presentation of results
Add segment maps Drainage and Roads and point map Places to the
same map window; use default Display Options.
Now all added layers are displayed in the map window. Furthermore, all layers appear
in the Layer Management pane (left hand side of the map window).
Adding an Annotation Text layer
You can also add text layers by creating a new object called annotation text. An
annotation text layer is designed to display and store multiple texts at multiple
positions. An annotation text object can be based on an existing point, segment, or
polygon maps. If you do so, the text object will contain a text (class name, ID or
value) for each point, segment or polygon in the selected map. In the next exercise
you will create text labels for point map Places .
From the File menu in the map window, select Create and select
Annotation Text. The Create Annotation Text dialog box is opened.
Accept all other defaults and click OK. The Annotation Text editor is
opened.
Make sure the check box Based on Map is selected and choose point map
Places from the drop-down list box.
The Annotation Text editor allows you to edit text items stored in an annotation text
object. With the Annotation Text editor, you can:
- insert new texts and delete selected existing texts,
- move one or more selected texts to another position,
- make text duplicates, and
- specify fonts, sizes, colors, etc. for (multiple) selected texts.
In this case, we will only change the font and the font size of all text labels.
From the Edit menu, choose Select All. In the map window, you will see
that all the text labels are selected.
Click the right mouse button in the map window and select Edit from the
context-sensitive menu. The Edit Texts dialog box appears.
Select the Font Name Arial and type 8 for the Font Size.
Select Text Color Blue , deselect the Transparent check box, accept all
other defaults and click OK. The annotation text labels appear in blue on top
of the point symbols.
Move the text labels one by one to a position you like and click the Exit
in the Toolbar after you are satisfied with the result.
Editor button
499
Presentation of results
The text labels are displayed with the new font and font size. For more information of
using the Annotation Text editor, refer to the ILWIS Help.
Advanced users may prefer to edit an annotation text object in table form. This
may provide quicker, easier or more precise possibilities to edit texts, positions
and other settings like font, font sizes, colors, etc. To open an annotation text
object as a table, you can double-click the object in the Catalog or open the File
menu in the Main window, choose Open As Table and select an annotation text
object.
Grid lines are regularly spaced, horizontal and vertical on a map area, according to
the coordinate system linked to the map. In this exercise, grid lines are added to the
data layers in the map window.
From the Layers menu, select the Add Grid Lines command. The Display
Options - Grid dialog box is opened.
Type 5000 in the Grid Distance text box, accept Line Type Single and
select Yellow from the Color list box.
Click OK in the Display Options Grid dialog box. The grid lines are
added to the map window.
From the File menu in the map window, select the Save View As command.
The Save View As dialog box is opened.
500
Presentation of results
Summary: Map views
- A map view contains the names of all layers to be displayed in one map window
including the display settings (the colors, widths, etc.) of these layers.
- Besides data layers (maps), you can also add annotation text objects, grid lines or
graticules to a map window. These layers can also be saved in the map view.
- The title that you give to a map view, is later visible in the Title bar of the map
window. If you save a map view when zoomed in on a map, the zoomed area will
be displayed when opening the map view.
501
Presentation of results
From the File menu of the Main window, select Create, Layout. The Layout
editor is opened.
The Layout editor contains a Layout Management pane and a Layout pane. The
Layout Management pane lists the inserted layout items, showing their icon, name,
502
Presentation of results
position, size and scale. In the Layout pane itself, the paper and its margins are
visible.
You can also start to create a layout by choosing the Create Layout command
from the File menu in the map view window or by clicking the right mouse button
on a map view in the Catalog and choosing Create Layout from the contextsensitive menu.
In this stage of creating a layout, you can change the Page Setup and choose Paper
Size, Orientation (Portrait or Landscape) and Margins. The page setup can still
be changed later, if needed. You will alter the Orientation of the paper into
Landscape now.
From the File menu of the Layout editor, select Page Setup. The Page
Setup dialog box is opened.
Layout elements, such as map views, legend, scale bar, north arrow, etc., can be
added to the virtual paper using the Insert menu or by using the following buttons in
the Layout toolbar of the Layout editor:
to add a Map View
to add a Box
to add a Legend
From the Insert menu, select Map View. You can also click the Map View
button
in the Layout toolbar. The Insert Map View dialog box is
opened.
Select Landview and click OK. The Set Scale dialog box appears.
Change the scale into 1:150000 and click OK. The map view Landview is
now listed in the Layout Management pane and displayed in the Layout
pane.
503
Presentation of results
In the Layout pane, you can position the map view by dragging it, size the map view
by dragging one of its size handles or zoom in into a specific area and/or pan to the
desired area.
In the Layout pane, click the map view Landview , hold down the mouse
button and drag the map view to the left side of the paper (see Figure 13.4).
Before you can size or pan you must deselect the Keep Scale option by
opening the View menu and deselecting Keep Scale or by clicking the
Keep Scale button
in the Standard toolbar (the button should appear
up). Try to size and/or pan the map view, but in the end make sure to display
the entire map.
The same operation can be carried out in the Layout Management pane. Select a
field in the Layer Management pane and edit the value of the field: position, size,
scale, etc.
In the Layout Management pane, click the Scale field of the map view
Landview .
The map is now displayed on scale 1:125000 . For A4 paper size, this is a reasonable
scale to print the map later on. You can fix this scale.
Make sure the map view Landview is selected in the Layout pane.
From the View menu, select the Keep Scale command or click the Keep
in the Standard toolbar (the button should appear down).
Scale button
In principle, the scale of the map view is now fixed to 1:125000 . When the size
handles of a map view are dragged by accident, nothing will happen. When you make
the map view smaller by dragging its size handles to the inside the map view will
become smaller, but the scale on which the map view is displayed remains the same.
Only part of the map view will be shown.
You can still change the scale of the map view manually by typing a scale in the
Layout Management pane.
Creating a map border
With the Map Border option, you can add border information to a map, optionally
displaying: neat line graduation, grid and/or graticule ticks, grid coordinates, graticule and/or corner coordinates, map outline.
Here, you will add a neat line, grid ticks and grid coordinates to the map view.
504
Presentation of results
Make sure the map view Landview is selected in the Layout pane.
On the Grid tab, select the Grid Ticks check box and type 5000 for the
Interval and type 1.0 for the Tick Length.
Select the Grid Coordinates check box and type 5000 for the Interval.
From the Insert menu, select Map Border or click the Map Border button
in the Layout toolbar. The Edit Map Border dialog box is opened.
Creating a legend
A legend is created based on information available in the domain of a map in a map
view and the representation used by the domain. In this exercise, a legend is created
for the map Landuse and this legend is added to the map view Landview that is
displayed in the layout.
Make sure the map view Landview is selected in the Layout pane.
From the Insert menu, select Legend. You can also click the Legend button
in the Layout toolbar.
The Map Layer Selection dialog box is opened. It enables you to select a layer for
which the legend will be created.
Select polygon map Landuse and click OK. The Display Options
Legend dialog box is opened.
Repeat the previous steps to insert a legend for the Drainage and Road
data layers.
Accept the defaults for other display options by clicking the OK button. The
legend will be displayed in the Layout pane.
Drag the box to the right hand side of the layout (see Figure 13.4). Leave
some open space below the legend, so that the scale bar can be placed there.
505
Presentation of results
You can align the separate legend items by typing identical values for Left and/or
Top position in the Layer Management pane.
From the File menu, select Save As. The Save As dialog box appears.
Type Landview for the File name and click Save.
Figure 13.4: The land use map that will be made in this exercise.
506
Select the bitmap Bolivia and click OK. The Bolivia map is displayed in
the layout.
Presentation of results
Drag the Bolivia map and position it somewhere at the right hand side of
the layout (see Figure 13.4).
It is also possible to paste a picture from the Clipboard into the layout.
In Microsoft Paint, open the Edit menu and choose Select All.
Open again the Edit menu and choose the Copy command. The bitmap is
now copied to the Clipboard.
Activate the Layout editor and select the Paste command from the Edit
menu or use the Paste button
in the Standard toolbar. The ITClogo is
now pasted into the layout.
Adding text
In general, a map has a title, which gives a description of its contents. This exercise
shows how to create a title and how to position it in the layout.
From the Insert menu, select the Text command or click the Text button
in the Layout toolbar of the Layout editor. The Edit Text dialog box is
opened.
If you select in the Edit Text dialog box the option Transparent, the background
color of the text area (white) will not be shown. This is important when the text has to
be placed on mapping units.
507
Presentation of results
The position of the text and the size of the text can be changed. The text box size can
be changed by dragging one of its size handles. You can size the text in both directions
by dragging the corner size handles of the text box. To change the position of the text:
You can now add other texts: for the inset map of Bolivia, and to display the author
name.
Choose the Font Name: Times New Roman use Font Size: 12 .
Select the Bold check box and click OK.
In the Layout pane select the text box and position it at the top of the inset
map of Bolivia (see Figure 13.4).
Repeat these steps to add the text Cochabamba to the inset map of Bolivia.
Select Font Color White , Font Name Arial and Font Size 8 and select
the Transparent check box.
Insert also the word Bolivia and the Author Name and drag them to the
correct position.
508
Make sure the map view Landview is selected in the Layout pane.
Position the arrow below the title of the map (see Figure 13.4).
From the Insert menu, select North Arrow or click the North Arrow button
in the Layout toolbar. The Edit North Arrow dialog box is opened.
Select Font Name: Times New Roman , Font Size: 14 and click OK. The
north arrow is displayed in the layout.
Resize the north arrow and make it smaller.
Save the layout.
ILWIS 3.0 Users Guide
Presentation of results
Adding a scale bar
Map scale is a ratio indicating the relationship between the distance on the map and
the distance on the ground. In ILWIS, the map scale can be expressed in the following ways:
- Graphically in the form of a scale bar
- As scale indication (e.g. 1:50000)
Make sure the map view Landview is selected in the Layout pane.
Position the scale box below the land use legend (see Figure 13.4).
From the Insert menu, select Scale Bar or click the Scale Bar button
the Layout toolbar. The Edit Scale Bar dialog box is opened.
in
Select Font Name: Times New Roman , Font Size: 10 and click OK. The
scale bar is displayed in the map window.
Save the layout.
Make sure the map view Landview is selected in the Layout pane.
From the Insert menu, select Scale Text or click the Scale Text button
in the Layout toolbar. The Edit Scale Text dialog box appears.
Select Font Name: Times New Roman , Font Size: 12 and click OK. The
scale text is displayed in the layout.
Position the scale box below the map view or below the scale bar and save
the layout.
Creating a box
Finally, you will add a box to the map window that encloses the entire map. Boxes
can be used to emphasize certain annotation (e.g. text, legend, etc.), highlight certain
areas, emphasize features, etc.
From the Insert menu, select Box or click the Box button
toolbar. The Edit Box dialog box is opened.
Accept the defaults by clicking the OK button. A box is added to the map.
in the Layout
Position the box close to the legend and resize it so that it encloses the whole
legend (see Figure 13.4).
509
Presentation of results
Repeat the steps to create a box for the entire layout. Make sure the box is
within the page margins.
Double-click the north arrow in the Layout pane. The Edit North Arrow
dialog box is opened.
Existing annotation can be removed from the layout using the mouse together with
the Del key of the keyboard or the Remove command on the Edit menu. You can
also click on the Remove button
in the Standard toolbar. To remove an
annotation layer:
in the
Presentation of results
- Text: multiple lines of text (e.g. a title); select a font type and color for the created
text.
- North-arrow: showing the north orientation of a map from the georeference or
coordinate system that is used by a map view.
- Scale bar: adds a graphic scale (scale bar) to the layout. The type of scale bar, intervals, font and colors are user-defined.
- Scale text: to obtain a scale indication as text in the layout. For each map view in
your layout, you can add a distinct scale indication.
- Box: can be placed around an annotation item.
The total composition of map views and annotation on a certain paper size is stored
as a layout and can be printed.
511
Presentation of results
From the File menu, select the Page Setup command. The Page Setup
dialog box is opened.
Still in the Page Setup dialog box, click the Printer button. The Page
Setup dialog box is opened. Make sure the correct printer is selected and
click OK.
Click OK in the Page Setup dialog box.
From the File menu, select the Print command. You can also use the Print
button
in the Standard toolbar. The layout is now printed.
If you change the paper size or orientation of the paper, you may have to
rearrange all items in the layout.
512
Presentation of results
From the File menu of the Main window, select the Export command. The
Export dialog box is opened.
From the File menu of the Main window, select the Export command. The
Export dialog box is opened.
513
Presentation of results
For polygon maps the situation is more complex, due to topological differences
between a GIS and a cartographic system. In ILWIS there is only one segment as
boundary line between two polygons, while in most cartographic packages it is
assumed that each polygon is enclosed by boundary lines, so there are in fact two
lines forming the boundary of two polygons. During the conversion of a polygon map
to DXF format, each polygon will be made so that it is enclosed by boundary lines.
From the File menu of the Main window, select the Export command. The
Export dialog box is opened.
If you want to show any ILWIS information e.g. as a picture, or even the data (tables)
in any other Windows application, you can always try to use the Copy in ILWIS and
Paste in the other package. In this way a map, table, etc. can be easily pasted into for
instance Microsoft Word or Power Point. To copy a whole window including
borders, Layer Management pane, etc., use Alt + PrintScrn in ILWIS.
Use the Export to Bitmap option in the File menu of a Layout window to export
the layout to a Windows bitmap.
514
Presentation of results
515
Presentation of results
If you want to show the photos in ILWIS map windows then the first thing that
should be done is to import the TIF Files. If you just leave the TIFF files as they are
and use them straight away in an attribute table probably a program like PhotoShop,
PaintShop, Windows Paint or even Internet Explorer may be used to open the
pictures.
From the File menu of the Main window, select the Import, General Raster
command. The Import dialog box is opened.
Select the Import Format: Tagged Image File Format .TIF. The list
of TIF files appears in the list box.
As you can see the last photo (Photo9 ) is rotated. To rotate it into the normal
position you can use the operation Mirror Rotate.
Click the map Photo9 with the right mouse button and select the commands
Raster Operations and Mirror Rotate from the context-sensitive menu. The
Mirror Rotate dialog box is opened.
Click OK. The map is rotated and the result is displayed. Close the map window.
The next step is to create a map view for each photo. The advantage of a map view is
that it will be displayed without showing first a Display Options - dialog box, since
the display options are already stored in the map view. Another advantage of using
map views is that you can give each map view a descriptive title, which will be
shown on the Title bar. You can also switch off Display Options - dialog boxes in
the Preferences (available via the File menu in the Main window).
516
Open the map Photo1 . Select from the File menu the Save View command.
The Save View As dialog box is opened.
Type the Map View Name: Photo1 , and the Title: Country school in
the mountains .
Presentation of results
Table 13.5:
View
Title
Photo1
Photo2
Photo3
Photo4
Photo5
Photo6
Photo7
Photo8
Photo9r
Now the photos are finished. The next step is to adapt the file with the location of the
photos. This is a point map, with the name Photos .
Double-click point map Photos . The Display Options Point Map dialog
box is opened.
Click OK. You are back in the Display Options - dialog box.
Select the Font: Times New Roman , the Font style: Bold , and the Size:
12 .
Click OK. You are back in the Display Options Point Map dialog box.
In the Symbol dialog box, select the Symbol Type: Simple , the Symbol:
Circle , the Size: 4, the Fill Color: Red , Line Width: 1 and the Color:
Red .
Select the Text check box and press the Font button. The Font dialog box
appears.
Select the Text Color: Red and click OK in the Display Options - dialog
box. The point map is displayed.
Drag-and-drop raster map Shadows to the map window. The Display
Options dialog box is opened. Select the option Light and click OK. The
hillshading map is now also displayed in the map window.
From the File menu select the Save View As command. The Save View As
dialog box is opened.
Type the Map View Name: Photos , the Title: Photos from the
Cochabamba area and click OK.
The next step is to create a table that is linked to the point map Photos and which
contains a column Action , in which the names of the map views of the photos are
written.
517
Presentation of results
In the Operation-tree of the Main window, expand the Create option and
double-click New Table. The Create Table dialog box is opened.
Enter the Table Name: Photos , select the Domain Photos and click OK.
The table is opened.
From the Columns menu in the table window, select the command Add
Column. The Add Column dialog box is opened.
Type the Column Name: Action , select the Domain String and click
OK.
Type the names of the map views in the column Action , including the
extension. So for the first record, with the domain item Photo1 , you type
Photo1.mpv in the column Action . Make sure that the name of the last
field in column Action reads: Photo9r.mpv. The extension .mpv stands
for map view.
Make sure that the Attribute Table check box is selected, select the table
Photos and click OK.
Click the point map Photos with the right mouse button and select
Properties. The Properties sheet is opened.
Now all input data is ready, so you can do the actual demo.
Double-click on any of the red dots, to see the map view of the photos. The
explanation of each photo is shown in the Title bar.
Make sure to close all map windows when you have finished the exercise.
From the Layers menu, select Double-Click Action and select the option:
Execute Action.
You can use this method also for segment, polygon or raster maps (domain type class
or ID) which have an attribute table where the files are listed that should be opened
with a double-click in the class or ID unit.
Creating a slide show
The second example of the preparation of a demo with ILWIS is the creation of a
slide show that can be used to display multi-temporal maps, in order to evaluate
changes through time. The operation Slide Show is meant for this purpose.
In a slide show, a map window shows multiple raster maps like a slide show. It is in
fact the same as repeatedly replacing the raster map in a map window, e.g. by
dragging the raster maps into the map window. The raster maps to be displayed must
all be stored in a map list.
518
Presentation of results
A map list is a container object and stores the names of a set of raster maps, for
example of the multi-spectral bands of a satellite image that you want to classify. A
map list may also store the names of several raster maps of a time series, which you
can display as a slide show.
In the slide show only one set of display options will be used. The defaults are based
on the first map in the map list. The parameters set for this map in the map list, also
define the display options for the other maps in the map list. So, a constraint of
using a slide show is that all maps in the map list must use the same domain and the
same georeference.
The Slide Show operation is useful for multi-temporal monitoring, where data
regarding a site is collected on more than one occasion. It can, for example, be used
for observing a series of satellite images of the same area in time, derived products
such as NDVI, or classified maps, such as land use maps. In this way you get a clear
view of the general changes in time.
In this example, you will work with multi-temporal maps showing the growth of the
city of Manizales, located in central Colombia, with a set of 7 maps from 1851 till
1989. In order to show these maps as a slide show, you should first create a map list,
containing the names of these maps.
From the File menu of the Main window, select the Create and the Map List
commands. The Create Map List dialog box is opened.
Accept the defaults and click OK. The Display Options - Map List dialog
box is opened. In this dialog box you can change the Refresh Rate, indicating how many times per minute the display will be changed.
519
Presentation of results
Now the maps are displayed in the map window one by one, so that you can evaluate
the changes quite easily. You can change the refresh rate, to make the display slower
or more rapid.
When you have finished watching the slide show, close the map window.
520
Index
3D
Details: 8
Distance: 304
Entire map: 18
ILWIS: 8
Keep scale: 504
Layout editor: 502
Border: 503
Box: 503
Graticule: 503
Grid Lines: 503
Legend: 503
Map view: 503
North arrow: 503
Picture/Bitmap: 503
Scale bar: 503
Scale text: 503
List: 8
Measure Distance: 19
Normal: 19
Options: 15
Pan: 18, 212
Record: 23
Zoom In: 18
Zoom Out: 18
3D: 405
Display: 405
Editor: 405
Model: 405
View: 388, 405, 410
Adding vector layers: 411
With raster draping: 410
A
ACE: 513
Action column: 515
Add
Annotation Text: 499
Data layer: 498
Grid lines: 500
Inset map or picture: 506
Text: 507
Affine transformation: 76, 81
Aggregate functions: 193
Anisotropic Kriging: 445
Anisotropy: 448
Annotation: 502, 510
Annotation Text: 499
ArcInfo .E00 format: 123
Area numbering: 352, 379
Areas: 28
Arithmetic operators: 178, 321
Aspect: 128, 365
Assignment symbol: 176, 318, 463
Attribute data: 13, 53, 71, 167
Attribute map: 293
AutoCad .DXF format: 123
Autocorrelation
Of point data: 424
Of raster maps: 454
Autocorrelogram: 425
Axis of anisotropy: 448
B
Bar graph: 494
Bicubic convolution: 246
Bilinear interpolation: 246
Binary filter: 356
Boolean statement: 288
Box: 509
Box classifier: 271
Break dependency link: 68
Button: 212, 304
Create: 14
Customize Catalog: 5
C
Calculating: 176, 302, 365, 397
Classified slope direction map: 365
Connectivity: 381
Distance with weights: 374
Distances: 375
Histogram: 219
Number of points: 302
Pocket line calculator: 177
Receiving cell map: 366
Segment density: 309
Slope shape: 397
With columns: 176
With value columns: 177
Catalog: 3, 58
Customizing: 5
Query: 58
Sort: 58
View: 58
Details: 58
List: 58
Cauchy-Schwarz inequality: 450
Check Up-to-date: 66
Check box: 15
Checking segments: 104
Class: 34, 37
Domain: 20, 34, 37, 486
Map colors: 487
Representation: 43
521
Index
Classification: 187, 262, 271
Box classifier: 271
Gaussian maximum likelihood classifier: 271
Minimum distance-to-mean classifier: 271
Minimum Mahalanobis distance classifier: 271
Post classification operations: 273
Supervised: 266
Unsupervised: 266, 275
Classify table: 296
Classifying data in a column: 187
CLFY function: 187, 300
Clipboard: 318, 458
Copy/paste information: 318
Clustered pattern: 420
Clustering: 275
Cochabamba: 26
Code consistency: 102
Codes: 39
CoKriging: 450
Color
Selector: 488
Sliders: 488
Color composite: 230
False color: 230
Interactive: 231
Permanent: 233
Pseudo natural: 230
Colors: 482
Assigning colors to a class map: 487
For maps with an ID domain: 495
Hints: 485
HSI color system: 482
RGB color system: 482
YMC color system: 482
Column: 176
Action: 515
Properties dialog box: 23
Column semi-variogram: 439
Column statistics: 189
Command line: 9, 318
Copy/paste: 318
Working from the: 458
Commands: 457, 459
Copying ILWIS objects: 459
Deleting ILWIS objects: 459
Help: 459
Opening or editing an ILWIS objects: 459
Complete spatial randomness: 420
Composed bar: 494
Concatenation operation: 195
Conditional function: 180, 324
Confidence interval: 443
Conformal transformation: 81
Conformality: 129
522
Index
Cubic convolution: 246
Customize segment editor: 97
D
Data: 28, 71, 146, 279
Add layer: 498
Analysis: 70
Attribute data: 53, 71
Combining layers: 498
Conversions: 146
Export: 513
Geographic: 70
Input: 70
Layer: 33
Management: 70
Objects: 30
Dependent: 64
Output: 70
Redundancy: 195
Retrieval: 279
Spatial data: 28, 71
Dead end in segment: 105, 108
Default values tab: 469
Defaults: 15
Definition symbol: 176, 318, 463
Deleting
Files: 459
Point: 87
Segment: 99
DEM: 387, 390
Demos: 515
Densify segment coordinates: 142
Density slicing: 262
Dependency: 60, 63, 332
Break: 68
Links: 60, 334
Dependent: 64, 155, 176
Columns: 176
Data objects: 64
Map: 155
Details View: 58
Determining flat areas in a DEM: 367
DFDX: 396
DFDY: 396
Dialog boxes: 14
Digital Elevation Model: 387, 390
Digital Terrain Model: 387
Digital Number: 209, 213
Digitizer: 71, 73
Control points: 80
Coordinates: 73, 76
Resolution: 71
Setup Wizard: 75
Digitizing: 71, 80
Contour lines: 101
In point mode: 88
In stream mode: 88
Points: 83, 85
Segments: 92
Dilation: 353
Directional filter: 227
Displaying: 31, 100, 206, 282, 405
3D: 405
Attribute data: 21, 282
Data to be used in the final map: 480
Feature spaces: 270
Geographic data: 13
Multiple images: 212
Results as graphs: 206
Satellite images: 211
Segments in different colors: 100
Vector and raster maps: 31
Distance: 304, 352
Between points: 304
Calculation: 352, 372, 373, 374
Inverse: 430
Limiting: 430
Nearest neighbour: 421
Operation: 372
Domain: 20, 32, 151, 187, 296
Class: 20, 34, 37, 486
Combinations: 151
Conversion: 159
Editor: 20, 38
Group: 187, 296
Identifier: 34, 37, 39, 487
Image: 32, 37, 210
Value: 35, 37, 40, 486
System-defined: 41
User-defined: 41
Double-click action: 515
Drainage density: 343
Drop-down list box: 14
DTM: 387
E
Editing: 86, 154, 172
Annotation: 510
Columns: 172
Points: 86
Polygons: 112
Raster maps: 154
Editor: 20, 85, 405
Domain Class: 20
Georeference 3D: 405
Script: 468
Ellipsoid: 126
Empirical semi-variogram: 436
523
Index
Entities: 13
Equidistant: 129
Equivalence: 129
ERDAS
GIS: 120
LAN: 120
Erosion: 353
Error map: 435, 441
Estimation
Kriging: 435, 441
Export
To Bitmap: 514
Maps: 513
Expressions: 457
Map and table calculation: 463
Extract boundaries: 146
F
False Easting: 130
False Northing: 130
Feature space: 270
Feature vector: 266
File Extensions: 460
Files
Copying: 459
Deleting: 459
Filter: 222, 223, 396
Binary: 353, 356
Counting: 353, 358
Directional: 227
Gradient: 223, 396
High pass: 223, 226
Laplace: 223, 226
Low pass: 223, 224
Majority: 274, 353
Rank order: 353, 356, 399
Smoothing: 353, 355
Spatial frequency: 222
Undef majority: 274, 354
User-defined linear: 358
Filtering: 352, 353
Filters
Applied on Digital Elevation Models: 395
Used to calculate internal relief: 399
Flow direction matrix: 366
Focal point: 406
Functions: 182, 324, 364, 474
Contiguity: 381
IFF function: 182, 324, 328, 335, 474
IFUNDEF function: 330
MinMax: 475
Neighbourhood: 364
Network: 381
Pre-programmed: 474
524
Proximity: 381
Random: 474
RND: 496
Seek: 381
Spread: 381
System-defined: 474
User-defined: 475
G
Gaussian maximum likelihood classifier: 271
Gearys c: 424
Geo-coding a raster image by resampling: 245
GeoGateway: 118
Geographic
Coordinate system: 126
Coordinates: 48
Data: 70
Geometric
Corrections and image referencing: 235
Distortions: 235
Georeference: 50, 236, 405
3D: 237, 405
Corners: 50, 236
Direct linear: 237
Orthophoto: 237
Tiepoints: 50, 236
Georeferencing: 236
A raster image using reference points: 238
Image-to-image: 242
Using corner coordinates: 236
Geostatistics: 417
GeoTiff format: 120
Glue
Raster maps: 151
Segment maps: 140
Goodness of Fit: 439
Gradient filter: 223, 396
Gradual representation: 486
Graphs: 206
Grid
Cells: 29
Lines: 500
Gridding: 417
Ground control points: 239
Ground truth: 267
Group domain: 187, 296
H
Hatching: 491
Haze correction: 217
Help: 9
High pass filter: 223, 226
Index
Hill shading map: 388, 395
Histogram: 217
Equalization: 217, 222
Of point maps: 302
Of polygon maps: 312
Of raster maps: 313
Of segment maps: 307
History: 3
HTML Help: 10
Hue: 484
Hypotenuse: 401
I
Identifier domain: 34, 39, 487
IDRISI
IMG: 120
IFF function: 328, 335
IFUNDEF function: 330
IKONOS: 120
ILWIS
Functions: 319
Help: 9
Icons: 11
Log file: 461
Objects: 11, 118
Extensions: 460
Image: 32
Arithmetics: 257
Classification: 262
Domain: 32
Enhancement: 217
Fusion: 258
Processing: 209
Ratios: 249
Image-to-image registration: 242
Import: 118, 174
Genuine: 118
Raster data: 119
Through General Raster import: 121
Through GeoGateway import: 120
Through ILWIS import: 119
Table Wizard: 174
Use As: 118
Vector data: 123
Through GeoGateway import: 124
Through ILWIS import: 123
Via GeoGateway: 118
Importing
Digital attribute data: 174
Digital data: 118
Indicator Kriging: 444
Input of Spatial data: 71
Insert Mode: 85
Intensity: 484
J
Joining tables: 198, 200, 202, 203, 465
K
Kriging: 435
Anisotropic: 445
CoKriging: 450
Estimation: 435, 441
From raster: 456
Indicator: 444
Ordinary: 435
Simple: 443
Universal: 444
L
Laplace filter: 223, 226
Latitudes: 48
Layer management: 16, 33
Layout: 502
Adding
Box: 509
Inset map or picture: 506
Legend: 505
Map border: 504
Map view: 503
North arrow: 508
Scale bar: 509
Scale text: 509
Text: 507
Copy and paste via Clipboard: 506
Creating: 502
Editor: 502
Page Setup: 503
Toolbar: 503
Export to Bitmap: 514
Least Squares Fit: 191, 431
Colomn operation: 191
Graph: 191
Legend: 505
Limiting distance: 430
Line graph: 494
525
Index
Linear stretching: 217, 220, 265
Piece-wise: 265
Lines: 28
Link: 53
Map with a table: 53
Non-spatial: 53
Links: 334
Dependency links: 334
List View: 58
Log file: 461
Logical operators: 179, 323
Longitudes: 48
Low pass filter: 223, 224
M
Main window: 2
Catalog: 3
Command line: 9
Menu bar: 6
Navigator: 2
Object selection toolbar: 8
Operation-list: 6
Operation-tree: 6
Operations/Navigator pane: 6
Standard toolbar: 8
Status bar: 7
Title bar: 5
Majority filters: 274, 353
Make up-to-date: 66
Map: 29, 73, 126, 257, 307, 318, 365
Annotation: 502
Border: 504
Calculation: 257, 318, 463
Script example: 464
Confidence interval : 443
Coordinates: 73
Cross: 341
Displaying maps: 31
Editing raster maps: 154
Editing annotation: 510
Error: 435, 441
Exporting: 513
Hill shading: 388, 395
Point map: 29, 486
Polygon map: 29, 486
Printing: 512
Projections: 48, 126, 128
Azimuthal: 128
Conical: 128
Cylindrical: 128
Raster map: 29, 486
Referencing: 76, 81
Scale: 509
Segment map: 29, 486
Shadow: 388
526
Index
Moving
A point: 86
Average: 430
Surface: 432
Multi-band
Images: 230
Operations: 249
Statistics: 252
Multi-spectral image classification: 266
N
Navigator: 2
NDVI, Normalized Difference Vegetation Index: 250
Nearest neighbour: 428
Distance: 421
Reflexive: 421
Nearest point interpolation: 428
Neighbourhood: 351
Functions: 364
Multiple neighbours: 363
Operations: 351
4-connected: 351
8-connected: 351
Connectivity: 351
Filtering: 353
Using map calculation: 361
Operators: 352
Single neighbour: 361
Nested IFF function: 328
Network function: 381
Node: 29, 88
Normalized Difference Vegetation Index (NDVI): 250
North arrow: 508
Nugget: 438
O
Object: 30
Collection: 118
Definition: 64
Definition file: 67
Extensions: 460
Properties: 60
Selection toolbar: 8
Types: 30
Objects: 30
Container objects: 30
Data objects: 30
Service objects: 30
Special objects: 30
Oblique: 128
Open as table: 483
Operation-list: 6
Operation-tree: 6
P
Page setup: 503, 512
Parallels: 126
Parameters tab: 468
Paste information from clipboard: 318
Path radiance: 217
Pattern
Analysis: 420
Clustered: 420
Random: 420
Regular: 420
PCI Geomatics: 118
PI: 477
Picture elements: 29, 209
Pie chart: 494
Piece-wise linear stretching: 217, 265
Pits in a DEM: 367
PIX format: 125
527
Index
Pixel: 29, 55, 155, 215, 279, 365
Editor: 155
Information window: 55, 279
Pixels and real world coordinates: 215
Point: 28, 84, 303, 392
Change position: 98
Deleting: 87
Density: 303
Digitizing: 85
Distance between points: 304
Editor: 84
Estimation: 435
In polygon operation: 305
Intermediate: 29, 88
Interpolation: 428
Moving average: 430
Nearest point: 428
Trend surface: 431
Map: 486
Visual variables: 492
Moving: 86
Pattern analysis: 420
Symbol: 493
Point mode: 88
Points as graphs: 494
Polygonization: 111
Polygon: 29, 104, 312
Editing: 112
Histogram: 312
Map: 104, 486
Unit hatching: 491
Post classification operations: 273
Predictand: 450
Presentation of results: 479
Principal components analysis: 254
Printing: 512
Layout: 512
Page setup: 512
Projections: 73, 130, 131, 247
Available in ILWIS: 131
Azimuthal: 131
Conformality: 129
Conical: 132
Cylindrical: 131
Dutch RD: 247
Equidistant: 129
Equivalence: 129
Lambert Azimuthal Equal Area: 130
Other: 132
UTM: 134
Propagation: 368
Properties: 129
Property sheet: 60
Proximity function: 381
528
R
Random function: 496
Range: 438
Range of influence: 426
Rank order filter: 356, 399
Raster: 29, 150
Data: 150
Management: 150
Map: 29, 486
Model: 29
To vector conversion: 156
Rasterization: 29, 148
Of a polygon map: 148
Reclassification: 287, 289, 293
Record View: 23
Reflexive Nearest Neighbour: 421
Regionalized variables: 417, 435
Regular pattern: 420
Relational operators: 179, 322
Release disk space: 67
Remotely sensed data
Remove false polygon: 107
Renumbering: 54
Representation: 43, 230
Class: 43
Colors: 482
Gradual: 486
System-defined: 45
Types: 44
Value: 44, 486
Resampling: 153, 236
Residuals: 77
Resolution of digitizer: 71
Retrieval: 279
Operations: 279
With a mask: 284
RGB transformation: 258
RND function: 496
Root Mean Square Error (RMSE): 235, 239
Rose diagrams: 309
Rotate: 152
Running scripts: 461, 471
S
Sample: 267
Set: 267
Statistics: 269
Sampling: 267
Saturation: 484
Scale
Bar: 509
Box: 16
Index
Factor: 449
Keep scale: 504
Text: 509
Scripts: 461
Correct script syntax: 461
Creating: 458, 461
Example
For Map Calculation: 464
For Table Calculation: 465
In scripts: 471
Parameters: 468
Running: 461, 471
Special language: 472
Scrolling: 212
Seek function: 381
Segment: 29, 88, 307, 390
Color: 491
Density: 309
Directions: 309
Editor: 97
Histogram: 308
Line
Type: 491
Width: 491
Map: 88, 307, 486
Digitizing: 88
Measurement operations: 307
Visual variables: 491
To raster conversion: 390
Select mode: 85
Self overlap: 105
Semi-variogram
Empirical: 436
Modelling: 438
Nugget: 438
Range: 438
Sill: 438
Service objects: 30
Setup digitizer: 75
Shadow map: 388
Sigma: 80, 235, 239
Sill: 438
Simple Kriging: 443
Slave image: 242
Slicing: 263, 264, 296
Slide show: 518
Slope: 365, 388
Aspect: 388, 403
Convexity/concavity map: 388
Direction: 365, 388, 403
Map: 401
Shape: 397
Steepness: 388, 397
Smoothing filter: 355
Snap tolerance: 97
Snapping: 88, 96
Source map: 372, 374
Spatial: 28, 71, 117, 222, 277, 317, 351
Autocorrelation: 424, 454
Correlation: 424, 436
Bidirectional: 424, 447
Omnidirectional: 424
Data: 13, 28, 71
Input: 71
Data analysis: 277, 317, 351
Advanced: 457
Geostatistical tools: 417
Neighbourhood and connectivity: 351
Overlay operations: 317
Data management: 117
Enhancement: 222
Frequency filters: 222
Special objects: 30
Spheroid: 126
Split bar: 22
Split/Merge mode: 90
Spread function: 381
Standard toolbar: 8
Statistics: 189, 190
On columns: 189
Pane: 22, 189
Using the command line: 190
Status bar: 7
Stream mode: 88
Stretching: 493
Sub map: 140
Surface
Moving: 432
Trend: 431
Variogram: 445
Symbol: 176, 318, 493
Assignment: 176, 318, 463
Definition: 176, 318, 463
Symbols as graphs: 494
System-defined: 41
Functions: 474
Representation: 45
Value domain: 41
T
Table: 170, 176, 346
Calculation: 176, 463
Formulas: 176
Script example: 465
Joining: 198, 465
Two-dimensional: 346
Window: 21
529
Index
Split bar: 22
Statistics pane: 22
Table viewer: 22
Text box: 14
Thiessen map: 376
Thiessen polygons: 428
Three dimensional view: 388
Title bar: 5
Toolbar
Object selection: 8
Standard: 8
Training phase: 267
Transformation: 76, 235
Affine: 76, 81
Conformal: 81
Transforming vectors: 138
Transverse aspect: 128
Travel time map: 374
Trend surface: 431
Truth tables: 329
Tunnel
Segments: 89, 143
Tolerance: 97
Two-dimensional table: 346
U
Undef majority filter: 274, 354
Undefined: 38, 328
Undo all changes: 85
Unique IDs: 307, 379
Universal Kriging: 444
Universal Transverse Mercator (UTM): 48, 134
Unsupervised classification: 275
User-defined: 41, 358
Coloring maps with an ID domain: 495
Functions: 475
Linear filters: 358
Value domains: 41
UTM: 134
Grid zone designations for the world: 135
V
Value: 35, 40, 177
Columns: 177
Domain: 35, 40
System-defined: 41
User-defined: 41
Representation: 44, 486
530
Variogram: 426
Cross: 450
Empirical: 436
Modelling: 438
Surface: 445
Vector: 28, 140
Data: 140
Management: 140
Masking: 142
Map: 29
Model: 28
Operations: 144
View: 405
3D view: 405
Angle: 406
Axis: 406
Point: 405
Record view: 23
Table view: 23
Visual variables: 486
Maps without a user-defined representation: 493
Point maps: 492
Segment maps: 491
Segment color, line type and line width: 491
Visualization
Multi-band images: 230
Single band images: 210
Volume
Cubes: 494
Map: 388
Voronoi Tesselation: 428
W
Weight
Factor: 375
Map: 372, 375
Windows: 119
Bitmap format (BMP): 119
Color dialog box: 489
WinTab: 75
Digitizer Setup Wizard: 76
Z
Zooming
In: 92, 211
Out: 211