Professional Documents
Culture Documents
Ilwis User Guide30 PDF
Ilwis User Guide30 PDF
Ilwis User Guide30 PDF
0 Academic
User’s Guide
May 2001
© ITC-ILWIS, May 2001
ITC
The International Institute for Aerospace Survey and Earth Sciences, Enschede, is the largest institute
for international higher education in the Netherlands. Its main objective is to assist developing
countries in human resources development in aerospace surveys, Remote Sensing applications, the
establishment of geoinformation systems and the management of geoinformation. To this end, ITC
concentrates on three activities: education/training, research and advisory services. In-house expertise
covers an extensive range of disciplines in the above fields.
Disclaimer
The International Institute for Aerospace Survey and Earth Sciences (ITC) has carefully prepared and
reviewed this document, the software and the data set on CD-ROM for accuracy. However, ITC takes
no responsibility or liability for incidental or consequential damages arising from the use of this
document or the data on the accompanying CD-ROM and reserves the right to update, revise, or
change this document or the data without notice.
Proprietary Notice
The information in this document is the sole property of the International Institute for Aerospace
Survey and Earth Sciences (ITC) and may not be reproduced, stored in a retrieval system or transmitted
in any form or by any means: electronic, photocopying or otherwise, without permission in writing
from ITC.
Contact adresses
This ILWIS 3.0 User’s Guide has been rewritten and extended by Raymond Nijmeijer
(chapters 1, 2, 6, 7, 8, 10, 11), Arend de Haas (chapters 3, 4, 5, 13) and Remco Dost
(chapters 9 and 12). Raymond Nijmeijer made sure all chapters were properly finalized.
Petra Budde guided the authors and proofread all chapters. Raymond Nijmeijer and
Petra Budde are responsible for the entire contents of this book.
We would like to thank Iris van Duren for providing additional data for chapter 5, and
Alfred Stein and Ambro Gieske for providing geostatistical data for chapter 11. All data
for the ILWIS 3.0 User’s Guide has been checked by Jelger Kooistra and the exercises
were tested by Boudewijn van Leeuwen and André Nagelhout. We are indebted to
Henk Scharrenborg of Composer DTP Service who preprocessed the whole User’s Guide
before printing and we thank Andries Menning for the cover design. Hendrik Prins and
Lyande Eelderink are acknowledged for their coordination efforts to get this book
published.
Finally, we like to thank the following persons and organizations for providing data:
Shilpam Pandey (urban data), Carlos Valenzuela, Rolando Mora Chinchilla (geomorpho-
logical data, contour data), Dr. Roberto Méndez from PROMIC: Projecto de Manejo
Integral de Cuencas, Cochabamba (satellite images, digitital topographic maps,
airphotos).
The SPOT images for the exercises are used with permission from SPOT Image; the
Landsat TM images with permission from EOSAT; the Ikonos image with permission of
Space Imaging, © NEO BV/Includes material © 2000 SIE S.A.; original ERS1 and
ERS2 data © ESA (1995), as distributed by Eurimage.
The Dnnet.E00 file of chapter 4 is part of the Digital Chart of the World (© ESRI) and
has been downloaded from the Digital Chart of the World Server at Penn State University
Libraries (http://www.maproom.psu.edu/dcw/). The Global 30 Arc Second Elevation
Data file W100s10.dem has been downloaded from the USGS EROS Data Center
(http://edcdaac.usgs.gov/gtopo30/gtopo30.html).
Last but not least, we like to thank all alpha and beta testers both within and outside ITC
who gave useful feedback to improve the software.
The ILWIS software is designed by Wim Koolhoven and Jelle Wind. The entire group
responsible for the release of ILWIS 3.0 consists of the following persons:
- Software Development: Jan Hendrikse, Wim Koolhoven, Willem Nieuwenhuis,
Martin Schouwenburg, Bas Retsios, Lichun Wang and Jelle Wind.
- Testing and Support: Jelger Kooistra and Boudewijn van Leeuwen.
- Help and Documentation: Petra Budde, Remco Dost, Arend de Haas and
Raymond Nijmeijer.
Head Geo Software Development: Wim Koolhoven.
Contents
1. Introduction to ILWIS 3.0 1
1.1 Starting ILWIS ...........................................................................................................................2
1.1.1 The Navigator ..............................................................................................................2
1.1.2 Catalog(s) .....................................................................................................................3
• Customizing the Catalog ..........................................................................................5
1.1.3 Title bar and Menu bar ..............................................................................................5
1.1.4 The Operation-tree and Operation-list ..................................................................6
1.1.5 Status bar .....................................................................................................................7
1.1.6 Toolbars of the Main window ..................................................................................7
• The Standard toolbar.................................................................................................8
• The Object selection toolbar ...................................................................................8
1.1.7 The Command line .....................................................................................................9
1.1.8 Getting Help ................................................................................................................9
• Summary: the Main window of ILWIS .................................................................11
1.2 Displaying geographic data .................................................................................................13
• ILWIS dialog boxes ..................................................................................................14
• A map window ..........................................................................................................16
• The contents of the map: domain ........................................................................20
• A table window .........................................................................................................21
• Summary: displaying maps and tables ...............................................................24
1.3 The Cochabamba area .........................................................................................................26
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 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
changed from a 16-bit into a 32-bit multi-threading application and is fully
compatible with Windows 95, 98, Me, NT4 and 2000. All memory allocation
limitations caused by segmented memory (64kB blocks) have been removed. Long
file names are allowed, and you are able now to select, copy and delete multiple
objects in the Catalog.
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.
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 1024×768, 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.
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 User’s 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.
The ILWIS 3.0 User’s 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 exercises in the ILWIS 3.0 User’s 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.
During the installation of ILWIS, you can install the User’s Guide Data directly on
your hard disk. The default installation directory for the User’s 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 pro-
gram, 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.
☞ • 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
• All information that should be supplied by the user is also shown in
Courier New 10 , as well as all the names of objects (maps, tables,
columns, etc.).
For example: Geology .
• 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.
Since the ILWIS 3.0 User’s 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:
The ILWIS 2.1 Applications Guide can, just like the ILWIS 3.0 User’s Guide, be
used both as a self-study material as well as in a course environment. Many of the
case studies presented in this book are used in courses given at ITC. The data and
documentation of the ILWIS 2.1 Applications Guide is available on the CD-ROM
but you can also download the data from the ILWIS web site http://www.itc.nl/ilwis/.
From this site it is also possible to download other exercises, like for example the
exercise on creating an Orthophoto (as included in the ILWIS 2.2 Guide).
ILWIS is an acronym for the Integrated Land and Water Information System. It
is a Geographic Information System (GIS) with Image Processing capabilities. ILWIS
has been developed by the International Institute for Aerospace Survey and Earth
Sciences (ITC), Enschede, The Netherlands.
As a GIS and Remote Sensing package, ILWIS allows you to input, manage, analyze
and present geo-graphical data. From the data you can generate information on the
spatial and temporal patterns and processes on the earth surface.
- In geology, GIS is used to find the most suitable places for mining, or to determine
areas subject to natural hazards.
- Areas that may be affected by pollution are analyzed using GIS functions.
- Extensions of cities are planned, based on analysis of many spatial and temporal
patterns, etc.
This chapter is intended to introduce you to ILWIS, and specifically to the user
interface. You will learn how to start ILWIS, the functions of the Main window and
how to open maps and tables.
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\.
You can use the Navigator (Figure 1.2) to change the current drive and working
directory.
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 directo-
ry 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.
The following objects, related to the area surrounding the city of Cochabamba in
Bolivia, can be seen:
Cochabamba
A coordinate system, containing the definition of the coordinate system (the
minimum and maximum coordinates of the study area and optionally the map
projection) used for the maps of the Cochabamba area;
Landuse
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
A representation, containing the color assignments of the mapping units in the
Landuse map;
Landuse
An attribute table containing information on the land use units;
View3D1
A domain, explaining the content of the raster map View3D1 ;
View3D1
A raster map, containing a three dimensional picture of the study area;
View3D1
A representation, containing the color assignments of the pixels in raster map
View3D2
View3D2
View3D2
A domain, raster map and representation of another 3D picture View3D2 .
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 ).
• Release the mouse button and click OK.
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.
The Menu bar (Figure 1.5) can be used for example to start an operation. The ILWIS
Main window has six menus: File, Edit, Operations, View, Window and Help.
☞ • 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.
• Position the mouse pointer on the command Image Processing. A submenu
appears.
• 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.
• Close the dialog box by clicking the Cancel button.
• Open some more menus and have a look at their contents. The Status bar
(at the bottom of the Main window) gives short explanations.
☞ • 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 but-
ton in the Title bar of the Help window or by double-clicking the con-
trol-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. Context-
sensitive menus are shortcuts for normal menu commands.
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 .
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.
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
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 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.
- Index. The Index page of the ILWIS Help is displayed. Type a keyword or click
any keyword in the list on which you wish to get help.
- Search. The ILWIS Help viewer is opened with the Search tab selected. Type
some characters, a word, or a phrase on which you want to obtain help and press
Enter ↵ or click the List Topics button to get a list of topics. In the Select topic
list box select the topic you want to display and click the Display button or press
Enter ↵.
- Basic Concepts. Gives an overview of the basic concepts of ILWIS. These
concepts will be treated in chapter 2 of the User’s 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 dis-
plays 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
Home/Contents Page topic, and to adapt the Font size, to Print topics and to
change the Options.
To find a Help topic, click one of the following tabs in the help window:
- To browse through topics by category, click the Contents tab.
- To see a list of index entries, click the Index tab and then either type a word or
scroll through the list.
- To search for words or phrases that may be contained in a help topic, click the
Search tab. In the left of the Help window, click the topic, index entry, or phrase to
display the corresponding topic in the Topic pane.
☞ • 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.
- A Catalog lists the available maps, tables and other ILWIS objects in the current
working directory. When you double-click an object, the object will be opened.
When you click an object with the right mouse button, you can choose to start an
application with the selected object as input. The ILWIS Main window can show
one or more Catalog(s).
- The ILWIS object types and their icons that can be shown in a Catalog are:
raster maps georeferences
polygon maps coordinates systems
segment maps histograms of raster maps
point maps histograms of polygon maps
tables histograms of segment maps
map lists histograms of point maps
object collections sample sets
map views two-dimensional tables
layouts matrices
annotation text objects (user-defined) filters
domains user-defined functions
representations scripts
- The Operation-tree provides a tree structure for all ILWIS operations, similar to the
Operations menu.
- The Operation-list contains an alphabetic list of all ILWIS operations. Each opera-
tion is preceded by an icon; the icon indicates the output data type of the operation.
- The Navigator provides a tree structure for all drives and directories and has a his-
tory of recently visited drives and directories.
- The Title bar is always located at the top of the window. It shows the name of the
window and can be used to move the window on the screen.
- The Menu bar can be used to start an operation, to create or edit objects, to view
the properties of an object, etc.
- The Standard toolbar provides shortcuts for regularly used menu commands such
as Customize Catalog, List/Details View, etc.
- The Object selection toolbar can be used to select the object types that should be
visible in the currently active Catalog.
- The Command line is mainly used to type calculations (MapCalc) and expressions
(i.e. perform operations).
- The Status bar gives short information on the item on which the mouse pointer is
located: a menu command, a button in the Toolbar, an object in the Catalog, an
operation in the Operation-list or the Operation-tree, etc.
- The ILWIS Help allows you to obtain help information from any point within the
program. The ILWIS Help viewer has a Topic pane, a Navigation pane and a
Toolbar.
Maps are considered spatial data, since the information they contain is directly
related to certain locations on the earth’s surface. The location of the units A, F and G
are specified with respect to their X and Y coordinates.
Tables, on the other hand, do not contain direct information on a location. They
contain descriptive information (in this case the names of the land use types and the
value of the land in monetary units). If we would only have the table, the data would
not be useful, since we don’t know where the units are located. If we would only have
the map, we still don’t know anything about the units. In a Geographic Information
System (GIS) like ILWIS, the link between spatial and attribute data is the key to get
real information. Only by combining spatial and attribute data we can get answers to
questions such as: Where are the land use units with a value more than 250?
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.
☞ • Press the polygon map button in the Object selection toolbar to show
the polygon maps again and double-click the polygon map Landuse in the
Catalog. The Display Options - Polygon Map dialog box appears (see
Figure 1.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
proper object. When you click the Create button, the program proceeds to a new
dialog box.
The dialog box in Figure 1.13 contains two list boxes: one in which you can specify
the color of the boundary lines of the land use units (Boundary Color), and another
(Representation) in which you can indicate the color of the units themselves. These
colors are stored in an object called representation (see section 2.4).
Check box. This is a small square in the dialog box, which allows you to select or
clear an option. The Display Options – Polygon Map dialog box has five check
boxes. When you select the Info check box, you will be able to read information
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
dialog box is closed and the action will be executed.
Cancel button: when you click the Cancel button (or press Esc on the keyboard) the
dialog box is closed and the action is canceled.
Help button: when you click the Help button (or press F1 on the keyboard) context-
sensitive help information will be displayed. Context-sensitive help means help
dealing with the specific dialog box.
Option buttons. Option buttons can be seen as circles and represent a group of
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 Alt-
key 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
➥
ILWIS 3.0 User’s Guide 15
Introduction to ILWIS 3.0
➦ 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 Tab-
! key 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
window and can be used to move the map window.
Menu bar: located just below the Title bar. A map window has 5 menus: File, Edit,
Layers, Options and Help.
Toolbar: located just below the Menu bar. The Toolbar provides shortcuts for some
regularly used Menu commands. The Toolbar of the map window has the following
buttons:
Entire Map 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.
Status bar: located at the bottom of the window. The Status bar displays
coordinates in meters and/or geographic coordinates.
Close button
Title bar Maximize button
Control menu icon Menu bar Minimize button
Toolbar Scale box
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.
• Maximize the map window by clicking the Maximize button in the upper
right corner of the window.
When you want to study details of the map, the zooming possibility can be used.
☞ • 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.
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).
☞ • Click the Normal button in the Toolbar to go back to the normal view.
• 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 longi-
tude.
With the Measure Distance button it is easy to measure the distances and the
angle between two points.
☞ • Click the Measure Distance button in the Toolbar of the map window,
or choose the Measure Distance command from the Options menu.
• 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.
☞ • 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 .
Domain 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 win-
dow is not visible anymore, click the ILWIS button on the Windows
Taskbar at the bottom of your screen.
• Make all the objects visible by clicking the ILWIS button in the Object
selection toolbar.
• Double-click the domain Landuse in the Catalog of the Main window.
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.
☞ • Close the Domain Class editor by clicking the Control-menu icon and
select Close.
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.
☞ • 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 New Graph Window
Paste Goto First Record
Delete Goto Previous Record
Print Goto Record
Properties Goto Next Record
Update all columns Goto Last Record
Close button
Toolbar Title bar Maximize button
Control menu icon Column properties Minimize button
Record view button button Command line
Split bar
Statistics pane Status bar Table viewer Scroll bar
Figure 1.15: An ILWIS table window.
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.
☞ • 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
➥
ILWIS 3.0 User’s Guide 23
Introduction to ILWIS 3.0
➦ (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.
• Click the Goto Previous Record button or the Goto First Record but-
ton to go to the previous record or to the first record respectively.
• Click the Goto Record button to go to a specific record in the table.
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 .
• Resort the table using the Record sequence Domain .
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.
- How to use dialog boxes: How to enter parameters to define the way in which a
map is displayed.
- The basics of a map window: How to open a map; the different components of a
map window: Title bar, Menu bar, Toolbar, Map viewer, Layer Management
Pane, Status bar; to resize a map window; to zoom in and to zoom out; to read
the coordinates of a map (coordinate system); to know the contents of a map
(domain).
- The basics of a table window: How to open a table; the different components of a
table window: Title bar, Menu bar, Toolbar, Command line, Table viewer, Split
bar, Statistics Pane, Status bar; the fact that contents of a table are defined by
the domain of the table; the fact that columns also have a domain. The display of an
entire table (i.e. Table View), or only the contents of a certain record (i.e. Record
View); to sort a table.
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.
A more detailed 3D view of the city of Cochabamba itself, made from a scanned
aerial photograph, is also available.
☞ • Close the map View3D1 , and open raster map . Have a look at it, and close it
when you have finished.
In chapter one, Introduction to ILWIS, you started with ILWIS, and learned the
basics of the user interface. This chapter presents some key concepts of ILWIS.
In section 2.1, the two basic data models (vector and raster models) that are used in
ILWIS are treated together with the different types of objects (i.e. data objects,
service objects, container objects and special objects). In section 2.2 the various types
of maps are shown: point, segment, polygon and raster maps. Vector and raster maps
can be displayed simultaneously in a map window. In this section and in section 2.3
you will also have a closer look at one of the key concepts of ILWIS: the use of
domains. A domain lists e.g. the possible units in a map (as class names or IDs) or
the range of possible values in a map. A representation, treated in detail in section
2.4, contains the information that determines how your spatial data should be
represented on screen or in a printout. A coordinate system (section 2.5) contains
information on the kind of coordinates you are using in your maps. In section 2.6 of
this chapter you will pay special attention to the georeference (containing information
about the number of lines and columns of a raster map, the coordinates and the pixel
size). In the sections 2.7 and 2.8 you will see how spatial and attribute data are linked
and how you can retrieve information from both simultaneously, by using the pixel
information window. In section 2.9 the details view of the Catalog is treated. The
last section, section 2.10, deals with another important concept of ILWIS:
dependency links. In ILWIS the maps, tables and columns created by an operation,
know how they were made. This has some major advantages, such as the possibility
to store only the definition of a map, without storing the data of the map itself, and
the possibility to simply recalculate output maps when input data has been changed
(make output maps up-to-date).
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter02, where the data files for
this chapter are stored.
The spatial entities described above can be represented in digital form in two data
models (Figure 2.1): vector models or raster models. Both models store details on the
location of entities and their value, class name or identifier. The main difference
between the two data models is the way they store and represent the locations.
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 The location of a point is described by a single XY coordinate pair. Points are stored
in point maps by registering their location in X and Y coordinates and by coding them
(e.g. a rainfall station, elevation, etc.).
Segments A line is stored as a series of X and Y coordinates (points) that best reflect its
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.
Object types
Before we are going to display vector and raster maps and investigate the different
types of domains, it is may be useful to explain that ILWIS uses different types of
objects.
- Data objects. Raster maps, polygon maps, segment maps, point maps, tables and
columns are called data objects. They contain the actual data.
- Service objects. Service objects are used by data objects; they contain accessories
that data objects need besides the data itself. Domains, representations, coordinate
systems and georeferences are called service objects.
- Container objects. Container objects are collections of data objects and/or annota-
tion: map lists, object collections, map views, layouts and annotation text.
- Special objects. Special objects are histograms, sample sets, two-dimensional
tables, matrices, filters, user-defined functions and scripts.
- Vector maps in ILWIS are either point maps, segment maps or polygon maps.
- Raster maps can be obtained either by rasterizing vector maps, by importing them
from other sources or by performing GIS or image processing operations in ILWIS.
- Raster maps, polygon maps, segment maps, point maps, tables and columns are
called data objects. They contain the actual data.
- Service objects are used by data objects; they contain accessories that data objects
need besides the data itself. Domains, representations, coordinate systems and geo-
references are called service objects.
- Raster maps also need these service objects: a domain, a representation and a coor-
dinate system. All raster maps contain information in discrete cells or pixels, which
are ordered in rows and columns. To relate these pixels to map coordinates another
service object called a georeference is needed.
Lets us now have a look at the different types of maps in ILWIS. In chapter 1 you
have seen the Landuse map. Remember that it was a polygon map. Let us now
compare the polygon map with a raster map, which is obtained by rasterizing the
polygon map.
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.
☞ • Click the Zoom In button in the Toolbar of the raster map. Position the
mouse pointer in a section of the map near the boundary of several units.
Press the left mouse button, hold it down, and drag it to define a small area
to zoom in on.
• 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.
We can see the individual pixels even more clearly when we display another type of
raster map: a satellite image (Tmb1 : Band 1 of a Landsat Thematic Mapper image).
☞ • 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 win-
dow 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 win-
dow). The Display Options - Raster Map dialog box is opened. As you
can see the Tmb1 map has a domain image.
• Click OK in the Display Options – Raster Map dialog box.
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:
☞ • Press the Normal button in the Toolbar of the map window to go back
from the Zoom In mode to the Normal mode, and subsequently click indi-
vidual pixels with the left mouse button.
Image 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 .
Layer management
☞ • 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 .
• Double-click Tmb1 in the Layer Management pane. The Display Options
– Raster Map dialog box of raster map Tmb1 appears.
• 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?
• Answer this question with Yes .
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
Layer button in the Toolbar of the map window. The Add Data Layer
dialog box is opened.
➥
➥ • 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 dis-
played 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.
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.
☞ • 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.
➥
34 ILWIS 3.0 User’s Guide
Main concepts of ILWIS 3.0
➥ • 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
User’s 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.
• Click the Font button. The Font dialog box is opened.
• In the Font dialog box, select Font: Arial , Font Style: Regular and
Size: 8.
• Click OK in the Font dialog box.
• In the Display Options – Point Map dialog box, select Text Color: Green
and click the Symbol button.
• 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 Symbol dialog box.
• 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
➥
ILWIS 3.0 User’s Guide 35
Main concepts of ILWIS 3.0
➦ in the Layer Management pane. You can also choose not to display a data
layer by clearing its check box.
• When you have finished, close the map window.
- The way in which various data layers are displayed in a map window can be manip-
ulated via the Layer Management pane.
- In the Layer Management pane you can select the layers to be displayed, and
from which layers you want to obtain information. You can change the display
options of a layer, the order of the layers and you can add or remove layers.
A domain stores the set of possible data ‘values’ (class names, IDs or values) that
should be available in a map, table or column.
ILWIS uses domains extensively and for many operations you should decide in
advance about the domain of a resulting map: a class map, an ID map, or a value
map. This enables you to have a direct control over your data types, e.g. having the
domain as a separate object you can have a direct look at the kind of data are stored
in your maps.
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.
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 multi-
temporal land use maps of a certain area, or various geological maps with the same
legend.
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 grass-
land, 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.
• Click the Used By tab.
You see a list of objects that are using this domain Landuse : raster map Landuse ,
polygon map Landuse , table Landuse , and representation Landuse .
☞ • Click the Cancel button in the Properties sheet and close the Domain
Class editor.
• Open another class domain: Geomorphology .
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
Item commands on the Edit menu, with the buttons in the Toolbar of the
Domain Class editor or by using the right mouse menu on a domain item.
☞ • In the Catalog, click domain Cityblock with the right mouse button and
select Open from the context-sensitive menu.
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.
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
example 0.0000001), the size of the map on disk can become very large (up to 8
bytes per pixel). This will also lead to slower performance of the system and to disk
space problems. So you should use a precision which is useful for the data you are
working with.
Domain Height is a so-called user-defined value domain. It was created for the
demo data set. User-defined value domains are useful when you have a series of
maps for which you need the same range of values and the same precision. You do
not have to define a new domain for each map, and even more important, you can
show these maps with the same representation. User-defined value domains can have
their own representation value. For example, when you are working with digitized
contour maps of different areas and when all maps should by default be displayed in
the same colors.
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
Catalog command or click the Customize Catalog button in the
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
➥
ILWIS 3.0 User’s Guide 41
Main concepts of ILWIS 3.0
➥ 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”.
- 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 inter-
polated values. A value domain may for instance store the values (range and preci-
sion) needed to define heights or to define concentrations.
- The system Image domain is used for satellite images or scanned aerial photo-
graphs 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.
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 select-
ing 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.
• Have a look at the other menu items and try some.
• After that, close representation Landuse .
Identifier domains (ID) do not need a user-defined representation because the IDs are
usually just numbers without a certain meaning.
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.
☞ • 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 represen-
tation value called Height .
• Close the Properties sheet and open representation Height by double-click-
ing the object in the Catalog. The Representation Value editor is opened.
☞ • Select the Limit 3500 , open the Edit menu and select the Edit Limit com-
mand 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.
• 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.
• From the Edit menu choose Insert Limit. The Insert Limit dialog box
appears.
• Insert a new limit (Value 4000 , Color Gold ) and click OK in the Insert
Limit dialog box.
• When finished close representation Height .
☞ • 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 dif-
ferent 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.
• In the Catalog, double-click the segment map Contour . The Display
Options – Segment Map dialog box is opened.
• Select a system-defined representation, for example Representation Red
and click OK. Now the contour lines are displayed according to that repre-
sentation.
• Double-click the word Legend in the Layer Management pane. The
Representation Gradual editor is opened. It is not possible to edit this rep-
resentation because it is a system-defined one and system-defined represen-
tations cannot be edited.
• Close the Representation Gradual editor.
• After finishing, close the map Contour .
☞ • Click the Customize Catalog button in the Standard toolbar of the Main
window. The Customize Catalog dialog box is opened.
• In the Customize Catalog dialog box, select object type Coordinate
System , select the check box Include System Objects and click OK.
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 X’s and Y’s that
can be used in a map, and in case of a coordinate system of type projection, you can
also store information on a map’s projection, ellipsoid and/or datum. Normally
locations on the earth’s surface are shown in geographic coordinates.
The Geographic Coordinates of the earth are expressed in Latitudes and Longitudes
(see Figure 2.2). Latitudes (parallels) are measured from the equator and may range
from 0° to 90° N or from 0° to 90° S. Longitudes (meridians) are measured from the
Greenwich meridian and may range from 0° to 180° E of from 0° to 180° W.
Figure 2.2: Geographic coordinate system: the location of A is determined by the Longitude (λ)
and the Latitude (φ).
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 earth’s 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.
For more information on types of coordinate systems and transformations, see section
4.2. In general it’s 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.
In principle, all maps of the same area should have the same coordinate system.
ILWIS assumes that all maps that you want to superimpose or display together in one
map window have the same coordinate system. Displaying maps with different
coordinate systems is possible if projection information is available for both
coordinate systems. Then the coordinates of a vector map are transformed on the fly
according to the coordinate system that the map window is using at the moment. Of
course, you can use the Transform operations to permanently transform coordinates
(see chapter 4 for more information).
☞ • 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 .
• Click Cancel in the Coordinate System Projection dialog box.
• Click the Customize Catalog button in the Standard toolbar of the Main
window and select all objects. Clear the check box Include System Objects
and click OK.
- A coordinate system may have information on the map’s projection, ellipsoid and
datum.
A georeference corners has information on the number of rows and columns in the
map, the coordinate system, the minimum and maximum X- and Y-coordinates of the
corners of the map, and the pixel size.
A georeference of type corners is used for instance for maps which are converted
from vector to raster (i.e. rasterized vector maps).
☞ • Check if the pixel size given in the GeoReference Corners editor is cor-
rect; 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.
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.
• 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.
• 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.
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 north-
oriented way.
• Close the map window.
- A georeference is a service object, which stores the relation between the rows and
columns in raster map(s) and the ground-coordinates (X, Y).
- In the chapters 6 and 10 you will see that there are several other types of georefer-
ences.
In section 1.3 we have also seen that spatial data (maps) can be linked to non-spatial,
or attribute data (tables). In order to be able to link a map with a table, the units of a
map must be linked to records in a table. The attribute information can then be added
in columns. In other words, a map and its attribute table should use the same domain.
Let us briefly check this again.
☞ • 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
attribute table, in which for each land use type information is given, such as the
biomes production per hectare, the value of the land per hectare, etc.
- The Cityblock map (with domain ID) can have an attribute table in which infor-
mation is stored for each city block, such as the number of people living in the
block, the number of houses, public buildings, shops, etc.
- A value map, on the other hand, such as the segment map Contour , contains val-
ues, representing a certain phenomenon (in this case terrain elevation). It is diffi-
cult to imagine which attributes could be linked with such information, other than
purely statistic information (e.g. the length of each line).
The linking of maps with attribute tables is useful if you want to substitute the units
of a map with an attribute value from the connected table (a process called
renumbering). In that case you generate an attribute map.
Although value maps cannot be linked to attribute tables, you can generate tables
from value maps. The most important ones are cross tables and histograms. These are
not used, however, to renumber the value maps. It would make no sense to replace the
DN values (reflectance values) of a satellite image with the area attribute from its
histogram.
- Only maps with a class or ID domain can be linked to attribute tables. Value maps
cannot be linked to tables.
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.
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.
• Position the mouse pointer in the map window.
• In the pixel information window, you can read the information of the map-
ping unit in map Geomorphology , and of the mapping unit in map
Landuse at the same location.
• Move the mouse pointer over the map to display the information continuously.
☞ • 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.
- A pixel information window shows information at the position of the mouse pointer
in a map window.
☞ • 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 ascending-
ly 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.
By using a query, you can search for instance for objects that use domain type
class/ID, domain type image, a certain domain (e.g. domain Landuse ), a certain
georeference, etc.
☞ • 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.
• You will create a query. Type in the Query text box:
map.domain = landuse
and click OK on the Query tab. The query shows all the raster, polygon, seg-
ment and point maps that use domain Landuse . In this exercise, raster map
Landuse and polygon map Landuse use the domain Landuse .
• To turn off the query, type Dir on the Command line, or open the View
menu, and select the Catalog Queries, All command.
- The Details View is a table with columns that give you extra information on indi-
vidual objects.
- In each Catalog, you can specify the visible object types, the sorting method of
objects, and a query to search for specific objects.
- You can use predefined queries but you can also construct your own queries.
The properties of an object show which service objects are used for a data object
or another service object. In section 2.2 you saw that for the display of vector
maps, you need to have a coordinate system, a domain and a representation
(depending on the domain) and that a raster map requires the same objects, plus
the georeference. In section 2.7 it was shown that class and ID maps could also be
linked to attribute tables.
The objects indicated in the shaded boxes are the data objects (i.e. point, segment,
polygon maps and tables) and the objects outside of these boxes are the service
objects. The arrows indicate the relations between the objects. For example, in
Figure 2.4, a domain is used by a vector map (either a point, segment, or polygon
map), by a table, and by a representation.
All the properties of an object can be viewed from their Properties sheet.
☞ • 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.
• Click the Used By tab.
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.
☞ • In the Catalog click with the right mouse button on domain Cityblock
and select Properties from the context-sensitive menu. The Properties
sheet appears.
• Click the Used By tab. Cityblock is an ID domain, used by polygon map
Cityblock , and table Cityblock .
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.
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 after-
wards.
• 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.).
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.
Output maps thus know how they are created and on which input maps, tables or
columns they depend. Such output maps are called dependent data objects. The same
applies for tables and columns. The operation or expression stored inside the
dependent data object is called the definition.
Let us look at an example. Polygon map Landuse was used in combination with the
georeference Cochabamba to generate a raster map Landuse . This is shown
schematically in Figure 2.7.
Figure 2.7: The dependency link between objects. The output raster map is made from a poly-
gon 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.
☞ • 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).
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.
☞ • 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.
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 any-
more.
- For maps, tables or columns that are created via the MapCalc and TabCalc
expressions, you can change the definition of the dependent output data objects; so
you can do a similar calculation again with different parameters without having to
create a new map, table, or column.
- You can release disk space: it is possible to delete the files that contain the actual
data values (e.g. .MP# and TB# files), as long as the object definition files (e.g.
.MPR, .MPA, .MPS, .MPP or .TBT files) which contain the definition to recalcu-
late the dependent data objects remain.
☞ • 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 .
(C) and Up-to-Date (U) and the data file of the raster map is available.
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.
- 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 creat-
ed 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.
recalculated as the system can execute their definition again. There is thus no
need to repeat operations and choose input and specify output objects again: you
can simply press the Make Up-to-Date button in the Properties sheet of the
dependent output maps, tables or columns.
Easy change of calculation formulas: MapCalc and TabCalc formulas are stored
as the definition of dependent raster maps and columns and can be modified in
the Properties sheet of such a map or column. This enables you to quickly
change calculation formulas and see results displayed in the same raster map or
column. The need to create new maps and columns for similar calculations is
thus reduced.
Minimum use of disk space: when you perform a calculation or another opera-
tion and the outcome is a dependent map or table, in principle only the object
definition file of the dependent map (.MPR, .MPA, .MPS, .MPP) or table
(.TBT) is stored on disk. Object definition files are small ASCII files and they
store amongst others the expression by which the output object is created and
contain a reference to the output data file(s). You can directly continue to per-
form calculations and/or operations on the dependent objects that do not have
calculated data files yet.
- When an object is Dependent (D), Calculated (C) and Up-to-Date (U) it means that
none of the source objects have been updated since the dependent object was gen-
erated.
- When an object is Dependent (D), Calculated (C) and Not Up-to-Date (N) it means
that (one of) the source objects has been updated since the dependent object was
generated. You can make the dependent object up-to-date again by using the Make
Up-to-Date button in the object’s Properties sheet.
- When an object is dependent (D), Not Calculated (N) and Not Up-to-Date (N) it
means that only the object definition file of the dependent object is stored on disk
and that the actual data file is deleted. You can recalculate the dependent object by
using the Calculate button in the object’s Properties sheet.
Data input
You need to ensure that your spatial and non-spatial data is available in digital form
in your computer. How you do this depends largely on the data type. For instance,
you can digitize maps and you can type tabular data. ILWIS can convert data files
derived from scanning, or you can import other digital formats as inputs. Through
image processing, ILWIS enables data input from remotely sensed images. The
aspects of spatial data input will be dealt with in the next chapter (chapter 3).
Data management
Data can be stored in and retrieved with ILWIS. The data management in ILWIS
emphasizes efficiency of storage and retrieval. File formats used are convertible so
different data types can be combined. Many aspects of data management in ILWIS
will be treated in chapter 4 (on spatial data) and in chapter 5 (on attribute data).
Data analysis
Data analysis is the most important feature of ILWIS, qualifying it as an analytical
GIS package. Data analysis is the process in which you generate information that is
useful for solving a particular problem. When the data is in the form of satellite
images, the data analysis is also called digital image processing. The objective is to
generate images that can be interpreted by experts, or to generate classification
results, containing thematic information on features such as land use, lithology, etc.
The various ILWIS operations on image processing will be covered in chapter 6.
Other data analysis techniques dealing with maps, combined with tables, will be
treated in the chapters 7 to 12 which have an increasing degree of complexity.
Data output
The final objective of working with a GIS such as ILWIS is to produce useful output
results. Using ILWIS you can show your results on the screen, as hard copy output
(printed data) or as soft copy (files to be used further in ILWIS or in other software
packages).
All aspects dealing with the generation of output with ILWIS will be treated in the
final chapter 13.
Analysis and modeling in a GIS requires input of relevant data. The data consist of
two types: spatial data representing geographic features (points, lines and areas) and
attribute data (descriptive information). Data input should be done with utmost care,
as the results of analyses heavily depend on the quality of the input data. In ILWIS
data can be entered by:
- Digitizing, if you want to use data from analog (paper) maps;
- Keyboard entry, for entering tabular data;
- Scanning, if you want to use paper prints of satellite images, aerial photographs,
maps and pictures;
- Importing existing data files from other sources.
This chapter explains how to digitize maps. The next chapter deals with the import of
digital map data and in chapter 5 the import and creation of tables is treated.
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter03, where the data files for
this chapter are stored.
Apart from a segment map used in section 3.5, you will create all digital data for this
chapter yourself.
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
to work with ILWIS). When you press one of the buttons, an electromagnetic signal is
transmitted and the position of the cross-hair is recorded by one of the horizontal and
one of the vertical wires. From this, a coordinate pair in digitizer units is defined and
sent to the computer.
In principle, all the maps that are used of a certain area should have the same
coordinate system. ILWIS expects that all maps that you want to superimpose or
display together in one map window have the same or a compatible coordinate
system. Therefore, when you start with a project you first create a user-defined
coordinate system, and you use this for all the maps that you digitize or that you
import from other sources.
For maps with different projections, different coordinate systems (of type projection)
have to be created. To display two or more maps with different projections an ILWIS
map window automatically ‘transforms’ the coordinates of the second map to the
projection of the first one. You can use the Transform operation to permanently
transform maps with different projections to one common projection.
Sometimes you may not know the projection of a map that you are going to digitize.
In that case you cannot fill in the projection parameters in the coordinate system, and
therefore, you don’t know the relationship between metric and geographic
coordinates. This is not a problem as long as you don’t want to combine your data
with maps in other projections.
We strongly advise you not to digitize your map in a coordinate system that you
invent yourself, for example just by taking the lower left corner of the map as X = 0
and Y = 0. If you do so it will be very difficult to combine your own digitized data
with that from other sources.
Normally, topographic maps contain information on the map projection that was
used. For example, on the topographic map of Cochabamba, the following
information is given:
- Ellipsoid: International .
- Projection: Transverse Mercator .
- Vertical Datum: Sea level .
- Horizontal datum: Provisional South America 1956 .
- UTM zone: 19 K.
In the next chapter, you will find a more elaborate explanation on map projections,
and especially on UTM.
The map that you are going to digitize first, is shown in Figure 3.3. You can see from
the map that the actual study area is located between the following coordinates (in
UTM zone 19):
- minimum X = 795000
- maximum X = 808500
- minimum Y = 8071500
- maximum Y = 8090500
Now that you know the coordinate boundaries of your map and the projection
information, you can generate the coordinate system that will be used for all maps of
the Cochabamba area.
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.
Coordinate system Cochabamba is now created and you can proceed with the
digitizer installation and configuration.
Using WinTab
The digitizer manufacturer usually supplies a WinTab driver; otherwise it can be
downloaded from the Internet. Install the WinTab driver on your computer (see your
digitizer manual or WinTab documentation). It is advised to use a WinTab driver,
because WinTab makes it easier to set up your digitizer and the digitizer can be used
for other applications as well.
To set up your digitizer using a WinTab driver choose for WinTab communication in
the Select Port page of the Digitizer Setup Wizard.
For the configuration of the digitizer tablet itself, you must know whether you
configured 9600 or something else for Baud Rate, 7 or 8 for number of Data Bits,
1 or 2 for number of StopBits and whether you used Even , Odd , or None for
Parity.
After you configured the digitizer tablet, you can use the Digitizer Setup Wizard. In
the Digitizer Setup Wizard, you have to specify exactly the same settings as during
the configuration of the tablet itself. Then choose the ‘Automatic’ configuration.
When the configuration is OK, the last page of the Digitizer Setup Wizard (i.e.
Size, Resolution and Final Check) gives you the opportunity to check the correct
working of all buttons, correct increase of digitizer coordinates when moving the
digitizer cursor to the upper right corner, etc.
For more information see the ILWIS Help topics How to set up a digitizer and
! start digitizing and Digitizer Setup Wizard.
With the map coordinates of the control points expressed as Xi,Y i and the digitizer
coordinates as Xdig,i, Ydig,i (Figure 3.2), the following formula for an affine
transformation is used to calculate the transformation coefficients:
where:
ai,j and bi are the affine transformation coefficients.
Figure 3.2: Referencing a map to a digitizer (simplified). Left: the digitizer contains an active
area. Only within that area, the horizontal and vertical wires inside the digitizer can
pick up a signal from the digitizer cursor (right).
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.
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
You can use the Transform Coordinates operation, to check whether the trans-
! formation 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.
☞ • 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 don’t 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).
☞ • 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.
• Position the digitizer cursor to point B and press the 0 button.
• 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.
- Transformation option buttons: The methods that can be used to calculate the
transformation between digitizer and real world coordinates. An Affine
transformation is a first order function requiring a minimum of three tie points. The
order of this transformation is sufficient to account for changes in scale on the X
and Y axes and for the map translation and rotation. The Conformal transformation
is also a first order function and needs a minimum of two tie-points. By selecting
the Conformal transformation, the program only accounts for scale differences in X
and Y axes and for map rotation. Although mathematically two or three tie points
are needed for the conformal or affine transformations, it is preferred to use at least
four tie points to derive a notion of accuracy.
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.
You are now ready to actually create a map and digitize the data that should be in the
map.
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.
- A minimum of three control points and the corresponding map coordinates are
required to reference the map. The map reference settings are stored and will
remain unchanged until you enter new reference settings.
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.
• Type Mountain_top in the Map Name text box.
• Type for the Description: Points indicating mountaintops .
• Select the Coordinate System: Cochabamba . This is the coordinate system
that you have created in the previous exercise. Note that the display of the
minimum and maximum X and Y coordinates changes, as the values of the
coordinate system are used.
• 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 ).
The Domain Identifier editor is opened. The editor can be used to add, change or
delete items in the domain. When you digitize you can either:
- First describe all domain items before you digitize, or;
- Define the domain items while you digitize.
☞ • 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.
• Click OK in the Create Point Map dialog box.
The Point editor and the Point editor command box are opened (Figure 3.5).
Figure 3.5: The Point editor and the Point editor command box.
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
select different modes, manage your data and to exit the editor:
Select Mode: this allows selection of one or more existing features (points,
segments, polygons or pixels) with the mouse. When you click the Select Mode
button the mouse cursor appears as a hand. In this mode you can select a feature
by clicking it.
Move Points Mode: this allows you to select a point (or a point within a
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 haven’t used the Save button sofar, the original map will be
restored.
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).
• A small box is opened at the digitized point. Type P1 in this box and press
Enter ↵.
• Digitize the rest of the points (Figure 3.3) and label them as follows:
Table 3.1: The codes used for digitizing the points in Figure 3.3.
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
☞ • 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 automatical-
ly.
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.
☞ • Move the cursor about a centimeter above the point 14 and press button 0.
Deleting a point
☞ • In the Toolbar, choose with the mouse the Select Mode button .
• Put the mouse pointer on point 16 and select it.
• Press the right mouse button to open the context-sensitive menu and select
Delete. You can also press the Delete key on the keyboard.
• Click Yes in the opened Point Editor message box to confirm.
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.
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.
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.
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
on you decide to continue digitizing, and the map on the digitizer is still in the same
position, you don’t have to reference your map anymore.
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.
• Click OK 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.
LEGEND
Segments EF, PQ, HR and RNO = highway
Segments LFMN, MGH, HID and ISQ = main road
Segments KLG, CS and TCD = motorway
Segments MU, DJ and IR = earth road
Figure 3.9: 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.
The Add Segments command window shows the position of the digitizer cursor and
the commands. The commands in this window are:
- Button 0: Begin Segment. To start digitizing a new segment, with its starting
point not connected to another segment.
- Button 1: Snap Segment. To start digitizing a new segment, with its starting
point connected to another segment: snapping.
- Button 2: Change Window. To change the area of digitizing displayed on the
screen (zoom in or zoom out).
- Button 3: Move Points. To switch to Move Point Mode.
☞ • 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.
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:
• Click the Maximize button with the mouse pointer to enlarge the map
window.
• Position the digitizer cursor at point Q in the map.
• Press digitizer button 0 to enter the point (starting point of the segment).
The program proceeds to the command box Digitize Segment (Figure 3.10A). In
this box:
- Button 0: Enter Point. To enter the (intermediate) points of the segment.
- Button 1: Snap End Segment. To end a segment by connecting it to another or
by creating a closed segment: Snapping.
- Button 2: End Segment. To end the segment, not connected to another segment.
- Button 3: Delete Last Point. To delete wrongly digitized point(s) at the end of
the segment.
(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 but-
ton 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.
• Press button 1 (Snap Segment).
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.
- Button 2: Snap Split. To split the selected segment into two and to snap the
segment to the two new segments.
- Button 3: No Snapping. To return to the Digitize Segment command box.
☞ • 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:
☞ • 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 dia-
log 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.
• Click OK 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.
• Position the digitizer cursor at point E and press the 0 button.
• 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).
• Digitize segment PQ . To end segment PQ at Q, press digitizer button 1 (Snap
End Segment) and then button 0 (Accept). In this way node Q connects
segments QHIS and PQ .
• Digitize segment HRNO similarly. To start segment HRNO at H, press respec-
tively 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.
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:
• Split Segment hw: Highway ?
• 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.
☞ • 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.
• 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.
• 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.
• Click OK in the Edit dialog box.
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
this is not the case. Reposition the cursor near the point you want to snap and try
again. The snap command only functions when you snap to the starting or ending
point of a segment. To snap to an intermediate point, the segment has to be split and
then snapped. The snap tolerance is a distance within which the program will accept
a node to snap to it. You can define the snap tolerance yourself in the Customize
Segment Editor dialog box.
☞ • 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.
➦ • Press button 2 (Snap Split) to split the segment KLG to segments: KL and
LG.
• Press button 0 to snap the segment FL to one of the segments (KL or LG ).
• Double-click FL . The Edit dialog box appears.
• In the Edit dialog box select Mr: Main road and click OK.
• Digitize the rest of the segments yourself, and use snap or split where neces-
sary. To codify the segments, follow the legend of Figure 3.9.
☞ • 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.
(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 .
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 delet-
ed segments will be displayed in the map window with a different color.
• Select the undeleted segment MU to really recover the segment.
Deleted segments, which can be undeleted, are shown in a color specified in the
Customize Segment Editor dialog box.
☞ • Open the context-sensitive menu in the map window by clicking the right
mouse button, and select Customize. The Customize Segment Editor dia-
log 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.
The Segment editor and the Add Segments command box are opened.
☞ • 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 digitiz-
ing 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.
• Digitize the other two contour lines with this altitude.
• Continue to digitize the rest of the contour lines.
• Make sure to snap different parts of the same contour line.
• Do not digitize the boundary.
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?
• 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.
The digitizing of segments is not treated here anymore. This was already explained in
section 3.3. You will start this exercise with a segment map that contains a number of
errors, which will be detected and corrected during the checking of the segments.
The file with which you will work is named Checkseg . It is the digital version of
Figure 3.14. It contains segments with the code Unitbound .
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-
ments. See text for explanation.
- Dead end in segment. The segment is not connected to another segment. This is
shown in example 1.
- Intersection without node. The segment overlays another segment without a node.
Several examples are shown in 2 and 3.
- The same segment is digitized twice. This may happen in large files, or in files you
obtain from someone else. This is illustrated in example 4.
- Self Overlap. The segment crosses itself. This is shown in example 5.
Before a map can be polygonized, it should be checked whether the segments have
been digitized and snapped in a proper way. This check is done using the option
Check Segments from the File menu of the Segment editor map window. You can
make corrections either with the digitizer cursor or with the mouse pointer. Segments
can also be checked when you select the option Polygonize from the File menu.
☞ • 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
overlap. B: Situation after automatically removal of false polygon. C: Situation after
automatic splitting segments.
☞ • The program will give an error message: Segment unitbound (nr 4) cross-
es 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 mes-
sage Zoom in on error?
• Drag the Check Segments message box outside the map window and com-
pare 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 unit-
bound (nr 21) crosses itself. Remove false polygon? appears.
• Click No. The message Split Segment unitbound appears.
• Click Yes. A node is inserted at the intersection and a new small polygon
now remains near M. The situation is comparable with the one shown in
Figure 3.14C. We will delete this small polygon later by hand.
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.
The next check that will be made is on dead ends in segments (see Figure 3.13
example 1).
☞ • 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).
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 mes-
sage for an error near L (after you clicked Yes in the Zoom in on error mes-
sage 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.
➥
➦ • Select the option Start at Number and click OK. If you corrected the previ-
ous 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.
The segments of segment map Checkseg are now error free, and you can proceed
with the creation of the polygon map.
☞ • 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.
• Type Landunit in the Map Name text box.
• Type for the Description: Points indicating the labels of land
unit polygons .
• Click the Create button next to the Domain list box. The Create Domain
dialog box is opened.
• Type Landunit in the text box Domain Name.
• Select the option Class and click OK. The Domain Class editor is
opened. ➥
110 ILWIS 3.0 User’s Guide
Spatial data input
➦ • Press the Insert key or click on the Add Item button in the Toolbar. The
Add Domain Item dialog box appears.
• 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.
• Close the Segment editor.
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 .
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 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.
- Point, segment and polygon maps are digitized and edited with the Point editor,
Segment editor and Polygon editor respectively.
- The editors work in Select, Insert and Move Point modes. The Polygon editor
only has a Select Mode.
- You can add features to the selection, by clicking them while pressing and holding
the CTRL key. When you have completed the selection, release the CTRL key. To
select all points or pixels within a specific area, define a window enclosing them.
This window can be defined by dragging it with the left mouse button. To deselect
any of these features, press and hold the SHIFT+CTRL keys and click on the
selected features. When you have finished deselecting, release the SHIFT+CTRL
keys. To toggle between selected and deselected features, press and hold down the
SHIFT key, click the selected one to be deselected, and non-selected one to be
selected. When finished, release the SHIFT key.
- Segments can be checked for Dead Ends (a node that is not connected),
Intersections without node (segment overlays without a node), and Self Overlap
(a segment that crosses itself). For contour maps, it is also useful to check for
Code Consistency (check if connected segments have the same code).
- Polygon maps are made by digitizing the boundary lines in the Segment editor,
checking the segments, and polygonizing them.
- A domain type ID, class or value, can be selected for a new map. The domain of a
map is selected based on the data represented by the map, e.g. a domain type class
for a land use map, value domain for a segment map representing the contour lines.
- You can also use domain type Unique ID for new maps. If you like you can assign
user-defined names to the points, segments or polygons yourself.
The transformation requires a DTM, in the form of a raster map, whose georeference
has the same Cartesian coordinate system, or at least a similar system which is
convertible into the one of the created segment or point map. The DTM is needed to
compute the distortions due to the relief in the terrain. To digitize on aerial
photographs you need to create a coordinate system Direct Linear or a coordinate
system Orthophoto. For more information refer to the ILWIS Help: How to
monoplot (on the digitizer).
Screen digitizing
In ILWIS it is furthermore possible to digitize a satellite image or scanned
photograph with the mouse pointer on your screen. Screen digitizing is the process of
creating and/or editing a segment or point map while an existing raster map is
displayed as a background in a map window. The raster map can be for instance a
band of a satellite image, a color composite, a scanned map, or a scanned photograph.
The background map or photo needs to have a georeference of type:
- Tiepoints: for satellite imagery;
- Direct Linear: when the photograph is taken with a normal camera;
- Orthophoto: when the aerial photograph is taken with a professional photogram-
metric camera and has fiducial marks.
For the direct linear and orthophoto georeferences a DEM should be available. For
more information, refer to the ILWIS Help, topics How to screen digitize and How
to monoplot (on screen).
Orthophoto
An orthophoto is a rectified (north-oriented raster map with square pixels) scanned
photogrammetric aerial photograph with corrections for tilt and relief displacement.
From the ILWIS web site, you can download text and data for an exercise on creating
an orthophoto (see ILWIS 2.2 Guide).
In the previous chapter you have seen how spatial data is entered in ILWIS via
digitizing. Another method for obtaining spatial data is to convert digital data into
other file formats. Sometimes, you obtain data that might not be directly usable in an
analysis. The data may still need to be edited. The data may be in the wrong data type
for a specific type of analysis. You may have to convert data from one vector type to
another (e.g. from segments to polygons), or from vector to raster (rasterization). The
data may also contain the wrong coordinates, georeference, domain or representation.
In this chapter the various spatial data management operations are shown, which
precede the actual data analysis. The first part of this chapter (section 4.1) deals with
the import of raster and vector maps from different file formats. In section 4.2, the
topic of map projections is treated, and how you can change maps from one
projection to another. In section 4.3, tools for vector data management are shown, and
in section 4.4, the vector to raster conversion is demonstrated. Then in section 4.5, the
tools for the management of raster maps are explained.
Before you can start with the exercises, you should start ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter04, where the data files for
this chapter are stored.
While importing files into ILWIS, you must know what type of data you are
importing: whether it is a point, segment, polygon or raster map, and what type of
information is stored inside the map. The content of a map determines the domain
type (class, ID, value, image, picture, color, etc.) that will be assigned to the imported
map.
Within ILWIS, you can use the normal ILWIS import, but you can also import
external files via GeoGateway.
After you used Import via GeoGateway, you will obtain an ILWIS object
collection . The object collection contains the ILWIS objects that are the result of
the import. You can open an object collection by double-clicking it in a Catalog; you
can subsequently open the imported objects also by double-clicking.
The TIF file format is frequently used as the storage type for scanned images. Here
an example is shown of importing a scanned aerial photograph of the city of
Cochabamba.
☞ • From the File menu of the Main window, select Import, Map. The Import
dialog box is opened. Click the Help button if you like.
• Select the Import Format: Tagged Image File Format .TIF .
• Select the file: Airphoto.tif , leave the Output Filename as it is and
click OK. The map Airphoto is now imported.
• Open the raster map Airphoto and check that it doesn’t have coordinates.
• From the File menu of the map window, select Properties, and 1 map
Airphoto . The Properties sheet is opened.
• Check the size of the map and the domain and close the Properties sheet
and the map window afterwards.
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.
• Select the Import Format: Windows bitmap .BMP .
• Select the file: Bolivia_mask.bmp . Leave the Output Filename as it is
and click OK. The map Bolivia_mask is now imported.
➥
ILWIS 3.0 User’s Guide 119
Spatial data management
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.
In this exercise, you will import an ERDAS .IMG file using GeoGateway and convert
this data to ILWIS data format. This file contains a Landsat TM image of
Cochabamba. The result will be an object collection, containing a map list and 3
different bands (raster maps).
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.
☞ • From the File menu of the Main window, select Import, Via GeoGateway.
The Import dialog box is opened.
• Select the file: Ikonos_Cochabamba.tif .
• Make sure the option Use PCI-GeoGateway is selected in the Import
Format list box, leave the Output Filename as it is, clear the check box
Combine compatible vector layers, and make sure that the check box
Convert to ILWIS data format is cleared.
• Click OK. The Ikonos_Cochabamba.tif file is now imported.
• Double-click the object collection Ikonos_Cochabamba . The object
collection 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.
• Select image Ikonos_Cochabamba__3 for the Red Band,
Ikonos_Cochabamba__2 for the Green Band and Ikonos_
Cochabamba__1 for the Blue Band.
• 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.
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.
• Open the map to see its contents.
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.
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.
• 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.
• Close all map windows after you have finished the exercise.
The conversion from ArcInfo .E00 format depends on the contents of the file, and
will either result in a segment map, possibly with a point map containing polygon
labels, or a polygon map. The domain will always be identifier.
In this exercise, you will import an ArcInfo .E00 file which contains the entire
drainage network of Bolivia. The file, Dnnet.E00 , is part of the Digital Chart of the
World and has been downloaded from the Digital Chart of the World Server at Penn
State University Libraries at http://www.maproom.psu.edu/dcw. The import will
result in an ILWIS segment map and an attribute table.
☞ • From the File menu of the Main window, select Import, Map. The Import
dialog box is opened.
• Select the Import Format: Arc/Info .E00 interchange format.
• Select the file: Dnnet.E00 . Accept the Output Filename and click OK.
The map Dnnet.E00 is now imported.
• 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.
• Close the map window when you are finished.
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).
☞ • From the File menu of the Main window, select Import, Map. The Import
dialog box is opened.
• Select the Import Format: AutoCad .DXF .
• Select the file: Samerica.dxf . Leave the Filename as it is and click OK.
The map Samerica is now imported.
• 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 exer-
cise.
☞ • From the File menu of the Main window, select Import, Via GeoGateway.
The Import dialog box appears.
• Select the file: Cochabamba.pix .
• Make sure the option Use PCI-GeoGateway is selected in the Import
Format list box and leave the Output Filename as it is.
• Clear the check box Combine compatible vector layers and click OK.
The Cochabamba.pix file is now imported.
• Double-click the object collection Cochabamba . The object collection is
opened.
• Open the map list and click the Open As ColorComposite button. The
Display Options – Map List as ColorComp dialog box appears.
• Select image Cochabamba__4 for the Red Band, Cochabamba__3 for
the Green Band and Cochabamba__2 for the Blue Band.
• 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.
- 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.
A map projection defines the relationship between the map coordinates and the
geographic coordinates, latitude and longitude.
Figure 4.1: A: Geographic coordinate system: The location of A is determined by the longitude
(λ) and the latitude (φ). B: The relationship between a sphere with radius a and an
ellipse with major and semi-axis a and b
Because of the earth’s 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 earth’s 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.
It follows that the ellipsoid shape is also completely defined by a and f or by a and e.
Nearly 93% of the earth’s 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 earth’s 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.
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 earth’s 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.
Map projections can be subdivided according to three aspects: class, aspect and
properties.
Figure 4.2: Cylindrical, azimuthal and conical projections. For each projection a tangent (touch-
ing 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
earth’s axis) and transversal (oriented perpendicular to the earth’s 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.
Map projections are named according to the class, the aspect, the property, the name
of the originator and the nature of any modification. In Table 4.2 an overview is given
of the projections available in ILWIS.
Now we will take a look at some map projections and see how the map of the world
is displayed.
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.
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 won’t 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.
• Click OK in the Coordinate System dialog box.
• Drag and drop coordinate system Centcyl to the map window in which the
map World is displayed.
• Note how the World map and the 20º graticules change.
• 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.
Table 4.2: 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 1920’s (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 Also called Cylindrical Equal Area. Mainly used for educational purposes.
Equal Area
Mercator Conformal. Designed for navigational use; standard for marine charts. Recommended use
for conformal mapping of regions predominantly bordering the equator. Often inappropri-
ately 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 coordi-
nates, 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 coordi-
nates.
Robinson Pseudo-cylindrical projection for world maps compromising distortion. Map is neither con-
formal nor equal area. Used for world maps, for example, by Rand McNally in Goode’s
Atlas for thematic world maps. Only used in spherical form.
Transverse Mercator Also called Gauss Conformal, or Gauss Krüger. 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 Hammer Aitoff Equal Area, variant of Lambert Azimuthal Equal Area.
Lambert Azimuthal Used for maps of continents and hemispheres. Also suited for regions extending equally in
Equal Area 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 confor-
mal nor equal area. Only one hemisphere can be shown. The earth appears as it would on
a photograph from space.
Conical
Albers Equal Area If the pole is one of the standard parallels, it is equal to Lambert’s Equal Area Conic.
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 Lambert Conformal Conic/Conical Orthomorphic (Lambert, 1972) (conformal). Extensively
Conic used for large-scale mapping of regions predominantly east-west in extent. Further widely
used for topographic maps.
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 1950’s.
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) Country projection. Transverse Mercator used in topographic maps of Italy.
Gauss (Colombia) Country projection. Transverse Mercator used in topographic maps of Colombia.
Gauss-Krüger Country projection. Transverse Mercator used in topographic maps of Germany.
(Germany)
General Perspective Shows the earth as seen from space. Projection is perspective.
Lambert Conformal Country projection. Lambert conformal conic projection used in topographic maps of
Conic (France) 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.
Van der Grinten 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.
Now the projection is such that the plane touches South America. The equator is no
longer a straight line. Only the 60º W meridian is now a straight line.
Now only the area surrounding the North Pole is displayed, in a very distorted way.
Some projections will also be shown that are useful for displaying world maps.
The world map is now displayed as if you look at the earth from space.
☞ • See the effect of the Plate Carree , the Mercator , the Mollweide and
the Sinusoidal projection.
• Try also other projections, if you like.
• When finished, close the map window.
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.
• Select the (target) Coordinate System: Lambert_AEA .
• Type for Output Segment Map: World_Lambert_AEA and click the
Show button. The segment map World_Lambert_AEA is created and the
Display Options – Segment Map dialog box is opened.
• Click OK. The map is displayed.
• Add a graticule to the map window and look at the effect.
• Close the map window when you are finished.
- The origin of each zone is located on a point at the equator, where it is intersected
by the central meridian of that zone.
- The Easting of the origin of each zone is assigned a value 500,000 m.
- Each zone has its own coordinate system.
Figure 4.3: UTM grid zone designations for the world, shown on an equidistant
cylindrical projection index map.
- 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:
- Ellipsoid: International.
- Projection: Transverse Mercator.
- Vertical Datum: Sea level.
- Horizontal datum: Provisional South America 1956.
- UTM zone: 19 K.
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.
• In the Select Projection dialog box, select the Projection: UTM and click
OK.
• 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.
• Clear the check box Northern Hemisphere.
• 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.
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 geo-
graphic coordinates.
First you will check whether the conversion from latitude/longitude to metric
coordinates of a certain UTM zone is correct.
Now you will check if the conversion of coordinates from UTM zone 20 to 19 is
done correctly.
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 .
• Compare the boundaries of the city polygon and segments.
- A map projection defines the relationship between the map coordinates and the
geographic coordinates latitude and longitude.
- 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 exercise, a rectangular part of the segment map Drainage will be saved as a
new segment map.
☞ • Expand respectively the Vector Operations item and the Segments item in
the Operation-tree.
• Double-click SubMap of Segment Map operation. The Sub Map of
Segment Map dialog box is opened.
• Select segment map Drainage in the list box Segment Map.
• Type 797200 for minimum X and 8078200 for minimum Y in the text box
Min X, Y.
• 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.
• Click OK. The map is displayed.
• Compare the Drainsub map with the map Drainage and close both map
windows when you have finished the exercise.
creates coordinate boundaries for the output map, based on the minimum and
maximum X and Y coordinates of the input maps. Note: If a user defines coordinate
boundaries that are smaller than the default, all segments of the input maps that fall
within these user-defined coordinates are copied, and the segments outside this
boundary are deleted.
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 option 2 for Number of Input Maps.
• 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.
• Type the Description: 100 meter contour lines in the entire
study area and click the Show button. The Display Options - Segment
Map dialog box is opened.
• 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.
Any vector map (with domain type class, ID, value) can be used as input map in this
operation. In fact there are three separate operations for points (Mask Points),
segments (Mask Segments) and polygons (Mask Polygons), but they work the
same. The output map uses the same domain, coordinate system and coordinate
boundaries as the input map. In this example, segment map City19 will be used to
extract only the grid lines.
☞ • Display the segment map City19 , and open the domain to look at the
domain items.
• Close the Domain Class editor and the map window.
• Double-click the Mask Segments item in the Operation-list. The Mask
Segments dialog box is opened.
• Select segment map City19 in the list box Segment Map.
• Type Grid19 in the text box Mask and in the text box Output Segment
Map.
• Click Show. The Display Options - Segment Map dialog box is opened.
• 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.
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.
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.
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.
When you want to generate a polygon map from a segment map, there are two
possibilities:
- Using the Segment editor. This method should be followed when you are not sure
whether the segment map is error free. In the Segment editor you can edit the
segments, make a check of them, and then polygonize them. This method was
explained in section 3.4.
- Using the Segment to Polygon (Polygonize Segment Map) operation. This
method can be followed when you are sure that the segment map is correct. The
advantage of this method is that it can be used in an automated way to periodically
update files.
The last method will be shown.
In this example a segment map Landunit will be used, similar to the map used in
section 3.4. To create a polygon map out of a segment map, all segments in the input
map should be correctly digitized, that means no dead ends, no intersections, no
double segments, etc. The output of this operation is a polygon map using system
domain Unique ID, which contains IDs such as pol 1, pol 2, pol 3,..., etc.
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 ID’s, 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 ).
☞ • Display polygon map Landuse , and click several polygons to find out their
names. Close the map window.
• Double-click Polygon to Segment in the Operation-list. The Boundaries
of Polygons dialog box is opened.
• 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 select-
ed 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.
• Select the Info check box and press OK.
• Click several segments to find out the meaning of the codes.
• Close the map window when you have finished the exercise.
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.
Point maps can be opened as a table, for instance by clicking the right mouse button
on the object and selecting Open as Table in the context-sensitive menu. When you
make the Command line visible in the table window, you can calculate with the
values in the columns.
- Creating a sub map of a vector map and merging two or more vector maps.
- Obtain more intermediate coordinates within segments in a segment map using the
Densify Segment Coordinates operation.
- Glueing of maps.
The resulting raster maps have the same domain as the corresponding source vector
map. Since the vector to raster operation is basically the same for point, segment or
polygon maps, only the Polygon to Raster operation is shown here.
Creating georeferences
In this exercise the same polygon map will be rasterized three times, using three
different georeferences with different pixel sizes, to show you the effect of the pixel
size on the final result. The three georeferences will have pixel sizes of 10, 25 and
100 meters.
☞ • Expand the Create option in the Operation tree and double-click the New
GeoReference item. The Create GeoReference dialog box is opened.
• Type for GeoReference Name: Cocha10 .
• Select the Coordinate System: Cochabamba .
• Type for Pixel size: 10 and for the Description: Georeference with 10
meter pixel size .
• 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.
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.
- 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.
☞ • Open the map Bolivia_mask , and find out the area that should be extract-
ed (expressed in first line, first column, nr. of lines, nr. of columns).
• Close the map window and double-click the SubMap of Raster Map opera-
tion 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.
• Make sure the Lines and Columns option is selected.
• Type 300 in the text box First Line and 375 in the text box First Column.
• Type 670 in the text box Number of Lines and 650 in the text box Number
of Columns.
• 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.
If the maps have different domains, the possible combinations for merging input
domains, are given in the Table 4.5. See the ILWIS Help topic Glue raster maps for
more information.
The output map is sized to allow all maps to fit in. In this way, you can glue adjacent
or partly overlapping georeferenced raster maps, derived from different sources. The
output map uses a new georeference in which all input georeferences fit. The map
uses the coordinate system and pixel size of the first input map. It is, therefore,
important to make a careful choice of the input map.
In case input maps overlap, users can define from which map the pixel values should
be used for the overlapping parts. By default, the pixel values of the first input map
are used.
Table 4.5: Possible combinations of domains of input raster maps and the resulting domain of
the output raster map.
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.
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 map’s 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.
• Double-click Mirror Rotate in the Operation-list. The Mirror Rotate dia-
log box is opened.
• Select raster map View3D in the list box Raster Map and select the option
Mirror Horizontal.
• Type View3D_ok in the text box Output Raster Map.
• Click Show. The map View3D_ok is created
• Click OK in the Display Options - Raster Map dialog box. The map is dis-
played now in the correct form.
• Close the map window when you have finished the exercise.
Resampling
In many cases, the raster operations shown above will not be sufficient to get your
imported raster data in the correct form, to combine them with other maps. The pixel
size may be different from the other maps, or the map may lack coordinates. To
overcome these problems, the map should be resampled to another existing raster
map in your data base. Resampling will be explained in more detail in chapter 6,
dealing with image processing. Here it is important to note that many of the tools,
originally designed for image processing, are equally valuable when working with
other types of raster maps.
Suppose that you have received a geological map from someone else. Suppose that
apart from the digital file you also received a table with a series of control points. If
these were missing you would have to find out control points yourself by comparing
the raster map with a topographic map, or with another digital map. This is shown in
chapter 6. Here it is assumed that 10 control points are known. The next thing to do is
to make a georeference for this map, using the control points listed in Table 4.6.
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.
X Y Row Column
797955 8088615 127 165
804195 8087085 229 581
804915 8080185 689 629
797415 8080335 679 129
800078 8083830 446 306
802343 8081985 569 457
800835 8073450 1138 357
796455 8072865 1177 65
796050 8083628 460 38
802973 8089080 96 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 .
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 .
Editors can only be used to edit source maps. Dependent maps (e.g. the raster map
created by rasterizing a polygon map) and maps which are defined in their properties
form as read only, cannot be edited. Conceptually, it would not be a good idea to edit
a dependent map, since such a map is derived from source maps, which are not
changed in that case. To edit a dependent map, you should either edit the source
map(s) and use the Make Up to Date button in the dependent map’s Properties
sheet or you should break the dependency. To edit a read only map, clear the Read-
Only check box in the Properties sheet of the read-only map.
Editing raster maps using the Pixel editor is only useful if you want to make
relatively small changes to a raster map. Since you can only edit pixel by pixel
(including the possibility to select multiple pixels, and rectangular groups of pixels),
changing irregular shapes in a raster map is rather time consuming. In that case it
would be better to convert the raster map to vector (as will be explained in the next
exercise) and do the editing in the Segment editor. Another option would be to
digitize the areas that should be changed as lines or polygons, rasterize these vector
maps and use them in a map calculation statement to mask away the wrong areas in
the raster map. In this exercise you will edit a raster map (called Wrong ) with a class
domain.
☞ • 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.
• Zoom in on the word EDIT and click the Normal button.
• Select with the left mouse button a part of the letter E which is surrounded
by green pixels by dragging a box.
• Press the right mouse button and select Edit from the Context-sensitive
menu. The Edit dialog box is opened.
• Select for Class Name: Class 2.
• 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.
☞ • Practice with these various options. Edit the map so that the word EDIT is
replaced by the pixel values of the areas surrounding it.
• Exit the Pixel editor by pressing the Exit Editor button.
• Close the map window when you have finished the exercise.
To convert raster data to vector data format, a 3x3 matrix moves over the input map
and assigns a code (class name, ID or value) to the center pixel of the matrix in the
output map, which depends on the class name, ID or value of the center pixel and its
4 or 8 neighbours. See chapter 9 for more information about 4 or 8-connectivity.
Undefined pixels will not be vectorized. The result of the conversion depends on the
homogeneity of the raster map and the pixel size compared to the size of the mapping
units. The program is provided with a smoothing facility, to remove the sharp corners
formed by the boundaries between mapping units of the raster map. Automatic
tunneling (see chapter 3) is performed on the coordinates of the vector data to delete
the redundant ones. In this exercise the raster map Slopeclass is converted to a
polygon map.
Now you will see the effect of converting a raster map to segments. When you con-
vert from raster to segments, only the boundary lines between mapping units are
stored, but in such a way that it is still possible to find out what the mapping units on
both sides of the line are.
The output map resulting from the raster to segment conversion uses a unique ID
domain and an attribute table with 3 columns: Area1 , Area2 and Length . Area1
and Area2 have the domain of the input raster map and indicate the right and left
area. The column Length gives the length of the segment. For example, Boundary1
is the segment between an area with class a and an area with class b (Figure 4.5).
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.
• Make sure the check box Single Name is cleared.
• Type Slopeseg in the text box Output Segment Map and type Segment
map slope class in the text box Description.
• 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.
- Copying a rectangular part of a raster map into a new raster map, using the
SubMap of Raster Map operation.
Changing domains of maps via the Properties sheet, is not recommended for
changing from one domain type to another (e.g. from domain class to domain value).
If you do that your file may become corrupt. For changing domain types, follow the
guidelines described below.
Take for example the polygon map Landuse , containing the land use types in the
study area. This is a class map.
☞ • 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.
• Press the Convert to identifiers button. The class domain is converted to an
identifier domain.
• Open the Properties sheet of the domain Landuse again. Now you can see
that it reads: Domain Identifier “Landuse”.
• Press the Convert to classes button. The ID domain is converted back to a
class domain.
The conversion from classes to identifiers is not very logical for the map Landuse ,
since each land use class contains various polygons. An identifier domain is generally
useful if each domain item is linked to one map feature (point, segment, polygon, or
group of connected pixels in a raster map).
There is, however, a way to convert a class map to a unique ID map, using the
Unique ID operation. This operation can be used to give a unique ID to all features in
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.
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.
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 ).
☞ • Open the polygon map Cityblock and double-click some units to find out
the information from the attribute table Cityblock .
In this case the conversion from identifier to value only makes sense when you want
to create for example a population map.
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.
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.
ID Class name
nr 1 Agriculture
nr 2 Agriculture (irrigated)
nr 3 Airport
nr 4 Bare rock
nr 5 Bare soils
nr 6 Forest
nr 7 Grassland
nr 8 Lake
nr 9 Riverbed
nr 10 Shrubs
nr 11 Urban centre
nr 12 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 .
• Select Domain Luse and click OK in the Properties sheet.
• Open the map Landimage and the domain Luse . Click a unit to find out its
ID. Change the name of this ID to the class name, according to Table 4.7.
• Change all the domain items and replace them by the land use type,
according to Table 4.7.
• Close the Domain Identifier editor and the map Landimage .
• Open the Properties sheet of the domain Luse and press the Convert to
classes button. Now a representation is also created with the same name as
the domain.
• 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.
This type of conversion is also quite common, after importing a Windows bitmap
.BMP or .TIF file. Similarly for the conversion from value to class, you should know
which pixel values represent which classes.
This is illustrated with map Landpicture that was imported with a picture domain.
It should be a class map, with information on land use types.
A recommended way to convert a map with a picture domain to another map with an
image domain is to use Map Calculation. On the Command line of the Main
window, type a statement like:
MapImage = MapPicture
Where MapPicture is the name of the map with the picture domain and MapImage
is the name of the output map. In the Raster Map Definition dialog box that follows
directly after you typed the statement, select the system domain Image.
The conversion can also be done by changing the domain type in the Properties
sheet. This can be demonstrated with the hillshading map of Bolivia (Hillshad ),
which was imported in section 4.1 from Windows bitmap .BMP format. This map
has a picture domain. It will be converted to an image domain.
☞ • 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.
• Select Domain Image and click OK in the Properties sheet.
• Open raster map Hillshad again. From the Display Options – Raster
Map dialog box you can see that the map has domain Image .
• Close the map window when you have finished the exercise.
* Domain type value includes all value domains (e.g. system domains Image, Radar, Bool, Bit, etc. and
your own value domains).
- Conversions between class and ID maps, is easily done by pressing the Convert to
Identifiers button or the Convert to Classes button, in the Properties sheet of
the domain.
- Conversion from a value domain to a class/ID domain, can be done either by using
the Slicing operation (when the value map has a precision other than 1), or by
creating an ID domain, and replacing this in the Properties sheet of the map
(when the value map has a precision of 1).
- Conversion from a picture domain to a class domain can be done, by pressing the
Convert to Classes button in the Properties sheet of the domain. Conversion to
ID domain can then also be done (see above).
- Conversion from a color domain to an image domain can be done with the Color
Separation operation.
In chapter 2 you have seen the basic concepts of ILWIS for Windows. One of the top-
ics of that chapter dealt with the relationship between spatial data (maps) and attrib-
ute data (tables). This chapter is completely dedicated to the use of tabular data in
ILWIS.
Before you start it is good to repeat some of the conclusions that were obtained from
the first chapter (see Figure 5.1):
- An attribute table is linked to a map through its domain.
- An attribute table can only be linked to maps with a class domain, an ID domain or
a Bool domain.
- An attribute table may contain several columns. Each of these columns can have a
class, ID or value domain (or other special domains, such as color, string, bool etc.)
Figure 5.1: Schematic relationship between spatial data (point- segment-, polygon- or raster
maps), and attribute data (tables, containing various columns).
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.
☞ • Open polygon map Cityblock and double-click a few different city blocks
to know their contents.
• Open domain Cityblock and look at the contents.
• Close the domain and the map window and open the table Cityblock .
You will see that each city block is coded by a unique number, so that it can be iden-
tified 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).
- Population : this is a column with a value domain, which contains the number of
persons living in each city block. Note that some city blocks have a population of 0
because there are no houses in that block.
☞ • 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 statisti-
cal data for value columns: minimum value, maximum value, average, standard devi-
ation 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 actu-
al situation, but the population column and the data related to the districts that will be
shown later have been made up for this exercise.
You will first see how to create a table in ILWIS: a table linked to the Identifier
domain District , with information regarding the cadastral districts of the city of
Cochabamba, such as:
- Housecon : the average dwelling condition, or building quality, within the district.
This will be a class domain with the classes bad, moderate and good.
- Schools : the number of schools within the district. This is a value domain.
- Pchildren : the percentage of the population in the district that consists of school-
children between 4 and 18 years old. This is also a value domain.
The full table is listed below:
Table 5.1: Information per district of the city of Cochabamba.
District Housecon Schools Pchildren
nr 1 Moderate 8 31
nr 2 Good 7 22
nr 3 Good 2 24
nr 4 Good 10 18
nr 5 Good 10 15
nr 6 Moderate 4 29
nr 7 Moderate 5 34
nr 8 Moderate 5 33
nr 9 Moderate 8 32
nr 10 Bad 5 42
nr 11 Moderate 5 35
nr 12 Bad 1 40
nr 13 Bad 7 35
☞ • Expand the Create item in the Operation Tree and double-click the New
Table item. The Create Table dialog box is opened.
• Type District in the text box Table Name.
• Type the description: Information related to the cadastral
districts .
• Select the domain District from the list box Domain.
• Click OK.
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 ).
The first column will be Housecon . This column will have a class domain with three
classes (Bad , Moderate , and Good ).
☞ • Open the Columns menu and select the Add Column command. The Add
Column dialog box is opened.
• Type Housecon in the Column Name text box.
• 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.
• Type the description: Housing condition . Click OK.
• The Domain Editor is opened. Open the Edit menu and select the Add Item
command. The Add Domain Item 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 .
• Close the Domain Editor.
• Type the description in the Add Column dialog box: Average housing
condition per district .
• Click OK in the Add Column dialog box.
☞ • 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).
☞ • 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 .
• Type the description: Number of schools per district . Click OK.
• Enter the values for the number of schools as given in Table 5.1.
The last column to add is called: Pchildren (the percentage of the population con-
sisting of schoolchildren).
☞ • Add the column: Pchildren . For the domain of this column select the sys-
tem domain Perc, with a value range of 0 to 100 , and a precision of 1.0 .
• Type the description: Percentage school children per district .
• Click OK.
• Enter the values as shown in Table 5.1.
• Close the table window.
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.
- An attribute table can be linked to other data objects that have a Class domain, an
ID domain or a Bool domain.
- It is also possible to create tables with a domain None . In that case you cannot link
the table to other objects.
- An attribute table may contain several columns. Each of these columns can have a
class, ID or value domain (or other special domains, such as Color, String, Perc,
Bool etc.).
The Import Table Wizard helps you to import different table formats. In this exer-
cise we will import a dBase file which contains the number of houses in each city-
block in Cochabamba.
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 Select Table Format page, make sure the right table format is select-
ed: Dbase DBF. Click Next.
• On the Edit Column Details page, check the properties of all columns.
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.
☞ • For the Name column, under New Domain, double-click the default Yes and
change it into No .
• Accept the default Domain Type (ID ).
• Under Domain, double-click the default Name , and select domain
Cityblock .
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 com-
mand.
• 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.
The formulas can be typed on the command line of a table window. A table calcula-
tion formula consists of an output column that will contain the result of the calcula-
tion, the definition symbol (=) or the assignment symbol (:= ), and an expression as
in:
Outputcolumn=Expression
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 limi-
tation on length. Column names may not contain any of the following characters: \ /
: * ? < > | “ %
However, when a column name:
- starts with a digit, or
- contains spaces, or
- contains any of the following special 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 depend-
ing 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-to-
date. Fields of a dependent column cannot be edited directly; results of calculations
are protected.
A formula can be very long. You can move within the formula using the left and right
arrow keys, in combination with the CTRL key, or by using the mouse pointer. To
retrieve a previous formula, open the listbox of the command line or use the arrow up
key on the keyboard: this is called the history.
For more information about the Pocket Line Calculator and the use of complicated
expressions, refer to ILWIS Help, topic Table calculation: pocket line calculator.
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
column, width of the column, number of decimals and description. The value
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 col-
umn. 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 dialog box is closed, and the program executes the formula. The results are dis-
played in the column Areaha .
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.
☞ • 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.
• Type the following description in the Column Properties dialog box:
Population density (persons per hectare) .
• Click OK.
The table window now also contains the column Popdens with the population densi-
ty 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.
☞ • Type the following formula on the command line:
Highdens=Popdens>200 ↵
• The Column Properties dialog box is opened.
• Type the following description: Population density highe r 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 opera-
tor is used to find the city blocks that have a population density between 200 and 300
persons per hectare.
Conditional function
The examples that we have used for the relational and logical operators all give out-
put values, which are either true or false or undefined. In practice we use these opera-
tors 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.
The resulting column (Highdens3 ) contains values for those records where the con-
dition (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 for-
mulas 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 writ-
ten as such a nested IFF function.
When you use nested IFF functions, you should be careful in determining how many
closing brackets you must use (always as many closing brackets as there are IFF’s in
the formula), and where you put them.
Before continuing it is better to delete the columns that were made in this exercise,
except for the column Popdens .
The number of operators and functions that you can use for class or ID columns is
quite limited. Of course, arithmetic operators make no sense (you can hardly divide
one word by another). Relational operators are only limited to two: = (check whether
two names are equal) and <> (check if they are unequal). Logical operators and con-
ditional functions, however, are used extensively on class or ID columns.
Some examples are shown below. The first example is finding out which city blocks
have a land use Residential and occur within the district nr 7 .
Now let us combine several operators and an IFF function. We will find out the city
blocks with either a residential or commercial land use in district nr 7.
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).
In situations 2, 3, and 4 you cannot simply use an existing domain for the output col-
umn. You should either add items to the existing domain, or you should create a new
domain, depending on the THEN and ELSE parts of the IFF function. In case 2 you
can add an extra name to the existing domain. In case 3 you can merge the two
domains, either by adding the items of one domain to the other or by making a new
domain which contains the items of both. In case 4 you can make a new domain
which contains both names.
When ILWIS encounters in an IFF function one of the first three possibilities, the
program will suggest that you use an existing domain. When you decide to use that
existing domain and press OK in the Column Properties dialog box, you will get a
warning, and you are asked whether you want to add the missing items to that
domain. However, it is not advisable to generate large domains with a mixture of
information. In many cases it is better to generate a new domain. To do so, you will
have to press the Create domain button in the Column Properties form.
Note that it is always possible to use the output domain String for all four situations
given above. However, it is not advised as a string column cannot be used in combi-
nation with a map.
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.
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.
Since this is quite a long formula we can do some tricks to shorten the equation. We
need to evaluate whether the district is larger then 3 and smaller than 10.
Unfortunately you cannot perform such relational operators on ID or class columns
(the column district is an ID column). So what we have to do is to change the names
of the column District , which appear to be numbers but are in fact IDs, to true
numbers. There are special functions for this.
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.
• Type the following formula on the command line:
Center=IFF(INRANGE(Distrnr,4,9),”Center”,”Not in cen-
ter”) ↵
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 can-
not 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 .
☞ • 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 col-
umn 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 coor-
dinates 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.
• Delete also the columns Rescomnr7 , Newlanduse , and Newlanduse2 .
• When you try to delete the column Distrnr , you will get a message that the
column is still in use. It is used to calculate the dependent column Center .
So before we can delete it, the dependency link should be broken.
• Double-click the column header Center . The Column Properties dialog
box is opened. Press the Break Dependency Link button. Confirm this by
clicking Yes in the next window.
• Delete the columns Center and Distrnr .
• Close table Cityblock .
- There is a similar set of operators and functions on value columns and on class, ID,
and string columns. You cannot mix values and strings in an output column. The
result column should be either value or string.
- On value columns we can use arithmetic, relational, and conditional operators, and
a whole set of functions, of which the IFF function is the most important.
- IFF(expression, then, else) statements are very common in ILWIS. IFF functions
can be combined into nested IFF statements.
- On class, ID or string columns we can use a smaller set of operators and functions
(some relational and conditional operators).
- When the result of an IFF statement is a string, you can have 4 possibilities:
IFF(expression, domain1,”?”),
IFF(expression, domain1,”name”),
IFF(expression, domain1, domain2), and
IFF(expression, “name”,”name”).
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 don’t have this column you can generate it by typing the following com-
! mand 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.
☞ • 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. ➥
ILWIS 3.0 User’s Guide 187
Attribute data handling
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.
• Close the table Cityblock .
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).
- Classification can be done with the CLFY function or the Column Slicing com-
mand on the Columns menu.
Column Statistics
Another option to calculate statistical values or to perform a statistical analysis using
one or two columns, is to use the Statistics command from the Columns menu.
On the command line of the table window, you can retrieve a statistical formula,
using the arrow up key. Replace the ? in front of the expression by an output column
name and a definition symbol (=), e.g. Outputcolumn=AVG(Inputcolumn).
You can find more information in ILWIS Help, topic Column Statistics.
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 environ-
mental 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.
• Click OK. The Graph Options dialog box is opened.
• On the Moist x Richness tab select Point for graph type and accept the
defaults by clicking OK. The Graph is displayed.
When you click in the graph window, ILWIS returns the corresponding X and Y
! values.
☞ • 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 pre-
dict 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.
• For the X-axis of the graph, select Moist.
• For the Y-axis of the graph, select Richness.
• Select Polynomial as the type of function.
• Type 2 for the number of terms to be used in the formula.
• Click OK. The Graph Options dialog box is opened.
• Make sure the graph type Line is selected, select a color for the line and click
OK.
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.
You will see a new column PredRichness , containing the predicted values for
species richness based on moisture availability of the even samples.
☞ • In the table window open the Columns menu and select the Statistics com-
mand.
The Column Statistics dialog box is opened.
• Select the statistical function Correlation.
• Select Richness for the first column, containing the observed values.
• Select PredRichness for the second column, containing the predicted values.
• Click OK.
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, posi-
tive 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 interpre-
tation purposes. A better option is to rasterize the point map and to choose an appro-
priate 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.
In several cases, you may want to take into account the value for the same unit in the
whole column or in sub-sets of records in a column. For example, you may want to
calculate the population density, not for each city block individually, but for an entire
district of the city. The functions that allow you to do such kind of operations are
called aggregate functions (see Figure 5.2). Aggregations are performed on:
- all records of a column, or
- all records that belong to the same group of records as determined by a key column
(also called a group-by column).
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 val-
ues 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
shown here. The use of the command line for operations will be explained in chapter
12. The result of an aggregation can be written into a new column of the same table,
into a new column of a new table, or into a new column of another existing table.
Some examples will be shown, again with table Cityblock . The first example is the
calculation of the total area of all city blocks.
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 col-
umn 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.
• Select for the Column: Area , the function: Sum.
• Select the check box Group by, and select the column District .
• Type as Output Column: Areadistrict . Click OK.
• Type the description: Total area of each district in the Column
properties dialog box. Click OK.
The values in the column Areadistrict now show different areas for different dis-
tricts.
☞ • 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.
• Sort the table again on the domain.
It is rather uneconomical to store the data from the column Areadistrict within
the table Cityblock . Out of 717 different records, there are only 13 different values
in this column. These values do not relate to the city blocks, but to the districts. To
reduce the data redundancy it would be better to store the results in the District
table (the one that you created in section 5.1).
☞ • Perform the same aggregation; use the same name for the output column, but
choose to write the output in the table: District .
• Open the table District and look at the result.
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 .
The new column Distrlanduse now contains the unique combinations of the dis-
trict numbers and the land use types. So now we can calculate with an aggregate
function the area occupied by each type of land use in each district. However, you
should first change the domain for the column Distrlanduse from string to a class
domain.
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 occu-
pied by several land use types.
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.
• Edit this formula so that it looks like:
Commercial=IFF(Landuse=“Commercial”,100*
Areadistrlu/Areadistrict,0)
• Press Enter. Select the domain Perc, and click OK.
• Then, edit the previous formula so that it looks like:
Institutional=IFF(Landuse=“Institutional”,100*
AReadistrlu/Areadistrict,0)
• Press Enter. Select the domain Perc, and click OK.
➥
➥ • 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.
• Sort again by Domain.
• Break the Dependency Link of the columns Institutional ,
Commercial , Residential , Areadistrlu , Distrlanduse ,
Areadistrict and Popdensclass , by pressing the Break Dependency
Link button in their Column properties dialog box.
• Delete the columns Popdensclass , Areadistrict , Distrlanduse and
Areadistrlu .
• Close table Cityblock .
The result of an aggregation can be written into a new column of the same table, into
a new column of a new table, or into a new column of another existing table.
To join tables you need two tables, one that receives data and one that provides data.
Furthermore, you need a common domain in the two tables.
When you want to combine information from two tables you may have one of the fol-
lowing four situations:
1. The domain of 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-A). You can directly obtain data
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).
3. The domain of the current table is the same as the domain of a key-column in the
other table from which you want to join a column. In this case you have two pos-
sibilities:
- The key column in the other table contains unique class names, ID’s 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, ID’s 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, ID’s or values. Fig 5.4-B (right): The column in
the other table does not contain unique class names, ID’s or values.
4. The domain of a column in the current table is the same as a domain of a key col-
umn 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).
Figure 5.5: The domain of a column in the current table is the same as a domain of a key col-
umn 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, ID’s or values. Fig 5.2-B
(right): The key column in the other table does not contain unique class names, ID’s
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.
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 col-
umn and click Finish.
• Click OK in the Column properties dialog box.
• Check the result and close the table Cityblock .
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
column in this table that you wish to use.
In this case you might thus have obtained the same result if you type on the com-
mand line:
Perimeter=Cityblock.hsa.Perimeter
Cityblock.hsa is the polygon histogram.
☞ • 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.
• From the Columns menu, select the Join command.
The Join Wizard is started.
• 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: 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 col-
umn 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.
• Make sure column District is selected as Key1 and click Next.
• Accept the Output Column Pchildren and click Finish.
• Change the value range in the Column properties dialog box so that mini-
mum= 0, maximum= 100 and precision= 1.0. Click OK.
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.
The information on areas and population is available in table Cityblock for each
city block. We also know for each city block in which district it is located. Thus we
can use the information from the table Cityblock and bring it into the table
District . But as table Cityblock contains 717 records, and table District
only 13, you will have to do an aggregation while doing the join operation.
To join information from table Cityblock into table District , you have to link
the table District through ‘group-by’ column District in the table Cityblock ,
which contains the columns of interest.
☞ • Make the table window that displays the District table the active window.
• From the Columns menu, select the Join command.
• Select for the Table: Cityblock , for the Column: Population . Click
Next.
• Read the Join Method page; in this case there is only one way of joining
possible. Click Next. ➥
➥ • On the Link between two tables page, select column District as Key2.
Click Next.
• On the Aggregation method page, select the aggregate function Sum.
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 dis-
! trict.
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.
☞ • 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.
• Close the table District and the table Cityblock .
- The domain of a column in the current table is the same as the domain of the table
from which you want to obtain data.
- The domain of the current table is the same as the domain of a column in the table
from which you want to obtain data.
- The domain of a column in the current table is the same as a domain of a column
in the table from which you want to obtain data.
If you did not succeed in the last exercise, or if you start with this exercise with-
! out 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 pre-
sented 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.
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 institu-
tional buildings.
☞ • 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.
• Select column Commercial from the Y-column list box.
• Click OK. The Graph Options dialog box is opened.
• Select Bar for the graph type and select a color for the Commercial bars.
• Make sure that for the Y-Axis, the Left axis is used.
• Repeat the same procedure for the graph of column Institutional .
You can change the display options of each of the graphs, by clicking a graph
tab in the Graph Options dialog box.
• Close the graph window.
• Close the table window.
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. Geo-
referencing remote sensed data refers to geometric distortions, the relationship
between an image and a coordinate system, the transformation function and resam-
pling techniques.
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.
To compare bands or to compare image bands before and after an operation, the
images can be displayed in different windows, visible on the screen at the same time.
The relationship between gray shades and pixel values can also be detected.
The pixel location in an image (rows and columns), can be linked to a georeference
which in turn is linked to a coordinate system which can have a defined map projec-
tion. In this case, the coordinates of each pixel in the window are displayed if one
points to it.
Remotely sensed data can be displayed by reading the file from disk line-by-line and
writing the output to a monitor. Typically, the Digital Numbers (DNs) in a digital
image are recorded over a numerical range of 0 to 255 (8 bits = 28 = 256), although
some images have other numerical ranges, such as, 0 to 63 (4 bits = 24 = 64), or 0 to
1023 (10 bits = 210 = 1024). The display unit has usually a display depth of 8 bits.
Hence, it can display images in 256 (gray) tones.
The following Landsat TM bands and maps of an area around Cochabamba (Bolivia)
are used in this exercise:
TM band 1 (0.45-0.52 µm): Tmb1 TM band 4 (0.76-0.90 µm): Tmb4
TM band 3 (0.63-0.69 µm): Tmb3 Landuse map: Landuse
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.
When you want to study details of the image, the zooming possibility can be used.
☞ • Open Tmb1 again, accept the defaults in the Display Options - Raster Map
dialog box and click OK.
• Maximize the map window by clicking the Maximize button .
• Click the Zoom In button in the toolbar to zoom in on a selected area.
• 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 but-
ton. Without releasing the button, drag the cursor a little bit to the second cor-
ner 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.
• Select the Zoom Out button in the toolbar and click (repeatedly) in the
map to zoom out.
• Click the Entire Map button to show the entire map in the map window
again.
☞ • 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.
• Click the Normal button in the toolbar to go back to the normal view.
• 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, select-
ing dark and bright toned pixels and note the changes in DN values.
• Close the map window.
It is possible to display in one map window a raster image together with one or more
point, segment or polygons maps but it is not possible to display two or more raster
images in the same map window.
There are more ways of displaying images in map windows. Three bands of Landsat
TM, of the area near Cochabamba, will be displayed using three different display
windows.
➦ • 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.
• Click the right mouse button on Tmb4 in the Catalog. A context-sensitive
menu appears.
• 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 win-
dow 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’, ‘medi-
um’ 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: Relative spectral responses per band for different land cover classes.
Fill in the table with classes: low, medium and high.
The digital numbers themselves can be retrieved through a pixel information window.
This window offers the possibility to inspect interactively and simultaneously, the
pixel values in one or more images.
There are several ways to open and add maps to the pixel information window.
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: DN values of different land cover classes of selected spectral bands. Fill in the DN
values yourself.
It is also possible to use the Command line of the Main window to add multiple
maps to a pixel information window.
☞ • 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.
☞ • Click the Measure Distance button on the toolbar of the map window,
or choose the Measure Distance command from the Options menu.
• 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.
- A single band image can be visualized in terms of its gray shades, ranging from
black (0) to white (255).
- Pixels with a weak spectral response are dark toned (black) and pixels representing
a strong spectral response are bright toned (white). The digital numbers are thus
represented by intensities from black to white.
- To compare bands and understand the relationship between the digital numbers of
satellite images and the display, and to be able to display several images, you can
scroll through and zoom in/out on the images and retrieve the DNs of the displayed
images.
- In one map window, a raster image can be displayed together with point, segment
or polygon maps. It is not possible in ILWIS to display two raster maps in one map
window.
- An image is stored in row and column geometry in raster format. When you obtain
an image 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, the relationship between row and column
number and real world coordinates can be established (see section 6.4).
The sensitivity of the on-board sensors of satellites, has been designed in such a way
that they record a wide range of brightness characteristics, under a wide range of illu-
mination conditions. Few individual scenes show a brightness range that fully utilizes
the brightness range of the detectors. The goal of contrast enhancement is to improve
the visual interpretability of an image, by increasing the apparent distinction between
the features in the scene. Although the human mind is excellent in distinguishing and
interpreting spatial features in an image, the eye is rather poor at discriminating the
subtle differences in reflectance that characterize such features. By using contrast
enhancement techniques these slight differences are amplified to make them readily
observable.
Contrast stretch is also used to minimize the effect of haze. Scattered light that reach-
es the sensor directly from the atmosphere, without having interacted with objects at
the earth surface, is called haze or path radiance. Haze results in overall higher DN
values and this additive effect results in a reduction of the contrast in an image. The
haze effect is different for the spectral ranges recorded; highest in the blue, and low-
est in the infra red range of the electromagnetic spectrum.
Techniques used for contrast enhancement are: the linear stretching technique and the
histogram equalization. To enhance specific data ranges showing certain land cover
types the piece-wise linear contrast stretch can be applied.
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 lin-
early 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 dis-
tribution at the lower and upper range.
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 limit-
ed range of 58 to 158. If these image values were directly displayed, only a small por-
tion 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.
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.
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?
☞ • 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.
• Close the dialog box and the histogram window.
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.
• Select Tmb1 as Raster Map, accept Linear stretching as stretching method
with a Percentage equal to 1.00 and type Tmb1_stretch as Output
Raster Map.
• 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.
• Click OK to display the map.
☞ • 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 lin-
ear stretching. Do not forget to set the minimum Stretch to 0 and the maxi-
mum Stretch to 255 for both images.
• Display the histograms of Tmb1 and Tmb1_stretch and study them.
• 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.
• Close the map and histogram windows.
! Indicate for each line in Figure 6.2, which linear stretch function is shown.
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.
Like all image enhancement procedures, the objective is to create new images from
the original image data, in order to increase the amount of information that can be
visually interpreted.
Spatial frequency filters, also often simply called spatial filters, may emphasize or
suppress image data of various spatial frequencies. Spatial frequency refers to the
roughness of the variations in DN values occurring in an image. In high spatial fre-
quency areas, the DN values may change abruptly over a relatively small number of
pixels (e.g. across roads, field boundaries, shorelines). Smooth image areas are char-
acterized by a low spatial frequency, where DN values only change gradually over a
large number of pixels (e.g. large homogeneous agricultural fields, water bodies).
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.
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 val-
ues. 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 high-
frequencies 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-enhance-
ment 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 gra-
dient). Laplacian filters are non-directional filters because they enhance linear fea-
tures 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.
The material used for this exercise consists of a Landsat TM 4 band: Tmb4 .
☞ • 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.
• Enter the values in the filter as shown in Table 6.5.
Table 6.5: Values for the low pass weighted mean filter.
1 2 1
2 4 2
1 2 1
☞ • Filter the image Tmb4 using the smoothing filter just defined. Select the cre-
ated 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.
Figure 6.3: Convolution, using a 3x3 filter with all coefficients equal to 1/9.
☞ • 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.
• Close both map windows afterwards.
A 3x3 high pass filter of the Laplacian type (the Laplace Plus filter) will be created
and applied to the image.
☞ • 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.
☞ • 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 win-
dows using a Gray Representation.
• Close the windows after finishing the exercise.
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 linea-
ments running north-south, an x-gradient filter can be used.
☞ • Create a directional filter according to the table below using the same proce-
dures as given in the former exercise.
- 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.
- 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) fil-
ters 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.
- 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.
The spectral information stored in the separate bands can be integrated by combining
them into a color composite. Many combinations of bands are possible. The spectral
information is combined by displaying each individual band in one of the three pri-
mary colors: Red, Green and Blue.
A specific combination of bands used to create a color composite image is the so-
called False Color Composite (FCC). In a FCC, the red color is assigned to the near-
infrared band, the green color to the red visible band and the blue color to the green
visible band. The green vegetation will appear reddish, the water bluish and the (bare)
soil in shades of brown and gray. For SPOT multi-spectral imagery, the bands 1, 2
and 3 are displayed respectively in blue, green and red. A combination used very
often for TM imagery is the one that displays in red, green and blue the respective
bands 5, 4 and 3. Other band combinations are also possible. Some combinations give
a color output that resembles natural colors: water is displayed as blue, (bare) soil as
red and vegetation as green. Hence this combination leads to a so-called Pseudo
Natural Color Composite.
Bands of different images (from different imaging systems or different dates), or lay-
ers created by band rationing or Principal Component Analysis, can also be combined
using the color composite technique. An example could be the multi-temporal combi-
nation of vegetation indices for different dates, or the combination of 2 SPOT-XS
bands with a SPOT-PAN band, (giving in one color image the spectral information of
the XS bands combined with the higher spatial resolution of the panchromatic band).
In ILWIS the relationship between the pixel values of multi-band images and colors,
assigned to each pixel, is stored in the representation. A representation stores the val-
ues for red, green, and blue. The value for each color represents the relative intensity,
ranging from 0 to 255. The three intensities together define the ultimate color, i.e. if
the intensity of red = 255, green = 0 and blue = 0, the resulting color is bright red.
Next to this, the domain assigned to color composites is the picture or the color
domain, as the meaning of the original data has disappeared.
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 val-
ues 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.
Table 6.8: Spectral ranges for selected TM bands and color assignment
for a false color composite.
Spectral range TM band number To be shown in
Near infrared
Visible Red
Visible Green
Which bands have to be selected, to create an interactive pseudo natural color com-
posite using three TM bands?
Write down the color assignment in Table 6.9.
Table 6.9: Spectral ranges for selected TM bands and color assignment
for a pseudo natural color composite.
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.
• Press the Open As ColorComposite button in the toolbar of the opened
map list. The Display Options - Map List as ColorComp dialog box
appears.
• 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 ILWIS 3.0 User’s Guide
Image Processing
How can the color differences between the two displayed images be explained?
☞ • Close both map windows when you have finished the exercises.
The different methods of creating a color composite are merely a matter of scaling
the input values over the output colors. The exact methods by which this is done are
described the ILWIS Help topic: “Color Composite: Algorithm”.
- In a False Color Composite (FCC), the red color is assigned to the near-infrared
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.
Remotely sensed images in raw format contain no reference to the location of the
data. In order to integrate these data with other data in a GIS, it is necessary to cor-
rect and adapt them geometrically, so that they have comparable resolution and pro-
jections as the other data sets.
The geometry of a satellite image can be ‘distorted’ with respect to a north-south ori-
ented map:
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 transfor-
mation 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.
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 geo-
reference, 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.
- Georeference Corners: Specifying the coordinates of the lower left (as xmin, ymin)
and upper right corner (as xmax, ymax) of the raster image and the actual pixel size
(see Figure 6.7). A georeference corners is always north-oriented and should be
used when rasterizing point, segment, or polygon maps and usually also as the out-
put georeference during resampling.
- Georeference Direct Linear: A georeference direct linear can be used to add coordi-
nates 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 sub-
sequent screen digitizing or to resample the photograph to another georeference
(e.g. to a georeference corners).
Figure 6.7: The principle of Georeference Corners. The coordinates are defined by the coordi-
nates 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.
The entered values for the X and Y coordinates, indicate the extreme corners of the
lower left and upper right pixels and not the center of these pixels.
For a number of points that can be clearly identified, both in the image as on a topo-
graphic map, the coordinates are determined. Reference points have to be carefully
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 refer-
ence 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.
In the following exercises we will use raster map Polder which is a scanned topo-
graphic 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-refer-
enced 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.
• Enter Flevo2 for the GeoReference Name.
• Type Georeference Tiepoints for the Flevo Polder in the text box
Description.
• Check if the option Georef Tiepoints is selected.
• Select Coordinate System Flevo (the one you created in the previous exer-
cise) and click OK.
Figure 6.9: The topographic map of the Flevo Polder (The Netherlands). Note that the coordinates are in kilometers.
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 inter-
sect (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 ).
• Accept the default Affine Transformation method and close the
Georeference Tiepoints editor by pressing the Exit Editor button in the
toolbar when the Sigma value is less than 1 pixel.
• 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.
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.
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).
☞ • 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.
• Click OK to close the Add Tie Point dialog box.
• Repeat this procedure for at least 5 other reference points.
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-
dom, and gives a measure for the overall accountability or credibility of the active tie-
points. The overall sigma value indicates the accuracy of the transformation.
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.
☞ • 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.
The value for a pixel in the output image is found at a certain position in the input
image. This position is computed using the inverse of the transformation that is
defined in the geo-referencing process.
Whether one pixel value in the input image, or a number of pixel values in that image
are used to compute the output pixel value, depends on the choice of the interpolation
method.
output image is determined by the value of the nearest pixel in the input image
(Figure 6.13 A).
- Bicubic. The cubic or bicubic convolution uses the sixteen surrounding pixels in
the input image. This method is also called cubic spline interpolation.
A B
Figure 6.13: Interpolation methods. A: Nearest Neighbour, B: Bilinear 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 georefer-
ence. First the map Polder will be resampled to the north-oriented georeference cor-
ners Flevo ; then you will resample the Spot images to the same georeference cor-
ners Flevo .
☞ • Display the scanned topographic map Polder and indicate with a drawing
how the map should be rotated.
• Close the map window.
• Double-click the Resample operation in the Operation-list in order to dis-
play the Resample Map dialog box.
• Enter Polder for the Raster Map and accept the default Resampling
Method Nearest Neighbour .
• Type Polder_resampled for the Output Raster Map, select
GeoReference Flevo and click Show. The resampling starts and after the
resampling process the Display Options - Raster Map dialog box is
opened. ➥
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 com-
bine the maps with other digitized information of the area (that is rasterized on geo-
reference Flevo as well).
- Remotely sensed images in raw format contain no reference to the location of the
data. In order to integrate these data with other data in a GIS, it is necessary to cor-
rect and adapt them geometrically, so that they have comparable resolution and pro-
jections as the other data sets.
- 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 resam-
pling, 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.
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, irre-
spective 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).
Table 6.10: Differences in DN values of selected bands and the ratio values.
In this section, ratioed images are created in order to minimize the effects of differ-
ences 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 moun-
tainous 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.
image might be useful for differentiating between areas of stressed and non-stressed
vegetation.
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.
➦ • 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.
• Close all windows after finishing the exercise.
In Figure 6.15 an example of scatter plots is given that show a strong positive
covariance (A) and zero covariance (B). Looking at the scatter plot, one could say in
other words, that the covariance values indicate the degree of scatter or shape of the
spectral cluster and the major direction(s). From Figure 6.15 A, an ellipse like
clustering can be deducted, indicating a strong positive correlation (an increase in a
value in one channel relates to an increase in a value of the other channel) and Figure
6.15 B shows a circle shaped cluster having zero correlation.
Figure 6.15: Scatter plots showing a strong positive covariance (A) and zero covariance (B).
Mean: 3.0, 3.0 (A) and 3.0, 2.3 (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.
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:
☞ • Display the three bands with the least correlation and combine them by con-
structing a color composite.
• Close all windows/dialog boxes when you finished the exercise.
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.
To perform PCA, the axis of the spectral space are rotated, the new axis are parallel
to the axis of the ellipse (Figure 6.16). The length and the direction of the widest
transect of the ellipse are calculated. The transect which corresponds to the major
(longest) axis of the ellipse, is called the first principal component of the data. The
direction of the first principal component is the first eigenvector, and the variance is
given by the first eigenvalue. A new axis of the spectral space is defined by the first
principal component. The points in the scatter plot are now given new coordinates,
which correspond to this new axis. Since in spectral space, the coordinates of the
points are the pixel values, new pixel values are derived and stored in the newly
created first principal component.
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
components and each new component is consisting of the widest transect which is
orthogonal to the previous components.
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.
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.
Write down in the table below (Table 6.13) the variance explained per component.
☞ • 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 princi-
pal component.
• In the Display Options - Raster Map dialog box select Gray as
Representation. Keep in mind the % of variance that is explained in this
single image. Accept all other defaults and click OK.
• Open image Tm PC2 and use again the Gray Representation.
• Open the File menu in the map window and choose Properties, select map
Tm PC2 and check the expression.
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?
☞ • Calculate Tm PC3 .
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.
☞ • 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.
• In the Display Options - Raster Map dialog box select Representation
Gray and click OK. The map is displayed.
• 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.
• In the Display Options - Raster Map dialog box select Representation
Gray and click OK. The map is displayed. ➥
ILWIS 3.0 User’s Guide 257
Image Processing
☞ • Close the map windows and the pixel information window when you have
finished the exercise.
This exercise makes use of the intensity component of the data sets used. Landsat TM
bands 3, 4 and 5 and IRS-1C Panchromatic are used of Dhaka City, the capital of
Bangladesh. Both images represent the beginning of 1996, the dry season. Landsat
TM has a spatial resolution of 30 meters but is resampled to a 10 meter resolution.
The IRS-1C image, with an original resolution of 5.8 meter is also resampled to 10
meters. Both images have the same georeference.
☞ • 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.
As the images have the same georeference, the fusion can be achieved through a
combined display of the two data sets in the form of a color composite.
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.
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.
- 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.
- 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.
- 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.
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.
The number of slices and the boundaries between the slices depend on the different
land covers in the area. All the DNs falling within a given interval in the input image
are then displayed using a single class name in the output map.
The image used in the exercise is a SPOT-XS band 3 of an area in the Flevopolder
near Vollenhove, The Netherlands.
Firstly, the ranges of the DN values representing the different land cover types have to
be determined. Secondly, a domain group with the slice boundaries, names and codes
has to be created.
In Figure 6.18, a clear distinction is possible between cover type A and cover types
B/C (slice with minimum number at position DN 1), as the distribution of the pixels
over the digital range is different from cover type B and C. If the distributions of
cover types B and C are studied, an overlap can be observed. To discriminate between
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.
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 Show in the Slicing dialog box. The Display Options - Raster Map
dialog box is opened.
• Accept the defaults by clicking OK.
• In the map window open the pixel information window and compare the val-
ues of the original map with the names in the classified map.
• Close the windows after finishing the exercise.
If you are not satisfied with the results, perform the same procedure again with a new
set of boundaries or by editing the existing slices.
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 classification jargon it is common to call the three bands “features”. The term
features instead of bands is used because it is very usual to apply transformations to
the image, prior to classification. They are called “feature transformations” and their
results are called “derived features”. Examples are: Principal Components, HSI
transformations, etc.
In one pixel, the values in the (three) features can be regarded as components of a 3-
dimensional vector, the feature vector. Such a vector can be plotted in a 2- or 3-
dimensional space called a feature space. Pixels which belong to the same (land
cover) class and which have similar characteristics, end up near to each other in a
feature space, regardless of how far they are from each other in the terrain and in the
image. All pixels belonging to a certain class will (hopefully) form a cluster in the
feature space. Moreover, it is hoped that other pixels, belonging to other classes, fall
outside this cluster (but in other clusters, belonging to those other classes).
A large number of classification methods exist. To make some order, the first
distinction is between unsupervised and supervised classification. For satellite image
applications, the second is generally considered more important.
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.
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:
☞ • 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 Code
water w
forest f
grass land gl
crop1 c1
crop2 c2
crop3 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 MapList created before is already filled out.
• Click OK in 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.
☞ • 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 con-
tinue 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):
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?
☞ • After you have finished the sampling, close all windows and return to the
ILWIS Main window.
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”.
- 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.
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.
☞ • In the Catalog, click the sample set Spot_classes with the right mouse
button and select Classify. The Classify dialog box appears.
• Select Box Classifier as Classification Method. Accept the default
Multiplication Factor. Type Spot_Box for the Output Raster Map name
and click Show. The classification will take place and the Display Options
- Raster Map dialog box appears.
• Click OK to display the result. ➥
272 ILWIS 3.0 User’s Guide
Image Processing
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.
results. After the classification process these classes can be merged again. If the
obtained results are still not according to expectations, incorporation of ancillary non-
spectral 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.
☞ • 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.
• Select Filter Type: Majority and Filter Name: Majundef .
• Enter Majority as Output Raster Map name, accept all other defaults and
click Show. The map Majority will be created.
• 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.
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.
After the process is finished, it is up to the user to find the relationship between
spectral and thematic classes. It is very well possible, that it is discovered that one
thematic class is split into several spectral ones, or, worse, that several thematic
classes ended up in the same cluster.
Various unsupervised classification (clustering) algorithms exist. Usually, they are not
completely automatic; 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. The process “builds” clusters as it is scanning through the
image. Typically, when a cluster becomes larger than the maximum size, it is split
into two clusters; on the other hand, when two clusters get nearer to each other than
the minimum distance, they are merged into one.
- 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.
- 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.
ILWIS provides a wide range of tools to perform operations on spatial data. These
tools enable you to transform your input data into useful information.
There are several ways in which the data analysis tools can be subdivided. We have
chosen the subdivision as suggested by Aronoff, 1989 (see Preface).
All operations in this category are performed on a single vector or raster map, often
in combination with attribute data.
Overlay operations
This group of operations forms the core of many GIS projects. With the help of these
operations, a number of maps are combined and new information is derived. New
spatial elements are created. This set of operations is only performed on raster maps
in ILWIS.
ILWIS has a powerful tool to combine maps, called Map Calculation. Many maps
can be combined at the same time using arithmetic, relational, or conditional
operators and many different functions in formulas that you can type on the
Command line of the Main window.
Two other important tools to overlay raster maps are the Cross operation, which
calculates the frequency of occurrence of all possible combinations of two maps, and
the use of a two-dimensional table, which is a matrix in which the user can define
how all classes of two maps should be combined.
Neighborhood operations
Where the overlay operations only consider the combination of raster cells in
different maps at the same location, the neighborhood operations evaluate the
characteristics of an area surrounding a specific location. These operations make use
of small windows of 3x3 cells, which perform one calculation on a center raster cell
and its eight neighbors. The result is stored in the central cell. Four types of
neighborhood operations will be treated in chapter 9: Neighborhood operations in
Map Calculation, Filtering (as was shown in the previous chapter for satellite
images, but now applied to thematic maps), AreaNumbering and Distance
calculation.
Map Calculation can be used for many operations. Map Calculation will be treated
as a block of exercises in the next chapter.
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter07, where the data files for
this chapter are stored.
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.
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
DEM shows the altitude of each raster cell, and the slope map shows the slope angle
in degrees. The procedure to construct such maps will be explained in chapter 10.
☞ • 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.
• Position the mouse pointer in the map 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 informa-
tion of that location in the pixel information window.
• Move the mouse pointer through the map to continuously display the infor-
mation.
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.
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.
All layers are now displayed in different colors on top of each other. Let us only
display one layer: Landuse .
☞ • 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 but-
ton pressed. You can read simultaneously the land use information in the map,
and all other information from the pixel information window.
• Find the answer to the following question:
What is the predominant geological unit that is used for irrigated agriculture?
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 infor-
mation?
- Are there parts of the city of Cochabamba that may be flooded?
- Which one of the geomorphologic zones (column zonation ) has the steep-
est slope? In which range are these slopes?
In this exercise you will learn how to display attribute data from a column in a table,
which replaces the original information in a map.
☞ • 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.
• In the Catalog, double-click polygon map Cityblock . Accept the defaults
in the Display Options - Polygon Map dialog box and click OK.
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.
☞ • 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, contain-
ing columns of the attribute table Cityblock .
• Select the column Landuse . This column contains the dominant land use
type of each cityblock.
• Select the option Representation. The representation City_Landuse will
appear in the list box to the right of the word Representation.
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 .
☞ • 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 win-
dow. 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 col-
umn 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 dis-
played according to the districts of the city.
• Check the content of the map by clicking a few different units.
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 .
• Check the contents of the map window.
• Close the map window after you have finished the exercise.
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.
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 .
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*
• Click OK in the Display Options – Polygon Map dialog box.
• Now only four units of the map are displayed: Bare rock , Bare soils ,
Agriculture and Agriculture (irrigated) .
• Close the map window.
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.
For more information about using wildcards in Mask, we refer to the ILWIS Help
topic How to use masks.
- In section 7.1, you practiced with the pixel information window. The pixel
information window allows you to read data from many maps and tables
simultaneously, for the XY-coordinate that you point at with your mouse pointer.
- In section 7.2, you displayed a map by one of its attributes. An attribute table
should be linked to the map, and the column values that you show may use a
representation.
- Both vector and raster maps that have a class domain, an identifier domain (ID
domain) or the Unique ID domain, and that have an attribute table linked to it, have
the possibility to display attributes instead of their own classes or IDs.
- You can also use a Mask to selectively display some classes, IDs or values of a
map.
Figure 7.2: Examples of data retrieval and classification using different MapCalc
formulas (see the following exercises for explanation).
Suppose you are interested in defining the location of the Bare rocks in the area.
This can be done by selecting the mapping units with a MapCalc formula.
☞ • 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
rock ). Or, if the land use is not bare rock, then the pixels in the output map will be
classified as undefined, indicated by the “?“ sign. The resulting map Rocks is also a
class map and uses the same domain (Landuse ) as the input map.
☞ • 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 sug-
gested 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.
As you can see the pixels in a raster map with a Bool domain can only be True or
False. Undefined pixels in an input map remain undefined in the output map. This is
logical, because if you do not know what the land use type is (that is the meaning of
the undefined values), you cannot say whether it is grassland or not. A Bool domain
thus also allows undefined values. This is different for a similar domain type called
Bit. The Bit domain allows only two conditions: 1 (true) or 0 (false), but it doesn’t
allow undefined values.
If you use the Bit domain, undefined values also become 0 (false). It is generally
better to use the Bool domain.
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 Raster Map Definition dialog box is opened.
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.
☞ • 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.
• Change the colors of the units: double-click Land in the Layer
Management pane. The Edit Repr. Item dialog box appears. Change the
color to Green ; double-click Water in the Layer Management pane and
change the color to Blue in the Edit Repr. Item.
• 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.
This is called a nested IFF statement: one IFF statement within another.
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.
- 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 so-
called Boolean statement, which can either be true or false.
- Data retrieval with a Map calculation formula for vector maps is rather inefficient.
The same information can be found easier by displaying the vector map with a
mask.
- Data retrieval with a Map calculation formula is required in those situations where
you want to use the result map in other calculations.
- For value maps, the problem of complex classifications can be solved by using a
special operation called Slicing.
In this exercise we have only seen some aspects of the Map Calculation functionality.
In chapter 8, dealing with overlay operations, there will be a more in-depth discussion
on the use of Map calculation.
Raster, polygon, segment or point maps with the domain type class, ID, Unique ID, or
group can have an attribute table with additional information on the elements in the
map. The relationship between the table and the map is provided by their common
domain.
When a map is linked to an attribute table, an attribute map can be created based on
the columns in the table. In other words, a map linked to an attribute table can be re-
classified by its attribute data. The domain type of the column is selected for the new
map. The data in the new map represents the information of the column, which can
be values, class names or IDs. An example of a reclassification using an attribute
table is shown in 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
of the columns in this table Landuse shows the dominant land use class for each city
block.
The Landuse column is used to reclassify the polygon map and create a polygon
map with domain type class representing the land use in the city.
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 .
☞ • 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.
• Close the map window and the pixel information window.
An attribute map can also be made by typing an expression on the Command line of
the Main window. You will now use the Landuse raster map, showing the land use in
the entire study area (not just within the city), and the column Landvalue from the
accompanying table Landuse to reclassify the map.
☞ • Position the mouse pointer on the Command line of the Main window and
type the following command:
Landvalue=Landuse.Landvalue ↵
• Click Show in the Raster Map Definition dialog box.
• Display the map Landvalue with a Pseudo Representation, and stretch
between 100 and 750 . Close it when finished.
- The attribute table and the map have the same domain. The table contains columns
with attribute information on the units of the map.
- Each of the columns in an attribute table also has a certain domain (either another
class domain, an identifier domain, or a value domain).
- You can substitute the classes of the original map by the attribute values from one
of the columns in the attribute table. The new map always uses the same domain as
the selected attribute column.
- You can make a reclassification using a dialog box, or using the Command line.
In such a case it is much easier to use a so-called classify table. A classify table
contains only the input boundary values and the output class names. In ILWIS the
concept of classify tables is applied in the Slicing operation (Figure 7.4). The classify
table in ILWIS is called a Group domain; it contains the input boundary values and
output class names.
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; it lists the upper boundary values of the
groups and the group names.
Figure 7.4: Process of the Slicing operation using DEM as an input map.
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.
The raster map Dem has a domain type value in which pixel values refer to the height
of the terrain.
☞ • 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.
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 3000 in the Upper Bound text box.
• 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.
☞ • 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.
☞ • Close the Representation Class editor when you are satisfied with the col-
ors.
• Close the Domain Group editor.
• Click the Show button in the Slicing dialog box. The Display Options -
Raster Map dialog box is opened.
• 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 ).
• Close the pixel information window and the map window.
- You can make a value map appear classified by creating a new representation value
or gradual for it (temporary classification).
- A value map can be permanently classified with the Slicing operation. The
operation requires a group domain. A group domain is a special class domain
containing the names of the classes and the boundary values.
- To classify a map, you can also use the CLFY function and a group domain.
- A group domain can also be used for classifying values in tables (see chapter 5).
Other statistical operations, which can be performed on point maps, such as Spatial
Correlation and Pattern Analysis, will be treated in chapter 11, together with the
various point interpolation techniques. There are a series of calculations that can be
done with the coordinates of point maps. An overview of these is given in ILWIS
Help, topic Point maps, Map calculation special: calculations on point data.
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.
☞ • 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.
• Type for the GeoReference Name: Cochabamba400 .
• Type for the Description: Georeference with 400 meter pixel
size .
• 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.
• Close the map window.
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.
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.
• Close the table window.
Check the ILWIS Help topic Table calculation: Special calculations, for other
useful functions to calculate with coordinates of a point map.
- A point histogram for a point map with a value domain shows the number of points
with the same value, as well as the cumulative number of points (all points with the
same value or a smaller value)
- The Point Density operation calculates the number of points that fall within the
same pixel. It is useful when you want to combine very closely spaced point data
with raster maps having a relatively large pixel size.
- With the distance tool distances and directions (angles) can be measured. When the
map uses a coordinate system of type projection with an ellipsoid and/or datum
also the Ellipsoidal Distance and Ellipsoidal Azimuth are listed in the Distance
message box. When the coordinate system uses a sphere, then the Spherical
Distance (distance over the sphere) and the Spherical Azimuth are listed.
- The function Mapvalue allows the extraction of thematic information from a map
at a specific location.
☞ • In the Catalog, click with the right mouse button on segment map Faults .
• Select Statistics, Histogram from the context-sensitive menu. The
Calculate Histogram dialog box is opened.
• 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.
You will see that each segment now has a different code.
You can now find the most important faults. For example, the faults with a length
more than 5 km.
☞ • 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 .
• Close the table window.
• In the Catalog, double-click segment map Fault_ID . The Display Options
- Segment Map dialog box is opened.
• Select the check box Attribute, select the column Mainfault and select
White as False Color.
• Click OK. Only the main faults are shown.
• Close the map window.
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 num-
ber 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.
☞ • 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 Catalog click with the right mouse button on segment map
Drainage .
• Select Rasterize, Segment Density from the context-sensitive menu. The
Segment Density dialog box is opened.
• Select the check box Mask and type the mask Drainage .
• Select the Georeference Cochabamba . Type the Description: Density of
drainage lines per pixel .
• Click Show.
The drainage density is now being calculated. After that the Display Options -
Raster Map dialog box is opened.
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
know the drainage density of the different catchments, we need to overlay the raster
map of the catchments with the segment density map that we have just created, using
the Cross operation. This will be demonstrated when we deal with the Cross
operation in the next chapter (section 8.4).
- A segment histogram for a segment map with a value domain, shows the number,
and the length of segments with the same value, as well as the cumulative number
and cumulative length of segments (all segments with the same value or a smaller
value).
- A directional histogram shows the number and the length of segments oriented
between west and east.
- The data from a directional histogram can be displayed in the form of a Rose
Diagram.
- The Segment Density operation calculates the length of segments per pixel. It is
useful when you want to overlay this map with another thematic raster map (having
a class or ID domain) in order to calculate the segment density for each mapping
unit, using the Cross operation.
If you need to know the area and the perimeter of individual polygons, you need to
convert the map to unique identifiers, with the operation Unique ID, in a similar
procedure as explained in the previous section for segment maps. We already have a
polygon map with unique IDs in the data set: the city block map Cityblock .
Let us have a look at the histogram of a value map: Dem (the Digital Elevation
Model).
When you display the graph of the histogram (X-column: Value , Y-column: Npix )
you see the frequency of occurring values in the maps.
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). Let’s 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.
Let us now look at the histogram of a raster map with a class domain Landuse .
Part of the raster map Landuse contains question marks (?). These are undefined
values for which no land use information is available.
We can find out how many pixels have the undefined value by looking at the
Additional Info, which can be displayed from the View menu.
There is one more thing to know about the histogram of a raster map: the areas
calculated from a raster map are less accurate than those of a polygon map. We will
compare the areas of the same land use units, one calculated from a raster map and
the other one calculated from its polygon map.
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
from the polygon map. This is caused by the fact that a pixel in a raster map can only
belong to one land use type. During the rasterization, the program will look whether
more than 50 percent of a pixel is occupied by a certain land use type (for example:
forest). If that is the case, then the pixel is classified as forest. If the pixel was
actually covered 51 percent by forest and 49 percent by shrubs, this means that the
actual area of the shrubs is less in the raster map than in the polygon map. For forest
it is the reverse. The combined effect of all these underestimations and
overestimations of the area will result in the differences that are shown in column
Area_difference .
So, when all the raster maps that you are using are derived from polygon maps it is
more accurate to use the areas of the polygon maps instead of the raster maps.
However, if some of the maps were not derived from polygon maps (for example the
map Dem ), then it is better to use raster map histograms for all maps.
- Histograms for raster maps with a class or ID domain show the number of pixels,
the percentage of the total number of pixels (with or without the undefined ones)
and the area for each class.
- Histograms for raster maps with a value domain also show cumulative percentage
and cumulative numbers.
- The number of pixels with undefined values are not shown in histograms. Column
Npixpct gives the percentage of pixels in each class as part of all pixels in the
map (including the undefined ones). Column Pctnotund gives the percentage of
the pixels in each class as part of all defined pixels in the map (thus disregarding
any undefined pixels).
- Histograms are dependent data objects: When the input map changes, the histogram
will be recalculated.
In the previous chapter we have seen a number of basic spatial analysis operations
used for the retrieval, (re)classification and measurement of point, segment, polygon,
and raster maps. All operations described in that chapter dealt with single maps. In
this chapter we will look at another set of operations dealing with the combination of
several maps. These operations can be grouped together as overlay operations.
Overlay operations are part of most spatial analysis processes and generally form the
core of GIS projects. These operations combine several maps and thus give new
information that was not present in the individual maps. In overlay operations new
spatial elements are created on the basis of multiple input maps.
Overlay operations are only performed on raster maps in ILWIS. The raster data
structure is particularly suitable for such operations, since all maps used in the
analysis have the same georeference. They have the same number of pixels, ordered
in lines and columns, the same pixel size and the same coordinates. So when maps
are combined, the program can look pixel by pixel to the values in the different maps.
ILWIS has a powerful tool for combining maps, called Map Calculation. Many
maps can be combined at the same time using arithmetic, relational, or conditional
operators and many different functions. Map Calculation formulae are typed on the
Command line of the Main window of ILWIS.
Other important tools for the overlay of raster maps are the Cross operation, which
calculates the frequency of occurrence of all possible combinations of two maps, and
the use of a Two-Dimensional Table, which is a matrix in which the user can define
how all classes of two maps should be combined.
Before you can start with the exercises, you should start up ILWIS and change to the
sub-directory C:\ILWIS 3.0 Data\Users Guide\Chapter08, where the data files for
this chapter are stored.
The formulae are typed on the Command line of the Main window (see Figure 1.1)
or using the dialog box of the MapCalc operation. A Map Calculation formula or
statement to be executed consists of an output map name that will contain the result
of the calculation, the definition symbol (=), or the assignment symbol (: =), and an
expression:
Output_map = Expression
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.
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.
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”.
Arithmetic operators
Arithmetic operators are the simplest operators. They are used for multiplication,
division, subtraction or addition of maps and/or constant values (see Table 8.2). It is
obvious that arithmetic operators can only be used on value maps, and not on maps
containing classes.
Table 8.2: List of the ILWIS arithmetic operators used in the MapCalc with a domain type
value or image.
Syntax Operation Example
+ Add a +b
- Subtract a -b
* Multiply a *b
/ Divide a /b
^ Exponential operator; POW(a,b); ab a ^b
a MOD b Returns the remainder of a divided by b (e.g. returns 1 if a=10 and b=3) a MOD b
a DIV b Returns the quotient of a divided by b (e.g. returns 3 if a=10 and b=3) a 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
Relational operators
Table 8.3: Relational operators used in MapCalc for value or image maps.
Only the first and the last one can also be used for class or ID maps.
Syntax Operation Example
= eq Equal to a =b
< lt Less than a <b
<= le Less than or equal to a <= b
> gt Greater than a >b
>= ge Greater than a >= b
<> ne Not equal to a <> b
Relational operators (see Table 8.3) test whether one expression is larger than,
smaller than, equal to another expression, etc.
Logical operators
Table 8.4: Logical operators used in MapCalc. They can be used on maps, with
all types of domains.
Syntax Operation Example
AND Returns true if both expressions a and b are true. (a) AND (b)
OR Returns true if one or both of the expressions a and b is true. (a) OR (b)
XOR Returns true if only one of the expressions a and b is true. (a) XOR (b
NOT Returns true if expression b is false. NOT (b)
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.
When a pixel in MapA has class name Forest and at the same time this pixel in
MapB has a value less than 500 , assign value True (1) to this pixel in the output
map (MapD ). Assign value False (0) to all other pixels.
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:
Output_map 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.
IFF 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.
Some examples of the use of conditional functions in ILWIS are given in Figure 8.4.
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.
1. The price of the land will be 100 percent of the average value when located on
slopes of less than 20 degrees, and 70 percent when located on slopes of more
than 20 degrees. Slope information is stored in the map Slope .
2. The price of the land will be 40 percent of the average value when it is located on
an active landslide or in an area with high erosion, and 60 percent when located
on an old landslide. For this criterion we need the geomorphologic map
(Geomorphology ).
When evaluating the combination of criteria we only look at the criterion, which will
lead to the lowest land price. So if a piece of land is located on an active landslide,
the land value is only 40% of the average price. If the same piece of land is also
located on a slope more than 20º, which would lead to a decrease of 70% of the
average, the value of the land is still 40% of the average, since 40% is less than 70%
of the average land price. This is why we will treat the two criteria independently
(using the same land price data), and obtain the final result by taking the minimum of
the two.
Please keep in mind that the objective of this exercise is not that you learn about an
application - for that the problem is far too hypothetical - but that you learn to work
with Map Calculation formulae. The ILWIS Applications Guide focuses more on
applications than on tools.
Before we start with the analysis using Map Calculation formulae, let us first have a
look at the input data with the pixel information window.
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.
☞ • 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.
• Display map Landvalue with Representation Pseudo and close it when
you have seen the result.
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.
• Display map Landvalue1 with Representation Pseudo and close it when
you have seen the result.
Now let’s 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.
For clarification purposes, we used capitals in the expression but you can type small
letters.
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 ) ↵
• Click Define in the Raster Map Definition dialog box.
• To visually compare maps Landvalue and Landval_combined , open
both maps with Representation Inverse and Stretch 1-15 .
• Use the pixel information window to find out the values in both maps.
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
error in the names of classes in a formula. For example if you write the following
formula:
Result = IFF(Landuse=“Forrest” , Landuse , “?”)
This formula results in a map with undefined values, since the correct class name
is Forest . This can be corrected by changing the definition of the output map, and
recalculating it.
- Calculated values in an output map, fall outside the value range defined in the for
the output map. For example, when you write the following formula:
Result = Dem*10 , and select a value range of 0 to 1000 for the output map.
This formula results in a map with undefined values, since the value range of the
Dem was 2500 to 4600, and the expected output values should have the value range
25000 to 46000. This can be corrected by increasing the value range for the output
map, and recalculating the map.
So when you obtain undefined values in an output map, you should check one of
these four possibilities.
Special emphasis should be paid to the use of undefined values in IFF functions. If
you use an IFF function that has the form IFF (a , b, c) , you can have the following
possibilities:
- Statement a is true, so the result will be b,
- Statement a is false, so the result will be c, or
- Statement a is undefined. If we don’t know what a is, then we also cannot say
whether a is true or false, so the result is also undefined.
Note that the situation is more complex, when the condition consists of several
statements, combined with logical operators. The result of combining two statements
with the AND , OR , XOR and NOT operators is shown in the truth tables below.
a AND b b=True b=False b=Undefined
a=True True False Undefined
a=False False False False
a=Undefined Undefined False Undefined
NOT b returns:
b=True False
b=False True
b=Undefined Undefined
In most cases this is a logical assumption: You don’t know the result of a formula if
one of the operands is undefined. However, in this situation, we may still want to use
the original land values, linked to the Landuse map, even if we don’t have any
information on the geomorphology.
☞ • 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 .
☞ • Accept the defaults in the Raster Map Definition dialog box and click
Show.
• Display the map Landval_final with Representation Inverse, Stretch
1-15 . Compare it with the other maps, and close all map windows.
- MapCalc formulas are typed on the Command line of the Main window.
- MapCalc formulas use raster maps as input and produce a raster map as output.
- The most important function is the IFF function, which has the following
structure: IFF (Condition, Then Expression, Else Expression).
- IFF functions can be nested, i.e. an IFF function can occur within another one.
- A Map Calculation formula can also be used to reclassify a map according to data
in an attribute table.
- Pixels in an output map are undefined if the pixel was already undefined in any of
the input maps. You don’t know the result of a formula if one of the operands is
undefined; this depends also on the operators that are used.
On the basis of these source maps (in fact Slope is not a real source map since it is
made from a Digital Elevation Model) five dependent maps were made:
Landvalue , Landvalue1 , Landvalue2 , Landval_combined , and
Landval_final .
Now suppose that the average value of the land has changed, for some economic
reason. This would mean that we have to recalculate all the result maps again.
This is where the concept of dependency becomes very useful. In chapter 2, we have
seen the basic concept of dependency. Dependent maps know how they are made, and
whether they are up-to-date or not. As soon as one of any of the input maps changed,
the dependent map knows that it is no longer up-to-date.
Another way to see if an object is Dependent (D), Calculated (C) and/or Up-
! to-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 .
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.
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.
☞ • 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 .
- When data in a source map is changed, this is indicated in the Properties sheet of
the dependent map. The map is then no longer up-to-date.
In situations 2, 3, and 4 you cannot simply use an existing domain for the output
maps. You either should add items to an existing domain, or you should create a new
domain.
When ILWIS encounters in an IFF function one of the last three possibilities, the
program will suggest that you use an existing domain, unless two new names are in
the IFF function. When you decide to use the default existing domain and press OK
in the Column Properties and/or in the Raster Map Definition dialog box, you will
get a warning, and you are asked whether you want to add the missing items to that
domain. However, it is not advisable to generate large domains with a mixture of
information. In many cases it is better to generate a new domain. To do so, press the
Create Domain button in the Raster Map Definition dialog box. You will now look
at the 4 situations with some examples.
☞ • 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.
☞ • Accept the defaults by clicking the Show button in the Raster Map
Definition dialog box.
• Check the contents of map Slide and close it afterwards.
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 , “?”) ↵
• Click Show in the Raster Map Definition dialog box.
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.
Suppose we want to find out where the landslides are. If there is no landslide, we will
use the new word “No landslide” .
☞ • Type the following formula on the Command line of the Main window:
Slide2 = IFF((Geom=“AL”)OR(Geom=“OL”) , Geom , “No land-
slide”) ↵
• The Raster Map Definition dialog box indicates the default domain
Geomorphology .
• Click Show.
Now the Merging Domains dialog box appears with the question:
Add string “No landslide” to domain “Geomorphology” .
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.
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).
• Close the map window when done.
For example: we want to add the items Old landslide (OL), Active landslide (AL) and
Heavily eroded area (HE) to the map Landuse .
☞ • 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.
• Type for the Domain Name: Slide4 . Click OK.
• The Domain Class editor is now opened. We will not add any items to the
domain. This will be done automatically while performing the calculation.
• 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.
• Answer the question: Merge strings of domain “Geomorphology”
into domain “Slide4” with Yes.
• Answer the question: Merge strings of domain “Landuse” into
domain “Slide4” with Yes.
• Inspect the results in map Slide4 and in domain Slide4 .
• Close the map and the domain afterwards.
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.
To continue with our example on landslides: You will now make a map with only two
units: “Landslides” or “No landslides” .
☞ • 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.
- 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.
The Cross operation performs an overlay of two raster maps by comparing pixels at
the same positions in both maps and keeping track of all the combinations that occur
between the values or classes in both maps. The input maps used in a Cross
operation should be raster maps that have the same georeference. During the Cross
operation, combinations of class names, identifiers or values of pixels in both maps
are listed, the number of pixels occurring as this combination is counted, and the
areas of the combinations are calculated. The results are stored in an output cross-
table and an output cross-map. The output cross-table and the output cross-map
obtain an ID domain with the same name as the output cross-table. The domain
contain items, which are combinations of the class names, IDs, group names or
values of the first input map and those of the second input map.
A simple example of a Cross operation between two class maps is shown in Figure 8.5.
Figure 8.5: Example of a cross operation. The maps Landuse and Geology are combined. A
cross table and a cross map are made.
☞ • Display the maps Landuse and Slope_classes and check the meaning of
the units. Close the map windows.
• Open the Raster Operations item in the Operation-tree and double-click
the Cross operation. The Cross dialog box is opened.
• Select raster map Landuse in the list box 1st Map.
• Select raster map Slope_classes in the list box 2nd Map.
• Type Landuse_slope in the text box Output Table.
• Type for the Description: Combination of Landuse and
Slope_classes .
• Select the Output Map check box.
• Type Landuse_slope in the text box Output Map.
• Click Show. The output cross table is displayed.
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 .
• Close the map Landuse_slope .
• Activate the table window.
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 .
☞ • Type the following formula on the Command line of the table window:
Flat = IFF(Slope_classes=“Flat” , Area , 0) ↵
• The Column Properties dialog box is opened. Click OK.
• Press the Arrow Up-key and edit the previous formula, so that it is:
Moderate = IFF(Slope_classes=“Moderate” , Area , 0) ↵
• The Column Properties dialog box is opened. Click OK.
• Press the Arrow Up-key and edit the previous formula, so that it is:
Steep = IFF(Slope_classes=“Steep” , Area , 0) ↵
• The Column Properties dialog box is opened. Click OK.
• 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 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 , con-
taining 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 .
• Click OK in the Aggregate Column dialog box.
• Repeat this for the columns Moderate and Steep , so that the Landuse
table will contain the columns Totalarea , Flat , Moderate and Steep .
• Close the table Landuse_slope .
• 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) ↵
• The Column Properties dialog box is opened.
• 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.
The columns Pflat , Pmoderate and Psteep contain the percentages of flat,
moderately steep and steep areas for each land use type.
The Cross operation and the subsequent aggregations and table joining, were made
to obtain the percentage of flat, moderately steep and steep land, for each land use
type.
We only used the cross table in the exercise. The cross map is often less important
because it usually contains far too many combinations. In other types of analyses, for
example when you want to make a unique combination map of several input maps,
you will also need the cross map as well.
We will work now on the crossing of an identifier map Catchment (which contains
the catchment areas in the mountainous part of the area) and a value map Drainage .
The map Drainage was created in the previous chapter, in the exercise on drainage
density (section 7.7). The drainage map contains the length of drainages within each
pixel.
☞ • Open the Operations menu in the Main window, select Raster Operations,
and choose the Cross command.
• Select raster map Catchment in the list box 1st Map.
• Select raster map Drainage in the list box 2nd Map.
• Type Catchment_drainage in the text box Output Table.
• Type for the Description: Cross of catchment and drainage length
per pixel . Click Show.
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.
☞ • Type the following formula on the Command line of the table window, con-
taining 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 .
• Click OK in the Aggregate Column dialog box.
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 .
• Click OK in the Aggregate Column dialog box.
• Close table Catchment_drainage .
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.
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.
- The input maps of a Cross operation are raster maps, which have the same
georeference.
- The output cross-table lists the combinations of class names, identifiers or values
of the pixels in both maps. The number of pixels occurring for each combination of
classes/ID’s or values, from both maps, is counted. The area is obtained by
multiplying the number of pixels with the pixel area (square of the pixel size).
- The results are stored in an output cross-table and a cross-map. Both output objects
obtain an ID domain with the same name as the output cross-table. The ID domain
contains items, which are combinations of the class names, IDs, group names or
values of the first input map and those of the second input map.
- The cross-map is often less important because it contains too many different
combinations. The crossing operation is mostly done to obtain cover information of
one map with respect to another, and not so much to generate a new combination
map.
In some cases it is better to select the output results yourself, so that you can decide
for each combination of classes or IDs in the input maps, what will be the resulting
class, ID or value in the output map. This is possible using a so-called two-
dimensional table. A two-dimensional table is a matrix where each row/record
represents a class, or an ID in the first input map, and each column represents a class,
or an ID in the second input map.
Each field in the table (each intersection of a record and a column) represents a
specific combination of two classes/IDs in the two input maps (see Figure 8.6). The
domain type for the input maps should be either class or ID. The domain type of the
field in the two-dimensional table, and of the output map, can be class, ID or value.
In this example (see Figure 8.6), the fields in the two-dimensional table use a class
domain with two classes Suitable , and Unsuitable . The two class domains
Geology and Landuse define the records and columns in the table.
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
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 2-
Dimensional 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” .
Table 8.5: Two-dimensional table showing the suitability for gravel extraction for the combination of
geological units (rows) and land use units (columns) (U = unsuitable, S= suitable).
Ag Ai Ap Br Bs Fo Gr La Ri Sh Uc Up
Gl U U U U S U S U S S U U
Ld U U U U U U U U U U U U
Oa U U U U S U S U S S U U
Qu U U U U U U U U U U U U
Ra U U U U S U S U S S U U
Sh U U U U U U U U U U U U
Si U U U U U U U U U U U U
Sd U U U U U U U U U U U U
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
! 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] ↵
• The Raster Map Definition dialog box is opened.
• Click Show.
• Check the contents of map Gravel .
• Close the map window when done.
- Each field in the table (each intersection of a record and a column) represents a
specific combination of two classes and or IDs in the two input maps.
- The domain type of the input maps should be either class or ID. The domain type
of the two-dimensional table, and of the output map, can be class, ID or value.
- Since the output value for each combination of two classes has to be entered
manually, this method is mostly used for combining class maps with relatively few
classes.
In the previous chapter you have seen a number of basic spatial analysis operations
used for the overlay of raster maps. Where the overlay operations only consider the
combination of raster cells in different maps at the same location, the neighbourhood
calculations evaluate the characteristics of a specified location and its surrounding
area. These calculations make use of a small calculation window (e.g. 3x3 cells) that
repeats a specified calculation on every pixel in the map, taking into account the
values of its neighbours. When only the 4 direct neighbours are used (i.e. the ones
that are on the same line or the same column as the central pixel), we talk about a 4-
connected operation. When all 8 neighbours are taken into account, it is an 8-
connected operation (see Figure 9.1).
Figure 9.1: The difference between 4-connected and 8-connected neighbourhood calculations.
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.
In the last part of this chapter some examples are given of how ILWIS can be used
for performing connectivity calculations. By using these calculations, spatial units
that are connected (using a set of pre-defined rules) are characterized.
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter09, or to the directory
where the data files for this chapter are stored.
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.
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.
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 .
• Type for the Output Raster Map name: Suitability1 and click the
Show button.
• In the Display Options - Raster Map dialog box select Representation
Pseudo and click OK. The map is now displayed.
• Compare the maps Suitability1 and Suitability and close the two
map windows afterwards.
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 undef-
majority 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.
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).
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.
• Create Output Raster Map Suitability4 and change the Precision to
0.1 .
• Display map Suitability4 with Representation Pseudo next to maps
Suitability_null and Suitability3 and compare them. Click the
pixels in both maps to find out their values.
• Close all the maps when you are finished.
☞ • 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.
• Display map Suitability5 next to map Suitability_null (both with
the Pseudo Representation) and compare them. Click the pixels in both
maps to find out their values.
• Close all maps when you are finished.
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.
• Close all maps when you are finished.
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.
☞ • 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 .
• Display map Suitability6 next to map Suitability_null (the last
one with the Pseudo Representation) and compare them.
• Click the pixels in both maps to find out their values.
• Close the map windows.
The Dilate8 filter assigns a 1 to the central pixel if any of the neighbours is “true”.
The result of using Dilate8 is that true pixels “grow” in all directions. The reverse
will be done using the Shrink8 filter. The shrink filter assigns a 1 only when the
central pixel is 1 and all neighbours are also 1. The result of using the Shrink8 filter
is that areas of “true” pixels “shrink” along their edges; single lines of “true” pixels
and single “true” pixels totally surrounded by “false” pixels disappear. This filter will
make the suitable area shrink in size in all directions. If you use the Shrink4 filter
the area will shrink in horizontal and vertical direction, but not in a diagonal
direction.
☞ • 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 .
• Display map Suitability7 next to map Suitability_null and com-
pare them.
• Click the pixels in both maps to find out their values.
• Close the map Suitability7 .
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 com-
pare them. Click the pixels in both maps to find out their values.
• Close the map Suitability8 .
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 com-
pare them. Click the pixels in both maps to find out their values.
• Close all map windows.
The last of the binary filters, which we would like to show you, is called the
Conn8to4 . When “true” pixels are 8-connected, this filter makes them 4-connected
by adding a “true” pixel in some places. This gives your binary image a better
outlook. It is also used to improve line barriers used in the distance calculation. The
line barrier must be at least two pixels wide, so that no pixels on either side of the
line are connected, not even diagonally. This will be demonstrated using the
Drainage map.
☞ • 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.
• In the Rasterize Segment Map dialog box, select GeoReference
Cochabamba and click the Show button
• Click OK in the Display Options dialog box. The map is displayed.
• 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.
• 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 .
• Display map Drain4connected next to map Drainage .
• 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.
• Close all map windows.
One example of a user-defined filter is a counting filter. Counting filters are used to
count the number of defined pixels, within a certain search radius of a central pixel.
They can be used to count the number of point features, such as houses, wells or
landslides. We will create a counting filter that will count the number of landslide
pixels within a radius of 10 pixels (Figure 9.2).
The filter shape resembles a circle in which all the pixels within the circle (with a
radius of 10 pixels) contain the value 1, and the rest the value 0. When we apply this
filter on a binary map, showing the landslides, for each pixel the number of pixels
with landslides within the 10 pixel radius is calculated.
columns
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10
-10 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0
-9 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
-8 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
-7 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
-6 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0
-5 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
-4 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
-3 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
-2 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
rows
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
3 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
4 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
5 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
6 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0
7 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
8 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
9 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0
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.
• Check the map values and close the map.
• Open the Counting filter and have a look at it. Note that there is a Gain of
1.0 specified.
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
stored in the central pixel, then the filter shifts one pixel further and does the same
calculation.
☞ • 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 cal-
culated and the Display Options dialog box is opened
• Click OK. The map is displayed.
• Check the values in the map by clicking on the pixels.
• After you have analyzed the result, close the map window.
- Filters used on Digital Elevation Models. With the help of the filters working
on DEM’s you can calculate slope steepness maps, slope direction maps, slope con-
vexity/concavity and hillshading maps.
- 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 neigh-
bours.
- Smoothing filters. These filters will calculate for each pixel the average value of
the central pixel and its neighbours.
- Rank order filters. These filters can be used to calculate the median value of the
central pixel and its neighbours.
- Binary filters. 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 num-
ber of point features, such as houses, wells or landslides.
1 2 3
4 5 6
7 8 9
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).
where:
Outmap is the name of the output map.
Map# is the syntax to specify the name of the input map Map over which a
neighbourhood matrix will be moved.
[Neighbour] is the syntax to select a single neighbour from the map over which
the neighbourhood matrix is moved.
Neighbour is a number between 1 and 9 which indicates the
position of a certain pixel in the neighbourhood matrix as numbered
as in Figure 9.3; the value of the selected neighbour will be
retrieved. Note that the position of the single neighbour is enclosed
in square brackets!
☞ • 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 .
☞ • 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 ).
• Close the pixel information window and the map window.
• Now calculate a map Dy that gives the difference in Y direction.
where:
OutMap is the name of the output map.
NbFunction 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 #.
where:
☞ • 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.
Table 9.2: Relation between the values of the output map and the direction.
Direction Value
Northwest 1
North 2
Northeast 3
West 4
Flat 5
East 6
Southwest 7
South 8
Southeast 9
☞ • Press Show in the Raster Map Definition dialog box. The map is calculat-
ed. The Display Options dialog box is opened. Select Representation
Pseudo and click OK.
• Check the result with the pixel information window.
• Close the pixel information window and the map window.
☞ • 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.
☞ • Press Show in the Raster Map Definition dialog box. The map is calculat-
ed and the Display Options dialog box is opened. Select the
Representation Pseudo and click OK.
• Check the result with the pixel information window.
• Close the pixel information window and the map window.
☞ • 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.
• Check the result with the pixel information window.
• Close the pixel information window and the map window.
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.
• Check the result with the pixel information window.
• Close the pixel information window and the map window.
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.
Iterations
Iterations are a special type of calculations. They are a successive repetition of a
mathematical operation, using the result of one calculation as input for the next.
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 can
only be 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). The iteration functions that can be used are listed in Table 9.3.
Calculation of the flooded area, given dam site and dam altitude
In this example you are going to calculate the area that will be flooded after the
construction of a dam in the mountains, north of Cochabamba, Bolivia.
The first step is determination of the dam site, dam altitude, freeboard and the
designed water level h. The location of the planned dam is shown in the raster map
Damsite .
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.
Now the Damsite map will be combined with the raster map Dem , and a new map is
created in which the Damsite is indicated with the elevation of the top of the dam
(3300 meters). The rest of the area shows the elevation of the terrain.
☞ • 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.
• Type for raster Map Name: Start .
• Select as GeoReference: Cochabamba .
• Select Domain: Value with a Value Range of 0 to 1, and a Precision of
1. Click OK.
• 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.
• Close the map window.
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.
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.
• Type for the Output Raster Map: Flooded .
• Select the Domain Value , the Value Range 0 to 1 and the Precision of 1.
Click the Show button.
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.
The output map Flooded can now be used to calculate the volume of the water in
the reservoir.
☞ • Cross the raster map Flooded with the raster map Dem_with_damsite .
Name the Output Table Volume and click Show.
• In the table, calculate the water level with the formula:
Difference = 3280 – Dem_with_damsite
• 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.
- 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.
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
impenetrable areas), represent those areas in the map which can not be passed. No
distance value will be calculated for these pixels; the output value will be undefined.
By default, the output map (distance map) obtains the system Distance domain.
The value range and step size of the output map can be adjusted each time you
perform the Distance operation. You can also create or use a value domain of your
own.
If line barriers, like a river, are used with a width of only one pixel (rasterized
segments), these barriers should be broadened before performing the distance
calculation, e.g. manually in the pixel editor or automatically with a Dilate filter or
the Conn8to4 filter (see the Filtering exercises in section 9.1). This because the
distance program can pass diagonal barriers of one pixel wide, as it uses 8-connected
distances (meaning each pixel has access to its eight neighbours: horizontally,
vertically, and diagonally).
In the following exercise three examples of distance calculations will be shown: one
from line features (drainage), one from area features (city blocks, taking into account
inaccessible areas) and one from point features (rainfall stations, using Thiessen
polygons).
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
can also display the segment map Drainage in the same map window.
The following examples show how to convert distance values to time units, assuming
a maximum speed of 20 km/h:
- When the output distance values are divided by 20,000 (m/h), the time in hours to
reach the nearest source pixel is obtained.
- When the output distance values are multiplied by 60 and divided by 20,000, the
time in minutes to reach the nearest source pixel is obtained.
- When the output distance values are multiplied by 60*60 and divided by 20,000,
the time in seconds to reach the nearest source pixel is obtained.
In this exercise, the city block map of Cochabamba (Cityblock) is used to calculate
how much time it takes from any part in the city to reach the central plaza Plaza 14
de Septiembre . For reasons of simplicity we assume that you can travel equally
fast in all the streets of the city. The city blocks themselves cannot be crossed, with
the exception of those with a recreational use (parks, etc.), which can be crossed with
a maximum velocity of 5 km/h.
☞ • Type the following formula at the Command line in the ILWIS Main win-
dow:
City_source = IFF(Cityblock = “018”, Cityblock, “?”) ↵
• Click Show in the Raster Map Definition dialog box.
• Check the results in map City_source and close the map afterwards.
☞ • Type the following formula at the Command line of the ILWIS Main win-
dow:
City_weight = IFUNDEF(Cityblock, 1, IFF
(Cityblock.Landuse = “Recreational”, 4, -1)) ↵
• Click Show in the Raster Map Definition dialog box.
• Check the results in map City_weight and close the map afterwards.
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.
☞ • Expand the Raster Operations item in the Operation-tree and click the
Distance Calculation operation.
• In the Distance Calculation dialog box select raster map City_source in
the list box Source Map.
• 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.
☞ • 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.
In this exercise a Thiessen map will be calculated from point map Rainfall ,
containing - fictitious- rainfall stations in the Cochabamba area. Before we can
calculate it, we first need to rasterize the point map Rainfall .
☞ • 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.
• Select GeoReference Cochabamba , name the Output Raster Map
Rainfall and click Show.
• 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.
• Close the map.
➥
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 .
• Use the Cross operation to overlay the maps Catchment and
Rain_total .
➥
ILWIS 3.0 User’s Guide 377
Spatial data analysis: neighbourhood and connectivity calculations
➦ • 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).
- 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, indi-
cate 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.
The operation can be used on connected (4- and 8-connected) and not connected
pixels; undefined pixels are ignored. Pixels from which all neighbours are undefined
are considered not to be connected. Connected pixels that have the same class are
assigned the same identifier.
Not connected pixels, connected pixels with a different class than its neighbour and
ID pixels are assigned a unique identifier.
The operation is based on a moving 3x3 matrix that assigns an ID to the central pixel.
The window starts at the first row and moves from left to right. The first (connected)
pixel(s) encountered will get the identifier Area 1, the second Area 2 etc.
Furthermore, an attribute table is created, which contains the new area IDs and the
original class names, IDs or values.
It is not recommended to use a value map as input for this operation; this can result
in an output map where every pixel has its own identifier. The procedure to follow
with value maps is to first classify the value map to create the classes that you want
to number and then use the output class map as input for the area numbering
operation.
Figure 9.5 shows a simple example of the area numbering operation applied to a bit
map.
➦ • 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 geomorpho-
logic 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).
- Area Numbering is similar to the Unique ID operation that can be used for point,
segment and polygon maps.
Contiguity calculations
Contiguity calculations examine the connected areas that share (a) common
characteristic(s). In order to know which areas are connected, topological information
is required. In general, these calculations are applied to identify (retrieve) areas with
a specific size and with specific characteristics.
In this exercise we will show you how you can use the information of neighbouring
polygons to solve the following problem:
Find out a forested area which is not bordering agricultural land or the city, and
which has a closed area of at least 200 hectares.
In order to solve these two sub problems we need to work with the polygon map
Landuse . The Landuse map has a class domain. This means all the polygons with
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.
➦ • Click OK in the Display Options - Polygon Map dialog box. The map is
now displayed.
• Find out the codes of the map by clicking on the units.
• Double-click on a unit. Now the land use type for each polygon is displayed
in the Attributes window.
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.
We are interested in the polygons with the land use type Forest in the column
PolName1 . As you can see, we do not have information yet on the land use types
(only on the polygon ID’s). This information exists, however, in the table LandID , in
which for each ID the land use is given. We will have to join the two tables in order
to read the information of the land use in table LandIDnb .
☞ • 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.
Now we know for each of the polygons ID’s 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”) ↵
• Click OK in the Column Properties dialog box.
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 .
• Check the result of the formula.
As you can see there are 3 forest polygons which are bordered by agriculture. Another
13 are bordered by either grassland or shrubs, and one forest polygon is located at the
margin of the area. However, these records may refer to the same forest polygons,
which may be bordered by agriculture on one side and grassland on the other.
Therefore, we should take the minimum value of the column Good in the next step.
Now we know which of the forest polygons is not bordered by agricultural or urban
land.
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.
• Click OK. The Polygon Histogram is shown as a table.
Now that the area of the polygons is known, we can make the final evaluation.
The calculation uses the column Area from the polygon histogram table (extension
.hsa ). Those polygons that contain the word “True ” in the column Finalgood ,
fulfill the requirements stated in the beginning. They are forest polygons, with an
area of at least 200 hectares, and not bordered by agriculture or city polygons.
- The operation Unique ID is used to transform a class map into a unique identifier
map, in which each polygon receives a single code.
- The operation Neighbour Polygons calculates for each polygon in a map, what its
neighbours are, and what the length of their boundary lines is.
Digital Elevation Models can either be stored in vector or in raster format. DEMs in
vector format are often in the form of Triangulated Irregular Networks (TIN), which
can be seen as a set of polygons in the form of triangles where the 3 corners of each
triangle are known height values. Each triangle has a uniform slope steepness and
slope direction. When the terrain is more complex, the number of triangles needed to
represent the terrain increases.
In ILWIS, the TIN structure is not used. DEMs are always in the form of raster maps,
with a value domain. Each pixel in the raster map contains the altitude of the center
of the pixel. Using a large pixel size will therefore result in more general DEMs (a
smoother topography). Especially when the mapped changes in topography occur at
distances smaller than the pixel size, the slope angles derived from the DEM may
lead to an underestimation of the actual slope angles in the field. When the pixel size
is chosen too large, ridges and small streams may be missed. The accuracy of a DEM
depends very much on the detail of the contour lines, that were used for the
interpolation, and the scale of the original topographic map from which the contour
lines were digitized. The larger the scale of the map, and the smaller the contour
interval, the more accurate the DEM will be.
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 bird’s 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.
In this chapter, first the method for generating a DEM will be explained, followed by
a series of exercises dealing with the derivative maps.
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter10, where the data files for
this chapter are stored.
You should make sure to have digitized the contour lines a little bit outside of the
study area where interpolation should take place, because at the borders of the
interpolated area, artifacts may occur.
The creation of a Digital Elevation Model from a segment map is done with the
Contour interpolation operation. This operation works in two steps:
- Segment to raster conversion. First the segment map is converted to raster,
using a georeference in which the pixel size, the number of lines and columns, and
the minimum and maximum X and Y coordinates of the map are defined. It is
important to make sure that the pixel size is not too large, in relation to the
maximum spacing of the contour lines. Otherwise it may happen that two contour
lines may have to be located in the same pixel, which is of course not possible. In
this case the program will select one of the two values of the contour lines and will
omit the other, which may lead to problems in the interpolation. The input segment
map should be a value map. The raster map resulting from the segment to raster
conversion will contain values for those pixels covered by a contour line. All other
pixels in the map remain undefined.
- Contour interpolation. A linear interpolation is made between the pixels with
altitude values, to obtain the elevations of the undefined values in between the
rasterized contour lines. The output of the contour interpolation is a raster map in
which every pixel has a value. The interpolation method is based on the Borgefors
distance method. The operation calculates, for each undefined pixel in between two
rasterized segments (outcome of the first step), the shortest distance towards the
two nearest isolines (see Figure 10.1). The height value (Hp) for a pixel (p),
between two contour lines is calculated as:
where: Hp is the calculated height value for an output pixel, H1 and H2 are the height
values of the higher and lower contour lines and d1 and d2 are the distances from the
pixel to the higher and lower contour lines (see Figure 10.1).
Figure 10.1: Two contour lines (H1 and H2) and the shortest distances (d1 and d2) towards an
output pixel (p).
During the interpolation, quite some time is needed to calculate the shortest distance
towards two known values, which has to be done for every undefined pixel. This
calculation is done iteratively; the program calculates forwards and backwards (from
top line to bottom and vice versa) until no more changes occur. Then a linear
interpolation is performed using the two distance values. The linear interpolation
returns the height values for the undefined pixels. During the calculation, several
Megabytes of hard disk are used for storing temporary maps.
In this exercise segment map Contour , with a value domain, is used to generate the
DEM.
☞ • 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.
• Type Dem as Output Raster Map.
• Select GeoReference Cochabamba .
• Type for the Description: DEM created from the segment map
Contour .
• Accept all other defaults and click Show.
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 dis-
played.
• 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.
➥ • 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.
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.
Now we have to rasterize the point map and combine it with the rasterized segment
map into a single map, which will be the input map for the interpolation. The
rasterized segment map ContourRasterized was created already during the
previous contour interpolation operation.
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.
• Click OK to display the map.
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.
• Press the Symbol button. The Symbol dialog box appears.
➥
ILWIS 3.0 User’s Guide 393
Using Digital Elevation Models
➥ • 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 dis-
played 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.
• Close the map window and the pixel information window.
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.
Filters are commonly used in image processing (see chapter 6) but can also be
applied to raster maps (see chapter 9). A special group of filters is used to calculate
slope steepness, slope shape (convex, concave) and shadow from Digital Elevation
Models. The existing standard filters in ILWIS that can be applied on DEMs are
given in Table 10.1.
Table 10.1: List of standard filters in ILWIS that can be applied on DEMs.
Filter type Application
DFDX Detects slope differences in x-direction.
DFDY Detects slope differences in y-direction.
DFDUP Calculates slope differences in the upward diagonal direction.
DFDDN Calculates slope differences in the downward diagonal direction.
D2FDX2 Detects slope shape differences in x-direction.
D2FDY2 Detects slope shape differences in y-direction.
D2FDXDY Calculates slope shape differences in all diagonal directions
LAPLACE Calculates slope shape differences in all diagonal directions
SHADOW Applies artificial illumination (from the northwest) to the DEM.
When you display the map, you can see the relief coming out of the map. The map
shows the representation of the mountains under an artificial illumination, as if the
sun is shining from the NW. Steep slopes directed to the SE are dark, and slopes
directed to the NW are very bright. You can generate hillshading maps with
illumination from other directions by saving a copy of the Shadow filter and then
editing the copy.
The gradient filter can be seen as a window which moves over the map, starting from
the upper left pixel in the map. Each value of the filter is multiplied by the
corresponding pixel value in the map. The results, for all the pixels in a filter are
added up, and the resulting value is multiplied by the gain and stored in the central
pixel of the output map. Then, the window moves one pixel to the right, and the
procedure is repeated. After finishing with the last pixel of the first line, the window
moves to the first pixel of the second line. In this way, a new value is calculated for
every pixel in the map. In Figure 10.2, a schematic example is given of a horizontal
gradient filter.
Figure 10.2: The filtering procedure, applying a horizontal gradient filter on a DEM. The direction
of the horizontal and vertical filters is not important. Filters -1 0 1 and 1 0 -1 will
give the same value but with opposite sign, e.g. in the calculation of slope angles.
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.
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.
- D2FDXDY. This 5x5 filter detects slope differences in both x and y direction (sec-
ond derivative).
☞ • Click raster map Dem with the right mouse button and select Image
Processing, Filter. The Filtering dialog box is opened.
• Select Filter Name: D2FDXDY .
• Type for the Output Raster Map: Shape .
• Accept all other defaults and click Show. After the map has been calculated,
the Display Options - Raster Map dialog box will appear.
• 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”)) ↵
The Raster Map Definition dialog box appears.
• 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.
• Answer Yes to the question: Add string ‘Concave slope’ to domain
‘Shapeclasses’ .
• Answer Yes to the question: Add string ‘Straight slope’ to domain
‘Shapeclasses’ .
• Answer Yes to the question: Add string ‘Convex slope’ to domain
‘Shapeclasses’ .
• Open map Shapeclasses and check its contents. Close it when you are
finished.
The map Shapeclasses shows for each pixel whether the slope is convex, straight
or concave. However, since nearly every pixel is having a different class, the result is
difficult to read. To improve this we could use a majority filter, which will assign the
predominant class name of every 5x5 input pixels into an output pixel.
☞ • Filter the map Shapeclasses using the Majority filter and generate the
result map Shapeclasses_final .
• Display this map and compare it with the map Shapeclasses .
• After that, close all map windows.
For calculating internal relief, we would need the minimum and the maximum value
within a sufficiently large area (for example within a hectare) and then calculate the
difference.
Georeference Cochabamba contains the pixel size of the raster maps (including the
DEM) of the data set we are using. This pixel size is 20 meters. So in order to
calculate the internal relief per hectare (100x100m), we need to use a filter of 5 rows
by 5 columns.
☞ • Select raster map Dem in the Catalog, press the right mouse button and
select Image Processing, Filter. The Filtering dialog box appears.
• Select Raster Map Dem and Filter Type Rank Order .
• Clear the check box Predefined because we want to use a user-defined
filter.
• 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.
☞ • 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.
• Select Domain Value , change the Value Range to 0-1000 (assume a
maximum height difference of 1km in 1 hectare), and the Precision to 1.0 .
• Type for the Description: Internal relief in meters per hectare
and click Show.
• 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.
• Choose Representation Pseudo and click OK. The map is displayed.
• From the File menu in the map window, select Open Pixel Information. The
pixel information window is opened.
• 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.
- Shadow filter. The shadow filter simulates sun illumination on the surface, with
the sun in the northwest. The shaded relief image is merely used for display pur-
poses.
- Gradient filters. With the help of the gradient filters DFDX and DFDY, horizontal
and vertical gradients are calculated for each pixel.
- Slope shape filters. With the help of second derivative filters, such as
D2FDXDY, you can detect slope differences in both x and y direction, and calcu-
late if the slope is convex, concave or straight.
- Rank order filters. With the help of rank order filters it is also possible to calcu-
late internal relief in a digital elevation model, expressed for example as the maxi-
mum elevation change within 1 hectare, or within 1 square kilometer.
Figure 10.4: Slope steepness calculation. h is the height difference between two points and d is
the distance between them on the map.
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 ↵
As you will see, slope values in this map may well rise above 100%. Note: the
following slope values are the same: 30° = 58%, 45° = 100%, 60° = 173%, 80° =
567%. Now you will calculate a slope map in degrees.
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.
In this exercise, a slope direction map is calculated for the Cochabamba area. The two
maps with the horizontal and vertical gradients (Dx and Dy ) have already been
created in section 10.3.
☞ • Type the following formula on the Command line in the Main window:
Aspect = RADDEG(ATAN2(Dx,Dy)+pi) ↵
☞ • 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.
• Type the Domain Name: Compass .
• Type for the Description: Compass direction.
• Enter the Min and Max: 0 and 360 , the Precision: 1.0 and click OK. You
are now back in the Raster Map Definition dialog box.
• Click Show to calculate the map.
• In the Display Options - Raster Map dialog box, select Representation
Gray and click Show. The map will be displayed.
☞ • Reopen the map’s Display Options dialog box and click the Create repre-
sentation button. The Create Representation dialog box is opened.
• Type the Representation Name: Compass , the Description: Compass
directions and click OK. The Representation Value editor is now
opened, showing the limits 0 in black and 360 in white.
The values 0° and 360° should have the same color (as they represent the same
compass direction). Furthermore, you want to see the relief properly (i.e. sun light
from the west). We will therefore use the following values and colors (Table 10.2):
☞ • 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.
• Enter 25 for the number of Stretch Steps and click OK.
Now the representation is ready. It goes from white for western aspects to gray for
northern and southern aspects to black for eastern aspects.
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”.
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.
The 3-D view is now displayed with default values. These default view parameters
can be modified by editing the georeference 3D.
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
certain X and Y coordinate. You can draw an imaginary line between the focal point
and the view point, which is called the view axis (see Figure 10.5).
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).
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).
The 3D view should now be similar to the one shown in Figure 10.7.
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.
The view should now be similar to the one shown in Figure 10.9. Note that the 3D
view is now rotated.
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.
Now we will use the small DEM window which appears above the 3D view
parameters. This window can be used to interactively specify the View Point and the
Focal Point by drawing a line.
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.
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
columns from the raster map that should be used to drape the raster map over the 3D
model. The best result is obtained by selecting a pixel step of 1. This will, however,
lead to a much slower display. Therefore, use larger pixel steps to edit the initial 3D
view, and use a pixel step of 1 for the final view.
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 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.
☞ • 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.
• Close the map window and the pixel information window.
To obtain a new raster map in 3D, you can use the Apply 3D operation.
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.
- Once the initial georeference 3D is displayed, you have to edit the georeference and
make the 3D view according to your wishes. This can be done in the
Georeference 3D editor. The user can specify the view parameters (altitude,
rotation, distance, vertical exaggeration, etc.) to define the perspective of the
observer in relation to the 3D model.
- A georeference 3D or 3D view can be displayed as grid lines but you may also use
a raster drape (i.e. any satellite image or thematic map). When you use a raster
drape, the raster map should use a georeference that has the same coordinate
system as the georeference of the 3D view.
- Once you finished editing the georeference 3D, you can display any raster map in
3D by using the Display 3D operation and optionally combine this with one or
more vector layers. The results can be stored as a map view.
- To produce an output raster map in 3D, you can use the Apply 3D operation. On
the output, you can overlay again any vector map(s), and the result can be stored as
a map view.
- The main advantage of the 3D views as obtained from either Display 3D or Apply
3D is thus that the 3D maps remain georeferenced. You can thus display other
vector layers on top of the 3D views, and you may use pixel information to retrieve
information of raster and vector maps, combined with attribute tables, while
moving the mouse pointer through the 3D view.
For this exercise you will use a predefined segment map Profile . If you want
digitize profiles yourself, you should make sure that each profile consists of one
single segment, with a unique code. It is possible to have several profiles in the same
file, but then they should be coded differently (e.g. Profile1 , Profile2 , etc.). For
the conversion from segments to points, only one segment should be present in the
file. If you have more profiles, the process should be done for each profile
individually and the conversion from segment to point should be preceded by the
Mask Segments operation, which you use to copy one single profile segment into
another file.
☞ • 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.
• Click OK to display the point map.
• Zoom in on a section to verify that the map contains individual points.
• Close the point map.
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.
☞ • Click with the right mouse on the point map Profile , and select the com-
mand 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 ↵
• Click OK in the Column Properties dialog box.
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) ↵
• Click OK in the Column Properties dialog box.
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°).
• Close the graph and the table window.
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).
Sometimes the input for interpolation is already a raster map itself. Further
interpolation on the raster values, for example to fill up gaps in the raster map or to
get a more dense network of sample points can be performed using the Densify
operation (to obtain more dense pixels), the Resample operation with bilinear or
bicubic interpolation (mainly used to obtain raster maps that all use the same
georeference), or the Kriging from Raster operation. These raster interpolation
methods will however not be treated in this chapter.
Point statistics may help you to get an impression of the nature of your point data
prior to for instance an interpolation and to find necessary input parameters for
kriging operations. Various other operations that might be useful, which are treated in
this chapter are Pattern Analysis (11.1), omnidirectional and bidirectional Spatial
Correlation (11.2 and 11.4), Cross Variogram (11.4), Variogram Surface (11.4)
and AutoCorrelation and SemiVariogram (11.5).
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter11, where the data files for
this chapter are stored.
Figure 11.1: Schematic representation of a potential oil reservoir. Given are the vertical dis-
tances towards the top and the bottom of sandstone unit.
The spatial distribution of the points in the maps can be examined to acquire more
knowledge about the phenomenon and the responsible process.
☞ • 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 click-
ing 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.
Spatial arrangement of point data in a point map can be one of the following three
fundamental types (Figure 11.2): Complete Spatial Randomness (CSR), Clustered
pattern and Regular pattern.
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 inter-
polate 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
pattern and Regural pattern.
There are two two basically different techniques that are used in ILWIS to examine
the spatial pattern of points in a point map:
- Reflexive Nearest Neighbours (RNN): this method considers two points as first
order reflexive nearest neighbours if these points are each other’s nearest
neighbours. This definition can be extended to higher orders; second order RNNs
are points that are each other’s second-nearest neighbours, etc. The frequencies are
calculated for RNNs of the first up to the sixth order. Most researchers suggest that
higher order values in excess of CSR expectations indicate measure of regularity in
arrangement of points, whereas lower empirical values imply elements of grouping
in the pattern. If more (first order) RNNs occur than is expected in CSR, it can be
concluded that isolated and relatively uniformly arranged couples exist.
The output of the pattern analysis operation is a table in which measured frequencies
of occurrences of RNNs are compared with expected frequencies of occurrences in a
situation of CSR. The CSR is simulated for the same area and the same number of
points. If the number of observed RNNs are almost the same as the expected one in a
situation of CSR, the point pattern is CSR. The points have a clustered pattern, when
the number of observed RNNs are less than the expected ones in a situation of CRS.
They have a regular pattern when the number of observed RNNs are higher than the
expected ones in a situation of CSR.
The output is a table with eight columns and additional information. Column
Distance lists distances that should be considered as distance from any point in the
input point map. Column Prob1Pnt lists the probability that, within the specified
distance (column Distance ) of any point, another point will be found. Prob2Pnt
lists the possibility that, within that distance, from any point, two other points will be
found. The same goes for columns Prob3Pnt , Prob4Pnt , Prob5Pnt and
Prob6Pnt . For a data set of n points ProbAllPnt is the summation of Prob1Pnt
+ Prob2Pnt + .. + ProbnPnt-1 , divided by (n - 1). Additional information on
pattern analysis is displayed in a separate window with three columns. First to sixth
order nearest neighbours are listed in the column Order . Observed values for each
order calculated using reflexive nearest neighbours and mean distance to nearest
neighbour, are displayed in the column Observed values . The assumed values
with CSR, for each order calculated using the above mentioned techniques, are listed
in the column Assumed with CSR . The data present in the additional information
window together with the data in the output table can be used to define the type of
spatial distribution of the points in the map.
In this exercise the Pattern Analysis operation is performed on point map Top . To
start the operation:
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.
• Accept the defaults by clicking the OK button.
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.
• Accept all other defaults by clicking the OK button.
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.
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 per-
form an interpolation?
☞ • From the View menu of the table window, select Additional Info. The addi-
tional 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.
- ILWIS uses two techniques to examine the spatial pattern of the points in a map:
Distance to Nearest Neighbours, Reflexive Nearest Neighbours (RNN).
- If in the Distance to Nearest Neighbours the individual points are closer to each
other than they would be for CSR than the points are clustered. If this is not the
case the pattern is more regular.
- In RNN higher order values in excess of CSR expectations are a measure of regu-
larity whereas lower empirical values imply elements of grouping in the pattern.
- If more (first order) RNNs occur than is expected in CSR, it can be concluded that
isolated and relatively uniformly arranged couples exist.
In ILWIS, a point map can be used for spatial correlation analysis. The input point
map should either be a value map itself, or a class or ID map which has a linked
attribute table with one or more value columns.
In the Spatial Correlation operation you can choose to use either the
Omnidirectional or the Bidirectional method. The omnidirectional method simply
determines all distances between point pairs, regardless of any direction. Thus all
point pairs that have a certain distance towards each other will be counted in a
distance class. Then, spatial autocorrelation (as Moran’s I), spatial variance (as
Geary’s c), and experimental semi-variogram values are calculated for all point pairs
within each distance class. The bidirectional method first counts, just like the
omnidirectional method, all pairs of points that have a certain distance to each other,
and then calculates the Moran’s I and Geary’s c for these point pairs within each
distance class. Furthermore, all point pairs are counted with a certain distance to each
other and with a certain direction towards each other. For point pairs in a certain
distance class and in the correct direction, experimental semi-variogram values are
calculated. Then also for the direction perpendicular to the specified direction, point
pairs are counted and experimental semi-variogram values are calculated.
In this exercise the top and the bottom of the sandstone unit will be examined using
the omnidirectional spatial correlation operation. The bidirectional option, that takes
anisotropy into account, will be extensively treated in the part about kriging
interpolation.
Inspect the first two columns in the output table: i.e. the distance values represent the
middle of a distance class.
- 70 point pairs are found of which the points are 62.5-187.5 m apart
- 147 point pairs are found of which the points are at least 187.5 m but less than
312.5 m apart, etc.
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 autocor-
relation (as Moran’s 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 Geary’s c).
Both graphs are based on the omnidirectional spatial correlation table, which also
contains the total number of point pairs, used to calculate for each of the individual
distance classes, the variance and correlation. Thus the points represent an average
value for a large number of pairs of points, in order to filter out some of the erratic
behavior of the variables. Note that the pairs are selected, based only on the distance
separating them and not on their orientation, thus the curves are representative for the
entire area rather than for a particular direction. This implies that directional
components or anisotropy’s in the data set cannot be detected.
In the distance versus variance (Geary’s c) graph, you can see that at short distance
the variance is low. This indicates that points close to each other are identical. When
moving to larger pair separations, you may observe an increase in variance to a
distance of approximately 500 meters. From 500 meters onward, the imaginary curve
that can be fitted through the points (i.e. this curve is known as the variogram) tends
to level off to a constant value. Thus, points separated over distances larger than 500
meter are no longer related or correlated to each other (notice this also in the graph
showing the correlation versus the distance). This critical distance in geostatistics is
known as the range of influence or correlation length of the data and is a measure of
spatial variability: a long range implies homogenous data whereas a short range
implies high spatial variability. Therefore, to ensure a proper sampling of the top of
the reservoir rock, we need to have at least points with an average sample spacing of
less than 500 meter, to capture the spatial variability. In general, a distance in the
order of 1/4 of the range values (i.e. 125 meter spacing) is recommended. Note also
that when extrapolating the value of the variance for a distance of zero, you find a
small but non-zero value for the variance. This implies that there is variability for
points separated by a distance of zero meters! This hypothetical variance is known as
nugget variance and can be attributed to measurement errors and to small-scale
variability occurring at a distance smaller than the average sampling interval.
- A point map can be used for spatial correlation analysis if the points in the map are
values or if the point map has a class or ID domain and the values are stored in a
column of the attribute table that is linked to the map.
- The imaginary curve that can be fitted through the points of the variance versus
distance graph is known as the variogram.
- The output of the bidirectional spatial correlation operation (the method that takes
anisotropy into account and that will be explained in section 11.4.4.) is a table con-
sisting of ten columns: Distance , I, c, AvgLag1 , NrPairs1 , SemiVar1 ,
AvgLag2 , NrPairs2 , SemiVar2 .
You will create the isochore map (i.e. equal thickness map) for the sandstone
reservoir, by interpolating the values for the top and the values for the bottom and
subtracting these two maps. Make sure that you use the same cell sizes for all
calculations. When interpolating the point values, it is, for time efficiency reasons,
strongly advised to choose a rather large pixel size for the output map. Further
interpolation on the raster map values can be performed using the Densify,
Resample or Kriging from Raster operations.
Nearest Point
In the Nearest Point method (also called Nearest Neighbour, Voronoi Tesselation or
Thiessen Polygons) the value, identifier, or class name of the nearest point is assigned
to the pixels according to the Euclidean distance. This method offers a quick way to
obtain a Thiessen map from point data (Figure 11.3).
Figure 11.3: (A) An input point map. (B) The output map obtained as the result of the interpola-
tion operation applying the Nearest Point interpolation method.
To interpolate the point map Top with the Nearest Point interpolation method:
☞ • 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.
• Type Top_np in the Output Raster Map text box.
➥
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 dia-
log 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 Display Options – Point Map dialog box select Attribute
Thickness , select the Text check box and click the Font button
• 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 right-
hand 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
you can conclude that the nearest neighbour interpolation method is very quick, but
far too rough for this specific application.
As additional geological exercise, try to sketch a geological cross section from the
top (north) to the bottom (south) of the mapped area. Notice that the thickness of the
sandstone diminishes in the central part of the area, due to a south dipping normal
fault and that the reservoir is also folded.
☞ • 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 ter-
! rain 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.
➦ • 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.
• Close all windows
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.
• Accept the defaults by clicking OK. The map will be displayed.
• Drag point map Sandstone with attribute column Thickness on top of
the map and compare the map with the result from the nearest point interpo-
lation (map Thickness_np ).
• Close the map windows when you have finished the exercise.
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).
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.
➦ • 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.
• Accept the defaults by clicking the OK button.
☞ • Display the thickness map of the Moving Average operation and the thick-
ness map of the Moving Surface operation next to each other
• Overlay both maps with point map Sandstone .
• Furthermore open a pixel information window, and add both raster maps.
• Zoom in and check the values of the maps.
☞ • Close all map windows when you have finished the exercise.
- The input for interpolation is either a value map itself or a class or ID map, which
has a linked attribute table with one or more value columns.
- The output of a point interpolation, is a raster map in which each pixel has a value
calculated by an interpolation on the input point values.
- The various interpolation methods are Nearest Point (also called Nearest
Neighbour, Voronoi Tesselation or Thiessen Polygons), Moving Average, Trend
Surface and Moving Surface.
- The ILWIS Help topic Point interpolation gives a useful overview of the different
point interpolation techniques and their advantages and disadvantages.
Before you are going to use the kriging method you should have thought about things
like:
- Do I really need the kriging interpolation method? When estimates with their errors
are required, you should use kriging instead of another interpolation technique.
Examples of situations where kriging could be very helpful are the mining industry,
environmental research where decisions could have major economical and juridical
consequences (e.g. is the area under study polluted or not) and so on.
- Is kriging the most appropriate interpolation method for my sample set? Before
using an interpolation technique, first the assumptions of the method(s) should be
considered carefully. As a user, you should choose the most appropriate method for
your job. For example, when you want to do some modelling it is better to choose a
straightforward interpolation method. When you are interested in the estimation
errors however you should use kriging.
Once you have decided that kriging is the method you want to use, you should con-
tinue with the following steps:
- Step 1: Examining the input data
- Step 2: Calculating experimental variograms
- Step 3: Modelling variograms
- Step 4: Kriging interpolation
Step 1 in the kriging process is the visual and statistical inspection of the data set:
➦ • Open the Layers menu in the map window and choose Add Grid Lines.
• Accept the defaults and click OK. The grid layer is displayed on top of the
point map.
• Estimate the size of the map and verify this using the Distance tool.
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.
! 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’).
☞ • Select point map C14 in the Catalog, press the right mouse button and select
Statistics, Spatial Correlation. The Spatial Correlation dialog box
appears.
• Specify a Lag spacing of 10 km.
• Call the Output Table Omnidirectional_10 .
• Type in the Description box Point pair statistics with a lag-
interval of 10 km . Remember that this text is optional and can always be
changed later on.
• 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 .
• Accept all other defaults and click OK.
What is the unit used for distance (X-axis) and what is the unit used for the semi-
! variogram values (Y-axis)?
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.
indicates that the variable is erratic over very short distances, and/or that the variable
is highly variable over distances less than the specified lag spacing or the sampling
interval.
At which distance do you find the greatest discrepancy between the semi-
! variogram model and the measured values?
☞ • In the graph window, click the right mouse button to open the context-sensi-
tive 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.
You can also test which semi-variogram model fits your data best by calculating the
Goodness of Fit (R2).
where:
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:
☞ • 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) ↵
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.
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 .
• Find the range of output values in both maps.
What are the units in which the values of the output kriging map and the output
! error map are expressed?
☞ • 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 Display Options – Point Map dialog box select Attribute C14 ,
select the Text check box and press the Font button.
• 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
• Find the point with the best and the point with the worst kriging estimate in
both error maps and close the window afterwards.
In this section a 3-valued confidence interval map will be made using the maps
Ord_krig25 and Ord_krig25_Error . As reference value we take the value 30.
The ILWIS IFF function enables us to make confidence interval maps that show the
upper and lower limits of confidence intervals.
☞ • 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.
☞ • 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”.
Indicator Kriging
☞ • 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.
☞ • 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.
• Call the prediction maps respectively Universal1 and Universal2 and
select in both cases the Error Map check box.
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.
In the following exercises, you will investigate with the Variogram Surface operation
whether data is anisotropic or not. The Variogram Surface operation produces a
‘raster’ plot (with an origin) in which each cell contains the semi-variogram value for
the specific distance class and the specific direction of the cell in relation to the
origin of the plot where the distance and the direction are zero. The output plot of the
Variogram Surface operation, helps you to visualize whether any anisotropy occurs,
and to determine parameters as direction, tolerance and band width of the anisotropy.
Then from the output table of the Spatial Correlation operation, using the
bidirectional method, graphs can be constructed (distance against semi-variogram
values) in the same way as from the output table of the Spatial Correlation
operation omnidirectional method as before.
From the graph, you can determine the appropriate semi-variogram model. When the
parameters for the semi-variogram model are clear, you can finally krige your
anisotropic data with the Anisotropic Kriging operation.
For the exercises, you will use point map Artificial which has attribute Samples
in an attribute table. Attribute Samples is expected to show anisotropy when using
lags smaller than 500 m.
Variogram Surface
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 user-
specified Lag spacing. The number of cells of the output surface (from the central
cell at the origin towards positive and negative X and Y axis) is defined by the user-
specified Number of lags. The cells in the output surface represent directional
distance classes: each cell contains the semi-variogram value of all point pairs of
which the separation vector ends up in that cell/pixel (see Figures 1-4 in the ILWIS
Help topic “Variogram surface: Functionality”).
The output surface can be best viewed with a representation Pseudo . Semi-
variogram values close to the origin of the output map are expected to be small (blue
in representation Pseudo ), as values of points at very short distances to each other
are expected to be similar. When there is no anisotropy, semi-variogram values will
gradually increase from the origin into all directions. You will then find circle-like
shapes from the origin outwards, while the color gradually changes from blue (at the
origin) to green and red (away from the origin). Your data is supposed to be
anisotropic when you find an ellipse-like shape of low semi-variogram values in a
certain direction going through the origin. In this direction, the semi-variogram
values do not increase much. However, in the perpendicular direction, you find a
clear increase in semi-variogram values.
☞ • Make another Variogram Surface; use 20 lags and a lag spacing of 10 km.
• Call the output map Var_surf55_20
☞ • 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 .
Display the surfaces using the same stretch range and the same representation
(Pseudo ). Compare the output surfaces; determine the directions (azimuth) of the
principle axis of anisotropy.
Figure 11.5: Schematic explanation of the input parameters for Spatial Correlation bidirectional
method: lag spacing, nr of lags, direction, tolerance and band-width.
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 west-
east 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 :
☞ • 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.
• Use parameter Samples as attribute column again.
• Select the option Bidirectional.
• Use a Lag spacing of 100 m and use the Direction angle as found in the
previous exercises (Variogram surfaces).
• Call the Output Table Artificial_bidirect , accept all other defaults
and click Show. The Bidirectional Spatial Correlation table is calculated
and shown.
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.
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.
distance from the origin to a certain semi-variogram value on the principle axis of
anisotropy (i.e direction 20°). Then try to find the same semi-variogram value in the
perpendicular direction (i.e. 110°). The ratio of these figures is called the scale factor.
For SemiVar2 the Slope could be 0.00002 but in case of geometric anisotropy we
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.
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 table window select Columns, Statistics. The Column Statistics
dialog box is opened.
• In the Column Statistics dialog box select the Correlation function and
select the attribute columns Sub76 and Avg30 .
• Click OK to show the result.
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.
• Call the Output Raster Map Cokriging .
• 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.
• Close all windows after you have finished the exercise.
- Kriging assumes a certain degree of spatial correlation between the input point
values. To investigate whether your point values are spatially correlated and until
which distance from any point this correlation occurs, you can use the Spatial
Correlation operation.
- In the Spatial Correlation operation you can either choose the omnidirectional or
the bidirectional method. The omnidirectional method simply determines semi-
variogram values in all directions. The bidirectional method on the other hand
calculates semi-variogram in a certain direction and perpendicular to that direction.
- When the variation of the variable under study is not the same in all directions,
then anisotropy is present and you must use the bidirectional method. In case of
suspected anisotropy you should calculate a variogram surface with the
Variogram Surface operation beforehand.
- When you want to use Cokriging, you should investigate the input point values
with the Cross Variogram operation.
- From the Distance and Semivar columns of the Spatial Correlation or Cross
Variogram output table you can create point graphs, i.e. experimental semi- and
cross-variogram(s).You must try to fit a semi-variogram model through the
experimental semi-variogram. The model will be used as interpolation function in
the kriging operation.
- Several variogram models exist e.g. Spherical, Gaussian, Exponential, Power,
Wave, Rational quadratic, Circular.
- Each type of semi- or cross-variogram model has a sill, a range and a nugget (or
when using the Power model values for the sill, slope and power).
- You can check which model fits your data best by using the Column
SemiVariogram operation in combination with the Goodness of Fit test.
- Kriging can be seen as a point interpolation that requires a point map as input and
returns a raster map with estimations and optionally an error map.
- In ILWIS several kriging methods are available: Simple Kriging, Ordinary Kriging,
Anisotropic Kriging, Universal Kriging and Cokriging.
- Simple Kriging is the simplest kriging method; all input points are used to
calculate each output pixel value
- Ordinary Kriging is the kriging method in which you can influence the number
of points that should be taken into account in the calculation of an output pixel
value by specifying a limiting distance and a minimum and maximum number of
points.
- Universal Kriging is variant of the Ordinary Kriging operation; it is kriging with
a local trend. The local trend or drift is a continuous and slowly varying trend
surface on top of which the variation to be interpolated is superimposed.
- From the combination of a kriged output map containing the estimates and its
output error map, you can create confidence interval maps.
To assess the effect of spatial resolution on image statistics and the spatial structure
of the image, variograms can be used.
The data set available in this section contains parts (250 by 250 pixels) of Landsat
TM scenes, with three different characteristic lithologies:
- Gneiss : Raster map of gneissic units, extracted from a Landsat TM scene
acquired on the 25th of March 1989 of an area near Málaga in southern Spain.
- Schist : Raster map of schist, extracted from a Landsat TM scene acquired on the
19th of July 1984 of an area near Montalbán in central Spain.
- Carbonate : Raster map of a folded carbonate sequence, extracted from a Landsat
TM scene acquired on the 19th of July 1984 of an area near Montalbán in central
Spain.
Now you will calculate and display semi-variograms for the three lithologies.
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.
Specific features that can be observed in the semi-variograms for the different
lithologies are:
- Gneiss: The semi-variogram has a very short range due to the fact that the gneisses
lack bedding or other kind of structurization. The vertical and horizontal semi-vari-
ograms are identical, due to the homogenous and isotropic landforms on the gneis-
sic terrain lacking any preferred orientation. The sill is high, due to strong differ-
ences in absolute digital numbers between the sunlit slopes and the shadowed
slopes.
- Schist: The range of the semi-variograms of the schist is very long pointing to very
continuous data with less spatial variability. The sill value is very low due to small
spectral variation observed in the image.
- Carbonate: The carbonate image has again a long range and a low sill value. Note
the differences between the vertical and horizontal semi-variograms. The long
range in the horizontal semi-variogram points to more continuity and the short
range in the vertical semi-variogram to more variability in the respective direction.
This can be attributed to the bedding that predominantly strikes east-west and is
pronouncedly clear, due to the alternation of carbonates and marls.
☞ • 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.
In the previous chapters you have seen a number of examples of data analysis, which
were mainly performed by using dialog boxes of the various ILWIS operations.
The script language is similar to the Command line syntax and we will therefore
have a closer look at the Command line in the first part of this chapter. We will then
start creating scripts with and without variables.
In chapter 5 (attribute data handling) and in chapters 7, 8 and 9, you have been
working with the Command line to perform calculations on tables and maps. Instead
of typing long and similar calculations on the Command line for different input
maps one by one, you can store frequently used calculations as functions, which can
then be used for different maps. The use of functions will be treated in the last part of
this chapter.
Before you can start with the exercises, you should start up ILWIS and change the
subdirectory to C:\ILWIS 3.0 Data\Users Guide\Chapter12 or to the directory
where the data files for this chapter are stored.
The script language is similar to the Command line syntax and we will therefore
have a closer look at the Command line first.
The Command line has a history: use the List button or the Arrow up key to
! retrieve previously used expressions and commands. The Escape key can be used
to clear the Command line.
You can also copy and paste text back and forth from the Command line to the
Clipboard with the following keystrokes:
Ctrl+C Copy the selected part to the Clipboard.
Ctrl+V Paste the contents from the Clipboard.
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 doesn’t 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).
☞ • Open Help, go to the Appendices and browse through the following topics:
ILWIS commands and expressions: ILWIS commands, ILWIS expres-
sions, ILWIS expressions (alphabetic), Construction of expressions,
ILWIS script language (syntax).
Table 12.1: Some commands that can be used on the Command line.
Command Example Description
Open object.ext Open Geomorphology.mpr Opens the Display Options dialog
box for the object or shows the
object immediately (e.g. tables)
Edit object.ext Edit Geomorphology.mpa Opens polygon map
Geomorphology in the Polygon
editor
Copy object.ext objname Copy Cityblocks.mpa Cocha Copies polygon map cityblocks
to a new name
Del object.ext Del temp.mpr Deletes raster map Temp
Md directory Md temp Creates a new directory Temp
Help Help Opens the ILWIS Help
You will notice that you get an error message when you type: Open
Geomorphology ↵.
This is due to the fact that ILWIS doesn’t 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.
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.
In the next exercise we will create a script that when executed creates the same
landslide map as created from the Command line in the previous exercise.
☞ • 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
The line numbers in Figure 12.1 are not forming part of the script. They are only used
here to comment on the various expressions. The script contains the following expres-
sions:
- In line 1, a class domain is created with the name Landslide .
- In lines 2 and 3, two items are added to this domain.
- In line 4, the raster map Landslide is defined which will have one of the two
items, defined in line 2 and 3. The Map Calculation formula uses as input the geo-
morphologic map Geomorphology . The codes “AL ” and “OL ” stand for “Active
Landslide ” and “Old Landslide ”.
- In line 5, the map Landslide is calculated. The Calc statement is a typical script
language statement meaning that an object has to be calculated before proceeding
to the next line of the script. This statement is used when the outcome of a calcula-
tion or a statement is needed as input for the next.
- In line 6, the map Landslide is displayed.
☞ • 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:
☞ • Click the Run Script button in the Toolbar of the Script editor. When
you already closed the Script editor, you can select the script in the
Catalog, click it with the right mouse button and select Run… from the con-
text-sensitive menu. You can also type Run Landslide on the Command
line of the Main window.
The results of running this script are the map Landslide and the domain
Landslide .
☞ • Check the contents of the raster map Landslide and the domain
Landslide and close the map window, the domain and the Script editor
afterwards.
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.
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.
The average land prices per hectare are given in an attribute table linked to the land
use map. However, these average values will either be higher or lower, depending on
a set of criteria:
- 1. The price of the land will be 100% of the average value when located on slopes
of less than 20°, and 70% when located on slopes of more than 20°. Slope informa-
tion is stored in the map Slope .
- 2. The price of the land will be 40% of the average value when it is located on an
active landslide or on an area with high erosion, and 60% when located on an old
landslide. For this criterion we need the geomorphologic map Geomorphology .
When evaluating the combination of criteria we only look at which of the criteria will
lead to the lowest land price.
Please keep in mind that the objective of this exercise is not that you learn about an
application - for that the problem is too hypothetical - but that you learn how to use
Map Calculation formulas in a script. The script looks as follows:
The line numbers in the table do not form part of the script. They are only used here
to comment on the various expressions.
- 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
are working on maps with a pixel size of 20 meters, you need to divide the land
value by 25 in order to obtain the average value per pixel.
- In line 4, the first criterion is applied: If the slope is more than 20°, then the price
of the land will only be 70% of the average value.
- In line 5, the second criterion is applied: If the pixel is an old landslide, then the
value is only 60% of the average value. If the pixel is on an active landslide or on
an active erosion area, the value is only 40% of the average. The information on
landslides and erosion is stored in the map Geomorphology . Codes are used
instead of the names of the geomorphologic units. The unit “Old Landslide ” in
the domain Geomorphology has the code “OL ”. If you use codes, the formulas
can be much shorter.
- Now you have generated two maps that contain land values based on one criterion
(Landvalue1 and Landvalue2 ). What should you do for pixels where more than
one of these criteria occurs? For example for pixels with a slope less than 20°
which are located on an active landslide. The best approach is to take for each pixel
the minimum of the same pixel in one of the two maps. This is done in line 6.
- Since the map Landval_combined occupies a smaller area than the map
Landvalue the formulas will result in undefined values, for those places where
one of the input maps is undefined. This is corrected in line 7.
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.
information on the cadastral districts of the city). In the last part of the exercise you
solved the following problem:
Calculate the total area and the total population for each district. Apart from that,
calculate the percentage cover of residential, commercial and institutional buildings
in each district. Find the relation between the number of schools and the number of
schoolchildren (under 18 years old) for the districts of Cochabamba city. In order to
solve this problem, we needed to know the land use types, the area, the population,
the number of school children, and the number of schools in each district.
The information on areas, land use types and population is available for each city
block in table Cityblock . The information on the number of schools and the
percentage of schoolchildren of the population is known per district and is stored in
table District . Since you know for each city block in which district it is located,
you can use the information from the table Cityblock and bring it into the table
District . However, the table Cityblock contains 717 records and the table
District only 13. So you will have to do an aggregation.
The line numbers in the table are not part of the script. They are only used here to
comment on the various expressions.
- In line 2, the aggregate function Sum is used to sum up the area per district. The
result is stored in the column Areadistrict of the table Cityblock .
- In line 4, the aggregate function Sum is used to sum the areas of the land use types
per district.
- In line 8, the Cityblock table in memory is closed, and in line 10 the District
table will be kept open in memory.
- In lines 11, 12 and 13, the percentage cover values for residential, commercial and
institutional areas within each district as stored in table Cityblock are joined into
table District . The aggregate function is needed, since 1 record of a district from
table District , is linked to many records of the same District in table
Cityblock .
- In line 14, another join operation is performed to join the population data from
table Cityblock , summed up for each district, into table District .
- In line 15, the total population per district is used in combination with the percent-
age of schoolchildren per district to find the number of schoolchildren per district.
- In line 16, the number of children per school is calculated for each district.
☞ • Click the ILWIS button in the Toolbar of the Main window to make sure
that all object types are selected.
• Double-click the script Urban in the Catalog. The Script editor is opened,
in which you will see the script language.
• Run the script by clicking the Run Script button in the Toolbar of the
Script editor.
• Have a look at the result and close the table District afterwards.
In this exercise you will calculate a slope map in percentages and degrees. The script
looks like:
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 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 6, output map %4 is calculated and therefore all maps created by the script
are calculated.
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.
- When the Parameters tab is used, also default values for the input and output
parameters can be filled out in the Default Values tab. This tab is very useful
when you want to test your script or when you directly want to run your script.
- When no parameters are defined on the Parameters tab, you can run the script
from the Command line and specify the input and output objects that should be
used for the parameters after the script name:
Run Scriptname Parameter1 Parameter2 … Parameter9
ILWIS will replace every parameter definition (%1….%9) by the specified parame-
ter.
We will first run the script from the Command line of the Main window.
We will now enter the parameters in the Parameters tab and run the script from the
Script editor.
☞ • Open script Slope and click the Parameters tab. Set the number of param-
eters to 4.
• Enter the parameter Names and Types according to Table 12.3.
• Enter Run Slope Script on the Description line.
• Save the script.
• Run the script by clicking the Run Script button in the Toolbar of the
Script editor.
• 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 Slopepct2 and Slopedgr2 .
• Click the Default Values tab. Select the Input Contour map and the
Georeference to be used according to Table 12.3. Type for the Output
Slope map in Percentage Slopepct3 and for the Output Slope map in
Degrees Slopedgr3 .
• Save the script.
• Run the script by clicking the Run Script button in the Toolbar of the
Script editor.
• Have a look at the resulting maps Slopepct3 and Slopedgr3 . Close the
map windows and the Script editor.
Script Density calculates the density of landslides within certain units. It reads:
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.
• Save the script and exit the editor.
• In the Catalog, click script DensIn with the right mouse button and choose
Run.
• Have a look at the resulting attribute tables Geology , Slope_classes and
Catchment .
• Close the tables after you have seen the result.
Table 12.4: Some commands that can be used on the Command line.
Command Example Description
Begincomment begincomment All lines of text between the com-
Open Geomorphology.mpr mands begincomment and endcom
Endcomment
endcomment ment are ignored by the script.
Pause seconds Pause 20 Stop the script for a certain amount
of time (seconds).
Message text Message Click to continue Obtain a message box on the screen
with any text; the text can be as long
as you like. After pressing the
OK button in the message box, the
script will continue.
Open -noask object.ext Open -noask Cityblock.mpa Opens the object object.ext with its
default display options
Closeall Closeall Close all ILWIS windows except the
ILWIS Main window.
Summary: Scripts
- Scripts are used to automate the operations in ILWIS.
- With the help of a script, a complete GIS or Remote Sensing analysis can be per-
formed 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.
- A script can also be made by copying parts from the ILWIS log file after you have
executed some operations via dialog boxes. ILWIS keeps track of everything you
are doing in a so-called log file. The ILWIS log file is called Ilwis.log, and you can
find its directory from the Preferences. The .log file can be opened with any text
editor.
- A script can be started from the Script editor, by choosing the Run … command
on the script’s context-sensitive menu in the Catalog or from the Command line
of the Main window by typing: Run Scriptname ↵
- You can also specify default objects for parameters on the Default Values tab.
- Other scripts and other Windows applications can be called from within a script.
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.
☞ • 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) Returns random long integer values in the range [1; 2 billion
(2*109 )]; To simulate a die, use this function in the form of:
RND(6).
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,
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.
• Examine the results, and then close the map window.
MinMax functions
Using these functions, you can for instance calculate for each pixel the minimum or
maximum value of 2 or 3 input maps; substitute a, b, c with the map names.
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: MapCalc, TabCalc, Scripts and the pocket line calculator. Especially when
you need to execute calculations that require a lot of typing work several times, user-
defined functions may be time saving. A user-defined function is an expression that
may contain any combination of operators, functions, maps and columns in tables.
Firstly you will create a simple function and after that a more complex one.
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 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.
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 .
☞ • 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 cal-
culator.
- Besides many internal pre-programmed functions, ILWIS gives the user an oppor-
tunity to create new functions.
- User-defined functions are especially useful when you need to execute certain cal-
culations, 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) fol-
lowed by the definition symbol (=), the name of your function and fill out the func-
tion parameters. The parameters, replacing the characters a, b, c, etc. in your func-
tion, 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.
Presentation of results
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.
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 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.
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.
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.
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 com-
puter 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.
The notation:
(0, 0, 0) returns black, (0, 0, 255) returns blue,
(255, 255, 255) returns white, (255, 255, 0) returns yellow,
☞ • Click on the color Yellow . You can see that the three slide bars on the left-
hand 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 representa-
tion 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).
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.
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:
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.
☞ • 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.
• Close the table window.
- 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”.
- 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.
To convey relevant information with these cartographic tools, a cartographer can use
several visual variables. With visual variables, one can manipulate how these above
mentioned items will be displayed. There are seven visual variables: position, form,
orientation, texture (variation of density of graphical elements with the same overall
gray expression), value (gray tones), size and color.
The visual variables that can be used in ILWIS depend on the map domain (class, ID,
value, picture, color), and on the type of map (point, segment, polygon and raster).
When you make a division according to the type of maps, the following variables can
be used:
- Point maps. Point can be displayed with different symbol types from different
symbol fonts. The size, line color, line thickness and fill color can be specified.
- Segment maps. Segments can be displayed in different colors, line types (double,
triple, etc. for e.g. a highway) and different line widths.
- Polygon maps. Polygons can be displayed in different colors, either solid, hatching
or with a pattern, and the boundary lines around polygons can be shown in
different colors and different line widths.
- Raster maps. Raster maps can be displayed using different colors.
From point, segment and polygon maps, you can extract text labels which can use a
certain font type, size, color, etc. by creating an annotation text layer (see section
13.4).
For point (and raster) maps, you can also directly show texts via the map’s Display
Options - dialog box.
In chapter 2, the different types of representations that are available for different
domains were discussed. To summarize, the Representation editor can be used to
edit colors, patterns and point 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 represen-
tations:
- 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 represen-
tation. 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.
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).
This exercise shows how to change colors in a class map by editing its representation
class.
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).
In this exercise you will produce a simplified land use map based on the main land
use classes of Cochabamba.
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.
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.
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.
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.
• In the Representation Class editor, click the Polygon tab.
• On the Polygon tab, double-click class Urban centre . The Edit Repr.
Item dialog box is opened.
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.
Visual variables for segments: color, line type and line width
The visual variables for segment maps are color, line type and line width. For the
production of the final map you will need three segment maps: Contour ,
Drainage , and Roads . The first map is a value map and the other two are class
maps.
➦ • 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.
Point data presented in a point map with a domain type class can be symbolized by
editing the representation linked to the map. Point maps with the domain type
identifier or value are linked to a system representation; the process of symbolizing
the point data has to be done using the Display Options – Point Map dialog box.
In this part of the exercise, the point map Places with class domain is used. By
editing the representation used by this map, you are able to select symbol type,
symbol, size, fill color, line width and line color for the individual points in the map.
➦ • Specify the symbol representation for the other points according to Table
13.4.
• Close the map window when you have finished the exercise.
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.
Point map Rainfall has an identifier (ID) domain. The map is linked to an attribute
table which contains rainfall data per year (Total ), per quarter and per month. In
this exercise you will display an attribute point map Rainfall with the point radius
stretched according to the total annual rainfall.
➦ • Accept the defaults for Symbol Type, Symbol, Fill Color, Line Width and
Color.
• Select the Stretch check box and accept the default stretch range.
• Accept Linear and Radius for the stretch method and click OK in the
Symbol dialog box.
• 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.
When the attribute table of an ID point map contains comparable value columns of
various categories, you can display the points as graphs. In the Symbols as Graphs
dialog box, you can specify the type of graph:
- Pie Chart
- Bar Graph
- Line Graph
- Composed Bar
- Volume Cubes
The values of the selected columns will be represented by the size, length, volume,
etc. of the selected graph type. For pie charts, you can also specify a stretch and
stretch range of the total size of the pie charts. This is a useful option when the total
size of the pie charts should represent the total amount of all variables depicted in the
pie charts. As an alternative, you can also specify a fixed, user-defined size for all
pie charts.
For more information on this subject, see the ILWIS Help topic Symbols as
graphs: Point maps with ID domain and attribute table.
In this exercise, you will use a pie chart to display rainfall data of one year for the
Cochabamba area. To reduce the number of wedges in the pie chart, you will
represent the total rainfall per quarter. The stretch option will be selected to display
the size of the pie charts according to the total annual rainfall. The raster map
Shadows will be used as a background map.
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.
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.
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.
- From point, segment and polygon maps, you can extract text labels which can use a
certain font type, size, color, etc. by creating an annotation text layer. For point (and
raster) maps, you can also directly show texts via the map’s Display Options - dia-
log box.
- The ILWIS Representation editor can be used to edit colors, patterns and point
A map view may contain data layers, annotation text layers, grid lines and/or
graticules. The display settings (colors, widths, etc.) of each layer is stored. By
opening a map view, all layers that were stored in the map view will be displayed
exactly as they were stored, i.e. same colors, same zoom factor, same area. The title
that you give to a map view, is later visible in the Title bar of the map window.
In this exercise, the following data layers will be combined into a single map:
- Polygon map Landuse : Forming the primary content. The map is displayed as col-
ored patterns.
- Raster map Shadows , containing the hillshading of the study area.
- Segment map Contour , containing the contour lines.
- Segment map Drainage , containing the drainage network.
- Segment map Roads , containing the road network.
- Point map Places , containing the location and names of the most important loca-
tions in the area.
➦ • 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).
☞ • From the File menu in the map window, select Create and select
Annotation Text. The Create Annotation Text dialog box is opened.
• Enter the AnnText Name: Place_labels .
• Make sure the check box Based on Map is selected and choose point map
Places from the drop-down list box.
• Accept all other defaults and click OK. The Annotation Text editor is
opened.
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
Editor button in the Toolbar after you are satisfied with the result.
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.
☞ • From the File menu in the map window, select the Save View As command.
The Save View As dialog box is opened.
• Enter the Map View Name: Landview .
• Enter the Title: Landuse map of the Cochabamba area .
• Click OK. The view is now saved.
• Close the map window.
• Open the map view Landview . As you can see, all layers that you combined
earlier are now appearing in the same way as you displayed them before.
• Close the map view afterwards.
- 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.
A layout is required to print maps with annotation. A layout is a virtual sheet of paper
on which you can make a composition of one or more map views into which you can
insert annotation. For each map view, you can specify the scale on which the map
view has to be displayed and printed later on.
Pictures or bitmaps can be inserted from the clipboard or from harddisk. Annotation
can be edited by double-clicking the object in the Layer Management pane. The
total composition of the map view(s) added annotation should be saved in the layout.
This layout can be printed later on.
In this exercise you will create a layout for the land use map of the Cochabamba area.
The final map that will be made is shown in Figure 13.4.
Creating a Layout
☞ • 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,
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 context-
sensitive 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.
• Make sure the Paper Size is A4 , change the Orientation to Landscape
and click OK. The orientation of the layout is now changed into landscape.
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 Scale Bar
to add simple Text e.g. a title to add a Scale Text
to add a Box to add a layer to a map view
to add a Picture or bitmap from disk to remove a layer from a map view
to add a Legend to add Grid Lines to a map view
to add a Map Border to add a Graticule to a map view
to add a North Arrow
☞ • 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.
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 .
• Change the scale into 1:125000 .
• If necessary, position the map view again.
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
Scale button in the Standard toolbar (the button should appear down).
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.
☞ • Make sure the map view Landview is selected in the Layout pane.
• 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.
• 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.
• Select Full Coordinates and Text Offset 2.0 mm.
• Select the Font Name: Times New Roman and Font Size: 10 .
• Click OK. The map border is displayed in the layout window.
• Position the map view in such a way that the map view and coordinates are
displayed within the page margins.
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.
• Select Font Name: Times New Roman , and Font Size: 10 .
• Accept the defaults for other display options by clicking the OK button. The
legend will be displayed in the Layout pane.
• Select the legend box.
• 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.
• Repeat the previous steps to insert a legend for the Drainage and Road
data layers.
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.
➦ • Drag the Bolivia map and position it somewhere at the right hand side of
the layout (see Figure 13.4).
• Size the inset map by dragging its corner handles.
• Save the layout.
It is also possible to paste a picture from the Clipboard into the layout.
☞ • 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.
• Click the ITClogo and drag it to the position as in Figure 13.4.
• Save 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.
• Type the following in the text box:
Land use map ,
Cochabamba , Bolivia
• Choose the Font Name: Arial and use Font Size: 28 .
• Select the Bold check box and click OK. The text appears in the layout.
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.
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.
☞ • Click the Text button in the Layout toolbar of the Layout editor. The
Edit Text dialog box is opened.
• Type the following in the text box:
Location map:
• 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.
☞ • Make sure the map view Landview is selected in the Layout pane.
• 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 Arrow Type Wing .
• Select Font Name: Times New Roman , Font Size: 14 and click OK. The
north arrow is displayed in the layout.
• Position the arrow below the title of the map (see Figure 13.4).
• Resize the north arrow and make it smaller.
• Save the layout.
☞ • Make sure the map view Landview is selected in the Layout pane.
• From the Insert menu, select Scale Bar or click the Scale Bar button in
the Layout toolbar. The Edit Scale Bar dialog box is opened.
• Select the Unit Indication check box.
• Select Font Name: Times New Roman , Font Size: 10 and click OK. The
scale bar is displayed in the map window.
• Position the scale box below the land use legend (see Figure 13.4).
• 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 in the Layout
toolbar. The Edit Box dialog box is opened.
• Accept the defaults by clicking the OK button. A box is added to the map.
• Position the box close to the legend and resize it so that it encloses the whole
legend (see Figure 13.4).
➥
➦ • Repeat the steps to create a box for the entire layout. Make sure the box is
within the page margins.
• Save the layout.
☞ • Double-click the north arrow in the Layout pane. The Edit North Arrow
dialog box is opened.
• Select the Half check box and click OK.
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:
A Layout is required to print maps with annotation. The layout may contain:
- Map views: one or more map views, each of which may include a raster map, and
multiple polygon, segment or point maps, annotation text layers, grid lines and/or a
graticule. For each map view, you need to specify the scale on which it should be
displayed and printed later on.
- Map border: border information for a map, optionally displaying: neat line gradua-
tion, grid and/or graticule ticks, grid, graticule and/or corner coordinates and a map
outline.
- Legends: a legend from the domain of any map in a map view and the representa-
tion used by that domain.
- An inset map, pictures or bitmaps: an inset map can be added as map view and pic-
tures or bitmaps can be pasted from Clipboard or inserted from file.
- Text: multiple lines of text (e.g. a title); select a font type and color for the created
text.
- Scale bar: adds a graphic scale (scale bar) to the layout. The type of scale bar, inter-
vals, 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.
The total composition of map views and annotation on a certain paper size is stored
as a layout and can be printed.
It is also possible to print only attribute data of a table. To this purpose, you can
select the Print command in the table window. In the Print Options dialog box, you
can select whether you want to see a header and leftmost column on all pages, and
you can set the font specifications.
Before you can print, you should make sure that the printer is correctly installed
under Windows. In this exercise, you will print the layout Landview that was
created in 13.5.
If you change the paper size or orientation of the paper, you may have to
! rearrange all items in the layout.
- Paper copies can be created in black and white or color, depending on the printer
you use.
Exporting your data is not needed if you use the cartographic software package ACE,
but it is recommended to transform your data to a georeference corners.
For raster maps, the easiest way is to convert to either Windows Bitmap format, or
TIFF format. Nearly all software packages dealing with maps and images are able to
read these file formats. These formats have the major disadvantage, however, that the
coordinate information is not converted. The imported files will thus lose their
coordinates. This will lead to problems when you want to combine a converted raster
map with vector information in the cartographic software. To make sure that the
exported file from ILWIS doesn’t lose its coordinates, the conversion to GeoTiff is
often used.
For vector data the most common file format is DXF, which is defined by AutoCad.
For more information on how to export data, see the ILWIS Help topics Export and
How to export data.
In this exercise you will practice the conversion of raster and vector data. For raster
maps, conversion is fairly simple.
☞ • From the File menu of the Main window, select the Export command. The
Export dialog box is opened.
• Select the raster map Shadows from the list box.
• Select the Export Format: Tiff (Geotiff).TIF
• Type the Output Filename: Shadows and click OK. The raster map
Shadows is exported to TIF format.
☞ • From the File menu of the Main window, select the Export command. The
Export dialog box is opened.
• Select the point map Places from the list box.
• Select the Export Format: AutoCad.DXF , type the Output Filename:
Places and click OK. The point map Places is exported to DXF format.
• Repeat the operation for the segment map Drainage . Export it to
Drainage.DXF
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.
• Select the polygon map Landuse from the list box.
• Select the Export Format: AutoCad.DXF , type the Output Filename:
Landuse and click OK. The polygon map Landuse is exported to DXF for-
mat.
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.
You can show ILWIS maps, a GIF image, a bitmap, play a sound or a video, etc.,
when a mapping unit in a domain class map or an element in a domain ID map is
double-clicked. In an attribute table linked to the map, there should be a column
called Action , which should have the string domain. In this Action column, you
specify a file name of a map or table and its extension (.MPR, .MPA, .MPS, .MPP,
.TBT), or a GIF image, picture, sound or video, that you want to see/hear when
double-clicking a mapping unit.
In Windows Explorer you should make sure that a default Open action is defined
for the file types which you would like to be opened when such a file type is double-
clicked. These are so-called registered file types. Native ILWIS extensions are already
associated with ILWIS during the setup of ILWIS. Most other file types will also
have a default program already, which will be used to open the files.
When you have set the Double-click Action to Execute Action in a map window
which displays a class or ID map, and double-click a unit in the map, then if an
attribute table is found with a column Action , in which a filename is found that has
a registered extension, then that file is opened (map or table is shown, audio or video
is played, etc.).
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.
• Select the File: Photo1.tif . The Output Filename is set to Photo1 .
• Click OK. The file is converted.
• Repeat this procedure for the other photos or create a script.
• Display the various photos and close all map windows after you have finished.
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.
• Select the option Rotate 90 degrees clockwise. Type as Output Raster
Map name: Photo9r and click Show. The Display Options – Raster Map
dialog box is opened.
• Click OK. The map is rotated and the result is displayed. Close the map win-
dow.
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).
☞ • 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 .
• Close the map window.
• Repeat this for the other photos (Photo2 to Photo8 , and Photo9r ), and
create views with the same names. Type the descriptions as given in Table
13.5.
View Title
Photo1 Country school in the mountains
Photo2 Cochabamba seen from the Colina de San Sebastian
Photo3 Indian village in the mountains
Photo4 Llamas grazing in the mountains
Photo5 Cochabamba by night
Photo6 Transporting Chicha and Coca
Photo7 Geologic fault
Photo8 Central park of Cochabamba
Photo9r Cochabamba beats Rio de Janeiro with 33cm
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.
• Press the Symbol button. The Symbol dialog box is opened.
• 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 .
• Click OK. You are back in the Display Options - dialog box.
• Select the Text check box and press the Font button. The Font dialog box
appears.
• 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.
• 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.
• Close the map window.
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.
☞ • 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.
• Close the table window.
• Click the point map Photos with the right mouse button and select
Properties. The Properties sheet is opened.
• Make sure that the Attribute Table check box is selected, select the table
Photos and click OK.
Now all input data is ready, so you can do the actual demo.
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.
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.
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.
• Enter the Map List Name: Manizales .
• Enter the Description: Growth of the city of Manizales (Colombia).
• Select the raster maps M1851 , M1930 , M1949 , M1960 , M1970 , M1977 , and
M1989 (hold the Ctrl key down to select multiple maps at a time), press the
> button and click OK.
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.
- Another way of demonstration in 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
Slide Show operation is meant for this purpose.
3D Details: 8
Distance: 304
3D: 405 Entire map: 18
Display: 405 ILWIS: 8
Editor: 405 Keep scale: 504
Model: 405 Layout editor: 502
View: 388, 405, 410
Border: 503
Adding vector layers: 411
Box: 503
With raster draping: 410
Graticule: 503
Grid Lines: 503
A Legend: 503
ACE: 513 Map view: 503
Action column: 515 North arrow: 503
Add Picture/Bitmap: 503
Annotation Text: 499 Scale bar: 503
Data layer: 498 Scale text: 503
Grid lines: 500 List: 8
Inset map or picture: 506 Measure Distance: 19
Text: 507 Normal: 19
Affine transformation: 76, 81 Options: 15
Pan: 18, 212
Aggregate functions: 193
Record: 23
Anisotropic Kriging: 445 Zoom In: 18
Anisotropy: 448 Zoom Out: 18
Annotation: 502, 510
Annotation Text: 499 C
ArcInfo .E00 format: 123 Calculating: 176, 302, 365, 397
Area numbering: 352, 379 Classified slope direction map: 365
Areas: 28 Connectivity: 381
Arithmetic operators: 178, 321 Distance with weights: 374
Aspect: 128, 365 Distances: 375
Assignment symbol: 176, 318, 463 Histogram: 219
Number of points: 302
Attribute data: 13, 53, 71, 167
Pocket line calculator: 177
Attribute map: 293 Receiving cell map: 366
AutoCad .DXF format: 123 Segment density: 309
Autocorrelation Slope shape: 397
Of point data: 424 With columns: 176
Of raster maps: 454 With value columns: 177
Autocorrelogram: 425 Catalog: 3, 58
Axis of anisotropy: 448 Customizing: 5
Query: 58
Sort: 58
B View: 58
Bar graph: 494 Details: 58
Bicubic convolution: 246 List: 58
Bilinear interpolation: 246 Cauchy-Schwarz inequality: 450
Binary filter: 356 Check Up-to-date: 66
Boolean statement: 288 Check box: 15
Box: 509 Checking segments: 104
Box classifier: 271 Class: 34, 37
Break dependency link: 68 Domain: 20, 34, 37, 486
Button: 212, 304 Map colors: 487
Create: 14 Representation: 43
Customize Catalog: 5
I J
Joining tables: 198, 200, 202, 203, 465
Identifier domain: 34, 39, 487
IDRISI
IMG: 120 K
IFF function: 328, 335 Kriging: 435
Anisotropic: 445
IFUNDEF function: 330
CoKriging: 450
IKONOS: 120 Estimation: 435, 441
ILWIS From raster: 456
Functions: 319 Indicator: 444
Help: 9 Ordinary: 435
Icons: 11 Simple: 443
Log file: 461 Universal: 444
Objects: 11, 118
Extensions: 460
Image: 32
L
Arithmetics: 257 Laplace filter: 223, 226
Classification: 262 Latitudes: 48
Domain: 32 Layer management: 16, 33
Enhancement: 217 Layout: 502
Fusion: 258 Adding
Processing: 209 Box: 509
Ratios: 249 Inset map or picture: 506
Image-to-image registration: 242 Legend: 505
Import: 118, 174 Map border: 504
Genuine: 118 Map view: 503
Raster data: 119 North arrow: 508
Through General Raster import: 121 Scale bar: 509
Through GeoGateway import: 120 Scale text: 509
Through ILWIS import: 119 Text: 507
Table Wizard: 174 Copy and paste via Clipboard: 506
Use As: 118 Creating: 502
Vector data: 123 Editor: 502
Through GeoGateway import: 124 Page Setup: 503
Through ILWIS import: 123 Toolbar: 503
Via GeoGateway: 118 Export to Bitmap: 514
Importing Least Squares Fit: 191, 431
Digital attribute data: 174 Colomn operation: 191
Digital data: 118 Graph: 191
Indicator Kriging: 444 Legend: 505
Input of Spatial data: 71 Limiting distance: 430
Insert Mode: 85 Line graph: 494
Intensity: 484