You are on page 1of 542

ILWIS 3.

0 Academic

Users Guide

Unit Geo Software Development


Sector Remote Sensing & GIS
IT Department
International Institute for
Aerospace Survey and Earth Sciences (ITC)
Enschede, The Netherlands

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
For general information about ILWIS, please contact:
ITC-ILWIS
Hengelosestraat 99
P.O. Box 6
7500 AA Enschede
The Netherlands

Phone: +31-53 4874 401


Fax: +31-53 4874 484
E-mail: ilwis@itc.nl
Web site: http://www.itc.nl/ilwis/

Other e-mail adresses


We have special e-mail addresses for various ILWIS related subjects:
General information:
info.ilwis@itc.nl

Bug reports:
bugs.ilwis@itc.nl

Technical support:
support.ilwis@itc.nl

Wishes for new functionality:


wishes.ilwis@itc.nl

Pricing and ordering:


sales.ilwis@itc.nl

Authors and Acknowledgements


The original ILWIS 2.0 and 2.1 Users Guides were created by Cees van Westen and
Jamshid Farifteh. All exercise data was prepared by Cees van Westen. Furthermore,
Ben Maathuis and Gerrit Huurneman made contributions to and provided data for
chapter 6, and Freek van der Meer and Paul van Dijk for chapter 11.
This ILWIS 3.0 Users 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 Users 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 Users 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 (geomorphological data, contour data), Dr. Roberto Mndez 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 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

2.

Main concepts of ILWIS 3.0

27

2.1 Structure of spatial data in ILWIS ......................................................................................28


Vector model .............................................................................................................28
Raster model .............................................................................................................29
Object types ..............................................................................................................30
Summary: Structure of spatial data in ILWIS ....................................................30
2.2 Displaying maps and Layer Management ........................................................................31
Displaying vector and raster maps ......................................................................31
Layer management ..................................................................................................33
Summary: Displaying maps and Layer Management ......................................36
2.3 About domains .......................................................................................................................37
More about class domains ....................................................................................37
More about identifier domains ..............................................................................39
More about value domains ....................................................................................40
Summary: About domains ......................................................................................42
2.4 About representations ...........................................................................................................43
More about representation class ..........................................................................43
More about representation value..........................................................................44
Summary: About representations .........................................................................46
2.5 About coordinate systems ...................................................................................................47
Summary: About coordinate systems .................................................................49

2.6 More about georeferences ...................................................................................................50


Summary: About georeferences ...........................................................................52
2.7 Attribute data ..........................................................................................................................53
Summary: Attribute data ........................................................................................54
2.8 Pixel Information window .....................................................................................................55
Summary: Pixel Information window ...................................................................57
2.9 Details view of a Catalog .....................................................................................................58
Summary: Details view of a Catalog ...................................................................59
2.10 Object properties and dependency links .........................................................................60
Dependencies ...........................................................................................................63
Summary: Object properties and dependency links ........................................68
2.11 How to use geographic data in ILWIS ..............................................................................70
Data input ..................................................................................................................70
Data management ....................................................................................................70
Data analysis .............................................................................................................70
Data output ................................................................................................................70

3.

Spatial data input

71

Introduction to digitizing ......................................................................................................71


3.1 Map coordinates versus digitizer coordinates ................................................................73
3.1.1 Creating a coordinate system ...............................................................................73
3.1.2 Digitizer setup ...........................................................................................................75
Using WinTab ............................................................................................................75
Using Digitizer Setup Wizard .................................................................................76
3.1.3 Map referencing .......................................................................................................76
Digitizing control points ..........................................................................................80
Summary: Map referencing ....................................................................................82
3.2 Digitizing a point map ...........................................................................................................83
Digitizing points ........................................................................................................85
Editing a point...........................................................................................................86
Moving a point ..........................................................................................................86
Deleting a point ........................................................................................................87
3.3 Digitizing a segment map ....................................................................................................88
Zooming in .................................................................................................................92
Digitizing segments .................................................................................................92
Change the position of a point .............................................................................98
Deleting a segment ..................................................................................................99
Displaying segments in different colors ...........................................................100
3.4 Digitizing contour lines .......................................................................................................101
3.5 Creating a polygon map .....................................................................................................104
Checking segments ...............................................................................................104
Creating a label point file .....................................................................................110
Creating the polygon map ...................................................................................111
Editing polygons ....................................................................................................112
Summary: Digitizing maps ...................................................................................113

3.6 Additional information on digitizing photographs ........................................................115


Monoplotting on the digitizer ..............................................................................115
Screen digitizing ....................................................................................................115
Orthophoto ..............................................................................................................115

4.

Spatial data management

117

4.1 Importing digital data ..........................................................................................................118


4.1.1 Importing raster data through ILWIS import ....................................................119
4.1.2 Importing raster data through GeoGateway ....................................................120
4.1.3 Importing through General Raster import ........................................................121
4.1.4 Importing vector data through ILWIS import ...................................................123
4.1.5 Importing vector data through GeoGateway ...................................................124
Summary: Importing data ....................................................................................125
4.2 Map projections ...................................................................................................................126
The UTM projection ...............................................................................................134
Checking coordinate transformation .................................................................136
Transforming vectors ............................................................................................138
Summary: Map projections .................................................................................139
4.3 Vector data management ...................................................................................................140
Creating a sub map ...............................................................................................140
Glueing segment maps .........................................................................................140
Masking vector data .............................................................................................142
Densify segment coordinates .............................................................................142
Tunnel segments ....................................................................................................143
Creating a polygon map from a segment map ...............................................144
Creating as segment map from a polygon map .............................................146
Summary: Vector data management .................................................................147
4.4 Vector to Raster conversion ..............................................................................................148
Creating georeferences ........................................................................................148
Rasterization of a polygon map .........................................................................148
Summary: Vector to Raster conversion ............................................................149
4.5 Raster data management ...................................................................................................150
Creating a sub map of a raster map .................................................................150
Glueing raster maps ..............................................................................................151
Mirror rotate ............................................................................................................152
Resampling ..............................................................................................................153
Editing raster maps ...............................................................................................154
Raster to Vector conversion ................................................................................156
Summary: Raster data management .................................................................158
4.6 Domain conversion ..............................................................................................................159
A warning about changing domains ..................................................................159
Conversion between an ID domain and a class domain ..............................159
Converting a class or an ID domain to a value domain ................................160
Converting a value domain to a class or an ID domain ................................161
Converting a picture domain to a class domain .............................................163
Converting a picture domain to an image domain .........................................163

Converting a color domain to a value domain ................................................164


Summary: Domain conversion ............................................................................165

5.

Attribute data handling

167

Introduction to the data set: city blocks .................................................................................168


5.1 Creating a table ....................................................................................................................170
Editing a column ....................................................................................................172
Summary: Creating, importing and editing tables .........................................173
5.2 Importing digital attribute data .........................................................................................174
5.3 Calculating with columns ...................................................................................................176
Pocket Line Calculator .........................................................................................177
Calculations with value columns ........................................................................177
Operators for value columns ...............................................................................178
Arithmetic operators .............................................................................................178
Relational operators ..............................................................................................179
Logical operators ...................................................................................................179
Conditional function ..............................................................................................180
Operators used for class or ID columns ..........................................................181
How to define domains for IFF functions with class or ID ...........................182
Summary: Table Calculation ................................................................................185
5.4 Classifying data in a column .............................................................................................187
Domain Group ........................................................................................................188
Summary: Classifying data in a column ...........................................................188
5.5 Statistical operations with columns ................................................................................189
5.5.1 Statistics in a table window ................................................................................189
Statistics Pane .......................................................................................................189
Column Statistics ...................................................................................................189
Statistics using the command line .....................................................................190
5.5.2 Statistical analysis .................................................................................................190
Least Squares Fit operation ................................................................................191
Prediction based on regression equation ........................................................192
Correlation between variables ............................................................................192
5.6 Aggregate functions ............................................................................................................193
A more complex problem .....................................................................................195
Summary: Aggregate functions ..........................................................................197
5.6 Table joining ..........................................................................................................................198
Joining via table domains ....................................................................................200
Joining a key column with a table .....................................................................202
Table joining combined with aggregation ........................................................203
Summary: Table joining ........................................................................................205
5.7 Displaying results as graphs .............................................................................................206
Summary: Graph display ......................................................................................207

6.

Image Processing

209

Introduction to remotely sensed data ......................................................................................209

6.1 Visualization of single band images ................................................................................210


Display a satellite image ......................................................................................211
Zoom in/out on a displayed satellite image ....................................................211
Scrolling through a displayed satellite image .................................................212
Displaying multiple images ..................................................................................212
Digital numbers and pixels ..................................................................................213
Pixels and real world coordinates ......................................................................215
Summary: Visualization of images .....................................................................216
6.2 Image enhancement ............................................................................................................217
6.2.1 Contrast enhancement .........................................................................................217
Calculation of a histogram ...................................................................................219
Linear stretching ....................................................................................................220
Compare original and stretched images ..........................................................220
Different linear stretch functions ........................................................................221
Histogram equalization .........................................................................................222
6.2.2 Spatial enhancement ............................................................................................222
Low pass filters ......................................................................................................224
Create and apply a user-defined low pass filter .............................................224
High pass filters .....................................................................................................226
Create and apply a user-defined Laplace filter...............................................226
Directional filters ....................................................................................................227
Summary: Image enhancement ..........................................................................229
6.3 Visualizing multi-band images ..........................................................................................230
6.3.1 Color composites ...................................................................................................230
Interactive false and pseudo natural color composites ................................231
Permanent Color Composites .............................................................................233
Summary: Visualizing multi-band images ........................................................233
6.4 Geometric corrections and image referencing ..............................................................235
6.4.1 Geo-referencing using corner coordinates ......................................................236
6.4.2 Geo-referencing a raster image using reference points ...............................238
6.4.3 Image-to-image registration ................................................................................242
6.4.4 Geo-coding a raster image by resampling ......................................................245
Adding projection information to a coordinate system (additional
exercise) ...................................................................................................................247
Summary: Geometric corrections and image referencing ............................247
6.5 Multi-band operations .......................................................................................................249
6.5.1 Image ratios: Brightness variations ...................................................................249
6.5.2 Normalized Difference Vegetation Index ..........................................................250
6.5.3 Multi-band statistics .............................................................................................252
6.5.4 Principal components analysis ...........................................................................254
6.5.5 Image arithmetics ..................................................................................................257
6.5.6 Image fusion ...........................................................................................................258
Summary: Multi-band operations .......................................................................260
6.6 Image classification .............................................................................................................262
6.6.1 Density slicing ........................................................................................................262
Interactive slicing ...................................................................................................263
Slicing operation ....................................................................................................264

6.6.2
6.6.3

6.6.4

6.6.5

7.

Piece-wise linear stretching ................................................................................265


Multi-spectral image classification ....................................................................266
Sampling ..................................................................................................................267
Displaying Feature Spaces ..................................................................................270
Classification ..........................................................................................................271
Classification methods .........................................................................................272
Evaluate the reclassified results .........................................................................273
Post classification operations .............................................................................273
Undef majority filter ...............................................................................................274
Unsupervised classification (clustering) ...........................................................275
Summary: Image classification ...........................................................................276

Spatial data analysis:


retrieval, (re)classification and measurement operations

277

7.1 Retrieval using the pixel information window ...............................................................279


7.2 Retrieval of information by displaying attributes ..........................................................282
Retrieval with a mask ............................................................................................284
Summary: retrieval operations ............................................................................286
7.3 Reclassification with Map Calculation formulas ...........................................................287
Using a Map Calculation formula for data retrieval .......................................287
Data retrieval with a Boolean statement ..........................................................288
Simple reclassification with a MapCalc formula .............................................289
Classifying value maps with Map Calc formulas ............................................290
Summary: Using MapCalc formulas for retrieval and (re)classification ....291
7.4 Reclassifying a map with attribute data .........................................................................293
Summary: Reclassifying a map with attributes ..............................................295
7.5 Classifying a value map (Slicing) .....................................................................................296
Temporary classification for display options ...................................................297
Permanent classification using the slicing operation ....................................298
Permanent classification using the CLFY function in MapCalc ..................300
Summary: Classifying a value map ...................................................................301
7.6 Measurement operations on point maps .......................................................................302
Measurement operations on point data ...........................................................302
Calculating the number of points .......................................................................302
Point density ...........................................................................................................303
Distance between points .....................................................................................304
Point in Polygon .....................................................................................................305
Summary: measurement operations on point maps ......................................306
7.7 Measurement operations on segment maps .................................................................307
Segment histogram of value maps ....................................................................308
Segment directions and Rose diagrams ..........................................................309
Calculating segment density ...............................................................................309
Summary: measurement operations on segment maps ...............................311
7.8 Measurement operations on polygon maps ..................................................................312
7.9 Measurement operations on raster maps ......................................................................313
Summary: Histogram calculation on polygon and raster maps ..................315

8.

Spatial data analysis: overlay operations

317

Introduction to Map Calculation ................................................................................................318


8.1 Map Calculation formulas resulting in value maps ......................................................321
Arithmetic operators .............................................................................................321
Relational operators ..............................................................................................322
Logical operators ...................................................................................................323
Conditional functions ............................................................................................324
Practicing with operators and functions in a small case study ..................325
Undefined values ...................................................................................................328
Summary: Map Calculation formulas resulting in value maps ....................331
8.2 Map Calculation and dependencies ................................................................................332
Summary: Map Calculation and dependency links........................................334
8.3 Map Calculation formulas resulting in class or ID maps ............................................335
IFF (expression, domain1,?) .............................................................................335
IFF (expression, domain1, name) ...................................................................336
IFF (expression, domain1, domain2) .................................................................337
IFF (expression, name, name) ......................................................................338
Summary: Map Calculation formulas resulting in Class or ID maps .........339
8.4 The Cross operation............................................................................................................340
Crossing two class maps .....................................................................................341
Crossing an ID and a value map: Drainage density ......................................343
Summary: Cross operation ..................................................................................345
8.5 Two-dimensional tables ......................................................................................................346
Summary: Two-dimensional tables ....................................................................349

9.

Spatial data analysis:


neighbourhood and connectivity operations

351

9.1 Filtering ..................................................................................................................................353


Majority filters .........................................................................................................353
Smoothing filters ....................................................................................................355
Rank order filters ...................................................................................................356
Binary filters ............................................................................................................356
User-defined linear filters: Example of a counting filter ...............................358
Summary: Filter operation using maps .............................................................360
9.2 Neighbourhood calculations using Map Calculation ...................................................361
9.2.1 Calculating with the value of a single neighbour ...........................................361
9.2.2 Using neighbourhood functions on multiple neighbours ..............................363
Neighbourhood functions on multiple neighbours .........................................363
Neighbourhood function NBFLT which uses a linear filter ...........................364
Calculating a classified slope direction map ...................................................365
Calculating a receiving cell map ........................................................................366
Determining flat areas and pits in a DEM ........................................................367
Iterations ..................................................................................................................368
Calculation of flooded area, given dam site and dam altitude ...................368
Summary: Neighbourhood functions .................................................................371

9.3 Distance calculation ............................................................................................................372


Simple distance calculation ................................................................................373
Calculating distance with weights: Travel time map .....................................374
Calculating distances: Thiessen map ...............................................................376
Summary: Distance calculation ..........................................................................378
9.4 Area numbering ....................................................................................................................379
Summary: Area numbering ..................................................................................380
9.5 Connectivity calculations ...................................................................................................381
Contiguity calculations .........................................................................................381
Summary: Connectivity calculations .................................................................385

10. Using Digital Elevation Models

387

10.1 Creating a Digital Elevation Model: contour interpolation .........................................390


Use of additional point heights ..........................................................................392
Summary: Contour interpolation ........................................................................394
10.2 Filters applied on Digital Elevation Models ...................................................................395
Creating a hillshading map ..................................................................................395
Using gradient filters .............................................................................................396
Calculating slope shape .......................................................................................397
Filters used to calculate internal relief ..............................................................399
Summary: filters used on Digital Elevation Models .......................................400
10.3 Creating a slope map .........................................................................................................401
10.4 Slope direction (aspect) .....................................................................................................403
10.5 Display 3D .............................................................................................................................405
3D view with raster draping ................................................................................410
Adding vector layers to a 3D view .....................................................................411
Summary: 3D-display ...........................................................................................412
10.6 Creating cross-sections from a DEM ..............................................................................414

11. Spatial data analysis: geostatistical tools

417

Visualization of the input data ...................................................................................................418


11.1 Pattern analysis ....................................................................................................................420
Summary: Pattern analysis ..................................................................................423
11.2 Spatial autocorrelation of point data ..............................................................................424
Summary: Spatial Correlation .............................................................................426
11.3 Point interpolation ...............................................................................................................428
Nearest Point ..........................................................................................................428
Moving Average .....................................................................................................430
Trend Surface .........................................................................................................431
Moving Surface ......................................................................................................432
Summary: Point interpolation .............................................................................433
11.4 Kriging estimation ................................................................................................................435
11.4.1 Ordinary Kriging .....................................................................................................435
Visualization of the input data ............................................................................435
Spatial Correlation and Empirical Semi-Variogram ........................................436

11.4.2

11.4.3
11.4.4

11.4.5

11.5 Spatial

Modelling the Semi-Variogram ...........................................................................438


Variogram Models: Goodness of Fit ..................................................................439
Kriging estimation and Error map ......................................................................441
Confidence interval maps ....................................................................................443
Simple Kriging and Indicator Kriging (additional exercise) ..........................443
Simple Kriging ........................................................................................................443
Indicator Kriging .....................................................................................................444
Universal Kriging ....................................................................................................444
Anisotropic Kriging ................................................................................................445
Investigating anisotropy with variogram surfaces ..........................................445
Variogram Surface .................................................................................................445
Change of support and/or change of scale .....................................................446
Spatial Correlation, bidirectional ........................................................................447
Semi-variogram models .......................................................................................448
Anisotropic Kriging ................................................................................................449
CoKriging .................................................................................................................450
Cross Variogram .....................................................................................................450
Summary: Kriging estimation ..............................................................................452
autocorrelation of raster maps ...........................................................................454
Summary: Autocorrelation ...................................................................................456

12. Scripts and functions

457

12.1 Creating a script ..................................................................................................................458


12.1.1 Working from the Command line .......................................................................458
12.1.2 Creating and running a script .............................................................................461
12.2 Creating a script with calculations and expressions ...................................................463
12.2.1 Example of a script for Map Calculation ..........................................................464
12.2.2 Example of a script for Table Calculation ........................................................465
12.3 Using parameters in a script .............................................................................................468
12.4 Running a script from another script ..............................................................................471
12.5 Special script language ......................................................................................................472
Summary: Scripts ..................................................................................................472
12.6 Functions ...............................................................................................................................474
System-defined functions ....................................................................................474
Random functions .................................................................................................474
MinMax functions ..................................................................................................475
User-defined functions .........................................................................................475
Summary: Functions .............................................................................................478

13. Presentation of results

479

13.1 Introduction ...........................................................................................................................480


Displaying data to be used in the final map ....................................................480
13.2 Colors .....................................................................................................................................482
Hints for appropriate use of colors ....................................................................485
13.3 Editing visual variables .......................................................................................................486

13.4

13.5

13.6
13.7
13.8

13.3.1 Maps with a representation .................................................................................486


Assigning colors to a class map ........................................................................487
Unit hatching...........................................................................................................491
Visual variables for segments: color, line type and line width ....................491
Visual variables for point maps ..........................................................................492
13.3.2 Maps without a representation ...........................................................................493
Point map with a value domain: temporary stretching .................................493
Point map with an ID domain: points as graphs ............................................494
User-defined coloring of maps with an ID domain ........................................495
Summary: Editing visual variables .....................................................................496
Map views .............................................................................................................................498
Combining data layers ..........................................................................................498
Adding an Annotation Text layer ........................................................................499
Adding grid lines ....................................................................................................500
Saving as map view ..............................................................................................500
Summary: Map views ............................................................................................501
Layout and Annotation .......................................................................................................502
Creating a Layout ..................................................................................................502
Inserting a map view .............................................................................................503
Creating a map border .........................................................................................504
Creating a legend ..................................................................................................505
Adding an inset map or picture ..........................................................................506
Adding text ..............................................................................................................507
Adding a north arrow ............................................................................................508
Adding a scale bar ................................................................................................509
Adding scale text ...................................................................................................509
Creating a box ........................................................................................................509
Editing map annotation ........................................................................................510
Summary: Layout and Annotation .....................................................................510
Printing a map ......................................................................................................................512
Summary: Printing maps ......................................................................................512
Exporting maps to cartographic software .....................................................................513
Summary: Exporting maps to cartographic software ....................................514
Creating demos with ILWIS ...............................................................................................515
Demo example: Display of field-photos ...........................................................515
Creating a slide show ...........................................................................................518
Summary: Creating demos in ILWIS ..................................................................520

Preface

Preface
General information
In late 1984, the International Institute for Aerospace Survey and Earth Sciences
(ITC) was awarded a grant from the Dutch Ministry of Foreign Affairs. The funds
should be spent on research benefiting land and water development in developing
countries. ITC decided to concentrate these funds in a single multidisciplinary
research project into the methodology of a Geographical Information System, to be
used as a tool for land use zoning and watershed management studies. By the end of
1988, the project resulted in the official release of version 1.0 of the Integrated Land
and Water Information System (ILWIS). Two years later, ILWIS was launched
commercially and ITC started up a distributors network to distribute ILWIS and to
support its users worldwide. Since then ILWIS has been used extensively as a tool for
training, research and advisory services all over the world.
ILWIS was designed to respond to user demands, to be low-cost and application
oriented, entirely meeting one of ITCs main objectives, i.e. transferring appropriate
technology to developing countries. By now, over 5000 ILWIS systems are in use in
more than 100 countries.
ILWIS 2.0, the first ILWIS for Windows version was presented in August 1996; after
that several upgrades have been released of which the last one was ILWIS 2.23
(September 1999).
ILWIS 3.0 as released in May 2001 has a completely modernized user-interface, both
for the software and the help. Behind the scenes much has changed as well. ILWIS

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.

What ILWIS has to offer


ILWIS is a user-friendly and widely distributed GIS and Image Processing package. It
is PC-based and designed for the Windows environments. Experts as well as
beginners will easily find their way through the program. ILWIS provides a powerful
tool for collection, storage, analysis, transformation and presentation of data. From
the input data, information can be generated to model the spatial and temporal
patterns and processes on the Earths surface. ILWIS provides a set of documentation,
dealing with the basics of GIS and Image Processing as well as its application in
many fields, i.e. land evaluation, urban surveys, natural hazards and environmental
management.

ILWIS 3.0 Users Guide

Preface
What ILWIS needs: hardware and software requirements
To install ILWIS 3.0, please run the installation program that is available on the CDROM or download the program from our web site at http://www.itc.nl/ilwis/. ILWIS
3.0 can be installed under Windows 95, 98, Me, NT4 and 2000.

To install under Windows NT/2000 administrator rights are required.

For best performance of ILWIS 3.0, we recommend a computer using a Pentium III
processor, 128 MB RAM or more, a 24 bit graphics Windows accelerator board with
a resolution of at least 1024768, a CD-ROM player, a mouse, a printer and a
digitizer.
The minimum requirements are: a Pentium with 64 MB RAM, 256 colors graphics
board with a resolution of 640x480, a CD-ROM drive and a mouse.
Furthermore, ILWIS requires that Internet Explorer version 5 or later is installed.
The ILWIS 3.0 Users Guide: Main objectives
The ILWIS 3.0 Users Guide is intended for those who want to know how ILWIS 3.0
is used in basic GIS and Image Processing operations. It trains the skills you need to
work with ILWIS, including explanations and procedures for first time users in
addition to topics for more advanced users. It provides numerous exercises to practice
GIS techniques and Image Processing operations and can be used both by persons that
want to learn how to work with ILWIS by themselves, or in a course environment.
Besides this guide, ILWIS HTML Help is available in the program itself. The Help
offers detailed descriptions of the functionality of ILWIS, its window types, the
objects, the operations, etc., and is illustrated with tips and examples.
Literature
The ILWIS 3.0 Users Guide is basically an exercise book. Therefore we have kept
the amount of theoretical explanations to a minimum. For a thorough introduction to
GIS and Image Processing, we recommend the following textbooks on GIS and on
Remote Sensing:
- Aronoff, S. (1995). Geographic Information Systems: A Management Perspective,
4th edition. WDL Publications, Ottawa, 294 pp.
- Barrett, E.C. and L.F. Curtis (1992). Introduction to Environmental Remote
Sensing, 3rd edition. Chapman & Hall, London, 426 pp.
- Bonham-Carter, G. F. (1996). Geographic Information Systems for Geosciences.
Modeling with GIS. Computer methods in the Geosciences. Pergamon Press,
Oxford, 398 pp.
- De By, R.A. (ed.) (2000). Principles of Geographic Information Systems: an
introductory textbook. ITC, Enschede, 230 pp.

ii

ILWIS 3.0 Users Guide

Preface
- Janssen, L.L.F. (ed.) (2000). Principles of Remote Sensing: an introductory
textbook. ITC, Enschede, 170 pp.
- Lillesand, T.M. and R.W. Kiefer (2000). Remote Sensing and Image Interpretation,
4th edition. John Wiley & Sons, New York, 724 pp.
- Sabins, F.F. Jr. (1996). Remote Sensing, Principles and Interpretation, 3rd edition.
W.H. Freeman and Co., New York, 494 pp.
Structure of the ILWIS 3.0 Users Guide
The ILWIS 3.0 Users Guide has been structured in a way that you can start with
any chapter. It is advisable, however, to follow the order of the book, since it reflects
the data flow of working with a GIS.
The ILWIS 3.0 Users Guide consists of 13 chapters:
- Chapter 1, Introduction to ILWIS, is intended to get you started with ILWIS, and
to show you the basics of the user interface.
- Chapter 2, Main concepts of ILWIS, presents key concepts of ILWIS.
- Chapter 3, Spatial data input, allows you to practice digitizing maps and
importing maps and images from other software packages.
- Chapter 4, Spatial data management, explains all ILWIS activities used to
arrange your spatial data in a way that it can be used for analysis.
- Chapter 5, Attribute data handling, deals with the use of tables, i.e. how to create
or import tables, and how to calculate with data in tables.
- Chapter 6, Image Processing, explains various operations that can be applied to
visualize, enhance, georectify and classify remote sensing images.
- Chapters 7, 8 and 9 all deal with Spatial data analysis. Various analysis
techniques, such as retrieval, (re)classification, measurement operations
(chapter 7), overlay operations (chapter 8) and neighbourhood and
connectivity operations (chapter 9) are demonstrated.
- Chapter 10, Using Digital Elevation Models, explains how to generate Digital
Elevation Models with ILWIS, and shows procedures to create derivatives, such as
slope steepness and slope direction maps.
- Chapter 11, Spatial data analysis: geostatistical tools, covers the use of
geostatistical tools for the analysis of point data.
- Chapter 12, Scripts and functions, is intended to show other functionalitys of
ILWIS for more advanced data analysis, including the use of the command line,
functions and script language.
- Finally, chapter 13, Presentation of results, is dedicated to the production of
output maps, the way to create annotations, how to treat colors, printing, exporting
data and creating demos.
The exercises in the ILWIS 3.0 Users Guide are designed not only to demonstrate
to you how certain ILWIS operations are used, but also give you a basic idea of when
they can be used in real applications. Therefore we used as much as possible
examples from a single region, surrounding the city of Cochabamba, in Bolivia. Only
when the Cochabamba data was not suitable for explaining certain operations, we
selected some other examples.
ILWIS 3.0 Users Guide

iii

Preface
The data set
All data files for the exercises in the ILWIS 3.0 Users Guide are included on the
ILWIS 3.0 CD-ROM and can also be downloaded from the ILWIS web site. On the
CD-ROM, the Users Guide data can be found in E:\Data\ILWIS 3.0 Users Guide
). For each chapter, there
Data (where E is the drive letter of the CD-ROM drive
is a subdirectory which stores the data that is required for the exercises of that
chapter, e.g. E:\Data\ILWIS 3.0 Users Guide Data\Chapter01.
During the installation of ILWIS, you can install the Users Guide Data directly on
your hard disk. The default installation directory for the Users Guide data is
C:\ILWIS 3.0 Data\Users Guide with subdirectories for every chapter. These
subdirectories of C:\ILWIS 3.0 Data\Users Guide will be the working directories
for the exercises of each chapter. For example, when you start with the exercises for
the first chapter, you should go to the directory C:\ILWIS 3.0 Data\Users Guide\
Chapter01. When you have finished the exercises for a certain chapter, and you
want to continue with the next one, you should change directory.

If you did not install the data files during the installation of ILWIS, you should do
so, before continuing. You can also use the Windows Explorer to copy the data
files from the CD-ROM to your hard disk. In case you use Windows Explorer,
you have to turn off the read-only attribute of the data files manually.
When you wish to repeat the exercises for a chapter, it is recommended that you
copy the original data files from the CD-ROM, or use the ILWIS Installation program, so that you always start with the original files, and not with files which
may have been altered.

The CD-ROM and the ILWIS web site furthermore include the ILWIS software, the
example data, and the text and data for the ILWIS 2.1 Applications Guide.

iv

ILWIS 3.0 Users Guide

Preface
Conventions used in the ILWIS 3.0 Users Guide
This manual is formatted in such a way that the specific actions dealing with the
software are separated from the accompanying text.

This is an exercise box. You can follow the instructions step by step.
Words in Times New Roman 10 Italics are keywords.
Formulas that should be entered are shown in Courier New 10 .
For example: MapC = MapA + MapB

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.

This is a tip box. It is used to give tips.

We assume that after a certain procedure is explained a few times, such as opening or
closing maps and other objects, you will be familiar with it, and therefore basic
things are not repeated too often.
Using the ILWIS 3.0 Users Guide in courses
The ILWIS 3.0 Users Guide is intended to be used both on an individual basis, for
learning how to work with ILWIS 3.0, as well as in GIS and Image Processing
courses.
Since the ILWIS 3.0 Users Guide covers most of the functionality of ILWIS 3.0, it
is too large to be treated in a single course. In the following scheme the
recommended exercises are shown for courses with different duration:
Introductory GIS courses
Intended for persons without prior knowledge of GIS and ILWIS.
- 1 day course: Chapter 1, 2.
- 5 days course: Chapter 1, 2, and parts of chapters 5 (5.1 to 5.3), chapter 7 (7.1 to
7.3), and chapter 8 (8.1, 8.2 and 8.4).
- 2 weeks course: Chapter 1, 2, 3, 4 (4.1, 4.3 to 4.5), 5, 7, 8, 13 (13.3 to 13.5).
- 1 month course: Chapter 1, 2, 3, 4 (4.1, 4.3 to 4.5), 5, 7, 8, 9 (9.1, 9.3), 10, and 13.

ILWIS 3.0 Users Guide

Preface
Advanced GIS courses
Intended for students already familiar with the basics of GIS and ILWIS.
- 1 week course: Chapter 4 (4.1 to 4.3, 4.6), 9.
- 2 weeks course: Chapter 4 (4.1 to 4.3, 4.6), 9, 10.
- 1 month course: Chapter 4 (4.1 to 4.3, 4.6), 9, 10, 11, 12, 13 (13.7).
For advanced courses with a longer duration, it is recommended to also practice with
some of the case studies of the ILWIS 2.1 Applications Guide that are available on
the internet, depending on the professional background and interest of the
participants.
Image Processing courses
Intended for students without prior knowledge of Image Processing and ILWIS.
- 1 week course: Chapter 1, 2, 6 (6.1 to 6.4).
- 2 weeks course: Chapter 1, 2, 6 (6.1 to 6.5).
- 1 month course: Chapter 1, 2, 6.
The schedule can also be followed when learning ILWIS on an individual basis.
However, in the schedule of the courses about one third of the time will be spend on
lectures. Users that are already familiar with GIS and Image Processing will need a
much shorter time.

The ILWIS 2.1 Applications Guide


The ILWIS 2.1 Applications Guide contains 25 case studies in various disciplines
such as geomorphology, geology, hydrology, environmental management, urban
survey, soil survey, land use planning and cartography. The case studies show
advanced procedures to work with ILWIS and also demonstrate how specific
questions in certain research disciplines can be solved with ILWIS. As the guide is
intended for experienced ILWIS users, the operations that have to be performed are
not written out in full detail.
The ILWIS 2.1 Applications Guide can, just like the ILWIS 3.0 Users 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).

vi

ILWIS 3.0 Users Guide

CHAPTER 1

Introduction to ILWIS 3.0


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.
Geographic Information Systems are nowadays indispensable in many different fields
of applications to assist in the decision making process. Most decisions are
influenced by some facts of geography. What is at a certain location? Where are the
most suitable sites? Where, when and which changes took place? Here are some
examples.
- In land use planning, GIS is used to evaluate the consequences of different
scenarios in the development of a region.
- 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.
In order to be able to make the right decisions, access to different sorts of
information is required. The data should be maintained and updated and should be
used in the analysis to obtain useful information. In this process ILWIS can be an
important tool.
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.

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0

1.1 Starting ILWIS


To start ILWIS, double-click the ILWIS icon on the desktop. After the opening screen
you see the ILWIS Main window (see Figure 1.1). From this window you can manage
your data and start all operations.

Figure 1.1:

The ILWIS Main window.

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\.

1.1.1 The Navigator


Before continuing with the exercises you first need to change to the subdirectory
C:\ILWIS 3.0 Data\Users Guide\Chapter01, where the data files for this chapter
are stored.
2

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0


You can use the Navigator (Figure 1.2) to change the current drive and working
directory.

Figure 1.2:

The ILWIS Navigator.

Click the word Navigator in the Operations/Navigator pane.

The Navigator lists all drives and directories (i.e. folders) in a tree structure. The
Navigator also has a History
to easily return to previously visited drives and
directories.

Click on the drives and folders in the Navigator until you are in the directory where the data for this chapter has been stored. By default the data is
located in C:\ILWIS 3.0 Data\Users Guide\Chapter01.

1.1.2 Catalog(s)
If you are in the correct directory C:\ILWIS 3.0 Data\Users Guide\Chapter01 you
will see, that the right hand side of the Main window, looks exactly the same as
Figure 1.3. This part of the Main window, in which maps, tables and other ILWIS
objects in the working directory are displayed each with its own type of icon, is
called the Catalog. When you double-click an object in the Catalog, it will be
displayed.
ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0

Figure 1.3:

Example of a Catalog of the ILWIS Main window.

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 .


4

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0

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.

Customizing the Catalog


To show only maps and tables in the Catalog:

Click the Customize Catalog button


in the Standard toolbar (Figures
1.1 and 1.8) of the Main window. The Customize Catalog sheet is opened.

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.

Position the mouse pointer on an object, for example on polygon map


Landuse . A description of this map will appear on the Status bar (Figure
1.7) of the Main window.

1.1.3 Title bar and Menu bar


The Title bar (Figure 1.4) shows the name of the currently active Catalog. You can
move a window to another position on the screen by dragging that windows Title bar
to another position.

Figure 1.4:

ILWIS 3.0 Users Guide

Title bar of the ILWIS Main window.

Introduction to ILWIS 3.0


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.

Figure 1.5:

The Menu bar of the Main window.

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.

1.1.4 The Operation-tree and Operation-list


Let us now concentrate on the another part of the ILWIS Main window. The
Operation-tree and the Operation-list (Figure 1.6) are located on the first two tabs in
the Operations/Navigator pane, by default along the left-hand side of the Main
window.
- 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.
In the Operation-tree as well as in the Operation-list each item is preceded by an
icon. The icon indicates the output data type of the operation. By double-clicking an
operation, the operation will be started. We will do this later.

Figure 1.6:

ILWIS Operation-tree (left) and ILWIS Operation-list (right).

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0

In the Operation-tree, double-click Image Processing, or click on the + in


front of the Image Processing icon
, to expand the Image Processing
tree.

Position the mouse pointer on one of the operations, for example on the
Filter operation.

1.1.5 Status bar


When the mouse pointer is positioned on an operation, the Status bar (Figure 1.7),
located at the bottom of the Main window, shows a short description of that
operation.
Figure 1.7:

The Status bar of the ILWIS Main window.

To get more information on an operation:

In the Operation-list, click with the right mouse button on an operation and
select Help from the context-sensitive menu. An Additional Help window
appears with a short explanation of the operation.

You can close the Additional Help window again by pressing the Close button
in the Title bar of the Help window or by double-clicking the control-menu icon
.

The Status bar also gives short information when you move the mouse pointer over
a menu command, over a button in the Toolbar or over an object in the Catalog.

In the Catalog, click with the right mouse button on polygon map Landuse
to get a context-sensitive menu.

A Context-sensitive menu is a menu, which gives only those menu commands that
are applicable to the moment you use the right mouse button; thus you will get a
different menu depending on where and when you use the right-mouse button. For
example, if you use the right mouse button on a polygon map, the context-sensitive
menu will only show the operations which can be applied on polygon maps. Contextsensitive menus are shortcuts for normal menu commands.

1.1.6 Toolbars of the Main window


You will go back to the Main window to see three more items. Below the menu, you
find two toolbars:
- The Standard toolbar
- The Object selection toolbar

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0


The Standard toolbar
The Standard toolbar (Figure 1.8) provides shortcuts for some regularly used menu
commands.

Figure 1.8:

Standard toolbar of the ILWIS Main window.

The Standard toolbar has the following buttons:


New Catalog

Properties

Open Map

Customize Catalog

Open Pixel Information

List

Copy

Details

Paste

cd..

Delete

When you leave the mouse pointer for a short period of time on top of a button a
ToolTip will appear with the name of the button/menu command that it will perform.
Also the Status bar gives some information on the working of the button. So far,
you have used the Customize Catalog button
.
Other buttons that you will probably use frequently are:
List. Show the objects in the current Catalog as a list of icons and object names.
Details. Show the details of the objects in the current Catalog in a table-like form.

This will be explained in more detail in chapter 2.


The Object selection toolbar
The Object selection toolbar (Figure 1.9) allows you to specify the object types that
you wish to see in the current Catalog.

Figure 1.9:

The Object selection toolbar.

Only the object types of which the button appears down will be shown. For a list of
all ILWIS object types and icons, see the summary of section 1.1. The first button,
the ILWIS button
, is used to hide all objects (after which you can click specific
object buttons, to show only these object types), or to show all object types. To add
8

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0


coordinate system Cochabamba to the Catalog:

Press the Coordinate Systems button


in the Object selection toolbar.
Coordinate system Cochabamba is now added to the Catalog.

To hide the coordinate system again:

Click the Coordinate Systems button again.

1.1.7 The Command line


The last item we will discuss now is the Command line (Figure 1.10).

Figure 1.10: The ILWIS Command line.

For beginners, the Command line is not so important yet. You can use the
Command line to type MapCalc formulas when you want to calculate with raster
maps (chapter 7) but also operations (like Filter, etc.) can be performed by typing an
expression on the Command line (see chapter 12).
The Command line has a History. You can use:
- the Arrow Up key of your keyboard to retrieve previously used expressions and
commands;
- the Arrow Down key to scroll forwards again, and
- the Arrow Down button
at the right hand side of the Command line to open a
list of previously used commands and expressions.

1.1.8 Getting help

Open the Help menu.

The ILWIS Help allows you to obtain information from any point within the
program. The Help menu differs per window. In the Main window the Help menu
has many options; we will explain a few of them now:
- Help on this Window. You obtain help on the current window. Depending on the
window from which you select this help option, you can get help on the Main
window, the map window, the table window, the pixel information window, etc.
- Related Topics. When this menu option is selected a dialog box appears with a
list of topics that are related to the current window.
- Contents. Displays the Help Contents. By clicking the links in the table of
contents you can go to any help topic you like.
ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0


- 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 Users Guide.

From the Help menu, select the command Help on this Window. The
ILWIS Help viewer (Figure 1.11) is opened and the help topic Main
Window, Contents is shown.

Click the hyperlink Introduction. The ILWIS Help viewer refreshes and displays the topic Main window: Introduction, in which all parts of the Main
window are explained.

Click any of the links. Another topic appears explaining you more.

Figure 1.11: The ILWIS HTML Help viewer.

The ILWIS HTML Help viewer (Figure 1.11) has three parts:
- a Topic pane that shows the topic the user has selected;
- a Navigation pane with 4 tabs: a Contents tab, an Index tab, a full-text Search
tab, and a Favorite tab;
- a Toolbar which allows users to Show or Hide the Navigation pane, to move
Forward to the next topic or Back to the previous topic, to go to the
10

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0


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.

Summary: the Main window of ILWIS


When you start ILWIS, the first thing you will see after the opening screen is the
ILWIS Main window. From this window you can manage your data, start all
operations and select all data. The Main window contains the following items:
- 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

ILWIS 3.0 Users Guide

11

Introduction to ILWIS 3.0


- 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 operation 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 history 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.

12

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0

1.2 Displaying geographic data


Geographic data are organized in a geographic database. This database can be
considered as a collection of spatially referenced data that acts as a model of reality.
There are two important components of geographic data (Figure 1.12): the
geographic position and the attributes, entities or properties. In other words, spatial
data (where is it?) and attribute data (what is it?) are distinguished. In the example of
Figure 1.12, you can see that we have a (very simplified) map on one side and a table
on the other.
Maps are considered spatial data, since the information they contain is directly
related to certain locations on the earths 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 dont know where the units are located. If we would only have
the map, we still dont 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?

Figure 1.12: Spatial and non-spatial data in ILWIS.

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.

ILWIS 3.0 Users Guide

13

Introduction to ILWIS 3.0


ILWIS dialog boxes

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).

Figure 1.13: Example of a Display Options - Polygon Map dialog box.

A dialog box allows the user to enter the information required by ILWIS to carry out
an operation. Dialog boxes differ depending on the application you are performing.
The dialog box, which is displayed now, is used to specify how you want to display a
polygon map. In general, an ILWIS dialog box can have features such as:
Title bar. Shows the name of the dialog box and can be used to move the dialog box
on the screen. In this case the title is: Display Options - Polygon Map.
Text box. A small box, which can be used for typing text or values. The dialog box
shown on your screen contains a Text box in which you can specify the Boundary
Width of the land use units lines.
Drop-down list box. A small box with an Arrow Down button

, which allows
you to select items. A list, including the available data, will be displayed when the
arrow button or list box is clicked. The button
on the right hand side is the create
button. The Create button can be used to create an object when the list excludes a

14

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0


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 Altkey while typing the underlined letter.

Select the check box Boundaries Only. Now you will see that the contents
of the whole dialog box changes. If you only want to show the boundary
lines of the units, no input is needed anymore on how you want to

ILWIS 3.0 Users 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 Tabkey or the Shift+Tab-keys on the keyboard.

A map window
The polygon map Landuse is displayed in a map window (see Figure 1.14). All
maps in ILWIS are displayed in a map window. The map window has many similar
features as the Main window of ILWIS, which we have seen before. It consists by
default of a:
Title bar: located at the top of the map window. The Title bar shows the name of the

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.

16

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0


Status bar: located at the bottom of the window. The Status bar displays
coordinates in meters and/or geographic coordinates.
Close button
Maximize button
Minimize button
Scale box

Title bar
Menu bar

Control menu icon


Toolbar

Layer Management pane Scroll bar

Status bar

Map viewer

Figure 1.14: An ILWIS 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.

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


right corner of the window.

ILWIS 3.0 Users Guide

in the upper

17

Introduction to ILWIS 3.0


When you want to study details of the map, the zooming possibility can be used.

Click the Zoom In button

To roam through the map on which you zoomed in, use the Pan button
or use the Left/Right/Up/Down scroll boxes in the horizontal or the vertical
scroll bar.

A fast scroll can also be achieved by dragging the scroll boxes in the scroll
bars Left/Right or Up/Down, or by clicking in the scroll bar itself.

Select the Zoom Out button


map to zoom out.

in the Toolbar and click (repeatedly) in the

Click the Entire Map button


again.

to show the entire map in the map window

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 button. Keep the mouse button down and drag the cursor a little bit to the second corner of the area of interest; then release the mouse button. Now the
selected area will appear enlarged. You can also click in the map window to
zoom in.

Another way to zoom in or out is by re-scaling the map.

Activate the Scale box which is by default located next to the Toolbar of
the map window and type another scale factor for the map (e.g. 1:200000 )
and press Enter .

Next, we will pay attention to another part of the map window: the Status bar,
which can be found at the bottom of the map window. If you move with the mouse
pointer over the map, you will see that the Status bar displays the position of the
mouse pointer in the map. To specify the position in an absolute way a coordinate
system is used. There are many different coordinate systems in use around the world.
Coordinates can be displayed in two ways:
- as metric coordinates (X,Y), or as
- geographic coordinates (latitude, longitude).
The Status bar displays the coordinates in meters and/or geographic coordinates.
First, the X, Y values of metric coordinates are given; these are followed by the
degrees, minutes and seconds of the latitude and longitude (i.e. geographic
coordinates).

18

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0

Click the Normal button

Move the mouse pointer through the map and verify in the Status bar that
the X values increase when going to the right of the map (towards the east),
and the Y coordinates increase when going to the top of the map (towards the
north).
Try to locate the mouse pointer on the following X and Y coordinates:
X=803384 , and Y=8074877 , and find the corresponding latitude and longitude.

With the Measure Distance button


angle between two points.

in the Toolbar to go back to the normal view.

it is easy to measure the distances and the

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.

The Distance message box will state:


From : the XY-coordinate of the point where you started measuring;
To : the XY-coordinate of the point where you ended measuring;
Distance on map : the distance in meters between starting point and end point
calculated in a plane;
Azimuth on map : the angle in degrees between starting point and end point related
to the grid north;
Ellipsoidal Distance : the distance between starting point and end point
calculated over the ellipsoid;
Ellipsoidal Azimuth : the angle in degrees between starting point and end point
related to the true North, i.e. direction related to the meridians (as visible in the
graticule) of your projection;
Scale Factor : direct indicator of scale distortion, i.e. the ratio between distance on
the map/true distance.

Click OK in the Distance box and click the Normal button in the Toolbar
to go back to the normal view.

ILWIS 3.0 Users Guide

19

Introduction to ILWIS 3.0


The contents of the map: domain
You can obtain information on the map contents simply by pressing the left mouse
button on any of the colored units in the map.

Domain

Press the left mouse button on different units in the map to find out what
they represent.

Find the land use class around the location: X=801830 and Y=8089283 .

As you can see, the units of the Landuse map are described by classes, with names
such as Forest , Grassland , Bare rock , Lake , etc. The list of all class names
that can occur in a map is called in ILWIS a domain. A domain defines the possible
contents of a map, a table, or a column. In other words, what do the items in a map,
table or column mean? Are they classes (such as land use classes), or values or
something else? The domain concept is very essential in ILWIS, and we will
therefore come back to it in chapter 2. The full list of class names of the land use
units can be seen in the Layer Management pane of the map window when the map
is displayed, but you can also open the domain of the polygon map Landuse
yourself.

Make the ILWIS Main window active. If the Main window is visible on the
screen, then you can just click any part of the Main window. If the Main window is not visible anymore, click the ILWIS button on the Windows
Taskbar at the bottom of your screen.

Make all the objects visible by clicking the ILWIS button


selection toolbar.

Double-click the domain Landuse in the Catalog of the Main window.

in the Object

The Domain Class editor is opened. The Title bar reads: Domain Class
Landuse - ILWIS. As you can see, the domain lists all possible class names of the
map. It is simply a list of all land use types, which can occur in the map. Since these
are different classes, we speak of a class domain. In chapter 2 you will also see some
other domain types.

Close the Domain Class editor by clicking the Control-menu icon


select Close.

and

We started this lesson by explaining the difference between spatial and non-spatial (or
attribute) data. From the map window, we can also obtain information on attributes,
related to the different land use units of the map, which is displayed.

20

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0

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.

In the Catalog, double-click the table Landuse .

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

ILWIS 3.0 Users Guide

21

Introduction to ILWIS 3.0

Close button
Title bar Maximize button
Minimize button
Column properties
Control menu icon
button
Record view button
Command line
Toolbar

Statistics pane

Status bar

Table viewer

Split bar

Scroll bar

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.

22

Double-click the Column header with the name Landvalue on it. The
Column Properties dialog box (Figure 1.16) appears.

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0

Figure 1.16: Example of a Column Properties dialog box.

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 Users 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 button
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.

Summary: displaying maps and tables


In this section you have learned:
- 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).
24

ILWIS 3.0 Users Guide

Introduction to ILWIS 3.0


- 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.

ILWIS 3.0 Users Guide

25

Introduction to ILWIS 3.0

1.3 The Cochabamba area


Before we will have a more detailed look at the main concepts of ILWIS in the next
chapter, it is maybe good to introduce you to the study area from which most of the
data for the ILWIS Users Guide are taken: the Cochabamba area.

In the Catalog, double-click raster map View3D1 . The Display Options


Raster Map dialog box is opened.

Click OK.

The picture which is displayed is a three dimensional view of the Cochabamba area.
This picture was made by the Display 3D operation which will be treated in chapter
10, using a Digital Elevation Model (DEM) and a False Color Composite (FCC)
derived from Landsat TM bands.

Zoom in on the right-hand side of the picture (Cochabamba city).

Cochabamba city is a fast growing center with a population of approximately


300,000. The city is located in the Andean region of Bolivia, at an elevation of about
2600 meters above sea level. It is located in a large valley, bordered on the northern
side by steep mountains, rising up to an elevation of 4500 meters. The northern part
of the city is located on the alluvial fans at the foot of the mountains. Due to the
high-intensity rainfall in the period November-January, the mountain area is subjected
to landslides and soil erosion, and the city itself occasionally suffers from flashfloods
on the alluvial fans. These processes affect the local farmers, and also hinder the
expansion of the city.
A more detailed 3D view of the city of Cochabamba itself, made from a scanned
aerial photograph, is also available.

26

Close the map View3D1 , and open raster map . Have a look at it, and close it
when you have finished.

ILWIS 3.0 Users Guide

CHAPTER 2

Main concepts of ILWIS 3.0


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.

Double-click the ILWIS icon on the desktop.


Use the Navigator to go to the directory: C:\ILWIS 3.0 Data\Users Guide\
Chapter02.

ILWIS 3.0 Users Guide

27

Main concepts of ILWIS 3.0

2.1 Structure of spatial data in ILWIS


In the previous chapter we have looked at how you can display maps and tables in
ILWIS. Now we will see more in depth how the data are structured. We will treat the
structure of spatial data.
Spatial features are represented in ILWIS in the following ways:
- Points. Many items can be represented as single points on a map. Points may refer
to rainfall stations, houses, field observations, sampling points, etc.
- Lines. Linear features such as roads, drainage lines or contour lines.
- Areas. Features which occupy a certain area, such as land use units (e.g. forest),
geological units, etc.
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

28

The location of a point is described by a single XY coordinate pair. Points are stored
ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0


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.
Through rasterization vector data (points, segments or polygons) can be converted to
the raster format. Apart from this source of raster maps, there are imported images,
either satellite images, scanned aerial photographs or imported raster maps from other
sources. Most ILWIS analyses are based on the raster data model. The results of most
of the operations are also raster maps.
ILWIS 3.0 Users Guide

29

Main concepts of ILWIS 3.0


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 annotation: 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.
A vector map needs a coordinate system, a domain and a representation. These
service objects are also needed for raster maps, together with another type of service
object: a georeference. In this chapter we will focus our view on data and service
objects. The container and special objects will be treated in other parts of the ILWIS
Users Guide.
Summary: Structure of spatial data in ILWIS
In this section you learned the following:
- ILWIS uses two types of maps: vector maps and raster maps.
- Vector maps in ILWIS are either point maps, segment maps or polygon maps.
- Vector maps can be obtained either by digitizing analog maps, or by importing
them from other sources.
- 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 georeferences are called service objects.
- Vector maps need a number of service objects: a domain, a representation and a
coordinate system.
- Raster maps also need these service objects: a domain, a representation and a coordinate 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.
30

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

2.2 Displaying maps and Layer Management


Displaying vector and raster maps
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.

Double-click polygon map


Landuse in the Catalog. The Display
Options Polygon Map dialog box is opened.

Accept the defaults in the Display Options - Polygon Map dialog box by
clicking OK. The polygon map is displayed.

Click the Title bar of the map window, keep the left mouse button down, and
move the map window to the side of the screen. Then release the left mouse
button. This is called dragging.

Double-click raster map

Landuse in the Catalog. The Display


Options - Raster Map dialog box is shown in which you can specify how

you want to see the raster map. Note that there are less options than in the
Display Options Polygon Map dialog box.

Accept the default values in the dialog box by clicking OK. The raster map is
displayed in another map window.

Drag and successively resize both windows so that they are next to each
other.

The first impression is that both maps are the same. They are similar with respect to
the information they contain. You can check this by clicking the same unit in both
maps. The units of both maps are also displayed in the same colors. The difference,
however, is in the way the information is stored in both maps; one in vector format
and the other in raster format. The best way to evaluate this is by zooming in on both
maps.

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.

ILWIS 3.0 Users Guide

31

Main concepts of ILWIS 3.0


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 window is not visible anymore, click the ILWIS button on the Windows
Taskbar at the bottom of your screen.

From the Catalog, drag the raster map Tmb1 to the raster map window (click
the map with the left mouse button and move it while keeping the left mouse
button pressed, and release the mouse button when you are in the map window). The Display Options - Raster Map dialog box is opened. As you
can see the Tmb1 map has a domain image.

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:

Image

32

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 individual pixels with the left mouse button.

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 .

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0


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
in the Toolbar of the map window. The Add Data Layer
Layer button
dialog box is opened.

ILWIS 3.0 Users Guide

33

Main concepts of ILWIS 3.0

In the Add Data Layer dialog box select polygon map Cityblock and
click OK. The Display Options - Polygon Map is opened.

Accept all defaults and click OK. Polygon map Cityblock is now added to
the map window. The polygon map Cityblock only covers the lower right
part of the map window.

Zoom in on the lower right part where the polygon map Cityblock is displayed and click the different city blocks to know there content.

You will see that each city block is identified by a number. These numbers, however,
do not represent measured, calculated, or interpolated values. Each city block has its
own code and information from each individual block can be obtained from a table
connected to the map. The polygon map Cityblock has an identifier domain (ID
domain).
Until now you saw two polygon maps (Landuse and Cityblock ) and two raster
maps (Landuse which was obtained by rasterizing the polygon map Landuse and a
satellite image Tmb1 ).
Now we will have a look at the other types of vector data: segment maps and point
maps.

Click the Entire Map button

Press the Add Layer button in the Toolbar of the map window. The Add
Data Layer dialog box appears.

In the Add Data Layer dialog box, select segment map Drainage from the
list box and click OK. The Display Options Segment Map is opened.

Select the Info check box and click OK. Segment map Drainage is now
added to the map window and is displayed on top of raster map Tmb1 and
polygon map Cityblock .

Click the drainage lines to learn the contents of the map Drainage .

As you can see, segment map Drainage contains three units: Drainage , Lake and
Main river . These are the names of three classes. The contents of the segment map
Drainage therefore, consists of classes. In ILWIS terms it is said that the segment
map Drainage has a class domain.
Let us now add another data layer to the map window: a segment map containing
digitized contour lines.

34

Open the Layers menu and select the Add Layer command.
In the Add Data Layer dialog box, select segment map Contour and click
OK. The Display Options - Segment Map dialog box is opened.

ILWIS 3.0 Users 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
Users Guide and not representing the real situation in Cochabamba).

In the Catalog of the Main window, select point map Rainfall and drag it
to the map window. The Display Options - Point Map dialog box appears.

Please note that point map Rainfall also uses an ID domain. The domain of a map
is always indicated at the top of a Display Options dialog box. In the dialog box
there is an option to show the names of the points as well.

Select the check box Text. Some extra text options appear.

Click OK in the Font dialog box.

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 the Font button. The Font dialog box is opened.


In the Font dialog box, select Font: Arial , Font Style: Regular and
Size: 8.
In the Display Options Point Map dialog box, select Text Color: Green
and click the Symbol button.

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 Users 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.

Summary: Displaying maps and Layer Management


In this exercise you learnt the following:
- ILWIS allows the display of many data layers in the same map window. A map window can display only one raster map, but a raster map may be displayed together
with many different point, segment and/or polygon maps.
- The way in which various data layers are displayed in a map window can be manipulated 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.

36

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

2.3 About domains


In the previous section you have already seen the four most important types of
domains:
- Class domains for data objects that contain classes (e.g. land use units, geomorphological units);
- ID domains for data objects that contain unique identifiers (e.g. city block 102 ,
rainfall station Laguna );
- Value domains for data objects that contain measured, calculated or interpolated
values (e.g. height, concentration);
- The Image domain for satellite images or scanned aerial photographs containing
values between 0 and 255.
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.
Lets us look now at some other advantages of domains.
More about class domains
Class

A class domain consists of a list of class names and optionally class codes. Elements
in a map (points, segments, polygons or pixels) which uses a certain class domain,
are coded by the class names and codes present in that class domain; elements

ILWIS 3.0 Users Guide

37

Main concepts of ILWIS 3.0

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.

Open the domain of polygon map Landuse by double-clicking the domain


Landuse in the Catalog. The Domain Class editor is opened.

The Domain Class editor allows you to add new items to the domain, and to change
or delete existing ones. One should be careful, however, with deleting domain items,
since this may cause problems in the maps and tables that use this domain. For
example, if you delete the Forest item, there will be polygons in the map Landuse
with an internal code that is not present anymore in the domain. The forest unit in the
map will then be represented as undefined (?) and will also loose its color. You
should always take care that a domain contains all the items that can occur in a map
or a table.
A domain may contain more items, however, than are present in the map. This is very
useful if you have different maps dealing with the same topic, for example multitemporal land use maps of a certain area, or various geological maps with the same
legend.
What is the advantage of the domain approach? Let us give an example:

Suppose you have two land use maps of different regions in the same country.
Suppose in one map you have land use types agriculture, grassland and shrubs,
and in the other map agriculture, forest and shrubs. In the DOS versions of
ILWIS, pixel values of your units might be Agriculture = 1, Grassland = 2
and Shrubs = 3 for the first map, and Agriculture = 1, Forest = 2 and
Shrubs = 3 in the second map. So, pixel value 2 is once forest and once grassland, which is very confusing!
However, if you use one domain containing all the possible land use classes, you
do not need to care about pixel values of separate maps since all the necessary
information for all your land use maps is stored in one domain. The domain then
contains the class names: Agriculture , Forest , Grassland , Shrubs .

Open the File menu in the Domain Class editor, and select the Properties
command or click the Properties button
in the Toolbar of the editor.
The Properties of Domain Class Landuse sheet appears, which
describes among others what this domain is used for.

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 .
38

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

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)

You can now write:


Result = IFF(Geomorphology=Ad, Possible landslide, Not
a possible landslide)

Codes can be entered, edited and deleted with the Add Item, Edit Item and Delete
in the Toolbar of the
Item commands on the Edit menu, with the buttons
Domain Class editor or by using the right mouse menu on a domain item.

Close the Domain Class editor.

More about identifier domains


An identifier domain can be used when each element in a map is identified by a
unique name, i.e. an identifier (ID); elements without an identifier are considered
undefined. Each item occurs in principle only once in the map. Attributes can be
linked to the unique names, that is to the identifiers. The attribute table contains
additional information on the uniquely identified elements and uses the same domain
as the map. An identifier domain can be used in point, segment, and polygon maps,
and in rasterized point, segment, and polygon maps. The identifier domain is advised
for detailed maps on large scales such as 1:500 for cadastral and infrastructural
purposes.

ID

Let us now look in more detail at some identifier domains.

In the Catalog, click domain Cityblock with the right mouse button and
select Open from the context-sensitive menu.

Domain Cityblock is an identifier (ID) domain. It is linked to the polygon map


with the city blocks, as well as to the table Cityblock . Domain Cityblock
contains the cadastral codes of the city blocks of the central part of Cochabamba city.
ILWIS 3.0 Users Guide

39

Main concepts of ILWIS 3.0


In this case the identifiers are unique numbers.

Close domain Cityblock , and open domain Rainfall .

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.

Close the Domain Identifier editor.

More about value domains


Value maps and value columns use a value domain. Elements in value maps (raster,
polygon, segment, or points) or fields in value columns represent measured,
calculated, or interpolated values. Values in a value domain are defined by a
minimum and maximum value (the value range) and a precision; values smaller than
the minimum or larger than the maximum are considered undefined.
In this section we will look at some value domains.

Value

Open the domain

Height .

Domain Height is used for segment map Contour which contains contour lines. A
value domain looks quite different from a class or ID domain. It is not a list of names
or codes, but it is a definition of certain values that should be used in a map or a
column. In this example, domain Height describes the Height in meters .
For the Cochabamba area, height values range from 2500 to 4600 meters. These are
the minimum (Min) and maximum (Max) values of the domain Height .
The Precision of a value domain determines the increment between two possible
successive values. The precision determines for instance the number of decimals that
are used to store the values. When you use a precision of 0.1 the values are stored
with 1 decimal. You can also store values with a certain step size, for example only
the values ending on 5, 10, 15, 20, 25, etc. In that case you use a precision of 5. You
can use any value for the precision, as long as it makes sense with respect to the
minimum and maximum value, and the meaning of the values. For instance, it would
be quite useless to use a precision of 0.001 for the domain Height , since the altitude
of the contour lines are in meters on the topographic map from which they were
digitized.
It is important to keep in mind, that if you use very small values for the precision (for
40

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0


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.

Close the Height domain.

There are also a number of system-defined value domains. These value domains are
defined by the system and are stored in the ILWIS\System directory. System-defined
value domains can be displayed in the Catalog but it is not possible to change them.

In the Main window open the View menu and select the Customize
in the
Catalog command or click the Customize Catalog button
Standard toolbar. The Customize Catalog sheet appears.

On the Selection tab, select object type Domain in the list box and click
Apply. Now you will see only the user-defined domains in the Catalog.
These domains have been made especially for the data set.

On the Selection tab, select the check box Include System Objects and
click OK. Now also the system-defined domains are listed in the Catalog.

The most important system-defined value domain is the one called Value. In fact you
can make all other value domains with this domain. The others are given to prevent
you from needing to define domains too often. Let us look at some examples.

Open the system domain Value . As you can see, the minimum value that
can be stored is -9999999.9 and the maximum is the positive equivalent of
that. So it is safe to conclude that you can store all possible values which
may occur in maps and tables in the value domain.

Close domain Value and open domain Perc . This is a special value domain
which is intended for storing percentage values with a default value range
between 0 and 100, and a precision of 0.01 (two decimals).

Close domain Perc and open the Bool domain. This is the Boolean domain,
which only allows two situations: False (0) or True (1). Like most other

ILWIS 3.0 Users 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.
Summary: About domains
- A domain stores the set of possible data values that are used by a map, table
and/or column. All ILWIS data objects (vector maps, raster maps and tables) always
have a domain.
- The same domain can be used by a vector map, a raster map and a table.
- The four most important types of domains are: class domains, identifier domains,
value domains and the image domain.
- Class domains are used for data objects that contain classes. A class domain may
for instance store the names of land use units or geomorphological units.
- ID domains are used for data objects that contain unique identifiers. An ID domain
may for instance store the unique IDs of city blocks, or the unique IDs of rainfall
stations.
- Value domains are used for data objects that contain measured, calculated or interpolated values. A value domain may for instance store the values (range and precision) needed to define heights or to define concentrations.
- The system Image domain is used for satellite images or scanned aerial photographs containing values between 0 and 255. This domain is a special type of
value domain, as the image domain cannot contain undefined values.
- Class and ID domains are always user-defined. Value domains can be user-defined,
or system-defined.

42

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

2.4 About representations


A representation contains the information that determines how your spatial data
should be represented on screen or in a printout. Representations are service objects
linked to a domain. The domain determines what is in a map (or a table or a column),
and the representation defines the colors of the domain items. There are different
types of representations depending on the type of domain.
More about representation class
Class

Class domains have the most straightforward representation. A map with a class
domain should have a representation, otherwise it is impossible for ILWIS to know
how to display it. A representation for a class domain is always user-defined. The user
should set the color for each class in the class domain.

Double-click polygon map Landuse in the Catalog. The Display Options


Polygon Map dialog box is opened.

Accept the defaults in the Display Options - Polygon Map dialog box by
clicking OK. The polygon map is displayed.

The Layer Management pane shows the Legend of the Landuse map,
which is in fact, representation Landuse . Double-click the word Legend in
the Layer Management pane. The Representation Class editor is opened
in the polygon mode (e.g. the Polygon tab is active).

Each item in the domain has a color assigned to it. The colors can be edited by
clicking on an item, and then changing the Red/Green/Blue amount by dragging the
slide bars in the Color Slider, by selecting a color in the Color Selector or by
double-clicking an item in the editor.

Practice with changing colors as explained above. Change also some colors
by using the Edit Item(s) button
or by opening the Edit menu and selecting Edit Item(s).

Select the Segment tab and look at the representation. After that, select the
Point tab. Since we can use the same domain, and the same representation
for raster, polygon, segment and point maps, these options can used to see
what a line would look like, or a point, or an area.

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.

ILWIS 3.0 Users Guide

43

Main concepts of ILWIS 3.0

In the Catalog, double-click polygon map Cityblock . In the Display


Options - Polygon Map dialog box, you see several options: Single Color,
or Multiple Color 7, 15 or 31.

Select the option Multiple Colors , 31 and click OK.

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.

Close polygon map Cityblock .

More about representation value


Maps with a value domain have a representation value. You can make two types of
representations for value maps:
- a representation value, in which boundaries and intermediate limits appear in values;
- a representation gradual, in which boundaries and intermediate limits appear in
percentages. If you use it on a value map, the percentages of the frequency distribution of pixel values are taken from the histogram.

Value

In the Catalog, click domain Height with the right mouse button, and
select the Properties command from the context-sensitive menu. The
Properties sheet is opened. As you can see, domain Height has a representation value called Height .

Close the Properties sheet and open representation Height by double-clicking the object in the Catalog. The Representation Value editor is opened.

A representation for a value domain is defined on the basis of a number of limiting


values between which the color changes from one color to another in a number of
user-defined steps. In this example the limits are 2500 (the minimum of the domain),
3500, and 4600 (the maximum value of the domain). You can insert as many
intermediate limits as you wish.

44

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

Select the Limit 3500 , open the Edit menu and select the Edit Limit command or click the Edit Limit button
in the Toolbar of the
Representation Value editor.

In the Edit Limit dialog box, change the color to LawnGreen and click OK.
Open the Edit menu and select Stretch Steps. The Stretch Steps dialog
box is shown. Change the Stretch Steps value to 30 and click OK.

Select the word Stretch in the editor. A drop-down list box appears.

From the Edit menu choose Insert Limit. The Insert Limit dialog box
appears.

Click once more to open the list box and select the word Upper. This means
that all values between the limits are displayed in the color of the upper limit.

Insert a new limit (Value 4000 , Color Gold ) and click OK in the Insert
Limit dialog box.

When finished close representation Height .

There are also a number of system-defined representations available. These


representations all use percentages as limits (representations of type gradual), so that
they can be used on different types of value ranges.

Click the Customize Catalog button in the Standard toolbar of the Main
window. The Customize Catalog sheet appears.

On the Selection tab, select object type Representation in the list box,
select the check box Include System Objects and click OK. Now you will
see only the representations, including the system-defined ones.

Open some of these representations to see how the colors are assigned to different percentage values.

Click again on the Customize Catalog button. Select all the objects from
the list, clear the check box Include System Objects and click OK.

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 representation.

Double-click the word Legend in the Layer Management pane. The


Representation Gradual editor is opened. It is not possible to edit this representation because it is a system-defined one and system-defined representations cannot be edited.

Close the Representation Gradual editor.


After finishing, close the map Contour .

ILWIS 3.0 Users Guide

45

Main concepts of ILWIS 3.0


Summary: About representations
- A representation contains information that determines how your spatial data should
be represented on screen or in a printout. Representations are service objects linked
to a domain. The domain determines what is in a map (or a table or a column), and
the representation defines which colors these domain items should have.
- There are different types of representations, depending on the type of domain.
- Class domains always have a user-defined representation Class.
- ID domains cannot have a user-defined representation. They can only be displayed
in 1, 7, 15 or 31 different colors or by one of their attributes (see section 7.2).
- Value domains can have two types of representations:
- representation Value, using actual values as limits;
- representation Gradual, using percentage values as limits.
See also chapter 13 if you want to know more about representations.

46

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

2.5 About coordinate systems


In section 1.3, you already learnt that the Status bar in a map window displays the
coordinates of a map.

Open polygon map Landuse by double-clicking it in the Catalog. The


Display Options Polygon Map dialog box appears.

Accept all defaults in this dialog box and click OK. Polygon map Landuse
is displayed.

Maximize the map window.

Close polygon map Landuse .

Move the mouse pointer through the map and verify the display of coordinates in X and Y values, as well as in degrees, minutes and seconds in the
Status bar.

The information on the X and Y coordinates of a vector map is stored in a service


object called the coordinate system. A coordinate system is a service object for point,
segment and polygon maps, and for georeferences (the latter are used for raster maps
and will be treated in the next section). A coordinate system contains information on
the kind of coordinates you are using in your maps. You may for instance use userdefined coordinates, coordinates defined by a national standard or coordinates of a
certain UTM zone.

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.

Open coordinate system Cochabamba by double-clicking it in the Catalog.


A dialog box is opened titled Coordinate System Projection
Cochabamba.

A coordinate system defines the possible minimum and maximum Xs and Ys that
can be used in a map, and in case of a coordinate system of type projection, you can
also store information on a maps projection, ellipsoid and/or datum. Normally
locations on the earths surface are shown in geographic coordinates.

ILWIS 3.0 Users Guide

47

Main concepts of ILWIS 3.0


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 earths surface can even be better
approached if a projection uses a datum. With the help of a map projection,
geographic coordinates are converted into a metric coordinate system, measuring the
X and Y directions in meters. Practically every country in the world uses its own
coordinate system, based on a certain projection. One of the most used projections is
the so-called Universal Transverse Mercator (UTM).
The UTM is an international metric coordinate system, which covers the whole earth
and divides it into 60 zones each covering 6 Longitude. Because of the small area
covered by each zone, a high degree of accuracy is possible.
In ILWIS you can digitize a map either in metric or in geographic coordinates. The
conversion from geographic to metric coordinate is done via a map projection. For
example, point data obtained from GPS (Global Positioning Systems) may have been
registered in geographic coordinates.
ILWIS has three standard coordinate systems:
- Latlon : Geographical coordinates in degrees.
- LatlonWGS84 : Geographical coordinate system using the WGS84 datum.
- Unknown : When coordinates are not known. This coordinate system should not be
used.
For more information on types of coordinate systems and transformations, see section
4.2. In general its best to create a coordinate of type projection and specify the
minimum and maximum X and Y coordinates of your study area. Projection
information may be added to the coordinate system in a later stage or not at all.

48

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0


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.

The use of projections is further discussed in chapter 4.


Summary: About coordinate systems
- A coordinate system is a service object for point, segment and polygon maps, and
for georeferences (the latter are used by raster maps and will be treated in the next
section). Vector maps and georeferences always need a coordinate system.
- A coordinate system defines the possible XY-coordinates or LatLon-coordinates
that can be used in your maps and thus stores information on the kind of coordinates you are using in your maps. You may for instance use user-defined coordinates, coordinates defined by a national standard or coordinates of a certain UTM
zone.
- A coordinate system may have information on the maps projection, ellipsoid and
datum.

ILWIS 3.0 Users Guide

49

Main concepts of ILWIS 3.0

2.6 More about georeferences


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). A georeference is
needed for raster maps and uses a coordinate system. If you work with several raster
maps of the same area, and you want to overlay them (e.g. with the Cross operation),
it is important that all maps have the same number of rows and columns, and the
same pixel size. The pixels in both maps thus refer to the same position on the
ground. Therefore all raster maps of the same area should have the same
georeference. Let us look at a georeference.

Open georeference Cochabamba .

Georeference Cochabamba is a georeference corners. By defining the X and Y


values of the corner of the raster map, ILWIS is able to find the correct coordinates
for each pixel. A georeference corners assumes that the raster map is oriented to the
north. The X-coordinate increases from the left column to the right column, and the
Y-coordinate increases from the lowest line to the upper line. The X and Y values
relate to the coordinate system that we have seen in the previous exercise.
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 correct; subtract the minimum X value from the maximum X value. Then divide
the resulting value by the number of columns.

For such calculations you can also use the Command line of the Main window.

Position the mouse pointer on the Command line and type an expression
such as:
?(maxX-minX)/nr. columns

Close georeference Cochabamba after you have seen the result of the
expression in the Calculation Result box.

For satellite images, scanned aerial photographs and other imported images, which
may not be north-oriented, we have another type of georeference: a georeference
tiepoints.

50

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

In the Catalog double-click georeference Tmgeo . The Display Options Raster Map dialog box of Tmb1 appears. Accept the defaults and click OK.
The GeoReference Editor: Tmgeo is opened.

In the satellite image you will see seven points displayed, which are related to the
seven points in the Tie Point Table of the GeoReference Tiepoints editor. For each
point the X- and Y-coordinates are given, along with the Row and Column locations
of these points in the image. On the basis of these coordinates using an Affine
transformation, all rows and columns will be assigned X- and Y-coordinates, with a
certain error, expressed as Sigma. In Chapter 6 we will treat the GeoReference
Tiepoints editor in much more detail.
What is important to note here is that the image is not oriented perfectly to the north.
The image is distorted with respect to a topographic map. When you want to overlay
images in combination with north oriented maps, you need to remove the distortion
of the image by resampling it (see chapter 6).

Close the GeoReference Tiepoints editor by opening the File menu and
selecting the Exit Editor command or by clicking the Exit Editor button
Do not close the map Tmb1 .

Click the Add Layer button. The Add Data Layer dialog box appears.

Open the Layers menu and select Add Grid Lines. The Display Options
Grid dialog box is opened.

In the Display Options Grid dialog box change the Color to Yellow ,
accept all other defaults and click OK. The grid layer is now displayed on top
of the two map layers.

In the Add Data Layer dialog box, select segment map Contour and click
OK, and again OK in the Display Options - Segment Map dialog box. The
Contour map is now displayed on top of the image.

The grid lines are displayed in a rotated way. From this you can conclude that the
image is distorted and not oriented to the north.

Drag and drop raster map Landuse in the map window. Raster map Tmb1
will be replaced by raster map Landuse . You will see that the display of grid
lines and the contour lines now changes. They are now displayed in a northoriented way.

Close the map window.

ILWIS 3.0 Users Guide

51

Main concepts of ILWIS 3.0


Summary: About georeferences
- A georeference is needed for raster maps and uses a coordinate system.
- 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).
- Two types of georeferences for raster maps were discussed here:
- Georeference corners, used for raster maps made from rasterizing vector
maps, and the resulting maps from operations on these maps. A georeference
corners is used for raster maps that are oriented to the north.
- Georeference tiepoints, used for satellite images, scanned aerial photographs and other imported images, which may not be north-oriented.
- In the chapters 6 and 10 you will see that there are several other types of georeferences.

52

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

2.7 Attribute data


In sections 2.1 and 2.2 we have looked at the way maps are stored and displayed in
ILWIS, either as point, segment, polygon or raster maps. In the sections 2.4 up to and
including 2.6 we have also looked at the service objects that contain information
about these maps, such as a domain, a representation, a coordinate system and a
georeference.
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
ILWIS 3.0 Users Guide

53

Main concepts of ILWIS 3.0


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 information 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 values, representing a certain phenomenon (in this case terrain elevation). It is difficult 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.
Summary: Attribute data
- Maps and tables can be linked only if they have the same domain.
- Only maps with a class or ID domain can be linked to attribute tables. Value maps
cannot be linked to tables.

54

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

2.8 Pixel Information window


ILWIS has a special tool with which you can examine multiple maps and linked
tables simultaneously: the pixel information window. A pixel information window is
used to interactively inspect coordinates, class names, IDs or pixel values, in one or
more maps and attribute values of map-related tables. A pixel information window
shows information at the position of the mouse pointer in a map window.

Open polygon map Landuse .

Position both windows next to each other and move the mouse pointer over
the map.

In the map window, open the File menu and select Open Pixel Information.
The pixel information window (Figure 2.3) is opened.

A pixel information window consists of many items that you have seen before in map
and table windows, such as a Control-menu icon , Title bar, Menu bar, Status
bar, etc. Some special items in this window are:
Top left button: the upper left gray button in the pixel information window can be
used to open the Customize Pixel Info dialog box.
Information viewer: where the information of the selected data objects for the actual
position of the mouse pointer in a map window is displayed.
Menu bar: the menus of the ILWIS pixel information window are: File, Edit,
Options and Help.

Figure 2.3:

ILWIS 3.0 Users Guide

An ILWIS Pixel Information window.

55

Main concepts of ILWIS 3.0

To get more information on a pixel information window, press the F1-key or


open the Help menu and select Help on this Window.

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.

Move the mouse pointer over the map to display the information continuously.

In the pixel information window, you can read the information of the mapping unit in map Geomorphology , and of the mapping unit in map
Landuse at the same location.

It is possible to hide or to show maps and attributes in a pixel information window:

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.

Deselect all columns of table Geomorphology and click OK.


When you now move with the mouse pointer over the map you will see that
no information is given on the table Geomorphology .
Close the pixel information window by double-clicking the Control menu
icon.

56

Close the map window.

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0


Summary: Pixel Information window
- A pixel information window is used to interactively inspect coordinates, class
names, IDs or pixel values in one or more maps and attribute values of map-related
tables.
- A pixel information window shows information at the position of the mouse pointer
in a map window.

ILWIS 3.0 Users Guide

57

Main concepts of ILWIS 3.0

2.9 Details view of a Catalog


You can choose to see the objects in a Catalog listed in List View or in Details
View. The List View option gives a simple list of object names and icons. The
Details View shows detailed information for each object.

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 and drop a column header horizontally to another position.

To change the width of a column in the Catalog:

Drag the vertical line which separates two column headers to the left or right.

The Catalog is by default ordered ascendingly by Name but you can order the objects
descendingly or use another sorting method (e.g. by Type, Size, Attribute, etc.).

Click column header Name. The objects will now be sorted descendingly.
Click the column header Name once more. The objects are sorted ascendingly again.

Click the right mouse button in the white space of the Catalog, choose the
Sort By command from the context-sensitive menu, and select sorting
method Type. The Catalog is now ordered by object type (i.e. coordinate
system, domain, georeference, etc.).

Open the View menu in the Main window, select Sort By and the sorting
method Object Size.

Sorting ascendingly and descendingly can be used on any column. You can also sort
objects when in List View. To return to the original situation:

Open the View menu in the Main window, select Sort By and sorting
method Name or click the column header Name in the Catalog.

By using a Catalog query, ILWIS will scan the contents of all object definition files
in the current Catalog and show only those objects that are the result of the query.
58

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0


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, segment 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.

Summary: Details view of a Catalog


- In ILWIS you can see objects in a Catalog in List View or in Details View.
- The Details View is a table with columns that give you extra information on individual 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.

ILWIS 3.0 Users Guide

59

Main concepts of ILWIS 3.0

2.10 Object properties and dependency links


As shown in preceding sections, different data objects (point, segment, polygon
and raster maps) and service objects (domains, representations, coordinate
systems and georeferences) are required to form a map in ILWIS. How does
ILWIS know which objects are linked?
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.
In Figures 2.4 and 2.5, a schematic representation is shown of the properties of
vector and raster maps. The properties of vector maps with a class domain,
identifier and value domain are shown in Figure 2.4.
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 .

Close the Properties sheet.

To understand the Figures 2.4 and 2.5 it is good to look at the properties of
several maps.

60

In the Catalog click with the right mouse button on domain Cityblock
and select Properties from the context-sensitive menu. The Properties
sheet appears.

Click the Used By tab. Cityblock is an ID domain, used by polygon map


Cityblock , and table Cityblock .

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

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.

ILWIS 3.0 Users Guide

61

Main concepts of ILWIS 3.0

Figure 2.5:

The properties of raster maps with a Class, Identifier, and Value domain in ILWIS. The data objects are
shown in a shaded box.

Compare the result with Figure 2.4 and close the Properties sheet afterwards.

Repeat this for value domain Height . This domain is used by segment map
Contour and by representation Height . Compare with Figure 2.4.

The properties of tables and columns are schematically represented in Figure 2.6. A
table should have a class or ID domain. A table contains a number of columns. Each
column also has a domain (e.g. class, ID, value or other special domains such as
color, string, Bool, etc.).

62

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

Figure 2.6:

The properties of tables and columns.

Open table Landuse .

To view the properties of a column, double-click the column header


Landvalue in the table window or select the column and press the
Properties button in the Toolbar. The Column Properties dialog box
appears.

In the Column Properties sheet you see that column Landvalue uses the
system Value domain. Click Cancel to close the Column Properties
sheet.

Close table Landuse .

Close table Cityblock after finishing the exercise.

To view the properties of the table, open the File menu and select
Properties. The Properties sheet of table Landuse is opened. You see that
the table has class domain Landuse .

Repeat the procedure described above for table Cityblock (with an ID


domain): inspect the domain of the table and the domain of some columns.

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.

ILWIS 3.0 Users Guide

63

Main concepts of ILWIS 3.0


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 polygon map and a georeference, using the Polygon to Raster operation.

The dependent raster map, which is the result of the Polygon to Raster operation
(i.e. the Rasterize Polygon Map operation), contains information on the source
objects from which it was created. In this case a polygon map and a georeference. Let
us check this example in the data set.

64

Click in the Catalog with the right mouse button on raster map Landuse
and select Properties from the context-sensitive menu. The Properties
sheet with the title Properties of Dependent Raster Map Landuse is
opened (see Figure 2.8).

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

Figure 2.8:

Example of a Properties sheet.

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.

ILWIS 3.0 Users Guide

65

Main concepts of ILWIS 3.0

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.

Close the Properties sheet of raster map Landuse .


Activate the Main window and check the columns D, C, U and Modified in
the Catalog (Details View). You will see that all the maps are modified on
the same date and time and that raster map Landuse is Dependent (D),
Calculated (C) and Up-to-Date (U).

Now we are going to update the source map Landuse .

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).

Open the Properties sheet of raster map Landuse . On the Dependency


tab you see: Object is not up-to-date:
Landuse.mpa (day date time) .

It is important to keep in mind that dependent maps are not automatically updated.
ILWIS does keep track of the dates and times at which the source objects were
modified. Only when you click the button Make Up-to-Date on the Dependency
tab of the Properties sheet, ILWIS will ask you if you want to recalculate the map.

66

Click the Make Up-to-Date button. A Check Up-to-date message appears


with the question Dependent raster map Landuse is not up-todate . Recalculate it to make it up-to-date?

Answer Yes to this question to recalculate the map.


Open the Properties sheet of raster map Landuse . On the Dependency
tab you see that the Object is up-to-date again.

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0

In the Preferences of the Main window, you can select the check box Give a
Warning when an object is not up-to-date. If you select this check box ILWIS
gives you a warning when you want to open an object that is not up-to-date anymore.

There are some other important advantages of the use of dependencies:


- 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 recalculate 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.

Open the Properties sheet of raster map Landuse .

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 .

Click the Calculate button.

A so-called tranquilizer is displayed, showing the progress of the calculation of the


map. When it stops, the raster map Landuse is again Dependent (D), Calculated
ILWIS 3.0 Users Guide

67

Main concepts of ILWIS 3.0


(C) and Up-to-Date (U) and the data file of the raster map is available.

Open the Properties sheet of raster map Landuse .

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.

On the Dependency tab, click the button Break Dependency Link. A


Break Dependency Link message appears.

Confirm the question with Yes. The Properties sheet is closed.


Open the Properties sheet again and note the difference.

The Properties sheet will not contain information on the dependency links anymore
(i.e. the Dependency tab is not available anymore in the Properties sheet).
In chapter 7, the link between maps and tables is explored further and in chapter 8
you will practice some more with dependencies.
Summary: Object properties and dependency links
- The relation between a data object and service objects, or between service objects
among themselves, is specified by the properties of the object.
- The properties are different for vector maps, raster maps or tables. The properties
depend largely on the type of domain which is used.
- The link between output data objects, obtained from other input data objects
through an ILWIS operation is defined by dependency links.
- Maps, tables and columns are originally when they are digitized, imported or created by typing. These objects are called source objects
- Output maps, tables and columns which are created through a calculation or an
operation are called dependent objects.
- The concept of dependency has a number of important advantages:
Easy update: when you have new information and you edited input maps, tables
or columns accordingly, the dependent output maps, tables or columns can be

68

ILWIS 3.0 Users Guide

Main concepts of ILWIS 3.0


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 operation 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 perform 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 generated.
- 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 objects 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 objects Properties sheet.
- It is also possible to convert an object from being a dependent object to a source
object. You can break a dependency link by using the Break Dependency Link
button in the objects Properties sheet.

ILWIS 3.0 Users Guide

69

Main concepts of ILWIS 3.0

2.11 How to use geographic data in ILWIS


After you have looked quite extensively at the way geographical data is stored in a
Geographic Information System like ILWIS, it is important to ask yourself now what
you will do with it. In general, there are four different phases that you have to go
through when you work with geographic data:
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.

70

ILWIS 3.0 Users Guide

CHAPTER 3

Spatial data input


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.

Double-click the ILWIS icon on the desktop.


Use the Navigator to go to the directory C:\ILWIS 3.0 Data\Users Guide\
Chapter03.

Introduction to digitizing
The most common method of entering spatial data in ILWIS is digitizing. Features on
a paper map or other analog documents (e.g. a photo-interpretation on a piece of
tracing film) can be digitized. This can be done using a device called a digitizing
tablet, or digitizing table, or simply digitizer. A digitizer contains a pointing device
(digitizer cursor) to trace spatial features. The position of the digitizer cursor is
registered electronically to a precision of fractions of a millimeter. This is done
through a fine grid of wires embedded in the digitizer (Figure 3.1).
The vertical wires record the X-coordinates; the horizontal ones the Y-coordinates.
The range of digitizer coordinates depends, amongst other things, on the density of
the network of wires: digitizer resolution. The cursor contains a small transparent
window with a cross-hair, and a number of buttons (at least four buttons are needed
ILWIS 3.0 Users Guide

71

Spatial data input


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.

Figure 3.1:

72

Operation of a digitizer (simplified).

ILWIS 3.0 Users Guide

Spatial data input

3.1 Map coordinates versus digitizer coordinates


3.1.1 Creating a coordinate system
Before you can start digitizing, you should first pay attention to the coordinate
system in which you will digitize your map. You may for instance use user-defined
coordinates, coordinates defined by a national standard or coordinates of a certain
UTM zone.
The information on the map coordinates you use in a project, is stored in a
coordinate system. A coordinate system defines the possible minimum and maximum
Xs and Ys that can be used in one or more maps, along with other information on
map datum, projection, etc., as was mentioned in the previous chapter. A coordinate
system may include a projection, which defines the relationship between map
coordinates and geographic coordinates in latitude and longitude.
In ILWIS, there are seven main types of coordinate systems:
- Boundary Only: corners of map in X,Y; no projection possible.
- Projection: corners of map in X,Y; optional projection and optional ellipsoid and
datum.
- LatLon: corners of map in LatLon; optional ellipsoid and datum.
- Formula: coordinates calculated by mathematical formula based on another existing
coordinate system.
- TiePoints: table with pairs of coordinates (master-slave) to define a relation
between the two, using a conformal, affine, second order, projective, etc.
transformation.
- Direct Linear: to digitize vector features from an (hardcopy) aerial photograph on
the digitizer. Table containing XYZ coordinates and digitizer coordinates. DTM of
the area required; no fiducial marks on aerial photograph.
- Ortho Photo: to digitize vector features from an (hardcopy) aerial photograph on the
digitizer. Table containing XYZ coordinates and digitizer coordinates. DTM of the
area required; fiducial marks on aerial photograph and camera information required.
ILWIS has three standard coordinate systems:
- LatLon: Geographical coordinates in degrees.
- LatLonWGS84: LatLon coordinates, using WGS84 datum and ellipsoid.
- Unknown: This is the coordinate system you can use if you do not want to specify
the projection used in your maps. In that case you define your own local coordinate
system; only the minimum and maximum X and Y values are stored and there is no
need for projection parameters.
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.
ILWIS 3.0 Users Guide

73

Spatial data input


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 dont know the relationship between metric and geographic
coordinates. This is not a problem as long as you dont 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.

74

Note that if you want to extend your study area and digitize adjacent areas you
need to extend the range of coordinates as defined in the coordinate system.

ILWIS 3.0 Users Guide

Spatial data input

Double-click the New Coordinate System item in the Operation-list. The


Create Coordinate System dialog box is opened.

Type for the Coordinate System Name: Cochabamba .

Click the Projection button and select the Projection: UTM .

Type for the Description: Coordinate system of Cochabamba in UTM .


Select the option CoordSystem Projection and click OK. The
Coordinate System Projection Cochabamba dialog box is opened.
Click OK in the Select Projection dialog box.
Click the Ellipsoid button, and select the Ellipsoid: International
1924 .

Click OK in the Select Ellipsoid dialog box.

Click OK in the Select Datum dialog box.

Click the Datum button and select the Datum: Provisional South
American 1956 and select the Area: Bolivia .
If you now click the Ellipsoid button, you can see that the ellipsoid
International 1924 is used. Click Cancel in the Select Ellipsoid dialog box.

In the Coordinate System Projection Cochabamba dialog box, clear


the check box Northern Hemisphere and enter for the UTM Zone: 19

Type for Min X: 795000 and for Min Y: 8071500


Type for Max X: 808500 and for Max Y: 8090500
Click OK in the Coordinate System Projection dialog box.

Coordinate system Cochabamba is now created and you can proceed with the
digitizer installation and configuration.

3.1.2 Digitizer setup


To be able to digitize in ILWIS, a digitizer tablet and a digitizer cursor with a
minimum of 4 cursor buttons is needed. Before you can use a digitizer, it must be
properly installed and configured. The digitizer can be configured either by using a
WinTab driver or by using the Digitizer Setup Wizard.
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.

ILWIS 3.0 Users Guide

75

Spatial data input


To set up your digitizer using a WinTab driver choose for WinTab communication in
the Select Port page of the Digitizer Setup Wizard.
Using Digitizer Setup Wizard
Before setting up a digitizer with the Digitizer Setup Wizard, you first need to
configure the digitizer tablet according to the digitizer manual. You need to pay
special attention to: Run Mode, ASCII data format, Baud Rate, Number of Data
Bits, Parity, Resolution, and Data Rate.
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.

3.1.3 Map referencing


A digitizer records the location of spatial features by means of digitizer coordinates.
To correctly register features in a map, the relationship between map and digitizer
coordinates needs to be established. A minimum of three control points and the
corresponding map coordinates should be specified by the user in order to calculate
the transformation between digitizer and map coordinates. Since both coordinate
systems are metric, an affine transformation is used.
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:
Xi = a1,1 * Xdig,i + a1,2 * Ydig,i + b1
Yi = a2,1 * Xdig,i + a2,2 * Ydig,i + b2

where:
ai,j and bi are the affine transformation coefficients.

76

ILWIS 3.0 Users Guide

Spatial data input

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.

Make a photocopy of Figure 3.3.

From the File menu of the Main window, select Map Reference.

Position this map in the center of your digitizer and fasten it to the digitizer
with tape. With some digitizers you can also place the paper under a plastic
cover, so that it remains fixed.

The first Map Referencing dialog box is opened. In this box you can select or create
a coordinate system, which stores the minimum and maximum X and Y coordinates
of the map, and optionally a projection for the map. The information is used to
describe how coordinates on the earth surface are related to corresponding
coordinates on the map.
The check boxes in the dialog box are used to select metric or geographic
coordinates. Note, if you choose geographic coordinates, a projection and associated
ILWIS 3.0 Users Guide

77

Spatial data input


parameters have to be defined. The information is needed for the transformation of
geographic coordinates to metric ones.

You can use the Transform Coordinates operation, to check whether the transformation from metric to geographic coordinate system and vice versa is correct
(see also chapter 4, section Map projections).

Select Cochabamba in the list box Coordinate System.


Accept the defaults by clicking the OK button.

The second Map Referencing dialog box (Figure 3.4) and the Map Referencing
command box (Figure 3.4) are opened. The Map Referencing command box shows
the coordinates of the digitizer cursor location and contains the options: Digitize
Point, Next Point and Delete Point. The numbers (0, 1, 2, 3) refer to the digitizer
cursor buttons which are normally labeled 0, 1, 2, 3, or 1, 2, 3, 4, or A, B, C, D. The
commands in this window are used for digitizing control points and have the
following meaning:
- Button 0: To digitize a control point on the map.
- Button 1: To move to the next control point.
- Button 2: To delete the currently active control point.

78

Move your digitizer cursor over the digitizing table. When you do so, you
should see the coordinates change in the upper part of the Map Referencing
command box.

When you dont see any coordinates in the Map Referencing command box, or
when the coordinates remain the same while you move the digitizer cursor over
the digitizer, your digitizer is not set-up properly. Check the digitizer installation
(See section 3.2.1 or refer to ILWIS Help, topic How to set up a digitizer and
start digitizing).

ILWIS 3.0 Users Guide

Spatial data input

Figure 3.3:

ILWIS 3.0 Users Guide

Point map Mountain_top.

79

Spatial data input


Digitizing control points
You are now able to start digitizing control points. After digitizing a point, you need
to enter the corresponding metric or geographic coordinates in the Map Referencing
dialog box (Figure 3.4).
It is important that you do the following as precise as you can.

Position the digitizer cursor at point A of the map and press the 0 button.

Position the digitizer cursor to point B and press the 0 button.

Make sure the mouse pointer is located in the first (left hand) coordinate text
box. Type 795000 for the X coordinate and press the Tab key. The mouse
pointer is now located in the right hand coordinate text box. Type 8071500
for the Y coordinate of the point.
Type 808500 for the X coordinate and 8071500 for the Y coordinate of the
point.
Move the digitizer cursor to point C and press the 0 button.
Type 808500 for the X coordinate and 8090500 for the Y coordinate of the
point.
Move the digitizer cursor to point D and press the 0 button.
Type 795000 for the X coordinate and 8090500 for the Y coordinate of the
point.

You can use Ctrl+C and Ctrl+V to copy and paste coordinate values.

The Map Referencing dialog box shows information such as:


- digitizer: Position of digitized control points in digitizer coordinates (mm).
- coordinates text boxes: Position of digitized control points in real world X and Y
coordinates. These are either metric (X,Y) or geographic (LatLon) coordinates,
depending on the type of coordinate system used (first Map Reference dialog box).
- diff X diff Y: The diff X and diff Y columns indicate deviations (in millimeters)
between the actual map coordinates and the calculated ones. A large deviation may
signify that the coordinate pairs were entered incorrectly. If less than three points
have been digitized, diff X and diff Y are 0 since no deviation can be calculated.
- Sigma: The value of Sigma (in millimeters) for the current data, indicates the
accuracy with which the control points have been digitized. If the value of sigma is
much larger than 1, this indicates that an error was made when digitizing the
points, or when entering the coordinates. Sigma is the standard deviation calculated
from the differences between the digitized and the calculated control points.
- Scale: The calculated scale in horizontal and vertical or X and Y axes assumes that
the entered coordinates are metric. It also takes into account the resolution of the
digitizer (lines/mm or lines/inch as specified in the digitizer configuration).
- Rotation: The rotation of the map coordinates (X and Y axes) relative to the
digitizer X and Y axes.
80

ILWIS 3.0 Users Guide

Spatial data input


- 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.
ILWIS 3.0 Users Guide

81

Spatial data input


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.

Summary: Map referencing


- A digitizer records the coordinates of spatial features by means of digitizer
coordinates. The relationship between the map and digitizer coordinate is
established by referencing the coordinates of the map to that of the digitizer.
- 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.

82

ILWIS 3.0 Users Guide

Spatial data input

3.2 Digitizing a point map


In this exercise a point map called Mountain_top will be created. The points in the
map show the peaks of mountains and hills in the Cochabamba area, Bolivia. A hardcopy of the map is presented in Figure 3.3. A photocopy of the same map was used in
the previous exercise for map referencing.

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.

Click the Create button next to the Domain list box. The Create Domain
dialog box is opened.

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.

As explained in the previous chapter, service objects such as a domain and a


coordinate system, are needed to create a map (data object). A list of IDs or classes,
or the value ranges and the precision used to codify elements in a map, are defined in
a Domain. The domain contains all possible names or values that may occur in a
map. See also chapter 2 for more information about domains.

Type Mountain_top in the text box Domain Name.


Select the option Identifier .

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 ).

Accept the default for the Nr of items and click OK.

ILWIS 3.0 Users Guide

83

Spatial data input


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.
The point IDs will be entered during digitizing.

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
84

ILWIS 3.0 Users Guide

Spatial data input


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 havent used the Save button sofar, the original map will be

restored.
Save button: to save your map to disk.
Exit Editor button: used to exit the editor.

The Point editor works in the Select, Move Points and Insert Modes.
You can work with the Point editor by using the mouse or the digitizer apart or
simultaneously.
Digitizing points
In this exercise you will digitize new points using the digitizer cursor.

Position the digitizer cursor at point 1 and press button 0 (Add Point).

Digitize the rest of the points (Figure 3.3) and label them as follows:

A small box is opened at the digitized point. Type P1 in this box and press
Enter .

Table 3.1: The codes used for digitizing the points in Figure 3.3.
Point #

Point label

Point #

Point label

Point #

Point label

1
2
3
4
5

P1
P2
P3
P4
P5

6
7
8
9
10

P6
P7
P8
P9
P10

11
12
13
14
15

P11
P12
P13
P14
P14

When you enter the label P14 for point 15, a message appears indicating that the
label P14 is used for another point. Although the ID domain allows duplicate names,
it is not very logical to have two points in an ID domain with the same name. To
ILWIS 3.0 Users Guide

85

Spatial data input


enter the correct label for this point:

Click No in this box and enter a new name for this point.
Type P15 and press Enter .

It is recommended to save your work regularly during the digitizing process: you
can either use the Save button or the Save command on the File menu. When
you leave the editor using the Exit Editor button, your work is saved automatically.

Editing a point
The label (ID) of a point can be edited or changed if incorrectly entered. To edit or
change the label of a point:

Position the digitizer cursor at the point which has to be edited, in this case
point 15 and press button 3. Type a new label for this point, e.g., P16 and
press Enter .

Moving a point
A point can be moved either by choosing the Move Points Mode in the Toolbar or
by using the digitizer cursor:

Position the digitizer cursor at the point which has to be moved, in this case
point 14 and press button 1. The digitizer cursor on your screen changes
from an x to a +.

The Move Point command box (Figure 3.6) is shown. It has the following options:
- Button 0: New Position: Specifies the new position for the selected point.
- Button 1: No function.
- Button 2: Change Window: Changes the window displayed on the screen.
- Button 3: Return: Returns to the Point editor command box.

Figure 3.6:

86

The Move Point command box.

ILWIS 3.0 Users Guide

Spatial data input

Move the cursor about a centimeter above the point 14 and press button 0.

If during digitizing points were incorrectly entered, they can be repositioned


afterwards.
Deleting a point

In the Toolbar, choose with the mouse the Select Mode button

Click Yes in the opened Point Editor message box to confirm.

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.

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.

Click the Exit Editor button

in the Toolbar.

Close the map window.

ILWIS 3.0 Users Guide

87

Spatial data input

3.3 Digitizing a segment map


Before you continue to digitize a segment map, it may be good to explain first about
how points, segments and polygons are digitized. Points, segments and polygons are
three types of spatial features used in ILWIS. An individual point is defined by a pair
of X and Y coordinates. A segment is composed of a series of intermediate points,
connected by straight lines, with a start and an end node. A polygon is a closed area
consisting of one or more segments. All segments forming a polygon have to be
connected at intersections. Each intersection or end connection of segments has a
node (Figure 3.7).

Figure 3.7:

Presentation of points, segments and polygons in ILWIS.

When you digitize a polygon, the boundary lines of this polygon should be
connected. The connection of one line to another is called snapping. Snapping always
takes place at a node (the end of a line). Snapping is needed for polygons, and for
segment maps that represent a network (e.g. a drainage network, or a road network).
Snapping is not required for other segment maps, such as a contour map. When you
digitize a contour map, you can only snap lines that have equal altitude.
You can digitize a line, by holding down the cursor button and simultaneously
moving the cursor on the line (digitizing in stream mode). The line coordinates are
recorded at regular time intervals. The disadvantage is that many points are needed to
define the segment. Many of these points do not improve the accuracy of the line and
are considered redundant.
You can also digitize a line, by pressing the cursor button only when a point in the
segment needs to be digitized (digitizing in point mode). In this way coordinates are
only recorded if the button is pressed. The number of points used to store a segment
depends on the complexity of the line, and on the accuracy of the person digitizing.

88

ILWIS 3.0 Users Guide

Spatial data input


To reduce the number of coordinates defining a segment, a data reduction procedure
called tunneling is carried out automatically (Figure 3.8). The necessity of each
coordinate, is evaluated by connecting the adjacent coordinates by a line or tunnel
with a pre-defined width. When the evaluated coordinate lies inside the tunnel, it is
considered redundant, and is removed. If it lies outside the tunnel, it is kept and the
same operation is carried out for the next coordinate.

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.

Make a photocopy of Figure 3.9.

From the File menu of the Main window, select Map Reference. The first
Map Reference dialog box is opened.

Remove the photocopy of Figure 3.3 if it is still on the digitizer. Position the
photocopy of Figure 3.9 in the center of your digitizer, and fasten it to the
digitizer with tape. With some digitizers you can also place the paper under a
plastic cover, so that it remains fixed.

When a new map is placed on the digitizer, or when you have moved the map that
you were digitizing before, you will have to reference the map again. However, the
Map Reference dialog box still contains the X and Y values of the control points of
the previous map. So if the new map uses the same control points, the only thing to
do is to digitize the four points. Once a map is referenced, it remains like that, until
you make a new map reference. So even if you turn off the computer and when later

ILWIS 3.0 Users Guide

89

Spatial data input


on you decide to continue digitizing, and the map on the digitizer is still in the same
position, you dont have to reference your map anymore.

Accept the defaults by clicking the OK button. The second Map


Referencing dialog box and Map Referencing command box (Figure 3.4)
are opened.

Digitize the four control points of Figure 3.9. Make sure to digitize the correct points for the XY coordinates that are already given in the Map
Reference dialog box. Click OK when the error is tolerable (Sigma value is
around 1 or lower). Otherwise digitize the four points again.

From the File menu of the Main window, select Create, Segment Map. The
Create Segment Map dialog box is opened.

Type Road in the text box Map Name.

Type Road in the text box Domain Name, make sure the option Class is
selected as the domain type and click OK. The Domain Class editor is
opened.

Select Cochabamba from the list box Coordinate System.


Click the Create Domain icon in the list box Domain. The Create Domain
window is opened.

It is possible to write the names of the domain items in the Domain Class editor
directly. In this exercise, however, you will create the names during digitizing.

Close the Domain Class editor. You are back in the Create Segment Map
dialog box.

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.

90

ILWIS 3.0 Users Guide

Spatial data input

LEGEND
Segments EF, PQ, HR and RNO
Segments LFMN, MGH, HID and ISQ
Segments KLG, CS and TCD
Segments MU, DJ and IR
Figure 3.9:

ILWIS 3.0 Users Guide

= highway
= main road
= motorway
= earth road

The segment map road (not according to the real situation). The nodes of each line
have a code in this example to facilitate the explanation on how to digitize.

91

Spatial data input


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.

Press digitizer button 2 (Change Window). Now the Change Window


command box appears.

Position the digitizer cursor on the upper left corner of the box indicated in
Figure 3.9 with a hatched line. Press digitizer button 1 (1st Point).

Move the digitizer to the lower right corner of the box with a hatched line
and press digitizer button 2 (2nd point). The map window now only displays
the area inside the box. Check this by moving your digitizer cursor through
the box.

Note that you can use button 0 (Entire Map) to zoom out again. You can also zoom
in by using the mouse pointer. In that case, click the Zoom In button on the Toolbar
of the Segment editor and define the area you want to zoom in.
Digitizing segments
In Figure 3.9 each node has a code. This is only used here so that we can explain
better how to digitize. To digitize the segment QHISQ:

92

Click the Maximize button


window.

Position the digitizer cursor at point Q in the map.

with the mouse pointer to enlarge the map

Press digitizer button 0 to enter the point (starting point of the segment).
ILWIS 3.0 Users Guide

Spatial data input


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 button 0 of the digitizer cursor.

Note, since the button 0 is continuously pressed the coordinates are recorded at
regular time intervals (see section 3.2). This is digitizing in stream mode.

Release the button 0 when you are just before the starting point Q of the line
QHISQ .

It is important to stop digitizing a little bit before you reach the actual point where
you want to connect the segment. This is done to ensure that no additional
intermediate coordinate is digitized, which is in fact on the other side of the
connection point, and which will cause an error when you check the segments later.

Move the digitizer cursor to point Q while not holding down the button 0 of
the digitizer cursor.

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.
ILWIS 3.0 Users Guide

93

Spatial data input


- 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.

Select <new> from the list box Class Name.

The Add item to Domain dialog box is opened. Here a Name, a Code and a Color
for the digitized segment can be entered.

Type Main road in the text box Name.


Type Mr in the text box Code.
Select a color in the list box Color. This color will only be shown after you
leave the editor.
Click OK in the Add item to Domain dialog box and in the Edit dialog box.

It is advised to enter codes (letters or numbers), especially, when the class names
are long and you intend to use the map for further MapCalc operations. The
codes can be used in the map calculation formula instead of the class names.

The Segment editor will by default display all segments in the same color (default
Green). If during digitizing you want to check on segment names/codes and have the
segments drawn in the color of the representation, open the Customize Segment
Editor dialog box (File, Customize) and select Segment colors Domain .
The lines EF , PQ , HR and RNO represent highways in the map. Before digitizing the
lines, we will add a new class Highway to the domain. To add a new class:

94

From the Edit menu of the Segment editor, select Insert Code. The Edit
dialog box is opened.

Select <new> from the list box Class Name. The Add item to Domain dialog box is opened.

Type Highway in the text box Name and Hw in the text box Code.

ILWIS 3.0 Users Guide

Spatial data input

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.

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 respectively digitizer button 1 (Snap Segment), button 2 (Snap Split) and button
0 (Accept). In this way node H connects segments HISQ and HRNO . Move
the cursor while pressing button 0. End the segment by pressing button 1
(End Segment).

Also digitize segments KLG and TCD . You will edit the codes of the segments
later.

Keep pressing this button and move the cursor along the line EF .
Release the button when the cursor is at point F and press the 2 button (End
Segment).

Now, if you want to digitize segment CS , there is a problem. Since there is no node
yet at point C, the segment TCD should be split first before you can digitize segment
CS . You can split a segment during digitizing, as you did before, but now we will use
the Split/Merge Mode.

Click the Split/Merge button on the Toolbar. The mouse pointer changes to
a pair of scissors.

Position the mouse pointer at point C (check with digitizer cursor) and click
with the mouse. The following message is shown:

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.

ILWIS 3.0 Users Guide

95

Spatial data input

Position the digitizer cursor at point C and press button 1 (Snap Segment).
Press digitizer button 0 (Accept).
Press digitizer button 0 and move along the line CS until you are near to S.
Position the mouse pointer on point S and press digitizer button 1 (snap end
segment). With a sound it is indicated that the segment cannot be connected
to point C, since there is no node yet. The End Segment command box
appears.
Press digitizer button 2 (Snap Split) to split the segment QHISQ .
Press digitizer button 0 (Accept) to accept the location where the segment
QHISQ will be split and where the segment CS will be connected.

The previously digitized segments KLG , CS , TC and CD were coded as Highway, but
in fact they represent Motorways . Since no new class name has been defined for
them yet, they automatically got the same class name (Highway ) as the last digitized
segment. Hence, the names of the segments need to be changed to Motorway . You
will use the mouse to change the class names of these segments.

Press the Select Mode button on the Toolbar with the mouse pointer.

Do the same for the segments TC and CD . Note that TCD now consists of two
segments, since you have split it.

Click the right mouse button, to open the context-sensitive menu and select
Edit. The Edit dialog box is opened.

Select <new> in the Edit dialog box. The Add item to Domain dialog box
is opened.

Type Motorway in the text box Name, type Mw in the text box Code, select
a color in the list box Color and click OK.

Click OK in the Edit dialog box.

Position the mouse pointer on the segment KLG and select it.
Press the Shift key and put the mouse pointer on the segment CS and select
it. In this way you can select multiple segments.

The names of the segments can also be changed by double-clicking the segment.

Double-click the segment KLG .


The list of the existing segment labels is displayed, and you can see that the
selected name for segment KLG is Motorway .

As you have seen, the connection of one segment to another is done via snapping.
This is to ensure that the segments are linked precisely through the nodes. Snapping
only succeeds if a point exists within the snapping tolerance distance. A beep warns if
96

ILWIS 3.0 Users Guide

Spatial data input


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.
Now you will practice some more with snapping segments.

Click Cancel in the Customize Segment Editor dialog box.

Digitize segment FL by pressing the button 0. Stop just before L.

Put the digitizer cursor at point F and press the button 1, to snap the starting
point of the new segment to point F of the segment EF and press button 0 to
accept.
Press button 1 to snap this segment to point L of segment KLG . The program
proceeds to End Segment command box.

ILWIS 3.0 Users Guide

97

Spatial data input

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 necessary. To codify the segments, follow the legend of Figure 3.9.

Change the position of a point


An incorrectly digitized point can be corrected by re-positioning it afterwards.
Assume that the correct position of point V on the line UM (Figure 3.9) is at point Z.
To change the position of this point:

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.

Zoom in on the area surrounding point V.


Position the digitizer cursor (box) on an intermediate point near point V and
press button 1.

The program proceeds to the Retouch Point command box (Figure 3.11B). The
commands in this command box are:
- Button 0: New Position. To drop the point at a new position.
- Button 1: Take Point. To select another point to be moved.
- Button 2: Snap. To drop the point at an existing node (snap) or to drop the point
on an existing segment to a point on the segment on which it has been positioned.
- Button 3: Return. Return to the Move Points command box.

98

ILWIS 3.0 Users Guide

Spatial data input

(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 .

Zoom in on the area around node F.

Press digitizer button 1 until the line EF is shown in red.

Put the cursor at node F, and press button 1. The Retouch Points command
box is opened.
To connect it to another segment, press button 2.

Deleting a segment
Incorrectly digitized segments can be deleted with the mouse. Suppose the segment
UM was incorrectly digitized, and you want to delete it:

Zoom in on the area of segment UM .


Choose with the mouse pointer the Select Mode. Select segment UM .
Click with the right mouse button and select Delete from the context-sensitive menu.

Deleted segments can be undeleted. If the segment UM was deleted by mistake and
you want to undelete it:

Open the context-sensitive menu and select Undelete segments. The deleted segments will be displayed in the map window with a different color.

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.

ILWIS 3.0 Users Guide

99

Spatial data input


Displaying segments in different colors
You can quickly see how many classes exist in a segment map, by displaying the
segments in different colors or in the colors defined in a representation.

Open the context-sensitive menu in the map window by clicking the right
mouse button, and select Customize. The Customize Segment Editor dialog box is opened.

From this box you can choose to display the segments in Normal color, colors
defined in the representation (Domain), or in Primary Colors.

Select Domain from this box and click OK.


Click the Exit Editor button. The segment map is displayed.
Close the map window after you have seen the result.

The final part of segment digitizing is the checking of the segments. The items that
are checked are intersections of lines without a node, dead ends in segments, self
overlapping segments and consistency of the codes.
The checking of segments is not treated here. In section 3.5, a detailed explanation
will be given of the procedure for checking segments and correcting errors.

100

ILWIS 3.0 Users Guide

Spatial data input

3.4 Digitizing contour lines


In the previous exercise you have seen how to digitize a segment map with a class
domain. Now you will learn how to digitize segments (contour lines) with a value
domain. Each contour line is digitized with the corresponding height as the value.
The contour value is given in the map (Figure 3.12). This contour map can be used to
create a Digital Elevation Model (see chapter 10). Digitizing contour lines is quite a
tedious job. To simplify the exercise, only the southern part the contour map of the
study area will be digitized. When digitizing, take the following into consideration:
- Always digitize contour lines a little bit further outside the boundaries of the study
area, to prevent the boundaries of the area having wrong results after contour
interpolation.
- Where many contour lines are close to each other, it is preferred to digitize only a
few to minimize errors in the interpolation.
- To prevent hills having a flat top, hilltops should be digitized as small lines,
defined by the highest closed contour line, or as a point map in a separate file.

Make a photocopy of Figure 3.12.

From the File menu of the Main window, select Map Reference. The Map
Reference dialog box is opened.

Reference the map (Figure 3.12) to the digitizer, similarly, as described in


section 3.1.3. Mind: the minimum and maximum X and Y values are different for this map.

Expand the Create item in the Operation-tree and double-click New


Segment Map. The Create Segment Map dialog box is opened.

Type Isolines for the name of the map.

Click the Create Domain button. The Create Domain dialog box appears.

Close the Create Domain dialog box by clicking OK. You are now back in
the Create Segment Map dialog box. Click OK.

Remove the photocopy of Figure 3.9 if it is still on the digitizer, position the
photocopy of Figure 3.12 in the center of your digitizer, and fasten it to the
digitizer.

Select Cochabamba from the list box Coordinate System.


Change the Min X and Y values in 800900 and 8071400 respectively and
the Max X and Y values in 808300 and 8080100 . By making the minimum
X and Y values a bit lower (100 m) and the maximum ones a bit higher (100
m), you can digitize the contour lines a little bit outside the map boundaries.
Type Isolines for the Domain Name and select domain Type Value .
Type 2000 and 4000 in the Min, Max text boxes, and type 0.1 in the text
box Precision.

The Segment editor and the Add Segments command box are opened.

ILWIS 3.0 Users Guide

101

Spatial data input

From the Edit menu of the segment editor, select Insert Code.
The Edit dialog box is opened.
Type the value: 2560 . This will be the default value for all segments that you
will digitize from now on. Click OK.

Digitize the contour lines with the altitude 2560. After you finished digitizing each line, click OK in the Edit dialog box.

Subsequently digitize a first contour line of altitude 2580. In the Edit dialog
box, which appears after you finished digitizing the line, change the value
into 2580 and click OK.

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?

102

Click Yes to zoom in and correct the errors (if any) by recoding the wrong
segments.

Press the Exit Editor button when the digitizing is finished. When the
segment editor is closed, the segments are displayed in a map window;
segments are displayed with system representation Pseudo .

Close the map window when you have seen the result.

ILWIS 3.0 Users Guide

Spatial data input

Figure 3.12: The segment map Isolines.

ILWIS 3.0 Users Guide

103

Spatial data input

3.5 Creating a polygon map


Now you will see how to digitize a polygon map. A polygon map can be created
using the following steps:
- Digitizing the boundaries of the polygons as segments in the Segment editor;
- Checking the segments in the Segment editor;
- Digitizing the labels of the polygons as a point map in the Point editor;
- Polygonizing the segments using the point map as labels in the Segment editor.
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 .

Make a photocopy of Figure 3.15 and fix this to the digitizer.


Reference this map with the method explained in section 3.1.3.
In the Catalog, click segment map Checkseg with the right mouse button
and select Edit from the context-sensitive menu.

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.

104

ILWIS 3.0 Users Guide

Spatial data input


- 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.

ILWIS 3.0 Users Guide

105

Spatial data input

Figure 3.15: Polygon map Geomorphology.

106

ILWIS 3.0 Users Guide

Spatial data input

The program will give an error message: Segment unitbound (nr 4) crosses itself. Remove false polygon?

Click Yes. The false polygon is removed and the program will continue to
check for other segments that overlap themselves. It will give again the message Zoom in on error?

Drag the Check Segments message box outside the map window and compare the segment map near point D with Figure 3.14B. Then click Yes in the
message box to zoom in on the area near M. The message Segment unitbound (nr 21) crosses itself. Remove false polygon? appears.

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 program is now checking further on segments that overlap themselves


and will give again the message Zoom in on error?

Click Yes to zoom in on the area with the red box (between M and L). An
error message Segment unitbound (nr 25) crosses itself. Remove false
polygon? is shown.

Click Cancel.

Click the Move Points button


and use the mouse pointer, which is now
in the form of little tweezers, to move the intermediate points of the segment,
until they no longer overlap.

Click the Select Mode button and the Entire Map button when finished.

Press the Zoom In button on the Toolbar and zoom in on the lower part of
the lake between M and L.

From the File menu in the Segment editor, select Check Segments, Self
Overlap. The Check Segments dialog box is opened.

Select the check box Start at Number. The number of the last checked segment is shown.

Click OK. The checking is resumed and, if you made the corrections well, no
other self overlapping segments are found and the Segment Editor message
OK: Segments are not overlapping themselves appears.

Click OK to close the message box.

ILWIS 3.0 Users Guide

107

Spatial data input


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).

108

ILWIS 3.0 Users Guide

Spatial data input

Display the entire map.

Click OK. The map is now checked for segments that are intersecting without
a node. The message Zoom in on error? appears.

Click Yes to zoom in on a location near E. The situation near E is shown in


Figure 3.17A.

From the File menu of the Segment editor, select Check Segments and
Intersections. The Check Segments dialog box is opened.

Figure 3.17: Intersection without node near point E in Figure 3.15.

A: Original situation. B: Situation after automatic correction.

Another error message Intersection without node in Segment unitbound


(nr 6). Split segment? appears.

Click Yes.

The situation near point E after automatic correction is shown in Figure 3.17 B. As
you can see, it is not always advisable to use the automatic editing option since this
may lead to many small polygons. Instead it is often better to edit the error manually
using the Move Point Mode. You will now correct the error near L manually using
the Move Points Mode.

The program resumes checking intersections and will display an error message for an error near L (after you clicked Yes in the Zoom in on error message box). Do not accept automatic correction and select No.

Use the mouse pointer to move the nodes of the segments so that the two
segments no longer intersect. Click the Entire Map button when finished.

From the File menu in the map window, select Check Segments and
Intersections. The Check Segments dialog box is opened.

ILWIS 3.0 Users Guide

109

Spatial data input

Select the option Start at Number and click OK. If you corrected the previous errors well, no more errors are found.

There is one more option to check segments: Code Consistency. This is useful only
in situations where you want only segments with the same code to be connected. For
example, in the case of contour lines, where only lines with the same altitude code
should be connected. In the example of the segment map Checkseg this is not a
useful option, since there is only one segment code (Unitbound ).
To better see the effect of automatic editing, you will now correct for the small
polygons that were generated during the automatic editing in point M and point E. You
will do this with the mouse pointer.

Zoom in on the area around M.

Repeat the procedure for the area around point E and click the Save button
when you are finished with the exercise.

Exit the Segment editor by pressing the Exit Editor button


return to a map window displaying the correct segments.

Choose the Select Mode, select the small unwanted segments and delete
them by pressing Delete.

. You will

The segments of segment map Checkseg are now error free, and you can proceed
with the creation of the polygon map.
Creating a label point file
When you create a polygon map, the best procedure is to digitize the boundary lines
of the segments in a segment map, and the labels or names of the polygons as points
in a point map. Now you will digitize a point map, containing the names of the units
in the map of Figure 3.15.

110

In the map window displaying the corrected segments, open the File menu
and select Create, Point Map. The Create Point Map dialog box is
opened.

Type Landunit in the Map Name text box.

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.

Type for the Description: Points indicating the labels of land


unit polygons .

Select the option Class and click OK. The Domain Class editor is
opened.

ILWIS 3.0 Users Guide

Spatial data input

Press the Insert key or click on the Add Item button


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 .

in the Toolbar. The

Creating the polygon map


Now that the segments are checked and you have a label point file, you can proceed
with the polygonization.

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 .
ILWIS 3.0 Users Guide

111

Spatial data input

Double-click the word Properties in the Layer Management pane. The


Properties sheet is opened.

Select the Dependency tab, click the Break Dependency Link button and
confirm with Yes.

In the map window open the Edit menu and select Edit Layer 1 Landunit .

Editing polygons
The Polygon editor and the Polygon Editor command box are opened. The
Polygon Editor command box only contains two options:
- Button 0: Edit Value: To change the name of a polygon.
- Button 1: No function.
- Button 2: Change Window: To change the area displayed on the screen.
- Button 3: No function.

Zoom in on the area around E and F.

When finished, press the Exit Editor button.

If you forgot to add a label point to the three small lake polygons before, you
can edit the names of the polygons now. Double-click the units, select Lake
and press Enter .
The polygon map Landunit is now ready. Close the map window when
finished.

If you want to practice some more with the creation of a polygon map, you can
digitize the landunit segments of Figure 3.14 yourself, do the segment check and
polygonize the segments.

112

Create a segment map Landunit2 , using the coordinate system


Cochabamba . Digitize the lines of Figure 3.15 in a similar way as explained
in section 3.3. Digitize all segments, including the boundaries of the map,
and make sure to snap all segments. All segments in the map may receive the
same code: Landunit2 .

Check the segments and correct the errors.


Create a point map Landunit2 , also using coordinate system
Cochabamba , digitize the labels, and use this point map together with the
segment map Landunit2 to create a polygon map Landunit2 .

ILWIS 3.0 Users Guide

Spatial data input


Summary: Digitizing maps
- Spatial data in ILWIS are digitized as point, segment or polygon maps.
- An individual point is defined by X and Y coordinates.
- A segment is composed of a series of intermediate points, connected by straight
lines, with a start and an end node.
- A polygon is a closed area consisting of one or more 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 are digitized either by continuously digitizing them (stream mode), or by
pressing the digitizer cursor only for some points along the line (point mode).
- A data reduction procedure called tunneling is carried out automatically, to reduce
the number of points defining a segment.
- In a segment map, generally, it is not needed to connect segments to each other,
except when it concerns linear features that will be used, e.g., in network analysis.
- In a polygon map, all segments forming a polygon have to be connected (snapped)
to each other at intersections. In other words, all boundary lines of polygons should
be snapped to each other at their nodes.
- 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.

ILWIS 3.0 Users Guide

113

Spatial data input


- 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.

114

ILWIS 3.0 Users Guide

Spatial data input

3.6 Additional information on digitizing photographs


Monoplotting on the digitizer
Monoplotting is the activity of digitizing segments and points from an aerial
photograph while correcting relief and camera tilt distortion. During digitizing the
software is transforming the gathered coordinates such that they fit on a topographic
map defined with a Cartesian coordinate system.
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 photogrammetric 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.
An orthophoto is obtained by resampling a photograph which has a georeference
orthophoto to a georeference corners. For more information see ILWIS Help: How to
create an orthophoto.
From the ILWIS web site, you can download text and data for an exercise on creating
an orthophoto (see ILWIS 2.2 Guide).

ILWIS 3.0 Users Guide

115

CHAPTER 4

Spatial data management


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.
The final section 4.6 focuses on the conversion of domains.
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.

Double-click the ILWIS icon on the desktop.


Use the Navigator to go to directory the C:\ILWIS 3.0 Data\Users Guide\
Chapter04.

ILWIS 3.0 Users Guide

117

Spatial data management

4.1 Importing digital data


In the previous chapter you have seen how to digitize maps. However, sometimes
maps may already be available in digital format from another source. They may have
been generated using different software, they may have resulted from scanning maps,
or they may be available as digital satellite images or scanned images. In order to use
these digital data in ILWIS, the files need to be imported to the ILWIS file formats
that are required. Importing can be done with the Import module, in which you can
select the import method and format.
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.
GeoGateway is a product of PCI Geomatics (http://www.pcigeomatics.com) which
allows programs to access data in many geomatics file formats, in a uniform manner,
without having to translate them before use in applications. GeoGateway includes
access to imagery, vectors, attributes, projections and other auxiliary information of
interest to users of geomatics applications.
When using GeoGateway, you can choose to:
- perform a genuine import and translate the external file to an ILWIS format:
- the external data will be translated into ILWIS file formats: ILWIS object
definition files (e.g. .MPR, .TBT) as well as ILWIS data files will be created.
- you can view the imported data, calculate with it, use it in ILWIS operations,
etc.
- the imported data can be edited in ILWIS.
- keep the external file in its original format (Use As):
- the external data will not be translated into ILWIS file formats: only ILWIS
object definition files (e.g. .MPR, .TBT) will be created; as the same data file
will not appear twice on your hard disk in different formats, you will save some
hard disk space in this way.
- you can view the imported data, calculate with it, use it in ILWIS operations,
etc.
- the imported data cannot be edited in ILWIS however.
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.

118

ILWIS 3.0 Users Guide

Spatial data management

4.1.1 Importing raster data through ILWIS import


Raster maps can be imported from a number of file formats. Some of these formats
do not allow the storage of coordinates. This is the case for the frequently used file
interchange formats: Tag Image File (TIF) format, and the Windows Bitmap (BMP)
format. When you import a raster map from these formats, the resulting ILWIS map
will have a georeference None . This means that the map is not georeferenced.
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 doesnt 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 Users Guide

119

Spatial data management

Import also the Windows bitmap Hillshad .

Close the map windows. The maps will be used later on.

Open the raster maps Bolivia_mask and Hillshad and check the domain
types and other properties of both maps.

Other file formats, such as the ERDAS .GIS, ERDAS .LAN and IDRISI .DOC/.IMG,
also allow for the conversion of coordinate information. The conversion of these file
formats will result in maps with a georeference corners.

4.1.2 Importing raster data through GeoGateway


To import external raster file formats in ILWIS, you can use the normal ILWIS
Import, but you can also Import via GeoGateway, which supports many current
raster file formats. The result of a GeoGateway import is an ILWIS object collection.
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).

Expand the Import/Export item in the Operation-tree, and double-click


Import Via GeoGateway. The Import dialog box is opened.

Select the file: Tm_b123.img .

Accept the Output Filename Tm_b123 .

Double-click the object collection Tm_b123 . The object collection is opened.

Close the object collection and the map windows after you have finished the
exercise.

Make sure the option Use PCI-GeoGateway is selected in the Import


Format list box.
Select the check box Convert to ILWIS data format and click OK. The map
Tm_b123.img is now imported.
Open the maps to see the contents. Check the domain types and other properties of the 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.

120

ILWIS 3.0 Users Guide

Spatial data management

From the File menu of the Main window, select Import, Via GeoGateway.
The Import dialog box is opened.

Select the file: Ikonos_Cochabamba.tif .

Click OK. The Ikonos_Cochabamba.tif file is now imported.

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.

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.
Double-click the object collection Ikonos_Cochabamba . The object
collection is opened.

4.1.3 Importing through General Raster Import


Import General Raster is designed to import raster map formats which are not
directly supported by ILWIS nor by GeoGateway. Files to be imported may have a
band sequential structure, a band interleaved structure or a pixel interleaved structure.

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.

ILWIS 3.0 Users Guide

121

Spatial data management

Expand the Import/Export item in the Operation-tree, and double-click


Import General Raster. The Import dialog box is opened.

Select the file: W100S10.DEM .

Accept the Output Filename W100S10 and click OK. The Import General
Raster dialog box is opened.

Type 0 for Header Size.

Make sure the option Use General Raster Import is selected in the Import
Format list box.

Select 1 for Number of Bands.


Type 4800 for Number of Columns.
Select Integer numbers for Pixel Structure.
Select 2 for Number of bytes per pixel.
Select the check box High Endian Byte Order.

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.

Open the map to see its contents.

Accept the Output Name W100S10 and click OK. The map W100S10.DEM
is now imported.

The map window shows part of the continent of South America. The imported map
has system domain value. When moving the mouse pointer in the map window, you
will see that the map has no coordinates. Before you can use this imported map
together with other data in ILWIS, you need to create a georeference for the map.

122

Close the map window.

Type for the GeoReference Name W100S10 .

In the Main window, open the File menu and select Create, GeoReference.
The Create GeoReference dialog box is opened.
Accept the GeoRef Corners option.
Select the Coordinate System LatLonWGS84 .
Type for Pixel size 0 0 30.
Type for Min Latitude 60 0 0 S.
Type for Min Longitude 100 0 0 W.
Type for Max Latitude 10 0 0 S.

ILWIS 3.0 Users Guide

Spatial data management

Type for Max Longitude 60 0 0 W.

In the Catalog, click with the right mouse button on raster map W100S10
and select Properties from the context-sensitive menu. The Properties
sheet is opened.

In the Properties sheet, select GeoReference W100S10 and click OK.

Make sure the option Center of Corner pixels is not selected and click OK.
The georeference is created.

Open the map W100S10 and check the coordinates.

Raster map W100S10 is now displayed with the proper coordinates and can be used
in combination with other data in ILWIS.
Note that pixels in the ocean area have a value 9999 , which indicates that there is
no data available, while in ILWIS this should be undefined. You can correct the map
with a Map Calculation in which you replace value 9999 by ?.

Type the following formula on the Command line of the Main window:
CorrectDEM = IFF(W100S10=-9999,?,W100S10)

The map is calculated and the Raster Map Definition dialog box is opened.

Close all map windows after you have finished the exercise.

Accept the defaults in the Raster Map Definition dialog box and click OK.
The output map is now displayed with undefined values where no data is
available, and with a proper stretch for elevation data.

4.1.4 Importing vector data through ILWIS import


The most frequently used file formats for importing vector data in ILWIS, are the
ArcInfo .E00 (non-compressed) format, the ArcView .SHP format and the AutoCad
.DXF format.
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.

ILWIS 3.0 Users Guide

123

Spatial data management

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.

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.

Select the file: Dnnet.E00 . Accept the Output Filename and click OK.
The map Dnnet.E00 is now imported.

The conversion from AutoCad .DXF may be a segment map, a polygon map and/or a
point map, depending on the contents of the file. If the codes in the .DXF file only
contain numerical values (as is the case for contour lines), the output domain will be
value. Otherwise it will be a class domain (if there is more than 1 code).
In this example a map of South America, in AutoCad .DXF format (Samerica ),
will be imported as a polygon map with a class domain. Note that in this case each
polygon has a separate boundary line, without topology.

From the File menu of the Main window, select Import, Map. The Import
dialog box is opened.

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 exercise.

4.1.5 Importing vector data through GeoGateway


External vector file formats can be imported using the normal ILWIS Import, but
you can also import vector files through GeoGateway, which supports many current
vector file formats. The result of a GeoGateway import is an ILWIS object collection.

124

ILWIS 3.0 Users Guide

Spatial data management

From the File menu of the Main window, select Import, Via GeoGateway.
The Import dialog box appears.

Select the file: Cochabamba.pix .

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.

Make sure the option Use PCI-GeoGateway is selected in the Import


Format list box and leave the Output Filename as it is.

For more information on the import of vector and raster data, see the ILWIS Help.
Summary: Importing data
- Raster maps can be imported from a number of file formats. Some of these formats
do not allow for the storage of coordinates, for instance the Windows Bitmap
(.BMP) format. The Tagged Image File format (.TIF) only stores coordinates
when it has been exported as GeoTIFF. Other file formats, such as the ERDAS
.GIS, ERDAS .LAN, and the IDRISI .DOC/.IMG generally contain coordinate
information.
- Frequently used file formats for importing vector data into ILWIS are the Arc/Info
.E00 format, the Arc/View .SHP format and the AutoCad .DXF format.
- To import external raster and vector file formats into ILWIS, you can use the
normal ILWIS Map Import, but you can also Import via GeoGateway, which
supports many current raster and vector file formats.
- Import General Raster is designed to import raster maps which formats are not
directly supported by ILWIS nor by GeoGateway. Files to be imported may have a
band sequential, a band interleaved, or a pixel interleaved structure.

ILWIS 3.0 Users Guide

125

Spatial data management

4.2 Map projections


The maps that you obtain after importing, often need to be changed before you can
use them in combination with the rest of your data. The different tools that you can
use to change vector and raster maps will be explained in the rest of this chapter. One
of the most important changes that may have to be done is related to the coordinates
of the map. The map may not have coordinates (in the case of raster maps imported
from TIFF or BMP for example). In that case you will have to georeference and
resample so that they have equal dimensions, pixel size and projection as the other
maps. Also, for vector maps, which have coordinates by definition, these coordinates
may not be the ones that you use for other maps. In that case you will need to
transform the coordinate system. The most important reason that coordinates may be
different (apart from the fact that a local coordinate system may have been used), is
that the original maps had different projections.
A map projection defines the relationship between the map coordinates and the
geographic coordinates, latitude and longitude.
The geographic coordinate system is a spherical coordinate system composed of
parallels of latitude () and meridians of longitude () (see Figure 4.1.A).

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 earths rotation, the shape of the earth is not a perfect sphere. The
earth is flattened towards the poles: The equatorial axis (line from the center to the
equator) is longer than the polar axis. The earths shape can be represented by an
ellipsoid, or as it is sometimes called, a spheroid (shapes that are generated by
revolving an ellipse around its minor axis).
A spheroid has 2 different semi-axes a and b, where a is the radius of the equator
circle and b is the half axis of rotation ( b < a). See Figure 4.1B.
126

ILWIS 3.0 Users Guide

Spatial data management


The flattening of the ellipsoid is defined by:
f = (a-b)/a

and the eccentricity:


e*e = (a*a - b*b) / a*a

It follows that the ellipsoid shape is also completely defined by a and f or by a and e.
Nearly 93% of the earths land surface is mapped using only four of these ellipsoids:
International, Krassovsky, Bessel and Clarke (1880). Table 4.1 lists the ellipsoids
available in ILWIS. They are stored in text file Ellips.def . In this file, for each
ellipse the value of a (equatorial radius) and 1/f (the inverse of the flattening) are
listed.
If no ellipsoid is known, the choice by default is a sphere with a = b = 6371007 m.
The choice of the ellipsoid, which fits best a given region of the earths surface to be
mapped, depends on the surface curvature and geoid undulations in that region.
Hence every country has its own best ellipsoid. See also the ILWIS Help topic
Select Ellipsoid.
Table 4.1:

Reference ellipsoids, which can be chosen in ILWIS.

Airy 1830
ATS 77
Australian National
Bessel 1841
Bessel 1841 (Japan by Law)
Bessel 1841 (Namibia)
Clarke 1866
Clarke 1880
Clarke 1880 (IGN)
D-PAF (Orbits)
Everest (India 1830)
Everest (India 1956)
Everest (Malaysia 1969)
Everest (E. Malaysia and Brunei)
Everest (Malaysia and Singapore 1948)
Everest (Pakistan)
Everest (Sabah Sarawak)

Fischer 1960
Fischer 1968
GRS 80
Helmert 1960
Hough 1960
Indonesian 1974
International 1924
Krassovsky 1940
Modified Airy
Modified Fischer 1960
New International 1967
SGS 85
South American 1969
WGS 60
WGS 66
WGS 72
WGS 84

The surface of the earth is curved but this should be presented in maps as a plain
surface. This will always result in some deformation or distortion, unless you use a
spheroidal map (a globe). To correctly represent the curved earths surface on a flat
map, you need a special map projection. With the help of a map projection,
geographic coordinates are converted into a two dimensional metric coordinate
system, measuring the X and Y directions in meters. Each map projection has unique
equations for the transformation from geographic to metric coordinates.

ILWIS 3.0 Users Guide

127

Spatial data management


Map projections can be subdivided according to three aspects: class, aspect and
properties.
There are three classes of map projections:
- Cylindrical projections
Cylindrical projections may be imagined, as the transformation to a plane that is
wrapped around the globe in the form of a cylinder (see Figure 4.2). Note that it is
possible that the cylinder intersects the sphere (a secant cylinder). The outline of the
world map would be rectangular in shape.
- Azimuthal projections
These projections may be imagined as the transformation on a plane tangent to the
globe (Figure 4.2). As with the cylindrical projections, here the plane may intersect
the sphere (a secant plane). The characteristic outline of the world map would be
circular.
- Conical projections
These projections may be imagined as the transformation to a plane that is wrapped
like a cone around the globe (Figure 4.2). The possibility of a secant cone is also
present in this class. The outline of the world would be fan shaped.

Figure 4.2:

Cylindrical, azimuthal and conical projections. For each projection a tangent (touching the globe), and a secant (intersecting the globe) version is shown. The lower
right part of the figure illustrates two aspects: Normal (oriented parallel to the
earths axis) and transversal (oriented perpendicular to the earths axis)

Projections can also be subdivided according to their aspect: The direction in which a
cylinder, plane or cone is oriented with respect to the globe. In Figure 4.2 two
possibilities are given: Normal and transverse aspects. For cylindrical projections a
normal aspect is a cylinder that touches the equator. A transverse aspect is a cylinder
that touches the poles. Similarly the normal and transverse aspects of azimuthal
projections can be visualized. The aspect may also be oblique; in that case the
cylinder, plane or cone is not horizontally or vertically oriented, but something in
between.
128

ILWIS 3.0 Users Guide

Spatial data management


Another important way to subdivide map projections is according to their properties.
As mentioned before, a map projection always results in some deformation or
distortion. Depending on the type of projection, these distortions will be different.
This is indicated by the so-called special properties. The most important properties
are:
- Conformality: A conformal map is one in which all angles are indicated correctly.
All angles measured on the earths surface are measured with the same values in
the map. As all angles are maintained, the shape of the objects is also preserved.
- Equivalence: A map with an equivalence property is called an equal-area map.
Although the shape of objects is distorted, the area as measured on the globe is
correctly indicated on the map.
- Equidistance: An equidistant map has the characteristic that along a special set of
lines, distances are equal.
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.

Open the segment map World .


Click the Add Graticule option in the Layers menu. The Display Options Graticule dialog box is opened.

Type 20 for Graticule Distance, accept all other defaults and click OK.
The graticule is now added to the map window, showing parallels and meridians every 20.

In the map window, open the File menu, choose Properties and select the
segment map World . Check the coordinate system on the Segment Map
tab of the Properties sheet.

Close the Properties sheet.

Now the effect of several map projections on the display of the world map will be
demonstrated. For each projection a new coordinate system should be created.

Drag the map window to the side of the screen.


In the Main window, open the File menu and select Create, Coordinate
System. The Create Coordinate System dialog box is opened.
Type for the Coordinate System Name: Centcyl .
Type for the Description: Using the central cylinder projection .
Select CoordSystem Projection and click OK. The Coordinate System
Projection dialog box is opened.

ILWIS 3.0 Users Guide

129

Spatial data management

Click the Projection button.


Select the projection: Central Cylindrical and click OK.

The Coordinate System dialog box now displays more information, relevant for this
projection. The central cylindrical uses the equatorial radius of the earth, since the
cylinder touches the earth at the equator. See Figure 4.2.
The false easting, false northing and central meridian are used to define the X, Y
coordinates of the map. False easting: Overall increase of map x-coordinates
(eastings), indicating the eastward shift of the origin of the projection relative to the
redefined origin (negative if projection origin is west of false origin). False northing:
Overall increase of map y-coordinates (northings), indicating the northward shift of
the origin of the projection relative to the redefined origin (negative if projection
origin is south of false origin). We wont change them now.

Type some positive values for Max X,Y. These coordinates will be adapted
automatically, based on the map displayed in the map window.

Click OK in the Coordinate System dialog box.

Note how the World map and the 20 graticules change.

Drag and drop coordinate system Centcyl to the map window in which the
map World is displayed.
Zoom in on the central part of the world, around the equator.

The map you see is neither conformal nor equal area. It is projected perspectively
from the center of the earth onto a cylinder tangent to the equator (see Figure 4.2).
The equator and other parallels are straight lines (spacing increases towards the poles)
and meet meridians (equally spaced straight lines) at right angles. Parallel spacing
increases towards the poles. The poles cannot be shown. Scale is true along the
equator. Shape, area and scale distortion increases rapidly away from the equator.
This map projection only shows the areas surrounding the equator correctly. All other
areas are too much distorted.

130

Create another coordinate system projection: Lambert_AEA . Select the


projection: Lambert Azimuthal Equal Area .

Type some positive numbers for Max X Y. These coordinates will be adapted
automatically, based on the map displayed in the map window.

Enter for the Sphere Radius: 6356007 and click OK.


Drag and drop coordinate system Lambert_AEA to the map window
displaying the map World .

ILWIS 3.0 Users Guide

Spatial data management


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 1920s (supposedly Airy ellipsoid) and detailed mapping of German states in the
same period; also used for topographic mapping of France in the 18th century.

Central Cylindrical

Map is perspective but neither conformal nor equal area. Projected perspectively from the
center of the earth onto a cylinder tangent to the equator. Only used for teaching purposes.

Eckert I

Pseudo-cylindrical projection. Map has equally spaced parallels and is neither conformal
nor equal area. Used for showing straight line equal-area graticule.

Eckert II

Pseudo-cylindrical projection. Map is equal area. Meridians are equally spaced straight
lines broken at the Equator. Used for showing straight line equal-area graticule.

Eckert III

Pseudo-cylindrical projection. Map has equally spaced parallels and is neither conformal
nor equal area. Used for showing straight line equal-area graticule.

Lambert Cylind
Equal Area

Also called Cylindrical Equal Area. Mainly used for educational purposes.

Mercator

Conformal. Designed for navigational use; standard for marine charts. Recommended use
for conformal mapping of regions predominantly bordering the equator. Often inappropriately used as a world map.

Miller

Compromise between Mercator and other cylindrical projections. Used in numerous world
maps.

Mollweide

Pseudo-cylindrical projection. Map is equal area. Occasionally used in thematic world maps.

Oblique Mercator

Map is conformal. Oblique aspect of Mercator. Used for larger scale mapping in
Switzerland, Madagascar and Borneo, and for atlas maps of regions having a greater
extent in an oblique direction, such as Hawaii.

Plate Carree

Also called Simple Cylindrical or Equidistant cylindrical. Used for raster maps which store
information of the whole world: Each pixel represents a square block of LatLon coordinates, i.e. information is stored per degree, per minute, etc. Used for mapping the earth
taken as a sphere.

Plate Rectangle

Also called EquiRectangular. Variant of Plate Carree. Used for raster maps which store
information of the whole world: Each pixel represents a rectangular block of LatLon coordinates.

Robinson

Pseudo-cylindrical projection for world maps compromising distortion. Map is neither conformal nor equal area. Used for world maps, for example, by Rand McNally in Goodes
Atlas for thematic world maps. Only used in spherical form.

Transverse Mercator

Also called Gauss Conformal, or Gauss Krger. Transverse form of the Mercator Projection
(conformal). Used for many topographic maps at scales from 1: 20000 to 1: 250000.
Recommended for mapping regions that are predominantly north-south in extent.

UTM

Universal Transverse Mercator. Map is conformal. Widely used for topographic maps and
military maps.

Azimuthal

Azimuthal Equidistant Commonly used in the polar aspect for maps of polar regions and the Northern and
Southern hemispheres. The oblique aspect is frequently used for world maps centered on
important cities and occasionally for maps of continents.
Gnomonic

Map is perspective and neither conformal nor equal area. It is used to show great circle
paths as straight lines and thus to assist navigators and aviators.

Hammer Aitoff

Hammer Aitoff Equal Area, variant of Lambert Azimuthal Equal Area.

Lambert Azimuthal
Equal Area

Used for maps of continents and hemispheres. Also suited for regions extending equally in
all directions from a center point, such as Asia and the Pacific Ocean.

Orthographic

Known by Egyptians and Greeks 2000 years ago. Map is perspective and neither conformal nor equal area. Only one hemisphere can be shown. The earth appears as it would on
a photograph from space.

ILWIS 3.0 Users Guide

131

Spatial data management


Table 4.2

continued:

Projection

Remarks

Stereographic

Apparently invented by Hipparchus (2nd century bc). Used in combination with UTM projection as Universal Polar Stereographic (UPS) for mapping poles and in navigation charts for
latitudes above 80. Recommended for conformal mapping of regions that are approximately circular in shape. For example, used for topographic maps of the Netherlands.

UPS

Universal Polar Stereographic. Azimuthal and perspective projection. Map is conformal.


Used in combination with UTM projection as Universal Polar Stereographic (UPS) in Arctic
and Antarctic maps and in navigation charts for latitudes above 80.

Conical

Albers Equal Area


Conic

If the pole is one of the standard parallels, it is equal to Lamberts Equal Area Conic.
Frequently used for maps of the United States, for thematic maps and for world atlases.
Recommended for equal area maps of regions that are mainly east-west in extent.

Bonne

Pseudo-conic projection. Map is equal area. Frequently used until mid-20th century for atlas
maps of continents and for topographic mapping of some countries.

Equidistant Conic

Also called Simple Conic. The most common projection in atlases for small countries.

Lambert Conformal
Conic

Lambert Conformal Conic/Conical Orthomorphic (Lambert, 1972) (conformal). Extensively


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 1950s.

Other projections

Dutch RD

Dutch topographic map projection. Map is conformal. The stereographic projection of the
Netherlands is a so-called double projection. The datum Rijksdriehoeksmeting, which
implies the Bessel 1841 ellipsoid, will be used automatically.

Gauss-Boaga (Italy)

Country projection. Transverse Mercator used in topographic maps of Italy.

Gauss (Colombia)

Country projection. Transverse Mercator used in topographic maps of Colombia.

Gauss-Krger
(Germany)

Country projection. Transverse Mercator used in topographic maps of Germany.

General Perspective

Shows the earth as seen from space. Projection is perspective.

Lambert Conformal
Conic (France)

Country projection. Lambert conformal conic projection used in topographic maps of


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.

132

Open coordinate system: Lambert_AEA .


Enter for the Central Meridian: 60 00 00 W and for the Central
Parallel: 20 00 00 N and click OK.
Press the Redraw button in the map window.

ILWIS 3.0 Users Guide

Spatial data management


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 the effect of a conical projection will be demonstrated.

Create another coordinate system: Lambert_CC . Select the projection:


Lambert Conformal Conic .

Type some positive numbers for Max X, Y, enter for the Sphere Radius:
6356007 and click OK.

Drag and drop coordinate system Lambert_CC to the map window displaying the map World and zoom in on the centre of the map.

Now only the area surrounding the North Pole is displayed, in a very distorted way.

Open coordinate system: Lambert_CC .


Enter for the Central Meridian: 20 00 00 W.
Enter for the Central Parallel: 50 00 00 S.
Enter for the Standard Parallel 1: 40 00 00 S.
Enter for the Standard Parallel 2: 60 00 00 S.
Click OK and press the Redraw button in the map window.

The Southern Hemisphere is now shown in a conical projection.


Some projections will also be shown that are useful for displaying world maps.

Create another coordinate system: Orthographic . Select the projection:


Orthographic .

Type some positive numbers for Max X, Y, enter for the Sphere Radius:
6356007 and click OK.

Drag and drop coordinate system Orthographic to the map window displaying the map World .

The world map is now displayed as if you look at the earth from space.

Open coordinate system: Orthographic .


Enter for the Central Meridian: 90 00 00 E.
Enter for the Central Parallel: 30 00 00 N.
Click OK and press the Redraw button in the map window.

You will now see the continent of Asia.


ILWIS 3.0 Users Guide

133

Spatial data management

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 .

Click OK. The map is displayed.

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.
Add a graticule to the map window and look at the effect.
Close the map window when you are finished.

The UTM projection


There is one map projection that will be treated in more detail, which is the
projection used most in GIS and image processing for relatively small study areas.
The Universal Transverse Mercator (UTM) projection system was developed in the
late 1940s by the US Army. Since then, it has become a standard in topographic
mapping. The UTM comprises the following features:
- The projection is the Gauss- Krger version of the Transverse Mercator.
- The projection is only intended for mapping between 84 N and 80 S. Beyond that
there is too much distortion.
- The unit of measure is the meter.
- The world is divided into 60 zones of 6 of longitude in width. Zone 1 has its
western edge at the 180 meridian. Zone 60 has its eastern edge on the same
meridian. Consequently the zones are numbered from west to east. The zones are
shown in Figure 4.3. Cochabamba is located 66 08 52 W in longitude, and 17
23 30 S in latitude. So it is located on the boundary between UTM zones 19 and
20.
- A second zoning is made along the latitudes following 8 intervals (except for the
most northern zone that has an interval of 12). These zones have a better designation
from south to north (see Figure 4.3). So Cochabamba is located in zone 19K.
134

ILWIS 3.0 Users Guide

Spatial data management


- 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:
ILWIS 3.0 Users Guide

135

Spatial data management


-

Ellipsoid: International.
Projection: Transverse Mercator.
Vertical Datum: Sea level.
Horizontal datum: Provisional South America 1956.
UTM zone: 19 K.

Open the coordinate system: Cochabamba .

Click the Datum button and select the Datum: Provisional South
America 1956 , select the Area: Bolivia and click OK.

Clear the check box Northern Hemisphere.

Click the Ellipsoid button and select the Ellipsoid: International 1924
and click OK.

Enter for the (UTM) Zone: 19 and click OK in the Coordinate System
Projection dialog box.

Suppose you want to convert data from the Cochabamba area from UTM zone 20 to
UTM zone 19. To illustrate the transformations you first create a coordinate system
for the adjacent UTM zone 20.

Open the File menu in the Main window and select Create, Coordinate
System. The Create Coordinate System dialog box is opened.

In the Create Coordinate System dialog box type Cocha20 for the
Coordinate System Name, select the option CoordSystem Projection
and click OK. The Coordinate System Projection dialog box appears.

Enter some positive values for Max X, Y and click the Projection button.

Click the Ellipsoid button, select the Ellipsoid: International 1924 and
click OK in the Select Ellipsoid dialog box.

Click the Datum button and select the Datum: Provisional South
America 1956 , the Area: Bolivia and click OK.

Clear the check box Northern Hemisphere.

In the Select Projection dialog box, select the Projection: UTM and click
OK.

Enter for the UTM Zone: 20 and click OK in the Coordinate System
Projection dialog box.

Now that a new coordinate system is made for UTM zone 20, you can link this
coordinate system to the maps digitized in that projection.
Checking coordinate transformation
Before making a coordinate transformation, it is wise to check the transformation for a
few coordinate pairs. This can be done with the Transform Coordinates dialog box.
136

ILWIS 3.0 Users Guide

Spatial data management


The following steps have to be done:
- Select a certain point on one of the paper maps and note its X and Y coordinates.
- Determine this point on the other paper map and note its X and Y coordinates.
- Enter one of the coordinate pairs in the ILWIS Transform Coordinates dialog box
as the following:

Double-click the Transform Coordinates operation in the Operation-list.


The Transform Coordinate dialog box is opened.

The options in this box can be used to check whether the transformation is correct. It
allows you to select an input and output coordinate system, to type the X and Y
coordinates of a point to be transformed and to interactively view the output
coordinates for the selected point.

Figure 4.4:

The corner of the topomap of sheet Cochabamba indicated the grid in UTM 19
coordinates, the tickmarks in UTM 20 coordinates and the upper left corner in geographic coordinates.

First you will check whether the conversion from latitude/longitude to metric
coordinates of a certain UTM zone is correct.

Select the Input Coordinate System Latlon .

Select the Output Coordinate System Cochabamba in the list box Output
Coordinate System.

Check the metric coordinates of UTM zone 19 with those in the map in
Figure 4.4. Write them down.

Type the latitude and longitude as indicated in the corner of the map in
Figure 4.4.

ILWIS 3.0 Users Guide

137

Spatial data management

Select the coordinate system Cocha20 list box Output Coordinate


System.

Check the metric coordinates of UTM zone 20 with those in the map in
Figure 4.4 and write them down.

Now you will check if the conversion of coordinates from UTM zone 20 to 19 is
done correctly.

In the Transform Coordinates dialog box select the Input Coordinate


System Cocha20 .

Type the X and Y values that have been noted down for the conversion from
Latlon to UTM 20 .

Select the coordinate system Cochabamba in the list box Output


Coordinate System.

Check the metric coordinates of UTM zone 19 with those that you have written down for UTM 19.

Close the Transform Coordinates dialog box.

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.

Compare the boundaries of the city polygon and segments.

Display segment map City19 . This map has coordinates in UTM 19.
Drag-and-drop polygon map City20 into the map window displaying
City19 .

Now the actual transformation can be done.


138

ILWIS 3.0 Users Guide

Spatial data management

Close both map windows.

Select the map City20 in the list box Polygon Map.

Accept the defaults by clicking the OK button. Polygon map City19 is displayed.

Compare the input polygon map City20 with the transformed output polygon map City19 .

Check the result by adding segment map City19 to the map window and
zoom in where the lines are doubled.

Add gridlines every 1000 meters (in Blue ), and a graticule (in Green )
every 5 minutes.

Close the map window when you have finished the exercise.

Double-click Transform Polygons in the Operation-list. The Transform


Polygon Map dialog box is opened.
Select Cochabamba in the list box Coordinate System.
Type City19 in the text box Output Polygon Map and click Show. The
Display Options - Polygon Map dialog box is opened.

Summary: Map projections


- After importing vector maps, their coordinates may not be the ones that you use for
your other maps. In that case you will need to transform the coordinate system. The
most important reason that coordinates may be different (apart from the fact that a
local coordinate system may have been used) is that the original maps had different
projections.
- A map projection defines the relationship between the map coordinates and the
geographic coordinates latitude and longitude.
- Projections are classified according to their class (cylindrical, azimuthal, conical),
their aspect (normal, transverse) and their properties (conformality, equivalence,
equidistance).
- The Universal Transverse Mercator (UTM) projection system, is the projection
used most in GIS and image processing, for relative small study areas. In this
projection the world is divided into 60 zones of 6 of longitude in width.
- Before making a coordinate transformation, it is wise to check the transformation
for a few coordinate pairs. This can be done with the Transform Coordinates
dialog box.
- After checking that the transformation of some known points in two maps with
different projections is done correctly, you can do the actual transformation.

ILWIS 3.0 Users Guide

139

Spatial data management

4.3 Vector data management


A vector map can be obtained either via digitizing a paper map, as was explained in
chapter 3, or from importing digital vector data, as was shown in section 4.1. A
number of tools are available to adapt vector maps for the analysis. In order to be able
to use vector maps of the same area together, all maps should have the same
coordinate system. In the previous section, the transformation from one coordinate
system to another was explained. In this section, a number of tools for further
manipulating vector maps will be shown such as the creation of a sub map,
combining two or more vector maps into one map, copying selected information from
a vector map using a mask, densifying coordinates, or thinning them using tunneling,
editing vector maps, and the conversion from one type to another. The change of the
domain type of the map will be explained in section 4.6.
Creating a sub map
The sub map operation makes it possible to select a rectangular part in a vector map
and save it as a new map. The user has to specify minimum and maximum XYcoordinates for the new segment map. The output segment map can be smaller than
the input map, but it can also be larger.
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 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.

Type 797200 for minimum X and 8078200 for minimum Y in the text box
Min X, Y.

Compare the Drainsub map with the map Drainage and close both map
windows when you have finished the exercise.

Glueing segment maps


This operation merges two or more segment maps of the same coordinate system and
domain together. By default, it copies all segments of the input maps into the output
map, unless a mask to select specific segment codes is specified. The operation also
140

ILWIS 3.0 Users Guide

Spatial data management


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.

ILWIS 3.0 Users Guide

141

Spatial data management


Masking vector data
This operation allows to selectively copy points, segments, or polygons into a vector
map, by specifying a mask, which lists the names and/or codes that are to be copied.
A mask contains one or more search strings, separated by a comma (spaces before or
after a comma make no difference). Asterisks can be used as a wild card for zero or
more characters (e.g. grass* , forest* or 1* , 2* ). Also question marks may be
used to replace only one character (e.g. the mask ??00 or *00 in a contour map). For
more information, open the ILWIS Help, search for Mask, and open the help topic
How to use masks. See also chapter 7, in which more examples of data retrieval
with a mask will be given.
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.

Click Show. The Display Options - Segment Map dialog box is opened.

Type Grid19 in the text box Mask and in the text box Output Segment
Map.
Accept the defaults by clicking the OK button in this dialog box. Now only
the grid lines are shown.
Close the map window when you have finished the exercise.

Densify segment coordinates


The operation Densify Segment Coordinates adds extra intermediate coordinates
within segments of an input map, at a user-specified distance, and copies them to an
output segment map. It is advised to use this operation during the Transform
Segments. The segment map Grid19 , which was created in the previous exercise,
will be used as an example. This map contains gridlines, digitized for the
Cochabamba area. Each gridline in the input map is defined by a starting and ending
coordinate.

142

ILWIS 3.0 Users Guide

Spatial data management

Double-click Densify Segment Coordinates in the Operation-list. The


Densify Segment Coordinates dialog box is opened.

Select the map Grid19 in the list box Segment Map.


Type 200 in the text box Distance. An intermediate coordinate will be
added every 200 meters.

Type Grid19new in the text box Output Segment Map and click Show.
The Display Options - Segment Map dialog box is opened.

Accept the defaults by clicking the OK button in this dialog box. The map is
now displayed. Apparently there is no difference.

Close the map window.

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.

Break the dependencies of the maps Grid19 and Grid19new by clicking


the Break Dependency Link button on the Dependency tab of the
Properties sheet.

In the Catalog click the map Grid19 with the right mouse button and select
Edit from the Context-sensitive menu. The Segment editor is opened.

Zoom in on a part of the map and select the Move Point Mode. As you can
see each gridline only has a starting and ending point. Close the Segment
editor.

Click the map Grid19new with the right mouse button and select Edit from
the Context-sensitive menu. The Segment editor is opened.

Zoom in on a part of the map and select the Move point mode. As you can
see there are now intermediate coordinates at regularly spaced intervals of
200 meter.

Close the Segment editor and the map windows when you have finished the
exercise.

Tunnel segments
This is more or less the opposite of the densify coordinate operations. The aim of this
operation, is to reduce the number of intermediate points and remove superfluous
nodes within segments of the input map. This operation can also be used when you
want to generalize your maps. The principle of tunneling was explained in chapter 3.

ILWIS 3.0 Users Guide

143

Spatial data management

Double-click Tunnel Segments in the Operation-list. The Tunnel


Segments dialog box is opened.

Select the map Drainage in the list box Segment Map.


Type 20 (meter) in the text box Tunnel Width.
Type Draintun20 in the text box Output Segment Map and click Show.
The Display Options - Segment Map dialog box is opened.

Accept the defaults by clicking the OK button in this dialog box.

Compare the results by displaying the maps Draintun20 , Draintun50


and Draintun100 in the same map window, and zooming in on a part of
the map.

Close the map windows when you have finished the exercise.

Repeat the exercise twice: once with a Tunnel Width of 50 meters (Output
Segment map Draintun50 ), and the other with a Tunnel Width of 100
meters (Output Segment map Draintun100 ).

In ILWIS several other vector operations are possible. An overview is given in table
4.3. For more information see also the ILWIS Help topic Vector operations.
Table 4.3: Overview of vector operations in ILWIS.
Operation

Point

Segment

Polygon

Attribute map

Attribute Map of
Point Map
Mask Points
SubMap of
Point Map
Glue Point Maps
-

Attribute Map of
Segment Map
Mask Segments
Labels to Segments
SubMap of
Segment Map
Glue Segment Maps
Densify Segment
Coordinates
Transform Segments
Tunnel Segments

Attribute Map of
Polygon Map
Mask Polygons
Labels to Polygons
-

Mask
Assign labels
Sub map
Glue map
Densify coordinates
Transform
Tunnel

Transform Points
-

Transform Polygons
-

Creating a polygon map from a segment map


In some cases you may have a segment map from which you want to generate a
polygon map. This may be the case if you have imported a polygon map from
Arc/Info E00 format. The import results in a segment map and a point map,
containing polygon labels.
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
144

ILWIS 3.0 Users Guide

Spatial data management


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.

Double-click Segment to Polygon in the Operation-list. The Polygonize


Segment Map dialog box is opened.

Select segment map Landunit in the list box Segment Map.

Click the Show button. After creating the polygon map, the Display
Options - Polygon Map dialog box is opened.

Click OK to display the map.

Clear the Mask, Topology and Auto Correction check boxes.


Select the option Unique Identifiers and type Landunit in the text box
Output Polygon Map.

Check the meaning of the polygons by clicking them.


Close the map window when you have finished the exercise.

The resulting polygon map uses system domain unique ID, indicating the different
polygons as Pol 1, Pol 2, etc. If you want to change these IDs, create an attribute
table for the map, create in the table an attribute column with correct (class) names
and create an attribute map.
A better option would be to polygonize the map using label points. The label points
can be generated from another polygon map using the Polygon to Point operation,
or digitized as a point map. In this case a label point map was already made (point
map Landunit ).

Double-click the Segment to Polygon operation in the Operation-list. The


Polygonize Segment Map dialog box is opened.

Select segment map Landunit in the list box Segment Map.

Type for Output Polygon Map: Landunit2 and click the Show button.

Make sure the Label Point check box is selected and use the point map
Landunit as Label Points.

ILWIS 3.0 Users Guide

145

Spatial data management

The polygon map Landunit2 is created and the Display Options


Polygon Map dialog box is opened.

Click OK in the Display Options Polygon Map dialog box. The polygon
map Landunit2 now contains the correct names.

Close the map window when you have finished the exercise.

Creating a segment map from a polygon map


The extract boundaries operation creates a new segment map out of a polygon map,
containing all polygon boundaries. The input map for this operation is a polygon map
with any domain type. The output map resulting from the conversion is a segment
map with an internal class domain. The class name of a segment in the output map, is
the combination of the name of the neighbouring polygons. For example, the
boundary between two polygons with the class name Lake and Mountain is
codified in the output segment map as Lake|Mountain .
In this exercise the polygon map Landuse is converted to a segment map.

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 selected all segments get the name: Segments .

Type Landuse_bound in the text box Output Segment Map and click
Show. After creating the segment map the Display Options Segment
Map dialog box is opened.

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.
Table 4.4:
Data type

Overview of data conversions in ILWIS.


to Point

to Segment

to Polygon

to Table

Open as Table
from Segment Segment to Point
Segment to Polygon
from Polygon Polygon to Point Polygon to Segment
from Table
Table to Point
from Point

146

ILWIS 3.0 Users Guide

Spatial data management


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.
Summary: Vector data management
The following tools can be used to manage vector data:
- Creating a sub map of a vector map and merging two or more vector maps.
- Selectively copying vector data using a mask.
- Obtain more intermediate coordinates within segments in a segment map using the
Densify Segment Coordinates operation.
- Tunneling reduces the amount of coordinate data stored in a segment map.
- Creating a segment map from a polygon map.
- Assigning labels to segments or polygons.
- Creating an attribute map.
- Glueing of maps.
- Transforming the coordinates of a map into another coordinate system.
- Conversion of one vector data type into another.

ILWIS 3.0 Users Guide

147

Spatial data management

4.4 Vector to Raster conversion


As has been mentioned already in chapter 1, most of the analyses in ILWIS are based
on raster data. Therefore, conversion from vector to raster format (rasterization) is
often a necessary step preceding the analysis. Points, segments and polygons are
represented by grid cells (pixels) in the raster data structure. In order to convert a
map from vector into raster format, a mesh with pre-defined cell size, is laid over the
map. The size of the grid cells is a crucial aspect of the raster data structure.
Before starting the rasterization, a georeference should be created. A georeference
contains the minimum and maximum X and Y coordinates of the raster map, the
number of rows and columns and the pixel size. When rasterizing various maps of the
same area, it is preferred to select the same georeference for them.
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.

Rasterization of a polygon map


The Polygon to Raster operation, creates a raster map from a polygon map. In this
exercise the polygon map Landuse will be rasterized.

148

Double-click the Polygon to Raster item in the Operation-list. The


Rasterize Polygon Map dialog box is opened.

Select polygon map Landuse in the list box Polygon Map and type

ILWIS 3.0 Users Guide

Spatial data management

for the Output Raster Map: Land10 .

Select GeoReference: Cocha10 , type Raster map showing land use


in the text box Description and click the Show button in the Rasterize
Polygon Map dialog box. The Display Options - Raster Map dialog box
is opened.

Accept the defaults by clicking the OK button of this dialog box. The raster
map Land10 is displayed.

Repeat the procedure, and create raster map Land25 with georeference
Cocha25 , and raster map Land100 with georeference Cocha100 .

Zoom in on the same part of the map in the three map windows. Drag-anddrop polygon map Landuse to each of the three map windows. Display only
the boundary lines.

Compare the three maps and evaluate the effect of different pixel sizes and
close all map windows when finished.

In ILWIS, two other rasterization operations are available, i.e. Point Density and
Segment Density. For each output pixel the total number of points respectively the
total length of segments is calculated. For more information, see the ILWIS Help
topic Rasterize.
Summary: Vector to Raster conversion
- Conversion from vector to raster format (rasterization) is often a necessary step
preceding data analysis.
- Points, segments and polygons are represented by grid cells (pixels) in the raster
data structure.
- In order to convert a map from vector into raster format, a mesh with pre-defined
cell size is positioned over the map. The size of the grid cells is a crucial aspect of
the raster data structure.
- Before starting the rasterization, a georeference should be created. A georeference
contains the minimum and maximum X and Y coordinates of the raster map, the
number of rows and columns and the pixel size.

ILWIS 3.0 Users Guide

149

Spatial data management

4.5 Raster data management


A raster map can be obtained either via rasterizing a vector map, as was explained in
the previous exercise, or from importing raster data, as was shown in section 4.1. A
number of tools are available to adapt raster maps for the analysis. In order to be able
to use raster maps of the same area together, all maps should have the same pixel
size, and the same number of rows and columns. In this section a number of tools for
manipulating raster maps will be shown, such as the creation of a sub map,
combining two raster maps into one map, mirroring and rotating maps, resampling
maps, editing raster maps, and the conversion from raster to vector.
Creating a sub map of a raster map
The sub map operation allows you to specify a rectangular part of a raster map and
copy it into a new raster map. You can specify corners either in row and column
numbers or in XY-coordinates. A raster map with any type of domain can be used as
input. The output map uses the same domain as the input map. The operation
automatically creates a new georeference for the output map. This operation is very
useful for creating subscenes from an entire frame of a satellite image, only covering
the area of interest.
In this exercise, a selected window of a hillshading map of a part of South America
(Hillshad ) will be saved as a new raster map (Hillshad_sub ). We also have a
map Bolivia_mask , containing only the country of Bolivia. From this image the
area that has to be extracted can be found.

Open the map Bolivia_mask , and find out the area that should be extracted (expressed in first line, first column, nr. of lines, nr. of columns).

Close the map window and double-click the SubMap of Raster Map operation in the Operation-list. The Sub Map of Raster Map dialog box is
opened.

Select raster map Hillshad in the list box Input Raster Map.

Type for Output Raster Map: Hillshad_sub and click the Show button.
The map is created and the Display Options Raster Map dialog box is
opened.

Click OK in the Display Options - Raster Map dialog box and close the
map window after you have seen the result.

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.

You can use the same method to extract the same area from the map Bolivia_mask ,
and then create a final map only showing the hillshading for the country of Bolivia.
150

ILWIS 3.0 Users Guide

Spatial data management


Glueing raster maps
The Glue Raster Maps operation merges two or more georeferenced raster maps.
The input maps should have a georeference and a domain which can be merged. The
input maps can have different georeferences, coordinate systems and pixel size. In the
case of different georeferences, the output map will use the georeference of the first
input map. If needed, the second, third etc. input map will then first be resampled to
the georeference of the first input map. If the georeferences of the input maps have
different coordinate systems, the coordinate system of the second, third etc. input
map will be transformed into the coordinate system of the first input map. In the
resampling process, the size of the pixels in the second, third etc. input map will be
adjusted to the size of the pixels in the first input map, if they are different.
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:

unique ID
ID
class
value
bool
image
color
picture
bit

Possible combinations of domains of input raster maps and the resulting domain of
the output raster map.
unique ID

ID

class

value

bool

image

color

picture

bit

unique ID
ID
ID
-

ID
ID
ID
-

ID
ID
class
color
class
color
color
color
color

color
value
value
value
color
color
value

class
value
bool
value
color
color
bool

color
value
value
image
color
color
value

color
color
color
color
color
color
color

color
color
color
color
color
color
color

color
value
bool
value
color
color
bit

In this exercise two parts of a TM image, one covering the northern (Tmb1_north )
and the other covering the southern part (Tmb1_south ) of the study area, are glued
together. Both maps have the image domain.

Double-click the Glue Raster Maps operation in the Operation-list. The


Glue Raster Maps dialog box is opened.

Select raster map Tmb1_north in the list box 1st Map.

ILWIS 3.0 Users Guide

151

Spatial data management

Select raster map Tmb1_south in the list box 2nd Map.


Type Tmb1_combined in the text box Output Raster Map.
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. The map is
shown.

Display also the raster maps Tmb1_north en Tmb1_south and close the
map windows when you have finished the exercise.

If you select the Last Map on Top check box, the values of the pixels defining the
overlap are taken from the second input map. Clear this check box if these values
should be taken from the first input map.
Mirror rotate
The Mirror Rotate operation allows you to mirror a raster map in a horizontal,
vertical, or diagonal line, to transpose (switch) the maps rows and columns, or to
rotate a raster map 90, 180, 270 (clock-wise). There are no special requirements
for the input map. The output raster map uses the same domain as the input raster
map. The operation creates a new georeference for the output map which obtains the
same name as the output map. The new georeference depends on the georeference of
the input map. This operation may be needed if you get an input raster map from
another source, which is rotated or mirrored. For example, when you use a scanned
image and the image was not properly oriented on the scanner. As an example there is
a 3D view, which is upside down.

Display the map View3D and close the map window again.

Select raster map View3D in the list box Raster Map and select the option
Mirror Horizontal.

Type View3D_ok in the text box Output Raster Map.

152

Double-click Mirror Rotate in the Operation-list. The Mirror Rotate dialog box is opened.

Click Show. The map View3D_ok is created


Click OK in the Display Options - Raster Map dialog box. The map is displayed now in the correct form.
Close the map window when you have finished the exercise.

ILWIS 3.0 Users Guide

Spatial data management


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.

Open raster map Geology .

Type for the GeoReference Name: Geology .

From the Edit menu in the GeoReference Tiepoints editor select Add Tie
in the Toolbar of the editor.
Point or press the Add Tie Point button
The Add Tiepoint dialog box is opened.

Type the Row , Column , X and Y coordinates for the first point as shown in
Table 4.6.

Repeat this for the other 9 tiepoints. The transformation should display
Affine, and the Sigma (the error) should be lower than 1.

Close the GeoReference Tiepoints editor by clicking the Exit Editor button
. Raster map Geology is now georeferenced.

Close the map window.

From the File menu of the map window select Create, GeoReference. The
Create GeoReference dialog box is opened.
Accept the default option GeoRef Tiepoints.
Select the Coordinate System: Cochabamba and click OK. The
GeoReference Tiepoints editor is opened.

If a digital table with tiepoint data is available, you can also use Copy and Paste
to insert your data in the Georeference Tiepoints editor.

ILWIS 3.0 Users Guide

153

Spatial data management


Table 4.6:

Tiepoint locations for the raster map Geology.

Row

Column

797955
804195
804915
797415
800078
802343
800835
796455
796050
802973

8088615
8087085
8080185
8080335
8083830
8081985
8073450
8072865
8083628
8089080

127
229
689
679
446
569
1138
1177
460
96

165
581
629
129
306
457
357
65
38
499

Now that the raster map Geology is georeferenced, you can resample it to another
raster map, for example Landuse , which uses the georeference Cochabamba .

Double-click Resample in the Operation-list. The Resample Raster Map


dialog box is opened.

Select raster map Geology in the list box Input Raster Map.

Click OK in the Display Options - Raster Map dialog box. The map which
is now displayed has the same pixel size and the same number of rows and
columns as the raster map Landuse .

Close the map window when you have finished the exercise.

Type for Output Raster Map: Geolout .


Select the GeoReference: Cochabamba make sure the resampling method
Nearest Neighbour is selected and click the Show button. The map
Geolout is calculated.

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 .

Editing raster maps


Maps may contain errors, which are introduced during digitizing, or which are in the
original imported data coming from other packages. Maps also need to be updated
when changes have occurred in an area, for example when the land use has changed.
In those situations you will need to edit the maps. When you use the Pixel editor you
can change the value, IDs or class name of pixels in a raster map. In the Pixel editor,
only the mouse pointer can be used, not the digitizer cursor.

154

ILWIS 3.0 Users Guide

Spatial data management


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 maps Properties
sheet or you should break the dependency. To edit a read only map, clear the ReadOnly 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.

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.

Select with the left mouse button a part of the letter E which is surrounded
by green pixels by dragging a box.

To see the result press the Redraw button in the Toolbar of the Pixel editor.

In the Pixel editor, you can select one or more pixels by clicking them or dragging a
box around them, in order to change their class name, ID, or value. You can add
pixels to a selection, clear a part of a selection or toggle between select and deselect
pixels.
- To add pixels to a selection:
Press and hold the CTRL key and click the other pixels you want to select.
- To clear a part of a selection:
Press and hold the CTRL+SHIFT keys, then click previously selected pixels or
drag a box around them.

ILWIS 3.0 Users Guide

155

Spatial data management


- To toggle between selecting and deselecting pixels:
Press and hold the SHIFT key, then click pixels or drag a box around pixels
(selected pixels are deselected and non-selected pixels are selected).

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.

Raster to Vector conversion


Sometimes it can be necessary to convert raster maps back to vector maps. This can
be the case if you obtain a thematic raster map by importing a digital file from other
sources. If you want to edit the map extensively, it is better not to do that with the
Pixel editor. It is best to convert the raster map to polygons first, then extract
segments and create labels, and do the editing in the Segment editor, after which
you polygonize and rasterize the map again. It may also be useful to convert raster
maps back to vector maps if you want to use them for high quality map production.
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.

Double-click the Raster to Polygon operation in the Operation-list. The


Polygons of Raster Map dialog box is opened.

Select raster map Slopeclass in the list box Raster Map.

156

Accept the defaults for connectivity and smoothing.


Type Slopeclass in the text box Output Polygon Map, type Polygon
map slope classes in the text box Description and click Show. The calculation will take some time. After that the Display Options - Polygon
Map is opened.
Accept the defaults by clicking the OK button. The polygon map is shown.
Close the map window when you have finished the exercise.

ILWIS 3.0 Users Guide

Spatial data management


Now you will see the effect of converting a raster map to segments. When you convert 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.

Click the Show button. The segment map Slopeseg is calculated and the
Display Options - Segment Map is opened.

In the Display Options Segment Map dialog box, select the Info check
box and click OK.

Find out the class names of the segments via the attribute table Slopeseg
and close the map window when you have finished the exercise.

Type Slopeseg in the text box Output Segment Map and type Segment
map slope class in the text box Description.

ILWIS 3.0 Users Guide

157

Spatial data management


Summary: Raster data management
The following tools can be used for raster data management:
- Copying a rectangular part of a raster map into a new raster map, using the
SubMap of Raster Map operation.
- Merge raster maps (Glue Raster Maps operation).
- Mirror, transpose or rotate a raster map (Mirror Rotate operation).
- Resampling a raster map to another georeference (Resample operation).
- Editing a raster map using the Pixel editor.
- Converting a raster map to a point, segment or polygon map (Raster to Point,
Raster to Segment, Raster to Polygon operations).

158

ILWIS 3.0 Users Guide

Spatial data management

4.6 Domain conversion


In the previous exercise, especially during the exercise dealing with import, you have
seen that in ILWIS your map may have another domain than you would like.
Sometimes the domain of a map should be changed, e.g., converting a domain value
to a domain class. In this exercise the various methods for domain conversion are
treated.
A warning about changing domains
Apparently the easiest solution for changing the domain type would be to simply
change the domain in the Properties sheet of the map. This should be done with
care! This method is only recommended for converting between domains of the same
type (e.g. for converting a class domain Landuse to a class domain Landuse1 ). You
should make sure, however, that the two domains have the same ordering of the raw
values. If the ordering is different, than the names in the map will be mixed after
changing the domain.
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.
Conversion between an ID domain and a class domain
Class domains and identifier domains are not so different. It is, therefore, easy to
convert from one type to the other. The conversion from a class domain to an
identifier domain can be done by clicking the button Convert to classes in the
Properties sheet of an ID domain. The conversion from a class domain to an
identifier domain can be done by clicking the button Convert to identifiers in the
Properties sheet of the class domain.
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.

ILWIS 3.0 Users Guide

159

Spatial data management


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.

Double-click Unique ID in the Operation-list. The Unique ID dialog box is


opened.

Select polygon map Landuse in the list box Input Map.

Click OK to display the map and click the polygons in the map window to
view the IDs.

Open the table Landid to view the original class name of the polygons and
the assigned ID.

Close the map window and the table when you have finished the exercise.

Type Landid in the text box Output Map.


Click the Show button. The map Landid is made and the Display Options
Polygon Map dialog box is opened.

The Unique ID operation can only be performed on vector maps. The equivalent
operation for raster maps is called Area Numbering, which will be treated in
Chapter 9.
Converting a class or an ID domain to a value domain
The conversion from a class or an identifier domain to a value domain, can best be
done by creating an attribute map from a value column of the maps attribute table.
Take for example the map Cityblock , which is a map using an identifier domain,
in which each building block of the city of Cochabamba has a separate code. Linked
to that map is an attribute table Cityblock which contains, amongst others,
information on the number of persons living in each cityblock (column
Population ).

160

Open the polygon map Cityblock and double-click some units to find out
the information from the attribute table Cityblock .

ILWIS 3.0 Users Guide

Spatial data management


In this case the conversion from identifier to value only makes sense when you want
to create for example a population map.

Close polygon map Cityblock .


In the Catalog click polygon map Cityblock with the right mouse button
and select Vector Operations, Attribute Map in the context-sensitive
menu. The Attribute Map of Polygon Map dialog box is opened.

Select the Attribute: Population and type for Output Polygon map:
Population .

Click Show. The map Population is created and the Display Options dialog box opened.

Click OK to display the map.

Close the map window and the Properties sheet.

The map Population is a value map. Check this by looking at the


Properties sheet of the map Population or by clicking some units in the
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.
Converting a value domain to a class or an ID domain
The conversion from a value or an image domain to a class domain may sometimes be
necessary. For example, when you have imported a scanned thematic map as a gray
scale TIF file. When you want to convert from a value map to a class map, you should
know the names of the legend units that should be assigned to the different values.
For the conversion from a value map to a class or ID map, there are two possibilities:
- When you have a value map that has values with a precision other than 1, you
should create a group domain (in which the boundary values and the class names
are indicated) and use the Slicing operation as described in chapter 7. An example
of this is the classification of a Digital Elevation Model into a classified altitude
map.
- When you have a value map that has values with a precision of 1, which actually
display thematic information instead of measured data, the procedure is as follows:
1. Create an ID domain with a sufficient number of items.
2. Change the domain from value to the ID domain in the Properties sheet of the
map.
3. Edit the domain while keeping the map open.
4. Convert the IDs to classes if necessary.
This is illustrated with a map that was imported as if it had an image domain. It is,
however, not an image but a class map with information on land use types.
ILWIS 3.0 Users Guide

161

Spatial data management


Table 4.7:
ID

nr
nr
nr
nr
nr
nr
nr
nr
nr
nr
nr
nr

162

Relation ID and Class names.


Class name

1
2
3
4
5
6
7
8
9
10
11
12

Agriculture
Agriculture (irrigated)
Airport
Bare rock
Bare soils
Forest
Grassland
Lake
Riverbed
Shrubs
Urban centre
Urban periphery

Open the raster map Landimage and click some pixels in the map. As you
can see the map displays numbers instead of class names.

Close the map window and select Create, Domain from the File menu in
the Main window. The Create Domain dialog box is opened.

Type for the Domain Name: Luse . Select the option Identifier, and type for
the Nr of items: 12 .

Accept the default Prefix and click OK. The Domain Identifier editor is
opened. No changes will be made now.

Close the Domain Identifier editor and open the Properties sheet of map
Landimage .

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.

ILWIS 3.0 Users Guide

Spatial data management


Converting a picture domain to a class domain
The conversion from a picture domain to a class domain, can be done by clicking the
button Convert to Classes in the Properties sheet of the domain. If you want to
convert a picture domain to an identifier domain, you first convert the picture domain
to classes and then press the button Convert to Identifiers in the Properties sheet
of the class domain.
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.

Double-click raster map Landpicture . In the Display Options Raster


Map dialog box select the check box Info and click OK.

Click some pixels in the map. As you can see the map displays a combination
of Red, Green and Blue instead of class names.

Close the map window and open the Properties sheet of the domain
Landpicture .

On the Properties sheet, press the button Convert to Classes.

Change all the domain items and replace them by the land use type according
to Table 4.7. Deleting the domain items that are not used is not necessary.
Close the Domain Class editor.

Now you can edit the representation and the conversion from picture to
classes is ready.

Close the map window.

Open the map Landpicture and the domain Landpicture . Click a unit
to find out its class name.

Converting a picture domain to an image domain


The conversion from a map with a picture domain to an image (or value) domain may
sometimes be necessary. For example, the import of TIF color files or BMP files
results in a picture domain for the output map, while in fact it should be value (in the
case of a slope map for example), or image (in the case of a satellite image). So the
conversion from picture to value, or to image, may happen quite often.
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

ILWIS 3.0 Users Guide

163

Spatial data management


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.

Close the map window when you have finished the exercise.

Open raster map Hillshad again. From the Display Options Raster
Map dialog box you can see that the map has domain Image .

Converting a color domain to a value domain


Finally, there is a possibility that you have imported a 24 bits/pixel Windows bitmap.
This is converted in ILWIS to the color domain. The colors of a map with a color
domain, can only be seen correctly when your screen uses a 24 bits/pixel display
(millions of colors). You can convert maps with a color domain easily to an image
domain, with the Color Separation operation.
An overview of domain conversions in ILWIS is given in Table 4.8. For more
information see also the ILWIS Help topic How to change the domain of a map.
Table 4.8:

Domain conversions in ILWIS.

From

To

Recommended procedure

Class
Class or ID
Color
ID
Picture
Picture
String column

ID
Value
Image
Class
Value
Class
Class or ID

Value
Value*

Class
Value

Properties, button Convert to identifiers


Attribute table/column Attribute Map
Color Separation
Properties, button Convert to classes
Map Calculation
Properties, create class domain, button Convert to classes
Column Properties, button Create new Domain from Strings in
column
Slicing or Properties, select or create new domain
Map calculation

* Domain type value includes all value domains (e.g. system domains Image, Radar, Bool, Bit, etc. and
your own value domains).

164

ILWIS 3.0 Users Guide

Spatial data management


Summary: Domain conversion
You should be careful when changing the domain of a map. If you do not follow the
guidelines described in this section, the file may get corrupt.
The following domain conversions are possible in ILWIS:
- 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 class or ID to value, is done by creating an attribute map with a
value column from an attribute table.
- 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 picture domain to an image or value domain can be done, by
using a Map Calculation or by changing the domain in the Properties sheet of
the map.
- Conversion from a color domain to an image domain can be done with the Color
Separation operation.

ILWIS 3.0 Users Guide

165

CHAPTER 5

Attribute data handling


In chapter 2 you have seen the basic concepts of ILWIS for Windows. One of the topics of that chapter dealt with the relationship between spatial data (maps) and attribute 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.
ILWIS 3.0 Users Guide

167

Attribute data handling

Double-click the ILWIS icon on the desktop.


Use the Navigator to go to the directory C:\ILWIS 3.0 Data\Users Guide\
Chapter05.

Introduction to the data set: city blocks


Throughout this chapter you will work on a dataset dealing with the city blocks of the
central part of the city of Cochabamba, in Bolivia. The city blocks have been digitized from a paper map, and for each building block attribute information is available
in a table.

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 identified separately and information from each individual block can be obtained from the
table connected to the map. The polygon map Cityblock has a domain ID
(Identifier).
The table Cityblock contains the following 4 columns:
- Area : a column with a value domain, containing the area of each city block in
square meters.
- Landuse : a column with a class domain containing the prevailing land use type
within the city block.
Residential : city blocks used primarily for housing.
Commercial : city blocks primarily containing buildings used for commercial
activities such as shops, offices, banks, hotels, restaurants etc.
Institutional : city blocks that contain buildings such as schools, universities, hospitals, churches, museums, governmental offices etc.
Industrial : city blocks with buildings primarily dedicated to processing,
manufacturing, and storage of goods.
Recreational : city blocks used for any community or socio-cultural activity, indoor or outdoor, such as sport fields, stadiums, parks etc.
Transport : city blocks used for transport related services such as bus station, railway station etc.
Vacant : city blocks within the urban area that are not used for any urban
activity, such as abandoned buildings, undeveloped plots, bare hills, forested
areas etc.
Water : includes all water bodies such as lakes and rivers.
Airport : the airport of Cochabamba.
- District : the city of Cochabamba is divided into a number of districts. Each district contains a number of city blocks. Since the districts have unique codes, the
District column has also an ID domain.
168

ILWIS 3.0 Users Guide

Attribute data handling


- 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 statistical data for value columns: minimum value, maximum value, average, standard deviation and the sum of all values in a column.

Close the table Cityblock .

The data used for this exercise is partly invented. In table Cityblock, the location
of the generalized city blocks, the land use and the cadastral districts reflect the actual situation, but the population column and the data related to the districts that will be
shown later have been made up for this exercise.
In the exercises of this chapter you will evaluate the following:
- The population density per building block.
- The total population per district.
- Land use proportions per district.
- The number of schools in relation to the number of schoolchildren in each district.

ILWIS 3.0 Users Guide

169

Attribute data handling

5.1 Creating a table


Tables can be obtained in three ways: either by creating them in ILWIS and entering
the values manually from the keyboard, by using Copy/Paste from another source
table or by importing existing data in other file formats.
For more information see ILWIS Help, topic How to import ASCII point data.
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 schoolchildren between 4 and 18 years old. This is also a value domain.
The full table is listed below:
Table 5.1:
District

Housecon

Schools

Pchildren

nr 1

nr 11

Moderate
Good
Good
Good
Good
Moderate
Moderate
Moderate
Moderate
Bad
Moderate

8
7
2
10
10
4
5
5
8
5
5

31
22
24
18
15
29
34
33
32
42
35

nr 12
nr 13

Bad
Bad

1
7

40
35

nr 2
nr 3
nr 4
nr 5
nr 6
nr 7
nr 8
nr 9
nr 10

Information per district of the city of Cochabamba.

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.

Select the domain District from the list box Domain.

Type the description: Information related to the cadastral


districts .
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 ).

170

ILWIS 3.0 Users Guide

Attribute data handling


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.

Type the description: Housing condition . Click OK.

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.

Click the Create Domain button (the small button to the right of the arrow
of the Domain list box). The Create Domain dialog box is opened. Type the
domain name Housecon in the text box, and make sure that the option Class
is selected.
The Domain Editor is opened. Open the Edit menu and select the Add Item
command. The Add Domain Item dialog box is opened.

Type the description in the Add Column dialog box: Average housing
condition per district .

Click OK in the Add Column dialog box.

Column Housecon is added to the table District .

Click the first field of column Housecon . A drop-down list is opened. If you
click the small arrow, the three classes of the domain of this column are
shown. Select the class Moderate .

Press the arrow down () key on the keyboard, to go to the next field. You
can use the left () and right () arrows to move through the items in the
domain list. Select Good from the list for district nr 2.

Enter the rest of the data for this column Housecon according to Table 5.1.

Then create the second column for this table: Schools (number of schools in each
district).

ILWIS 3.0 Users Guide

171

Attribute data handling

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 consisting of schoolchildren).

Add the column: Pchildren . For the domain of this column select the system domain Perc, with a value range of 0 to 100 , and a precision of 1.0 .

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.

172

Open the table Cityblock .


Add a new column Tourism . Create for this column a new domain
Tourism , in which you add the items shown in Table 5.2.

Go to the records indicated in Table 5.2 and type the text shown in the table.
Close the table window.

ILWIS 3.0 Users Guide

Attribute data handling

Table 5.2:

Some touristic sites in Cochabamba.

city block

Tourism

017

Cathedral
Central Park
Post office
University
Stadium
Memorial hill
Statue

018
075
267
553
700
707

Summary: Creating, importing and editing tables


- Tables can be obtained in several ways. In this exercise you saw how to create a
table in ILWIS and how to enter values manually from the keyboard.
- 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.).

ILWIS 3.0 Users Guide

173

Attribute data handling

5.2 Importing digital attribute data


In many GIS projects you dont have to start from scratch. Often a lot of data is readily available, also in digital format. This is especially true for attribute data such as
the data we are using in this exercise. These data have to be imported into ILWIS and
adapted so that they can be used in combination with maps.
The Import Table Wizard helps you to import different table formats. In this exercise we will import a dBase file which contains the number of houses in each cityblock 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 Edit Column Details page, check the properties of all columns.

On the Select Table Format page, make sure the right table format is selected: Dbase DBF. Click Next.

The Edit Columns Details page gives you an overview of columns that are detected
in the dBase file, and allows you to check and modify how these columns should be
imported. You can for instance specify other output column names, the domain (type)
of each output column and whether or not a certain column should be the domain of
the output table. Every default listed on this page can be double-clicked and changed
according to your wishes.
In this case, you can use the existing ID domain Cityblock for the Name column,
instead of creating a new domain for it. This column will also be used as the domain
of the output table.

174

For the Name column, under New Domain, double-click the default Yes and
change it into No .

Accept the default Domain Type (ID ).


Under Domain, double-click the default Name , and select domain
Cityblock .

ILWIS 3.0 Users Guide

Attribute data handling


Now, you will specify column Name as table domain.

Select the Table domain check box.


From the listbox that now appears, select column Name .
A star *, which appears before the Name column in the upper part of the
page, is indicating the column that will be used as table domain.

Click Next.

Double-click the Houses table in the Catalog and check the results.

On the Specify ILWIS Table Name page, type Houses for the Output File
Name and click Finish.
Also open table Cityblock .
Check the domain of both tables by opening the Properties sheets.

Both tables use domain Cityblock . Because of this common domain, you can join
the column Houses from table Houses into the table Cityblock .

In table Cityblock , open the Columns menu and choose the Join command.

On the first page of the Join Wizard, select table Houses, accept column
Houses and click Next.

On the second page of the Join Wizard, accept the default Output Column
Name, and click Finish.

Click OK in the column Properties dialog box and inspect the results.
Close the table windows when you have finished the exercise.

Table joining will be addressed extensively in section 5.7.

ILWIS 3.0 Users Guide

175

Attribute data handling

5.3 Calculating with columns


After some introductory exercises dealing with the creation and import of a table, you
are now starting with the main theme of this chapter: table calculations. These calculations will be done with Table Calculation formulas.
The formulas can be typed on the command line of a table window. A table calculation formula consists of an output column that will contain the result of the calculation, 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 limitation 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 depending on other columns (a source data object, see section 2.5). You can edit the data
stored in such a column directly, e.g. by double-clicking on the field to be edited.
- When the definition symbol (=) is used and the output column does not exist yet, a
dependent column is created. The data in a dependent column depend on data from
other columns via the formula which was used. When data in one of the source
columns is changed, the result will also change, when you make the column up-todate. Fields of a dependent column cannot be edited directly; results of calculations
are protected.
An expression usually contains operators and/or functions to specify the calculation
to be performed. The expression calculates results for all records of the output column. The available TabCalc operators and functions are listed in the ILWIS Help.
You can press F1 at any time in the table window to access detailed information
about them. You can also choose the Help on this Window command or the
Related Topics command from the Help menu.

176

ILWIS 3.0 Users Guide

Attribute data handling


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.

You can use the following short-cut keys:


- Ctrl+V (to paste information from the Clipboard to the Command line),
- Ctrl+C (to copy from the Command line to the Clipboard).
This is extremely useful when you have to edit complicated and long formulas.
For an overview of the keyboard shortcuts see the topic Appendices: Keyboard
shortcuts in the ILWIS Help.

Pocket Line Calculator


To temporarily view the outcome of an expression, i.e. without storing the results in a
column, you can also use the command line as a Pocket Line Calculator. On the command line of the table window, type a ? followed by an expression. This is in ILWIS
the syntax for using the Pocket Line Calculator:
? Expression

for example:
? 7 + 8 returns 15.
? MAX(ColumnName) returns the maximum value of a column.
? Columnname[Recordnr] returns the contents of a column at a certain record-

number.
For more information about the Pocket Line Calculator and the use of complicated
expressions, refer to ILWIS Help, topic Table calculation: pocket line calculator.
Calculations with value columns
You will now practice with calculations using columns. There are considerable differences in the way you calculate with value columns on the one hand, and with class
and ID columns on the other. Lets start by using some operators on columns with a
value domain. We use the table Cityblock to calculate the area of each city block
in hectares, by dividing the column Area with 10000.
(1 hectare = 100*100 = 10,000 square meters).

Open the table Cityblock .


In the table window, position the mouse pointer on the command line and
type the following formula:
Areaha=Area/10000

Press Enter.

Now the Column Properties dialog box is opened. Since the column Areaha did
not exist in the table, it now has to be defined. This dialog box provides possibilities
to define for the new column: domain type, range, precision, position of the
ILWIS 3.0 Users Guide

177

Attribute data handling


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 column. A precision of 1 means that output values will be rounded to whole numbers. A
precision of 0.1 means that the output values will have 1 decimal. The description
text box can be used to enter a text explaining what the column represents. The use of
the description text box is optional, but it is highly recommended, as it helps to
remind you what the data means.

Type some explanatory text in the Description text box, e.g.:


Area of the city blocks in hectares .

The rest of the properties we will leave as they are; accept the default values
suggested by ILWIS by clicking OK.

The dialog box is closed, and the program executes the formula. The results are displayed in the column Areaha .
Operators for value columns
There are several types of operators and functions that can be used in expressions
with value columns.

You can get an overview of all operators and functions that can be used for value
columns in the ILWIS Help. Open the Help menu, and select Help on this
Window. The Help is opened on the Table window page. Select the hypertext
link Command line. Select the hypertext link Table Calculation. Select the
hypertext link Operators and functions on value columns. Now you will see
an overview of the operators and functions on value columns. Click the hypertext
links to get more information and examples of the various operators. You can also
use the Related Topics command on the Help menu.

Arithmetic operators
These are the most simple operators, which are used for the multiplication, division,
subtraction or addition of columns. Another example of these arithmetic operators
will be used to calculate the population density per city block.

178

ILWIS 3.0 Users Guide

Attribute data handling

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 density for each city block.
Relational operators
Relational operators (=, <, <=, >, >=, <>) test whether one expression is equal,
smaller, smaller or equal, larger, larger or equal, or different than another expression.
Let us find out, for example, which city blocks have a population density of more
than 200 persons per hectare.

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.

Click OK and check the results.

Logical operators
Logical operators such as AND, OR, XOR and NOT, compare two expressions and
check if both are true (AND), at least one is true (OR), or only one is true (XOR).
The NOT operation checks if an expression is true or false. If the expression is true,
the NOT operation will result in false and vice versa. As an example, the AND operator is used to find the city blocks that have a population density between 200 and 300
persons per hectare.

ILWIS 3.0 Users Guide

179

Attribute data handling

Type the following formula on the command line:

The Column Properties dialog box is opened.

Highdens1=(Popdens>200)and(Popdens<300)

Type the following description: Population density between 200


and 300 persons per hectare .
Click OK.

The same result could be obtained with the INRANGE function.

Type the following formula on the command line:


Highdens2=INRANGE(Popdens,200,300)

Click OK in the Column Properties dialog box and check the results in the
table.

Conditional function
The examples that we have used for the relational and logical operators all give output values, which are either true or false or undefined. In practice we use these operators mostly in combination with the conditional IFF function, which has the form of
an IF...THEN..ELSE statement. The format for a conditional statement in ILWIS is:
IFF(a,b,c). If condition a is true, then return expression b, otherwise return expression c.

Type the following formula on the command line:

Click OK in the Column Properties dialog box.

Highdens3=IFF((Popdens>200)and(Popdens<300),Popdens,?)

The resulting column (Highdens3 ) contains values for those records where the condition (Popdens>200)and(Popdens<300) was true. The other fields contain a
question mark (?). These are so- called undefined values.
Conditional functions are used extensively in ILWIS. You will find that 3 out of 4 formulas you create will contain an IFF statement.
Conditional functions can also be part of another conditional function. In that case we
call them nested IFF functions. The calculation performed above can also be written as such a nested IFF function.

180

Type the following formula on the command line:

Click OK in the Column Properties dialog box.

Highdens4=IFF(Popdens>200,IFF(Popdens<300,Popdens,?),?)

ILWIS 3.0 Users Guide

Attribute data handling


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 IFFs 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 .

Select column Highdens by clicking the name of the column.

Select the columns Highdens2 , Highdens3 , and Highdens4 with the left
mouse button, while holding the Shift key. Press the right mouse button and
choose Delete or click the Delete button
in the toolbar. Confirm the deletion for all columns.

Close table Cityblock .

From the Edit menu choose Delete. Confirm the deletion.


Select column Highdens1 , and press the Delete key on the keyboard.
Confirm the deletion.

Operators used for class or ID columns


Columns that have a class or ID domain can also be used in formulas. When using
class names or IDs within an expression, these class names and IDs should be put
between double quotes, e.g. Residential . This also applies to the undefined
value ? in class and ID maps or domains.
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 conditional 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 .

Open table Cityblock .

Click OK in the Column Properties dialog box.

Type the following formula on the command line:

Resnr7=(Landuse=Residential)and (District=7)

The result of this formula is a column, using domain Bool.


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.

ILWIS 3.0 Users Guide

181

Attribute data handling

Type the following formula on the command line:


Rescomnr7=IFF(((Landuse=Residential)or(Landuse=
Commercial))and(District=7),Landuse,?)

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).

Click OK in the Column Properties dialog box.

How to define domains for IFF functions with class or ID


When we work with IFF functions that give class or ID results, we may have four different situations:
1. IFF(expression, domain1,?). The result of the expression fits in an existing
class or ID domain (mostly one of the input columns), or is the undefined value.
This is illustrated by the example shown above;
2. IFF(expression, domain1,name). The result of the expression fits in a existing
domain or is a name which is not yet in the domain. In this case you must add one item
Name to the existing domain. A similar situation is IFF(expression,name,domain1);
3. IFF(expression, domain1, domain2). The result of the expression fits either in
domain1 or in domain2. In this case you must merge the two domains;
4. IFF(expression, name,name). The result of the expression is two names
which fit, or may not fit, in an existing domain.
In situations 2, 3, and 4 you cannot simply use an existing domain for the output column. 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 combination with a map.
182

ILWIS 3.0 Users Guide

Attribute data handling


Let us now look at the situations 2, 3, and 4 with some examples.

Type the following formula on the command line:


Newlanduse=IFF(Landuse<>Residential,Landuse,
Houses)

This statement is an example of situation 2, IFF(expression, domain1,name). If the


land use in the city block is not Residential then take the names from the column
Landuse , otherwise use the word Houses . So in fact we replace the word
Residential with the word Houses . This is a situation in which you could still
use the existing domain City_Landuse (belonging to the column Landuse ) and
add the item Houses to it.

Click OK in the Column Properties dialog box.


The Merge domain dialog box appears, asking you to Add string Houses
to domain City_Landuse . Answer with Yes.

The new column Newlanduse shows the names of the non-residential city blocks, as
in the column Landuse , and the new name Houses for the residential city blocks.
Let us now look at situation 3: IFF(expression, domain1, domain2). If there is information in column Tourism (which you generated in exercise 5.1), then we will use
that information, otherwise we will take the names of the land use classes.

Type the following formula on the command line:

Newlanduse2=IFF(ISUNDEF(Tourism),Landuse,Tourism)

What we have done here, is to look at whether fields in the column Tourism have
undefined values, using a special function ISUNDEF. If that is the case, the names
from the Landuse column are used, otherwise the names from the column Tourism .
Since the items in the column Tourism also refer to land use, we can add the items of
the existing domain City_Landuse to it, so there is no need to create a new domain.

Press OK in the Column Properties dialog box. The Merge domain dialog
box appears, asking you to Merge strings of domain
City_Landuse into domain Tourism . Answer with Yes.

Finally, let us give an example of situation 4, IFF(Expression,name,name). We


will evaluate which city blocks are located in the city center. The city center consists
of the district numbers 4, 5, 6, 7, 8, and 9. If we would create a formula for that it
would be quite long:
Center=IFF((District=nr 4)or(District=nr 5)
or(District=nr 6) or (District=nr 7)or(District=nr 8)
or(District=nr 9),Center,Not in center)

ILWIS 3.0 Users Guide

183

Attribute data handling


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.

Type the following formula on the command line:


Distrnr=VALUE(RIGHT(District,2))

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 center)

Now the calculation formula is much shorter, and the INRANGE function, which
works on value columns, can be used to see if the district number of the district is
between 4 and 9.
In this case it would make no sense to add the new names Center and Not in
center to an existing domain. They contain a different type of information than that
of the domains City_Landuse or District .
Since the ELSE and THEN parts of the IFF function contain names that ILWIS cannot identify as being part of an existing domain, the program will display the String
domain as the default domain for the output column. In this case, however, we would
like to make a new domain: Center .

184

Click the Create domain button (located next to the arrow of the domain list
box). The Create Domain dialog box is opened.

Enter the Domain Name: Center , select the Class option and click OK.
The Domain Editor is opened. Add the two items: Center and Not in
center . Close the Domain Editor. Now you are back in the Column
Properties dialog box. The domain Center is now selected. Click OK.

ILWIS 3.0 Users Guide

Attribute data handling

Note that you could have also calculated the entire formula directly, by combining
a series of functions in one expression, without the need to generate a value column first:
Center=IFF(INRANGE(VALUE(RIGHT(District,2)),4,9),Center,
Not in center)

There are many more operators and functions that can be used for class or ID
domains than the ones we have treated in this exercise.

You can get an overview of all operators and functions that can be used for class
or ID columns in the ILWIS Help, topic Table calculation: Operators and
functions on Class, ID, Group or String columns.
You can also check the topics Table calculation special: calculation on coordinates and calculation on colors, etc.

Before you continue with the next exercise, it is better to delete most of the columns
created in this exercise.

Select column Resnr7 by clicking the name of the column, and press the
Delete key on the keyboard. Confirm the deletion.

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 .

Summary: Table Calculation


- Calculations are typed on the command line of the table window with formulas.
Each formula contains the name of an output column, a definition or assignment
symbol (which determines whether the output column will be dependent or not)
and an expression.
- An expression contains operators, functions and operands (names of columns,
strings and values).
- 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.

ILWIS 3.0 Users Guide

185

Attribute data handling


- 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).

186

ILWIS 3.0 Users Guide

Attribute data handling

5.4 Classifying data in a column


In the previous exercise you have seen a number of different operators and functions
that can be used in calculations with columns. In this exercise you will learn another
useful function: classification of values in a column.
The table Cityblock , containing information on the city blocks of Cochabamba,
will be used again as an example.

Open table Cityblock .

One of the columns in this table that was created in the previous exercise is called
Popdens (population density of each city block, expressed as number of persons per

hectare).

If you dont have this column you can generate it by typing the following command on the command line of the table window:
Popdens=10000*Population/Area

Domain Group
The column Popdens shows different values for each city block. To simplify this
information it would be handy if we could classify it into a number of classes. This is
done with the CLFY function. This function classifies values into a number of classes.
The classes should be defined beforehand, and are stored in a so-called domain
Group. A Group domain is a special type of class domain, in which for each class an
upper boundary value is given.
Table 5.3:

Boundary values for classifying population density.

Upper Bound

Name

0
50
100
200
10000

0 persons/ha
1 - 50 persons/ha
50 - 100 persons/ha
100 - 200 persons/ha
> 200 persons/ha

You will first create a group domain, called Popdensclass .

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 Users Guide

187

Attribute data handling

Type for the Upper Bound: 0. Name: 0 persons/ha . Click OK.


Press the INS key. The Add Domain Item dialog box is opened.
Type for the Upper Bound: 50 . Name: 1 - 50 persons/ha . Click OK.
Repeat the procedure for the other classes listed in the table.
Close the Domain Editor.

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).
Summary: Classifying data in a column
This exercise dealt with the classification of values in a column.
- Classification can be done with the CLFY function or the Column Slicing command on the Columns menu.
- A classification uses a so-called Group domain, which is a special type of class
domain. For each class name, there is a boundary value to be used in the classification.

188

ILWIS 3.0 Users Guide

Attribute data handling

5.5 Statistical operations with columns


Statistical operations with columns are a special type of table calculations. In the previous exercise you have seen how to calculate with columns and how to classify data
in columns. In this exercise you will look at the statistical analysis options within
tables.

5.5.1 Statistics in a table window


Statistics Pane
At the bottom of each table window you can find the Statistics Pane, which gives you
some descriptive statistical information. For each value column, the Statistics Pane
shows:
- Minimum value.
- Maximum value.
- Average.
- Standard deviation.
- Sum.
These values may help you to get a quick overview of your data.
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.

Open table Cityblock.


In the table window, open the Columns menu and select the Statistics command.
The Column Statistics dialog box is opened.
Select the statistical function Average.
Select Area as the column on which you want to calculate the statistics.
Click OK. The outcome is shown in a multi-line message box.
Repeat this exercise for other statistical functions and close the table window
when you are finished.
Available statistical functions are:
- Statistics on a single column: Average, Minimum, Maximum, Sum, Standard
Deviation, Standard Error or Variance.
- Statistics on two columns: Correlation or Covariance.
- Statistical analysis: Students t-test or X2-test.

ILWIS 3.0 Users Guide

189

Attribute data handling


Statistics using the command line
It can be useful to store the results of a statistical analysis in an output column. In
that case, you can type an expression on the command line of the table window, in
which you define an output column name and the statistical formula.
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.

5.5.2 Statistical analysis


In this exercise you will apply a regression analysis to find the relationship between
bird species richness and an environmental variable (moisture availability (%)). The
data to be used in the regression analysis is stored in the table Birdodd , which contains the odd sample numbers of an inventory. You will use the regression equation to
predict the number of bird species in a second table with even sample numbers
Birdeven , on the basis of this environmental variable. The last step is to test the
reliability of the predicted species richness i.e. to calculate the correlation between
the predicted and the observed species richness.

Open the table Birdodd and evaluate the contents.

The X- and Y-columns show the coordinates for the odd-numbered locations. The
table contains information about two environmental variables, moisture availability in
% (Moist ) and mean annual rainfall in mm (Avrain ), and about the number of bird
species (Richness ) for each location.
The relation between species richness and moisture availability, as one of the environmental variables, can be visualized in a graph.

In the Graphs menu of the table window select New Graph Window. The
graph dialog box is opened.

Select the checkbox X-column and select Moist . Select Richness for the
Y-column.

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.

Explore the relation between species richness and moisture availability.

!
190

When you click in the graph window, ILWIS returns the corresponding X and Y
values.
ILWIS 3.0 Users Guide

Attribute data handling


Least Squares Fit operation
To obtain the regression equation that describes this relation, you need to perform a
Least Squares Fit operation. The Least Squares Fit operation is a tool to describe the
best fitting relation between two variables in a table.

Open the Columns menu in the table window and select Least Squares.
The Least Squares Fit dialog box is opened.

Select Moist for the X-column and Richness for the Y-column.
Select Polynomial for the type of function to describe the relation.
Type 2 for the number of terms to be used in the formula.
Type LSF for the name of the output column.
Click OK. The Column Properties dialog box is opened.
Click the Additional Info button to view the resulting least square fit formula.

Write this formula down, as this is the regression equation you will use later to predict species richness.

Click OK in the Additional Info dialog box.


Accept the defaults in the Column Properties dialog box and click OK.

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.
ILWIS 3.0 Users Guide

191

Attribute data handling

Close table Birdodd .

Prediction based on regression equation


You have now visualized the relationship between moisture availability and species
richness and you have found the regression equation, which describes this relation.
The coefficients of the regression equation will be used to predict the number of bird
species in a second table (Birdeven) with the even records of the database.

Open table Birdeven .

Click OK in the Column Properties dialog box.

Type the following formula on the command line of the table window:
PredRichness = 45.265 + 4.193 * Moist

You will see a new column PredRichness , containing the predicted values for
species richness based on moisture availability of the even samples.
Correlation between variables
To evaluate the reliability of your prediction, you can calculate the correlation
between the predicted and the observed species richness.

In the table window open the Columns menu and select the Statistics command.
The Column Statistics dialog box is opened.

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, positive relation between moisture availability and species richness.
While the table contains X- and Y-coordinates, you can display the predicted and the
observed species richness as attribute point data in a map window. However, a point
map representing biodiversity (species numbers) has limited value for visual interpretation purposes. A better option is to rasterize the point map and to choose an appropriate representation (e.g. Pseudo).
The point map can also be used as input map to perform a point interpolation, such
as for instance Moving Average. The output of a point interpolation is a raster map.
For each pixel in the output map, a value is calculated by an interpolation on input
point values.
192

ILWIS 3.0 Users Guide

Attribute data handling

5.6 Aggregate functions


In the previous exercises, the use of several operators and functions that can be used
in the calculation of columns were presented. All of these operators and functions
work on each field individually, without looking at other fields in the same column.
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).
Aggregate functions can be performed on value columns as well as on class and ID
columns.
- In case of value columns, all available statistical functions might be meaningful. In
short, the following aggregations can be performed: average, weighted average,
count, minimum, median, weighted median, maximum, predominant, weighted predominant, standard deviation, weighted standard deviation, and sum.
- In case of class or ID columns, only the median, the count and the predominant
aggregate functions are meaningful.

Figure 5.2:

An example of the use of the aggregation function SUM for three situations.
Group by: none: all values are summed up. Group by the column District: all values are summed up for each District. Group by: column Landuse.

Aggregation commands can be selected from the Columns menu in a table window,
or by typing a statement on the command line of a table window. The first method is
ILWIS 3.0 Users Guide

193

Attribute data handling


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.

Open table Cityblock .

Select for the Column: Area , the function: Sum, and type as Output
Column: Totalarea . Click OK.

Type the description: Total area of all city blocks in the


Column Properties dialog box. Click OK.

Open the Columns menu, and select the Aggregation command. The
Aggregate Column dialog box is opened.

You will see that the column Totalarea contains the value 10678499.792 for all
records. That is because you have calculated the total area summing up all records. It
is evident that the column Totalarea is not useful in combination with a map. Since
the column only contains 1 value, it says nothing about the different units in the map.
Instead, you can also calculate the total area per district. Then, areas are summed up
only for those records that have the same name in the column District . The column District is used to group the records. In this way we can calculate the total
area of each district, or of each land use type, or any other group-by column.

Open the Columns menu and select the Aggregation command. The
Aggregate Column dialog box is opened.

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 districts.

194

Check this by opening the Columns menu, and choosing the Sort command.
The Sort dialog box is opened. Click Column, and select the column
District . Click OK. The table is sorted according to the column
District .

In the table window, use the scroll button on the right-hand side and check
whether the values in column Areadistrict change for each district.

Sort the table again on the domain.

ILWIS 3.0 Users Guide

Attribute data handling


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 .
You will now use another aggregation function: Average.

Close table District .

Open table District and examine the result.

In table Cityblock , calculate the average number of persons per building


block for each district. Store the result in column: Avgpopbl in table
District .
Close all table windows.

A more complex problem


Now you will learn how to use aggregate functions for a more complicated problem:
what is the percentage of the land use types residential, commercial and institutional
per district. You cannot obtain this information directly by an aggregate function,
since the table has 717 records, one for each city block. For each city block it is indicated what is the district and what is the land use. The area of the districts is calculated already in the column Areadistrict . Now you need to know the area of each
combination of District and Landuse . In order to do that you will have to combine the two columns District and Landuse . This can be done with the so-called
concatenation operation. With a concatenation operation you can glue two strings
together.

Open table Cityblock .

The Column properties dialog box is now displayed. The output column
will have a String domain. Click OK.

Type the following formula on the command line:


Distrlanduse=District+Landuse

The new column Distrlanduse now contains the unique combinations of the district numbers and the land use types. So now we can calculate with an aggregate
ILWIS 3.0 Users Guide

195

Attribute data handling


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.

Double-click the column header Distrlanduse . The Column Properties


dialog box is opened. Press the button Create New Domain from Strings
in column. The Create Domain dialog box is opened.

Change the name of the domain to Dlanduse . Note that the check box
Apply domain to column is selected. Click OK. The domain of the column
Distrlanduse is now a class domain, called Dlanduse .

Open the Columns menu and select the Aggregation command. The
Aggregate Column dialog box is opened.

Select for the Column: Area , the function: Sum.


Select the check box Group by, and select the column Distrlanduse .
Type for the Output Column: Areadistrlu . Click OK.
Type for the description: Area occupied by each land use type
in each district . Click OK.

Now you know the area of each district, and the area of each land use type in each
district. The combination of the two will give us the percentage of each district occupied by several land use types.

Type the following formula on the command line:


Residential=IFF(Landuse=Residential,100*
Areadistrlu/Areadistrict,0)

In the Column properties dialog box, select domain Perc, and click OK.

The column Residential shows the percentage of each district occupied by houses.
Now do the same thing for the land use types Commercial and Institutional .

Locate the mouse pointer on the command line, and press the up arrow. The
previous formula is displayed again.

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)

196

Press Enter. Select the domain Perc, and click OK.

ILWIS 3.0 Users Guide

Attribute data handling

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.

Delete the columns Popdensclass , Areadistrict , Distrlanduse and


Areadistrlu .

Close table Cityblock .

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.

Summary: Aggregate functions


Aggregations are either performed on:
- all records of a column,
- all records that belong to the same class as determined by a group-by column.
Aggregate functions can be performed on value columns as well as on class and ID
columns.
- In the case of value columns, the following aggregations can be performed: average, weighted average, count, minimum, median, weighted median, maximum, predominant, weighted predominant, standard deviation, weighted standard deviation
and sum.
- In case of class or ID columns, only the median, the count and the predominant
aggregate functions are meaningful.
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.

ILWIS 3.0 Users Guide

197

Attribute data handling

5.7 Table joining


In the previous exercise we have seen that you can store results of an aggregation in
another table, which has the same domain as the group by column used in the aggregation, in order to reduce the data redundancy. In this exercise you will look in more
detail to how you can use columns from one table in another table. The process of
linking tables is called joining.
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 following 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).
198

ILWIS 3.0 Users Guide

Attribute data handling


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, IDs or values.
In that case you only have to specify the key column in that table (key 2) (see
Figure 5.4-A)
- The key column in the other table does not contain unique class names, IDs or
values. In that case direct joining is not possible, since there may be more than
one possibility to join. To solve that, you need to aggregate the values via the
key column (Figure 5.4-B)

Figure 5.4:

The domain of the current table is the same as the domain of a column in the other
table from which you want to join a column. Dark shaded columns are used as key.
The arrows indicate how the link is made. Fig 5.4-A (left): The column in the other
table contains unique class names, IDs or values. Fig 5.4-B (right): The column in
the other table does not contain unique class names, IDs or values.

4. The domain of a column in the current table is the same as a domain of a key column in the other table from which you want to obtain data. In this case we also

have the same two possibilities as in the third situation shown above (see Figure
5.5).

ILWIS 3.0 Users Guide

199

Attribute data handling

Figure 5.5:

The domain of a column in the current table is the same as a domain of a key column in the other table from which you want to obtain data. Dark shaded columns
are used as key. The arrows indicate how the link is made. Fig 5.3-A (left): The key
column in the other table contains unique class names, IDs or values. Fig 5.2-B
(right): The key column in the other table does not contain unique class names, IDs
or values.

Joining via table domains


First you will join two tables which both have the same domain (Figure 5.3-A). The
first table is attribute table Cityblock with which you have been working in the
previous exercises. To this current table, a column from Polygon Histogram
Cityblock will be joined. This polygon histogram contains statistical information
on each city block: the number of polygons, the perimeter and the area.

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).

Open polygon histogram Cityblock and evaluate its contents.


Open the File menu and select the Properties command to find out the
domain of the table. Click Cancel.

The polygon histogram Cityblock has the same domain as the attribute table
Cityblock . Note that the column NrPol (number of polygons) only contains the
value 1. This is logical, since each city block has a unique identifier, and therefore
occurs only once. The column Perimeter contains the length of the border of each
city block (in meters). We want to read this column into the attribute table Cityblock.
200

ILWIS 3.0 Users Guide

Attribute data handling

Close polygon histogram Cityblock and open the attribute table


Cityblock .

From the Columns menu, select the Join command. The Join Wizard is
started.

Select for the Table: the polygon histogram Cityblock and for the
Column: Perimeter .

The Join Wizard now looks like Figure 5.6.

Figure 5.6:

The Join Wizard used for joining a column from two tables with the same domain.

Click Next in the Join Wizard. Accept the name Perimeter for output column and click Finish.

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 command line:
Perimeter=Cityblock.hsa.Perimeter
Cityblock.hsa is the polygon histogram.

ILWIS 3.0 Users Guide

201

Attribute data handling


Joining a key column with a table
In this exercise, you will perform a join as shown in Figure 5.3-B: the current table
has a key column with a domain that is the same as the domain of another table from
which you wish to join a column. We would like to know the percentage of schoolchildren in relation to the total population per cityblock. This information is available
in the column Pchildren in the District table, which you have created in exercise 5.1. The information of column Pchildren in the District table can be
joined to the table Cityblock , because table Cityblock has a column
(District ) which has the same domain as the District table.

Open table District and open table Cityblock . Check if the domain of
the column District in table Cityblock is the same as the domain of
table District .

Make the table window that displays table Cityblock the active window.

Select for the Table: District , for the Column: Pchildren . Click Next.

From the Columns menu, select the Join command.


The Join Wizard is started.

The second page of the Join Wizard is to select and confirm the Join method, i.e. the
link between the two tables. You can see in this case there is only one option: to
choose a key Column from the current table and to use the Domain of the selected
table. The Join wizard now looks like Figure 5.7.

Figure 5.7:

202

The Join Wizard - Join method page, using a key column in the current table to join
a column from another table. The other table has the same domain as the key column in the current table.

ILWIS 3.0 Users Guide

Attribute data handling

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 minimum= 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.

Table joining combined with aggregation


In this exercise you will deal with a join as shown in Figure 5.4-B: the domain of the
current table is the same as the domain of a column in another table from which you
wish to join. We would like to know the total area and the total population for each
district. Besides that, we would like to know the percentage cover of residential, commercial and institutional buildings in 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.

Read the Join Method page; in this case there is only one way of joining
possible. Click Next.

From the Columns menu, select the Join command.


Select for the Table: Cityblock , for the Column: Population . Click
Next.

ILWIS 3.0 Users Guide

203

Attribute data handling

On the Link between two tables page, select column District as Key2.
Click Next.

On the Aggregation method page, select the aggregate function Sum.

The Join Wizard now looks like Figure 5.8.

Figure 5.8:

The Join Column dialog box using an aggregation function (SUM) to join a column
(Population) from another table (Cityblock) via a group by column (District)
into the current table (District) which also has the domain (District). The
aggregate function is needed since the table Cityblock contains many records
for the same item of the domain District, while table District only contains
one record for each domain item.

Click Next.
Accept the Output Column name Population and click Finish.
Accept the defaults in the Column properties dialog box and click OK.

The Column Population is now added to the attribute table District . We could
use this column, together with the column Pchildren to calculate the number of
schoolchildren in each district.

Design the formula yourself for calculating the number of schoolchildren per district.

Finally, you can also join the columns Residential , Commercial and
Institutional into the table District . In table Cityblock , information on
the areas of residential, commercial and industrial land use types is available per city
block. These columns were created in section 5.6.

204

ILWIS 3.0 Users Guide

Attribute data handling

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 .

Summary: Table joining


In order to be able to join tables, the domain of the table or one of its columns should
match the domain of the other table or one of its columns. There are four methods in
which tables can be joined:
- The domain of the two tables is the same.
- 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.

ILWIS 3.0 Users Guide

205

Attribute data handling

5.8 Displaying results as graphs


Data in a table can be presented as graphs in a graph window. In this exercise you
will have a look at the graph window and at the way in which you can display the
results of the previous exercise. In the last part of section 5.7, you have joined the
columns of table Cityblock into the District table, and obtained the columns
Residential , Commercial and Institutional in the last table. These
columns contain the percentage cover of each of these land use types within each district of the city of Cochabamba.

If you did not succeed in the last exercise, or if you start with this exercise without having done section 5.7, you can use table Distric1 , which already contains
the joined columns, and use table Distric1 whenever we speak of the table
District .

Open table District .


In the table window, open the Graphs menu, and select the New Graph
Window command.

The dialog box Graph is opened. In this dialog box, the columns of the table are presented in the X-Axis (optional) and Y-Axis list boxes which can be used to select the
X and Y axes of the graph.

Make sure the X-column check box is not selected.


Select column Residential from the Y-column list box.
Click OK.

The Graph Options dialog box is opened, in which you can select a graph type and
a display color.

Select Bar for graph type.

Click OK.

On the tab Y-Axis (left), type for the Axis text: Percentage . Type for the
Y-Axis Min - Max: 0 and 100 .

The Graph window is opened. The graph shows the percentage cover of residential
buildings in each district.
You can add the other two graphs showing the percentage of commercial and institutional buildings.

206

ILWIS 3.0 Users Guide

Attribute data handling

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.

Summary: Graph display


- Data in columns can be displayed as graphs of different types: lines, steps, bars,
needles and points.
- Several graphs can be combined in one graph window.

ILWIS 3.0 Users Guide

207

CHAPTER 6

Image Processing
ILWIS contains a set of image processing tools for enhancement and analysis of data
from space borne or airborne platforms. In this chapter, the routine applications such
as image enhancement, classification and geo-referencing are described. The image
enhancement techniques, explained in this chapter, make it possible to modify the
appearance of images for optimum visual interpretation. Spectral classification of
remotely sensed data is related to computer-assisted interpretation of these data. Georeferencing remote sensed data refers to geometric distortions, the relationship
between an image and a coordinate system, the transformation function and resampling techniques.
Introduction to remotely sensed data
Remotely sensed data, such as satellite images, are measurements of reflected solar
radiation, energy emitted by the earth itself or energy emitted by Radar systems that
is reflected by the earth. An image consists of an array of pixels (picture elements) or
gridcells, which are ordered, in rows and columns. Each pixel has a Digital Number
(DN), that represents the intensity of the received signal reflected or emitted by a
given area of the earth surface. The size of the area belonging to a pixel is called the
spatial resolution. The DN is produced in a sensor-system dependent range; the radiometric values. An image may consist of many layers or bands. Each band is created
by the sensor that collects energy in specific wavelengths of the electro-magnetic
spectrum.
Before you can start with the exercises, you should start up ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter06, where the data files for
this chapter are stored.

Double-click the ILWIS icon on the desktop to open ILWIS.


Use the Navigator to go to the directory: C:\ILWIS 3.0 Data\Users Guide\
Chapter06.

ILWIS 3.0 Users Guide

209

Image Processing

6.1 Visualization of single band images


For satellite images and scanned black and white aerial photographs the image
domain is used. Pixels in a satellite image or scanned aerial photograph usually have
values ranging from 0-255. The values of the pixels represent the reflectance of the
surface object. The image domain is in fact a special case of a value domain. Raster
maps using the image domain are stored using the 1 byte per pixel storage format. A
single band image can be visualized in terms of its gray shades, ranging from black
(0) to white (255).
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 projection. In this case, the coordinates of each pixel in the window are displayed if one
points to it.
The objectives of the exercises in this section are:
- to understand the relationship between the digital numbers of satellite images and
the display, and
- to be able to display several images, scroll through and zoom in/out on the images
and retrieve the digital numbers of the displayed images.
Satellite or airborne digital image data is composed of a two-dimensional array of
discrete picture elements or pixels. The intensity of each pixel corresponds to the
average brightness, or radiance, measured electronically over the ground area corresponding to each pixel.
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

210

ILWIS 3.0 Users Guide

Image Processing
Display a satellite image
Display the image Tmb1 (the blue band) of the area near Cochabamba.

Double-click image Tmb1 in the Catalog. The Display Options - Raster


Map dialog box is opened.

In the Display Options - Raster Map dialog box, it is shown that the image
Tmb1 has domain Image , has digital numbers ranging from 25 to 162 and
will be displayed in gray tones (Representation: Gray ).

Click OK in the dialog box to accept these display settings. The image will be
displayed in gray tones from black (lowest reflectance) to white (highest
reflectance).

The image Tmb1 is now displayed in a map window. The map window can be moved,
like all windows, by activating it and dragging it to another position. The size of the
map window can be changed in several ways.

Reduce/enlarge the map window by dragging the borders of the window.


Maximize the map window by clicking the Maximize button

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.

Zoom in / out on a displayed satellite image


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

Select the Zoom Out button


map to zoom out.

in the toolbar and click (repeatedly) in the

Click the Entire Map button


again.

to show the entire map in the map window

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 button. Without releasing the button, drag the cursor a little bit to the second corner of the area of interest. Releasing the mouse button will result in an
enlarged display of the selected area. You can also click in the map window to
zoom in.

ILWIS 3.0 Users Guide

211

Image Processing
By repeatedly zooming in or by zooming in on a very small area, the pixel structure
of the image becomes clearly visible by the blocky appearance of the displayed
image.

Zoom in on the displayed image till you can clearly see the blocky pixel
structure of the image. If necessary, change the size of the map window.

Click the Normal button

Close the map window.

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, selecting dark and bright toned pixels and note the changes in DN values.

Scrolling through a displayed satellite image


When part of an image is displayed in a map window, other parts of the image can be
viewed by scrolling through the image.

Display the image Tmb4 and zoom in on an area.

A fast scroll can also be achieved by dragging the scroll boxes in the scroll
bars Left/Right or Up/Down, or by clicking in the scroll bar itself.

Close the map window.

To roam through the image use the Pan button


or use the
Left/Right/Up/Down scroll boxes in the horizontal or the vertical scroll bar.

Displaying multiple images


It is often useful to display more than one image on the screen. This is done by opening a map window for each image to be displayed. Multiple map windows can be
opened at the same time by selecting several maps and using the right mouse button
menu to open them.
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.

212

Double-click Tmb1 in the Catalog and click OK in the Display Options Raster Map dialog box. Move the map window to a corner of the screen.

Double-click the Show item in the Operation-tree.

ILWIS 3.0 Users Guide

Image Processing

In the Open Object dialog box select Tmb3 and click OK. The Display
Options - Raster Map dialog box is displayed.

Accept the defaults and click OK. Move the window to a position close to the
Tmb1 window.

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 window which displays Tmb1 . Select the option Boundaries Only in the
Display Options - Polygon Map dialog box. Select Boundary Color Red ,
make sure that the check box Info is selected and click OK.

Do the same for the other two map windows. When you click in any of the
map windows you will see the land use type.

Study the individual windows and try to explain the gray intensities in terms
of spectral response of water, urban areas, agriculture and grasslands for the
individual bands. Write down the relative spectral response as low, medium or high, for the different land cover classes and spectral bands in Table
6.1.

Close all map windows after you have finished the exercise.

Table 6.1:

Band

Relative spectral responses per band for different land cover classes.
Fill in the table with classes: low, medium and high.
Water

Urban area

Agriculture

Grassland

1
3
4

Digital numbers and pixels


The spectral responses of the earths surface in specific wavelengths, recorded by the
spectrometers on board of a satellite, are assigned to picture elements (pixels). Pixels
with a strong spectral response have high digital numbers and vise versa. The spectral
response of objects can change over the wavelengths recorded, as you have seen in
the former exercise when comparing the three Landsat TM bands with regard to for
example water and rural areas. When a gray scale is used, 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 on a
black to white scale.
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.
ILWIS 3.0 Users Guide

213

Image Processing
There are several ways to open and add maps to the pixel information window.

Display map Tmb1 in a map window.

Make sure that the pixel information window can be seen on the screen.
Select Tmb3 and Tmb4 in the Catalog and drag these maps to the pixel information window: hold the left mouse button down; move the mouse pointer to
the pixel information window; and release the left mouse button; The images
are dropped in the pixel information window.

Display Tmb4 , click OK in the Display Options - Raster Map dialog box.
Make sure that the map window does not overlap with the pixel information
window.

In the pixel information window the DNs of all three selected bands will be
displayed. Zoom in if necessary.

From the File menu in the map window, select Open Pixel Information. The
pixel information window appears.

You can also add maps one by one to the pixel information window (File menu Add
Map).

Roam through image Tmb4 and write down in Table 6.2 some DN values for water,
urban area, agriculture, scrubs and grassland. For ground truth, the land use map of
Cochabamba (map Landuse ) can be used.
Table 6.2:
Band

DN values of different land cover classes of selected spectral bands. Fill in the DN
values yourself.
Water

Urban area

Agriculture

Shrubs

Grassland

1
3
4

Close the pixel information window.

It is also possible to use the Command line of the Main window to add multiple
maps to a pixel information window.

214

Type on the Command line of the Main window:

Pixelinfo Tmb1.mpr Tmb3.mpr Tmb4.mpr


The pixel information window opens and contains the maps Tmb1 , Tmb3 and
Tmb4 .

Close all windows after finishing the exercise.

ILWIS 3.0 Users Guide

Image Processing
Pixels and real world coordinates
When an image is created, either by a satellite, airborne scanner or by an office scanner, the image is stored in row and column geometry in raster format. There is no
relationship between the rows/columns and real world coordinates (UTM, geographic
coordinates, or any other reference map projection) yet. In a process called geo-referencing, which is discussed in section 6.4, the relationship between row and column
number and real world coordinates can be established.

Double-click the map Tmb4 in the Catalog. The Display Options - Raster
Map dialog box appears.

Click OK in the Display Options - Raster map dialog box and maximize
the map window.

Move the cursor to the lake area near the city of Cochabamba and note the
Row/Col and XY, Lat/Long figures as given in the Status bar. Zoom in if
necessary.

Move to the mountain area in the NW corner of the image. Note the change
in real world coordinates and the row/col numbers.

When a map has coordinates, distances can be measured.

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.

The Distance message box will state:


From : the XY-coordinate of the point where you started measuring;
To : the XY-coordinate of the point where you ended measuring;
Distance on map : the distance in meters between starting point and end point calculated in a plane;
Azimuth on map : the angle in degrees between starting point and end point related
to the grid North;
Ellipsoidal Distance : the distance between starting point and end point calculated over the ellipsoid;
Ellipsoidal Azimuth : the angle in degrees between starting point and end point
related to the true North, i.e. direction related to the meridians (as visible in the
graticule) of your projection;
Scale Factor : direct indicator of scale distortion, i.e. the ratio between distance
on the map / true distance.

ILWIS 3.0 Users Guide

215

Image Processing

Click OK in the Distance message box.


Close the map window after finishing the exercise.

Summary: Visualization of images


- Satellite or airborne digital images are composed of a two-dimensional array of
discrete picture elements or pixels. The intensity of each pixel corresponds to the
average brightness, or radiance, measured electronically over the ground area
corresponding to each pixel.
- 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).

216

ILWIS 3.0 Users Guide

Image Processing

6.2 Image enhancement


Image enhancement deals with the procedures of making a raw image better interpretable for a particular application. In this section, commonly used enhancement
techniques are described which improve the visual impact of the raw remotely sensed
data for the human eye.
Image enhancement techniques can be classified in many ways. Contrast enhancement, also called global enhancement, transforms the raw data using the statistics
computed over the whole data set. Examples are: linear contrast stretch, histogram
equalized stretch and piece-wise contrast stretch. Contrary to this, spatial or local
enhancement only take local conditions into consideration and these can vary considerably over an image. Examples are image smoothing and sharpening.

6.2.1 Contrast enhancement


The objective of this section is to understand the concept of contrast enhancement
and to be able to apply commonly used contrast enhancement techniques to improve
the visual interpretation of an image.
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 illumination 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 reaches 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 lowest 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.
A computer monitor on which the satellite imagery is displayed is capable of displaying 256 gray levels (0 - 255). This corresponds with the resolution of most satellite
images, as their digital numbers also vary within the range of 0 to 255. To produce an
image of optimal contrast, it is important to utilize the full brightness range (from
black to white through a variety of gray tones) of the display medium.
ILWIS 3.0 Users Guide

217

Image Processing
The linear stretch (Figure 6.1) is the simplest contrast enhancement. A DN value in
the low end of the original histogram is assigned to extreme black, and a value at the
high end is assigned to extreme white. The remaining pixel values are distributed linearly between these extremes. One drawback of the linear stretch is that it assigns as
many display levels to the rarely occurring DN values as it does to the frequently
occurring values. A complete linear contrast stretch where (min, max) is stretched to
(0, 255) produces in most cases a rather dull image. Even though all gray shades of
the display are utilized, the bulk of the pixels is displayed in mid gray. This is caused
by the more or less normal distribution, with the minimum and maximum values in
the tail of the distribution. For this reason it is common to cut off the tails of the distribution at the lower and upper range.
The histogram equalization technique (Figure 6.1) is a non-linear stretch. In this
method, the DN values are redistributed on the basis of their frequency. More different gray tones are assigned to the frequently occurring DN values of the histogram.

Figure 6.1:

Principle of contrast enhancement.

Figure 6.1 shows the principle of contrast enhancement. Assume an output device
capable of displaying 256 gray levels. The histogram shows digital values in the limited range of 58 to 158. If these image values were directly displayed, only a small portion of the full possible range of display levels would be used. Display levels 0 to 57
and 159 to 255 are not utilized. Using a linear stretch, the range of image values (58
to 158) would be expanded to the full range of display levels (0 to 255). In the case
of linear stretch, the bulk of the data (between 108 and 158) are confined to half the
output display levels. In a histogram equalization stretch, the image value range of
108 to 158 is now stretched over a large portion of the display levels (39 to 255). A
smaller portion (0 to 38) is reserved for the less numerous image values of 58 to 108.
218

ILWIS 3.0 Users Guide

Image Processing
The effectiveness depends on the original distribution of the data values (e.g. no
effect for a uniform distribution) and on the data values of the features of interest. In
most of the cases it is an effective method for gray shade images.
Density slicing and piece-wise linear contrast stretch, two other types of image
enhancement techniques, are treated in section 6.6.1 and 6.6.2 respectively.
The material for this exercise consists of a Landsat TM band 1 of the area near
Cochabamba valley, Bolivia: Tmb1 .
Calculation of a histogram
Before stretching can be performed, a histogram of the image has to be calculated.

In the Operation-tree, expand Statistics and double-click the Histogram


operation. The Calculate Histogram dialog box is opened.

Select the raster map Tmb1 and click the Show button.

Write down in Table 6.3 the DN values that belong to the corresponding
cumulative percentages.

The histogram window appears showing a graphical display of the histogram


as well as a numerical display of the histogram in a number of columns:
Npix (= number of pixels with a certain pixel value),
Npixpct (= the percentage of pixels compared to the total number of pixels),
Pctnotzero (= the percentage of pixels compared to the total number of
pixels with non zero values),
Npixcum (= cumulative frequency distribution),
Npcumpct (= cumulative frequency distribution in percentages) and, if pixel
size is known,
Area (= area of pixels with a certain DN). In order to have a better view
maximized the histogram window.

Table 6.3:

DN values at specific cumulative percentages. Fill in the table


from the histogram of Tmb1.

Cumulative Percentage

0.5

10

100

99.5

99

98

95

90

DN value
Cumulative Percentage
DN value

For an optimal stretching result, the histogram shape and extent has to be studied.
This can be done using the numerical listing but a better picture can be obtained from
a graphical display.
Use the graph and the histogram table to answer the following questions:
1) What is the total number of pixels of the image?
ILWIS 3.0 Users Guide

219

Image Processing
2) How many pixels have a digital number of 68?
3) How many pixels have a DN more than 93?
4) Which DN represents the predominant value (most frequently occurring) of the
image?

In order to get an overview of the most important image statistics, open the
View menu in the histogram window and make sure that the Additional Info
command is active. Check if the DN values in Table 6.3 are correct. Check
also your answer to question 4.

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.

Compare original and stretched images


The original and the stretched image can be compared by displaying them in two map
windows next to each other and by inspecting the image statistics in their histograms.

220

Display the original image Tmb1 and the stretched image Tmb1_stretch ,
each in a map window next to each other and assess visually the effect of linear stretching. Do not forget to set the minimum Stretch to 0 and the maximum Stretch to 255 for both images.

Display the histograms of Tmb1 and Tmb1_stretch and study them.

Close the map and histogram windows.

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.

ILWIS 3.0 Users Guide

Image Processing
Table 6.4:

DN values at specific cumulative percentages. Fill in the table


from the histogram of Tmb1_stretch.

Cumulative Percentage

0.5

10

100

99.5

99

98

95

90

DN value
Cumulative Percentage
DN value

Different linear stretch functions


In Figure 6.2, four different linear contrast stretch functions are given using different
lower and upper percentages to be ignored.

Figure 6.2:

Linear stretch functions using different input intervals.

These four functions were derived using:


1) No stretching
2) Stretching between minimum and maximum values
3) 1 and 99% as lower and upper percentages
4) 5 and 95% as lower and upper percentages

! Indicate for each line in Figure 6.2, which linear stretch function is shown.
ILWIS 3.0 Users Guide

221

Image Processing
Histogram equalization
The histogram equalization stretching technique takes into account the frequency of
the DNs. Just as in linear stretching, percentages for the lower and upper DN values
can be specified, but also user-specified minimum and maximum values of the DNs
themselves can be given instead.

Open the Stretch dialog box by double-clicking Stretch in the Operationlist.

Select Tmb1 as input Raster Map and Histogram Equalization with 10


intervals as stretching method. Each interval should receive 10% of the data.
Use the default Percentage 0.00 and type Tmb1_equal for the Output
Raster Map. Click the Show button to display the stretched map after the
stretching operation. The Display Options - Raster Map dialog box
appears.

Display the stretched image, using a Gray Representation.


Display the histogram of Tmb1_equal and check the frequency per interval.
Close the windows afterwards.

6.2.2 Spatial enhancement


The objective is to understand the concept of spatial enhancement using filters and to
be able to apply different types of filters.
Spatial enhancement procedures result in modification of an image pixel value, based
on the pixel values in its immediate vicinity (local enhancement). Filters are commonly used to:
1) correct and restore images affected by system malfunctioning,
2) enhance the images for visual interpretation and
3) extract features.
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 frequency 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 characterized 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.

222

ILWIS 3.0 Users Guide

Image Processing
Low pass filters. Applying a low pass filter has the effect of filtering out the high and
medium frequencies and the result is an image, which has a smooth appearance.
Hence, this procedure is sometimes called image smoothing and the low pass filter is
called a smoothing filter. It is easy to smooth an image. The basic problem is to do
this without losing interesting features. For this reason much emphasis in smoothing
is on edge-preserving smoothing.
High pass filters. Sometimes abrupt changes from an area of uniform DNs to an area
with other DNs can be observed. This is represented by a steep gradient in DN values. Boundaries of this kind are known as edges. They occupy only a small area and
are thus high-frequency features. High pass filters are designed to emphasize highfrequencies and to suppress low-frequencies. Applying a high pass filter has the
effect of enhancing edges. Hence, the high pass filter is also called an edge-enhancement filter.
Two classes of high-pass filters can be distinguished: gradient (or directional) filters
and Laplacian (or non-directional) filters. Gradient filters are directional filters and
are used to enhance specific linear trends. They are designed in such a way that edges
running in a certain direction (e.g. horizontal, vertical or diagonal) are enhanced. In
their simplest form, they look at the difference between the DN of a pixel to its
neighbor and they can be seen as the result of taking the first derivative (i.e. the gradient). Laplacian filters are non-directional filters because they enhance linear features in any direction in an image. They do not look at the gradient itself, but at the
changes in gradient. In their simplest form, they can be seen as the result of taking
the second derivative.
A filter usually consists of a 3x3 array (sometimes called kernel) of coefficients or
weighting factors. It is also possible to use a 5x5, a 7x7 or even a larger odd numbered array. The filter can be considered as a window that moves across an image and
that looks at all DN values falling within the window. Each pixel value is multiplied
by the corresponding coefficient in the filter. For a 3x3 filter, the 9 resulting values
are summed and the resulting value replaces the original value of the central pixel.
This operation is called convolution. Figure 6.3 illustrates the convolution of an
image using a 3x3 kernel.
The material used for this exercise consists of a Landsat TM 4 band: Tmb4 .

ILWIS 3.0 Users Guide

223

Image Processing
Low pass filters
To remove the high frequency components in an image, a standard low pass smoothing filter is used. In this activity a 3x3 average filter is going to be used.

In the Operation-tree, expand Image Processing and double-click the


Filter operation. The Filtering dialog box appears.

Select Raster Map Tmb4 , use the Linear Filter Type and the standard low
pass filter Avg3x3 . Enter Tm_average as Output Raster Map and click
the Show button.

Display the filtered and the unfiltered image next to each other and make a
visual comparison.

Create and apply a user-defined low pass filter


Besides using pre-defined filters, it is also possible to create and apply your own filter. A 3x3 low pass filter of the weighted mean type will be created and applied to the
image.

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.

Values for the low pass weighted mean filter.

Table 6.5:

1
2
1

2
4
2

1
2
1

Specify 0.0625 as Gain and close the Filter editor.

What is the function of the gain value?

224

Filter the image Tmb4 using the smoothing filter just defined. Select the created filter Weightmean from the Filter Name list box. The Domain for the
output map is Image . Type Weightmean as Output Raster Map and click
the Show button.

Compare this filtered image with the image filtered using the standard
smoothing filter.

ILWIS 3.0 Users Guide

Image Processing

Figure 6.3: Convolution, using a 3x3 filter with all coefficients equal to 1/9.

ILWIS 3.0 Users Guide

225

Image Processing
High pass filters
To enhance the high frequency components in an image, a standard high pass filter is
used. The applied filter is a 3x3 edge enhancement filter with a central value of 16,
eight surrounding values of -1 and a gain of 0.125.

Open the Filtering dialog box by selecting the Filter operation in the
Operation-list.

Select Raster Map Tmb4 and select the Linear filter Edgesenh . Enter the
name Edge for the Output Raster Map. The Domain should be Value
(negative values are possible!).

Accept the default value range and precision and click the Show button. The
raster map Edge is calculated and the Display Options - Raster Map dialog
box is opened.

Use a Gray Representation, accept all other defaults and click OK.

Close both map windows afterwards.

Display the unfiltered and the filtered image next to each other and make a
visual comparison.

Create and apply a user-defined Laplace filter


Figure 6.4 gives an example of a 3x3 Laplace filter. The product (sum) of the applied
filter is zero. A gain factor to correct the effect of the filter coefficients is therefore
not necessary. When these type of filters are applied, the resulting values can be both
negative and positive. It is for this reason that ILWIS stores the results of these computations in maps with a value domain.
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.
Values for the Laplace Plus filter.

Table 6.6:

0
-1
0

226

-1
5
-1

0
-1
0

Accept the default Gain and close the Filter editor.

ILWIS 3.0 Users Guide

Image Processing
What is the function of the gain value here?

Filter image Tmb4 using the previously defined Laplace_plus filter. Use
Domain Value and the default value range and step size.

Filter image Tmb4 using a standard Laplace filter. Use the Domain Value
and the default value range and precision.

Compare both filtered images by displaying them in two different map windows using a Gray Representation.

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 lineaments running north-south, an x-gradient filter can be used.

Create a directional filter according to the table below using the same procedures as given in the former exercise.
Values for the directional filter.

Table 6.7:

1
1
1

0
0
0

-1
-1
-1

Filter image Tmb4 using the previously created directional filter.

Display the original image Tmb4 and the two filtered images.

Create the same type of directional filter, but now a filter to enhance the lineaments in an east-west direction and filter also the image Tmb4 .

Explain the difference between these images?

ILWIS 3.0 Users Guide

227

Image Processing

Figure 6.4:

228

Convolution, using a 3x3 Laplacian filter.

ILWIS 3.0 Users Guide

Image Processing
Summary: Image enhancement
- Contrast enhancement, also called global enhancement, transforms the raw data
using the statistics computed over the whole data set.
- Techniques used for a contrast enhancement are: the linear stretching technique and
histogram equalization. To enhance specific data ranges showing certain land cover
types the piece-wise linear contrast stretch can be applied.
- The linear stretch is the simplest contrast enhancement. A DN value in the low end
of the original histogram is assigned to extreme black, and a value at the high end
is assigned to extreme white.
- The histogram equalization technique is a non-linear stretch. In this method, the
DN values are redistributed on the basis of their frequency. More different gray
tones are assigned to the frequently occurring DN values of the histogram.
- Spatial enhancement procedures result in modification of an image pixel value,
based on the pixel values in its immediate vicinity (local enhancement).
- Low pass filters are designed to emphasize low frequency features and to suppress
the high frequency component of an image. High pass filters do just the reverse.
- Two classes of high-pass filters can be distinguished: gradient (or directional) filters and Laplacian (or non-directional) filters.
- Gradient filters are directional filters and are used to enhance specific linear trends.
- Laplacian filters are non-directional filters because they enhance linear features
having almost any direction in an image.
- A filter usually consists of a 3x3 array (sometimes called kernel) of coefficients or
weighting factors.
- Each pixel value is multiplied by the corresponding coefficient in the filter. The 9
values are summed and the resulting value replaces the original value of the central
pixel. This operation is called convolution.

ILWIS 3.0 Users Guide

229

Image Processing

6.3 Visualizing multi-band images


In this section, the objective is to understand the concept of color composites and to
be able to create different color composites.
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 primary colors: Red, Green and Blue.
A specific combination of bands used to create a color composite image is the socalled False Color Composite (FCC). In a FCC, the red color is assigned to the nearinfrared 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 layers created by band rationing or Principal Component Analysis, can also be combined
using the color composite technique. An example could be the multi-temporal combination 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).

6.3.1 Color composites


Color composites are created and displayed on the screen, by combining the spectral
values of three individual bands. Each band is displayed using one of the primary colors. In Figure 6.5 the color cube is represented and the primary additive (Red, Green
and Blue) and subtractive colors (Yellow, Magenta, Cyan) are given. A combination
of pixels with high DN values for the individual bands results in a light color.
Combining pixels with low DN values produces a dark color. Each point inside the
cube produces a different color, depending on the specific contribution of red, green
and blue it contains.
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 values 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.
230

ILWIS 3.0 Users Guide

Image Processing

Figure 6.5:

Color cube.

The pixel values from the three input images are used to set values for corresponding
pixels in the composite. One input band gives the values for red (R), another the values for green (G) and the third for blue (B) (Figure 6.6).

Figure 6.6:

The link between a color composite, the source images and the representation. n is
the number of colors.

In ILWIS, color composites can be created using different method: interactively by


storing the screen results as a Map View or permanently by creating an output raster
map with the Color Composite operation.
Interactive false and pseudo natural color composites
In the exercises below, both an interactive false color composite and an interactive
pseudo natural color composite, will be created using Landsat TM bands. For the creation of the false color composite, three TM bands have to be selected. Enter the corresponding TM bands for the spectral ranges indicated in Table 6.8.
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

ILWIS 3.0 Users Guide

231

Image Processing
Which bands have to be selected, to create an interactive pseudo natural color composite using three TM bands?
Write down the color assignment in Table 6.9.
Table 6.9:

Spectral 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.

To display the map list as a color composite:

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 Users Guide

Image Processing

Create also a pseudo natural color composite, according to the color


assignment given in Table 6.9.

Display both interactive color composites and add the polygon map Landuse
to the map windows (display only the boundaries).

How can the color differences between the two displayed images be explained?

Close both map windows when you have finished the exercises.

Permanent Color Composite


The Color Composite operation is used to create permanent color composites. In
this operation color composites can be created in various ways:
- Standard Linear Stretching;
- Standard Histogram Equalization;
- Dynamic;
- 24 Bit RGB Linear Stretching;
- 24 Bit RGB Histogram Equalization;
- 24 Bit HSI.
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 the Operation-tree, open the Image Processing item, and double-click


the Color Composite operation. The Color Composite dialog box is
opened.

Select image Tmb4 for the Red Band, Tmb3 for the Green Band and Tmb2
for the Blue Band .

Type Tmccp432 in the Output Raster Map text box, accept all other default
and click Show. The permanent color composite is calculated and the
Display Options - Raster Map dialog appears.

Click OK to display the map and close it after you have seen the result.

Summary: Visualizing multi-band images


- 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 primary colors: red, green and blue.
- In a False Color Composite (FCC), the red color is assigned to the near-infrared
ILWIS 3.0 Users Guide

233

Image Processing
band, the green color to the red visible band and the blue color to the green visible
band.
- In a Pseudo Natural Color Composite, the output resembles natural colors.: water is
displayed in blue, (bare) soil as red and vegetation as green.
- In ILWIS, there are two ways in which you can display or create a color composite:
interactive by showing a Map List as Color Composite and permanent by using
the Color Composite operation.

234

ILWIS 3.0 Users Guide

Image Processing

6.4 Geometric corrections and image referencing


Remote sensing data is affected by geometric distortions due to sensor geometry,
scanner and platform instabilities, earth rotation, earth curvature, etc. Some of these
distortions are corrected by the image supplier and others can be corrected referencing the images to existing maps.
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 correct and adapt them geometrically, so that they have comparable resolution and projections as the other data sets.
The geometry of a satellite image can be distorted with respect to a north-south oriented map:
-

Heading of the satellite orbit at a given position on Earth (rotation).


Change in resolution of the input image (scaling).
Difference in position of the image and map (shift).
Skew caused by earth rotation (shear).

The different distortions of the image geometry are not realized in certain sequence,
but happen all together and, therefore, cannot be corrected stepwise. The correction
of all distortions at once, is executed by a transformation which combines all the
separate corrections. The transformation most frequently used to correct satellite
images, is a first order transformation also called affine transformation. This transformation can be given by the following polynomials:
X = a0 + a1rn + a2cn
Y = b0 + b1rn + b2cn

where:
rn is the row number, cn is the column number, X and Y are the map coordinates.
To define the transformation, it will be necessary to compute the coefficients of the
polynomials (e.g. a0, a1, a2, b0, b1 and b2). For the computations, a number of points
have to be selected that can be located accurately on the map (X, Y) and which are
also identifiable in the image (row , column ). The minimum number of points
required for the computation of coefficients for an affine transform is three, but in
practice you need more. By selecting more points than required, this additional data is
used to get the optimal transformation with the smallest overall positional error in the
selected points. These errors will appear because of poor positioning of the mouse
pointer in an image and by inaccurate measurement of coordinates in a map. The
overall accuracy of the transformation is indicated by the average of the errors in the
reference points: The so-called Root Mean Square Error (RMSE) or Sigma.
If the accuracy of the transformation is acceptable, then the transformation is linked
with the image and a reference can be made for each pixel to the given coordinate
ILWIS 3.0 Users Guide

235

Image Processing
system, so the image is geo-referenced. After geo-referencing, the image still has its
original geometry and the pixels have their initial position in the image, with respect
to row and column indices.
In case the image should be combined with data in another coordinate system or georeference, then a transformation has to be applied. This results in a new image
where the pixels are stored in a new row/column geometry, which is related to the
other georeference (containing information on the coordinates and pixel size). This
new image is created by applying an interpolation method called resampling. The
interpolation method is used to compute the radiometric values of the pixels, in the
new image based on the DN values in the original image.
After this action, the new image is called geo-coded and it can be overlaid with data
having the same coordinate system.

In case of satellite imagery from optical systems, it is advised to use a linear


transformation. Higher order transformations need much more computation time
and in many cases they will enlarge errors.
The reference points should be well distributed over the image to minimize the
overall error. A good choice is a pattern where the points are along the borders of
the image and a few in the center.

6.4.1 Geo-referencing using corner coordinates


When an image (raster map) is created, either by a satellite, airborne scanner or by an
office scanner, the image is stored in row and column geometry in raster format.
There is no relationship between the rows/columns and real world coordinates (UTM,
geographic coordinates, or any other reference map projection). In a process called
geo-referencing the relation between row and column numbers and real world coordinates are established.
In general, five approaches can be followed:
- 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 output georeference during resampling.
- Georeference Tiepoints (see section 6.4.2): Specifying reference points in an image
so that specific row/column numbers obtain a correct X, Y coordinate. All other
rows and columns then obtain an X, Y coordinate by an affine, second order or projective transformation as specified by the georeference tiepoints. A georeference
tiepoints can be used to add coordinates to a satellite image or to a scanned photograph and when you do not have a DTM. This type of georeference can be used to
resample (satellite) images to another georeference (e.g. to a georeference corners)
or for screen digitizing.
236

ILWIS 3.0 Users Guide

Image Processing
- Georeference Direct Linear: A georeference direct linear can be used to add coordinates to a scanned photograph which was taken with a normal camera, and when
you have an existing DTM to also correct for tilt and relief displacement (Direct
Linear Transformation). With this type of georeference you can for instance add
coordinates to small format aerial photographs without fiducial marks and for subsequent screen digitizing or to resample the photograph to another georeference
(e.g. to a georeference corners).
- Georeference Orthophoto: A georeference orthophoto can be used to add coordinates to a scanned aerial photograph with fiducial marks, taken with a photogrammetric camera with known principal distance, and when you have an existing DTM
to also correct for tilt and relief displacement (Differential rectification). You can
use this type of georeference to add coordinates to professional near vertical aerial
photographs and further monoplotting on the photograph and as the first step in
creating an orthophoto (the second step is to resample it to a north-oriented georeference).
- Georeference 3D: A georeference 3D can be used to obtain a 3 dimensional picture
of a raster map overlaid by vector maps. A DTM of the area is required. Georef 3D
will be explained in section 10.5.

Figure 6.7:

The principle of Georeference Corners. The coordinates are defined by the coordinates of the corners and the pixel size.

In this exercise we will create a north-oriented georeference corners to which all the
maps will be resampled in a later stage.

Open the File menu in the Main window and select Create, GeoReference.
The Create GeoReference dialog box is opened.

Enter Flevo for the GeoReference Name. Note that the option GeoRef
Corners is selected.

Type: GeoReference Corners for the Flevo Polder in the text box
Description.

Click the Create button next to the Coordinate system list box. The
Create Coordinate System dialog box is opened.

ILWIS 3.0 Users Guide

237

Image Processing
As already mentioned in chapter 2, a georeference is linked to a coordinate system;
the coordinate system contains the minimum and maximum coordinates of the study
area, and optional projection parameters. It is always advised to create a coordinate
system of type Projection for the study area in which you are working, even if
you do not have projection information, instead of using the coordinate system
Unknown . This is important if you want to transform later on other data that have different coordinate systems and/or projections.

Type Flevo for the Coordinate System Name.

In the dialog box type the following coordinates for Min X, Y: 188000 and
510000 , and for Max X, Y: 201000 and 522000 and click OK. In a later
stage we may add possible projection information.

You are back in the Create Georeference dialog box. Enter for the Pixel
size: 10 (meters).

Use the same coordinates for Min X, Y and Max X, Y as for Coordinate
System Flevo , clear the check box Center of Corner Pixels and click OK.

Type Coordinate system for the Flevo Polder in the text box
Description, select CoordSystem Projection and click OK. The
Coordinate System Projection dialog box is opened.

A georeference of 1200 lines and 1300 columns will be created.


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.

6.4.2 Geo-referencing a raster image using reference points


In many cases, you do not know the X, Y coordinates of the corners of the map or
image. You only know the coordinates for some points in the image. In this case georeferencing will be done by specifying reference points (tiepoints) that relate for distinct points their row/column number with the corresponding X, Y coordinate (Figure
6.8).

Figure 6.8: Geo-referencing using reference points or tiepoints.

For a number of points that can be clearly identified, both in the image as on a topographic map, the coordinates are determined. Reference points have to be carefully
238

ILWIS 3.0 Users Guide

Image Processing
selected. Corresponding locations of objects in the image and on a map, have to be
carefully addressed and measured, especially when there is a large time difference
between the production of the map and the acquisition date of the image. Examples
of good reference points are highway intersections, fixed river crossings (bridges),
railway crossings, runways/airports, etc.
The entered reference points are used to derive a polynomial transformation of the
first, second or third order. Each transformation requires a minimum number of reference points (3 for affine, 6 for second order and 9 for third order polynomials). In
case more points are selected, the residuals and the derived Root Mean Square Error
(RMSE) or Sigma, may be used to evaluate the calculated equations.
After geo-referencing, the corresponding X, Y coordinate is returned each time a
pixel is addressed in the display window. Note that the scanned image is not actually
transformed. The original arrangement of the pixels is still intact and no resampling
has taken place yet.
In the following exercises we will use raster map Polder which is a scanned topographic map of part of the Flevopolder near Vollenhove, the Netherlands. An analog
map of the area is also available (see Figure 6.9).

Display the scanned topographic map Polder and zoom in to see more
detail. As you can see this map is a bit rotated.

Move the mouse pointer over the map and note that on the Status bar of the
map window, the row and column location of the mouse pointer is shown and
the message No Coordinates. This means that the image is not geo-referenced yet.

Study the coordinates on the analog topographic map. The georeference is going to
be created using reference points. Selection of the reference points (in ILWIS also
called tiepoints or Ground Control Points (GCPs)) is made on a reference map.

In the map window, open the File menu and select Create, GeoReference.
The Create Georeference dialog box is opened.

Enter Flevo2 for the GeoReference Name.

Check if the option Georef Tiepoints is selected.

Type Georeference Tiepoints for the Flevo Polder in the text box
Description.
Select Coordinate System Flevo (the one you created in the previous exercise) and click OK.

ILWIS 3.0 Users Guide

239

Image Processing

Figure 6.9: The topographic map of the Flevo Polder (The Netherlands). Note that the coordinates are in kilometers.

240

ILWIS 3.0 Users Guide

Image Processing
The GeoReference TiePoints editor (Figure 6.10) is opened. It consists of the map
window, in which you will see the mouse pointer as a large square, and a table with
the columns X, Y, Row , Column , Active , DRow , Dcol . For more information about
the Georeference Tiepoints editor see section 6.4.3 or the ILWIS Help topic
Georeference Tiepoints editor: Functionality.

Figure 6.10: Georeference Tiepoints editor.

Zoom in on the map to a point where horizontal and vertical gridlines intersect (for example P1: x=191000 and y=514000 ).

Locate the mouse pointer exactly at the intersection and click. The Add Tie
Point dialog box appears. The row and column number of the selected pixel
are already filled out. Now enter the correct X, Y coordinates for this pixel
(x=191000 and y=514000 ). Then click OK in the Add Tie Point dialog
box. The first reference point (tiepoint) will appear in the tiepoints table.

Repeat this procedure for at least 3 more points. You can use for instance the
following points:
P2 (x=199000 , y=514000 );
P3 (x=199000 , y=519000 );
P4 (x =191000 , y=519000 ).

Accept the default Affine Transformation method and close the


Georeference Tiepoints editor by pressing the Exit Editor button
toolbar when the Sigma value is less than 1 pixel.

in the

You will return to the map window. Move the mouse pointer over the map and
note that on the Status bar of the map window the row and column location
of the mouse pointer as well as the X and Y coordinates are shown. The
image is now geo-referenced.

ILWIS 3.0 Users Guide

241

Image Processing

6.4.3 Image-to-image registration


Accurate topographic maps are often not available to perform a standard geometric
correction or georeferencing. In order to combine images of different dates and/or
from different sensor systems, an image-to-image registration is executed. In an
image-to-image registration, the distortions are not removed and no referencing to a
coordinate system is needed. In image registration, one image is selected as reference
and another image is matched to that one. The base image is often referred to as master image and the other one is called the slave image. The slave image is resampled to
the master image. This requires the availability of objects identifiable on both images
(Figure 6.11).

Figure 6.11: Image-to-image registration.

The registration operation does not imply correcting any geometric errors inherent in
the images, since geometric errors are immaterial in many applications e.g. in change
detection. For referencing an image to any geometric system, tiepoints are needed.
These points should not be named ground control points or geo-reference points,
since no relation is specified between the selected point and a location expressed in
any map projection system. However, the master image has to be linked in an earlier
process to a reference system. The slave image will inherit this reference system after
registration. The definition of the transformation used for the registration and the
resampling is further identical to the geo-referencing. The transformation links the
row/column geometry of the slave to the row/column geometry of the master.
Now that the scanned topographic map Polder is georeferenced, we will use it (as
master) to georeference the images Spotb1 , Spotb2 and Spotb3 (the slaves) of the
same region.

242

Open satellite image Spotb3 .

Enter Flevo3 for the GeoReference Name.

In the map window, open the File menu and select Create, GeoReference.
The Create GeoReference dialog box is opened.
Type: GeoReference for the Flevo Polder in the text box
Description.

ILWIS 3.0 Users Guide

Image Processing

Select the option GeoRef Tiepoints.


Select the Coordinate System Flevo and click OK. The Georeference
Tiepoints editor is appears.
Position the window Spotb3 and Polder next to each other so that you can
see both clearly.

At this point you can start entering the reference points (tiepoints) by clicking pixels
in the slave (to obtain Row /Column numbers) and then clicking at the same position
in the master (to obtain X,Y coordinates).
The following procedures can be used to enter tiepoints in the Georeference
Tiepoints editor (Figure 6.10):
- Firstly, click with the mouse pointer at a recognizable point in the background map
without coordinates (the slave). The Add Tie Point dialog box appears. In this dialog box, the row and column values at the position of the click are shown. When
already sufficient tiepoints are selected, the dialog box will come up with a suggestion for the XY coordinates (which should never be accepted without reflection).
Then:
- Click at the same position in a map of the same area which is already georeferenced (the master) and which is displayed in another map window (in this case the
map Polder ), or;
- Digitize the same point in an analog paper map which is fixed onto a digitizer, or;
- Read the correct XY coordinates for this point from an analog paper map or a
table, and type these XY coordinates in the dialog box.

Choose a location in the slave image Spotb3 for which you can find the
coordinate pair in the master image Polder .

Zoom in on the chosen location, and click the reference point in the slave
image as accurately as possible. The Add Tie Point dialog box appears.

Go to the map window with the master raster map and click the pixel, which
corresponds to that position. In the Add Tie Point dialog box, the correct X
and Y coordinates are filled out now.

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-

ILWIS 3.0 Users Guide

243

Image Processing
dom, and gives a measure for the overall accountability or credibility of the active tiepoints. The overall sigma value indicates the accuracy of the transformation.
Based on the expected geometric distortions in the background image a transformation method can be selected. By default, an Affine transformation is used. You can
choose another transformation method in the Transformation dialog box (Edit menu,
or context-sensitive menu) as well as in the drop-down list box in the toolbar of the
GeoReference Tiepoints editor.

For satellite images an affine transformation will usually do.


For a scanned photograph (without DTM), a projective transformation is recommended.

A tiepoint can be selected or excluded from the transformation computation by putting True or False respectively in the column Active . By excluding tiepoints, you
can for instance evaluate the performance of the transformation; assuming that the
excluded tiepoints are correctly chosen. Furthermore, in the Georeference
Tiepoints editor, good tiepoints are shown in green, medium good tiepoints are
shown in yellow, bad tiepoints are shown in red, and passive tiepoints are shown in
blue. You can set these colors in the Customize Georeference Tiepoints editor dialog box.
A tiepoint is considered well positioned if:
(DRow 2+DCol 2)<=(1.2*Sigma)

A tiepoint is considered to have a medium error if:


(1.2*Sigma)<(DRow 2+DCol 2)<=(2*Sigma)

A tiepoint is considered to have a large error if:


(DRow 2+DCol 2)>(2*Sigma)

A tiepoint can be deleted by clicking its record number and by selecting Edit, Delete
Tiepoint, or by pressing <Delete> on the keyboard. If confirmed, the tiepoint will be
deleted.

Inspect the DRow and DCol values and inspect the Sigma .
Close the GeoReference Tiepoints editor when finished.
You will return to the map window. See that the image Spotb3 now has
coordinates. Move the mouse pointer around in the image and determine for
some easy identifiable pixels the accuracy of the transformation. Use the
zoom in option if necessary.

The georeference Flevo3 created for Spotb3 can also be used for other bands
(Spotb1 and Spotb2 ) since all bands refer to the same area and have the same
number of rows and columns.

244

ILWIS 3.0 Users Guide

Image Processing

In the Catalog click Spotb1 with the right mouse button and select
Properties. In the Properties of Raster Map Spotb1 sheet, change the
GeoReference of the image to Flevo3 . Close the Properties sheet.

Do the same for Spotb2 and close all windows when all three SPOT bands
are georeferenced.

6.4.4 Geo-coding a raster image by resampling


After geo-referencing an image, the image will have coordinates for each pixel, but
its geometry is not corrected for geometric distortions and not adapted to a master
map or image. To create a distortion free adapted image, the transformation that is
defined during geo-referencing (see previous exercise) is executed. This process, geocoding, results in a new image in which the pixels are arranged in the geometry of
the master image or map, and the resolution is equal to the resolution of the master
image or chosen in case the master is a topographic map. The radiometric values or
pixel values of the new image are found by resampling the original image using a
chosen interpolation method (Figure 6.12).
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.

Figure 6.12: The process of geo-coding.

There are three different interpolation methods:


- Nearest Neighbour. In the nearest neighbor method, the value for a pixel in the
ILWIS 3.0 Users Guide

245

Image Processing
output image is determined by the value of the nearest pixel in the input image
(Figure 6.13 A).
- Bilinear. The bilinear interpolation technique is based on a distance dependent
weighted average, of the values of the four nearest pixels in the input image (Figure
6.13 B).
- Bicubic. The cubic or bicubic convolution uses the sixteen surrounding pixels in
the input image. This method is also called cubic spline interpolation.

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 georeference. First the map Polder will be resampled to the north-oriented georeference corners Flevo ; then you will resample the Spot images to the same georeference corners Flevo .

Display the scanned topographic map Polder and indicate with a drawing
how the map should be rotated.

Close the map window.

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.

Double-click the Resample operation in the Operation-list in order to display the Resample Map dialog box.

246

ILWIS 3.0 Users Guide

Image Processing

Click OK to display the map.

Close the map windows when you finished the exercise.

Repeat this procedure for Spotb1 , Spotb2 and Spotb3 successively. Call
the output maps for instance Spotb1_resampled , Spotb2_resampled
and Spotb3_resampled .

What will happen to output pixel values if you use a bilinear or a bicubic
interpolation during resampling?

All the maps now have the same georeference Flevo and it is possible now to combine the maps with other digitized information of the area (that is rasterized on georeference Flevo as well).
Adding projection information to a coordinate system (additional exercise)
Coordinate system Flevo as created in section 6.4.1 and used by georeference
Flevo , did not yet have projection information. However, we know that the topographic map of the Flevopolder area uses the standard Dutch RD projection
(Rijksdriehoeksmeeting). We will now add this information to coordinate system
Flevo .

In the Catalog, double-click coordinate system Flevo .


In the appearing dialog box Coordinate System Projection Flevo, click
the Projection button. The Select Projection dialog box is opened and
shows a list of projections.
Select Dutch RD and click OK.
For the Dutch RD projection, datum and ellipsoid are already fixed, the information appears at the bottom in the dialog box. Click OK in the Coordinate
System Projection Flevo dialog box.

Display the map Polder or Polder_resampled again and note that the
Status bar now also displays geographical coordinates in latitudes and longitudes.

Close the map window afterwards.

Summary: Geometric corrections and image referencing


- Remote sensing data is affected by geometric distortions due to sensor geometry,
scanner and platform instabilities, earth rotation, earth curvature, etc.
- 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 correct and adapt them geometrically, so that they have comparable resolution and projections as the other data sets.
ILWIS 3.0 Users Guide

247

Image Processing
- The geometric correction is executed by a transformation. The transformation most
frequently used to correct satellite images, is a first order transformation also called
affine transformation.
- To define the transformation, it will be necessary to compute the coefficients of the
polynomials. For the computations, a number of points have to be selected that can
be located accurately on the map (X,Y ) and which are also identifiable in the image
(row , column ).
- The overall accuracy of the transformation is indicated by the average of the errors
in the reference points: The so-called Root Mean Square Error (RMSE) or Sigma.
- After geo-referencing, the image still has its original geometry and the pixels have
their initial position in the image, with respect to row and column indices.
- In case the image should be combined with data in another coordinate system or
with another georeference, a transformation has to be applied. This results in a
new image where the pixels are stored in a new line/column geometry, which is
related to the other georeference. This new image is created by means of resampling, by applying an interpolation method. The interpolation method is used to
compute the radiometric values of the pixels, in the new image based on the DN
values in the original image.
- After this action, the new image is called geo-coded and it can be overlaid with
data having the same coordinate system.

248

ILWIS 3.0 Users Guide

Image Processing

6.5 Multi-band operations


To enhance or extract features from satellite images, which cannot be clearly detected
in a single band, you can use the spectral information of the object recorded in multiple bands. These images may be separate spectral bands from a single multi-spectral
data set, or they may be individual bands from data sets that have been recorded at
different dates or using different sensors.
The operations of addition, subtraction, multiplication and division, are performed on
two or more co-registered images of the same geographical area. This section deals
with multi-band operations. The following operations will be treated:
- The use of ratio images to reduce topographic effects.
- Vegetation indices, some of them are more complex than ratios only.
- Multi-band statistics.
- Principal Components Analysis.
- Image algebra.
- Image fusion.

6.5.1 Image ratios: Brightness variations


When a satellite passes over an area with relief, it records both shaded and sunlit
areas. These variations in scene illumination conditions are illustrated in Figure 6.14.
A red silt stone bed shows outcrops on both the sunlit and the shadowed side of a
ridge. The observed DNs are substantially lower on the shaded side compared to the
sunlit areas. This makes it difficult to follow the silt stone bed around the ridge.

Figure 6.14: Shadow effects.

In the individual Landsat-TM bands 3 and 4, the DNs of the silt stone are lower in the
shaded than in the sunlit areas. However, the ratio values are nearly identical, irrespective of illumination conditions. Hence, a ratioed image of the scene effectively
compensates for the brightness variation, caused by the differences in topography and
emphasizes by the color content of the data (Table 6.10).
ILWIS 3.0 Users Guide

249

Image Processing
Table 6.10: Differences in DN values of selected bands and the ratio values.
TM Band 3

TM Band 4

Ratio: Band3/Band4

94
76

42
34

2.24
2.23

Sunlit slope
Shaded slope

In this section, ratioed images are created in order to minimize the effects of differences in illumination.
To show the effect of band ratios for suppressing topographic effects on illumination,
Landsat TM bands 4 and 5 are used. The northern part of the image displays mountainous areas, where variation in illumination due to the effect of topography are
obvious.

Display the images Tmb4 and Tmb5 using a Gray Representation.


Visually inspect the two displayed bands on the effect of illumination conditions. Use the mouse to view the DNs in the mountain areas.

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.

Double-click the Map Calculation item in the Operation-list. The Map


Calculation dialog box is opened.

In the Expression text box type the following map calculation formula:
Tmb5/Tmb4

Enter Shadow for Output Raster map, select as system Domain Value,
click on the Defaults button and click Show. The map Shadow is calculated
and the Display Options - Raster Map dialog box is opened.

Accept the defaults and click OK.

Evaluate the effect of shadow suppression by means of this band ratio. Select
pixels on the sunlit and the shadow side of a water divide.

Close all windows.

Zoom in on a sunlit-shaded part of the image.


Open the pixel information window and drag-and-drop raster maps Tmb4 ,
Tmb5 and Shadow .

6.5.2 Normalized Difference Vegetation Index


Ratio images are often useful for discriminating subtle differences in spectral variations, in a scene that is masked by brightness variations. Different band ratios are
possible, given the number of spectral bands of the satellite image. The utility of any
given spectral ratio depends upon the particular reflectance characteristics of the features involved and the application at hand. For example a near-infrared / red ratio
250

ILWIS 3.0 Users Guide

Image Processing
image might be useful for differentiating between areas of stressed and non-stressed
vegetation.
Various mathematical combinations of satellite bands, have been found to be sensitive
indicators of the presence and condition of green vegetation. These band combinations are thus referred to as vegetation indices. Two such indices are the simple
Vegetation Index (VI) and the Normalized Difference Vegetation Index (NDVI). Both
are based on the reflectance properties of vegetated areas as compared to clouds,
water and snow on the one hand, and rocks and bare soil on the other. Vegetated areas
have a relatively high reflection in the near-infrared and a low reflection in the visible
range of the spectrum. Clouds, water and snow have larger visual than near-infrared
reflectance. Rock and bare soil have similar reflectance in both spectral regions. The
effect of calculating VI or the NDVI is demonstrated in Table 6.11.
Table 6.11: Reflectance versus ratio values.

Green vegetation
Water
Bare soil

TM Band 3

TM Band 4

VI

NDVI

21
21
123

142
12
125

121
-9
2

0.74
-0.27
0.01

It is clearly shown that the discrimination between the 3 land cover types is greatly
enhanced by the creation of a vegetation index. Green vegetation yields high values
for the index. In contrast, water yield negative values and bare soil gives indices near
zero. The NDVI, as a normalized index, is preferred over the VI because the NDVI is
also compensating for changes in illumination conditions, surface slopes and aspect.
To create a NDVI map, Landsat TM imagery of Cochabamba, Bolivia, is used. The
following bands are used: Tmb3 and Tmb4 .
The creation of the NDVI is done with the map calculator.

Double-click the Map Calculation operation in the Operation-list. The


Map Calculation dialog box is opened.

In the Expression text box type the following map calculation formula:
(Tmb4-Tmb3)/(Tmb4+Tmb3)

Enter NDVI for Output Raster map, select system Domain Value, change
the Value Range to -1 and +1 , and the Precision to 0.01 .

Click Show. The map NDVI is calculated and the Display Options - Raster
Map dialog box is opened.

In the Display Options - Raster Map dialog box select Pseudo as


Representation. In this representation the colors range from blue (for the
low DNs) through green (for the medium DNs) to red (for the high DNs).
Click OK. The map NDVI is displayed.

In the map window open the pixel information window and add the maps
Tmb3 and Tmb4 to it.

ILWIS 3.0 Users Guide

251

Image Processing

Move through the image with the mouse pointer and study the DN values of
the input maps and how they are combined in the NDVI map.

Calculate also a NDVI image using the images of the Flevo Polder, The
Netherlands. As these are SPOT images, select the appropriate bands (band
1=green, band 2=red and band 3=near infrared). Repeat the procedure as
described above. Before you create the NDVI image, first make sure that all
three bands (Spotb1 , Spotb2 and Spotb3 ) are georeferenced.

Close all windows after finishing the exercise.

You can also use the NDVI function in MapCalc:


NDVImap=NDVI(Tmb4,Tmb3)

See chapter 12 for further information.

6.5.3 Multi-band statistics


The distribution of data values in a single band could be represented graphically
using a histogram and mathematically by the variance statistics, which summarizes
the differences between all the pixel values and the mean value of the channel (the
range of data values in a channel is an indication of channel variability, it does not
indicate the way the values are distributed between the minimum and maximum
values). The correlation between two (or more) channels can be shown graphically by
a scatter plot and mathematically by the covariance statistics. A scatter plot is a two
dimensional graph, with on the horizontal axis the values of one channel, and on the
vertical axis the values of the second channel. The points in the graph indicate the
data or pixel values. 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.
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.

252

ILWIS 3.0 Users Guide

Image Processing

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.
In this exercise variance/covariance and correlation matrices are calculated for
Landsat TM, including all bands.

Double-click the Correlation Matrix operation in the Operation-list. The


Show Correlation Matrix dialog box is opened.

Select Tmbands for the Map List name and click OK.

The correlation, mean and standard deviation for these bands are calculated and
presented in the Matrix viewer. Study the correlation matrix and answer the following
questions:
1) Which band(s) in general show the least correlation and why?
2) Are the visible and the infra red bands highly correlated?
3) Select a band combination using three bands, showing most of the information or
in other words, those bands having the least correlation.

Display the three bands with the least correlation and combine them by constructing a color composite.

Close all windows/dialog boxes when you finished the exercise.

ILWIS 3.0 Users Guide

253

Image Processing
You can also have a look in the Properties of the map list. On the Additional Info
tab, Optimum Index Factors are listed. Click the Help button for more information.

6.5.4 Principal components analysis


Another method, called Principal Components Analysis (PCA), can be applied to
compact the redundant data into fewer layers. Principal component analysis can be
used to transform a set of image bands, as that the new layers (also called
components) are not correlated with one another. Because of this, each component
carries new information. The components are ordered in terms of the amount of
variance explained, the first two or three components will carry most of the real
information of the original data set, while the later components describe only the
minor variations (sometimes only noise). Therefore, only by keeping the first few
components most of the information is kept. These components can be used to
generate an RGB color composite, in which component 1 is displayed in red and
component 2 and 3 in green and blue respectively. Such an image contains more
information than any combination of the three original spectral bands.
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.

Figure 6.16: First (left) and second (right) principal components.

The second principal component is the widest transect of the ellipse that is
orthogonal (perpendicular) to the first principal component. As such, Principle
Component 2 (PC2) describes the largest amount of variance that has not yet been
described by Principle Component 1 (PC1). In a two-dimensional space, PC2
corresponds to the minor axis of the ellipse. In n-dimensions there are n principal
254

ILWIS 3.0 Users Guide

Image Processing

components and each new component is consisting of the widest transect which is
orthogonal to the previous components.
Figure 6.17 graphically shows the result of a Principal Components transformation in
which the data are presented without correlation.

Figure 6.17: Result of a Principal Components transformation.

Through this type of image transformation the relationship with raw image data is
lost. The basis is the covariance matrix from which the eigenvectors and eigenvalues
are mathematically derived. It should be noted that the covariance values computed
are strongly depending on the actual data set or subset used.
In this exercise, a principal components analysis is done using seven TM images in
the data set: Tmb1 , Tmb2 , Tmb3 , Tmb4 , Tmb5 , Tmb6 and Tmb7 .

Double-click the Principal Components operation in the Operation-list.

The Principal Components dialog box is opened. In this dialog box you can select
or create a map list.

Select Map List Tmbands .


Accept the Number of Output Bands, type Tm in the Output Matrix text
box and click Show. The Matrix viewer is opened.

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.

ILWIS 3.0 Users Guide

255

Image Processing

Table 6.12:

Eigenvalues.
Tmb1

Tm
Tm
Tm
Tm
Tm
Tm
Tm

Tmb2

Tmb3

Tmb4

Tmb5

Tmb6

Tmb7

PC1
PC2
PC3
PC4
PC5
PC6
PC7

All TM bands have a positive eigenvalue in principal component 1, therefore this PC


mainly explains the intensity difference of the input bands.
Explain the contribution of the TM bands in principal components 2 and 3?
Write down in the table below (Table 6.13) the variance explained per component.
Table 6.13:
PC

Tm
Tm
Tm
Tm
Tm
Tm
Tm

Variance explained.
Variance %

PC1
PC2
PC3
PC4
PC5
PC6
PC7

Open the Properties of map Tm PCl to check the expression of the first axis:
Tm PC1= 0.27*Tmb1 + 0.21*Tmb2 + 0.33*Tmb3 + 0.3*Tmb4
+ 0.72*Tmb5 + 0.19*Tmb6 + 0.37*Tmb7

Double-click raster map Tm PCl in the Catalog to calculate the first principal component.

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?

256

Calculate Tm PC3 .

ILWIS 3.0 Users Guide

Image Processing
A color composite can be created of the images produced by the principal component
analysis. To create such a color composite, the domain type of the images should be
changed from value to image.

Create an interactive color composite using images Tm PC1 , Tm PC2 and Tm


PC3 for the Red, Green and Blue Bands respectively. Remember that the
Tm PC maps should be in a map list.

Compare this color composite map with color composite Tmcc432 created
in section 6.3.

Close the map windows when you have finished the exercise.

6.5.5 Image arithmetics


Below, some examples of common used arithmetic operations are given. Images
recording the microwave portion of the electromagnetic spectrum are used. The Ers1
and Ers2 images are from the Flevo Polder, The Netherlands. The images have not
been georeferenced.

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.

Explain the effect of the formula Ers_average =(Ers1+Ers2)/2 ?

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 Users Guide

257

Image Processing

Add maps Ers_difference to the pixel information window (e.g. drag it


from the Catalog to the pixel information window). Move the cursor over
some of the pixels.

Describe the effect of this operation?

Close the map windows and the pixel information window when you have
finished the exercise.

6.5.6 Image fusion


Image fusion is the process of combining digital images, by modifying the data
values, using a certain procedure. Before starting the fusion process the data should
be properly co-registered. Combining for example both optical and microwave data,
through image fusion techniques, results in a new data set. One of the fusion
techniques has already been described: Principal Component Analysis (PCA).
Another commonly used technique is the Red-Green-Blue transformation (RGB) into
Intensity-Hue-Saturation (IHS), the intensity component is commonly replaced with
another image and the modified data set is transformed back into the three primary
colors. This technique is used to integrate for example a radar or panchromatic image
with a multi spectral data set.
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.

What can be concluded when looking at the spatial resolution?


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.

258

Create a map list by double-clicking New Map List in the Operation-list.


The Create Map List dialog box appears.

Type IrsBtm34 in the Map List box. Select the maps Irs1C , Btm3 and
Btm4 and press the > button to add the images to the map list. Click OK.

ILWIS 3.0 Users Guide

Image Processing

Double-click map list Irs1CBtm34 in the Catalog to open it.

Select for the Red Band: Irs1C , for the Green Band: Btm3 and for the
Blue Band: Btm4 . Accept the other defaults and click OK to display the
map.

Check the result and close the map window afterwards.

Click the Open As Color Composite button to open the Display Options Map List as ColorComp dialog box.

In the next step, the data sets are fused by means of a replacement of the combined
intensity of the three TM bands, by the intensity of the panchromatic image. This
results in a sharpening of the image due to the higher spatial resolution of the
panchromatic image. The results are again displayed as a color composite.

To calculate the combined intensity, type the following MapCalc formula on


the Command line of the Main window:
Intensity =(Btm3+Btm4+Btm5)/3

Make sure the Domain Image is selected in the Raster Map Definition dialog box and click Define.

For the intensity replacement, enter the expressions given below, choose for
each output map the Image Domain and accept the other defaults in the
Raster Map Definition dialog boxes.
Intensity1=Btm3/Intensity*Irs1c
Intensity2=Btm4/Intensity*Irs1c
Intensity3=Btm5/Intensity*Irs1c

Create a map list Intensity , add the three intensity maps and show a color
composite as follows:
for Red Band: Intensity1 ;
for Green Band: Intensity2 ;
for Blue Band: Intensity3 .

What can be concluded when the fused image is compared to the image created in the
previous exercise?

Close the map windows when you have finished the exercise.

ILWIS 3.0 Users Guide

259

Image Processing
Summary: Multi-band operations
- To enhance or extract features from satellite images, which cannot be clearly
detected in a single band, you can use the spectral information of the object
recorded in multiple bands.
- The operations of addition, subtraction, multiplication and division are performed
on two or more co-registered images of the same geographical area.
- Brightness variations: a ratioed image of the scene effectively compensates for the
brightness variation, caused by the differences in topography and emphasized by
the color content of the data.
- Normalized Difference Vegetation Index (NDVI): Ratio images are often useful for
discriminating subtle differences in spectral variations, in a scene that is masked by
brightness variations.
The utility of any given spectral ratio, depends upon the particular reflectance
characteristics of the features involved and the application at hand.
- Various mathematical combinations of satellite bands, have been found to be
sensitive indicators of the presence and condition of green vegetation. These band
combinations are thus referred to as vegetation indices. Two such indices are the
simple vegetation index (VI) and the normalized difference vegetation index
(NDVI).
- The NDVI, as a normalized index, is preferred over the VI because the NDVI is
also compensating for changes in illumination conditions, surface slopes and
aspect.
- Multi-band statistics
The distribution of data values in a single band could be mathematically
represented by the variance statistics, which summarize the differences between all
the pixel values and the mean value of the channel.
The correlation between two (or more) channels can be mathematically shown by
the covariance statistics.
The values in a covariance matrix indicate also the correlation: Large negative
values indicate a strong negative correlation, large positive values show a clear
positive relation and covariance values near to zero indicate a weak or no
correlation. The covariance values indicate the degree of scatter or shape of the
spectral cluster and the major direction(s).
The individual bands of a multi-spectral image are often highly correlated, which
implies that there is a redundancy in the data and information is being repeated. To
evaluate the degree of correlation between the individual bands a correlation matrix
can be used. This matrix (a normalized form of the covariance matrix) has values in
the range of -1 to 1.

260

ILWIS 3.0 Users Guide

Image Processing
- Principal Components Analysis
Principal Components Analysis (PCA) can be applied to compact the redundant
data into fewer layers. Principal component analysis can be used to transform a set
of image bands, as that the new layers are not correlated with one another. The first
two or three components will carry most of the real information of the original data
set. Therefore, only by keeping the first few components most of the information is
kept. Through this type of image transformation the relationship with the raw
image data is lost. It should be noted that the covariance values computed are
strongly depending on the actual data set or subset used.
- Image fusion is the process of combining digital images, by modifying the data
values, using a certain procedure. Data sets are for example fused by means of a
replacement of the combined intensity of the three TM bands, by the intensity of a
panchromatic image.

ILWIS 3.0 Users Guide

261

Image Processing

6.6 Image classification


Measured reflection values in an image depend on the local characteristics of the
earth surface; in other words there is a relationship between land cover and measured
reflection values. In order to extract information from the image data, this
relationship must be found. The process to find the relationship is called
classification. Classification can be done using a single band, in a process called
density slicing, or using many bands (multi-spectral classification).

6.6.1 Density slicing


In theory, it is possible to base a classification on a single spectral band of a remote
sensing image, by means of single band classification or density slicing.
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.

Display the image Spotb3 .


Move through the image and write down the values of water and land. Fill in
the data in Table 6.14. Zoom in if necessary. Select also some mixed pixels
along the land/water boundary.

Table 6.14:
Cover class

DN values per cover class of Spot Band 3.


DN values of Spot-XS Band 3

Land
Water

By a visual interpretation of the spectral reflectance of the cover classes in band 3,


differences are observed with regard to their gray tones. Density slicing will only give
reasonable results, if the DN values of the cover classes are not overlapping each
other, as indicated in Figure 6.18.
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
262

ILWIS 3.0 Users Guide

Image Processing

B and C several options are possible, but all will result in an improper slice
assignment. To classify cover class B, the slice DN 1 to DN 2 will include the lower
DN values of B and the higher DN values of B are excluded. To include all the
pixels belonging to B, the slice assignment is from DN 1 to DN 4. This slice
assignment is including even more pixels that belong to cover class C. When trying to
classify C, the same problem occurs.

Figure 6.18: Distribution of ground cover classes over the digital range.

Interactive slicing
Before a slicing operation is performed it is useful to firstly apply a method which
shows the map, as if it was classified, by manipulating the representation.

Display map Spotb3 with default Gray Representation.

Type for Representation Name: Spotb3 and click OK. The


Representation Value editor is opened.

Open the Edit menu and select Insert Limit. The Insert Limit dialog box is
opened. Enter the limit you have written down in Table 6.14 to differentiate
land from water, and select the color Blue .

Insert also the other limit shown in the table and select the color Green for it.

Click the Redraw button


representation.

When satisfied, close the Representation Value editor.

Reopen the Display Options - Raster Map dialog box and click the Create
button next to the Representation list box. The Create Representation
dialog box is opened.

Open the list box, which appears after you click the word Stretch between
the two limits. Select Upper. Do the same for the other.

ILWIS 3.0 Users Guide

in the map window to see the map with the new

263

Image Processing
The representation can thus be edited, and the result shown on the screen (by using
the Redraw button in the map window). This allows you to interactively select the
best boundaries for the classification.
Slicing operation
Now you will do the actual classification, using the Slicing operation.

Double-click the Slicing operation in the Operation-list. The Map Slicing


dialog box is opened.

Select Spotb3 in the Raster Map list box.


Type Slices in the Output Raster Map text box.
Type Classified SPOT image in the Description text box.
Click the Create Domain button. The Create Domain dialog box is opened.
Type Slices in the Domain Name text box.
Make sure that the Group check box is selected and accept all other defaults
by clicking the OK button. The Domain Group editor is opened.

For a group domain, you can enter an upper boundary, a name and a code for each
class/group. This domain will be used to slice or classify the raster map Spotb3 . The
upper boundaries and group names that you have entered in Table 6.14 will be used in
this exercise.

Click the
button in the toolbar of the Domain Group editor.
The Add Domain Item dialog box appears.

Type the value from Table 6.14 in the Upper Bound text box.

264

Type Water in the Name text box. The use of a Code and a Description is
optional. It will not be used now.
Click OK.
Press the Insert key of the keyboard to enter the next upper boundary and
name.

Press the Open Representation button


in the toolbar. The
Representation Class editor appears, showing the groups/classes that are
present in the domain with different colors.

Double-click a color box in the editor and select a pre-defined color, or create
your own color.

Exit the Representation Class editor when you are satisfied with the colors.
Exit the Domain Group editor.

ILWIS 3.0 Users Guide

Image Processing

Click Show in the Slicing dialog box. The Display Options - Raster Map
dialog box is opened.

Accept the defaults by clicking OK.

Close the windows after finishing the exercise.

In the map window open the pixel information window and compare the values of the original map with the names in the classified map.

When you create a domain group, a representation is also created. It is possible to


edit the colors of the output groups/classes from the Domain Group editor, or by
opening the representation in the Catalog. To edit the representation:
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.

6.6.2 Piece-wise linear stretching


In the same way as described in the exercise on interactive slicing, you can also do a
piece-wise linear stretching of images by creating a new representation. While for
interactive slicing, we used upper boundary values (Figure 6.19 left) for piece-wise
linear stretch, we will use the stretch option between limits (Figure 6.19 right).

Figure 6.19: Upper boundary method (left) and stretched method (right).

The piece-wise linear contrast stretch is very similar to the linear contrast stretch, but
the linear interpolation of the output values is applied between user-defined DN
values. This method is useful to enhance a certain cover type, for example water.

In the Catalog, double-click Spotb3 . The Display Options - Raster Map


dialog box appears.

In the Display Options - Raster Map dialog box click the Create
Representation button. The Create Representation dialog box is opened.

In the Create Representation dialog box type Piecewise for the


Representation Name accept the default Image Domain and click OK.
The Representation Value editor is opened.

ILWIS 3.0 Users Guide

265

Image Processing

Create a representation with the following limits and colors:


255 (LawnGreen)
68 (ForestGreen)
60 (MidnightBlue)
0 (Cyan)

Make sure that in between two limits, the coloring method Stretch is
selected and increase the Stretch Steps to 10 .

Close the Representation Value editor to return to the Display Options Raster Map dialog box.

Click OK to display the map.


Compare the output map with map Slices created in the previous exercise
and close both map windows when you are finished.

6.6.3 Multi-spectral image classification


Multi-spectral image classification is used to extract thematic information from
satellite images in a semi-automatic way. Different methods for image classification
exist; some of them are based on the theory about probabilities. Looking at a certain
image pixel in M bands simultaneously, M values are observed at the same time.
Using multi-spectral SPOT images, where M=3, three reflection values per pixel are
given. For instance, (34, 25, 117) in one pixel, in another (34, 24, 119) and in a third
(11, 77, 51). The values found for 1 pixel in several bands are called feature vectors.
It can be recognized that the first two sets of values are quite similar and that the
third is different from the other two. The first two probably belong to the same (land
cover) class and the third one belongs to another class.
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 3dimensional vector, the feature vector. Such a vector can be plotted in a 2- or 3dimensional 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.

266

ILWIS 3.0 Users Guide

Image Processing
In order to make the classifier work with thematic (instead of spectral) classes, some
knowledge about the relationship between classes and feature vectors must be given.
Theoretically, this could be done from a database in which the relationships between
(thematic) classes and feature vectors are stored. It is tempting to assume that in the
past, enough images of each kind of sensor have been analyzed, as to know the
spectral characteristics of all relevant classes. This would mean, for example, that a
pixel with feature vector (44, 32, 81) in a multi-spectral SPOT image always means
grass, whereas (12, 56, 49) is always a forest pixel.
Unfortunately, the observed feature vectors in a particular image are influenced by a
large amount of other factors than land cover, such as atmospheric conditions, sun
angle (as function of latitude, time of day, date and terrain relief), soil types, soil
humidity, growing stage of the vegetation, wind (affecting orientation of leafs), etc.
The problems we meet when trying to take all these influences into account vary
from quite easy to practically impossible; at least, vast amounts of additional data
(DEMs, soil maps, etc.) would be required.
Sampling
Therefore, supervised classification methods are much more widely used. The
process is divided into two phases: a training phase, where the user trains the
computer, by assigning for a limited number of pixels to what classes they belong in
this particular image, followed by the decision making phase, where the computer
assigns a class label to all (other) image pixels, by looking for each pixel to which of
the trained classes this pixel is most similar.
During the training phase, the classes to be used are defined. About each class some
ground truth is needed: a number of places in the image area that are known to
belong to that class. This knowledge must have been acquired beforehand, for
instance as a result of fieldwork, or from an existing map (assuming that in some
areas the class membership has not changed since the map was produced). If the
ground truth is available, training samples (small areas or individual pixels) are
indicated in the image and the corresponding class names are entered.
A sample set has to be created in which the relevant data regarding input bands (map
list), cover classes (domain codes) and background image for selecting the training
areas is stored. The map presented below is giving the ground truth information, as
well as the cover classes to be used. The images used in this exercise are SPOT
images from the area of the Flevo Polder, The Netherlands:
SPOT-XS band 1: Spotb1
SPOT-XS band 2: Spotb2
SPOT-XS band 3: Spotb3
As the selection of the training areas is done on a color composite, it has to be
created beforehand.
ILWIS 3.0 Users Guide

267

Image Processing

Create a map list which contains the SPOT bands and display this as a color
composite. Use Spotb3 for Red, Spotb2 for Green and Spotb1 for Blue.

You may save the color composite as a map view. In the following steps a sample set
will be created. This will be used for the actual sampling procedure.

In the map window, choose Create Sample Set from the File menu.
In the Sampling dialog box enter Spot_classes for the Sample Set
Name.
Create a domain for the classes to be sampled by selecting the Create
Domain button. The Create Domain dialog box is opened.

Enter Spot_classes for the Domain Name and click OK. The Domain
Class editor appears.

In the Domain Class editor, click the Add Item button. The Add Domain
Item dialog box is displayed.

Enter the Name: Forest , and the Code: f. Click OK. Repeat this for all
classes as given in Table 6.15. New classes can always be added later on.

Table 6.15:

The land-cover classes in the sample set for a supervised image classification.

Class name

water
forest
grass land
crop1
crop2
crop3

Code

w
f
gl
c1
c2
c3

After having entered all classes, open the Representation Class editor by
pressing the Open Representation button in the toolbar of the Domain
Class editor. Select each class by double-clicking it and choose a color from
the color list or define your own color.

Close the Representation Class editor and close the Domain Class editor
to return to the Create Sample Set dialog box.

The 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.

268

ILWIS 3.0 Users Guide

Image Processing

Zoom in on an area with water and press the Normal button in the toolbar to
return to the normal mode. To select pixels press the left mouse button and
drag the cursor. When the mouse button is released, the statistics of
the current selection of pixels are shown in the Sample Statistics window,
Current Selection (Figure 6.19).

Click the right mouse button to reveal the context-sensitive menu and select
Edit. Select the appropriate class from the class list (w: Water ). Once this
selection is added to the class, the total class statistics are shown in the upper
part of the table.

One can always compare the statistics of a sample with the statistics of a
class, by selecting the class in the class list.

Repeat the sampling procedure for a number of water samples and then continue with sampling the other land cover classes.

If a land cover class has not yet been defined and, therefore, does not appear
in the class list, a new class can be created by selecting <new> .

Add a new class (Name: Urban , Code: u). Take samples of this class.

To select multiple training pixels you can drag rectangles or you can hold the
Ctrl-key.

The Sample Statistics window contains the code and name of the selected class as
well as the number of bands. The following statistics are shown for a selected class
(see Figure 6.20):
-

Mean value of pixels (Mean).


Standard deviation of pixels (StDev).
The number of pixels having the predominant value (Nr).
The predominant pixel value (Pred.).
The total number of the selected pixels (Total).

Figure 6.20: The Sample Statistics window.

ILWIS 3.0 Users Guide

269

Image Processing
Displaying Feature Spaces
The classes can be plotted in distinct colors in the feature space, which enables a
judgement of whether the classes can really be spectrally distinguished and whether
each class corresponds to only one spectral cluster (if not, it is advisable to create
sub-classes, which must be joined after the classification is finished). After training is
done, a feature space with training samples may look like Figure 6.21.

Figure 6.21: Three examples of ILWIS Feature Space windows.

The number of training samples should be between 30 and some hundreds of samples
per class, depending on the number of features and on the decision making that is
going to be applied. The feature space is a graph in which DN values of one band are
plotted against the values of another. To view a feature space:

Click the Feature Space button in the toolbar of the Sample Set editor.
The Feature Space dialog box is opened.

Select two bands for which a feature space should be created. Select Spotb1
for the horizontal axis (band 1) and Spotb2 for the vertical axis (band 2).
Click OK. The feature space of Spotb1 against Spotb2 is displayed.

Try also the other band combinations for the feature space display.

You will probably see some overlapping classes in the feature space.
What can be said about the standard deviation for the urban area and how can this be
explained?

270

After you have finished the sampling, close all windows and return to the
ILWIS Main window.

ILWIS 3.0 Users Guide

Image Processing

6.6.4 Classification
It is the task of the decision-making algorithm to make a partitioning of the feature
space, according to our training samples. For every possible feature vector in the
feature space, the program must decide to which of the sets of training pixels this
feature vector is most similar. After that, the program makes an output map where
each image pixel is assigned a class label, according to the feature space partitioning.
Some algorithms are able to decide that feature vectors in certain parts of the feature
space are not similar to any of the trained classes. They assign to those image pixels
the class label Unknown. In case the area indeed contains classes that were not
included in the training phase, the result unknown is probably more realistic than to
make a wild guess.
To find the relationship between classes and feature vectors is not as trivial as it may
seem. Therefore, various decision-making algorithms are being used; they are
different in the way they partition the feature space. Four of them are:
- The Box classifier is the simplest classification method: In 2-D space, rectangles
are created around the training feature vector for each class; in 3-D they are
actually boxes (blocks). The position and sizes of the boxes can be exactly around
the feature vectors (Min-Max method), or according to the mean vector (this will
be at the center of a box) and the standard deviations of the feature vector,
calculated separately per feature (this determines the size of the box in that
dimension). In both cases, the user is allowed to change the sizes by entering a
multiplication factor. In parts of the feature space where boxes overlap, it is usual
to give priority to the smallest box. Feature vectors in the image that fall outside all
boxes will be unknown.
- The Minimum Distance-to-mean classifier, first calculates for each class the mean
vector of the training feature vectors. Then, the feature space is partitioned by
giving to each feature vector the class label of the nearest mean vector, according
to Euclidean metric. Usually it is possible to specify a maximum distance
threshold: if the nearest mean is still further away than that threshold, it is assumed
that none of the classes is similar enough and the result will be unknown.
- Minimum Mahalanobis Distance classifier. For the spectral values of a pixel to be
classified, the distances towards the class means are calculated as Mahalanobis
distance. The Mahalanobis distance depends on the distances towards class means
and the variance-covariance matrix of each class. The class name with the shortest
Mahalanobis distance is assigned, if this distance is smaller than the user-defined
threshold value. Else, the undefined value is assigned.
- Gaussian Maximum Likelihood classifiers assume that the feature vectors of each
class are (statistically) distributed according to a multivariate normal probability
density function. The training samples are used to estimate the parameters of the
distributions. The boundaries between the different partitions in the feature space
are placed where the decision changes from one class to another. They are called
decision boundaries.
ILWIS 3.0 Users Guide

271

Image Processing
In this exercise, different types of land-cover in the area will be detected by
implementing a supervised classification, using the sample set prepared in the
previous exercise on sampling. The output will be a map with domain type class
representing land-cover units in the area.
The four standard techniques for classifying an image in ILWIS are:
1) The Box classifier;
2) The Minimum Distance classifier;
3) The Mahalanobis Distance classifier, and
4) The Maximum Likelihood classifier.
Each classifier uses a sample set, only the procedure to classify an image is different.
Classification methods
The box classifier uses class ranges determined by the DN values observed in the
training set. These intervals result in rectangular spaces or boxes; hence, the name
box classifier.
Having sampled a representative amount of pixels per class, the mean DN values of
the class are used, together with the standard deviation of the sample and a
multiplication factor, to determine the extent of the box. The boundaries of the box
are defined by the product of the standard deviation and the multiplication factor.
A pixel not falling within a box, is not classified. If a pixel lies within two or more
overlapping boxes, the pixel is classified according to the smallest box.
The bands used in this exercise are from a SPOT image of the Flevo Polder, The
Netherlands:
SPOT-XS band 1: Spotb1
SPOT-XS band 2: Spotb2
SPOT-XS band 3: Spotb3
When performing an automated box classification, the different land cover classes in
the area will be detected by implementing a programmed classification rule, using a
specified sample set. The output map will be a map with classes representing the land
cover units in the area. The sample set, to be used, has been created in the part about
sampling.

272

In the Catalog, click the sample set Spot_classes with the right mouse
button and select Classify. The Classify dialog box appears.

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.

ILWIS 3.0 Users Guide

Image Processing

Repeat the procedure using a larger Multiplication Factor.

Perform other classifications using the Minimum Distance, Minimum


Mahalanobis Distance and Maximum Likelihood method. Classify once
without using a Threshold Distance and once with a Threshold Distance
of around 15 . Name the output images for instance Spot_MinDist ,
Spot_MinMahaDist and Spot_MaxLikehd .

Compare the results with the box classified maps.

Visually compare the results with the classified map using the default multiplication factor.

Close all map windows when you have finished the exercise.

Evaluate the reclassified results


The final result is compared with the original values in the bands 1, 2 and 3 of the
SPOT image. For the complex and more homogenous land covers the results can be
compared with the original bands.

Display the topographic map Polder . Make sure that it is georeferenced.


Check this also for the SPOT bands.

Open the pixel information window and add the maps Spotb1 , Spotb2 ,
Spotb3 and Spot_Box .

Evaluate for pixels the different cover classes defined and the result of your
classification.

Close the map window and the pixel information window.

To get a better idea of the overall accuracy of the classification, use has to be made of
the test set which contains additional ground truth data, which have not been used to
train the classifier. Crossing the test set with the classified image and creation of a
confusion matrix, is an established method to assess the accuracy of a classification.

See the ILWIS Help topic How to calculate a confusion matrix for more
information about creating a confusion matrix.

It is not recommended to use the same sample map for both the classification and the
accuracy assessment, because this will produce figures that are too optimistic.
Post classification operations
The final classification may not meet the expected results. This can be due to spectral
overlap in the sample set, or because the classifier has not been trained properly. If
this is the case the classification process should be repeated, incorporating for
example more spectral classes. Defining sub-classes, when a bi-model distribution or
large standard deviation/variance exists in a class, will improve the classification
ILWIS 3.0 Users Guide

273

Image Processing
results. After the classification process these classes can be merged again. If the
obtained results are still not according to expectations, incorporation of ancillary nonspectral information might be considered, for example elevation information might be
useful to distinguish certain forest types.
In a classified image small areas occur, consisting of one or a few pixels, to which
another class label has been assigned, compared to the larger homogeneous classified
surrounding areas. Individual non-classified pixels may also occur throughout the
classified image. If there is, for example, a need to integrate the results with other
data sets, a large number of small individual units will occur which can not be
properly represented on a map. To circumvent these problems the classified image
may be generalized in order to remove these small individual areas. Spatial filters are
a mean to achieve this objective, e.g. individual pixels may be assigned to the
majority of the surrounding pixels.
Undef majority filter
A standard filter, which can be applied, is the majority filter. The majority filter
selects the predominant (most frequently occurring) value of a pixel and its 8
neighbors. The undef majority filter selects only the predominant value if the central
pixel is zero, which thus removes isolated unclassified pixels and assigns the pixel to
the surrounding class.

Click one of the classified output maps with the right mouse button and
select Image Processing, Filter from the context-sensitive menu. The
Filtering dialog box is opened.

Select Filter Type: Majority and Filter Name: Majundef .

In the Display Options - Raster Map dialog box accept all defaults and
click OK to display the Majority map.

Display also the original classified output image and compare both images.

Enter Majority as Output Raster Map name, accept all other defaults and
click Show. The map Majority will be created.

These post classifier operations should be used with care: small areas are of high
relevance for some applications. A further generalization can be achieved if the
majority filter is applied several times.

Close the map windows when you have finished the exercise.

In chapter 9 more examples of map filters will be given.

274

ILWIS 3.0 Users Guide

Image Processing

6.6.5 Unsupervised classification (clustering)


One way to perform a classification is to plot all pixels (all feature vectors) of the
image in a feature space, and then to analyze the feature space and to group the
feature vectors into clusters. The name of this process is unsupervised classification.
In this process there is no knowledge about thematic land cover class names, such
as town, road, potatoes, etc. All it can do, is to find out that there appears to be (for
example) 16 different things in the image and give them numbers (1 to 16). Each
thing is called a spectral class. The result can be a raster map, in which each pixel
has a class (from 1 to 16), according to the cluster to which the image feature vector
of the corresponding pixel belongs.
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.

Double-click the Cluster operation in the Operation-list. The Clustering


dialog box is opened.

Select Spotb1 , Spotb2 and Spotb3 . Use the same number of classes as
when performing the supervised classification.

Type Unsupervised for the Output Raster Map name, clear the check
box Output Table and click Show. The supervised map is calculated and
after the calculation the Display Options - Raster Map dialog box is
opened.

Accept the defaults in the Display Options - Raster Map dialog box by
clicking OK. The map is displayed.

Display one of the maps produced with the supervised classification method
and compare the results.

Close the map windows when you have finished the exercise.

ILWIS 3.0 Users Guide

275

Image Processing
Summary: Image classification
- In order to extract information from the satellite images, the relationship between
pixel values and land cover types must be found. The process to find the
relationship is called classification.
- Density slicing is a technique, whereby the DNs distributed along the horizontal
axis of an image histogram, are divided into a series of user-specified intervals or
slices. Density slicing will only give reasonable results, if the DN values of the
cover classes are not overlapping each other.
- Multi spectral image classification is used to extract thematic information from
satellite images in a semi-automatic way. The values of the various bands found for
1 pixel in several bands are called feature vectors. Such a vector can be plotted in a
3-dimensional space, called feature space. Pixels belonging to the same (land
cover) class and having similar characteristics, end up near to each other in the
feature space. In order to make the classifier work with thematic (instead of
spectral) classes, some knowledge about the relationship between classes and
feature vectors must be given.
- The classification process is divided into two phases: a training phase, where the
user trains the computer, by assigning for a limited number of pixels to what
classes they belong in this particular image, followed by the decision making phase,
where the computer assigns a class label to all (other) image pixels, by looking for
each pixel to which of the trained classes this pixel is most similar.
- About each class some ground truth is needed: a number of places in the image
area that are known to belong to that class. It is the task of the decision- making
algorithm to make a partitioning of the feature space, according to our training
samples. For every possible feature vector in the feature space, the program must
decide to which of the sets of training pixels this feature vector is most similar.
After that, the program makes an output map where each image pixel is assigned a
class label, according to the feature space partitioning.
- Various decision making algorithms are used: box classifier, minimum distance to
mean classifier, minimum Mahalanobis distance classifier and Gaussian maximum
likelihood classifier.
- Unsupervised classification. One way to perform a classification is to plot all
pixels (all feature vectors) of the image in a feature space, and then to analyze the
feature space and to group the feature vectors into clusters. In this process there is
no knowledge about thematic land cover class names. The user must specify
some parameters such as the number of clusters (approximately) you want to
obtain, the maximum cluster size (in the feature space), the minimum distance (also
in the feature space), that is allowed between different clusters, etc.

276

ILWIS 3.0 Users Guide

CHAPTER 7

Spatial data analysis: retrieval,


(re)classification and measurement
operations
In chapter 5 you used a number of table window operations, such as calculations,
aggregations, and table joining, in the analysis of attribute data. In the previous
chapter you have seen the most important image processing tools that ILWIS provides
for the analysis of satellite data. In this chapter, and also in chapters 8 and 9, attention
will be paid to other data analysis tools, specifically for maps.
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).
Retrieval, (re)classification & measurement operations
These operations mostly form the starting point in the data analysis process. They
enable you to explore your data, without making changes to the location of spatial
elements and without creating new spatial elements.
- Data retrieval involves the selective search of data.
- Reclassification involves the (re)assignment of thematic values to categories of an
existing map.
- Measurement operations involve the measurement of distances between points,
lengths of lines, area and perimeter of polygons, determination of volumes and
counting.
All operations in this category are performed on a single vector or raster map, often
in combination with attribute data.
Retrieval, (re)classification and measurement operations will be treated in this chapter.
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 3.0 Users Guide

277

Spatial data analysis: retrieval, (re)classification and measurement operations


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.
Overlay operations will be treated in the next chapter, including an extensive
demonstration of Map Calculation.
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.

278

Double-click the ILWIS icon on the desktop.


Use the Navigator to go to the directory C:\ILWIS 3.0 Data\Users Guide\
Chapter07.

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

7.1 Retrieval using the pixel information window


Data retrieval involves the (selective) search, manipulation and output of spatial data
and/or attribute data. Retrieval operations can be subdivided into the following
groups:
- What is at...?
To find out what is present at a particular location. Reading of the contents of maps
and related attribute tables at specified XY-coordinates. In ILWIS, the pixel
information window can be used to read the values from vector and/or raster maps,
with their accompanying tables.
- Where is...?
Retrieval of spatial data (points, lines, polygons or mapping units in a raster map)
to find an answer to questions such as: Where are the forested areas?
The pixel information window is used to interactively inspect coordinates, class
names, IDs or pixel values, in one or more maps and map-related tables. The pixel
information window shows information for the mouse pointers position in a map
window. In chapter 2, the functionality of the pixel information window was already
introduced to you.

Open raster map FCC .


In the map window open the File menu and choose Open Pixel Information.
Open the Help menu in the pixel information window and select the command Help on this window. Click the hypertext word: Introduction .
Close the Help window when you have finished reading the help on the pixel
information window.

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.

In the Catalog, select the polygon maps Geology , Geomorphology ,


Landuse and Catchment (hold down the Ctrl-key) and drag them to the
pixel information window.

When you move the mouse pointer in the map window, you will see information on these maps in the pixel information window.

For this exercise we have also prepared some maps that are made from the segment
map Contour : a Digital Elevation Model (Dem ) and a slope map (Slope ). The
ILWIS 3.0 Users Guide

279

Spatial data analysis: retrieval, (re)classification and measurement operations


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 information of that location in the pixel information window.

Move the mouse pointer through the map to continuously display the information.

The three polygon maps do not cover the entire area displayed in the false color
composite. If you move to the right of the image, you will see that the information
from the geologic and geomorphologic maps is missing (it says for the maps: ?
outside map , and for attribute data: ?).
You can use pixel information to become familiar with the data and to find out
certain relations between one map and another.
To find such relations it may be useful to display these maps on top of the false color
composite.

Select the four polygon maps Geology , Geomorphology , Landuse , and


Catchment in the Catalog and drag them to the map window.

When the Display Options - Polygon Map dialog boxes appear, specify:
Boundaries Only and choose for:
Catchment (Boundary Color: White )
Geology (Boundary Color: Magenta )
Geomorphology (Boundary Color: Yellow )
Landuse (Boundary Color: Green ).

For more information on how to manage data layers we refer to chapter 2 and to the
ILWIS Help topic Basic concepts: Layers in a map window.

280

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


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 button 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 information?
- Are there parts of the city of Cochabamba that may be flooded?
- Which one of the geomorphologic zones (column zonation ) has the steepest slope? In which range are these slopes?

When you finish the exercise:

Close the pixel information window and the map window.

ILWIS 3.0 Users Guide

281

Spatial data analysis: retrieval, (re)classification and measurement operations

7.2 Retrieval of information by displaying attributes


The pixel information window allows you to retrieve information for the XYcoordinates where the mouse pointer is located. However, in many cases you do not
want to have the information for one location only, but for an entire map.
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.
The Cityblock map is used as an example. In chapter 5 (attribute data handling),
you worked with table Cityblock which contains information such as area, land
use, district number, population and population density for each city block.

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.

282

Close the Edit Attribute pane by clicking the cross in the upper-right.

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

Figure 7.1:

A polygon map window with both the Layer Management pane and the Edit
Attribute pane docked in the map window.

In the Layer Management pane of the map window, double-click the map
Cityblock . The Display Options - Polygon Map dialog box is opened.

In the Display Options - Polygon Map dialog box select the check box
Attribute. Now a list box appears to the right of the word Attribute, containing columns of the attribute table Cityblock .

Select the column Landuse . This column contains the dominant land use
type of each cityblock.

Select the option Representation. The representation City_Landuse will


appear in the list box to the right of the word Representation.

Column Landuse has a class domain (called City_Landuse ) which has a


representation (City_Landuse ).

Click OK in the Display Options - Polygon Map dialog box.

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 .

ILWIS 3.0 Users Guide

283

Spatial data analysis: retrieval, (re)classification and measurement operations

Click on the different units in the map. You can see that for each city block
the land use type is shown as well as the code of the city block.

Displaying a map by one of its attributes allows you to get a good idea on the
distribution of the different attribute values throughout a map.
You will display another attribute of the Cityblock map: District . Each city
block forms part of a cadastral district of the city. The District column uses an
identifier domain.

Click with the right mouse button while the mouse pointer is in the map window. Select Display Options from the context-sensitive menu and click on
the polygon map name Cityblock .

Select the check box Attribute, and select column District . Since this column uses an identifier domain, you cannot select a representation. Instead,
you can display districts in 1, 7, 15 or 31 colors.

Select the option Multiple colors, and 15 . Click OK. Now the map is displayed according to the districts of the city.

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.
Retrieval with a mask
Finally, you will have a look at some other useful options in the Display Options
dialog box that can help you to evaluate the data.
We will switch to another example: the land use map of the region around the city of
Cochabamba, called Landuse . You can selectively display units in a map, e.g. only
the land use type Forest .

284

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

In the Catalog, double-click polygon map Landuse . The Display Options Polygon Map dialog box is opened.

Select the check box Mask, type the class name Forest in the appearing
text box and click OK.

Only the land use unit Forest is shown in the map window. Suppose you want to
show the following four units: Bare rock , Bare soils , Agriculture , and
Agriculture (irrigated) . Instead of typing full names or codes you can use
wildcards: the asterisk * to replace zero or more characters, and the question mark
(?) to replace one character.

Open the Display Options dialog box of polygon map Landuse again.

Click OK in the Display Options Polygon Map dialog box.

Close the map window.

Select the check box Mask, and type the following search strings in the
appearing text box: Bare*,Agri*
Now only four units of the map are displayed: Bare rock , Bare soils ,
Agriculture and Agriculture (irrigated) .

A mask can be used to selectively display vector data. For maps with many different
units this can be quite useful, e.g., to show specific contour lines.

In the Catalog, double-click segment map Contour .

Select the check box Info and click OK. Only the contour lines from 3000 to
3440 are displayed.

Double-click the map Contour in the Layer Management pane.

Click OK in the Display Options Segment Map dialog box. Only the
hundred meter contour lines are displayed.

Close the map window.

In the Display Options Segment Map dialog box, select the check box
Mask, and type the following search strings in the appearing text box: 30* ,
31* , 32* , 33* , 34* .

In the Display Options Segment Map dialog box, select the check box
Mask, and type the following search string in the appearing text box: ??00 .

For more information about using wildcards in Mask, we refer to the ILWIS Help
topic How to use masks.

ILWIS 3.0 Users Guide

285

Spatial data analysis: retrieval, (re)classification and measurement operations


Summary: retrieval operations
- In the previous exercises methods were shown that could be used to retrieve
information from maps and from the connected attribute tables.
- 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.
- Displaying a map by one of its attributes is useful to investigate the spatial
distribution of attribute information, without the need of generating a new map.
- You can also use a Mask to selectively display some classes, IDs or values of a
map.

286

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

7.3 Reclassification with Map Calculation formulas


In the previous exercises we have seen several tools that can be used for data retrieval
in ILWIS. There is another important tool: Map Calculation formulas. The Map
Calculation tool forms the core of ILWIS. With this operation you can do all kinds of
calculations with raster maps. In the next chapter we will treat Map Calculation in
depth. Here we want to show you some examples of how it can be used for data
retrieval and classification.
The expression of a Map Calculation formula often has the notation
IFF( .. , .. , ..). An IFF function consists of a condition, a then part and an else part.
The condition that should be met is written first, followed by the result if the
condition is met, and by the result if the condition is not met (Figure 7.2).
The result of data retrieval using MapCalc is a new raster map.

Figure 7.2:

Examples of data retrieval and classification using different MapCalc


formulas (see the following exercises for explanation).

Using a Map Calculation formula for data retrieval


In this exercise, raster map Landuse is used for a retrieval operation. This map has a
class domain, representing the land use types in the Cochabamba area.
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
ILWIS 3.0 Users Guide

287

Spatial data analysis: retrieval, (re)classification and measurement operations


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.

MapCalc is not case-sensitive. On the Command line, it makes no difference if


you type capitals or small letters.

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.

Close the map window.

Data retrieval with a Boolean statement


Let us give another example of the use of a MapCalc formula for data retrieval (see
Figure 7.2). Suppose we are interested to know the location of the areas with the land
use Grassland . We will use a so-called Boolean statement. A Boolean statement
has only two possibilities: the statement is true (if the condition is met), or it is false
(if the condition is not met).

Type the following formula on the Command line of the Main window:
Grass = Landuse = Grassland

The Raster Map Definition dialog box is opened. As you can see, the suggested domain is called: Bool (for Boolean). Click Show.
Accept the defaults in the Display Options - Raster Map dialog box by
clicking OK. The map is displayed.
Click the various units to find out what they mean.

288

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


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 doesnt
allow undefined values.

Close the map window.


Repeat the calculation: Use the history of the Command line (Arrow Up or
open the Command line list box) to retrieve the calculation on the
Command line.

Press Enter and answer the question Overwrite? with Yes. In the Raster
Map Definition dialog box, select domain Bit .

Display map Grass (now with the Bit domain), and close the map window
when you have finished the exercise.

If you use the Bit domain, undefined values also become 0 (false). It is generally
better to use the Bool domain.
Simple reclassification with a MapCalc formula
The previous examples were more intended for data retrieval rather than for
reclassification. No new values were assigned to pixels in the output map. Let us now
look at a simple example in which we do want to give the output map a meaning,
which is different from the input map.
Suppose, in this example (similar to the one shown in Figure 7.2), that you are
interested to differentiate between land and water in the area. The land use units are
reclassified into new names, either Land or Water . These two class names
(Land , Water ) do not occur in domain Landuse .

Type the following formula on the Command line of the Main window:
Landwater=iff((Landuse=Lake)or(Landuse=
Riverbed),Water,Land)

The 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.
ILWIS 3.0 Users Guide

289

Spatial data analysis: retrieval, (re)classification and measurement operations

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.

MapCalc formulas are a suitable tool to perform simple reclassifications of class


maps, such as the one you just did. However, if you want to assign different values to
each of the land use units, the MapCalc formula would become too long and too
complicated. Therefore, for more complex reclassifications of raster maps with a
class or ID domain, it is easier to store the attributes in a table, and to reclassify the
map with the values from the table. This will be demonstrated in the next exercise.

Classifying value maps with MapCalc formulas


The final example of the use of MapCalc formulas for (re)classification shows how
to classify data from a raster map with domain type value. In this exercise the raster
map Dem (Digital Elevation Model) is used. The values in this map represent the
altitude of the terrain and range from 2640 to 4500 meters. By performing the next
operation a class map with three classes is created (low: 3000 meters, moderate:
3000-4000, and high: 4000 meters).

Double-click the MapCalculation item in the Operation-list. The Map


Calculation dialog box is opened.

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.

Type the following expression in the text box Expression:


iff(Dem<3000,Low,iff(Dem<4000,Moderate,High))

290

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


This is called a nested IFF statement: one IFF statement within another.

Type Demclass in the text box Output Raster Map.


Click the Create Domain button next to the Domain list box. The Create
Domain dialog box is opened. Type Demclass in the text box Domain
Name.

Accept the defaults by clicking the OK button in the dialog box. The Domain
Class editor is opened. Close the Domain Class editor.

Click Show in the Map Calculation dialog box.

The Display Options - Raster Map dialog box is opened.

You can customize the colors in the same way as before.

Accept to add the following items into domain Demclass : Low , Moderate
and High .
Accept the defaults and click OK. The map is displayed. Click the units to
find out their meaning.
Close the map window when you are finished with the exercise.

We can draw the same conclusion as before: MapCalc formulas are suitable for
simple classifications. If we want to make more complex classifications, we would
need to make many nested IFF statements, which would make the formula too long
and too complex. Unlike class and ID maps, there is no possibility to reclassify value
maps by an attribute table as value maps cannot have an attribute table.
To solve this problem of complex classifications, we can make use of a special
operation, called Slicing. This will be explained in section 7.5.
Summary: Using MapCalc formulas for retrieval and (re)classification
- In this exercise we have seen that it is possible to retrieve information from a map,
using a Map calculation formula.
- The expression of a Map calculation formula often has the notation iff(.... , ... , ...)
which is called an IFF function with conditional, then and else parts.
- The result of a Map calculation formula is a new output raster map. The domain of
this output map depends on the contents of the formula. The domain of the output
map can either be class, ID or value. A combination of the three is not possible.
- If you use a Map calculation formula for the retrieval of one unit in a map, you can
use the same domain for the output map as for the input map, and assign undefined
to all other classes.
- Another option for data retrieval using a Map calculation formula is to use a socalled Boolean statement, which can either be true or false.
ILWIS 3.0 Users Guide

291

Spatial data analysis: retrieval, (re)classification and measurement operations


- 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.
- MapCalc formulas are a suitable tool for performing simple reclassifications of
class maps. More complex reclassifications would require many nested IFF
statements.
- Therefore, for more complex reclassifications of raster maps with a class or ID
domain, it is easier to store the attributes in a table and to reclassify the map with
the values from the table.
- 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.

292

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

7.4 Reclassifying a map with attribute data


In section 7.2 you saw that it is possible to display attributes related to a map, without
actually generating a new map. In many cases, however, when you want to use such
an attribute map in further analysis, it will be necessary to generate a map from the
attributes, in an operation called Reclassification, or Attribute Map.
Reclassification involves the (re)assignment of thematic values to the categories of an
existing map. In the previous exercise we have seen that for simple reclassification
also Map Calculation formulas can be used. If we want to reclassify many classes,
the formulas become too complex, and it is better to use attribute tables.
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 reclassified 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.

Figure 7.3:

Example of a reclassification using an attribute table. The


map city block (with a domain ID) is reclassified to the map
Landuse (with a class domain) using the column Landuse
from the attribute table.

In this exercise you will first use the polygon map Cityblock to create a new
polygon map representing the land use of the city blocks of Cochabamba. The
polygon map Cityblock has an identifier domain; each unit is codified by an ID
from 1 to 717. This map has an attribute table, which is also called Cityblock . One
ILWIS 3.0 Users Guide

293

Spatial data analysis: retrieval, (re)classification and measurement operations


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.

Double-click Attribute Map of Polygon Map in the Operation-list.

The Attribute Map of Polygon Map dialog box is opened.

Select polygon map Cityblock in the list box Polygon Map.

In the Display Options - Polygon Map dialog box, accept the defaults by
clicking the OK button.

Select column Landuse in the list box Attribute.


Type City_Landuse in the text box Output Polygon Map.
Type Dominant land use in the text box Description and click the Show
button.

The output map is displayed on the screen.

Evaluate the contents of the map by clicking some units.


Note that the reference to the city block code is no longer displayed (as was
the case in the previous exercise, when we displayed the map Cityblock by
its attribute Landuse ).

Also generate a polygon attribute map District , by using the column


District and the map Cityblock .

In chapter 5 (attribute data handling) you have created a table District with
information on each district of the city. Now that you have also generated a district
map, and as both the map and the table use the same domain (District ), you can
link the table District to the map District .

294

In the map window, open the File menu, select Properties and click on the
polygon map District . The Polygon Map Properties sheet appears.

Click the check box Attribute. Select the table District . Click OK to close
the dialog box.

Open the pixel information window, and drag the polygon maps Cityblock ,
City_Landuse and District to it. Evaluate the contents of the maps and
tables while moving with the mouse pointer over the map.

Close the map window and the pixel information window.

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


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.

Summary: Reclassifying a map with attributes


- Vector or raster maps with a class or identifier domain often have an attribute table
linked to it.
- 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.

ILWIS 3.0 Users Guide

295

Spatial data analysis: retrieval, (re)classification and measurement operations

7.5 Classifying a value map (Slicing)


A raster map with the domain type value cannot be reclassified by the method
explained in the previous section, since you cannot attach a table to it. Take for
example a Digital Elevation Model (DEM). This is a value map which contains a
wide range of values. The map DEM in the demo data set, for example, contains
values between 2520 and 4560, with a precision of 0.1. Suppose we would like to
classify this map into five different height zones. It would require a very large table,
with an attribute column containing a lot of repetitive values.
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.

296

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


Table 7.1:

Boundary values and class names


for the group domain Demclass.

Upper
boundary

Group name

3000
3500
4000
4500
5000

<3000 m
3000-3500
3500-4000
4000-4500
4500-5000

m
m
m
m

The raster map Dem has a domain type value in which pixel values refer to the height
of the terrain.
Temporary classification for display options
Before the Slicing operation is demonstrated, it is useful to firstly apply a method,
which shows the map, as if it was classified, just by manipulating the maps
representation.

Double-click raster map Dem in the Catalog. The Display Options - Raster
Map dialog box is opened. Click OK to display the map.

In the Layer Management pane double-click the raster map Dem to open the
Display Options - Raster Map dialog box again.

In the dialog box click the Create button next to the Representation list
box. The Create Representation dialog box is opened.

Type for Representation Name: Demclass2 . Accept the other defaults and
click OK. The Representation Value editor is opened.

Press the Insert Limit button in the toolbar. The Insert Limit dialog box is
opened. Enter the limit 3000 and select the Color Red and click OK.

Insert also the other limits shown in the Table 7.1 (3500 , 4000 , 4500 ) and
select a color for each.

Click the word Stretch between two limits. A list box appears.

Click once more to open the list box and select Upper. Do this for all ranges
in between limits.
Close the Representation Value editor. You are back in the Display
Options - Raster Map dialog box. Click OK. The map is now displayed as
if it was classified.

The representation can be edited, and the result shown on the screen. Use the
Redraw button in the map window, to redraw the map with the updated
representation. This allows you to interactively select the best boundaries for the
classification.

ILWIS 3.0 Users Guide

297

Spatial data analysis: retrieval, (re)classification and measurement operations


Permanent classification using the slicing operation
Now you will do the actual classification, using the Slicing operation.

Expand the Image Processing item in the Operation-tree and double-click


the Slicing operation. The Slicing dialog box is opened.

Select Dem in the Raster Map list box.

Type Classified_Dem in the Domain name text box.

Type Classified_Dem in the Output Raster Map text box.


Type Classified DEM in the Description text box.
Click the Create Domain button next to the Domain list box. The Create
Domain dialog box is opened.
Make sure to select the option Class and the check box Group.
Click the OK button in the Create Domain dialog box. The Domain Group
editor is opened.

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 .

When you create a domain group, a representation is also created. It is possible to


edit the colors of the output groups/classes from the Domain Group editor, or by
opening the representation. To edit the representation:

Open the File menu in the Domain editor and select Open Representation.
You can also click the Open Representation button in the toolbar.

The Representation Class editor is opened, showing the five groups/classes that
are present in the domain with different colors.

298

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

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.

To edit a color of a single class, double-click individual items in the Representation


Class editor and either select a pre-defined color, choose a customized color or edit
the color of the selected group by changing the amount of Red, Green and Blue.

ILWIS 3.0 Users Guide

299

Spatial data analysis: retrieval, (re)classification and measurement operations

Close the Representation Class editor when you are satisfied with the colors.

Close the Domain Group editor.

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.

Click the Show button in the Slicing dialog box. The Display Options Raster Map dialog box is opened.

Permanent classification using the CLFY function in MapCalc


A value map can also be classified by typing an expression on the Command line of
the Main window. You will now use this method to classify the landvalue map
Landvalue , generated in the previous exercise. This map shows the value of the
land in fictitious monetary values per hectare for each land use type. The values in
the map Landvalue range from 50 to 1000. You will classify this map into three
classes: Low (land value lower than 100), Moderate (land value between 100 and
750), and High (land value higher than 750).

Create a group domain Landvalue_class . Add three classes with the


boundaries as given above. Use 1000 as Upper Bound for the third class.

Close the Domain Group editor.


Locate the mouse pointer on the Command line of the Main window and
type the following command:
Landvalue_class=CLFY(Landvalue,Landvalue_class)

The expression has the following structure:


OUTMAP = CLFY(InputMapName, DomainGroup)

in which:
OUTMAP
CLFY
InputMapName
DomainGroup

300

is the name of your output map.


is the function to classify values according to a domain group.
is the name of the input map (domain value map).
is the name of the domain group; it lists the boundaries of the
values and the group names for the output map.

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

Click Show in the Raster Map Definition dialog box.

Use the left mouse button in the map window to inspect the result.

Edit the colors if you wish, e.g. Low = Yellow , Moderate = Orange , High
= Red .
Close the map window when you finished the exercise.

Summary: Classifying a value map


- A value map cannot be reclassified from an attribute table.
- 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).

ILWIS 3.0 Users Guide

301

Spatial data analysis: retrieval, (re)classification and measurement operations

7.6 Measurement operations on point maps


In the remaining part of this chapter a new group of operations will be shown:
measurement operations. Measurement operations enable you to obtain all kinds of
statistical information on vector and/or raster maps. You can do different types of
measurement operations, depending on the type of map:
- Points. The number of points in a point map can be calculated, using a
Histogram, or the number of points that fall within the same pixel, using the Point
Density operation. The distance between points can easily be measured.
- Segments. The number and length of segments (such as drainage lines, roads, or
geological faults) can be calculated with the Histogram operation. The direction of
segments can also be calculated. Measurement operations on segments will be
treated in section 7.7.
- Polygons. For polygons we can calculate the area of the different units, and the
length of the borders around them using the Histogram operation. This is shown in
section 7.8.
- Raster maps. For raster maps we can also calculate histograms. A histogram of a
class or ID map is different from the one of a value map. Both types are shown in
section 7.9.
Measurement operations on point data
In this section measurement operations dealing with points will be shown:
- Calculation of histograms for points
- Calculation of point density within pixels
- Calculation of distance between points
- Point in polygon calculation
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.
Calculating the number of points
You will first look at the calculation of histograms for point maps. Since there is no
appropriate example ready in the demo data set, an operation that will generate points
from the geomorphologic polygons (polygon map Geomorphology ) will be applied
first.

302

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

Double-click the Polygons to Points operation in the Operation-list. The


Polygons to Points dialog box appears.

Select the Polygon Map Geomorphology . Type for the Output Point
Map: Geompoint .

Type the Description: Center point of geomorphologic polygons .

Click Show. The point map is calculated and the Display Options - Point
Map dialog box is opened.
Click OK in the Display Options - Point Map dialog box. The point map is
displayed.

The points you see are the center points of the geomorphologic polygons. The colors
are according to the geomorphologic representation (Geomorphology ).

Close the point map Geompoint .


Click the point map Geompoint with the right mouse button.
Select Statistics, Histogram from the context-sensitive menu. The
Calculate Histogram dialog box is opened. Since you used context-sensitive
menu on the point map Geompoint , this map is already shown as the Input
Map. Click Show.

The histogram table shows the number of points for each geomorphologic class.

In the table window, press the New Graph button on the toolbar. The Graph
dialog box appears.

In the Graph dialog box deselect the X-column check box and click OK. The
Graph Options sheet is opened.

On the X-Axis tab type for the Axis Text: Geomorphologic unit .

On the Y-Axis (left) tab change the Axis Text to: Number of points and
click OK in the Graph Options sheet. The Bar graph is displayed.
Close the graph window and the table window.

Point density
Another measurement operation for points is Point Density. This operation
calculates the number of points that fall within each pixel. This depends of course on
the size of the pixel, which is defined in the georeference. All raster maps (except the
satellite images) in the demo data set have the georeference Cochabamba , which has
a pixel size of 20 meters. Counting the number of points that fall in each pixel with
such a small size, will not make much sense (there will be always only one point in
the cell, unless the points are very close). Therefore we will generate another
georeference with a much larger pixel size. The same point map (Geompoint ) as in
the previous exercise will be used.
ILWIS 3.0 Users Guide

303

Spatial data analysis: retrieval, (re)classification and measurement operations

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.

Close the map window.

Press the left mouse button on a few pixels in the map. The points are widely
spaced, even with a pixel size of 400 by 400 meters, we only get a maximum
of 3 points in 1 pixel.

The Point density operation is useful, when you are working with point maps that
are derived from detailed surveys in which points are measured at close intervals. It
may then happen that several points occur within one pixel of the thematic raster
maps that you are using. For example, when you are using GPS (Global Positioning
Systems), you may take a number of very closely spaced (X,Y,Z) coordinates in the
field. An example of an engineering geological application: sample points for soil
tests taken in a certain area may be so close to each other that several sample points
fall in the same pixel of the soil map that you are using.
Distance between points
With the distance tool distances and directions (angles) can be measured.

304

Open point map Geompoint .

Click a point of interest somewhere in the map (starting point), hold the left
mouse button down, and release the left mouse button at another position
(end point). The Distance message box appears.

Click the Measure Distance button


on the toolbar of the map window,
or choose the Measure Distance command from the Options menu.

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


The Distance message box will state:
From : the XY-coordinate of the point where you started measuring;
To : the XY-coordinate of the point where you ended measuring;
Distance on map : the distance in meters between starting point and end point
calculated in a plane;
Azimuth on map : the angle in degrees between starting point and end point related
to the grid North;
Ellipsoidal Distance : the distance between starting point and end point
calculated over the ellipsoid;
Ellipsoidal Azimuth : the angle in degrees between starting point and end point
related to the true North, i.e. direction related to the meridians (as visible in the
graticule) of your projection.

Click OK in the Distance message box.


Close the map window afterwards.

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.

ILWIS 3.0 Users Guide

305

Spatial data analysis: retrieval, (re)classification and measurement operations


Summary: measurement operations on point maps
- A point histogram for a point map with a class or ID domain shows the number of
points having the same class or ID.
- 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.
- A point map can be opened as table.
- The function Mapvalue allows the extraction of thematic information from a map
at a specific location.

306

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

7.7 Measurement operations on segment maps


You can also calculate histograms of segment maps. In this case, the length of the
segments are important, as well as the number of segments. This will be
demonstrated by calculating the length of the geological faults and lineaments of the
map Faults .

In the Catalog, click with the right mouse button on segment map Faults .

Click Show.

Select Statistics, Histogram from the context-sensitive menu. The


Calculate Histogram dialog box is opened.

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.

Close the table window showing the segment histogram.

Type Nr . for the Domain Prefix.

In the Display Options - Segment Map dialog box select the Info check
box and select the option Multiple colors, and 15 .

Click OK. The map is displayed.

Click with the right mouse button on segment map Faults .


Select Vector Operations, Unique ID from the context-sensitive menu. The
Unique ID dialog box is opened.
Type the name of the Output Map: Fault_ID and click Show. The
Display Options dialog box of the segment map is shown.

Press the left mouse button on some of the segments to check their codes.

You will see that each segment now has a different code.

Close the map Fault_ID and open the table Fault-ID .

ILWIS 3.0 Users Guide

307

Spatial data analysis: retrieval, (re)classification and measurement operations


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.

Select the check box Attribute, select the column Mainfault and select
White as False Color.

Click OK. Only the main faults are shown.

In the Catalog, double-click segment map Fault_ID . The Display Options


- Segment Map dialog box is opened.

Close the map window.

Segment histogram of value maps


A segment histogram calculated for segment maps with a value domain looks slightly
different. Take for example the value map Contour .

Calculate the histogram of the segment map Contour .

The histogram table for segment maps with a value domain contains more columns:
- Value : the altitude of the contour lines, which have this value code. So the lowest
contour line is 2520 meters and the highest is 4560.
- NrSeg : the number of segments occurring for each value.
- NrSegCum : the cumulative number of segments. For each altitude value the number of segments of all the contour lines with a lower or equal altitude is indicated.
- Length : the length of all segments with the same value.
- LengthCum : the cumulative length of segments. For each altitude value the total
length of all the contour lines with a lower or equal altitude is shown.

308

Close the table window.

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


Segment directions and Rose diagrams
Another useful measurement operation on segment maps, especially for geological
applications, is called Segment Direction Density.

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.

Close the Rose Diagram.


Open the Graphs menu again and select the Rose Diagram command.
In the Graph dialog box select Direction for the X-column, NrLines for
the Y-column and click OK

In the Graph Options - Direction x NrLines sheet, select Needle and click
Show. The rose diagram now shows the number of segments for the different
directions.

Close the Rose diagram and the table window.

Calculating segment density


In many applications it may be useful to know the density of segments within certain
units. For example, the drainage density per catchment is often required in hydrologic
models, or the density of faults in certain geological units for geological applications.
With ILWIS we can generate a segment density map with the operation Segment
Density. This operation generates a raster map from a segment map, in which for
each pixel the length of certain segments is indicated.
ILWIS 3.0 Users Guide

309

Spatial data analysis: retrieval, (re)classification and measurement operations


This is demonstrated for the segment map Drainage .

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 .

Click Show.

Select the Georeference Cochabamba . Type the Description: Density of


drainage lines per pixel .

The drainage density is now being calculated. After that the Display Options Raster Map dialog box is opened.

Make sure the Representation Pseudo is selected.

Zoom in on one of these lines so that you can see only about 20 individual
pixels. Click a few pixels to read the values.

Open the Layers menu and select Add layer. In the Add Data Layer dialog
box select the segment map Drainage and click OK. The Display Options
Segment Map dialog box appears.

Select the check box Mask and type Drainage in the text box.

Click OK. The map is displayed. You will see a number of colored lines within a blue map.

Select the option Single Color and choose the color Red .
Click OK. The segment map Drainage is displayed on top of the drainage
density map.
Close the map window after finishing the exercise.

If the window is sufficiently enlarged, you can see the individual pixels and the red
line of the drainage passing over it. The value of the pixel through which a line is
passing indicates the length of that line within the pixel. The pixel size of the map is
20 by 20 meters (check this in the Properties sheet of the raster map). So if the
drainage is crossing the pixel in an exact north-south or east-west direction, the
length of the line in the pixel is also 20 meters. If the line is oriented in NW-SE or in
NE-SW direction, it crosses the pixel diagonally. In that case the length of the
segment in the pixel is 28.28 meters (Pythagoras rule). So this is also the maximum
possible length of a segment in the pixel, unless you have two segments in the same
pixel.
The segment density map by itself is not so useful. It is just showing the length of
segments covering each pixel. It is, however, an important input map for calculating
the segment density of another thematic map, such as a catchment map. In order to
310

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


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).
Summary: measurement operations on segment maps
- A segment histogram for a segment map with a class or ID domain, shows the
number and the length of segments having the same class or ID.
- 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.

ILWIS 3.0 Users Guide

311

Spatial data analysis: retrieval, (re)classification and measurement operations

7.8 Measurement operations on polygon maps


For polygon maps we can also calculate histograms. In this case we are most
interested in the area of the polygons belonging to the same mapping unit, as well as
the number of these polygons. Besides we can also obtain information on the length
of the boundary line around each polygon, called the perimeter.
A histogram of the geomorphologic map Geomorphology , with a class domain,
will be calculated as an example.

Click polygon map Geomorphology with the right mouse button.

Click Show.

Select Statistics, Histogram from the context-sensitive menu. The


Calculate Histogram dialog box is opened.

A polygon histogram table contains the following columns:


- NrPol : The number of polygons belonging to each class of the domain.
- Perimeter : The total length of the boundary lines of all polygons belonging to
the same class. The values in this column are in meters if the coordinates used in
the coordinate system are also in meters (which is nearly always the case).
- Area : The total area of all polygons belonging to the same class. The values in this
column are in square meters.
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 .

Close the table window.


Calculate and display the histogram for the polygon map Cityblock .

In an ID map, the column showing the number of polygons (NrPol ) is obsolete,


since all polygons have a unique identifier and therefore each code occurs only once.

312

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations

7.9 Measurement operations on raster maps


Finally, you will look at the histogram of raster maps. In the chapter on Image
Processing you have been working extensively with histograms made from raster
maps with an image domain. As an image domain is a special type of value domain,
the same type of histogram is used for all raster maps with a value domain.
Let us have a look at the histogram of a value map: Dem (the Digital Elevation
Model).

Calculate and display the histogram of raster map Dem .

The histogram table shows the following columns:


- Value : Lists the values, which occurs in the map.
- Npix : The number of pixels with a certain value.
- Npixpct : The percentage of the number of pixels with the same value as part of
the total number of pixels (that are not undefined) in the map.
- Npixcum : The cumulative number of pixels with the same or a smaller value.
- Npcumpct : The cumulative percentage of pixels with the same or a smaller value
as part of the total number of pixels (that are not undefined) in the map.
- Area : The area of pixels with the same value. This is obtained by multiplying the
number of pixels with the pixel area (npix * pixel size * pixel size).
When you display the graph of the histogram (X-column: Value , Y-column: Npix )
you see the frequency of occurring values in the maps.

Scroll to the last record of the table.

The value 593684 in column Npixcum represents the total number of pixels in the
map (provided that there are no undefined pixels, which are not used in the histogram
calculation). Lets check this.

Close the table window.


Open georeference Cochabamba .

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.

Close georeference Cochabamba .


Type the following pocket line calculation on the Command line of the Main
window:
? 932*637

As we have 932 lines and 637 columns, the total number of pixels is 932*637 =
593684, which is the same as the number we have just seen.
ILWIS 3.0 Users Guide

313

Spatial data analysis: retrieval, (re)classification and measurement operations


Let us now look at the histogram of a raster map with a class domain Landuse .

Open raster map Landuse .


Click on the white area in the upper right corner of the map and read the
information.

Part of the raster map Landuse contains question marks (?). These are undefined
values for which no land use information is available.

Close raster map Landuse .


Calculate and display the histogram of raster map Landuse .

The histogram table shows the following columns:


- Npix : The number of pixels with the same land use type.
- Npixpct : The percentage of the number of pixels with the same land use type as
part of the total number of pixels in the map (so as a percentage of 593684).
- Pctnotund : The percentage of the number of pixels with the same land use type
as part of the total number of pixels in the map that are not undefined.
- Area : The area of pixels with the same land use type.
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.

Calculate and display the histogram of the polygon map Landuse .

Select as Table the histogram of raster map Landuse . Select the Column:
Area , click Next, and type the Output Column Arearaster .

Click Finish.

Click OK in the Column properties dialog box.

In the table window, open the Columns menu and select the Join command.
The Join wizard is opened.

Click OK in the Column Properties dialog box.


Make sure that the Command line is visible. Position the mouse pointer on
the Command line of the table window and type the following formula:
Area_difference=Area-Arearaster

You can see from the values in column Area_difference that the Landuse area
values as calculated from the raster map are quite different from those calculated
314

ILWIS 3.0 Users Guide

Spatial data analysis: retrieval, (re)classification and measurement operations


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.
Summary: Histogram calculation on polygon and raster maps
- Histograms for polygon maps with a class or ID domain give the number of pixels
within each class, the perimeter and the area.
- 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).
- When calculating a histogram of a raster map, which is a rasterized polygon map,
the calculated areas in the raster histogram have relatively slight errors due to the
generalization effect, which occurs during rasterization.
- Histograms are dependent data objects: When the input map changes, the histogram
will be recalculated.

ILWIS 3.0 Users Guide

315

CHAPTER 8

Spatial data analysis: overlay


operations
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.

Double-click the ILWIS icon on the desktop to open ILWIS.


Use the Navigator to go the directory: C:\ILWIS 3.0 Data\Users Guide\
Chapter08.

ILWIS 3.0 Users Guide

317

Spatial data analysis: overlay operations


Introduction to Map Calculation
Map Calculation is an operation with which you can calculate new maps using
formulae.
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.
An expression usually contains operators and functions to specify the calculation to
be performed. The map names and the constants that are used in a formula are called
operands. When the expression is executed, the program will perform the calculation
on a pixel by pixel basis, starting from the first pixel in the first line, and continuing
till the last pixel in the last line.
The available MapCalc and TabCalc operators and functions are listed in the ILWIS
Help topic Map and Table calculation. Table 8.1 presents an overview of the
MapCalc functions.

318

You can use the following short-cut keys:


- Ctrl+C (to copy from the Command line to the Clipboard).
- Ctrl+V (to paste information from the Clipboard to the Command line).
This is extremely useful when you have to edit complicated and long formulae.
For an overview of the keyboard shortcuts see the ILWIS Help topic,
Appendices Keyboard shortcuts.

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

You can also use the history of the Command line. Press the Arrow Up key to
retrieve previously used expressions, the Down Arrow key is used to scroll
forward again. You can also open the list of previously used commands and
expressions by clicking the arrow at the right hand side of the Command line.
The amount of commands and expressions that can be retrieved can be set in the
Preferences.

In the following exercises, you will see a number of examples of Map Calculation
formulae, first some that will produce value maps (section 8.1), then some that will
give output maps with a class or ID domain (section 8.3). You will also look at how
dependency links can be used to update maps made with Map Calculation (section
8.2).
Table 8.1:

Some ILWIS functions used in Map Calculation. All the functions in this table can be used on maps with
a domain type value. The Conditional IFF and Undefined functions can also be used on maps with a
domain type class or ID. For a complete overview see the ILWIS Help topic Map and Table calculation.

Functions

Syntax

Operation

Conditional IFF

IFF (a,b,c)

If condition a is true, then return the outcome of expression b, or


else (when condition a is not true) return the outcome of expression c.

Relational

INRANGE (a,b,c)

Tests whether values of expression or map a are contained by a


range or closed interval with endpoints b and c.

Undefined

ISUNDEF (a)
IFUNDEF (a,b)

Tests whether a is undefined.


If condition a is undefined, then return the outcome of expression b,
else return a.
If condition a is undefined, then return the outcome of expression b,
else return the outcome of expression c.
If condition a is not undefined, then return the outcome of expression b, else return a. Tests whether a is undefined.
If condition a is not undefined, then return the outcome of expression b, else return the outcome of expression c.

IFUNDEF (a,b,c)
IFNOTUNDEF (a,b)
IFNOTUNDEF (a,b,c)

POW(a,b)
EXP(a)

a square; a2; a*a.


a square plus b square; a2 + b2; (a*a + b*b).
Calculates the positive square root of a; a
Calculates the positive square root of the sum of a square and
b square; (a2 + b2).
a raised to the power b; ab; The n-th root of a is found by: POW(a, 1/n).
Value e (i.e. 2.718) raised to the power a; ea.

Logarithmic

LOG(a)
LN(a)

Calculates the 10-based logarithm of a; 10log(a)


Calculates natural logarithm of a; elog(a)

Random

RND(a)
RND(0)
RND( )

Returns random integer values in the range [1;a]


Returns a 0 or a 1 at random.
Returns random real values in the range [0;1>, i.e. including 0, excluding 1.

Sign

- (a)
NEG(a)
ABS(a)
SGN(a)

returns a multiplied by 1.
returns a multiplied by 1.
Returns the absolute (= positive) value of a.
Returns -1 for negative values of a, 0 if a= 0, and 1 for positive values of a.

Exponential

SQ(a)
SQ(a,b)
SQRT(a)
HYP(a,b)

ILWIS 3.0 Users Guide

319

Spatial data analysis: overlay operations

Table 8.1:

(continued)

Functions

Syntax

Operation

Rounding

ROUND(a)
FLOOR(a)
CEIL(a)

Rounds a to an integer value.


Returns the largest integer value smaller than input value.
Rounds up; returns the smallest integer value larger than input value.

MinMax

MIN(a,b)
MIN(a,b,c)
MAX(a,b)
MAX(a,b,c)

Returns
Returns
Returns
Returns

NDVl

NDVI(a,b)

Calculates the Normalized Difference Vegetation Index of 2 images;


(b-a) / (a+b).

Trigonometric

SIN(a)
COS(a)
TAN(a)
ASIN(a)
ACOS(a)
ATAN(a)
ATAN2(y,x)

Sine; returns real values in the range -1 to 1.


Cosine; returns real values in the range -1 to 1.
Tangent: sin/cos.
Arcsin; sin-1 returns real values in radians in the range -/2 to /2.
Arccos; cos-1 returns real values in radians in the range 0 to .
Arctan; tan-1 returns real values in radians in the range -/2 to /2.
Returns the angle in radians of two input values.

Hyperbolic

SINH(a)
COSH(a)
TANH(a)

Hyperbolic sine: (ea - e-a)/2.


Hyperbolic cosine: (ea + e-a)/2.
Hyperbolic tangent: tanh(a) = sinh(a)/cosh(a).

Pre-defined values
and variables

PI
PI2
PIDIV2
PIDIV4
EXP(a)
%X
%Y
%L
%C

Value : 3.141592653589793
Value 2 : 6.283185307179586...
Value 1/2 : 1.570796326794896
Value 1/4 : 0.785398163397448
Returns exponential: ea ; Value e : 2.718281828459045...
Variable to calculate with X-coordinates in a map.
Variable to calculate with Y-coordinates in a map.
Variable to calculate with Line or Row numbers in a map.
Variable to calculate with Column numbers in a map.

Special function to
classify values

CLFY
(a , DomainGroup)

Classifies the values of a according to a domain Group.

320

the
the
the
the

minimum of two expressions a and b.


minimum of three expressions a b and c.
maximum of two expressions a and b.
maximum of three expressions a, b and c

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

8.1 Map Calculation formulas resulting in value maps


There is a wide range of operators and functions that are used to analyze raster maps
with the domain type value. They also work on maps with the domain type image,
which is a special type of value domain. In the following sections, firstly some
examples of the various operators are shown, before we will apply them in a small
case study.
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

+
*
/
^
a MOD b
a DIV b

Add
Subtract
Multiply
Divide
Exponential operator; POW(a,b); ab
Returns the remainder of a divided by b (e.g. returns 1 if a=10 and b=3)
Returns the quotient of a divided by b (e.g. returns 3 if a=10 and b=3)

a
a
a
a
a
a
a

+b
-b
*b
/b
^b
MOD b
DIV b

In the Figure 8.1 some examples of these arithmetic operators are given.

Figure 8.1:

Some examples of arithmetic operations in ILWIS. The input maps have domain
type value

Let us look at the simplest one:


MapC = MapA + 10

This means: Add a constant factor of 10 to all pixel values of raster map MapA and
store the result in output map MapC . In other words, output MapC is equal to the sum
ILWIS 3.0 Users Guide

321

Spatial data analysis: overlay operations


of raster map MapA and a constant value of 10 .
The second calculation is:
MapC1 = MapA + MapB

This means add the pixel values of MapA and MapB and store the result in MapC1 .
The third calculation is:
MapC2 = ((MapA - MapB) / (MapA + MapB)) * 100
This means: Store raster map MapC2 , which is the result of the subtraction of MapB
from MapA , divided by the sum of MapA and MapB ; then multiply this by 100 . This
formula when applied on two satellite bands (MapB with visible or red values and the
MapA with near-infra-red values) is called the NDVI (Normalized Difference

Vegetation Index). The output values range from -100 to +100.


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

=
<
<=
>
>=
<>

Equal to
Less than
Less than or equal to
Greater than
Greater than
Not equal to

a
a
a
a
a
a

eq
lt
le
gt
ge
ne

=b
<b
<= b
>b
>= b
<> b

Relational operators (see Table 8.3) test whether one expression is larger than,
smaller than, equal to another expression, etc.

Figure 8.2:

Some examples of Boolean statements in ILWIS.

Relational operators are used in combination with logical operators or conditional


functions. If we use only a relational operator in a formula, the formula will be a
Boolean statement. Some examples of Boolean statements are (see Figure 8.2):

322

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

MapC = MapA > 20

This means: For pixels in MapA that have a value greater than 20 , the expression is
true and True (1) is assigned to those pixels in output MapC . For pixels where the
expression is false, a False (0) is assigned (Bool domain).
MapC = MapA <> MapB

In this statement it is checked whether MapA is different from MapB . This statement
can be either true or false. The output map, MapC , will therefore only contain two
different values: True (1) or False (0) . Such a statement would be useful for
change detection, for example to compare two land use maps of different periods.
Logical operators
Logical operators used in MapCalc. They can be used on maps, with
all types of domains.

Table 8.4:

Syntax Operation

AND
OR
XOR
NOT

Returns
Returns
Returns
Returns

true
true
true
true

Example

if
if
if
if

both expressions a and b are true.


one or both of the expressions a and b is true.
only one of the expressions a and b is true.
expression b is false.

(a) AND (b)


(a) OR (b)
(a) XOR (b
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.
MapD = (MapA=Forest) AND (MapB<500)

ILWIS 3.0 Users Guide

323

Spatial data analysis: overlay operations


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.
MapD1 = (MapA=Forest) OR (MapB<500)

The expression is true if only 1 of the expressions is true or both of the 2 expressions
are true:
- if a pixel in mapA has class name Forest and in MapB not smaller than 500 .
- if that pixel in mapB has a value <500 and in MapA not Forest .
- if a pixel in mapA is Forest and if that pixel in MapB <500 .
Otherwise the who le expression is false.
MapD2 = (MapA=Forest) XOR (MapB<500)

The expression is true if only 1 of the 2 expressions is true:


- if a pixel in MapA is Forest and in MapB not smaller than 500 .
- if a pixel in MapB <500 and in MapA not Forest .
Otherwise the whole expression is false. This statement is called exclusive OR.
MapD3 = (MapA=Forest) AND NOT (MapB<500)
When a pixel in MapA has class name Forest and at the same time this pixel in
MapB does not have a value less than 500 , assign True (1) to this pixel in the
output map (return True (1) if the first condition is true and the second is false).
Assign False (0) for all pixels where this is not the case.

Conditional functions
The examples that we have used for the relational and logical operators all give
output values, which are either true or false. In practice we use these operators mostly
with the so-called conditional iff function. The general syntax for the conditional iff
functions is:
Output_map = IFF (Condition, Then Expression, Else Expression)
or
Output_map := IFF (Condition, Then Expression, Else Expression)
Where:
Is the name of output map.
Is the definition to create a dependent output map.
Is the assignment to create a non-dependent (editable) output map.
Is the conditional function.
Condition
Is the condition to be met.
Then Expression Is the calculation that has to be performed when the condition
is met.
Else Expression Is the calculation that has to be performed when the condition
is not met.
Output_map
=
:=
IFF

Some examples of the use of conditional functions in ILWIS are given in Figure 8.4.

324

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

Figure 8.4:

Examples of conditional functions in ILWIS. MapA has domain type class and
MapB has domain type value.

For simplification purposes, we will not use an expression for the Then condition
and the Else condition but we will simply put a value.
MapC = IFF (MapA=Forest , 1, ?)
In words: If a pixel in MapA has a class name Forest , then assign a value 1 to this
pixel in the output map (MapC) . If the pixel does not have the class Forest , then
assign the undefined value (?).
MapC1 = IFF ((MapA=Forest) AND (MapB=700) , 1, 0)
In words: If a pixel in MapA has a class name Forest and at the same time this pixel
in MapB has a value equal to 700 , then assign a value 1 to this pixel in the output
map; else assigns value 0.

Practicing with operators and functions in a small case study


After this overview of different operators and functions, let us apply these in the
analysis of a simple, hypothetical, problem. Suppose we want to calculate the price of
the land in the Cochabamba region. The average land prices per hectare are given in
an attribute table linked to the land use map. However, these average values may be
lower, depending on a set of two criteria:
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,
ILWIS 3.0 Users Guide

325

Spatial data analysis: overlay operations


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.

Select the following maps in the Catalog: Landuse , Slope and


Geomorphology ; click the right mouse button and select Open Pixel
Information.

Similarly, open the maps Landuse , Slope and Geomorphology .

SL = Slope>20

To get a quick idea of where the steep slopes are type on the Command line
of the Main window:
To get an idea where the landslides are, type on the Command line of the
Main window:
LSL =(Geomorphology=OL)OR ( Geomorphology=AL)

Inspect the values of the maps. Move with the mouse pointer through the
Landuse map and look at the information of the three maps in the pixel
information window.
Close the map windows and the pixel information window when you think
you have a good idea of the content of the maps and attribute tables connected to it.

You start the GIS analysis with an operation that you are already familiar with:
Reclassification (see section 7.3). The land use map has an attribute table, in which
the average land value (per hectare) is stored for each land use type. So you will
reclassify the class map Landuse with the Landvalue column, which will result in
a value map. Since the average land values are given per hectare (100*100=10000
m2), and you are working on maps with a pixel size of 20 meters (i.e., 400 m2 per
pixel), you need to divide the land values by 25 in order to obtain the average value
per pixel.

326

Type the following formula on the Command line of the Main window:
Landvalue = (Landuse.Landvalue)/25

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

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.

Type the following formula:


Landvalue1 = IFF (Slope>20 , Landvalue*0.7 , Landvalue)

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 lets look at the second criterion: If a pixel is located on an old landslide, then
the value is only 60% of the average land value. If the pixel is on an active landslide
or on an active erosion area, the value is only 40% of the average.

Type on the Command line of the Main window:


Geom = Geomorphology

Type the following formula:


Landvalue2 = IFF (Geom=OL , Landvalue*0.6 ,
IFF((Geom=AL)OR(Geom=HE) , Landvalue*0.4 ,
Landvalue))

Accept the defaults in the Raster Map Definition dialog box and Click
Show.

For clarification purposes, we used capitals in the expression but you can type small
letters.

ILWIS 3.0 Users Guide

327

Spatial data analysis: overlay operations

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
328

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations


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 dont 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
a=Undefined

True
False
Undefined

False
False
False

Undefined
False
Undefined

a OR b

b=True

b=False

b=Undefined

a=True
a=Undefined

True
True
True

True
False
Undefined

True
Undefined
Undefined

a XOR b

b=True

b=False

b=Undefined

a=True
a=Undefined

False
True
Undefined

True
False
Undefined

Undefined
Undefined
Undefined

NOT b

returns:

b=True

False
True
Undefined

a=False

a=False

a=False

b=False
b=Undefined

ILWIS 3.0 Users Guide

329

Spatial data analysis: overlay operations


So for example, if we have the following IFF function: IFF (a AND b c, d ):
- If a is true and b is true, then the condition is true, so the result is c.
- If a is true and b is undefined, then we cannot know whether the result is true or
false, because if b were true, the result would be c, else d Therefore, the result is
undefined.
- If a is false and b is undefined, then already one of the parts of the condition is
false, so it doesnt matter anymore what b is, because the condition is false anyway,
and the result will be d.
A different situation occurs, if we have the IFF function: IFF (a OR b, c, d
- If either a or b is true then it doesnt matter what the other part is (false or
undefined), because the condition is true, and the result is c.
- If a is false and b is undefined, then it may be that b is true, so the result is
undefined.
In most cases this is a logical assumption: You dont 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 dont 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 .
In ILWIS the function IFF(ISUNDEF( a ), b, c ) gives the same result as the
expression IFUNDEF( a, b, c ).

330

Accept the defaults in the Raster Map Definition dialog box and click
Show.

Display the map Landval_final with Representation Inverse, Stretch


1-15 . Compare it with the other maps, and close all map windows.

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations


Summary: Map Calculation formulas resulting in value maps
- Map Calculation is an operation with which you can calculate new maps using
formulas.
- 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.
- There is a wide range of operators and functions that can be used:
Arithmetic operators to multiply, divide, raise to a power, subtract or add
maps and/or constant values.
Logical operators to compare two expressions and check if both are true
(AND ), at least one is true (OR ), only one is true (XOR ). The NOT statement
checks whether an expression is not true.
Relational operators to test whether one expression is larger than, smaller
than, equal to another expression etc.
- Most functions are listed in Table 8.1.
- 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 dont know the result of a formula if one of the operands is
undefined; this depends also on the operators that are used.
- The functions IFF(ISUNDEF( a, b, c) and IFUNDEF( a, b, c) test whether
expression a is undefined. You can use these functions to change undefined values
into known values.

ILWIS 3.0 Users Guide

331

Spatial data analysis: overlay operations

8.2 Map Calculation and dependencies


In the previous exercise we have made a few maps, based on the input maps
Geomorphology , Slope , and Landuse . We also used the attribute table Landuse
in which the average value of the land per hectare was indicated.
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.

Open the Properties of map Landval_final .

Close the Properties of the map Landval_final by clicking the Cancel


button.

Move with the mouse pointer over map Landval_final . On the Status
bar you see on the right-hand side D, C, U. This means that map
Landval_final is Dependent (D), Calculated (C) and Up-to-Date (U).

On the Dependency tab one can read: Object is up-to-date. This means
that no changes were made in the input maps after the time that the map
Landval_final was created.

Another way to see if an object is Dependent (D), Calculated (C) and/or Upto-Date (U) is by switching the Catalog to Details View (by choosing the
Details command from the View menu or by clicking the Details button
in
the Standard toolbar of the Main window).

Open table Landuse .

This table contains the column Landvalue (the average value of the land per hectare
for the different land use types). The values for the units Lake and Riverbed are
undefined.
Now suppose there is a shortage of water in the Cochabamba area, then the price of
water will increase considerably. Many factories would like to have their own lake, as
is the case for the large beer brewery Taquina. So there should also be a value added
to the land use type: Lake .
332

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

Display map Landuse .

Double-click the Lake in the map window; the landvalue of the lake will now
be 400. Close the map and table when done.

Open map Landval_final and open a pixel information window with


maps Landuse and Landval_final .

Check the value of the lakes.

In the attribute table Landuse , edit the Landvalue field for the Lake
record. Type 400 .

As you can see the lakes in the map Landval_final still have undefined values.
Although we have edited the land values in the table Landuse for the lakes, the final
result is still not updated. Updating does not happen automatically, but is decided by
the user.

Close the map Landval_final and the pixel information window.


Open the Properties of raster map Landval_final .
On the Dependency tab of the raster map Landval_final one can now
read:
Object is not up-to-date: Column Landuse.Landvalue (day, month, year,
time).

It is indicated (day, month, year, time) when you have updated the column
Landvalue (if it is correct that should be about a minute ago).

Go to the Catalog and move with the mouse pointer over map
Landval_final .

On the Status bar you see the characters D, C, N. This means that the map
Landval_final is Dependent (D), Calculated (C) but that the map is
Not Up-to-Date (N).

On the Depencency tab, press the Make Up-to-Date button. The Check
Up-to-date dialog box appears.

Click Yes to answer the question: Map Calculate Landval_final is


not up-to-date . Recalculate it to make it up-to-date? .

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.

ILWIS 3.0 Users Guide

333

Spatial data analysis: overlay operations

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 .

Summary: Map Calculation and dependency links


- When the definition symbol (=) is used in a Map Calculation formula, a dependent
map is created. Data in a dependent map depend on data of input maps via the used
formula.
- 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.
- If a final output map is no longer up-to-date, all dependent maps in between an
edited source map and a final output map, will be recalculated when you press the
Make Up-to-Date button. For the final output map a chain of recalculations will
take place until the final output map is up-to-date again.
- The dependency of maps allows for easy updating.

334

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

8.3 Map Calculation formulas resulting in class or ID maps


When we work with IFF functions that give class or ID results, we may have four
different situations:
1. IFF (expression, domain1, ?). The result of an expression may be an existing
class or ID domain (mostly of one of the input maps), or it may be an undefined
value.
2. IFF (expression, domain1,name). The result of an expression may be an
existing domain or a name, which is not in the domain. In that case you cannot
simply use the existing domain (domain1) as the domain of the output map. Since
the new name is not in the domain, the map will contain undefined values for
those pixels. You either have to add the name to the domain or create a new
domain. A similar situation is IFF (expression, name, domain1).
3. IFF (expression, domain1, domain2). The result of an expression may be a
combination of two existing domains (domain1 and domain2).
4. IFF (expression, name, name). The result of an expression may be two
names, which are not in an existing domain.
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.
IFF (expression, domain1, ?)
If the operation uses only one map, this is in fact a retrieval expression, as we have
seen in chapter 7. Note that you have to use a question mark between double quotes
to assign undefined values in a map with a class or ID domain. For example, to find
the areas with landslides (AL = Active Landslide, OL = Old LAndslide) you can type
the following formula:

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.

ILWIS 3.0 Users Guide

335

Spatial data analysis: overlay operations

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.

IFF (expression, domain1, name)


In this example, we explain an IFF function in which the then part uses an existing
domain and the else part contains an item, which is not in the domain. You can add
the new name to the existing domain or create a new domain.
Suppose we want to find out where the landslides are. If there is no landslide, we will
use the new word No landslide .

336

Type the following formula on the Command line of the Main window:
Slide2 = IFF((Geom=AL)OR(Geom=OL) , Geom , No landslide)

The Raster Map Definition dialog box indicates the default domain
Geomorphology .

Click Show.

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations


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.
If you answer Yes, the name No landslide is added to domain
Geomorphology .

Answer Yes to the question: Add string No landslide to domain


Geomorphology .

Inspect the results in map Slide2 .


Then close the map window.

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.

IFF (expression, domain1, domain2)


The result of an expression may be a combination of two existing domains (domain1
and domain2).
For example: we want to add the items Old landslide (OL), Active landslide (AL) and
Heavily eroded area (HE) to the map Landuse .

ILWIS 3.0 Users Guide

337

Spatial data analysis: overlay operations

Type the following formula on the Command line of the Main window:
Slide4 = IFF ((Geom=AL)OR(Geom=OL)OR (Geom=HE) ,
Geom , Landuse)

The Raster Map Definition dialog box indicates the default domain
Landuse .

Click the Create button. The Create Domain dialog box is opened.

Close the Domain Class editor. Now you are back in the Raster Map
Definition dialog box. You will see that the domain is now Slide4 .

Click Show.

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.

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.
IFF (expression, name, name)
In this last example, we will look at a formula where both the then and else parts
contain new names. In this situation, ILWIS does not know the output domain, and
will not provide you with a default domain in the Raster Map Definition dialog box.
To continue with our example on landslides: You will now make a map with only two
units: Landslides or No landslides .

338

Type the following formula on the Command line of the Main window:
Slide5 = IFF((Geom=AL)OR(Geom=OL) , Landslides , No
landslides)

In the Raster Map Definition dialog click the Create Domain button. The
Create Domain dialog box appears.

Type Slide5 for the Domain Name. Make sure the option Class is selected
and click OK. The Domain Class editor is opened.

Press the Add Item button on the toolbar. The Add Domain Item dialog box
is opened.

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

Add the class Landslides and click OK.

Type the Description: Presence of Landslides and click Show.

Press the Insert-key and add the class No landslides .


Close the Domain Class editor. You are back in the Raster Map Definition
dialog box.
Inspect the results in map Slide5 and domain Slide5 and close the map
window and editor afterwards.

You could have created a new domain beforehand as well. Note that you can also use
a Bool domain (containing the possibilities True , False and undefined ? )
or a Yesno domain for the output map. This domain uses Yes and No instead
of True and False . In that case the formula would be:
Slide6 = (Geom=AL)OR(Geom=OL)
Select domain Yesno in the Raster Map Definition dialog box.
Summary: Map Calculation formulas resulting in Class or ID maps
- When the result of an IFF statement is not a value, you can have 4 possibilities:
1. IFF (expression, domain1, ?)
2. IFF (expression, domain1, name)
3. IFF (expression, domain1, domain2)
4. IFF (expression, name, name)
- For each of these combinations, you can choose to add classes or IDs to an existing
domain, to merge two domains, or to create a new domain.
- When two domains contain related information, one domain could be merged into
the other domain. When two domains contain information of different kinds, it is
better to generate a new domain.

ILWIS 3.0 Users Guide

339

Spatial data analysis: overlay operations

8.4 The Cross operation


When we are interested in many combinations of two maps, Map Calculation
formulae as discussed in the previous exercises, are not useful anymore. For example,
to combine two maps, MapA with 5 classes, and MapB with 3 classes, we may need
about 15 nested IFF functions within the same formula; this would obviously
become too complicated. Often, maps have even more classes. We use another
operation: Cross.
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 crosstable 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.

In the following exercise you will do two cross operations:


- Between two class maps: Landuse and a classified slope map Slope_classes ,
in order to find the percentages of flat, moderate and steep slopes for each land use
type.
- Between an identifier map Catchment and a value map Drainage in order to
calculate the drainage density per catchment.

340

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations


Crossing two class maps
Suppose you want to know the percentage of each land use type located on flat,
moderately steep, and steep slopes. In order to calculate that, we need two input
maps. The raster map Landuse , and a classified slope map Slope_classes with
three classes: Flat (0-10), Moderately steep (10-25), and Steep (> 25).
Note that some examples of classifying value maps were already presented in section
7.5.

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 the Output Map check box.

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 .
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 .

ILWIS 3.0 Users Guide

341

Spatial data analysis: overlay operations

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.

The Column Properties dialog box is opened. Click OK.

The Column Properties dialog box is opened. Click OK.

Select the Column: Area , select the Function: Sum , select the check box
Group by and select the column Landuse , select the Output Table check
box and type the table name: Landuse . Type for the Output Column:
Totalarea .

Click OK in the Aggregate Column dialog box. Column Totalarea , containing area sums per landuse class will be added to table Landuse .

From the Columns menu in the table window select Aggregation. The
Aggregate Column dialog box is opened.

Select the Column: Flat , select the Function: Sum , select the check box
Group by and select the column Landuse , select the Output Table check
box, and type the table name: Landuse . Type for the Output Column:
Flat .

Click OK in the Aggregate Column dialog box.

Close the table Landuse_slope .

Press the Arrow Up-key and edit the previous formula, so that it is:
Moderate = IFF(Slope_classes=Moderate , Area , 0)
Press the Arrow Up-key and edit the previous formula, so that it is:
Steep = IFF(Slope_classes=Steep , Area , 0)
From the Columns menu in the table window select Aggregation. The
Aggregate Column dialog box is opened.

Repeat this for the columns Moderate and Steep , so that the Landuse
table will contain the columns Totalarea , Flat , Moderate and Steep .
Open the table Landuse . As you can see it contains the columns
Totalarea , Flat , Moderate and Steep that you just generated.

Now you will calculate the percentage landuse found on flat, moderate and steep slopes.

Type the following formula on the Command line of the table window:
Pflat = 100*(Flat/Totalarea)

The Column Properties dialog box is opened.

342

Select the Domain Perc (percent) and enter for the Precision 1.0 . Click OK.
Create also the columns Pmoderate and Psteep with similar formulas.
Select Domain Perc for these columns and use a Precision of 1.0 .
Evaluate whether the results make sense and close the table Landuse when
done.

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations


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.
Crossing an ID and a value map: Drainage density
The cross operation is not restricted to class maps. It is also possible to use ID or
value maps. You should be careful with value maps though, since these may have an
enormous number of possible values and the cross tables may become too large to
handle.
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.

ILWIS 3.0 Users Guide

343

Spatial data analysis: overlay operations

Type the following formula on the Command line of the table window, containing the table Catchment_drainage :
Length = Drainage * npix

The Column Properties dialog box appears. Accept the defaults and click
OK.

From the Columns menu in the table window select Aggregation. The
Aggregate Column dialog box is opened.

Select the Column: Length , select the Function: Sum , select the check box
Group by and select the column Catchment , select the Output Table
check box, and type the table name: Catchment . Type for the Output
Column: Totallength .

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.

Open table Catchment .

The Column Properties dialog box is opened. Click OK.

Type the following formula on the Command line of the table window:
Drainagedensity = 1000*Totallength/Totalarea

The drainage density is expressed in kilometers per square kilometers. Since the
original data is in meters and square meters, we need to multiply with 1000. Now you
see the final result: the drainage density per catchment.

344

Close table Catchment .

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations


Summary: Cross operation
- 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 of
values or classes/IDs that occur in both maps.
- 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/IDs 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.
- A cross-table is often used in combination with Aggregation functions in the table
window.
- 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.

ILWIS 3.0 Users Guide

345

Spatial data analysis: overlay operations

8.5 Two-dimensional tables


As could be seen in the previous exercise, crossing of two maps results in a crosstable and a cross-map, in which all possible combinations of the units from the two
input maps, are stored as unique identifiers.
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 twodimensional 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

346

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

identifiers. If we would use it in combination with the Landuse map (which has 12
classes) you would have to fill in 717*12 = 8604 different combinations. This method
is thus mostly used for combining class maps with relatively few classes.
In this exercise, we will evaluate which areas are suitable for the extraction of gravel
material, which is used for building purposes (road-construction or for the production
of concrete for buildings). We do this by combining two maps: Geology (containing
information on the geological units) and Landuse (with the land use types). For each
combination of a geological and a land use unit, we will indicate whether it is suitable
or unsuitable for gravel extraction.

In the Catalog, click with the right mouse button on domain Geology .
Select the command Create 2-Dimensional Table from the context-sensitive
menu. The Create 2-Dimensional Table dialog box is opened.

Enter for the Table Name: Gravel . Type for the Description:
Suitability for gravel extraction . Select the Secondary Domain:
Landuse . The Primary Domain: Geology is already indicated.

Click the Create button next to the drop-down list box of the domain. The
Create Domain dialog box is opened.

Type for the Domain Name: Gravel . Select Type Class . Type the
Description: Suitability for gravel extraction and click OK. The
Domain Class editor is opened.

Press the Insert-key, and enter for the Name: Suitable , and the Code: S.
Click OK.

Press the Insert-key, and enter for the Name: Unsuitable , and the Code:
U. Click OK.

Close the Domain Class editor. You are now back in the Create 2Dimensional Table dialog box. Click OK.

Now the two-dimensional table Gravel is opened. The records show the units of the
geological map, and the columns of the units of the land use map.
The suitability classes for each combination of the geological and the land use units
are shown in Table 8.5. Only the geological units Glacial deposits , Old
alluvial deposits and Recent alluvial deposits can be used for the
extraction of gravel material, but only in combination with the land use units Bare
soil , Grassland , Riverbed and Shrubs .

ILWIS 3.0 Users Guide

347

Spatial data analysis: overlay operations


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).

Table 8.5:

Gl
Ld
Oa
Qu
Ra
Sh
Si
Sd

Ag

Ai

Ap

Br

Bs

Fo

Gr

La

Ri

Sh

Uc

Up

U
U
U
U
U

U
U
U
U
U

U
U
U
U
U

U
U
U
U
U

S
U
S
U
S

U
U
U
U
U

S
U
S
U
S

U
U
U
U
U

S
U
S
U
S

S
U
S
U
S

U
U
U
U
U

U
U
U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

U
U
U

Select a rectangle for all the fields in the first 4 columns.

In the Edit selected field(s) dialog box select the class Unsuitable .

Click the right mouse button in the selection, and choose Edit from the context-sensitive menu. The Edit selected field(s) dialog box appears.
Subsequently, edit all the fields in the columns Forest , Lake , Urban centre and Urban periphery to Unsuitable .

Edit the fields of column Bare soils one by one. Then select all fields of
column Bare soils and use the Copy and Paste (on the context-sensitive
menu) to paste the values into columns Grassland , Riverbed and
Shrubs .

When you are finished, close the table window.

The two-dimensional table is now complete. We can use it in a calculation on the


Command line of the Main window. The calculation formula should have the
following syntax:
Output_map = two-dim_tablename [map1, map2]

Where:
two-dim_tablename is the name of the two-dimensional table
map1
corresponds with the records in the 2D table
map2
corresponds with the columns in the 2D table

348

Make sure that you use square brackets [ ]instead of curly brackets ( )

ILWIS 3.0 Users Guide

Spatial data analysis: overlay operations

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.

Summary: Two-dimensional tables


- A two-dimensional table is seen as a matrix, used to define output class names, IDs
or values, for each combination of classes/IDs of two input maps.
- 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.
- To apply a two-dimensional table, use the following syntax:
Output_map = two-dim_tablename [map1, map2]

ILWIS 3.0 Users Guide

349

CHAPTER 9

Spatial data analysis:


neighbourhood and connectivity
calculations
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 4connected operation. When all 8 neighbours are taken into account, it is an 8connected 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.
For some of the calculations, an iterative procedure is required, in which the
calculation window, after finishing the calculation at the last pixel in the last line, will
start a reverse operation, using the data of the previous run as input. The calculation
will be repeated several times until no more changes occur in the map or a predefined
number of iterations.

ILWIS 3.0 Users Guide

351

Spatial data analysis: neighbourhood and connectivity calculations


The following neighbourhood calculations will be explained in this chapter:
- Filtering (in chapter 6 already explained for satellite images) applied to thematic
maps. You will look at those filters that are especially used for raster maps, such as
smoothing filters, counting filters, etc.;
- Neighbourhood calculations in Map Calculation formulas. The use of powerful
neighbourhood functions and map iterations will be shown, that allow you to generate models that evaluate the conditions of neighbouring pixels in a map;
- Distance calculation, in which the calculation window is used to calculate the
distance from source pixels in the map (which could be roads, rivers, etc.);
- Area numbering, in which unique identifiers are assigned to groups of connected
pixels with the same class name.
Some other neighbourhood calculations will be discussed in other chapters:
- Chapter 10 will discuss the specific calculations that are used for the analysis using
Digital Elevation Models, including Contour Interpolation and the use of gradient
filters in the calculation of slope length and slope direction.
- Chapter 11 will treat the various Point Interpolation calculations available in
ILWIS.
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.

352

Double-click the ILWIS icon on the desktop.


Use the Navigator to go to the directory: C:\ILWIS 3.0 Data\Users Guide\
Chapter09.

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

9.1 Filtering
In chapter 6, the filter operation has been discussed for the use on satellite images.
Filtering is a process in which each pixel value in a raster map is replaced with a new
value, provided that a condition or a set of conditions is satisfied. The new value is
obtained by applying a certain function to each input pixel and its neighbours. There
are many types of filters available in ILWIS. Some of these are especially designed
for the use on thematic or value maps, some are especially for satellite images, and
some may be used for both.
The following filters are useful to apply on maps:
- Filters used on Digital Elevation Models. With the help of the filters working
on DEMs, you can calculate slope steepness, slope direction, slope convexity/concavity and hillshading. These filters will be treated in the next chapter, which is
completely dedicated to the generation and use of DEMs;
- Majority filters. These filters allow you to calculate for each pixel the predominant (most frequently occurring) value or class name, of each input pixel and its 8
neighbours (when using a 3x3 filter);
- Smoothing filters. This filter is used on value maps and will calculate for each
pixel the average value of the central pixel and its 8 neighbours (when using a 3x3
filter);
- Rank order filters. This filter is used on value maps and can be used to calculate
the median value or any other rank of the central pixel and its 8 neighbours (when
using a 3x3 filter);
- Binary filters. Binary filters regard the input map as a binary map. This means
that zero values are regarded as zero, and all other values as one. Depending on the
central pixel value and its 8 neighbours, the filter produces a zero or one as output
value. These filters are used in what is called mathematical morphology. You can
use them for dilation (the growing of true pixels in a certain direction) and erosion (the shrinking of true pixels in a certain direction);
- Counting filters. Counting filters are used to count the number of pixels within a
certain search radius around each central pixel. They can be used to count the number of point features, such as houses, wells or landslides.
You can also define filters of other sizes. In the following sections examples will be
given of the use of these different filters.
Majority filters
These filters allow you to calculate for each pixel the predominant (most frequently
occurring) value or class name, of each input pixel and its neighbours. You can use
this filter to reduce a large variation in classes or values for neighbouring pixels.
A simple example will be used in this exercise: a small suitability map. It has 41 rows
and 54 column so that you can clearly see the effect of the filter on the map. The map
Suitability is a value map, and contains the values 1 to 6 for showing the
suitability of an area for growing maize. The area that has not been rated is undefined.
ILWIS 3.0 Users Guide

353

Spatial data analysis: neighbourhood and connectivity calculations

Display the raster map Suitability with the Pseudo Representation.


Find out the values of the different pixels by clicking them.
Close the map window.

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 .

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.

Type for the Output Raster Map name: Suitability1 and click the
Show button.

The result of the majority filter is that single undefined pixels that were within the
different areas are now filled up, and the linear features of 1 pixel wide have
disappeared.
There is also a majority filter that is used only on undefined values. The undefmajority filter (MAJUNDEF) is a 3x3 filter that selects the predominant value or class
name if the central pixel is undefined. If the central pixel is defined, the value or
class name will not be changed.

Now filter the map Suitability with the majority filter Majundef , and
create output map Suitability2 .
Display all three maps (Suitability , Suitability1 , and
Suitability2 ) next to each other and compare them.

The result of the undefined majority filter, is that single undefined pixels disappear
and the mapping units expand into the undefined areas.
Similarly to the undefined majority filter, there is a zero majority filter (MAJZERO),
which only selects the predominant value or class name if the central pixel has value
zero. If the central pixel is not zero, the value or class name remains the same.

354

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

Close the three maps (Suitability , Suitability1 , and


Suitability2 ).

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).

Type the following formula on the Command line:


Suitability_null = IFUNDEF(Suitability, 0)

Click Show in the Raster Map Definition dialog box, and select the
Pseudo Representation in the Display Options dialog box. Check
whether the undefined values are now zero.

Filter map Suitability_null with Filter Type Average , with 3 Rows


and 3 Columns. Create Output Raster Map Suitability3 and change
the Precision to 0.1 .

Display map Suitability3 next to map Suitability_null and compare them.

Click the pixels in both maps to find out their values.

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.

ILWIS 3.0 Users Guide

355

Spatial data analysis: neighbourhood and connectivity calculations


Rank order filters
These filters can be used to calculate for instance the median value of the central
pixel and its 8 neighbours (if using a 3x3 filter).

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.

356

Filter map Suitability_null with the Binary Filter Type, and the
Filter Name Dilate8 . Create Output Raster Map Suitability6 . Note
that the Domain of the Output Raster Map is Bool .

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.

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations


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 compare 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 compare 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 compare them. Click the pixels in both maps to find out their values.

Close all map windows.

ILWIS 3.0 Users Guide

357

Spatial data analysis: neighbourhood and connectivity calculations


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.

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 .

Close all map windows.

Zoom in on a part of the map containing drainage lines to see that the lines
are sometimes 8-connected. The undefined pixels neighbouring these
drainage lines are thus also 8-connected.

Zoom in on a small section of both maps with the same drainage lines and
compare them. You can see that all drainage lines are now 4-connected. In a
distance calculation they can now act as a closed barrier.

User-defined linear filters: Example of a counting filter


Besides the standard filters that are stored in the ILWIS system directory, of which
we have seen some in the previous part of this chapter, it is also possible to define
filters yourself.
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.

358

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations


columns

rows

-10 -9

-1

10

-10

-9

-8

-7

-6

-5

-4

-3

-2

-1

10

Figure 9.2:

-8

-7

-6

-5

-4

-3

-2

User-defined counting filter of size 21 * 21.

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
ILWIS 3.0 Users Guide

359

Spatial data analysis: neighbourhood and connectivity calculations


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 calculated 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.

Summary: Filter operation using maps


The following filters are useful to apply on maps:
- Filters used on Digital Elevation Models. With the help of the filters working
on DEMs you can calculate slope steepness maps, slope direction maps, slope convexity/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 neighbours.
- 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 number of point features, such as houses, wells or landslides.

360

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

9.2 Neighbourhood calculations using Map Calculation


Neighbourhood calculations are a special type of spatial analysis in ILWIS. They are
calculations on pixels where the outcome of a calculation depends directly on the
values of the neighbouring pixels. Neighbourhood calculations can be performed on
user-selected pixels and on whole maps, not like normal filters that can only be
applied on a whole map.
Like in a filtering procedure, neighbourhood calculations make use of a calculation
window. This imaginative window of 3x3 cells moves over the raster map and each
cell of the output map is calculated according to the specified neighbourhood
expression.
To be able to perform calculations on user-selected pixels, a pixel neighbour position
is coded with respect to the central pixel. The neighbours in this so-called matrix
(Figure 9.3) are coded from 1 to 9, where the central pixel has a value of 5.
1

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).

We can distinguish two types of neighbourhood calculations:


- neighbourhood calculations on the value of a single neighbour;
- neighbourhood calculations using neighbourhood functions which will calculate
with the values of multiple neighbours.
These two types can also be combined.

9.2.1 Calculating with the value of a single neighbour


The simplest neighbourhood expression retrieves the value of a single user-selected
neighbour:
Outmap = Map#[ Neighbour]
where:
Outmap
Map#
[Neighbour]

ILWIS 3.0 Users Guide

is the name of the output map.


is the syntax to specify the name of the input map Map over which a
neighbourhood matrix will be moved.
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!
361

Spatial data analysis: neighbourhood and connectivity calculations

Type the following formula on the Command line of the Main window
(note the square brackets!):
Dem_uppervalue = Dem Dem#[2]

Click Show in the Raster Map Definition dialog box. The map is calculated.

By this calculation, for every pixel, the value of a pixel from map Dem will be
retrieved (first part of expression), and simultaneously, a neighbourhood matrix will
be moved over map Dem (second part of expression), which will retrieve the value of
the neighbour on position [2]. These two values will then be subtracted from one
another. Refer to Figure 9.3 for the positions of neighbours. So, in this calculation the
value of a pixel in the first input map is subtracted by the value of the pixel on
position [2] (upper center) as found by the matrix which moves over the second map.

The Display Options Raster Map dialog box is opened. Click OK.
Check the result and close the map window.

In the next example you will calculate the altitude difference of a map in the X and Y
direction. The Dx (difference in X direction) and Dy (difference in Y direction) maps
are the output maps using a Digital Elevation Model (Dem ) as input map.

Type the following formula on the Command line of the Main window:
Dx = Dem#[4] - Dem#[6]

This formula means: Subtract the value of the pixel on the [6] position (the right
neighbour of the central pixel) from the value of the pixel on the [4] position (the left
neighbour of the central pixel). The result will be assigned to the central pixel in map
Dx .

362

Press Show in the Raster Map Definition dialog box. The map is calculated
and the Display Options dialog box is opened. Select Representation
Pseudo and click OK.

Check the result with the pixel information window (using the map Dem and
the map Dx ).

Close the pixel information window and the map window.


Now calculate a map Dy that gives the difference in Y direction.

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

9.2.2 Using neighbourhood functions on multiple neighbours


This section deals with neighbourhood functions. A neighbourhood function can
calculate with all values found by a neighbourhood matrix, or only with the values of
some selected neighbours in the matrix. The syntax for neighbourhood function
NBFLT will be treated separately. At the end of this section, also iterative calculations
will be explained.
Neighbourhood functions on multiple neighbours
OutMap = NbFunction(NbExpression)
OutMap = NbFunction [neighbour, neighbour, ]( NbExpression)

where:
is the name of the output map.
is a neighbourhood function to be used on the values as found by a
neighbourhood matrix. Some available functions are: NBMIN ,
NBMAX , NBAVG , NBSUM , NBPRD , NBSTD , NBMINP , NBMAXP ,
NBPRDP , and NBCNT . For more information, see Table 9.1.
[neighbour, neighbour, ]
if the neighbourhood function is followed by a list of neighbours
[neighbour, neighbour, ], then the neighbourhood function will
only work on the values of these selected neighbours.
As in section 9.2.1, neighbour is a number between 1 and 9 which
indicates the position of a certain pixel in the neighbourhood matrix
(refer to Figure 9.3).
(NbExpression) is a neighbourhood expression: a neighbourhood expression is any
expression which contains the name(s) of the input map(s) and
which contains at least one neighbour operator #.
OutMap

NbFunction

NbExpression may read for instance:


a neighbourhood matrix will move over input map
Map ; the values of all neighbours found by the
matrix will be retrieved. The neighbourhood
function will then return the minimum, maximum,
average, sum, etc. of these values.
Map# > 40
a neighbourhood matrix will move over input map
Map ; the values of the neighbours found by the
matrix will be retrieved when a neighbour has a
value greater than 40. The neighbourhood function
will then return the minimum, maximum, average,
sum, etc. of these values.
Map#

The available neighbourhood functions to perform calculations on multiple


neighbours including the central pixel are listed in Table 9.1.

ILWIS 3.0 Users Guide

363

Spatial data analysis: neighbourhood and connectivity calculations


Table 9.1:
Function

Overview of neighbourhood functions.


Explanation

NBMIN

Returns the smallest value of the values found by a neighbourhood matrix.

NBMAX

Returns the largest value of the values found by a neighbourhood matrix.

NBAVG

Returns the average value of the values found by a neighbourhood matrix.

NBSUM

Returns the sum of the values found by a neighbourhood matrix.

NBPRD

Returns the predominant value of the values found by a neighbourhood matrix.

NBSTD

Returns the standard deviation of the values found by a neighbourhood matrix.

NBCNT

Counts the number of values as found by a neighbourhood matrix which are not
undefined nor false.

NBDIS

Returns the distance between the central pixel and its neighbouring ones.

NBPOS

Returns the position of a neighbour in the neighbourhood expression.

NBMINP

Returns the position of the neighbour with the smallest value.

NBMAXP

Returns the position of the neighbour with the largest value.

NBPRDP

Returns the position of the neighbour with the predominant value.

NBCNDP

Tests for which of the neighbouring pixels a certain condition is true; when none
of the neighbours satisfies the specified condition the outcome value is 0.

NBFLT (filter) Applies a linear filter on the values found by a neighbourhood matrix.

Examples of some simple neighbourhood calculations using a neighbourhood


function are:
OUT = NBMIN(Map1#)
return the minimum value of each 9 values found by a
neighbourhood matrix which moves over Map1
calculate the average of each 9 values found by a
OUT = NBAVG(Map1#)
neighbourhood matrix which moves over Map1 (same as
using the AVG3x3 filter in the Filter operation).
OUT = NBCNT(Map1#)
count the number of values which are not undefined of
each 9 values found by a neighbourhood matrix which
moves over Map1 .
OUT = NBAVG[2,4,5,6,8](Map1#)

OUT = NBMINP(Map1#)

calculate the average of the values of the neighbours on


positions 2, 4, 5, 6, 8 (i.e. the 4-connected pixels) as
found by a neighbourhood matrix which moves over
Map1 .
return the position of the neighbour with the smallest
value of each 9 values found by a neighbourhood matrix
which moves over Map1 . The returned position will be a
value between 1 and 9.

Neighbourhood function NBFLT which uses a linear filter


NBFLT is always used in combination with NbExpression.
OutMap = NbFunction (NbExpression * NBFLT( FltName))

364

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations


where:
OutMap

NbFunction

NbExpression

NBFLT

FltName

is the name of the output map.


is a neighbourhood function (NBMIN , NBMAX , NBSUM , NBPRD ,
NBMINP , NBMAXP , NBPRDP , NBCNT , etc.) to be used on the values
which result from the neighbourhood expression.
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 neighbourhood operator #.
In its simplest form, the expression reads: Map# .
is name of the neighbourhood function which will apply a certain
3x3 linear filter on the values of NbExpression.
is the name of an existing 3x3 linear filter. The existing 3x3 linear
filters are: AVG3x3 , Edgesenh , Laplace , and Shadow . You can
also specify a 3x3 filter created by yourself.

An example of a simple neighbourhood calculation using a linear filter is:


OUT = NBSUM(Map1# * NBFLT(Edgesenh))

Apply the edge enhancement filter on input map Map1 and sum the
values of each neighbourhood matrix (same as using the edge
enhancement filter in the Filter operation).
Calculating a classified slope direction map
In chapter 10 a method is presented to calculate a slope direction map. A simple
classified slope direction map (aspect map) can also be made using the
neighbourhood function NBMINP and a DEM. This function returns the position of
the neighbour with the lowest value. Because we want all the neighbours to be
checked for the lowest value, we use the operator #.

Type the following formula on the Command line of the Main window:
Aspect = NBMINP(Dem#)

If more pixels have the same minimum value, then the precedence of the pixels is
determined by the pixel identifier value (see Figure 9.3): 5, 1, 2, 3, 4, 6, 7, 8, 9. The
position of the first pixel with the lowest value in this precedence will be assigned to
the pixel of the output map.
The result of the calculation is a raster map with values ranging from 1 to 9 (the
position identifiers, see Figure 9.3).
For example, if the neighbour with the lowest value is the lower left (southwest) pixel,
the result of the calculation is 7; if the lowest neighbour is the left (west) pixel, the
result is 4, etc. The different directions are listed in Table 9.2.

ILWIS 3.0 Users Guide

365

Spatial data analysis: neighbourhood and connectivity calculations


Table 9.2:
Direction

Northwest
North
Northeast
West
Flat
East
Southwest
South
Southeast

Relation between the values of the output map and the direction.
Value

1
2
3
4
5
6
7
8
9

Press Show in the Raster Map Definition dialog box. The map is calculated. The Display Options dialog box is opened. Select Representation
Pseudo and click OK.

Check the result with the pixel information window.


Close the pixel information window and the map window.

Calculating a receiving cell map


Another example of the use of neighbourhood functions is the calculation of a flow
direction matrix. In a flow direction matrix the direction that a fluid will flow to on a
Digital Elevation Model is calculated. This is done by calculating the steepest slope
downhill, using the NBMINP neighbourhood function in the same way as the direction
calculated in the previous exercise. You can however also calculate for each cell from
which of its neighbours it receives the fluid, a receiving cell map; this map can be
calculated using the 10-NBMINP function.

Type the following formula on the Command line of the Main window:
Flow_direction = 10 - NBMINP(Dem#)

The result of this calculation is a raster map with values ranging from 1 to 9,
indicating from which neighbour the cell receives the liquid. A 1 indicates for
example the cell in the Northwest direction. The result can be used in other
calculations that predict spreading phenomena (such as the spreading of a pollutant, a
landslide, or in runoff modeling). The direction matrix value can be compared with
the position identification value, in any 3x3 neighbourhood of which the cell is part.
If the pixel value in the direction matrix equals its position number in any 3x3
neighbourhood, then water (or other feature) will flow from this pixel towards the
center of this window for which the statement is true.

366

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

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.

Check the result with the pixel information window.


Close the pixel information window and the map window.

Determining flat areas and pits in a DEM


An area is considered to be flat, when in the moving window of 3x3 pixels (9 pixels
in total) all pixels have the same value. With the expression NBCNT(Dem# = Dem)= 9
we can check which pixels have 8 neighbours with the same value as the central
pixel. In other words, the statement counts the amount of all neighbours of Dem that
are equal to the central pixel. If the value is 9, i.e. all pixels in the matrix have the
same value, the area is considered to be flat. This calculation will result in a
Boolean map. If the statement is true the result will be 1 else 0.

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.

ILWIS 3.0 Users Guide

367

Spatial data analysis: neighbourhood and connectivity calculations


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.
Table 9.3:

Iteration functions.

MAPITER (startmap, iterexpr)

Performs iterations on the start map according to


the iteration expression until there are no pixel
changes anymore.

MAPITER (startmap, iterexpr, times)

Performs a specified number of iterations on the


start map according to the iteration expression.

MAPITERPROP (startmap, iterexpr)

Performs iterations with propagation on a start map.

MAPITERPROP (startmap, iterexpr, times)

Performs a specified number of iterations with propagation on a start map.

Iterations can be performed with or without propagation. When performing iteration


with propagation, the newly calculated values for a row of pixels are immediately
used as input for the calculation of the next row of pixels. Without propagation, the
original values are used as input on all calculations, until the next iteration. After
each iteration, ILWIS shows the number of changed pixels. This number is the total
number of changes after performing one iteration in all directions (up, down, right
and left).
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 .

Display raster map Damsite.


Check the contents of the map.
After that close the map window.
Polygonize the raster map Damsite . Accept all defaults.

As you can see, the raster map Damsite contains the location of the dam, indicated
with the word Damsite . The rest of the map has undefined values.
368

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations


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 .

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.

Select as GeoReference: Cochabamba .


Select Domain: Value with a Value Range of 0 to 1, and a Precision of
1. Click OK.

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.

ILWIS 3.0 Users Guide

369

Spatial data analysis: neighbourhood and connectivity calculations

Double-click Iteration in the Operation-list. The Map Iteration dialog box


is opened.

Select the Start Map: Start .


In the Expression box type:
IFF(Dem_with_damsite > 3280,Start,NBMAX(Start#))

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.

Accept the defaults and click OK.

Close the pixel information window and the map window.

Use the pixel information window and add the maps Dem_with_damsite ,
Start and Flooded . Check the results.

The output map Flooded can now be used to calculate the volume of the water in
the reservoir.

370

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

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.

What is the total volume of the flooded area?


Is this dam well situated? Why?

The concept of map iterations is very powerful. It allows you to create your own
models for different types of applications. For more examples of neighbourhood
calculations, consult the ILWIS Applications Guide and the topic How to calculate
(advanced) in the ILWIS Help.
Summary: Neighbourhood functions
- Neighbourhood calculations are a special type of spatial analysis in ILWIS. They
are calculations on pixels in which the outcome depends on the neighbouring pixels.
- Neighbourhood calculations may be performed on user-selected pixels as well as on
whole maps.
- Just as in filtering procedures, neighbourhood calculations make use of a matrix.
This imaginative window of 3x3 cells is moved over the raster map. Each cell of
the output map is calculated according to the specified neighbourhood expression.
- Neighbourhood calculations can make use of neighbourhood functions.
- Iterations are a special type of calculation. They are a successive repetition of a
mathematical operation, using the result of one calculation as input for the next.
- In iterations, the calculation stops when the difference of the output compared to
the input is negligible, or if the number of iterations as defined before is reached.
- Iterations are always used in combination with neighbourhood calculations. Such
an application might be for instance the selection of an item or area that fits a certain condition, starting from one pixel (for example the calculation of a flooded
area, or the spreading of a pollutant).

ILWIS 3.0 Users Guide

371

Spatial data analysis: neighbourhood and connectivity calculations

9.3 Distance calculation


The Distance operation calculates the distance (in meters) from user specified
source pixels to all other pixels in a raster map. The result of this operation is a raster
map, where every pixel is assigned a value representing its distance to the nearest
source pixel. The user-defined source pixels from which the distance is calculated
may represent any kind of features, such as point features (for example rainfall
stations), linear features (for example roads) or area features (for example a city
block). The distance is calculated with a distance filter. The principle is shown in
Figure 9.4.

Figure 9.4:

The principle of distance calculation.

A source map for distance calculation can be any raster map with domain type class,
ID or value. This map should contain pixels with class names, IDs or values and
pixels with undefined values. All pixels with a class name, ID, or value in a source
map, are considered as source pixels and distance values will be calculated for all
pixels that are undefined. The distance filter will first calculate the distance in
number of pixels. The distance from a source pixel to its horizontal or vertical
neighbours is 1, and the distance from a source pixel to its diagonal neighbours is the
square root of 2. The filter will move first from the first pixel on the top line to the
last pixel of the last line. Then, it will do the same operation in the reverse direction.
Once the distance, in number of pixels, to the nearest source pixel is known, the final
distance in meters is obtained by multiplying this with the pixel size.
If not all parts in the source map are equally accessible, a so-called weight map can
be used. A weight map contains pixels with values (weight factors) referring to the
degree of accessibility and inaccessibility. In a weight map, accessible pixels are
assigned positive values. A higher positive weight value for accessible pixels means
that the area covered by these pixels (swamps, forest, bad roads, etc.) are more
difficult to cross than other areas. Inaccessibility can be introduced in the weight map
by negative weight factors. Pixels with a negative value (river, dens forest or
372

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations


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).
Simple distance calculation
The map Drainage with a class domain is used in order to calculate the distance
from streams and lakes to any pixel in the map, under the assumption that all areas
are equally accessible. The raster map Drainage contains pixels, representing the
drainage (source pixels) and undefined pixel, representing the rest of the area in the
map.

Double-click the operation Distance Calculation in the Operation-list.


The Distance Calculation dialog box is opened.

Select raster map Drainage in the list box Source Map.


Type Drain_distance in the text box Output Map.
Accept the other defaults and click the Show button.

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.

In the Display Options - Raster Map, select Representation Clrstp12 ,


change the Stretch range into 0 to 2000 and click OK.

The distance map is displayed on the screen. This map is a value map, in which the
pixel values refer to the distance of this pixel towards the nearest source pixels. You
ILWIS 3.0 Users Guide

373

Spatial data analysis: neighbourhood and connectivity calculations


can also display the segment map Drainage in the same map window.

Drag the segment map Drainage to the map window.


Click OK in the Display Options dialog box.
Enlarge the map and check the distance values by clicking on several pixels.
Close the map window.

Calculating distance with weights: Travel time map


A travel time map is a distance map in which the calculated distance values in meters
are converted to time units (seconds, minutes, or hours, etc.). For this process we
need two raster maps as input: a source map and a weight map. The source map
indicates from where the distance should be calculated, and the weight map indicates
which areas are more difficult to cross.
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.
First step: Creation of the source map

One of the input maps required for this operation, is a source map in which only the
central plaza has a value and the rest of the map has undefined values. The central
plaza has the ID 018 (you can check that if you like).

374

Type the following formula at the Command line in the ILWIS Main window:
City_source = IFF(Cityblock = 018, Cityblock, ?)

Click Show in the Raster Map Definition dialog box.


Check the results in map City_source and close the map afterwards.

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations


Second step: Creation of the weight map

The second input map required for this operation, is a weight map where all the
pixels, except the source pixels, are assigned weight factors to simulate the difficulty
of crossing pixels, which form barriers such as building blocks, the river, the lake,
mountain ridges, etc. In this exercise the roads are assigned a value 1, the recreational
areas a value 4 and the rest of the city blocks will receive the value -1 (negative
weights make the pixels inaccessible). Note that the weight factors are inversely
proportional to the speed. In this exercise the maximum speed (20 km/h) is set to
weight factor 1 (along the streets) and to obtain the minimum speed of 5 km/h in the
recreational areas we use a weight factor 4.

Type the following formula at the Command line of the ILWIS Main window:
City_weight = IFUNDEF(Cityblock, 1, IFF
(Cityblock.Landuse = Recreational, 4, -1))

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.
Third step: Calculating distances

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.
ILWIS 3.0 Users Guide

375

Spatial data analysis: neighbourhood and connectivity calculations

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.

Fourth step: Converting distances to travel time

Now that the weighted distances from each part in the map towards the central plaza
are known, we only need to convert the distance values (in meters) to time units
(minutes). The maximum speed in the city is assumed to be 20 km/h in the streets
and 5 km/h in the parks. To create the travel time map:

Type the following formula on the Command line:


City_travel_time = (City_distance * 60 / 20000)

Click Show in the Raster Map Definition dialog box. Select


Representation Pseudo and click OK.

Check how much time it takes to travel from the airport to the center.
Close the map window when you are finished.

Calculating distances: Thiessen map


In the third and last example of distance calculation, you will have a look at a
Thiessen map. In a Thiessen map each pixel is assigned the class name, identifier, or
value of the nearest point. For example, schools, hospitals, water wells, etc. can be
represented by points. The output of a nearest point operation on such a point map,
gives the service area of the schools, hospitals or water wells, based on the shortest
horizontal distance between input points and output pixels.
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.

376

Close the map.

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

Double-click the Distance Calculation operation in the Operation-list. The


Distance Calculation dialog box is opened.

Select raster map Rainfall in the list box Source Map.

Click OK to display the output map Rain_distance .

Click the various units to find out their meaning.

Type Rain_distance in the text box Output Raster Map.


Select the check box Thiessen Map and enter the name: Rain_area .
Click the Show button.
After the calculations, the Display Options Raster Map dialog box is
opened.
Also display the Thiessen map Rain_area , and position it next to the map
Rain_distance .

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.

Open table Rainfall .


Type the following formula on the Command line of the table window:
Rain_total = January + February + March + April + May + June +
July + August + September + October + November + December

The Column Properties dialog box is opened. Click OK.


Close the table window and activate the map Rain_area .
Re-open the Display Options Raster Map dialog box of the map.
Select the check box Attribute and select the column Rain_total .
Select Representation Pseudo and click OK. Now the total rainfall per
year in shown for each of the Thiessen areas.
Close the maps Rain_distance and Rain_area .

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 Users 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).
Summary: Distance calculation
- The Distance operation calculates the distance (in meters) from user specified
source pixels to all other pixels in a raster map.
- All pixels with a class name, ID, or value in a source map, are considered as source
pixels and distance values will be calculated for all pixels that are undefined.
- A weight map contains pixels with values referring to the degree of accessibility.
Negative weights indicate inaccessibility, and positive values, higher than 1, indicate areas that can be crossed with more difficulty.
- The units in a distance map are meters. They can be converted with Map
Calculation formulas into time.
- A by-product of distance calculation is a Thiessen map, in which the service area
of source pixels, based on the shortest distance is indicated. Thiessen maps can also
be made from point maps using the Nearest Point interpolation.

378

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

9.4 Area numbering


The Area Numbering operation assigns unique identifiers to class, value or ID pixels
in a raster map; the identifier Area followed by a unique number starting at 1.
Area numbering may be a useful tool in the following situations:
- If you want to perform a Cross operation with another map and you want to distinguish each connected area separately, instead of using mapping units.
- If you want to add special attribute data to each connected area, instead of the mapping units.
- To generate maps that can be used as input for cell based models.
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.
In this exercise, the Area Numbering operation is performed on map
Geomorphology , which has a class domain.

Double-click the Area Numbering operation in the Operation-list. The


Area Numbering dialog box is opened.

Select class raster map Geomorphology in the list box Raster Map.
Type Geomorphology_numbered in the text box Output Raster Map.
Accept the defaults (note that you use the 8-connected option) and click the
Show button. The Display Options - Raster Map dialog box is opened.

ILWIS 3.0 Users Guide

379

Spatial data analysis: neighbourhood and connectivity calculations

Select the option Multiple Colors 31 and click OK. The map is displayed.
Check the meaning of the mapping units. Double-click a unit. The Edit
Attribute dialog box is opened, in which you can also read the geomorphologic class name.
Close the map window when you finished the exercise.

Figure 9.5:

Simple example of Area numbering. The pixels that are connected are assigned the
same code. Different results are obtained when only the horizontal and vertical
neighbours are considered (4-connected) or whether all neighbours are considered
(8-connected).

Summary: Area numbering


- The objective of area numbering, is to assign unique identifiers to those areas in a
raster map that are having the same value, and that are connected.
- Area Numbering is similar to the Unique ID operation that can be used for point,
segment and polygon maps.

380

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

9.5 Connectivity calculations


Connectivity calculations look at spatial units that are connected (using a set of predefined rules). These spatial units may either occur in raster or vector maps. This
group of calculations can be subdivided into:
- Contiguity functions: Connected areas that share (a) common characteristic(s);
- Proximity functions: Connected areas having the same distance (in time, distance,
costs, etc.) to a given point, line or area;
- Network functions: Areas (usually lines) that form a set of interconnected features
through which resources from one location to another are moved;
- Spread functions: Connected areas that result for spreading, dilution or accumulation of phenomena from a given point, line or area, and;
- Seek functions: Connected areas (usually lines) that form an optimum pathway
according to (a) specified decision rule(s).
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 this problem we need to know the following:
- Which one of the forested areas has no borders with agricultural or urban areas?
- Which one of the forested areas is at least 200 hectares large?
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.

Double-click the Unique ID operation in the Operation-list. The Unique ID


dialog box is opened.

Select polygon map Landuse as the Input Map.


Type for Domain Prefix LandID .
Type LandID as the Output Map.
Type the following Description: Unique Landuse polygons .
Click Show. The map is being calculated.

ILWIS 3.0 Users Guide

381

Spatial data analysis: neighbourhood and connectivity calculations

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.

Close the map LandID .

Select the polygon map LandID as Input Map.

Double-click the Neighbour Polygon operation in the Operation-list. The


Neighbouring Polygons dialog box is opened.
Type LandIDnb as Output Table.
Type the following Description: Neighbours of the unique land use
polygons .

Click Show. The table is opened after it has been calculated.

The result of this operation is a table (LandIDnb ) containing three columns:


- PolName1 : The polygon for which the neighbours are calculated.
- PolName2 : The polygon neighbouring the polygon shown in PolName1 .
- Length : The length of the boundary line between the two polygons.
The combination between the polygons in PolName1 and those in PolName2 ,
represent the polygons located at the margins of the map. The undefined values (?)
refer to the boundary of a polygon located at the margin of the study area.
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 IDs). 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 .
Joining of tables was already discussed extensively in chapter 5.

In the table open the Columns menu and select the Join command. The Join
Wizard appears.

Since the column PolName1 has the same domain as the table LandID , the joining
is fairly simple.
382

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations

Select the Table : LandID .


Select the Column: Landuse and click the Next button.
The Key-Column option is selected by default. Click the Next button.
Select as Key 1: PolName1 and click the Next button.
Type the Output Column: Landuse1 and click the Finish button.
Click OK in the Column Properties dialog box.

Now we know for each of the polygons IDs in column PolName1 what the land use
is. We also need to know the land use of their neighbouring polygons, listed in
column PolName2 .

Do the same Join operation, but now select the Key-Column: PolName2
and type the Output Column: Landuse2 .

Now that we know the land use type of each polygon and its neighbours, we can start
to evaluate which one of the forest polygons has no borders with agricultural or urban
polygons. We can do this with a calculation formula. There are four types of land use
which we want to exclude: Agriculture , Agriculture (irrigated) , Urban
center and Urban periphery . To simplify the formula, we already know that
none of the forested area is bordering the urban area. The formula would become
very large if we would have to type the full names. Fortunately we can use a shortcut.
If we use the function Left(column, length) in the following way:
- Left(Landuse2, 2) = Ag , this will incorporate both the land use types
Agriculture and Agriculture (irrigated) .

Locate the mouse pointer on the Command line of the table window and
type (case sensitive!) the following formula:
Good = (Landuse1 = Forest) and (left(Landuse2, 2) <>
Ag)

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.

ILWIS 3.0 Users Guide

383

Spatial data analysis: neighbourhood and connectivity calculations


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.

Close the table LandIDnb and open the table LandID .

Select the Table LandIDnb and select the Column Good . Click the Next
button.

Accept the default option Use Domain of current table and click the
Next button.

Select Polname1 as Key 2 and click the Next button.

Open the Columns menu and select the Join command. The Join Wizard is
opened.

Select the Function Minimum and click the Next button.


Type the name of the Output Column Good and click Finish.
Click OK in the Column Properties dialog box.

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.

384

Close the Polygon Histogram LandID .

Click OK in the Column Properties dialog box.

Open or maximize the table LandID .


Type the following formula on the Command line of the table window:
Finalgood = Good and (LandID.hsa.area > 2000000)

ILWIS 3.0 Users Guide

Spatial data analysis: neighbourhood and connectivity calculations


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 final task is to display these polygons.

Close the table LandID .

Select the check box Attribute and select the Column: Finalgood .

Check the result by clicking on these polygons and close the map window
afterwards.

Double-click the polygon map LandID . The Display Options dialog box is
opened.
Click OK. The polygon map is displayed and you can see the suitable polygons displayed in green.

Summary: Connectivity calculations


- Connectivity calculations look at spatial units that are connected (using a set of predefined rules).
- 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.
- The resulting table can be used for connectivity calculations.

ILWIS 3.0 Users Guide

385

CHAPTER 10

Using Digital Elevation Models


Digital Elevation Models (DEMs) store continuously varying variables such as
elevation, groundwater depth or soil thickness. Digital Terrain Models (DTMs) are
digital representations of altitude and are frequently used in hydrological, erosion and
engineering geological studies.
Digital Elevation Models are made via the following techniques:
- Photogrammetrical techniques. These methods use stereoscopic aerial
photographs or satellite images to sample a large number of points, with X, Y and
Z values, by means of advanced photogrammetrical equipment. After this, the
points are interpolated into a regular grid (raster). Unfortunately, the method is
rather time consuming (each sampling point has to be measured by an expert
through the lowering of a floating mark on the stereo model) and requires
photogrammetrical experts, and a set of detailed control points. At present,
photogrammetrical software packages are on the market which can automatically
generate a DTM from stereoscopic scanned aerial photographs or satellite images
in combination with a number of control points for which (x,y, z) coordinates are
known. In general, it can be said that photogrammetrical methods, whether
analogue or digital, are mainly used by mapping agencies and certain companies
specialized in photogrammetry and map production.
- Point interpolation techniques. When point data is available for an area,
obtained via ground surveys using theodolites and/or Global Positioning Systems
(GPS), point interpolation can be used to generate a DEM. For complex terrain, the
interpolation techniques are also rather complex, taking into account breaklines of
slope. Point interpolation techniques will be treated in chapter 11.
- Interpolation of contour lines digitized from existing maps. When neither
existing DEMs derived from photogrammetric techniques nor detailed point data is
available, the contour information on existing topographic maps is the only source
from which you can generate a DEM. In that case the contour lines are digitized
and interpolated. The interpolation of contour lines is a standard procedure in
ILWIS to generate a DEM. This is what we will discuss in the next section.
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.

ILWIS 3.0 Users Guide

387

Using Digital Elevation Models


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 birds eye view of the terrain from a user
defined position above the terrain.
- Cross-sections indicating the altitude of the terrain along a line and represented
in a graph (distance against altitude).
- Volume maps (or cut-and-fill maps), generated by overlaying two DEMs from
different periods. This allows you to quantify the changes in elevation that took
place as a result of slope flattening, road construction, landslides etc.
- Creation of Ortho-images from aerial photographs or satellite images. With the
help of DEMs, aerial photographs and satellite images can be corrected for tilt
distortion and relief displacement.

388

ILWIS 3.0 Users Guide

Using Digital Elevation Models


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.

Double-click the ILWIS icon on the desktop.


Use the Navigator to go to the directory: C:\ILWIS 3.0 Data\Users Guide\
Chapter10.

ILWIS 3.0 Users Guide

389

Using Digital Elevation Models

10.1 Creating a Digital Elevation Model: contour interpolation


In this section, you will create a DEM for the Cochabamba study area from digitized
contour lines. The contour lines were digitized manually. See section 3.4 for
information on how to digitize contour lines.
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:
Hp = H2 +(d2 /(d1 + d2)*(H1 - H2))
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).

390

ILWIS 3.0 Users Guide

Using Digital Elevation Models


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.

Accept all other defaults and click Show.

Select GeoReference Cochabamba .


Type for the Description: DEM created from the segment map
Contour .

The calculation may take some time, depending on the computer configuration and
other programs that are working simultaneously. It is advised to close other programs
while performing contour interpolation: this will speed up the process considerably.
The Display Options - Raster Map dialog box will be opened after the operation is
finished.
The default representation which is indicated in the Display Options dialog box is
the same one as was used for the segment map Contour : the user-defined
Representation Height .

Click OK in the Display Options Raster Map dialog box. The map is displayed.

Click several places in the map and read the altitude values.

Double-click the map Dem in the Layer Management pane. The Display
Options Raster Map dialog box is reopened.
Select Representation Clrstp12 and click OK. The map is now displayed
with a Representation Clrstp12 .

Now we will show you that even within pixels an interpolation can take place.

Zoom in on the Dem , until you see the pixels clearly.


Check the value of a pixel by moving the mouse pointer within a pixel.

ILWIS 3.0 Users Guide

391

Using Digital Elevation Models

From the File menu, choose Properties, and select the Interpolation check
box. Click Apply.

Check the height value within a pixel once more and close the map window
when finished.

Selecting the Interpolation check box is especially important when you want to use
the DEM in a georeference Direct Linear or a georeference Orthophoto. In regular
map calculations, however, still 1 value per pixel will be used.
If you wish you can create a new representation to make the Dem appear sliced. A
DEM can also be classified or sliced permanently through the operation Slicing.
Ranges of values of the input map are grouped together into one or more output
classes. The output map resulting from the Slicing operation is a map with the
domain type group. A domain group should be created beforehand or during the
operation using the Slicing dialog box. The domain group lists the upper boundaries
of the groups and the group names. A detailed description of the Slicing procedure
was given in the sections 6.6.2 and 7.5.
Use of additional point heights
The interpolation of contour lines will give wrong results for hilltops, which are
enclosed on all sides by a contour line. They will appear as flat areas with the same
altitude as the contour line surrounding it. To improve this, it is possible to combine the
segment map, containing the contour lines, with a point map, containing the altitudes of
the hilltops. Both maps should first be converted to raster and then combined into one
raster map. This raster map will serve as the basis for the interpolation.

Display segment map Contour with Representation Height .


From the Layers menu select Add Layer.
The Add Data Layer dialog box appears. Select the Point Map
Spotheight and click OK. The Display Options Point Map dialog box
is opened.
Press the Symbol button. The Symbol dialog box appears.
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.
Click OK. The point map is displayed on top of the contour lines.

When you zoom in on one of the crosses you will see that it is located within a
closed contour line on a hilltop. Of course the same procedure is valid for closed
depressions.

392

Close the map window.

ILWIS 3.0 Users Guide

Using Digital Elevation Models


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.

Double-click the Point to Raster operation in the Operation-List. The


Rasterize Point Map dialog box is opened.

Select the Point Map Spotheight . Select GeoReference Cochabamba ,


accept all other defaults and click Show. The point map is rasterized and the
Display Options Raster Map dialog box is opened.

Click OK to display the rasterized point map.


Close the map after you inspected the result.

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 Users 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 displayed on top of Dem1 .

From the File menu in the map window, select Open Pixel Information.
The pixel information window is opened.

Add map Dem via drag and drop to the pixel information window and check
the altitude values of the hilltops with the mouse.

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.
Summary: Contour interpolation
The creation of a Digital Elevation Model from a segment map is done with the
Contour Interpolation operation. This operation works in two steps:

- Segment to raster conversion. First a segment map is converted to raster, using


a georeference.
- Contour interpolation. A linear interpolation is made between the pixels with
known 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 each pixel in the map has a value.

394

ILWIS 3.0 Users Guide

Using Digital Elevation Models

10.2 Filters applied on Digital Elevation Models


Filtering is the calculation of pixel values in an image or a raster map based on the
pixel values of the central pixel and its neighbours. In other words, filtering is a
process in which, usually a window of 3x3 or 5x5 pixels, is moved over the map, to
calculate an output value for the central pixel in the window according to its
neighbours.
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
DFDY
DFDUP
DFDDN
D2FDX2
D2FDY2
D2FDXDY
LAPLACE
SHADOW

Detects slope differences in x-direction.


Detects slope differences in y-direction.
Calculates slope differences in the upward diagonal direction.
Calculates slope differences in the downward diagonal direction.
Detects slope shape differences in x-direction.
Detects slope shape differences in y-direction.
Calculates slope shape differences in all diagonal directions
Calculates slope shape differences in all diagonal directions
Applies artificial illumination (from the northwest) to the DEM.

Creating a hillshading map


In this exercise, the ILWIS standard filter Shadow is applied on the Digital Elevation
Model Dem to create a shaded relief image. The shadow filter simulates sun
illumination on the surface, with the sun in the northwest. The shaded relief image is
merely used for display.

Double-click the Filter operation in the Operation-list. The Filtering dialog


box appears.

Select Raster Map: Dem

Accept all other defaults and click Show. After the map has been calculated,
the Display Options - Raster Map dialog box will appear.

In the Display Options - Raster Map dialog box, select Representation


Gray and click OK. The map is now displayed.

Select Filter Name: SHADOW .


Type Hillshading in the text box Output Raster Map.
Type for the Description: Hill shading map generated from the map
Dem .

ILWIS 3.0 Users Guide

395

Using Digital Elevation Models


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.

Close the map window.

Using gradient filters


The most important types of filters that can be used on a DEM are called gradient
filters. With the help of the gradient filters Dfdx and Dfdy , horizontal and vertical
gradients are calculated for each pixel. The gradient maps are used to produce slope
steepness maps as well as slope direction maps.
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.

396

ILWIS 3.0 Users Guide

Using Digital Elevation Models

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.

Double-click the Filter operation in the Operation-List. The Filtering dialog


box is opened.

Select Raster Map Dem and Filter Name DFDX .

Click OK in the Display Options - Raster Map dialog box. The map is
now displayed.

In the map window, open the pixel information window and add the map
Dem . Zoom in on the map until you can see individual pixels. Compare the
values of the map Dx for a certain pixel, with the difference of the altitude of
its left and right neighbours in the map Dem .

Repeat the procedure to create a gradient map in the y-direction, but select
the Filter Name DFDY and type Dy for the Output Raster Map name.

Close the map window and the pixel information window when you have finished the exercise.

Type for Output Raster Map: Dx .


Accept all other defaults and click Show. The map is calculated, after which
the Display Options - Raster Map dialog box is opened.

Calculating slope shape


Before continuing with the creation of a slope steepness map, you will have a look to
another set of filters that are useful for DEMs. A number of filters can be used to
investigate which parts of the terrain are convex (showing negative values in the
output map) or concave (positive values in output map). Flat areas and uniform slopes
obtain the output value 0. The following filters can be used:
- D2FDX2. This 1x5 filter detects slope shape differences in x-direction.
- D2FDY2. This 5x1 filter detects slope shape differences in y-direction.
- LAPLACE. This 3x3 filter can be used to detect slope shape differences in both x
and y directions.
ILWIS 3.0 Users Guide

397

Using Digital Elevation Models


- D2FDXDY. This 5x5 filter detects slope differences in both x and y direction (second 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 .

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.

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.

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.

398

Click the Create button next to the drop-down list box of the Domain. The
Create Domain dialog box is opened.

Enter the Domain Name Shapeclasses and click OK. The Domain
Class editor is now opened

Close the Domain Class Editor. You are now back in the Raster Map
Definition dialog box. Click Show.

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.

ILWIS 3.0 Users Guide

Using Digital Elevation Models


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.

Filters used to calculate internal relief


With the help of filters and digital elevation models, it is also possible to calculate
internal relief, which is expressed as the maximum elevation change within 1 hectare,
or within 1 square kilometer. The filter type that can be used for this is the rank order
filter. A rank order filter will place all pixel values that occur within the filter
window (in a 3x3 filter that would be 9 values) in an increasing order. The user can
then select which rank value should be taken. So, in the case of a 3x3 filter, the first
rank value would be the minimum of the 9 pixels, the fifth value would be the
median and the ninth value would be the maximum.
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.
ILWIS 3.0 Users Guide

399

Using Digital Elevation Models

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.

Add maps Demmin and Demmax to the pixel information window and check
some values by clicking in the map.

Close the map and the pixel information window when done.

From the File menu in the map window, select Open Pixel Information. The
pixel information window is opened.

Summary: filters used on Digital Elevation Models.


The following filters are useful to apply on Digital Elevation Models:
- 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 purposes.
- 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 calculate if the slope is convex, concave or straight.
- Rank order filters. With the help of rank order filters it is also possible to calculate internal relief in a digital elevation model, expressed for example as the maximum elevation change within 1 hectare, or within 1 square kilometer.

400

ILWIS 3.0 Users Guide

Using Digital Elevation Models

10.3 Creating a slope map


In principal, a slope angle or slope percentage can be calculated for each pixel in a
raster map, as shown in Figure 10.4.

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

In this formula HYP (hypotenuse) is an internal MapCalc/TabCalc function to


calculate the positive root of the sum of square Dx plus square Dy (Pythagoras rule),
Dx is the horizontal gradient map, and Dy the vertical gradient map. In this formula,
the numerator is divided by the pixel size, using the internal function
pixsize(map) , since the gradient is expressed in meters difference per pixel and
the result should be in meters difference per meter. The value 100 in the formula
gives the slope in percentages

The Raster Map Definition dialog box is opened.

Click OK. The map is now displayed.

Type for the Description: Slope map in percentages and click Show.
The map is calculated and after that the Display Options - Raster Map
dialog box is opened.

ILWIS 3.0 Users Guide

401

Using Digital Elevation Models


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.

Close the map Slope_percentage .


Type the following formula on the Command line:
Slope_degrees = RADDEG(ATAN((HYP(Dx, Dy))/pixsize(Dem)))

ATAN and RADDEG are internal MapCalc/TabCalc functions. The ATAN function

calculates the arctan (tan-1), and returns real values in radians in the range
-1/2 to 1/2 . The function RADDEG is used to convert the radians to degrees.

402

The Raster Map Definition dialog box is opened.


Select a Value Range from 0 to 90 and a Precision of 1.0 .
Click Show. The map is calculated and after that the Display Options
Raster Map dialog box is opened.

Click OK. The map is now displayed.

Close the map and pixel information window when finished.

From within the map window, open the pixel information window and add
the map Slope_ percentage to it. Compare the values and calculate if
both maps are correct in respect to each other.

ILWIS 3.0 Users Guide

Using Digital Elevation Models

10.4 Slope direction (aspect)


The slope direction (or slope aspect) can also be calculated by combining gradient
maps which result from applying horizontal and vertical filters on a digital elevation
model (DEM).
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)

RADDEG and ATAN2 are internal MapCalc/TabCalc functions. ATAN2(y,x) returns


the angle in radians of two input values; x is horizontal, y is vertical. The function
RADDEG is used to convert from radians to degrees. The value for pi () is
3.141592653589.... The map Dx is the horizontal gradient map, and Dy the vertical

gradient map. The formula results in values between 0 and 360, according to the
degrees of the geological compass. For flat areas no slope direction can be calculated.
They will obtain an undefined value. In order to be able to display them correctly we
need to make a domain Compass , for which we will create a special representation
later on.

In the Raster Map Definition dialog box click the Create button next to the
drop-down list box of the Domain. The Create Domain dialog box is
opened.

Type the Domain Name: Compass .

Click Show to calculate the map.

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.
In the Display Options - Raster Map dialog box, select Representation
Gray and click Show. The map will be displayed.

We still need to make a good representation for the map.

Reopen the maps Display Options dialog box and click the Create representation 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.

ILWIS 3.0 Users Guide

403

Using Digital Elevation Models


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):
Table 10.2:

Values and color for representation Compass.

Degrees

Color

360
270
180
90
0

Gray
White
Gray
Black
Gray

Open the Edit menu and select the Insert Limit command or press the Insert
Limit button. The Insert Limit dialog box is opened.

Insert the limits and edit the colors according to Table 10.2.

Enter 25 for the number of Stretch Steps and click OK.

Select from the Edit menu the command Stretch Steps. The Stretch Steps
dialog box appears.

Now the representation is ready. It goes from white for western aspects to gray for
northern and southern aspects to black for eastern aspects.

Close the Representation Value editor.

Add the segment map Drainage and/or Contour to the map window.
Display the segments in a single color (e.g. Blue or SandyBrown ).

Check the slope directions by clicking on the pixels and close the map window afterwards.

Representation Compass is now selected in the Display Options dialog


box of the map. Click OK. The map is displayed.

It is also possible with the Slicing operation to classify the aspect map. The
procedure how to do this is clearly described in the ILWIS Help topic How to
calculate an aspect map.

404

ILWIS 3.0 Users Guide

Using Digital Elevation Models

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.

Double-click the Display 3D operation in the Operation-list. The Display


3D dialog box is opened.

In the Display 3D dialog box, click the Create button next to the
GeoReference drop-down list box. The Create GeoReference dialog box
is opened.

Type Dem3D in the text box GeoReference Name.

Click OK. The Display Options - 3D Grid dialog box is opened.

Type 3D view, Cochabamba in the text box Description.


Select raster map Dem in the list box DTM, accept the number of Rows,
Columns, and click OK. Now you are back in the Display 3D dialog box.
Accept the defaults and click OK.

The 3-D view is now displayed with default values. These default view parameters
can be modified by editing the georeference 3D.

From the Edit menu, select the command GeoReference. The


GeoReference 3D editor is opened.

Maximize the window so that the whole 3D view (grid lines) and all parameters in the 3D View Parameter pane are visible.

By changing the values in this editor you can change the view direction, altitude, etc.
This is explained in Figures 10.5 and 10.6.
You can imagine a 3D view as the view that you would have from an area when you
are in a helicopter, which is at a fixed position. This position is called the view point.
The view point is at a certain height (i.e. view height) in meters and at a certain X
and Y coordinate in the map. From the view point you are looking at the study area.
The point in the center of your study area is called the focal point, which also has a
ILWIS 3.0 Users Guide

405

Using Digital Elevation Models


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).
406

ILWIS 3.0 Users Guide

Using Digital Elevation Models

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).

In the GeoReference 3D Parameter pane, change the Horizontal


Rotation to 0 and the Vertical Rotation to 82 , and press Enter.

Accept all other defaults and press the Redraw button


dow.

in the map win-

For your information, the Focal Point is located approximately at (801850 ,


8081200 ), the Distance to the Focal Point is approximately 20400 m and the
View Point Height is approximately 5700 m. The values above are just an
indication. You will probably not get exactly the same values yourself.
The 3D view should now be similar to the one shown in Figure 10.7.

ILWIS 3.0 Users Guide

407

Using Digital Elevation Models

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.

Figure 10.8: A 3D view showing the effect of a smaller vertical rotation.

Now you will see the effect of changing the horizontal rotation. We will change the
vertical rotation back to the original value.

408

Change the Vertical Rotation to 82 .

Click the Redraw button, or press Enter.

Change the Horizontal Rotation to 30 . This means you are now looking
from the south-southeast towards the north-northwest.

ILWIS 3.0 Users Guide

Using Digital Elevation Models


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.

Change the Viewing Angle to 60 and press Enter.

The view should now be similar to the one shown in Figure 10.10. Note that you will
see a smaller area than before.

Figure 10.10: A 3D view showing the effect of a larger viewing angle.

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.

ILWIS 3.0 Users Guide

409

Using Digital Elevation Models


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.

First, click the Extend Boundaries button. The Extend Window by


Percentage dialog box appears.

In the Extend Window by Percentage dialog box extend all four sides of
the window with 50 %.

Now, click the Set View Point button.

If you like, adapt the Viewing Angle to a somewhat larger value, e.g. 95 .

Click somewhere in the white space in the small DEM window, e.g. somewhere at the bottom left; keep the left mouse button down and move the
pointer to the center of the map; then release the mouse button. The 3D view
will change immediately.
Practice some more until the grid lines nicely fill the area of the georeference
3D window.

Selecting the best parameters for defining a 3D view seems quite difficult when you
are doing it for the first time. However, if you practice some more with the editor,
you will see that a number of parameters are interrelated.
When you have finished editing the parameters of the GeoReference 3D, you can
leave the editor by pressing the Exit Editor button
on the Toolbar in the
GeoReference 3D editor.

Click the Exit Editor button in the Toolbar of the GeoReference 3D editor
or open the File menu and choose Exit Editor.

3D view with raster draping


In the previous exercise you have created and edited a 3D view using only grid lines
for the 3D display. It is also possible to drape a raster map on top of the 3D view. In
this exercise you will create a 3D view using a hillshading map.

Double-click georeference Dem3D in the Layer Management pane or click


the right mouse button in the window and select Display Options. The
Display Options - 3D Grid dialog box appears.

Clear the check box Grid, select the check box Raster Drape and select
raster map Shadows from the drop-down list box.

Click OK. The Shadows map is now draped over the 3D view.

As you can see the display is still rather course. This is because you accepted the
default pixel size of 3. With the pixel steps, you can define the number of rows and
410

ILWIS 3.0 Users Guide

Using Digital Elevation Models


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.

In the Layer Management pane double-click Dem3D . The Display Options


- 3D Grid dialog box appears.

Change the Pixel steps to 1 and click OK. The 3D view is redisplayed slowly, but more accurately.

In the map window, press the right mouse button and select Display
Options. The Display Options 3D Grid dialog box appears.

In the Display Options 3D Grid dialog box, select the Grid check box,
change the Grid Distance to 1000 m and click OK.

Close the map window when you have seen the result.

Once you finished creating and editing the georeference 3D, you can display any
existing raster map as a 3D view by using the Display 3D operation.

Double-click the Display 3D operation in the Operation-list. The Display


3D dialog box is opened.

In the Display 3D dialog box, select Dem3D1 from the GeoReference dropdown list box and click OK. The Display Options - 3D Grid dialog box is
opened.

Clear the Grid check box, select the check box Raster Drape and select
raster map Landuse .

Accept the default Representation and click OK. The Landuse map is now
draped over the 3D view.

The result of this exercise can be saved as a map view.

In the map window open the File menu and select the Save View command.
The Save View As dialog box appears.

In the Save View As dialog box type 3Dmapview for the Map View Name
and click OK. The map is saved as a map view.

Adding vector layers to a 3D view


One of the major advantages of the 3D views in ILWIS is that they remain
georeferenced, so that you can display other data layers on top. You can also use the
pixel information window to retrieve information of raster and vector maps,
combined with attribute tables, while moving the mouse pointer through the 3-D
view.
ILWIS 3.0 Users Guide

411

Using Digital Elevation Models

Drag-and-drop polygon map Cityblock to the map window in which the


3D view 3Dmapview is displayed. The Display Options -Polygon Map
dialog box is opened.

Change the Boundary Width to 0. In this way only the polygons are shown
in color, without boundary lines.

Change the amount of Multiple Colors to 31 and click OK. The polygon
map is drawn in the perspective view.

Also add segment map Drainage to the map window.


Zoom in if you like and save the result as a map view.

It is also possible to use the pixel information window in combination with a 3D


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.

Double-click the operation Apply 3D in the Operation-list. The Apply 3D


dialog box is opened.

Select Raster Map Landuse , GeoReference Dem3D1 and type for the
Output Raster Map name 3DLanduse .

Click Show. The new map is now created. This will take a while.
After that the Display Options - Raster Map dialog box is opened. Click
OK to display the 3D view and close it after you have seen the result.

The resolution of the output raster map may be rather course. The resolution is
determined by the size of your georeference 3D (default 300 lines x 400 columns)
when the georeference 3D was created, and how well you made the initial 3D grid
lines fit into this when you edited the georeference 3D.
Summary: 3D-display
- A Digital Elevation Model (DEM) can be visualized in three dimensions by
creating and editing a Georeference 3D.
- A georeference 3D can be created with the Display 3D operation.

412

ILWIS 3.0 Users Guide

Using Digital Elevation Models


- 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.

ILWIS 3.0 Users Guide

413

Using Digital Elevation Models

10.6 Creating cross-sections from a DEM


In this last exercise, dealing with the use of Digital Elevation Models, a simple
method is presented to generate altitude information from a DEM along profiles. The
profiles are segments, which can be digitized with the mouse or the digitizer. The
objective is to display in a graph the distance from the starting point of the profile
along the X-axis and the altitude along the Y-axis.
In order to do so we have to make the following steps:
- Digitize a line along which you want to create a cross-section.
- Use the operation Segment to Points, to convert the digitized line to regularly
spaced points.
- Open the point map as a table, and calculate the column Distance , which is the
distance from the starting point of the profile.
- Read the values of the altitude from the DEM for the coordinates specified in the
table.
- Plot the distance against the altitude in a graph.
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.

414

ILWIS 3.0 Users Guide

Using Digital Elevation Models

Click with the right mouse on the point map Profile , and select the command Open as Table from the context-sensitive menu. The point map is
now shown as a table with two columns: Coordinate and Name .

Open the View menu in the table window and select the Command Line.
The table window should now give you a Command line.

Type the following formula on the Command line of the table window:
Distance =(%R-1) * 50

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.

Close the graph and the table window.

If you like, you can adapt the descriptions for the X and Y-axis in the Graph
Options sheet; on the X-axis tab and the Y-axis (left) tab. On the X-axis
tab, you can also rotate the values along the X-axis (e.g. 90).

In the previous exercise vector data (a segment map) is used to create a cross-section
through the terrain. It is also possible to use raster data as basis for the selection and
creation of a cross section e.g. using a particular line or column from a raster map.
How to do this is clearly described in the ILWIS Help topic How to calculate a
cross-section through the terrain (Advanced).
ILWIS 3.0 Users Guide

415

CHAPTER 11

Spatial data analysis: geostatistical


tools
Geostatistics studies spatial variability of regionalized variables. Regionalized
variables are variables that have an attribute value and a location in a two or three
dimensional space. Geostatistics are also described sometimes as a set of
techniques/tools used to analyze and predict values of a variable distributed in space
or in time. With geostatistics you can explore your sample data, construct variogram
models and produce interpolated surfaces.
A point interpolation (also known as gridding) performs an interpolation on randomly
distributed point values and returns regularly distributed point values. The input for
point interpolation is mostly a point map with the domain type value or a point map
with domain type class or identifier that is linked to an attribute table, in which the
attribute values are stored in a column with domain type value. 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 interpolation methods that will be treated in
section 11.3 are: Nearest Point, Moving Average, Trend Surface and Moving
Surface.

An alternative to the above mentioned straightforward deterministic methods is


kriging. Kriging is a statistical method based on the theory of regionalized variables.
Before you can use kriging, you must make a semi-variogram model, which will
determine the interpolation function. Furthermore kriging is the only interpolation
method available in ILWIS that gives you an interpolated output map and an error
map with the standard errors of the estimates. In this manner, kriging allows you to
quantify the quality of your predictions. In section 11.4 you will successively become
familiar with the kriging operations Ordinary Kriging, Simple Kriging, Indicator
Kriging, Universal Kriging, Anisotropic Kriging and CoKriging.
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
ILWIS 3.0 Users Guide

417

Spatial data analysis: geostatistical tools


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.

Double-click the ILWIS icon on the desktop to open ILWIS.


Use the Navigator to go the directory: C:\ILWIS 3.0 Data\Users Guide\
Chapter11.

Visualization of the input data


The data set used in this exercise belongs to synthetic drillhole data from an oil field
that is under exploration. The vertical distances towards the top and the bottom of
sandstone unit are given (Figure 11.1); the sandstone unit is considered to be a
potential reservoir rock for both oil and gas. The exploration geologist is asked to
provide his judgement on the spatial variability of the thickness of the reservoir,
which would intrinsically be important to determine the success ratio to drill for oil in
the area.
The following point maps are available:
- Sandstone : point map linked to an attribute table Sandstone with the attribute
columns Top , Bottom and Thickness .
- Top : point map with vertical distance (m) from sea level to the top of a sandstone
unit.
- Bottom : point map with vertical distance (m) from sea level to the bottom of the
sandstone unit.

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.
418

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

Double-click point map Top in the Catalog. The Display Options Point
Map dialog box is opened.

In the Display Options Point Map dialog box accept all defaults by clicking OK. The map is displayed in a map window.

Visually inspect the point map. Move with your mouse pointer over the map window
and keep the left mouse button pressed. Notice that the point values are displayed if
you position the mouse pointer near a point in the map. In the Status bar, you see
the map coordinates changing while moving the mouse.

Open the Layers menu in the map window and choose Add Grid Lines.
Accept the defaults and click OK.

Estimate the size of the map (X- and Y-extent) and verify this using the Measure
Distance tool.

Press the pair of compasses in the toolbar of the map window and measure
some distances.

Press the pair of compasses in the toolbar of the map window and measure some
distances.
Measure the length of both the smallest and the largest point-pair vector i.e. the
shortest distance between two points and the longest distance between two points.
Find also the angle between each of these two point pairs.

Double-click Properties in the Layer Management pane. The Properties


sheet of point map Top appears.

In the Properties sheet, press the right mouse button on the text Point Map
Top to open the context-sensitive menu.

On the context-sensitive menu, select the Open as Table command.

How many different point pairs can be made theoretically?

Close all windows and dialog boxes that are open.


Repeat the previously described procedure to evaluate map Bottom .

ILWIS 3.0 Users Guide

419

Spatial data analysis: geostatistical tools

11.1 Pattern analysis


Point interpolations assume spatial randomness of the input points. To examine the
arrangement of the point data in space and to investigate whether your points are
randomly distributed you can use the Pattern analysis operation prior to a point
interpolation.
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 of CSR, no correlation exists between locations of points.
- In a clustered pattern, subgroups of points tend to be significantly closer to each
other than to other subgroups of points.
- In a regular pattern, individual point items tend to repel each other and distances
between adjacent points tend to be further apart than for CSR.

In case your points are regularly distributed, e.g. as a regular grid, it is advised to
directly rasterize the points with the Points to Raster operation and further interpolate the raster map with the Densify or Resample operation or with the
Kriging from Raster operation.

Figure 11.2: Fundamental types of patterns: Complete Spatial Randomness (CSR), Clustered

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:
420

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


- Distance to Nearest Neighbours: this method involves analyzing spatial distribution
of the points using distance characteristics between individual points in the map.
The pattern is analyzed by calculating distances between individual points and its
first to sixth nearest neighbour points in the pattern. The results are tested against
the expected distances in CSR. If the individual points are closer than they would
be for CSR, this indicates a clustered pattern. If, on the other hand, individual
points are further apart than they would be in CSR, a more regular pattern is
assumed.
- Reflexive Nearest Neighbours (RNN): this method considers two points as first
order reflexive nearest neighbours if these points are each others nearest
neighbours. This definition can be extended to higher orders; second order RNNs
are points that are each others 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.

ILWIS 3.0 Users Guide

421

Spatial data analysis: geostatistical tools


In this exercise the Pattern Analysis operation is performed on point map Top . To
start the operation:

Double-click Pattern Analysis in the Operation-list. The Pattern Analysis


dialog box is opened.

Select point map Top in the list box Point Map.


Type Top_pattern_analysis in the text box Output Table and click the
Show button. A table window containing the result of the analysis is opened.

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.

422

In the table, find the distance at which at least 6 points will be found for any
point. Are 6 points, which will form 6 point vectors for any point, enough to perform an interpolation?

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


To view the additional information:

From the View menu of the table window, select Additional Info. The additional information is displayed in a separate window.

Close the additional information window, the graph windows and the table
window when you have finished the exercise.

Summary: Pattern Analysis


- Pattern analysis is an operation to investigate whether your sample points are randomly distributed and should be used prior to a point interpolation.
- Three fundamental types of patterns exist: Complete Spatial Randomness (CSR),
Clustered Pattern, and Regular Pattern.
- 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 regularity 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.

ILWIS 3.0 Users Guide

423

Spatial data analysis: geostatistical tools

11.2 Spatial autocorrelation of point data


Point interpolations assume also a certain degree of spatial correlation between input
point values. The Spatial Correlation operation can be used to investigate whether
point values are randomly distributed or whether the values have a relation with
distance. Many variables that have discrete values measured at several specific
geographic positions (i.e. individual observations can be approximated by
dimensionless points) can be considered as random processes and can thus be
analyzed using spatial autocorrelation analysis. Examples of such phenomena are:
total amount of rainfall, toxic element concentrations, grain sizes, elevation at
triangulated points, etc.
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 Morans I), spatial variance (as
Gearys 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 Morans I and Gearys 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.

424

Double-click the Spatial Correlation operation in the Operation-list. The


Spatial Correlation dialog box is opened.

Select point map Top in the list box Point Map.


Check if the Omnidirectional option is selected.
Choose as Lag spacing 125 meter.
Type Top_Spatcorr in the text box Output Table and click Show. The
spatial correlation is calculated and the result of the operation is displayed in
a table window.

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


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 autocorrelation (as Morans I ).

Click the New Graph Window button in the Toolbar of the table window.
The Graph dialog box shows up.

Select column c for the Y-axis and click OK. The Graph Options sheet is
opened.

On the Distance x c tab, select the Point option, the Color Green and
click OK. The graph is displayed, showing the distance against the spatial
variance (as Gearys c).

ILWIS 3.0 Users Guide

425

Spatial data analysis: geostatistical tools


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 anisotropys in the data set cannot be detected.
In the distance versus variance (Gearys 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.

Close all windows when you have finished the exercise.


Repeat the procedure for point map Bottom . Evaluate the results and close
the table and graph windows afterwards.

Summary: Spatial Correlation


- Spatial Correlation examines the correlation of a random process with itself in
space.
- The spatial autocorrelation function shown in a graph and referred to as spatial
autocorrelogram shows the correlation between a series of points or a map and
itself for different shifts in space or time, and visualizes the spatial variability of
the phenomena under study.
- 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.
426

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


- 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 omnidirectional spatial correlation operation is a table consisting
of six columns: Distance , NrPairs , I, c, AvgLag and SemiVar .
- Column Distance lists the middle values of the distance intervals;
- Column NrPairs lists for each distance interval, the number of point pairs
found at these distances towards each other;
- Column I lists for each distance interval, the spatial autocorrelation of the
point pairs in this distance interval;
- Column c lists for each distance interval, a statistic for spatial variance of the
point pairs in this distance interval;
- Column AvgLag lists for each distance interval, the average distance between
points of point pairs in this distance interval;
- Column Semivar lists for each distance interval, the experimental semivariogram value of the point pairs in this distance interval.
- 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 consisting of ten columns: Distance , I, c, AvgLag1 , NrPairs1 , SemiVar1 ,
AvgLag2 , NrPairs2 , SemiVar2 .

ILWIS 3.0 Users Guide

427

Spatial data analysis: geostatistical tools

11.3 Point interpolation


A point interpolation (also known as gridding) performs an interpolation on randomly
distributed point values and returns regularly distributed point values. The input for
interpolation is mostly a point map with the domain type value or domain type class
or identifier. If a point map has a domain type class or identifier, it is necessary that
the map is linked to an attribute table, in which the attribute values are stored in a
column with the domain type value. 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 that will be treated in this section are:
Nearest Point, Moving Average, Trend Surface and Moving Surface.
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:

428

Select point map Top in the Catalog. Use the right mouse button and select
Interpolation, Nearest Point from the context-sensitive menu. The Nearest
Point dialog box is opened.

Type Top_np in the Output Raster Map text box.

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

Select Wells as GeoReference.


Type Nearest point interpolation in the text box Description.
Accept all other defaults and click the Show button. The output map will be
calculated and the Display Options - Raster Map dialog box will be
opened.
Accept the defaults by clicking OK. The interpolated map is shown.
Check the values in the map and close it afterwards.
Repeat the procedure for point map Bottom . Call the Output Map
Bottom_np .

Now that you know the depth of the top and the depth of the bottom of the sandstone
unit, you can calculate the thickness of the unit.

Type the following formula on the Command line of the Main window:
Thickness_np = Top_np Bottom_np

Accept the defaults in the Raster Map Definition dialog box and click
Show. The map is calculated and the Display Options Raster Map dialog box is opened.

Click OK and check the values of the map and those of the input maps using
the pixel information window. If you like, you can open the Display Options
of map Thickness_np again and Stretch from e.g. 0-400 m.

Get an idea of where the sandstone unit is thick and where it is thin.

Drag and drop point map Sandstone from the Catalog in to the raster map
Thickness_np . The Display Options Point Map dialog box appears.

In the 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 righthand side of the area. This is caused by a normal fault dipping south, cutting out part
of the reservoir sandstone in the central part of the area. From the interpolated map
ILWIS 3.0 Users Guide

429

Spatial data analysis: geostatistical tools


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 terrain for more information about creating a cross section through the terrain.

Moving Average
The Moving Average method performs a weighted averaging on point values of a
point. The output value for a pixel is calculated as the sum of the products of weights
and point values, divided by the sum of weights. Weight values are calculated in such
a way that points close to an output pixel obtain large weights and points further away
obtain small weights. Thus, the values of points close to an output pixel are of greater
importance to the output pixel value, than the values of points that are further away.
You have the inverse distance and linear option to specify the method to calculate
weight values (see the ILWIS Help topic Moving average Algorithm for more
information). Furthermore, you also have to specify a limiting distance. Points that
are further away from an output pixel than the limiting distance, obtain weight zero
and thus have no influence on the output value for that pixel. This speeds up the
calculation and prevents artifacts. It is however important to choose a limiting
distance that contains enough data points.

Double-click the Moving Average item in the Operation-list to start the


operation. The Moving Average dialog box is opened.

Select point map Top in the list box Point Map.

430

Type Top_ma in the Output Raster Map text box.


Accept Inverse Distance as Weight Function.
Select Wells as GeoReference.
Type Moving average interpolation in the text box Description.
Accept the other defaults by clicking the Show button. After the calculation,
the Display Options - Raster Map dialog box will be opened.
Accept the defaults and click OK. The map is displayed.

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

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 interpolation (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).

Double-click the Trend Surface operation in the Operation-list. The Trend


Surface dialog box is opened.

Select point map Top in the Point Map list box.


Accept 2nd degree in the Surface list box.
Type Top_ts in the Output Raster Map text box.

ILWIS 3.0 Users Guide

431

Spatial data analysis: geostatistical tools

Select Wells as GeoReference.

Accept the defaults by clicking the OK button.

Type Trend surface interpolation in the Description text box.


Accept all other defaults and click Show. After the map has been calculated,
the Display Options - Raster Map dialog box will be opened.

The result of the interpolation is a map consisting of surfaces representing


homogeneous areas.

Close the map window.


Repeat the procedure for point map Bottom and name the Output Map
Bottom_ts .

Calculate the thickness of the sandstone unit by subtracting the map


Bottom_ts from the map Top_ts . Call the Output Map Thickness_ts .

Compare the map Thickness_ts with the maps Thickness_np and


Thickness_ma .

Close all map windows when you have finished the exercise.

From the output map you can conclude that the Trend Surface method is not useful
for this particular data set. The result only shows a very general trend, without any
local detail.
Moving Surface
In the Moving Surface method pixel values are calculated by fitting a surface through
weighted point values. Weights for all points are calculated by a user-specified weight
function. Weights may, for instance, equal the inverse distance. The weight functions
are implemented in such a way that points which are further away from an output
pixel than the user-specified limiting distance obtain weight zero. Surface fitting is
performed by a least squares fit.

432

Double-click the Moving Surface operation in the Operation-list.


Select point map Top in the Point Map list box
Accept Inverse Distance as Weight Function.
Select 2nd degree linear in the Surface drop-down list box.
Type Top_ms in the Output Raster Map text box.
Select Wells as GeoReference.
Type Moving surface interpolation in the Description text box.

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

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.

The result of this interpolation is a map consisting of surfaces representing


homogeneous areas.

Close the map window.


Repeat the procedure for point map Bottom and name the Output Map
Bottom_ms .

Calculate the thickness of the sandstone unit. Call the Output Map
Thickness_ms .

Compare the output map with the other interpolated maps.

Display the thickness map of the Moving Average operation and the thickness 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.

What is the best interpolation method?

Close all map windows when you have finished the exercise.

Summary: Point interpolation


- Point interpolation also known as gridding performs an interpolation on randomly
distributed point values and returns regularly distributed point values.
- 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.

ILWIS 3.0 Users Guide

433

Spatial data analysis: geostatistical tools


- 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.

434

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

11.4 Kriging estimation


Kriging is an alternative to many other point interpolation techniques. Unlike
straightforward deterministic methods, such as Nearest Point, Trend Surface,
Moving Average or Moving Surface, it is a statistical method based on the theory
of regionalized variables. Before you can use kriging, you must make a semivariogram model, which will determine the interpolation function. Furthermore
kriging is the only interpolation method available in ILWIS that gives you an
interpolated map and output error map with the standard errors of the estimates. In
this manner, kriging allows you to quantify the quality of your predictions. As kriging
is an advanced technique that heavily relies on statistical theory, the novice GIS user
may need to ask advice from an expert.
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 continue with the following steps:
- Step 1: Examining the input data
- Step 2: Calculating experimental variograms
- Step 3: Modelling variograms
- Step 4: Kriging interpolation

11.4.1. Ordinary Kriging


Visualization of the input data
In the Catalog, a map with Carbon 14 (14C) water measurements in Botswana,
Southern Africa is given and named C14 . The map is linked to an attribute table C14 .
Step 1 in the kriging process is the visual and statistical inspection of the data set:

Double-click point map C14 in the Catalog


In the Display Options Point Map dialog box select the Attribute check
box, accept the default attribute column C14 and click OK. The map is
displayed in a map window.

ILWIS 3.0 Users Guide

435

Spatial data analysis: geostatistical tools

Open the Layers menu in the map window and choose Add Grid Lines.

Estimate the size of the map and verify this using the Distance tool.

Accept the defaults and click OK. The grid layer is displayed on top of the
point map.

Measure the length of both the shortest and the longest point-pair vector. A point-pair
vector is the distance (and the angle) between two points. Zoom in if needed. Find
also the angle and the difference in 14C percentages for each of these 2 point pairs.

Double-click the word Properties in the Layer Management pane. The


Properties of Point Map C14 sheet appears.

In the Properties sheet, press the right mouse button on the text Point Map
C14 to get the context-sensitive menu.

From the context-sensitive menu, select Open as Table. The point map is
opened as a table.

How can you verify that the map is from an area in Botswana?

Also open table C14 . In Layer Management pane, expand Properties and
double-click the table C14 to open it.

In the C14 attribute column you will find the percentages of 14C content, measured in
well water at all locations appearing in the point map. Percentages are given with
respect to a stabilized 14C/12C ratio (p.m.c. = percents modern carbon).

Close all windows.

Spatial Correlation and Empirical Semi-Variogram


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 (as discussed in section 11.2) prior to a kriging interpolation.
This is the second step in the kriging process.

436

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

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 laginterval 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?

To check this, you should:

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 semivariogram values (Y-axis)?

ILWIS 3.0 Users Guide

437

Spatial data analysis: geostatistical tools

Perform the Spatial Correlation operation again, now with a lag-interval of


5 km. Use Omnidirectional_5 as Output Table name.

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 ?

Modelling the Semi-Variogram


The third step in the kriging process is to model the discrete values of your
experimental semi-variogram by a continuous function, which will give an expected
value for any desired distance. Figure 11.4 below shows a semi-variogram depicting a
spherical model.

Figure 11.4: Example of a spherical semi-variogram model.

data. g are semi-variogram values.

is the total variance of input

When the distance between sample points is 0, the differences between sampled
values is also expected to be 0. Thus, the semi-variogram value at distance 0 equals
0, i.e. (0)=0. Samples at a very small distance to each other are expected to have
almost the same values; thus, the squared differences between sample values are
expected to be small positive values at small distances. With increasing distance
between point pairs, the expected squared differences between point values will also
increase. At some distance the points that are compared are so far apart that they are
not any more related to each other, i.e. the sample values will become independent of
one another. Then, the squared differences of the point values will become equal in
magnitude to the variance of the variable. The semi-variogram no longer increases
and the semi-variogram develops a flat region, called the sill. The distance at which
the semi-variogram approaches the variance is referred to as the range or the span of
the variable.
A semi-variogram with a nugget effect is a semi-variogram that goes from 0 to the
level of the nugget effect in a distance less than the sampling distance. The semivariogram model shows the semi-variogram value 0 at distance 0 and a discontinuity
(jump) to a semi-variogram value at an extremely small distance. A nugget effect

438

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


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.
The theoretical or estimated semi-variogram model can be made as follows:

In the graph window of the Omnidirectional_10 table, click the right


mouse button to open the context-sensitive menu. Select Add Graph,
Semivariogram Model.

In the Add Graph Semi Variogram dialog box, choose Spherical Model
for the SemiVariogram model, use values 200 m, 800 m and 40 km for the
Nugget, Sill and Range respectively and click OK. The Graph Options
sheet appears.

Accept the defaults and click OK.

At which distance do you find the greatest discrepancy between the semivariogram model and the measured values?

In the graph window, click the right mouse button to open the context-sensitive menu and select the Graph Options command. The Graph Options
sheet appears.

On the Spherical Model tab, modify the Sill until you obtain a good fit
between curve and plotted points until distances 40000 m.

Make a list of all available semi-variogram models (Spherical, Circular, Exponential,


Gaussian, etc.), their numeric parameters and the units in which these parameters are
measured.

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.

Variogram Models: Goodness of Fit


You can use the Column SemiVariogram operation to find which model fits your
experimental semi-variogram values best. The Column SemiVariogram operation
calculates semi-variogram values according to a user-specified model and stores the
calculated values in an output table column. To create new columns for both the
rounded distances and the real mean distances per distance class:

ILWIS 3.0 Users Guide

439

Spatial data analysis: geostatistical tools

In the Omnidirectional_10 table, open the Columns menu and choose


the SemiVariogram operation. The Column SemiVariogram dialog box
appears.

Select Distance for the Distance column, choose Spherical Model for
the SemiVariogram model and use values 200 , 750 and 40000 for the
Nugget, Sill and Range respectively.

Call the Output Column SemiCol_Dist and click OK. The Column
Properties dialog box is opened.

Accept all defaults and click OK.

Repeat the procedure but use this time AvgLag as Distance column and
call the Output Column SemiCol_Avg .
Make graphs of these 2 output columns. Plot respectively SemiCol_ Dist
against Distance , and SemiCol_Avg against AvgLag .

Visually inspect the difference between experimental and model outcomes.

You can also test which semi-variogram model fits your data best by calculating the
Goodness of Fit (R2).

where:
are the experimental semi-variogram values calculated by the Spatial
Correlation operation;
are the semi-variogram values calculated by the Column SemiVariogram operation;
N is the total number of distance classes/intervals.
The numerator of the fraction gives the sum of the squared differences between the
experimental semi-variogram values and the semi-variogram values calculated by a
user-specified semi-variogram model.
The denominator of the fraction gives the sum of the squared differences between the
experimental values and the average experimental semi-variogram values of all
distance classes/intervals.
The Goodness of Fit indicator can be calculated using TabCalc statements. The terms
in the numerator are computed by first making a new column in the
Omnidirectional_10 table with an expression as:

440

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


Outputcol = SQ( SemiVar-SemiCol)
where:
Outputcol is the name of the out put column;
SemiVar is the name of the column with the experimental semi-variogram values;
SemiCol is the name of the column with the semi-variogram values calculated with
the Column SemiVariogram operation.

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)

This average must be used in a new column with squared terms:

Type the following formula on the Command line of the table window:
G_Avg_Sqr = SQ(SemiVar Mean_G)

The Goodness of Fit indicator R2 can now be obtained by:


R2 = 1 SUM( G_Gam_Sqr) / SUM( G_Avg_Sqr)

Compute the Goodness of Fit indicator.

The maximum value of R2 is 1, meaning an exact match of calculated semivariogram values and experimental semi-variogram values.

One can obtain a better fit by excluding the distances beyond the range. See the
ILWIS Help for more information.
The TabCalc statements mentioned above are also available in an ILWIS script.
You can run the Goodness of Fit script by expanding the Script item in the
Operation-tree, then double-click the R2 script.

Once you have decided which semi-variogram model and which values for sill, range
and nugget fit your data best, you can continue with the kriging interpolation.
Kriging estimation and Error map
The final step in the kriging process is the calculation of the kriging estimations and
the estimation errors.
ILWIS 3.0 Users Guide

441

Spatial data analysis: geostatistical tools

Double-click the Kriging operation in the Operation-list. The Kriging dialog box is opened.

Select point map C14 with attribute column C14 as input Point Map.

Accept the default Spherical Model and for Nugget, Sill and Range fill
out the values as used before.
Specify a Limiting Distance of 25 km.
Take 4 for the Minimum and 14 for the Maximum number of points.
Call the Output Raster Map Ord_krig25 .
Use GeoReference C14 and select the Error Map check box.
Accept all other defaults and click Show. The kriging map with its error
map is calculated and after you click OK in the Display Options dialog box,
it is displayed.

Which parameters influence the calculation speed? Explain the numbers in the
progress bar.

Use the right mouse button in the Catalog to view the Properties of raster
maps Ord_krig25 and Ord_krig25_Error .

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?

Perform another kriging estimation on the C14 point map.

442

This time use, a Limiting Distance (search radius) of 40 km and specify all
other parameters as used before.

Call the Output Raster Map with the kriging estimates Ord_krig40 .
Open both error maps Ord_krig25_Error and Ord_krig40_Error and
close all other map windows.

Drag the input point map C14 on top of each of the error maps.

In the Font dialog box use the Font Arial , Font Type Regular , Size 8pt
and click OK.

Click the Symbols button and use Crosses for the Point Symbols

In the Display Options Point Map dialog box select Attribute C14 ,
select the Text check box and press the Font button.

Find the point with the best and the point with the worst kriging estimate in
both error maps and close the window afterwards.

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


Confidence interval maps
The output maps of the kriging operation (the output kriging map with the estimates
and the output error map) can be used to create (3-valued) confidence interval maps.
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.
Combining both maps produces a 3-valued occurrence map.

Type the following formula on the Command line of the Main window:
Occurrence_3_valued = Over30 + Under30

For more information about creating confidence interval maps, see the ILWIS Help
topic How to calculate confidence interval maps.

11.4.2 Simple Kriging and Indicator Kriging (additional exercise)


Simple Kriging
Perform a Simple Kriging interpolation similar to the previous exercise. List the
parameters which are not needed in Simple Kriging compared to Ordinary Kriging.

Call the Output Raster Map Simple_krig40 .

Find the point with minimum and the point with maximum error variance
(uncertainty).

Close all windows after finishing the exercise.

Drag the input point map C14 over raster map Simple_krig40_Error in
the same way as before, and compare the result with the previously
calculated error maps.

ILWIS 3.0 Users Guide

443

Spatial data analysis: geostatistical tools


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.

Make an Omnidirectional Spatial Correlation table and find a semi-variogram model, which reasonably fits the experimental values.

Perform an Ordinary Kriging operation with these model settings, call the
Output Raster Map Indicator_kriging and make sure that also an
error map is created.

The output map is called an indicator map.

11.4.3 Universal Kriging


Universal Kriging is a variant of Ordinary Kriging. Universal Kriging is kriging
with a local trend or drift. This local trend or drift is a continuous and slowly varying
trend surface on top of which the variation to be interpolated is superimposed. The
local trend is recomputed for each output pixel and the operation is therefore more
similar to the Moving Surface operation than to the Trend Surface operation. In
ILWIS this supposed trend can be of degree 1 (tilted trend plane) or of degree 2
(quadratic trend surface).

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.

444

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

11.4.4 Anisotropic Kriging


Investigating anisotropy with variogram surfaces
Sometimes, the variation in data may not simple have a relation to distance, but the
relation to distance may occur in a certain direction only. If that is the case, your data
is said to be anisotropic. To krige such data you should use the Anisotropic Kriging
operation.
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

Double-click the VarioSurface operation in the Operation-list. The


Variogram Surface dialog box is opened.

Select point map Artificial with attribute column Samples as Input


Map. Accept the proposed defaults: Lag spacing 55.1 and Number of
lags 10 .

Call the Output Raster Map Var_surf55 , accept the other defaults and
press the Show button. The variogram surface is calculated and the Display
Options Raster Map dialog box appears.

Accept the defaults in the Display Options Raster Map dialog box by
clicking OK. The variogram surface is displayed.

The output of the Variogram Surface operation is a plot with the origin in the
center. Each cell in the plot (each pixel in the output map) has the size of the userspecified Lag spacing. The number of cells of the output surface (from the central
ILWIS 3.0 Users Guide

445

Spatial data analysis: geostatistical tools


cell at the origin towards positive and negative X and Y axis) is defined by the userspecified 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 . Semivariogram 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.

How many cells does the output variogram surface contain?


What is the distance between the origin and one of the corner cells in the variogram surface?
Explain the meaning of a semi-variogram value in a corner cell.
Make another Variogram Surface; use 20 lags and a lag spacing of 10 km.
Call the output map Var_surf55_20

Do you discover a geometric anisotropy in the spatial continuity of the measured


regionalized variable?
In which direction?

Change of support and/or change of scale


Repeat the Variogram Surface operation:

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 .

can use the history of the


! You
mands.

446

Command line to retrieve previously used com-

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


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.
Spatial Correlation, bidirectional
Now we will use the bidirectional method of the Spatial Correlation operation.
semi-variogram values, will be calculated for the principle axis of anisotropy and the
perpendicular direction. You need to specify the parameters Direction, Tolerance
and Band width. These parameters should be found from the variogram surfaces as
created above. The parameters for the bidirectional method are schematically
presented in Figure 11.5.

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 westeast or in east-west direction will be considered (i.e. +90 clockwise from the Y-axis).
The tolerance angle is a parameter with which you can limit the number of point
pairs. When a tolerance of 45 is used, all point pairs in the map will contribute to
calculated semi-variogram values. When using a tolerance of 10, the direction of
every 2 points may differ -10 or +10 from the specified direction (90). So, in fact,
all points that are found in a position within 80 to 100 to one another are valid
pairs. Then, for the valid point pairs, the distance class to which they belong will be
determined.
Optionally, you can set a third parameter, the band width (m), to limit the tolerance to
a certain width.
You should find the values for these parameters from your variogram surfaces as
created in the previous exercise. To calculate the spatial correlation table for Point
Map Artificial :
ILWIS 3.0 Users Guide

447

Spatial data analysis: geostatistical tools

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.

Plot SemiVar1 (Y-column) against AvgLag1 (X-column). Use the Point


option with Red points and take as X-Axis bounds 0 and 1000 and as YAxis bounds 0 and 10 .

Do the same for SemiVar2 against AvgLag2 . Use this time the Color
Green as point color.

Create also a third graph. Plot the NrPairs against Distance . Take now
Needle as graph presentation and select again a different color. Set the maximum X-axis bound at 1000 and leave the Y bounds unchanged.

Do you conclude a trend or anisotropy from these figures? Why?

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.

In the graph of Direction against SemiVar1 add a semi-variogram


model. Choose the Power model and use for instance Nugget 1.2 , Slope
0.000015 and Power 1.78 .

Furthermore, we need to now the relation between semi-variogram values on the


principle axis of anisotropy and in the perpendicular direction. When you inspect the
variogram surface output map you can use the Distance tool and measure the
448

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


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

Figure 11.6: Explanation of the scale factor

and the principle axis and perpendicular axis of anisotropy.

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.

Perform an Anisotropic Kriging operation on attribute Samples with the


above mentioned findings.

Use an Angle of 20 , a Ratio of 1.2 and a Limiting Distance of 600 m.

Select the Error Map checkbox and click the Show button to start the calculation. After the calculation, the Display Options dialog box shows up.
Accept all defaults and click OK to display the map.

Close the map window when you have finished the exercise.

Call the Output Raster Map Anisotropic .


Create a Georeference. Use Coordinate Systems Unknown , accept the
default boundary values but change the Pixel size into 20 m.

ILWIS 3.0 Users Guide

449

Spatial data analysis: geostatistical tools

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).

Open point map Mander .

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 correlation between Sub76 and Avg30 .


450

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

Perform Spatial Correlation operations on the attributes Sub76 , Moist76


and Avg30 . Use in all three cases a Lag spacing of 200 meter.

Call the new tables respectively Spat_corr_Sub76 ,


Spat_corr_Moist76 and Spat_corr_Avg30 .

Also make a Cross Variogram table (Lag spacing 200 meter) for the correlated attributes Sub76 and Avg30 .

Use TabCalc commands to check the Cauchy-Schwarz condition:


Cauchy_Schwarz = SQ(CrossVarAB)< SemiVarA * SemiVarB .

Display the graphs of the 2 semi-variograms and the cross-variogram and try
to fit them with Power models. Hint: the slopes are small values (about
0.02 or less) and the Power exponents are around 1.5 .

In the Graph window, use the context-sensitive menu to modify the way the
different variograms are displayed. Use Red for the Predictand Sub76 ,
Green for the Covariable Avg30 and Blue for the Cross-Variogram.

Write down the parameters for the Nugget, Slope and Power from the best fitting
models. Use these models in the Cokriging operation such that the interpolation of
the Predictand Sub76 values is supported by the Covariable Avg30 .

Start the CoKriging operation and fill out the parameters as found above.

Call the Output Raster Map Cokriging .

Use for the Limiting Distance 800 meter and for the Minimum and
Maximum number of sample points 1 and 8 respectively.
Create a GeoReference. Use a Pixel size of 10 or 20 m and call the new
georeference Mander10 or Mander20 .
Select the Error Map check box, and click the Show button to execute the
operation.

Subsequently, interpolate attribute Sub76 via the Ordinary Kriging method.

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.

ILWIS 3.0 Users Guide

451

Spatial data analysis: geostatistical tools


Summary: Kriging estimation
- The four major steps in a kriging interpolation are: (1) Examining the input data,
(2) Calculating experimental variograms, (3) Modelling variograms and (4) Kriging
interpolation.
- 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 semivariogram 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.
452

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools


- Anisotropic Kriging is another variant of the Ordinary Kriging operation. It
incorporates the influence of direction dependency i.e. anisotropy in the kriging
process.
- Co-Kriging is a multivariate extension of the Ordinary Kriging technique.
CoKriging calculates estimates or predictions for a poorly sampled variable (the
predictand) with help of a well-sampled variable (the covariable). Both variables
should however be highly correlated (positive or negative).
- From the combination of a kriged output map containing the estimates and its
output error map, you can create confidence interval maps.

ILWIS 3.0 Users Guide

453

Spatial data analysis: geostatistical tools

11.5 Spatial autocorrelation of raster maps


The AutoCorrelation and SemiVariogram operation calculates the autocorrelation and
the semi-variance, between pixel values of a raster map and pixel values of the same
raster map for different shifts (lags), in horizontal or vertical directions. This method
is based on the assumption that a regional variable becomes random at a great
distance, i.e. the correlation of a regional variable with other pixels will normally
decrease with increasing distance. The AutoCorrelation - Semivariance operation
should be used prior to a raster interpolation operation like Densify, Resample or
Kriging from Raster

The results of auto-correlation and semi-variance in vertical and horizontal directions


are stored in a table. The data of this table can also be represented as graphs. The
output table contains the following columns:
- Distance : distance values
- HorCorr : horizontal autocorrelation
- VertCorr : vertical autocorrelation
- HorSemVar : horizontal semi-variance
- VertSemVar : vertical semi-variance.
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 Mlaga 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 Montalbn 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 Montalbn in central
Spain.

Double-click raster map Gneiss in the Catalog. The Display Options


Raster Map dialog box is opened.

Accept all default settings and press OK. The map is shown.

Repeat the procedure for the maps Schist and Carbonate .

Check the values in this map by clicking some pixels. Close the map window.

Now you will calculate and display semi-variograms for the three lithologies.

454

ILWIS 3.0 Users Guide

Spatial data analysis: geostatistical tools

Double-click the Autocorrelation-Semivariance operation in the


Operation-list. The AutoCorrelation and SemiVariogram dialog box is
opened.

Select raster map Gneiss in the Raster Map list box.

From the Graphs menu select the New Graph Window command. The
Graph dialog box appears.

Select column Distance for the X-axis, select column HorCorr for the Yaxis and click OK. The Graph Options sheet is opened.

On the Distance x HorCorr tab, select Point, the Color Red and click OK.

Select the column VertCorr for the Y-axis and click OK. The Graph
Options sheet appears.

On the Distance x VertCorr tab, select Point, choose Color Green and
click OK again.

Click the New Graph Window button. The Graph dialog box is opened.

On the Distance x HorSemVar tab, select the Point option, the Color Red
and click OK.

In the graph window, click the right mouse button to open the context-sensitive menu. Select the Add Graph, from Columns command. The Add
Graph dialog box appears.

Select the column VertSemVar for the Y-axis and click OK. The Graph
Options sheet appears.

On the Distance x VertSemVar tab select the Point option, choose Color
Green and click OK again.

Repeat the previous described procedure for the maps Schist and
Carbonate .

Type Autocorr_Gneiss in the text box Output Table. Accept the default
Maximum Pixel Shift and click the Show button. The result of the operation is displayed in a table window.

In the graph window, click the right mouse button to open the context-sensitive menu. Select the Add Graph, from Columns command. The Graph
dialog box shows up.

In the Graph dialog box, select column Distance for the X-axis, select
column HorSemVar for the Y-axis and click OK.

In general, the semi-variograms show low values for short lag spacings, indicating
that pixels that are close or adjacent are relatively similar (i.e. the variance is low). In
some cases the curve does not seem to approach the origin of the plot, but tends to
reach a small Y-intercept known as nugget. This indicates that there is variability at
very short (almost zero pixel) distances. In remote sensing, this variance can be
attributed to noise in the images. At larger lag spacings, the increase in semi-variance
tends to level off to a constant value, known as the sill of the semi-variogram. The
distance at which this sill is reached is known as the range of the variogram.
ILWIS 3.0 Users Guide

455

Spatial data analysis: geostatistical tools


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-variograms are identical, due to the homogenous and isotropic landforms on the gneissic terrain lacking any preferred orientation. The sill is high, due to strong differences 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.
- The AutoCorrelation - Semivariance operation should be used prior to a raster
interpolation operation like Densify, Resample or Kriging from Raster.

456

ILWIS 3.0 Users Guide

CHAPTER 12

Scripts and functions


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.
Spatial data analysis can also be performed in ILWIS by typing commands,
calculations or expressions on the Command line of the Main window, or by
combining these in a script.
When using a script, a series of commands, calculations and expressions are
predefined in a list. These are consecutively executed when the script is run.
Furthermore, a script may contain variables, so that the script can be used for
different input maps, tables or values. Scripts can save a lot of time when dealing
with frequently occurring analyses.
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.

Double-click the ILWIS icon on the desktop.


Use the Navigator to go the directory: C:\ILWIS 3.0 Data\Users Guide\
Chapter12.

ILWIS 3.0 Users Guide

457

Scripts and functions

12.1 Creating a script


In this part you will learn how to create a script. With the help of a script, a complete
GIS or Remote Sensing analysis can be performed automatically. A script may
contain all the commands and expressions that are listed in the ILWIS Help topic
Appendices, ILWIS script language (syntax). These include commands and
expressions for the creation and calculation of data objects, for object management
(e.g. copy or delete), and for display of data objects (open and show). Other scripts
and other Windows applications can also be called from within a script.
The script language is similar to the Command line syntax and we will therefore
have a closer look at the Command line first.

12.1.1 Working from the Command line


Most of the activities that are done via menus can also be done via the Command
line of the Main window located at the top of the Main window, just below the
toolbars.
The Command line can be used for the following activities:
- To perform ILWIS commands: To display, edit or create ILWIS objects, and to
obtain dialog boxes to start an ILWIS operation. You can also use some special
script language for data management: copying and deleting objects, and breaking
dependency links of objects;
- To perform calculations with maps and attribute tables. The calculations with
tables were treated in chapter 5, and the Map Calculation statements were discussed
in chapter 8;
- To perform ILWIS expressions allowing you to perform complete ILWIS operations
directly from the Command line;
- To generate script syntaxes, that can be copied to a script.

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 doesnt matter if you type them in upper or lowercase. A complete
overview of ILWIS commands can be found in the ILWIS Help topic, Appendices
ILWIS script language (syntax).

458

ILWIS 3.0 Users Guide

Scripts and functions

Open Help, go to the Appendices and browse through the following topics:
ILWIS commands and expressions: ILWIS commands, ILWIS expressions, ILWIS expressions (alphabetic), Construction of expressions,
ILWIS script language (syntax).

Table 12.1:

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

Type the following command on the Command line: Open

Close the map window.

The Open Object dialog box appears from which you can select any object.
Select raster map Geomorphology and click OK. The Display Options Raster Map dialog box is opened. Click OK. The raster map
Geomorphology is displayed.
Type the following command on the Command line:
Open Geomorphology

You will notice that you get an error message when you type: Open
Geomorphology .
This is due to the fact that ILWIS doesnt know which object with the name
Geomorphology should be displayed: a raster map, a vector map, a table, a domain,
etc. You have to use the name of the object and its extension.

Type the following command on the Command line:


Open Geomorphology.mpr

Click OK in the Display Options Raster Map dialog box.


Close the map window.

The extension .mpr is the extension of raster maps. In Table 12.2, the extensions of
some ILWIS objects are listed.
ILWIS 3.0 Users Guide

459

Scripts and functions


Table 12.2:

File extensions of different ILWIS objects.

Extension

Example

Description

.mpr

Geomorphology.mpr

File extension of raster maps.

.mpa
.mps
.mpp
.tbt
.mpv
.mpl
.ioc
.ilo
.his
.hsa
.hss
.hsp
.rpr

Cityblock.mpa
Contour.mps
Rainfall.mpp
Cityblock.tbt
Cochabamba.mpv
Tms.mpl
Bolivia.ioc
Cochabamba.ilo
Slope.his
Landuse.hsa
Drainage.hss
Wells.hsp
Landuse.rpr

File extension of polygon maps.


File extension of segment maps.
File extension of point maps.
File extension of tables.
File extension of map view.
File extension of a map list.
File extension of an object collection.
File extension of a layout.
File extension of a raster histogram.
File extension of a polygon histogram.
File extension of a segment histogram.
File extension of a point histogram.
File extension of a representation.

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.

Type the following command on the Command line: Crdom Slide

The domain Slide now has two items. Check this by opening the domain.

The class domain Slide is created, but it still doesnt contain any items.
Type the following command on the Command line:
Additemtodomain Slide Landslide
Additemtodomain Slide No Landslide
Enter the following MapCalc statement:
Slide{dom=Slide}=IFF((Geomorphology=AL)OR
(Geomorphology =OL),Landslide,No Landslide)

460

Click Show in the Raster Map Definition dialog box and OK in the
Display Options dialog box.

Inspect the results and close the map window.

ILWIS 3.0 Users Guide

Scripts and functions

12.1.2 Creating and running a script


The exact syntax for the script statements is something you know by heart only after
working a considerable time with ILWIS. There are however several methods that you
can use to create correct expressions for scripts:
- Use the menu and the dialog boxes for a certain operation. Fill in all required
parameters in the dialog box, and click Define. At that moment the expression for
that specific operation is displayed on the Command line. You can then copy the
expression from the Command line into the script. Within the script editor and the
Command line, you can use the following key strokes:
CTRL+C
Copy the selected part to the Clipboard.
CTRL+V
Paste the contents from the Clipboard.
- The ILWIS log file. ILWIS keeps track of everything you are doing in a so-called
log file. The ILWIS log file is called Ilwis.log and can be found in the Log file
directory that is specified in the Directories part of the Preferences dialog box
(File menu in the Main window). The log file is an ASCII file that you can open
with a text editor. You can copy (part of) the expressions that are stated in the log
file to 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

Figure 12.1: ILWIS Script editor with an example of an ILWIS script.

ILWIS 3.0 Users Guide

461

Scripts and functions


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 expressions:
- 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 geomorphologic 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 calculation 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 context-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 .

462

Check the contents of the raster map Landslide and the domain
Landslide and close the map window, the domain and the Script editor
afterwards.

ILWIS 3.0 Users Guide

Scripts and functions

12.2 Creating a script with calculations and expressions


When using MapCalc expressions in a script, no special syntax is required: you can
simply type the MapCalc expression as you would type it on the Command line of
the Main window.
The general syntax for MapCalc expressions in scripts is:
Outmap = Expression

Where,
is the name of the output object.
is a definition symbol to indicate that a dependent output object is to
be created, when the assignment symbol := is used, an independent
output object is created.
Expression is an expression consisting of an operation name followed by the
parameters required by this operation (between brackets, and separated
by commas), or a MapCalc expression.
Outmap
=

For example, to sum maps Map1 and Map2 to create Map3 , type in the script:
Map3 = Map1 + Map2

When using TabCalc expressions in a script, it is required that the word TabCalc
and the table name used for the expression are added to the syntax.
The general syntax for TabCalc expressions in scripts is:
TabCalc Tablename Expression

Where,
Tabcalc
is to indicate that the following is a table calculation syntax.
Tablename is the name of the table used for the expression.
Expression is the Command line syntax that you would use on the Command
line of a table window to perform table calculations.

For example, to sum columns Col1 and Col2 in table MyTable and to store the
results in column Col3 , you can type in a script:
TabCalc MyTable Col3 = Col1 + Col2

You can also perform table calculations on other objects that can be opened as a
table, e.g. histograms, point maps, class representations. Then, specify the extension
(see Table 12.2) of the object after the object name:
TabCalc Objectname.ext Col3 = Col1 + Col2

When you use long object names for maps or tables, and when the names of
objects start with a digit, or start with or contain a space, or a special character,
then these names must be enclosed in single quotes. The extension should be left
outside the quotes. For more information, see the ILWIS Help topic, How to use
long object names.

ILWIS 3.0 Users Guide

463

Scripts and functions

12.2.1 Example of a script for Map Calculation


In chapter 8 you have been working with Map Calculation formulas in the analysis of
a simple, hypothetical problem dealing with the calculation of the price of the land in
the Cochabamba region.
Now you will do the same analysis, using a script.
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 information 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:
Rem ILWIS Script
1
2
3
4
5

Geomorphology = MapRasterizePolygon(Geomorphology,Cochabamba.grf)
Landuse = MapRasterizePolygon(Landuse,Cochabamba.grf)
Landvalue = (Landuse.Landvalue) / 25
Landvalue1 = IFF(Slope > 20 , Landvalue * 0.7 , Landvalue)
Landvalue2 = IFF(Geomorphology = OL, Landvalue * 0.6, IFF
((Geomorphology = AL) OR (Geomorphology = HE), Landvalue * 0.4,
Landvalue))
6 Landval_combined = MIN(Landvalue1, Landvalue2)
7 Landval_final = IFUNDEF(Geomorphology, Landvalue2, Landval_combined)

The line numbers in the table do not form part of the script. They are only used here
to comment on the various expressions.
For a better understanding of the script statements it is recommended to repeat the
exercise in section 8.1. Below, only a brief explanation on the script lines is given.
- In lines 1 and 2, the maps Geomorphology and Landuse are rasterized, using the
georeference Cochabamba .
- In line 3, the map Landuse is renumbered, with the values from the column
Landvalue in the attribute table linked to the map Landuse . The land use map is
linked to an attribute table, in which the average land value (per hectare) is stored
for each land use type. Since the average land values are given per hectare, and you
464

ILWIS 3.0 Users Guide

Scripts and functions


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.

Double-click the script Landvalue in the Catalog. The Script editor is


opened, in which you will see the script statements.

Run the script by clicking the Run Script button


Script editor.

in the Toolbar of the

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.

12.2.2 Example of a script for Table Calculation


In section 5.7 you have been practicing with table joining for an urban problem, using
two tables: Cityblock (table linked to the map Cityblock , with information on
the 717 city blocks in the central part of Cochabamba), and District (a table with
ILWIS 3.0 Users Guide

465

Scripts and functions


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 script for calculating this problem is shown below:
Rem ILWIS Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Opentbl Cityblock.tbt
Tabcalc Cityblock Areadistrict = ColumnAggregateSum(Area, District, 1)
Tabcalc Cityblock Distrlanduse = District + Landuse
Tabcalc Cityblock Areadistrlu = ColumnAggregateSum(Area,
Distrlanduse, 1)
Tabcalc Cityblock Residential {dom = perc;::1} = IFF(Landuse =
Residential, 100 * Areadistrlu / Areadistrict, 0)
Tabcalc Cityblock Commercial {dom = perc;::1} = IFF(Landuse =
Commercial, 100 * Areadistrlu / Areadistrict, 0)
Tabcalc Cityblock Institutional {dom = perc;::1} = IFF(Landuse =
Institutional, 100 * Areadistrlu / Areadistrict, 0)
Closetbl Cityblock.tbt
Rem Open the table District
Opentbl District.tbt
Tabcalc District Residential = ColumnJoinMax(Cityblocks.tbt,
Residential, District, 1)
Tabcalc District Rommercial = ColumnJoinMax(Cityblocks.tbt,
Commercial, District, 1)
Tabcalc District Institutional = ColumnJoinMax(Cityblocks.tbt,
Institutional, District, 1)
Tabcalc District Population = ColumnJoinSum(Cityblocks.tbt,
Population, District, 1)
Tabcalc District Children = Population * Pchildren / 100
Tabcalc District Childpschool = Children / Schools
Closetbl District.tbt
Open District.tbt

The line numbers in the table are not part of the script. They are only used here to
comment on the various expressions.

466

ILWIS 3.0 Users Guide

Scripts and functions


- In line 1, table Cityblock will be kept open in memory.
- 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 3, (Distrlanduse = District + Landuse ) the two columns Landuse
and District are combined (concatenated) into a new column.
- In line 4, the aggregate function Sum is used to sum the areas of the land use types
per district.
- In lines 5, 6 and 7, the percentage coverage of residential, commercial and institutional areas within each district is calculated. Note that the domain of the output
column is specified: Perc , which is the percentage domain and that the precision
for the values in the output column is set to 1.
- 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 percentage 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.
- In line 17, table District is closed.
- In line 18, the output table District is displayed.

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


Script editor.

Have a look at the result and close the table District afterwards.

ILWIS 3.0 Users Guide

in the Toolbar of the

467

Scripts and functions

12.3 Using parameters in a script


In the previous examples you have only looked at scripts that are made for specific
maps or tables. You can also make scripts that are more widely applicable, by
introducing parameters. Any ILWIS object can be represented by parameters in a
script as well as values and strings. Parameters in a script must be written as %1, %2,
%3, , %9 (see ILWIS Help, How to use parameters in scripts).
In this exercise you will calculate a slope map in percentages and degrees. The script
looks like:
Rem ILWIS Script: for creating a slope map
1
2
3
4
5
6

Dem = MapInterpolContour(%1, %2)


Dem_dx = MapFilter(Dem, DFDX)
Dem_dy = MapFilter(Dem, DFDY)
%3.mpr = 100 * HYP(Dem_dx, Dem_dy) / Pixsize(Dem)
%4.mpr = RADDEG(ATAN(%3.mpr / 100))
Calc %4.mpr

The line numbers in the table are not part of the script. They are only used here to
comment on the various expressions. The script contains the following expressions:
- In line 1, a contour vector map, indicated with parameter %1 , is interpolated using
georeference %2 to create a Digital Elevation Model Dem .
- In line 2, the digital elevation model is filtered using a DFDX filter, creating a new
map Dem_dx containing the first derivative in x-direction (df/dx) per pixel.
- In line 3, the digital elevation model is filtered using a DFDY filter, creating a new
map Dem_dy containing the first derivative in y-direction (df/dy) per pixel.
- In line 4, a slope map in percentages %3 is calculated.
- In line 5, a slope map in degrees %4 is calculated.
- In line 6, output map %4 is calculated and therefore all maps created by the script
are calculated.
Note that this script contains four parameters: %1 till %4.
When you run a script with parameters these parameters should be defined either
before or when the script is run. The parameters can be defined in the following
ways:
- In the Script editor you can fill out the Parameters tab. Parameter Name and
Type can be entered here and will later on appear in a Run Script dialog box when
a user runs the script. The user can then select object names for input parameters
and/or type object names for output parameters.
468

ILWIS 3.0 Users Guide

Scripts and functions


- 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 parameter.
For this exercise the parameters of Table 12.3 are used.
Table 12.3:

Script parameters.

Parameters for the Slope script


Parameter

Name for Run Script dialog box

Type

Optional default object

%1
%2
%3
%4

Input Contour map


Georeference to be used
Output Slope map in Percentages
Output Slope map in Degrees

Segment Map
Georeference
Filename
Filename

Contour.mps
Cochabamba.grf
Slopepct.mpr
Slopedgr.mpr

When run, the script will be interpreted as follows:


Rem ILWIS Script: for creating a slope map
1
2
3
4
5
6

Dem = MapInterpolContour(Contour.mps, Cochabamba.grf)


Dem_dx = MapFilter(Dem, DFDX)
Dem_dy = MapFilter(Dem, DFDY)
Slopepct.mpr = 100 * HYP(Dem_dx, Dem_dy) / Pixsize(Dem)
Slopedgr.mpr = RADDEG(ATAN(Slopepct.mpr / 100))
Calc Slopedgr.mpr

We will first run the script from the Command line of the Main window.

Open the script Slope and look at its contents.


Close the Script editor.
You can run the script by typing the following expression on the Command
line of the Main window:
Run Slope Contour Cochabamba Slopepct Slopedgr

Have a look at the resulting maps Slopepct and Slopedgr . Note that the
calculations start when you open the maps.

We will now enter the parameters in the Parameters tab and run the script from the
Script editor.
ILWIS 3.0 Users Guide

469

Scripts and functions

470

Open script Slope and click the Parameters tab. Set the number of parameters to 4.

Enter the parameter Names and Types according to Table 12.3.

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.

Enter Run Slope Script on the Description line.


Save the script.
Run the script by clicking the Run Script button
Script editor.

in the Toolbar of the

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.

Have a look at the resulting maps Slopepct3 and Slopedgr3 . Close the
map windows and the Script editor.

Run the script by clicking the Run Script button


Script editor.

in the Toolbar of the

ILWIS 3.0 Users Guide

Scripts and functions

12.4 Running a script from another script


In this example, we will make a new script DensIn which will run the existing script
Density three times, each time using a different map as input.
Script Density calculates the density of landslides within certain units. It reads:
Rem Script Density to calculate landslide density
1
2
3
4
5
6
7

s%1 = TableCross(%1,Slide)
calc s%1.tbt
tabcalc %1 AreaClass = ColumnJoinSum(s%1.tbt,Area,%1)
tabcalc s%1 AreaSl = iff(Slide="landslide",Area,0)
tabcalc %1 AreaSlide = ColumnJoinSum (s%1.tbt,AreaSl,%1)
tabcalc %1 Density {dom=perc} = 100 * AreaSlide/AreaClass
calc %1.tbt

As before, the line numbers are only used to explain the script. In short:
- A cross table is calculated from a variable input map (%1) and raster map Slide.
- In the cross table, the total area of each class is calculated and written into the attribute
table of the variable input map (AreaClass).
- Then, if landslides occur, the total area with landslides is calculated per class, and
written into the attribute table of the variable input map (AreaSlide).
- In the attribute table, the density of landslides is calculated by dividing AreaSlide by
AreaClass.

With script DensIn we can now call script Density and use various input maps:
Rem Script DensIn that serves as input for the Density script
1 Run Density Geology
2 Run Density Slope_classes
3 Run Density Catchment

- In line 1, script Density is executed using map Geology as parameter %1.


- In line 2, script Density is executed using map Slope_classes.
- In line 3, script Density is executed using map Catchment.

Create a script DensIn and enter the lines as given in the example.

Have a look at the resulting attribute tables Geology , Slope_classes and


Catchment .

Close the tables after you have seen the result.

Save the script and exit the editor.


In the Catalog, click script DensIn with the right mouse button and choose
Run.

ILWIS 3.0 Users Guide

471

Scripts and functions

12.5 Special script language


Even though the script language is not intended to be a programming language, but
merely a tool to help you process data, it does have special features that makes it
easier to work with and to give it some extra capabilities. Some examples of the
special script language is given in Table 12.4, a complete overview is given in the
ILWIS Help topic, Appendices ILWIS script language (syntax).
Table 12.4:

Some commands that can be used on the Command line.

Command

Example

Description

Begincomment

begincomment
Open Geomorphology.mpr
endcomment

All lines of text between the commands begincomment and endcom


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.

Endcomment

Open -noask object.ext Open -noask Cityblock.mpa

Opens the object object.ext with its


default display options

Closeall

Close all ILWIS windows except the


ILWIS Main window.

Closeall

Summary: Scripts
- Scripts are used to automate the operations in ILWIS.
- A script is a list of commands, calculations and expressions.
- With the help of a script, a complete GIS or Remote Sensing analysis can be performed automatically.
- A script may contain all the commands and expressions as listed in the
Appendices, ILWIS commands and expressions section of the ILWIS Help:
opening dialog boxes, MapCalc, TabCalc, performing operations and some other
actions.
- A script consists of an object definition file with extension .isl (ILWIS Script
Language) and a data file with extension .isf (ILWIS Script File).
- A script can be made by copying an expression from the Command line after you
have filled in all required parameters in the dialog box of a certain operation, and
clicked Define. At that moment the expression for that operation is shown on the
Command line. You can copy this expression from the Command line into your
script.
472

ILWIS 3.0 Users Guide

Scripts and functions


- 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 scripts context-sensitive menu in the Catalog or from the Command line
of the Main window by typing: Run Scriptname
- Any ILWIS object can be represented by parameters in a script as well as values
and strings. Parameters in a script must be written as %1 , %2 , %3 , etc. Parameters
have a Name and Type that are entered on the Parameters tab so that a user can
select objects for the parameters in a dialog box when running the script.
- 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.
- A range of special script language is available to give a script more possibilities.

ILWIS 3.0 Users Guide

473

Scripts and functions

12.6 Functions
In Chapter 5 you have seen the use of calculation formulas to work with tables, and
in chapters 7 and 8 those to work with maps. As you have seen, there are many
different operators and functions that can be applied on value maps and on class or
ID maps. A complete overview of the operators and functions available in Table
Calculation and in Map Calculation can be found in the ILWIS Help, together with a
series of examples.
In this exercise you will first have a look at some examples of functions that are
already present in the system (pre-programmed functions), before you will practice
with the creation of your own functions (user-defined functions).
System-defined functions
A number of these functions where already treated in chapters 5, 7 and 8. Here, only
some examples of system-defined functions are given. One of the most important
functions is the Conditional IF function.
IFF(a,b,c)

If condition a is true, then return the outcome of expression b, or


else (when condition a is not true) return the outcome of expression
c. Mind the double ff in IFF (standing for 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,
474

ILWIS 3.0 Users Guide

Scripts and functions


use the following formula:

Type the following expression on the Command line:


Map1 = IFF (Dem = 1, 1, 1)

The Raster Map Definition dialog box is opened. Select system Domain
Value , and set the Value Range from 0 to 1, and the Precision to 1.0 .
Click Show.

Type the following expression on the Command line of the Main window:
Random = RND(0) * Map1

in which Map1 is a georeferenced value map with value 1 for every pixel. Map1 can
be calculated from any map using the appropriate georeference. Random uses the
same georeference as Map1 . The pixels in the output map will randomly get the value
0 or 1. Random functions are very useful for all kinds of statistical testing.

The Raster Map Definition dialog box is opened. Select system Domain
Value , and set the Value Range from 0 to 1, and the Precision to 1.0 .
Click Show.

Examine the results, and then close the map window.

MinMax functions
MIN(a,b)

Calculates the minimum of two expressions a and b.

MIN(a,b,c)

Calculates the minimum of three expressions a, b and c.

MAX(a,b)

Calculates the maximum of two expressions a and b.

MAX(a,b,c) Calculates the maximum of three expressions a, b and c.


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.

Type the following expression on the Command line:


Min3 = MIN(Tmb2, Tmb3)

The Raster Map Definition dialog box is opened. Select system Domain
Image and click Show.

Examine the results, and then close the map window.

User-defined functions
Besides many internal pre-programmed functions, ILWIS gives the user an
opportunity to create new functions. They may be used in all four calculators in
ILWIS 3.0 Users Guide

475

Scripts and functions


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, userdefined 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.

Double-click New Function in the Operation-list. The Create Function


dialog box is opened.

Type for the Function Name: Average_2 .


Type for the Expression: (a + b)/2 .
Type for the Description: Averaging two value maps . Click OK.

The Function editor appears showing your newly created function. If necessary, you
can edit your function. The different parameters in your function may be names of
maps or table columns, or you use characters (a, b) which you may specify later when
you apply the function.
The function in the Function editor is defined as follows:
1 Function Average_2(Value a, Value b) : Value
2 Begin
3
Return (a+b)/2;
4 End;

The line numbers do not form part of the function. They are only used here to explain
the contents.
-In line 1, the function name is given and the parameters are listed between brackets.
In this case there are two parameters: Value a and Value b. Also the output domain is
given: Value .
-In line 2, the word Begin indicates the beginning of the actual function expression.
-In line 3, the actual function is given. Note that the expression ends with a
semicolon (;).
-In line 4, the end of the function is indicated with the word End .
Now you can use your function on the Command line of the Main window or table
window. Type an expression that starts with an output map name (or column name)
followed by the definition symbol (=), then the name of your function and fill out the
parameters. The parameters, replacing the characters a and b in your function, have to
be entered in brackets separated by commas. The parameter that is filled in first is
taken as the first parameter encountered in your user-defined function.
476

ILWIS 3.0 Users Guide

Scripts and functions

Close the Function editor.

The Raster Map Definition dialog box is opened. Select the system
Domain Image and click Show.

Examine the results in map Average_tmb .

Type the following expression on the Command line:


Average_tmb=Average_2(Tmb2, Tmb3)

Close the map window.

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.

Double-click New Function in the Operation-list. The Create Function


dialog box is opened.

Type for the Function Name: Aspect .


Type for the Expression: RADDEG(ATAN2(Dx, Dy) + PI) .
Type the Description: Slope aspect between 0 and 360 degrees .
Click OK. The Function editor is opened.

As you can see in the first line of the function definition, ILWIS assumes that PI is
another variable (a map or value). But in fact PI represents here the system-defined
variable. So you should edit the function to remove the variable declaration Value PI .
The correct definition of the function should be:
Function Aspect(Value Dx, Value Dy) : Value
Begin
Return RADDEG(ATAN2(Dx, Dy) + PI);
End;

Edit the function so that it looks as above.


Save the function and close the Function editor.

ILWIS 3.0 Users Guide

477

Scripts and functions


To apply the function Aspect :

Type the following expression on the Command line of the Main Window:
Aspect = Aspect(Dem_dx, Dem_dy)

The Raster Map Definition dialog box is opened. Select system Domain
Value , and set the Value Range from 0 to 360 and the Precision to 1.
Click Show.

Examine the results in map Aspect and close the map window.

Now you can easily calculate several aspect maps of other areas. You only have to fill
out your new input variables for the function; you have to specify the new Dx and Dy
map names of the other area.
Summary: Functions
- ILWIS contains over 50 different functions that are pre-programmed and that can
be used in Table Calculation, in Map Calculation, Script and in the pocket line calculator.
- Besides many internal pre-programmed functions, ILWIS gives the user an opportunity to create new functions.
- A user-defined function is an expression, which may contain any combination of
operators, functions, maps and columns.
- User-defined functions are especially useful when you need to execute certain calculations, which require a lot of typing effort on the Command line.
- To apply your function, type an expression on the Command line of the Main
window or table window. Start with an output map name (or column name) followed by the definition symbol (=), the name of your function and fill out the function parameters. The parameters, replacing the characters a, b, c, etc. in your function, have to be entered in brackets separated by commas. The parameter filled out
first is taken as the first parameter encountered in your user-defined function.

478

ILWIS 3.0 Users Guide

CHAPTER 13

Presentation of results
Data presentation is the procedure by which information from a GIS is presented in a
form suitable for the user. Remember that the results of a GIS analysis are used in
planning and management. Normally, data analysis is not done by the decision
makers and planners, therefore, information should be presented to them in such a
way that they are able to make sound decisions. If the information is presented to
them in a vague, unclear way, wrong decisions may be taken.
A map contains information, presented in a graphical form, intended for the map
user. A map is a means of communication, just as spoken text, video images, graphics
and sounds. A map should be well designed, so that the user can retrieve the
information quickly and easily.
Although ILWIS is not a cartographic package, it does provide the basic tools for the
creation of annotation and to convert digital spatial data (maps) to a hard copy print.
In the first part of this chapter, an introduction is given to the use of color, both for
display on the screen and for printing. The second part of the chapter explains how to
produce an output map. The selection of colors, patterns and point symbols is
demonstrated, and the Layout editor is used to create a complete land use map. The
procedure for printing a map is shown after that, followed by the methods for
converting your data to other (cartographic) packages. The last part of this chapter
deals with the generation of demos in ILWIS.
Before you can start with the exercises, you should start ILWIS and change to the
subdirectory C:\ILWIS 3.0 Data\Users Guide\Chapter13, where the data files for
this chapter are stored.

Double-click the ILWIS icon on the desktop.


Use the Navigator to go to the directory: C:\ILWIS 3.0 Data\Users Guide\
Chapter13.

ILWIS 3.0 Users Guide

479

Presentation of results

13.1 Introduction
When you prepare a map, you should be aware of the requirements of the map users.
A map intended for decision-makers, containing clear data without details, will be
very different from one made for scientists, which should contain as much factual
information as possible.
A map may be multi-purpose, such as a topographical map, which may be used by
many different people, for different purposes. A map can also be a single-purpose
map, displaying only one theme, for example, the annual rainfall distribution.
A map has a primary content (the main theme of the map), a secondary content (base
map information, such as roads, contours, drainage), and a supportive content
(legend, scale, north arrow, location map, etc.).
When you prepare a map for presentation you should decide on the scale of the map
you want to produce on paper. The scale of the output map should be based upon
considerations, such as: the purpose of the map (regional planning versus detailed
design), the requirements of the map user, the contents of the map, the size of the
area mapped, the size of the output map (paper format), and the required accuracy.
Displaying data to be used in the final map
In ILWIS, the map making-process starts with the visualization of the mapped area
and the selection of the spatial and attribute data to be presented. You will first have
to investigate which data you want to display on your map as primary content (main
theme) and secondary content (base map information). Users should always be able
to locate themselves on a map, so each map should contain sufficient base map
information. On a large scale map, this base map information can be quite extensive
including contour lines, drainage lines, roads and other infrastructure, and the
location of villages and towns. On small scale maps, maybe only the main roads and
main towns can be displayed as base information. Putting too much base information
on a map is confusing.
It is possible to make use of one, or a combination of data layers (raster, segment,
polygon or point maps) to compile a final output map. In the Display Options dialog boxes, which appear just before a map is displayed in a map window, you can
specify how each map should be displayed.
The objective of the exercises in this chapter is to produce a complete land use map.
The first step of the preparation process for producing an output map in this exercise,
is to display the map Landuse. Visualization of the map area is an important stage
in the preparation of the map for final printing, since further planning of the layout
can only be decided after viewing the map. For example, by visualization you are able
to check whether enough space is available for annotation or whether the map area
has to be extended and whether the contrast between colors representing different
mapping units is satisfactory or not.
480

ILWIS 3.0 Users Guide

Presentation of results
In this exercise, the following data layers will be combined into a single map:
The polygon map Landuse : Forming the primary content. The map is displayed as
colored patterns.
- The point map Labels , containing text labels of the land use polygons.
- The raster map Shadows , containing the hillshading of the study area.
- The segment map Contour , containing the contour lines.
- The segment map Drainage , containing the drainage network.
- The segment map Roads , containing the road network.
- The point map Places , containing the location and names of the most important
locations in the area.
The various steps required to display maps and adding data layers to a map window
were explained in chapter 2.

Display polygon map Landuse .

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.

ILWIS 3.0 Users Guide

481

Presentation of results

13.2 Colors
One of the most important aspects in the design of presentable maps is the selection
of the most appropriate colors.
In ILWIS, the colors of objects are defined in the representation. In chapter 2 several
aspects of representations were already discussed.

Click with the right mouse button on representation Colors and select
Open from the context-sensitive menu. The Representation Class editor is
opened.

You will see a display of 20 colors. Every color may be seen as a combination of
different amounts of the primary colors: Red, Green and Blue (see Figure 13.1).

Figure 13.1: Color systems. Left: The RGB color system. Right: The HSI color system.

In ILWIS, you can work with three color systems (see Figure 13.1):
- The RGB (Red, Green, Blue) color system, which is used for display on most computer screens.
- The YMC (Yellow, Magenta, Cyan) color system, often used to describe the color of
an image produced by several hard copy devices.
- The HSI (Hue, Saturation, Intensity) color system, used for image processing.
In theory there is an infinite number of colors possible. ILWIS uses contributions of
each of the colors Red, Green and Blue in the range from 0 to 255. A value of 255
refers to the full intensity of a basic color.
The notation:
(0, 0, 0)
returns black,
(255, 255, 255) returns white,
482

(0, 0, 255)
(255, 255, 0)

returns blue,
returns yellow,
ILWIS 3.0 Users Guide

Presentation of results
(255, 0, 0)
(0, 255, 0)

returns red,
returns green,

(255, 0, 255)
(0, 255, 255)

returns magenta,
returns cyan.

Click on the color Yellow . You can see that the three slide bars on the lefthand part of the window change. Red will be 255 , Green will also be 255
and Blue will be 0.

Check the Red/Green/Blue components of the other 19 colors and close the
Representation Class editor afterwards.

Besides manipulation of colors in the representation of maps, ILWIS also has the
possibility to retrieve and/or assign colors in calculations. Calculations on colors
require maps or table columns with a color domain or a picture domain. You can also
see the color assignments of the items represented in the representation Colors in a
table.

Click in the Catalog with the right mouse button on representation Colors
and select Open as Table from the context-sensitive menu. The representation is now shown as a table.

Double-click the column header Color . The Column Properties dialog box
is opened. As you can see, column Color has domain Color .

Domain Color is a domain in which the colors are stored as Red, Green and Blue.
You can convert the colors as stated in the Color domain to the values of separate
Red, Green and Blue colors (or YMC or HSI as explained earlier) with a number of
statements (see Table 13.1).
Table 13.1:

Expressions to convert a color domain into the


individual values of the color systems RGB, YMC
and HSI.

CLRRED (colorexpr)

returns the red component

CLRGREEN (colorexpr)

returns the green component

CLRBLUE (colorexpr)

returns the blue component

CLRYELLOW (colorexpr)

returns the yellow component

CLRMAGENTA (colorexpr)

returns the magenta component

CLRCYAN (colorexpr)

returns the cyan component

CLRGREY (colorexpr)

returns the gray component

CLRHUE (colorexpr)

returns the hue component

CLRSAT (colorexpr)

returns the saturation component

CLRINTENS (colorexpr)

returns the intensity component

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.

ILWIS 3.0 Users Guide

483

Presentation of results

Close the Column Properties dialog box.

Type the following formulas on the Command line and click OK each time
the Column Properties dialog box shows up:
Red = CLRRED(color)
Green = CLRGREEN(color)
Blue = CLRBLUE(color)
Yellow = CLRYELLOW(color)
Magenta = CLRMAGENTA(color)
Cyan = CLRCYAN(color)
Grey = CLRGREY(color)
Hue = CLRHUE(color)
Sat = CLRSAT(color)
Intensity = CLRINTENS(color)

Make the Command line appear in the table window by choosing the
Command Line from the View menu.

Now you can see the 20 colors of the representation, expressed in the components of
the three color systems explained earlier. The first three columns Red , Green and
Blue , are simply the same values as in the appropriate part of the column color. The
second group of three columns (Yellow , Magenta , and Cyan ) show the colors in
the YMC color system. Note that the calculation is made in the following way:
Yellow = 255 - Blue
Magenta = 255 - Green
Cyan
= 255 - Red
Next, there is a column showing the gray tones of the colors. The gray component is
useful when you want to produce a gray tone map out of a color map.
The last three columns (Hue , Sat , Intens ) show the values according to the HSI
color system:
- Hue is the direction of the color in a three-dimensional color cube;
- Saturation is the purity of the color;
- Intensity is the brightness of the color.
Note that the values for Hue, Saturation and Intensity range from 0 to 240, because
that is the standard HSI color range in Windows. For the exact conversion formulas,
see the ILWIS Help topic Color Separation.

484

Compare the values in the columns you have just calculated with the color
cubes in Figure 13.1 in order to get an idea of the three color systems.

Close the table window.

ILWIS 3.0 Users Guide

Presentation of results
Hints for appropriate use of colors:
- For large areas in a map, the saturation of a color seemingly increases for the eye.
A color that looks okay in the legend may be too dominating in the map.
- Two rather similar colors can only be differentiated when they appear next to each
other in the map.
- Hues in the red-yellow region are said to be warm colors. Blue colors are said to
be cold.
- There are generally accepted color order scales. For example:
- Evidently: blue for water, green for vegetation, yellow for sandy areas.
- Some colors are more powerful and are used to indicate important features:
red for high hazard areas.
- To indicate increasing order scales, decreasing values are used: dark to light.
- It is not advisable to use more than 4 to 6 steps of the same hue.
- To indicate increasing positive and negative values use two base colors: red/yellow
& blue.
- The same colors are perceived lighter on a computer screen than on a paper map,
especially if you use high contrast and high brightness settings for your monitor.

ILWIS 3.0 Users Guide

485

Presentation of results

13.3 Editing visual variables


13.3.1 Maps with a representation
A cartographer disposes of the following tools in the representation of information in
a map:
- The basic types of spatial data, mentioned in chapter 2: points, lines and areas.
- Volumetrical shapes, for example an impression of the relief shown with hill shading.
- Text for legend information, topographical information and codes of mapping units.
- Symbols related to points but also to other symbols such as pie charts or bar graphs
to display statistical information within mapping units.
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 maps 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 representations:
- Representation Gradual, using percentage values as limits. This representation
can be used to display maps with any value domain.
- Representation Value, using actual values as limits. This representation can be
used only for the user-defined value domain for which it was created.
486

ILWIS 3.0 Users Guide

Presentation of results
- Identifier domains: Maps with domain type ID do not have a user-defined representation. They can be displayed:
- in 1, 7, 15, or 31 system colors via the Display Options - dialog box;
- by selecting a (class or value) column in the attribute table, e.g. in the Display
Options - dialog box.
- by calculating colors in a column with the color domain in the attribute table
(see paragraph 13.3.2).
In this paragraph you will edit visual variables through a representation. Table 13.2
shows for which type of maps and domains a representation is available. Identifier
domains and some system domains (Bit, Bool) do not have a stored representation on
disk. Editing visual variables if no representation is available will be discussed in
paragraph 13.3.2.
Table 13.2:

Managing Colors for maps with different domains.

Type

Domain Class

Domain Identifier

Domain Value

Point map

Representation
Class

Symbols, Symbols by Attribute,


as Arrows, as Graphs

Stretched Symbols

Segment map

Representation
Class

1, 7, 15, 31 Colors

Representation
Value/Gradual

Polygon map

Representation
Class

1, 7, 15, 31 Colors

Representation
Value/Gradual

Raster map

Representation
Class

1, 7, 15, 31 Colors

Representation
Value/Gradual

For maps which use system domain Value , you can create a representation and
you can choose to work with either percentages (0-100%) or with values
(-99999.99 to 99999.99).

Assigning colors to a class map


A map using a class or group domain always has a representation. Such a
representation can be edited in the Representation Class editor. The colors,
patterns, line types, etc. of all classes in the maps domain are shown and can be
changed in the editor.
This exercise shows how to change colors in a class map by editing its representation
class.

Display raster map Landuse .

To change the colors of the mapping units:

From the Edit menu, select the Representation command and select raster
map Landuse .

ILWIS 3.0 Users Guide

487

Presentation of results
The Representation Class editor (Figure 13.2) is opened. The tabs in this
representation editor can be used to see the colors for raster, polygon, segment or
point maps using this class domain. In the central part of this window, the class
names and their colors can be viewed. In the upper left part just below the Toolbar of
the window you will see the Color Selector and in the lower left part the Red,
Green and Blue Color Sliders are visible.

Figure 13.2: The Representation Class editor showing the Raster, Polygon, Segment and Point

tabs, the Color Selector (upper left part) and the Color Sliders (lower left part).

Colors can be edited in various ways:


- double-clicking classes;
- selecting a class and using the Color Selector;
- selecting a class and using the Color Sliders;
- selecting multiple classes and edit multiple items;
- assigning custom colors to a class.
In this exercise you will produce a simplified land use map based on the main land
use classes of Cochabamba.

!
488

When you change the color of a class in a representation class, the color of this
class will also be changed in all other maps that use the same domain and thus the
same representation.
ILWIS 3.0 Users Guide

Presentation of results

Select the class Bare rock .

Move the Red (color) scroll bar to value 84 .

Use the Red, Green and Blue Color Sliders to compose the correct color
for this class.
Move the Green (color) scroll bar to value 84 .
Move the Blue (color) scroll bar to value 84 .
Select the class Agriculture(irrigated) .
Change the colors to: Red = 0, Green = 176 and Blue = 20 .
Double-click the class Forest . The Edit Repr. Item dialog box is opened.

Any changes are directly saved to disk.

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.

Select the color ForestGreen and click OK.


Double-click the class Urban centre . The Edit Repr. Item dialog box is
opened again.
Click the Custom Color button. The Color dialog box is opened.

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.

Press the Define Custum Colors >> button.


In the Color Refiner box, select a reddish color along the left-hand side
(Red = 195 , Green = 35 and Blue = 35) . Click the button Add to Custom
Colors and click OK in the Color dialog box.
Now you are back in the Edit Repr. Item dialog box. Click OK. This will
bring you back to the Representation Class editor.

ILWIS 3.0 Users Guide

489

Presentation of results

Figure 13.3: The standard Windows Color dialog box.

Now, you will edit the colors for the various mapping units.

Edit the Red, Green, and Blue colors of each class according to the colors in
Table 13.3.

Click the Redraw button in the map window to see the result.

Table 13.3:

490

Colors of the land use units.

Class

Color Name

Red

Green

Blue

Agriculture
Agriculture (irrigated)
Airport
Bare rock
Bare soils
Forest
Grassland
Lake
Riverbed
Shrubs
Urban centre
Urban periphery

Green
LimeGreen
Red
DimGray
LightGray
ForestGreen
Custom
Custom
Custom
Custom
Custom
Custom

0
0
255
84
68
48
159
0
182
106
195
129

255
176
0
84
168
128
255
146
182
126
35
40

0
20
0
84
168
76
0
255
255
0
35
0

Hatching polygons

Horizontal
Vertical
Upwards
Solid
Solid
Solid
Solid
Solid
Solid
Solid
Diagonal
Crossing

ILWIS 3.0 Users Guide

Presentation of results
Unit hatching
Besides colors, the Representation Class editor contains a number of hatching
types which can be used to represent units in a polygon map.

Add polygon map Landuse to the map window and switch off the raster
layer in the map window.

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.

Select the Hatching type Diagonal and click the OK button.


Set the hatching of the other classes as indicated in Table 13.3.
Press the Redraw button in the map window to see the result.
Close the Representation Class editor and the map window when you have
finished the exercise.

Note that hatching is only possible for polygon maps.


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.

Open segment map Drainage .


Double-click the word Legend in the Layer Management tree of the map
window to open the Representation Class editor.

Double-click the item Main river . The Edit Repr. Item dialog box is
opened. Change the Line width to 0.2 and the Color to Blue .

Change the Color of the item Drainage to Blue , and the one of the item
Lake to Cyan . Leave the Line width 0 for these two.

Click the Redraw button in the map window, look at the result and close the
Representation Class editor.

Add segment map Roads to the map window.

ILWIS 3.0 Users Guide

491

Presentation of results

Similarly, change the representation of the segment map Roads . Change the
Color of item Main roads to Red , Line Type to Double and the Line
width to 0.2 . Change the Color of Secondary road to Red .

Click the Redraw button in the map window and close the Representation
Class editor after you have seen the result.

The segment map Contour has a value domain Height , which also has a value
representation Height . However, we do not want to display the contour lines in
different colors. They should be shown in gray, and we want to display only the main
contour lines (those every 100 meters).

Drag-and-drop the segment map Contour to the map window. The Display
Options Segment Map dialog box is opened.

Select the check box Mask and type the following mask: ??00 . This will
result in the display of the 100 meter contour lines only.

Click the option Single Color and select the color Gray . Click OK.
Close the map window after you have seen the result.

Visual variables for point maps


Data such as the location of villages and towns or data that are aggregated to points,
such as total population per province, can be symbolized as points. Points are
visualized as symbols, but they may vary in size according to the quantity they
represent. Different simple point symbols are supported (circle, square, diamond,
plus, etc.); you can also choose another symbol font.
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.

492

Display point map Places .

Specify Symbol Square, Size 4, Fill Color Yellow, Line Width 1 and
Color Red for this point and click OK to see the result.

In the Layer Management pane, double-click the name Cerveceria


Taquina (the local beer brewery). The Edit Repr. Item dialog box is
opened.

ILWIS 3.0 Users Guide

Presentation of results

Specify the symbol representation for the other points according to Table
13.4.

Close the map window when you have finished the exercise.

Table 13.4:

Symbol representation for the point map places.


Symbol Type

Symbol

Size

Cerveceria Taquina

Simple

Square

Yellow

Red

Cochabamba
Laguna Largon Mayu
Airport

Simple
Simple
Wingdings

Circle
Diamond


6
4
8

Red
White

2
2

Black
Blue
Red

Fill Color

Line Width

Color

You can also create an annotation text object (see section 13.4) which can be
based on a map. In this way you obtain all class names, IDs, or values of the
points in your map, while you can edit the exact positions, fonts, font sizes, etc. of
the texts later on in the Annotation Text editor.

13.3.2 Maps without a representation


In the previous paragraph, you have seen how to edit visual variables through a
representation. The visual variables that can be changed are subject to the type of
map and to the maps domain. In this paragraph, you will see how to change visual
variables of maps without a user-defined representation.
Point map with a value domain: temporary stretching
For point maps with a value domain, you can specify symbol type, color, line width
and line color for all points. For interpretation purposes, a point map with a value
domain can be displayed using a stretch option for the symbol size. There are two
stretch methods available: Linear and Logarithmic. If this is applicable to the type of
symbol, you can either stretch the Radius or Area of a symbol. A stretch range can
be specified as lower and upper boundaries.
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.

In the Catalog, double-click point map Rainfall .

Click the Symbol button. The Symbol dialog box is opened.

In the Display Options Point Map dialog box, select the Attribute check
box, and select column Total .

ILWIS 3.0 Users Guide

493

Presentation of results

Accept the defaults for Symbol Type, Symbol, Fill Color, Line Width and
Color.

Select the Stretch check box and accept the default stretch range.

Click OK in the Display Options - Point Map dialog box. Point map
Rainfall is now displayed with a point radius proportionally to the total
annual rainfall.

Accept Linear and Radius for the stretch method and click OK in the
Symbol dialog box.

Point map with an ID domain: points as graphs


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.

In the Catalog, double-click raster map Shadows . In the Display Options


Raster Map dialog box, select the option Light and click OK. The raster
map Shadows is displayed.

Drag and drop point map Rainfall into this raster map window. The
Display Options - dialog box of point map Rainfall is opened.

In the Display Options Point Map dialog box, select Symbols as


Graphs and click the Details button. The Symbols as Graphs dialog box
appears.

494

ILWIS 3.0 Users Guide

Presentation of results

Make sure that the option Pie Chart is selected.


From the left hand list box, select the columns Quarter1 , Quarter2 ,
Quarter3 and Quarter4 . Use the Ctrl or Shift key to select multiple
columns and press the > button. The right hand list box now lists the selected
columns from which the graphs will be constructed.
Select the Stretch check box and select column Total .
Type 6 for the minimum and 14 for the maximum piechart Size.
Accept the Radius option as stretching method and click OK. You are back
in the Display Options Point Map dialog box.
Click OK. The point map Rainfall is now displayed on top of the raster
map Shadows .

The points are displayed as pie charts, showing the rainfall values per quarter. The
total size of each pie chart is proportional to the total annual rainfall at that location.
If you like, repeat the exercise and try other possibilities like Compose Bar and/or
Line Graphs.
User-defined coloring of maps with an ID domain
In general, maps with an ID domain are displayed with a system representation. Units
are represented in a fixed number of system colors (1, 7, 15 or 31 colors) that cannot
be assigned to specific map elements (domain items). However, in most cases, you
will wish to show an attribute value of the ID map.
In case, you really wish to show the mapping units as IDs themselves, you can use in
the attribute table of the ID map some table calculations: for each ID a different color
will be generated. The colors will be stored in an attribute column with the color
domain.
Every color may be seen as a combination of different amounts of the primary colors
Red, Green and Blue. The easiest way to create distinct colors for all domain items is
to use a formula that will assign random colors to the domain items. Another option
is to enter values for Red, Green and Blue manually. For more information, see ILWIS
Help, topic Table calculation, Calculations on colors.
In this exercise, you will create a user-defined representation for polygon map
Cityblock , which has an ID domain. You will create a new column with a color
domain in the attribute table, and calculate random colors for all city blocks. To
display the polygon map Cityblock with the new distinct colors, you need to select
the option Attribute Column in the Display Options Polygon Map dialog box.

ILWIS 3.0 Users Guide

495

Presentation of results

Open the table Cityblock .

In the Column Properties dialog box accept Domain Color and click OK.

Type the following formula on the Command line of the table window:
Random:= COLOR(RND(255),RND(255),RND(255))

In column Random , you will see the newly calculated values Red, Green and Blue.
The formula returns a color composed by the random RND function, resulting in
random values for Red, Green and Blue (each ranging from 0 to 255 ).
You can now display polygon map Cityblock by its attribute column Random .

In the Catalog, double-click polygon map Cityblock .


In the Display Options Polygon Map dialog box, select the Attribute
check box, select column Random and click OK.

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.

Close the table and the map window.

Summary: Editing visual variables


- The visual variables that can be used in ILWIS depend on the one hand on the
domain of the map (class, ID, value, picture, color) and on the other hand 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. For point (and
raster) maps, you can also directly show texts via the maps Display Options - dialog box.
- The ILWIS Representation editor can be used to edit colors, patterns and point
496

ILWIS 3.0 Users Guide

Presentation of results
symbols of a map with:
- Class domains: Colors and patterns can be assigned to the classes of the map.
- Value domains: For maps with a value domain you can have two types of representations:
- Representation Gradual, using percentage values as limits. This representation can be used to display maps with any value domain.
- Representation Value, using actual values as limits. This representation can
be used only for the user-defined value domain for which it was created.
- Identifier domains: Maps with domain type ID do not have a user-defined representation. They can be displayed:
- in 1, 7, 15, or 31 system colors via the Display Options - dialog box;
- by selecting a (class or value) column in the attribute table, e.g. in the
Display Options - dialog box.
- by calculating colors in a column with the color domain in the attribute table
(see paragraph 13.3.2).
- Editing visual variables of maps without a user-defined representation:
- Point maps with a value domain. For interpretation purposes, a point map with
a value domain can be displayed using a stretch option for the symbol size.
- Point maps with an ID domain. When the attribute table of an ID point map
contains comparable value columns of various categories, you can display the
points as:
- Single Symbol;
- Symbols by Attribute;
- Symbols as Arrows, or
- Symbols as Graphs.
- User-defined coloring of maps with an ID domain. If you prefer to display an
ID map in a user-defined way, instead of using system colors, you can calculate
for instance random colors in a column in the maps attribute table. The column
should use the color domain.

ILWIS 3.0 Users Guide

497

Presentation of results

13.4 Map views


Combining data layers
In the previous section you have learned how the individual data layers, that will form
part of the final map, can be best displayed. A data layer is a raster, polygon, segment
or point map, for which the user has specified display options such as color, width,
size, etc., for the display in a map window. In this exercise you will combine various
data layers into a single map. The combination of data layers will be stored as a
map view.
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 colored 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 locations in the area.

498

Double-click raster map Shadows in the Catalog. The Display Options


dialog box is opened.

Select the Light option and click OK in the Display Options Raster
Map dialog box. The map is displayed.

On the Toolbar of the map window, click the button Add Layer. The Add
Data Layer dialog box is opened.

Select the polygon map Landuse and click OK. The Display Options Polygon Map dialog box is opened.

Accept the defaults and click OK. The polygon map Landuse is added to
the list of data layers.

Click the Add Layer button again and select segment map Contour in the
Add Data Layer dialog box.

Click OK. The Display Options Segment Map dialog box is opened.
Select the Mask check box and type the following mask: ??00 .
Select the Single Color option and select the color Brown .
Click OK in the Display Options dialog box. The map Contour is now
displayed and added to the list of data layers.

ILWIS 3.0 Users Guide

Presentation of results

Add segment maps Drainage and Roads and point map Places to the
same map window; use default Display Options.

Now all added layers are displayed in the map window. Furthermore, all layers appear
in the Layer Management pane (left hand side of the map window).
Adding an Annotation Text layer
You can also add text layers by creating a new object called annotation text. An
annotation text layer is designed to display and store multiple texts at multiple
positions. An annotation text object can be based on an existing point, segment, or
polygon maps. If you do so, the text object will contain a text (class name, ID or
value) for each point, segment or polygon in the selected map. In the next exercise
you will create text labels for point map Places .

From the File menu in the map window, select Create and select
Annotation Text. The Create Annotation Text dialog box is opened.

Enter the AnnText Name: Place_labels .

Accept all other defaults and click OK. The Annotation Text editor is
opened.

Make sure the check box Based on Map is selected and choose point map
Places from the drop-down list box.

The Annotation Text editor allows you to edit text items stored in an annotation text
object. With the Annotation Text editor, you can:
- insert new texts and delete selected existing texts,
- move one or more selected texts to another position,
- make text duplicates, and
- specify fonts, sizes, colors, etc. for (multiple) selected texts.
In this case, we will only change the font and the font size of all text labels.

From the Edit menu, choose Select All. In the map window, you will see
that all the text labels are selected.

Click the right mouse button in the map window and select Edit from the
context-sensitive menu. The Edit Texts dialog box appears.

Select the Font Name Arial and type 8 for the Font Size.

Select Text Color Blue , deselect the Transparent check box, accept all
other defaults and click OK. The annotation text labels appear in blue on top
of the point symbols.
Move the text labels one by one to a position you like and click the Exit
in the Toolbar after you are satisfied with the result.

Editor button

ILWIS 3.0 Users Guide

499

Presentation of results
The text labels are displayed with the new font and font size. For more information of
using the Annotation Text editor, refer to the ILWIS Help.

Advanced users may prefer to edit an annotation text object in table form. This
may provide quicker, easier or more precise possibilities to edit texts, positions
and other settings like font, font sizes, colors, etc. To open an annotation text
object as a table, you can double-click the object in the Catalog or open the File
menu in the Main window, choose Open As Table and select an annotation text
object.

Adding grid lines

Grid lines are regularly spaced, horizontal and vertical on a map area, according to
the coordinate system linked to the map. In this exercise, grid lines are added to the
data layers in the map window.

From the Layers menu, select the Add Grid Lines command. The Display
Options - Grid dialog box is opened.

Type 5000 in the Grid Distance text box, accept Line Type Single and
select Yellow from the Color list box.

Click OK in the Display Options Grid dialog box. The grid lines are
added to the map window.

Saving as map view


Now you can save the map window with all data layers, the annotation text layer and
the grid lines in a map view.

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 .

500

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.

ILWIS 3.0 Users Guide

Presentation of results
Summary: Map views
- A map view contains the names of all layers to be displayed in one map window
including the display settings (the colors, widths, etc.) of these layers.
- Besides data layers (maps), you can also add annotation text objects, grid lines or
graticules to a map window. These layers can also be saved in the map view.
- The title that you give to a map view, is later visible in the Title bar of the map
window. If you save a map view when zoomed in on a map, the zoomed area will
be displayed when opening the map view.

ILWIS 3.0 Users Guide

501

Presentation of results

13.5 Layout and Annotation


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.). In the previous exercise you have
generated a map view (Landview ) containing the primary content (Landuse
polygon map), the secondary content (raster map Shadows , segment maps
Contour , Drainage and Roads , and point map Places ) and a supportive content
(annotation text labels (Place_labels) , grid lines). In this exercise you will see
how you can add other supportive content (annotation) by creating a layout.
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.
A layout may contain:
- 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;
- Texts;
- Boxes;
- Pictures and/or bitmaps.
For each map view, you can add in the layout:
- A legend for each layer in a map view;
- A scale bar and scale bar text;
- A north arrow;
- A map border, including coordinates and ticks for grid lines and or a graticule.
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,
502

ILWIS 3.0 Users Guide

Presentation of results
position, size and scale. In the Layout pane itself, the paper and its margins are
visible.

You can also start to create a layout by choosing the Create Layout command
from the File menu in the map view window or by clicking the right mouse button
on a map view in the Catalog and choosing Create Layout from the contextsensitive menu.

In this stage of creating a layout, you can change the Page Setup and choose Paper
Size, Orientation (Portrait or Landscape) and Margins. The page setup can still
be changed later, if needed. You will alter the Orientation of the paper into
Landscape now.

From the File menu of the Layout editor, select Page Setup. The Page
Setup dialog box is opened.

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


Inserting a map view
Map views are the primary contents of a layout (see section 13.4 for how to make a
map view). You can insert multiple map views in a single layout. In this exercise you
will only use one map view Landview .

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.

ILWIS 3.0 Users Guide

503

Presentation of results
In the Layout pane, you can position the map view by dragging it, size the map view
by dragging one of its size handles or zoom in into a specific area and/or pan to the
desired area.

In the Layout pane, click the map view Landview , hold down the mouse
button and drag the map view to the left side of the paper (see Figure 13.4).

Before you can size or pan you must deselect the Keep Scale option by
opening the View menu and deselecting Keep Scale or by clicking the
Keep Scale button
in the Standard toolbar (the button should appear
up). Try to size and/or pan the map view, but in the end make sure to display
the entire map.

The same operation can be carried out in the Layout Management pane. Select a
field in the Layer Management pane and edit the value of the field: position, size,
scale, etc.

In the Layout Management pane, click the Scale field of the map view
Landview .

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
in the Standard toolbar (the button should appear down).
Scale button

In principle, the scale of the map view is now fixed to 1:125000 . When the size
handles of a map view are dragged by accident, nothing will happen. When you make
the map view smaller by dragging its size handles to the inside the map view will
become smaller, but the scale on which the map view is displayed remains the same.
Only part of the map view will be shown.
You can still change the scale of the map view manually by typing a scale in the
Layout Management pane.
Creating a map border
With the Map Border option, you can add border information to a map, optionally
displaying: neat line graduation, grid and/or graticule ticks, grid coordinates, graticule and/or corner coordinates, map outline.
Here, you will add a neat line, grid ticks and grid coordinates to the map view.
504

ILWIS 3.0 Users Guide

Presentation of results

Make sure the map view Landview is selected in the Layout pane.

On the Grid tab, select the Grid Ticks check box and type 5000 for the
Interval and type 1.0 for the Tick Length.

Select the Grid Coordinates check box and type 5000 for the Interval.

From the Insert menu, select Map Border or click the Map Border button
in the Layout toolbar. The Edit Map Border dialog box is opened.

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 .

Select the legend box.

Repeat the previous steps to insert a legend for the Drainage and Road
data layers.

Accept the defaults for other display options by clicking the OK button. The
legend will be displayed in the Layout pane.
Drag the box to the right hand side of the layout (see Figure 13.4). Leave
some open space below the legend, so that the scale bar can be placed there.

ILWIS 3.0 Users Guide

505

Presentation of results

You can align the separate legend items by typing identical values for Left and/or
Top position in the Layer Management pane.

Save the layout before proceeding.

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.

Adding an inset map or picture


Graphics may be inserted into the layout. You can add pictures and/or bitmaps, which
have been copied to the Clipboard before and paste them in the layout (copy and
paste one by one). You can also insert picture and/or bitmap files. Pictures, also
called Windows Meta Files, have extension WMF; bitmaps have extension BMP.
First, a bitmap of Bolivia will be added to the map window.

506

From the Insert menu, select Bitmap/Picture or click the Bitmap/Picture


button
in the Layout toolbar. The Insert Bitmap or Picture dialog box
is opened.

Select the bitmap Bolivia and click OK. The Bolivia map is displayed in
the layout.

ILWIS 3.0 Users Guide

Presentation of results

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.

Open the file ITClogo.bmp in a drawing program (e.g. Microsoft Paint).

Close the Microsoft Paint program.

In Microsoft Paint, open the Edit menu and choose Select All.
Open again the Edit menu and choose the Copy command. The bitmap is
now copied to the Clipboard.

To paste the bitmap 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.

ILWIS 3.0 Users Guide

507

Presentation of results
The position of the text and the size of the text can be changed. The text box size can
be changed by dragging one of its size handles. You can size the text in both directions
by dragging the corner size handles of the text box. To change the position of the text:

Select the text box.


Drag the box and place it at the top, right of the map view (see Figure 13.4).
Save the layout before proceeding.

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.

Adding a north arrow


A north arrow points to the north of a map, based on the coordinate system or
georeference that is used by the maps in the map view. In the next step, a north arrow
is added to the layout.

508

Make sure the map view Landview is selected in the Layout pane.

Select Arrow Type Wing .

Position the arrow below the title of the map (see Figure 13.4).

From the Insert menu, select North Arrow or click the North Arrow button
in the Layout toolbar. The Edit North Arrow dialog box is opened.
Select Font Name: Times New Roman , Font Size: 14 and click OK. The
north arrow is displayed in the layout.
Resize the north arrow and make it smaller.
Save the layout.
ILWIS 3.0 Users Guide

Presentation of results
Adding a scale bar
Map scale is a ratio indicating the relationship between the distance on the map and
the distance on the ground. In ILWIS, the map scale can be expressed in the following ways:
- Graphically in the form of a scale bar
- As scale indication (e.g. 1:50000)

Make sure the map view Landview is selected in the Layout pane.

Select the Unit Indication check box.

Position the scale box below the land use legend (see Figure 13.4).

From the Insert menu, select Scale Bar or click the Scale Bar button
the Layout toolbar. The Edit Scale Bar dialog box is opened.

in

Select Font Name: Times New Roman , Font Size: 10 and click OK. The
scale bar is displayed in the map window.
Save the layout.

Adding scale text


The Scale Text option can be used to obtain a scale indication as text, e.g. below a
scale bar. For each map view in your layout, you can add a distinct scale indication.

Make sure the map view Landview is selected in the Layout pane.
From the Insert menu, select Scale Text or click the Scale Text button
in the Layout toolbar. The Edit Scale Text dialog box appears.

Select Font Name: Times New Roman , Font Size: 12 and click OK. The
scale text is displayed in the layout.

Position the scale box below the map view or below the scale bar and save
the layout.

Creating a box
Finally, you will add a box to the map window that encloses the entire map. Boxes
can be used to emphasize certain annotation (e.g. text, legend, etc.), highlight certain
areas, emphasize features, etc.

From the Insert menu, select Box or click the Box button
toolbar. The Edit Box dialog box is opened.

Accept the defaults by clicking the OK button. A box is added to the map.

in the Layout

Position the box close to the legend and resize it so that it encloses the whole
legend (see Figure 13.4).

ILWIS 3.0 Users Guide

509

Presentation of results

Repeat the steps to create a box for the entire layout. Make sure the box is
within the page margins.

Save the layout.

Editing map annotation


Existing annotation (map border, legend, picture, text, north arrow, scale bar, scale
text, box) can be edited by double-clicking an item. Grid lines or a graticule can not
be edited in the layout, but solely in a map window (see section 13.4).

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:

Select an Annotation layer and click on the Remove button


Standard toolbar.

in the

Summary: Layout and Annotation


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
(annotation like a legend, scale, north arrow, location map, etc.).
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 graduation, 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 representation used by that domain.
- An inset map, pictures or bitmaps: an inset map can be added as map view and pictures or bitmaps can be pasted from Clipboard or inserted from file.
510

ILWIS 3.0 Users Guide

Presentation of results
- Text: multiple lines of text (e.g. a title); select a font type and color for the created
text.
- North-arrow: showing the north orientation of a map from the georeference or
coordinate system that is used by a map view.
- Scale bar: adds a graphic scale (scale bar) to the layout. The type of scale bar, intervals, font and colors are user-defined.
- Scale text: to obtain a scale indication as text in the layout. For each map view in
your layout, you can add a distinct scale indication.
- Box: can be placed around an annotation item.
The total composition of map views and annotation on a certain paper size is stored
as a layout and can be printed.

ILWIS 3.0 Users Guide

511

Presentation of results

13.6 Printing a map


ILWIS enables you to produce paper copies of a layout, which contain one or more
map views and annotation. Paper copies can be created in black and white or color,
depending on the printer connected to your computer.
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.

Open the layout Landview .

Check whether the Paper Size A4 is selected.

From the File menu, select the Page Setup command. The Page Setup
dialog box is opened.
Still in the Page Setup dialog box, click the Printer button. The Page
Setup dialog box is opened. Make sure the correct printer is selected and
click OK.
Click OK in the Page Setup dialog box.
From the File menu, select the Print command. You can also use the Print
button
in the Standard toolbar. The layout is now printed.

If you change the paper size or orientation of the paper, you may have to
rearrange all items in the layout.

Summary: Printing maps


- ILWIS enables you to produce paper copies of a layout which contain map views
and annotation.
- Paper copies can be created in black and white or color, depending on the printer
you use.
- It is also possible to print only attribute data of a table.

512

ILWIS 3.0 Users Guide

Presentation of results

13.7 Exporting maps to cartographic software


In order to be able to use data generated in ILWIS in specialized cartographic
software, you might need to export your maps to an interchangeable file format. In
that case, you need to export all required data layers and create a final map
composition in the cartographic software package you are using.
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 doesnt 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.

Exporting point maps and segment maps is also quite simple.

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.

Repeat the operation for the segment map Drainage . Export it to

Select the Export Format: AutoCad.DXF , type the Output Filename:


Places and click OK. The point map Places is exported to DXF format.
Drainage.DXF

ILWIS 3.0 Users Guide

513

Presentation of results
For polygon maps the situation is more complex, due to topological differences
between a GIS and a cartographic system. In ILWIS there is only one segment as
boundary line between two polygons, while in most cartographic packages it is
assumed that each polygon is enclosed by boundary lines, so there are in fact two
lines forming the boundary of two polygons. During the conversion of a polygon map
to DXF format, each polygon will be made so that it is enclosed by boundary lines.

From the File menu of the Main window, select the Export command. The
Export dialog box is opened.

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 format.

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.

Summary: Exporting maps to cartographic software


- To use data generated in ILWIS in specialized cartographic software, you need to
export all required data layers to an interchangeable file format.
- Raster maps can be converted to Windows bitmap or TIFF format or to GeoTiff
format when coordinate information should be preserved.
- Vector files are mostly converted to AutoCad DXF format.

514

ILWIS 3.0 Users Guide

Presentation of results

13.8 Creating demos with ILWIS


Professional users will use a specialized program to give demonstrations, but to
some extend, you can also do some automatic display in ILWIS. Two possibilities are
described:
- Double-click Action in a map window,
- Slide Show in a map window.
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 doubleclicked. 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.
Make sure that:
- An attribute table is linked to the map.
- This attribute table has a column Action (column of domain string type).
- You have typed in this column file names inclusive of path and extension of the
map, table, GIF image, picture, sound or video, that should be opened when you
double-click a certain mapping unit or element.
- Windows knows which program should be used to open the map, table, sound
video, etc. This can be set in the File Types section in Windows Explorer. The
default Open action will be used to open the particular file type.
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.).
Demo example: Display of field-photos
In this exercise, you will learn how you can make a demo, using a number of scanned
photographs from the Cochabamba area, and a point map showing the locations
where the photos were taken, represented as red dots. When you double-click on a red
dot, the appropriate photo is shown. The photos were obtained through the scanning
of snapshots and slides, using a simple scanner. These files are available in TIF
format (Photo1.tif to Photo9.tif ). The locations where the photos were
approximately taken are stored in a point map.
ILWIS 3.0 Users Guide

515

Presentation of results
If you want to show the photos in ILWIS map windows then the first thing that
should be done is to import the TIF Files. If you just leave the TIFF files as they are
and use them straight away in an attribute table probably a program like PhotoShop,
PaintShop, Windows Paint or even Internet Explorer may be used to open the
pictures.

From the File menu of the Main window, select the Import, General Raster
command. The Import dialog box is opened.

Select the Import Format: Tagged Image File Format .TIF. The list
of TIF files appears in the list box.

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 window.

The next step is to create a map view for each photo. The advantage of a map view is
that it will be displayed without showing first a Display Options - dialog box, since
the display options are already stored in the map view. Another advantage of using
map views is that you can give each map view a descriptive title, which will be
shown on the Title bar. You can also switch off Display Options - dialog boxes in
the Preferences (available via the File menu in the Main window).

516

Open the map Photo1 . Select from the File menu the Save View command.
The Save View As dialog box is opened.

Type the Map View Name: Photo1 , and the Title: Country school in
the mountains .

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.

ILWIS 3.0 Users Guide

Presentation of results
Table 13.5:

Description of photos used in the demo.

View

Title

Photo1
Photo2
Photo3
Photo4
Photo5
Photo6
Photo7
Photo8
Photo9r

Country school in the mountains


Cochabamba seen from the Colina de San Sebastian
Indian village in the mountains
Llamas grazing in the mountains
Cochabamba by night
Transporting Chicha and Coca
Geologic fault
Central park of Cochabamba
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.

Click OK. You are back in the Display Options - dialog box.

Select the Font: Times New Roman , the Font style: Bold , and the Size:
12 .

Click OK. You are back in the Display Options Point Map dialog box.

In the Symbol dialog box, select the Symbol Type: Simple , the Symbol:
Circle , the Size: 4, the Fill Color: Red , Line Width: 1 and the Color:
Red .
Select the Text check box and press the Font button. The Font dialog box
appears.

Select the Text Color: Red and click OK in the Display Options - dialog
box. The point map is displayed.
Drag-and-drop raster map Shadows to the map window. The Display
Options dialog box is opened. Select the option Light and click OK. The
hillshading map is now also displayed in the map window.

From the File menu select the Save View As command. The Save View As
dialog box is opened.

Type the Map View Name: Photos , the Title: Photos from the
Cochabamba area and click OK.

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.

ILWIS 3.0 Users Guide

517

Presentation of results

In the Operation-tree of the Main window, expand the Create option and
double-click New Table. The Create Table dialog box is opened.

Enter the Table Name: Photos , select the Domain Photos and click OK.
The table is opened.

From the Columns menu in the table window, select the command Add
Column. The Add Column dialog box is opened.

Type the Column Name: Action , select the Domain String and click
OK.

Type the names of the map views in the column Action , including the
extension. So for the first record, with the domain item Photo1 , you type
Photo1.mpv in the column Action . Make sure that the name of the last
field in column Action reads: Photo9r.mpv. The extension .mpv stands
for map view.

Close the table window.

Make sure that the Attribute Table check box is selected, select the table
Photos and click OK.

Click the point map Photos with the right mouse button and select
Properties. The Properties sheet is opened.

Now all input data is ready, so you can do the actual demo.

Open map view Photos .

Double-click on any of the red dots, to see the map view of the photos. The
explanation of each photo is shown in the Title bar.

Make sure to close all map windows when you have finished the exercise.

From the Layers menu, select Double-Click Action and select the option:
Execute Action.

You can use this method also for segment, polygon or raster maps (domain type class
or ID) which have an attribute table where the files are listed that should be opened
with a double-click in the class or ID unit.
Creating a slide show
The second example of the preparation of a demo with ILWIS is the creation of a
slide show that can be used to display multi-temporal maps, in order to evaluate
changes through time. The operation Slide Show is meant for this purpose.
In a slide show, a map window shows multiple raster maps like a slide show. It is in
fact the same as repeatedly replacing the raster map in a map window, e.g. by
dragging the raster maps into the map window. The raster maps to be displayed must
all be stored in a map list.
518

ILWIS 3.0 Users Guide

Presentation of results

A map list is a container object and stores the names of a set of raster maps, for
example of the multi-spectral bands of a satellite image that you want to classify. A
map list may also store the names of several raster maps of a time series, which you
can display as a slide show.
In the slide show only one set of display options will be used. The defaults are based
on the first map in the map list. The parameters set for this map in the map list, also
define the display options for the other maps in the map list. So, a constraint of
using a slide show is that all maps in the map list must use the same domain and the
same georeference.
The Slide Show operation is useful for multi-temporal monitoring, where data
regarding a site is collected on more than one occasion. It can, for example, be used
for observing a series of satellite images of the same area in time, derived products
such as NDVI, or classified maps, such as land use maps. In this way you get a clear
view of the general changes in time.
In this example, you will work with multi-temporal maps showing the growth of the
city of Manizales, located in central Colombia, with a set of 7 maps from 1851 till
1989. In order to show these maps as a slide show, you should first create a map list,
containing the names of these maps.

From the File menu of the Main window, select the Create and the Map List
commands. The Create Map List dialog box is opened.

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 you can run the slide show.

Double-click map list Manizales in the Catalog.


In the map list, click the Open As Slide Show button
. The Display
Options - Raster Map dialog box is opened, with the display options for the
first map (M1851 ).

Accept the defaults and click OK. The Display Options - Map List dialog
box is opened. In this dialog box you can change the Refresh Rate, indicating how many times per minute the display will be changed.

Change the Refresh Rate to 30 and click OK.


Maximize the window, open the Options menu and select the option No
Zoom.

ILWIS 3.0 Users Guide

519

Presentation of results
Now the maps are displayed in the map window one by one, so that you can evaluate
the changes quite easily. You can change the refresh rate, to make the display slower
or more rapid.

When you have finished watching the slide show, close the map window.

Summary: Creating demos in ILWIS


- You can show ILWIS maps, a GIF image, a bitmap, play a sound or a video, etc.,
when a mapping unit is double-clicked in a map which has a domain class or a
domain ID.
- 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.

520

ILWIS 3.0 Users Guide

Index

3D

Details: 8
Distance: 304
Entire map: 18
ILWIS: 8
Keep scale: 504
Layout editor: 502
Border: 503
Box: 503
Graticule: 503
Grid Lines: 503
Legend: 503
Map view: 503
North arrow: 503
Picture/Bitmap: 503
Scale bar: 503
Scale text: 503
List: 8
Measure Distance: 19
Normal: 19
Options: 15
Pan: 18, 212
Record: 23
Zoom In: 18
Zoom Out: 18

3D: 405
Display: 405
Editor: 405
Model: 405
View: 388, 405, 410
Adding vector layers: 411
With raster draping: 410

A
ACE: 513
Action column: 515
Add
Annotation Text: 499
Data layer: 498
Grid lines: 500
Inset map or picture: 506
Text: 507
Affine transformation: 76, 81
Aggregate functions: 193
Anisotropic Kriging: 445
Anisotropy: 448
Annotation: 502, 510
Annotation Text: 499
ArcInfo .E00 format: 123
Area numbering: 352, 379
Areas: 28
Arithmetic operators: 178, 321
Aspect: 128, 365
Assignment symbol: 176, 318, 463
Attribute data: 13, 53, 71, 167
Attribute map: 293
AutoCad .DXF format: 123
Autocorrelation
Of point data: 424
Of raster maps: 454
Autocorrelogram: 425
Axis of anisotropy: 448

B
Bar graph: 494
Bicubic convolution: 246
Bilinear interpolation: 246
Binary filter: 356
Boolean statement: 288
Box: 509
Box classifier: 271
Break dependency link: 68
Button: 212, 304
Create: 14
Customize Catalog: 5

ILWIS 3.0 Users Guide

C
Calculating: 176, 302, 365, 397
Classified slope direction map: 365
Connectivity: 381
Distance with weights: 374
Distances: 375
Histogram: 219
Number of points: 302
Pocket line calculator: 177
Receiving cell map: 366
Segment density: 309
Slope shape: 397
With columns: 176
With value columns: 177
Catalog: 3, 58
Customizing: 5
Query: 58
Sort: 58
View: 58
Details: 58
List: 58
Cauchy-Schwarz inequality: 450
Check Up-to-date: 66
Check box: 15
Checking segments: 104
Class: 34, 37
Domain: 20, 34, 37, 486
Map colors: 487
Representation: 43

521

Index
Classification: 187, 262, 271
Box classifier: 271
Gaussian maximum likelihood classifier: 271
Minimum distance-to-mean classifier: 271
Minimum Mahalanobis distance classifier: 271
Post classification operations: 273
Supervised: 266
Unsupervised: 266, 275
Classify table: 296
Classifying data in a column: 187
CLFY function: 187, 300
Clipboard: 318, 458
Copy/paste information: 318
Clustered pattern: 420
Clustering: 275
Cochabamba: 26
Code consistency: 102
Codes: 39
CoKriging: 450
Color
Selector: 488
Sliders: 488
Color composite: 230
False color: 230
Interactive: 231
Permanent: 233
Pseudo natural: 230
Colors: 482
Assigning colors to a class map: 487
For maps with an ID domain: 495
Hints: 485
HSI color system: 482
RGB color system: 482
YMC color system: 482
Column: 176
Action: 515
Properties dialog box: 23
Column semi-variogram: 439
Column statistics: 189
Command line: 9, 318
Copy/paste: 318
Working from the: 458
Commands: 457, 459
Copying ILWIS objects: 459
Deleting ILWIS objects: 459
Help: 459
Opening or editing an ILWIS objects: 459
Complete spatial randomness: 420
Composed bar: 494
Concatenation operation: 195
Conditional function: 180, 324
Confidence interval: 443
Conformal transformation: 81
Conformality: 129

522

Connectivity operations: 381


Container objects: 30
Context-sensitive menu: 7
Contiguity: 381
Contour lines: 101, 390
Contrast enhancement: 217
Control points: 76
Conversion: 146, 376
Class or ID domain to value domain: 160
Color domain to value domain: 164
Distances to travel time: 376
Domain: 159, 164
ID domain to class domain: 159
Overview: 146, 164
Picture domain to class domain: 163
Picture domain to image domain: 163
Raster to vector: 156
Value domain to class or ID domain: 161
Vector to raster: 148
Coordinate system: 47, 73, 238
Types: 73
Coordinate transformation: 136
Coordinates: 73
Digitizer: 73
Map: 73
Copy from the command line: 318
Copying files: 459
Correlation length: 426
Counting filter: 358
Covariable: 450
Covariance: 252
Creating: 73, 144, 170, 401
Coordinate system: 73
Cross-section from a DEM: 414
Demo: 515
Georeference: 148
Label point file: 110
Layout: 502
Legend: 505
Map border: 504
Polygon map: 104, 111
Polygon map from a segment map: 144
Script: 458, 461, 463
Segment map from a polygon map: 146
Slide show: 518
Slope map: 401
Sub map of a raster map: 150
Table: 170
Cross variogram: 450
Cross operation: 340, 343
Cross-section: 388, 414
Crossing: 341
Class maps: 341
ID map and value map: 343

ILWIS 3.0 Users Guide

Index
Cubic convolution: 246
Customize segment editor: 97

D
Data: 28, 71, 146, 279
Add layer: 498
Analysis: 70
Attribute data: 53, 71
Combining layers: 498
Conversions: 146
Export: 513
Geographic: 70
Input: 70
Layer: 33
Management: 70
Objects: 30
Dependent: 64
Output: 70
Redundancy: 195
Retrieval: 279
Spatial data: 28, 71
Dead end in segment: 105, 108
Default values tab: 469
Defaults: 15
Definition symbol: 176, 318, 463
Deleting
Files: 459
Point: 87
Segment: 99
DEM: 387, 390
Demos: 515
Densify segment coordinates: 142
Density slicing: 262
Dependency: 60, 63, 332
Break: 68
Links: 60, 334
Dependent: 64, 155, 176
Columns: 176
Data objects: 64
Map: 155
Details View: 58
Determining flat areas in a DEM: 367
DFDX: 396
DFDY: 396
Dialog boxes: 14
Digital Elevation Model: 387, 390
Digital Terrain Model: 387
Digital Number: 209, 213
Digitizer: 71, 73
Control points: 80
Coordinates: 73, 76
Resolution: 71
Setup Wizard: 75

ILWIS 3.0 Users Guide

Digitizing: 71, 80
Contour lines: 101
In point mode: 88
In stream mode: 88
Points: 83, 85
Segments: 92
Dilation: 353
Directional filter: 227
Displaying: 31, 100, 206, 282, 405
3D: 405
Attribute data: 21, 282
Data to be used in the final map: 480
Feature spaces: 270
Geographic data: 13
Multiple images: 212
Results as graphs: 206
Satellite images: 211
Segments in different colors: 100
Vector and raster maps: 31
Distance: 304, 352
Between points: 304
Calculation: 352, 372, 373, 374
Inverse: 430
Limiting: 430
Nearest neighbour: 421
Operation: 372
Domain: 20, 32, 151, 187, 296
Class: 20, 34, 37, 486
Combinations: 151
Conversion: 159
Editor: 20, 38
Group: 187, 296
Identifier: 34, 37, 39, 487
Image: 32, 37, 210
Value: 35, 37, 40, 486
System-defined: 41
User-defined: 41
Double-click action: 515
Drainage density: 343
Drop-down list box: 14
DTM: 387

E
Editing: 86, 154, 172
Annotation: 510
Columns: 172
Points: 86
Polygons: 112
Raster maps: 154
Editor: 20, 85, 405
Domain Class: 20
Georeference 3D: 405
Script: 468
Ellipsoid: 126
Empirical semi-variogram: 436

523

Index
Entities: 13
Equidistant: 129
Equivalence: 129
ERDAS
GIS: 120
LAN: 120
Erosion: 353
Error map: 435, 441
Estimation
Kriging: 435, 441
Export
To Bitmap: 514
Maps: 513
Expressions: 457
Map and table calculation: 463
Extract boundaries: 146

F
False Easting: 130
False Northing: 130
Feature space: 270
Feature vector: 266
File Extensions: 460
Files
Copying: 459
Deleting: 459
Filter: 222, 223, 396
Binary: 353, 356
Counting: 353, 358
Directional: 227
Gradient: 223, 396
High pass: 223, 226
Laplace: 223, 226
Low pass: 223, 224
Majority: 274, 353
Rank order: 353, 356, 399
Smoothing: 353, 355
Spatial frequency: 222
Undef majority: 274, 354
User-defined linear: 358
Filtering: 352, 353
Filters
Applied on Digital Elevation Models: 395
Used to calculate internal relief: 399
Flow direction matrix: 366
Focal point: 406
Functions: 182, 324, 364, 474
Contiguity: 381
IFF function: 182, 324, 328, 335, 474
IFUNDEF function: 330
MinMax: 475
Neighbourhood: 364
Network: 381
Pre-programmed: 474

524

Proximity: 381
Random: 474
RND: 496
Seek: 381
Spread: 381
System-defined: 474
User-defined: 475

G
Gaussian maximum likelihood classifier: 271
Gearys c: 424
Geo-coding a raster image by resampling: 245
GeoGateway: 118
Geographic
Coordinate system: 126
Coordinates: 48
Data: 70
Geometric
Corrections and image referencing: 235
Distortions: 235
Georeference: 50, 236, 405
3D: 237, 405
Corners: 50, 236
Direct linear: 237
Orthophoto: 237
Tiepoints: 50, 236
Georeferencing: 236
A raster image using reference points: 238
Image-to-image: 242
Using corner coordinates: 236
Geostatistics: 417
GeoTiff format: 120
Glue
Raster maps: 151
Segment maps: 140
Goodness of Fit: 439
Gradient filter: 223, 396
Gradual representation: 486
Graphs: 206
Grid
Cells: 29
Lines: 500
Gridding: 417
Ground control points: 239
Ground truth: 267
Group domain: 187, 296

H
Hatching: 491
Haze correction: 217
Help: 9
High pass filter: 223, 226

ILWIS 3.0 Users Guide

Index
Hill shading map: 388, 395
Histogram: 217
Equalization: 217, 222
Of point maps: 302
Of polygon maps: 312
Of raster maps: 313
Of segment maps: 307
History: 3
HTML Help: 10
Hue: 484
Hypotenuse: 401

I
Identifier domain: 34, 39, 487
IDRISI
IMG: 120
IFF function: 328, 335
IFUNDEF function: 330
IKONOS: 120
ILWIS
Functions: 319
Help: 9
Icons: 11
Log file: 461
Objects: 11, 118
Extensions: 460
Image: 32
Arithmetics: 257
Classification: 262
Domain: 32
Enhancement: 217
Fusion: 258
Processing: 209
Ratios: 249
Image-to-image registration: 242
Import: 118, 174
Genuine: 118
Raster data: 119
Through General Raster import: 121
Through GeoGateway import: 120
Through ILWIS import: 119
Table Wizard: 174
Use As: 118
Vector data: 123
Through GeoGateway import: 124
Through ILWIS import: 123
Via GeoGateway: 118
Importing
Digital attribute data: 174
Digital data: 118
Indicator Kriging: 444
Input of Spatial data: 71
Insert Mode: 85
Intensity: 484

ILWIS 3.0 Users Guide

Intensity-Hue-Saturation (IHS): 258


Interactive slicing: 263
Intermediate point: 88, 29
Internal relief: 399
Interpolation: 245, 390, 428
Contour: 390
Nearest neighbour: 245
Intersection without node: 105, 109
Inverse distance: 430
Iterations: 368

J
Joining tables: 198, 200, 202, 203, 465

K
Kriging: 435
Anisotropic: 445
CoKriging: 450
Estimation: 435, 441
From raster: 456
Indicator: 444
Ordinary: 435
Simple: 443
Universal: 444

L
Laplace filter: 223, 226
Latitudes: 48
Layer management: 16, 33
Layout: 502
Adding
Box: 509
Inset map or picture: 506
Legend: 505
Map border: 504
Map view: 503
North arrow: 508
Scale bar: 509
Scale text: 509
Text: 507
Copy and paste via Clipboard: 506
Creating: 502
Editor: 502
Page Setup: 503
Toolbar: 503
Export to Bitmap: 514
Least Squares Fit: 191, 431
Colomn operation: 191
Graph: 191
Legend: 505
Limiting distance: 430
Line graph: 494

525

Index
Linear stretching: 217, 220, 265
Piece-wise: 265
Lines: 28
Link: 53
Map with a table: 53
Non-spatial: 53
Links: 334
Dependency links: 334
List View: 58
Log file: 461
Logical operators: 179, 323
Longitudes: 48
Low pass filter: 223, 224

M
Main window: 2
Catalog: 3
Command line: 9
Menu bar: 6
Navigator: 2
Object selection toolbar: 8
Operation-list: 6
Operation-tree: 6
Operations/Navigator pane: 6
Standard toolbar: 8
Status bar: 7
Title bar: 5
Majority filters: 274, 353
Make up-to-date: 66
Map: 29, 73, 126, 257, 307, 318, 365
Annotation: 502
Border: 504
Calculation: 257, 318, 463
Script example: 464
Confidence interval : 443
Coordinates: 73
Cross: 341
Displaying maps: 31
Editing raster maps: 154
Editing annotation: 510
Error: 435, 441
Exporting: 513
Hill shading: 388, 395
Point map: 29, 486
Polygon map: 29, 486
Printing: 512
Projections: 48, 126, 128
Azimuthal: 128
Conical: 128
Cylindrical: 128
Raster map: 29, 486
Referencing: 76, 81
Scale: 509
Segment map: 29, 486
Shadow: 388

526

Slope: 365, 388, 401


Aspect: 388
Convexity/concavity: 388
Direction: 365, 388
Steepness: 388, 397
Source: 155, 372, 374
Thiessen: 376
Travel time : 374
Unique identifier map: 307
Vector map: 29
View: 498
Add Annotation text layer: 499
Add Grid lines: 500
Add Layer: 498
Primary content: 502
Secondary content: 502
Supportive content: 502
Volume: 388
Weight: 372, 375
Window: 16
Layer Management pane: 16
Map viewer: 16
Scale box: 16
Map Calculation: 287, 321
And dependencies: 332
Formulas: 287, 321
Resulting in class or ID maps: 335
Resulting in value maps: 321
Masking vector data: 142
Master image: 242
Mathematical morphology: 353
Measurement operations
On point data: 302
On polygon maps: 312
On raster maps: 313
On segment maps: 307
Menu bar: 5
Meridians: 126
Message: 472
Minimum distance-to-mean classifier: 271
Minimum Mahalanobis distance classifier: 271
MinMax functions: 475
Mirror rotate: 152
Modes
Insert: 85
Move point: 85
Select: 85
Split/Merge: 90
Modelling
Semi-variogram: 438
Morans I: 424
Move point mode: 85

ILWIS 3.0 Users Guide

Index
Moving
A point: 86
Average: 430
Surface: 432
Multi-band
Images: 230
Operations: 249
Statistics: 252
Multi-spectral image classification: 266

N
Navigator: 2
NDVI, Normalized Difference Vegetation Index: 250
Nearest neighbour: 428
Distance: 421
Reflexive: 421
Nearest point interpolation: 428
Neighbourhood: 351
Functions: 364
Multiple neighbours: 363
Operations: 351
4-connected: 351
8-connected: 351
Connectivity: 351
Filtering: 353
Using map calculation: 361
Operators: 352
Single neighbour: 361
Nested IFF function: 328
Network function: 381
Node: 29, 88
Normalized Difference Vegetation Index (NDVI): 250
North arrow: 508
Nugget: 438

O
Object: 30
Collection: 118
Definition: 64
Definition file: 67
Extensions: 460
Properties: 60
Selection toolbar: 8
Types: 30
Objects: 30
Container objects: 30
Data objects: 30
Service objects: 30
Special objects: 30
Oblique: 128
Open as table: 483
Operation-list: 6
Operation-tree: 6

ILWIS 3.0 Users Guide

Operations: 140, 277, 317, 351


(Re)classification: 277
4-connected: 351
8-connected: 351
Area numbering: 379
Autocorrelation-semivariance: 454
Column semi-variogram: 439
Connectivity: 381
Contiguity: 381
Cross operation: 340, 343
Cross variogram: 450
Distance calculation: 372
Map calculation: 318, 463
Measurement: 277, 307, 312, 313
On polygon maps: 312
On raster maps: 313
On segment maps: 307
Neighbourhood: 278, 351, 361
Overlay: 277, 317
Retrieval: 277, 279
Spatial correlation: 424
Sub map: 140
Table calculation: 463
Variogram surface: 445
Operations/Navigator pane: 6
Operators: 178, 321, 352
Arithmetic: 178, 321
For class or ID columns: 181
Logical: 179, 323
Neighbourhood operator: 352
Practicing with operators and functions: 325
Relational: 179, 322
Option buttons: 15
Ordinary Kriging: 435

P
Page setup: 503, 512
Parallels: 126
Parameters tab: 468
Paste information from clipboard: 318
Path radiance: 217
Pattern
Analysis: 420
Clustered: 420
Random: 420
Regular: 420
PCI Geomatics: 118
PI: 477
Picture elements: 29, 209
Pie chart: 494
Piece-wise linear stretching: 217, 265
Pits in a DEM: 367
PIX format: 125

527

Index
Pixel: 29, 55, 155, 215, 279, 365
Editor: 155
Information window: 55, 279
Pixels and real world coordinates: 215
Point: 28, 84, 303, 392
Change position: 98
Deleting: 87
Density: 303
Digitizing: 85
Distance between points: 304
Editor: 84
Estimation: 435
In polygon operation: 305
Intermediate: 29, 88
Interpolation: 428
Moving average: 430
Nearest point: 428
Trend surface: 431
Map: 486
Visual variables: 492
Moving: 86
Pattern analysis: 420
Symbol: 493
Point mode: 88
Points as graphs: 494
Polygonization: 111
Polygon: 29, 104, 312
Editing: 112
Histogram: 312
Map: 104, 486
Unit hatching: 491
Post classification operations: 273
Predictand: 450
Presentation of results: 479
Principal components analysis: 254
Printing: 512
Layout: 512
Page setup: 512
Projections: 73, 130, 131, 247
Available in ILWIS: 131
Azimuthal: 131
Conformality: 129
Conical: 132
Cylindrical: 131
Dutch RD: 247
Equidistant: 129
Equivalence: 129
Lambert Azimuthal Equal Area: 130
Other: 132
UTM: 134
Propagation: 368
Properties: 129
Property sheet: 60
Proximity function: 381

528

R
Random function: 496
Range: 438
Range of influence: 426
Rank order filter: 356, 399
Raster: 29, 150
Data: 150
Management: 150
Map: 29, 486
Model: 29
To vector conversion: 156
Rasterization: 29, 148
Of a polygon map: 148
Reclassification: 287, 289, 293
Record View: 23
Reflexive Nearest Neighbour: 421
Regionalized variables: 417, 435
Regular pattern: 420
Relational operators: 179, 322
Release disk space: 67
Remotely sensed data
Remove false polygon: 107
Renumbering: 54
Representation: 43, 230
Class: 43
Colors: 482
Gradual: 486
System-defined: 45
Types: 44
Value: 44, 486
Resampling: 153, 236
Residuals: 77
Resolution of digitizer: 71
Retrieval: 279
Operations: 279
With a mask: 284
RGB transformation: 258
RND function: 496
Root Mean Square Error (RMSE): 235, 239
Rose diagrams: 309
Rotate: 152
Running scripts: 461, 471

S
Sample: 267
Set: 267
Statistics: 269
Sampling: 267
Saturation: 484
Scale
Bar: 509
Box: 16

ILWIS 3.0 Users Guide

Index
Factor: 449
Keep scale: 504
Text: 509
Scripts: 461
Correct script syntax: 461
Creating: 458, 461
Example
For Map Calculation: 464
For Table Calculation: 465
In scripts: 471
Parameters: 468
Running: 461, 471
Special language: 472
Scrolling: 212
Seek function: 381
Segment: 29, 88, 307, 390
Color: 491
Density: 309
Directions: 309
Editor: 97
Histogram: 308
Line
Type: 491
Width: 491
Map: 88, 307, 486
Digitizing: 88
Measurement operations: 307
Visual variables: 491
To raster conversion: 390
Select mode: 85
Self overlap: 105
Semi-variogram
Empirical: 436
Modelling: 438
Nugget: 438
Range: 438
Sill: 438
Service objects: 30
Setup digitizer: 75
Shadow map: 388
Sigma: 80, 235, 239
Sill: 438
Simple Kriging: 443
Slave image: 242
Slicing: 263, 264, 296
Slide show: 518
Slope: 365, 388
Aspect: 388, 403
Convexity/concavity map: 388
Direction: 365, 388, 403
Map: 401
Shape: 397
Steepness: 388, 397
Smoothing filter: 355

ILWIS 3.0 Users Guide

Snap tolerance: 97
Snapping: 88, 96
Source map: 372, 374
Spatial: 28, 71, 117, 222, 277, 317, 351
Autocorrelation: 424, 454
Correlation: 424, 436
Bidirectional: 424, 447
Omnidirectional: 424
Data: 13, 28, 71
Input: 71
Data analysis: 277, 317, 351
Advanced: 457
Geostatistical tools: 417
Neighbourhood and connectivity: 351
Overlay operations: 317
Data management: 117
Enhancement: 222
Frequency filters: 222
Special objects: 30
Spheroid: 126
Split bar: 22
Split/Merge mode: 90
Spread function: 381
Standard toolbar: 8
Statistics: 189, 190
On columns: 189
Pane: 22, 189
Using the command line: 190
Status bar: 7
Stream mode: 88
Stretching: 493
Sub map: 140
Surface
Moving: 432
Trend: 431
Variogram: 445
Symbol: 176, 318, 493
Assignment: 176, 318, 463
Definition: 176, 318, 463
Symbols as graphs: 494
System-defined: 41
Functions: 474
Representation: 45
Value domain: 41

T
Table: 170, 176, 346
Calculation: 176, 463
Formulas: 176
Script example: 465
Joining: 198, 465
Two-dimensional: 346
Window: 21

529

Index
Split bar: 22
Statistics pane: 22
Table viewer: 22
Text box: 14
Thiessen map: 376
Thiessen polygons: 428
Three dimensional view: 388
Title bar: 5
Toolbar
Object selection: 8
Standard: 8
Training phase: 267
Transformation: 76, 235
Affine: 76, 81
Conformal: 81
Transforming vectors: 138
Transverse aspect: 128
Travel time map: 374
Trend surface: 431
Truth tables: 329
Tunnel
Segments: 89, 143
Tolerance: 97
Two-dimensional table: 346

U
Undef majority filter: 274, 354
Undefined: 38, 328
Undo all changes: 85
Unique IDs: 307, 379
Universal Kriging: 444
Universal Transverse Mercator (UTM): 48, 134
Unsupervised classification: 275
User-defined: 41, 358
Coloring maps with an ID domain: 495
Functions: 475
Linear filters: 358
Value domains: 41
UTM: 134
Grid zone designations for the world: 135

V
Value: 35, 40, 177
Columns: 177
Domain: 35, 40
System-defined: 41
User-defined: 41
Representation: 44, 486

530

Variogram: 426
Cross: 450
Empirical: 436
Modelling: 438
Surface: 445
Vector: 28, 140
Data: 140
Management: 140
Masking: 142
Map: 29
Model: 28
Operations: 144
View: 405
3D view: 405
Angle: 406
Axis: 406
Point: 405
Record view: 23
Table view: 23
Visual variables: 486
Maps without a user-defined representation: 493
Point maps: 492
Segment maps: 491
Segment color, line type and line width: 491
Visualization
Multi-band images: 230
Single band images: 210
Volume
Cubes: 494
Map: 388
Voronoi Tesselation: 428

W
Weight
Factor: 375
Map: 372, 375
Windows: 119
Bitmap format (BMP): 119
Color dialog box: 489
WinTab: 75
Digitizer Setup Wizard: 76

Z
Zooming
In: 92, 211
Out: 211

ILWIS 3.0 Users Guide

You might also like