# The Mat hemat ics of GIS

Wolfgang Kainz

Wolfgang Kainz
Department of Geography and Regional Research
University of Vienna
Universitätsstraße 7, A-1010 Vienna, Austria
E-Mail: wolfgang.kainz@univie.ac.at
Version 2.1 (August 2010)

I
Cont ent s
0. Pref ace ............................................................................ XI
1. The St ruct ure of Mat hemat i cs ........................................ 1
1.1 Brief History of Mathematics ...................................................................... 2
1.2 Sub-disciplines of Mathematics................................................................... 2
2. Proposi t i onal Logi c .......................................................... 5
2.1 Assertion and Proposition ............................................................................ 6
2.2 Logical Operators ......................................................................................... 7
2.3 Types of Propositional Forms ...................................................................... 9
2.4 Applications in GIS .................................................................................... 11
2.5 Exercises ..................................................................................................... 11
3. Predi cat e Logi c .............................................................. 13
3.1 Predicates .................................................................................................... 14
3.2 Quantifiers .................................................................................................. 15
3.3 Quantifiers and Logical Operators ............................................................ 16
3.4 Compact Notation ...................................................................................... 17
3.5 Applications in GIS .................................................................................... 18
3.6 Exercises ..................................................................................................... 18
4. Logi cal I nf erence ........................................................... 19
4.1 Logical Arguments ..................................................................................... 20
4.2 Proving Arguments Valid in Propositional Logic .................................... 20
4.2.1 Proving Arguments Valid with Truth Tables ................................................................ 21
4.2.2 Proving Arguments Valid with Rules of Inference ....................................................... 21
4.3 Proving Arguments Valid in Predicate Logic ........................................... 22
4.4 Applications in GIS .................................................................................... 23
4.5 Exercises ..................................................................................................... 23
5. Set Theory ...................................................................... 25
5.1 Sets and Elements ...................................................................................... 26
5.2 Relations between Sets .............................................................................. 27
5.3 Operations on Sets ...................................................................................... 27
5.4 Applications in GIS .................................................................................... 29
5.5 Exercises ..................................................................................................... 30
6. Rel at i ons and Funct i ons ............................................... 31
6.1 Cartesian Product ....................................................................................... 32
6.2 Binary Relations ......................................................................................... 32
6.2.1 Relations and Predicates ................................................................................................ 33
6.2.2 Graphic Representation of Binary Relations ................................................................ 33
II

6.2.3 Special Properties of Relations ...................................................................................... 33
6.2.3.1 Equivalence Relation .............................................................................................................. 34
6.2.3.2 Order Relation ......................................................................................................................... 35
6.2.4 Composition of Relations ............................................................................................... 35
6.3 Functions .................................................................................................... 36
6.3.1 Composition of Functions .............................................................................................. 37
6.3.2 Classes of Functions ....................................................................................................... 37
6.4 Applications in GIS .................................................................................... 40
6.5 Exercises ..................................................................................................... 42
7. Coordi nat e Syst ems and Transf ormat i ons .................. 43
7.1 Coordinate Systems .................................................................................... 44
7.1.1 Cartesian Coordinate Systems ....................................................................................... 44
7.1.2 Polar Coordinate Systems .............................................................................................. 45
7.1.3 Transformations between Cartesian and Polar Coordinate Systems ........................ 45
7.1.4 Geographic Coordinate System ..................................................................................... 47
7.2 Vectors and Matrices ................................................................................. 47
7.2.1 Vectors ............................................................................................................................. 47
7.2.2 Matrices ........................................................................................................................... 51
7.3 Transformations ......................................................................................... 52
7.3.1 Geometric Transformations ........................................................................................... 52
7.3.1.1 Translation ............................................................................................................................... 52
7.3.1.2 Rotation .................................................................................................................................... 53
7.3.1.3 Scaling ...................................................................................................................................... 53
7.3.2 Combination of Transformations .................................................................................. 54
7.3.3 Homogeneous Coordinates ............................................................................................ 55
7.3.4 Transformation between Coordinate Systems .............................................................. 56
7.4 Applications in GIS .................................................................................... 57
7.5 Exercises ..................................................................................................... 58
8. Al gebrai c St ruct ures ..................................................... 59
8.1 Components of an Algebra ........................................................................ 60
8.1.1 Signature and Variety ..................................................................................................... 60
8.1.2 Identity and Zero Elements ............................................................................................ 61
8.2 Varieties of Algebras .................................................................................. 61
8.2.1 Group ............................................................................................................................... 62
8.2.2 Field ................................................................................................................................. 62
8.2.3 Boolean Algebra ............................................................................................................. 63
8.2.4 Vector Space .................................................................................................................... 63
8.3 Homomorphism ......................................................................................... 64
8.4 Applications in GIS .................................................................................... 65
8.5 Exercises ..................................................................................................... 66
9. Topol ogy ......................................................................... 67
9.1 Topological Spaces .................................................................................... 68
9.1.1 Metric Spaces and Neighborhoods ............................................................................... 68
9.1.2 Topology and Open Sets ................................................................................................. 69
9.1.3 Continuous Functions and Homeomorphisms ............................................................. 71
9.1.4 Alternate Definition of a Topological Space ................................................................ 72
9.2 Base, Interior, Closure, Boundary, and Exterior ....................................... 74
9.3 Classification of Topological Spaces ........................................................ 76
9.3.1 Separation Axioms .......................................................................................................... 76
III

9.3.2 Compactness .................................................................................................................... 78
9.3.3 Size .................................................................................................................................... 80
9.3.4 Connectedness ................................................................................................................. 81
9.4 Simplicial Complexes and Cell Complexes.............................................. 82
9.4.1 Simplexes and Polyhedra ............................................................................................... 82
9.4.2 Cells and Cell Complexes .............................................................................................. 83
9.5 Applications in GIS .................................................................................... 86
9.5.1 Spatial Data Sets ............................................................................................................. 87
9.5.2 Topological Transformations......................................................................................... 88
9.5.3 Topological Consistency ................................................................................................ 88
9.5.4 Spatial Relations ............................................................................................................. 90
9.6 Exercises ..................................................................................................... 91
10. Ordered Set s ................................................................ 93
10.1 Posets ........................................................................................................ 94
10.1.1 Order Diagrams ............................................................................................................ 94
10.1.2 Upper and Lower Bounds ............................................................................................ 95
10.2 Lattices ...................................................................................................... 96
10.3 Normal Completion ................................................................................. 97
10.3.1 Special Elements ........................................................................................................... 98
10.3.2 Normal Completion Algorithm .................................................................................... 99
10.4 Application in GIS ................................................................................. 101
10.5 Exercises ................................................................................................. 101
11. Graph Theory ............................................................. 103
11.1 Introducing Graphs ................................................................................ 104
11.1.1 Basic Concepts ............................................................................................................ 105
11.1.2 Path, Circuit, Connectivity ......................................................................................... 106
11.2 Important Classes of Graphs .................................................................. 107
11.2.1 Directed Graph ........................................................................................................... 107
11.2.2 Planar Graph .............................................................................................................. 107
11.3 Representation of Graphs ...................................................................... 108
11.4 Eulerian and Hamiltonian Tours, Shortest Path Problem .................... 110
11.4.1 Eulerian Graphs .......................................................................................................... 110
11.4.2 Hamiltonian Tours ...................................................................................................... 111
11.4.3 Shortest Path Problem ................................................................................................ 111
11.5 Applications in GIS ................................................................................ 111
11.6 Exercises ................................................................................................. 112
12. Fuzzy Logi c and GI S .................................................. 113
12.1 Fuzziness ................................................................................................ 114
12.1.1 Motivation .................................................................................................................... 114
12.1.2 Fuzziness versus Probability ...................................................................................... 114
12.2 Crisp Sets and Fuzzy Sets ...................................................................... 115
12.3 Membership Functions .......................................................................... 116
12.4 Operations on Fuzzy Sets ...................................................................... 118
12.5 Alpha-Cuts .............................................................................................. 122
12.6 Linguistic Variables and Hedges ........................................................... 122
12.7 Fuzzy Inference ...................................................................................... 123
IV

12.7.1 MAMDANI’s Direct Method ......................................................................................... 124
12.7.2 Simplified Method ....................................................................................................... 127
12.8 Applications in GIS ................................................................................ 129
12.8.1 Objective ...................................................................................................................... 129
12.8.2 Fuzzy Concepts ........................................................................................................... 129
12.8.3 Software Approach ..................................................................................................... 129
12.8.3.1 ArcInfo GRID ...................................................................................................................... 130
12.8.3.2 ArcMap Spatial Analyst ..................................................................................................... 130
12.8.3.3 ArcView 3.x ......................................................................................................................... 130
12.8.3.4 ArcGIS 9 Script ................................................................................................................... 131
12.8.4 Result ............................................................................................................................ 132
12.9 Exercises ................................................................................................. 132
13. Spat i al Model i ng ........................................................ 135
13.1 Real World Phenomena And Their Abstractions ................................. 136
13.1.1 Spatial Data And Information ................................................................................... 136
13.2 Concepts Of Space And Time ............................................................... 137
13.2.1 Pre-Newtonian Concepts Of Space And Time ......................................................... 137
13.2.2 Classical Concepts Of Space And Time .................................................................... 138
13.2.3 Contemporary Concepts Of Space And Time .......................................................... 139
13.2.4 Concepts Of Space And Time In Spatial Information Systems ............................... 139
13.3 The Real World And Its Models ........................................................... 140
13.3.1 Maps ............................................................................................................................. 140
13.3.2 Databases .................................................................................................................... 141
13.3.3 Space And Time In Real World Models .................................................................... 142
13.4 Real World Models And Their Representation .................................... 142
13.4.1 Database Design ......................................................................................................... 143
13.4.2 Spatial Data Models ................................................................................................... 144
13.4.2.1 Field-based Models ............................................................................................................. 145
13.4.2.2 Object-based Models .......................................................................................................... 146
13.4.3 Spatiotemporal Data Models ..................................................................................... 146
13.4.3.1 Space-Time Cube Model .................................................................................................... 147
13.4.3.2 Snapshot Model ................................................................................................................... 147
13.4.3.3 Space-Time Composite Model .......................................................................................... 147
13.4.3.4 Event-based Model ............................................................................................................. 148
13.4.3.5 Spatiotemporal Object Model ............................................................................................ 148
13.5 Summary ................................................................................................ 148
14. Sol ut i ons of Exerci ses .............................................. 149
15. Ref erenc es and Bi bl i ography .................................... 153
16. I ndex .......................................................................... 155

V
Li st of Fi gur es
Figure 1. Sub-disciplines of mathematics and their relationships ..................................... 3
Figure 2. Raster Calculator with logical connectors ........................................................ 11
Figure 3. VENN diagram .................................................................................................... 26
Figure 4. Non-commutativity of the Cartesian product ................................................... 32
Figure 5. Sample relations ................................................................................................. 34
Figure 6. Composition of relations ................................................................................... 36
Figure 7. Functions and relations ...................................................................................... 37
Figure 8. Topological relations ......................................................................................... 40
Figure 9. Spatial relations derived from topological invariants ....................................... 41
Figure 10. Map projections with singularities .................................................................. 41
Figure 11. Cartesian coordinate system in the plane ........................................................ 44
Figure 12. Cartesian coordinate system in 3-D space ...................................................... 44
Figure 13. Polar coordinate system in the plane .............................................................. 45
Figure 14. Spherical coordinate system ............................................................................ 45
Figure 15. Conversion between Cartesian and polar coordinates in the plane ............... 45
Figure 16. Conversion between Cartesian coordinates and spherical coordinates ......... 46
Figure 17. Geographic coordinate system ........................................................................ 47
Figure 18. Point vector ...................................................................................................... 48
Figure 19. Cross product of two vectors ........................................................................... 50
Figure 20. Scalar triple product ......................................................................................... 50
Figure 21. Translation ........................................................................................................ 52
Figure 22. Rotation ............................................................................................................ 53
Figure 23. Scaling .............................................................................................................. 54
Figure 24. Manual digitizing setup ................................................................................... 58
Figure 25. Raster calculator interface ............................................................................... 65
Figure 26. Open disk in
2
 .............................................................................................. 69
Figure 27. Neighborhood axioms ..................................................................................... 70
Figure 28. Continuous function ........................................................................................ 71
Figure 29. Example of a homeomorphic function ........................................................... 72
Figure 30. Equivalent approaches to the definition of a topological space, open sets and
neighborhoods and related theorems .......................................................................... 73
Figure 31. Interior (upper left), boundary (upper right), closure (lower left) and exterior
(lower right) of an open set ......................................................................................... 76
Figure 32. Separation axioms T
0
, T
1
, and T
2
.................................................................... 77
Figure 33. Separation axioms T
3
and T
4
........................................................................... 78
Figure 34. Relationship between separation characteristics of topological spaces ........ 78
VI

Figure 35. Simplexes of dimension 0, 1, 2, and 3 ............................................................ 82
Figure 36. Valid simplicial complex (left) and invalid simplicial complex (right) ........ 83
Figure 37. Unit balls and cells ........................................................................................... 84
Figure 38. Cell decomposition and skeletons ................................................................... 85
Figure 39. Construction of a CW complex ....................................................................... 86
Figure 40. Two-dimensional spatial data set as cell complex ......................................... 87
Figure 41. Topological mapping ....................................................................................... 88
Figure 42. Closed polygon boundary check ..................................................................... 89
Figure 43. Node consistency check .................................................................................. 90
Figure 44. Spatial relationships between two simple regions based on the 9-intersection91
Figure 45. Poset and corresponding diagram ................................................................... 95
Figure 46. Lower bounds .................................................................................................. 96
Figure 47. Normal completion lattice ............................................................................. 100
Figure 48. Normal completion ........................................................................................ 101
Figure 49. Geometric interpretation of new lattice elements ......................................... 101
Figure 50. The seven bridges of Königsberg ................................................................. 104
Figure 51. Graph of the Königsberg bridge problem ..................................................... 104
Figure 52. Complete graphs ............................................................................................ 105
Figure 53. Isomorphic graphs ......................................................................................... 106
Figure 54. Connected (G) and disconnected (H) graph ................................................. 107
Figure 55. Directed graphs .............................................................................................. 107
Figure 56. Planar graph ................................................................................................... 108
Figure 57. Dual graph ...................................................................................................... 108
Figure 58. Undirected and directed graph ...................................................................... 109
Figure 59. Membership functions for “short”, “average”, and “tall” ............................ 116
Figure 60. Linear membership function ......................................................................... 117
Figure 61. Sinusoidal membership function ................................................................... 117
Figure 62. Gaussian membership function ..................................................................... 118
Figure 63. Set inclusion ................................................................................................... 119
Figure 64. Fuzzy set union operators .............................................................................. 120
Figure 65. Fuzzy set intersection .................................................................................... 120
Figure 66. Fuzzy set and its complement ....................................................................... 121
Figure 67. Law of the excluded middle and law of contradiction for fuzzy set Average.121
Figure 68. Membership functions for Tall, Very Tall, and Very Very Tall ................. 123
Figure 69. Membership function for Tall and Not Very Tall ........................................ 123
Figure 70. Membership function for Tall and Slightly Tall .......................................... 123
Figure 71. Inference rule in MAMDANI’s direct method................................................ 124
VII

Figure 72. Fuzzy sets of the rules .................................................................................... 126
Figure 73. Fuzzy inference step 2 ................................................................................... 126
Figure 74. Fuzzy inference final result ........................................................................... 127
Figure 75. Simplified Method ......................................................................................... 127
Figure 76. Membership functions for flat and steep slope ............................................. 128
Figure 77. Membership functions for favorable and unfavorable aspect. .................... 128
Figure 78. Membership function for “high elevation” ................................................... 129
Figure 79. Analysis with a fuzzy logic approach (left) and a crisp approach (right) ... 132
Figure 80. Platonic solids as building blocks of matter ................................................. 138
Figure 81. Spatial modeling is a structure preserving mapping from the real world to a
spatial model. ............................................................................................................. 142
Figure 82. Data modeling from the real world to a database (digital landscape model),
and from there to digital cartographic models and analogue products for
visualization ............................................................................................................... 143
Figure 83. Two data layers in a field-based model ........................................................ 145
Figure 84. Layers in an object based model ................................................................... 146

IX
Li st of Tabl es
Table 1. Logical Connectors ............................................................................................... 7
Table 2. Truth tables for logical operators .......................................................................... 8
Table 3. Logical identities ................................................................................................. 10
Table 4. Logical implications ............................................................................................ 11
Table 5. Logical relationships involving quantifiers ........................................................ 17
Table 6. Rules of inference ................................................................................................ 21
Table 7. Rules of inference involving predicates and quantifiers ................................... 22
Table 8. Rules for set operations ....................................................................................... 28
Table 9. ArcInfo overlay commands ................................................................................ 29
Table 10. Properties of the Cartesian product ................................................................... 32
Table 11. Properties of interior, closure, and boundary of a set ...................................... 75
Table 12. Arc table for the arc-node structure .................................................................. 88
Table 13. Special elements and the closure operator in the normal completion............. 99
Table 14. Normal completion ........................................................................................... 99
Table 15. Characteristic function for height classes ....................................................... 116
Table 16. Membership values for the height classes...................................................... 116
Table 17. Rules for set operations valid for crisp and fuzzy sets .................................. 121
Table 18. Rules valid only for crisp sets ......................................................................... 121
Table 19. Operators for hedges ....................................................................................... 122
Table 20. Hedges and their models ................................................................................. 122
Table 21. Fuzzy inference step 1 .................................................................................... 126
Table 22. Data models and schemas in database design (the ANSI/SPARC architecture)144

XI

Yet there’s method in it.”
.
The Binary Bible of Saint \$ilicon
Logic and set theory can be regarded as the foundation of mathematics. Mathematics is
written in the language of logic, and set theory is the very fundament on which all
mathematical theories are built. Logic is not only the language of mathematics. It
appears also in programming languages as syntactic constructs to express propositions,
predicates, and to infer conclusions from given or assumed facts.
The purpose of this book is to provide the reader with the mathematical knowledge
needed when they have to deal with spatial information systems. Readers are expected to
have a general knowledge of high school mathematics. The use of computers and
software for the handling and processing of spatial data requires new contents such as
discrete mathematics and topology.
The book is structured into 13 chapters
Chapter 1 gives a brief overview of the structure of mathematics and how the different
mathematical disciplines are built on top of more fundamental ones. The next three
chapters deal with mathematical logic, the language and foundation of mathematics.
Propositional and predicate logic are presented as well as logical inference, the methods
of drawing logical conclusions from given facts.
Chapter 5 and 6 are an introduction into the basic notions of sets, set operations, relations,
and mappings. These two chapters together with the three chapters on logic represent the
foundation for the subsequent chapters dealing with mathematical structures.
The next chapter on coordinate systems and transformations builds the bridge between
the foundation and the more advanced chapters on mathematical structures. Much of
chapter 7 would normally be considered to belong either to (analytical) geometry or to
linear algebra.
Chapters 8 to 11 present the highly relevant subjects of algebra, topology, ordered sets,
and graph theory. These chapters address the mathematical core of many GIS functions
from data storage, consistency to spatial analysis.
Uncertainty plays an increasingly important role in GIS. Chapter 12 addresses fuzzy
logic and its applications in GIS. It shows how vague concepts can be formalized in
mathematical language and how they are applied to spatial decision making.
CHAPTER
0
Preface
XII THE MATHEMATICS OF GIS

Chapter 13 is a synthesis of the previous chapters together with some philosophical
considerations about a space and time. It shows that spatial modeling is built on solid
mathematics as well as that there are challenging and interesting philosophical questions
as to how to represent models of spatial features.
The book can be read in several ways as illustrated by the horizontal blocks in the
following diagram.
Chapter 1:
The St ruct ure of
Mat hemat ics
Chapter 2:
Propositional Logic
Chapter 3:
Predicat e Logic
Chapt er 4
Logical I nference
Chapter 7:
Coordinate Syst ems
and Transformat ions
Chapter 12
Fuzzy Logic
Chapt er 13:
Spat ial Modeling
Chapter 8:
Algebraic St ruct ures
Chapter 9:
Topology
Chapter 10
Ordered Set s
Chapt er 11:
Graph Theory
Chapter 5:
Set Theory
Chapter 6:
Relat ions and
Funct ions

Readers interested in the logical and set theoretic foundations might want to read chapters
2 to 4 and chapters 5 and 6, respectively. For someone with a particular interest in more
advanced structures chapters 8 to 11 will be of interest.
Chapters 7, 12, and 13 can be read individually without losing too much of the context.
The best way, of course, is to read all the text from chapter 1 to 13.
This book is work in progress and not every chapter or section is complete. The author
appreciates any comments and hints that might help to improve the text or its appearance.

Wolfgang Kainz
Vienna, August 2010

1

athematics is an activity that has been performed by humans since
thousands of years. The understanding of what mathematics is has
changed over the centuries. In the beginning, mathematics was
mainly devoted to practical calculations related to trade and land surveying. Over
the centuries, mathematics has become a scientific discipline with many
applications in all domains of life. This chapter gives a brief history of
mathematics and explains how the different theories and branches of mathematics
are rooted in logic and set theory.

CHAPTER
1
The St ruct ure of
Mat hemat ics

M
2 THE MATHEMATICS OF GIS

1.1 Bri ef Hi st or y of Mat hemat i cs
The first known cultures that actively performed mathematical calculations in ancient
history were the Sumerians, Babylonians, Egyptians, and the Chinese. In the beginning,
mathematics was always related to practical problems of commerce, trading and
surveying. This is the reason why the ancient cultures mainly developed practical
solutions for arithmetic and geometric problems.
In the fifth century before Christ, the ancient Greeks started to do mathematics for its own
sake, and to focus the scientific attention to mathematics as a science. The concept of
axioms and logical deduction was developed then. The first great example of this
approach is The Elements of EUCLID, the first textbook on geometry, which was valid
until the 19
th
century.
The Indians and Arabs further developed the number concept and trigonometry. In the
17
th
and 18
th
century, the concepts of calculus and analytical geometry were developed as
a consequence of the intensive studies in physics and natural sciences.
In the 19
th
century, mathematicians began to establish an axiomatic foundation of
mathematical theories. Starting from a minimal set of axioms statements (theorems) can
be derived whose validity can be formally established (proof). This axiomatic approach
has been applied since then to formalize mathematics. Logic and set theory play an
important role as the language and foundation principle, respectively.
1.2 Sub-di scipli nes of Mat hemat ics
Logic is a formal language in which mathematical statements are written. It defines rules
how to derive new statements from existing ones, and provides methods to prove their
validity.
Set theory deals with sets, the fundamental building block of mathematical structures, and
the operations defined on them. The notation of set theory is the basic tool to describe
structures and operations in mathematical disciplines.
Relations define relationships among elements of a set or several sets. These
relationships allow for instance the classification of elements into equivalence classes or
the comparison of elements with regard to certain attributes. Functions (or mappings) are
a special kind of relations.
Sets whose elements are in certain relationships to each other or follow certain operations
are mathematical structures. We distinguish between three major structures in
mathematics, algebraic, order, and topologic structures. In sets with an algebraic
structure we can do arithmetic, sets with an order structure allow the comparison of
elements, and sets with a topologic structure allow to introduce concepts of convergence
and continuity. Calculus is based on topology.
Often, sets carry more than one structure. The real numbers, for instance, carry an
algebraic, an order, and a topologic structure. Results from algebraic topology are used in
the theory of geographic information systems (GIS).
Figure 1 shows the sub-disciplines and their position in a general concept of mathematics
and the fundamental building blocks.
THE STRUCTURE OF MATHEMATICS 3

Structures
Algebraic Order Topological
Logic
Set Theory
Relations
Algebra
Ordered
Sets
Topology

Figure 1. Sub-disciplines of mathematics and their relationships
On top of the different structures and mixed structures, we find the many mathematical
disciplines such as calculus, algebra, and (analytical) geometry. The classical theories of
great importance in spatial data handling are (analytical) geometry, linear algebra, and
calculus. With the introduction of digital technologies of GIS other branches of
mathematics became equally important, such as topology, graph theory, and the
investigation of non-continuous discrete sets and their operations. The latter two fall
under the domain that is usually called finite or discrete mathematics that plays an
important role in computer science and its applications.

5

ropositional logic deals with assertions or statements that are either true
or false and operators that are used to combine them. Such statements
are called propositions. Any other statements for which we cannot
establish whether they are true or false are not the subject of logic. This chapter
explains the principles of propositional logic by introducing the concepts of
proposition, propositional variable, propositional form, and logical operators. The
translation of natural language into propositions and the establishment of their
truth-values with the help of truth tables are shown as well.

CHAPTER
2
Proposit ional Logic

P
6 THE MATHEMATICS OF GIS

2.1 Asser t i on and Proposi t i on
Propositional logic deals with statements that are either true or false. Here, we will only
deal with a two-valued logic. This is the logic on which most of the mathematical
disciplines are built, and which is used in computing (a bit can only assume two states, on
or off, one or zero).
Definition 1 (Assertion and Proposition). An assertion is a statement. If an assertion
is either true or false, but not both
1
, we call it a proposition. If a proposition is true, it
has a truth-value of true; if it is false, it has a truth-value of false. Truth-values are
usually written as true, false, or T, F, or 1, 0. In the following sections, we will use the
1-0 notation for truth-values.
Example 1. The following statements illustrate the concept of assertion, proposition and truth-
values. The following are propositions:
(1) “It rains.”
(2) “I pass the exam.”
(3) “3 + 4 = 8”
(4) “3 is an odd number and 7 is a prime number.”
Assertion (1) and (2) can be true or false. Proposition (3) is false, and (4) is true. The following
statements are not propositions:
(5) “Are you at home?”
(6) “Use the elevator!”
(7) “ 12 < + y x ”
(8) “ 6 = x ”
(5) and (6) are not assertions (they are a question and a command, respectively), and therefore they
cannot be propositions. (7) and (8) are assertions, but no propositions. Their truth-value depends
on the value of the variables x and y . Only when we replace the variables with some values, the
assertion becomes a proposition.
Often we have to be more general in writing down assertions. For this, we use
propositional variables and propositional forms.
Definition 2 (Propositional Variable). A propositional variable is an arbitrary
proposition whose truth-value is unspecified. We use upper case letters P, Q, R,… for
propositional variables.
We can combine propositions and propositional variables to form new assertions. For the
combination we use words such as “and”, “or”, and “not”.
Example 2. “Beer is good and water has no taste” is a combination of the two propositions
“Beer is good” and “Water has no taste” using the connector “and”. “P or not Q.” is a combination
of the propositional variables P and Q using the connectors “or” and “not”.

1
We call a logic in which assertions are either true or false a two-valued logic. The law of the excluded
middle characterized a two-valued logic.
PROPOSITIONAL LOGIC 7

2.2 Logi cal Operat ors
In the example above P and Q are called operands, the words “and”, “or”, and “not” are
logical operators, or logical connectives. An operator such as “not” that operates only on
one operand is called unary operator; those that operate on two operands such as “and”
and “or” are called binary operators.
Definition 3 (Propositional Form). A propositional form is an assertion that contains
at least one propositional variable. We use upper case Greek letters to denote
propositional forms, ( , , ) P Q u . .
When we substitute propositions for the propositional variables of a propositional form,
we get a proposition. When we use logical connectives to derive new propositions from
old ones, the truth-value of the new proposition depends on the logical connective and the
truth-values of the old propositions.
Example 3. When P stands for “Vienna is the capital of Austria” and Q stands for “Two is an
odd number” then the propositional form in Example 2 “P or not Q” becomes the proposition
“Vienna is the capital of Austria or two is an even number”.
Logical operators are used to combine propositions or propositional variables. Table 1
shows the most common operators.
Table 1. Logical Connectors
Logical Connector Symbol Read or written as
Conjunction . and
Disjunction v or
Exclusive or © either … or but not both
Negation ÷ not
Implication ¬ implies, if…then…
Equivalence · equivalent, …if and only if…, iff
2

To determine the truth-value for a combined statement we need to look at every possible
combination of truth-values for the operands. This is done using truth tables that are
defined for every operand. Table 2 shows the truth tables for the most common logical
operators. We use the symbols “0” for false and “1” for true.
Negation is a unary operator, i.e., it applies to one variable, and changes the truth-value
of a proposition. The other operators apply to two operands. The conjunction (or logical
and) is only true if both operands are true. The disjunction (or inclusive or) is true
whenever at least one of the operands is true. The exclusive or is only true if either one
or the other operand is true, but never both.
When we use the English term “or” we do not make explicit whether we mean the
inclusive or exclusive or. It usually follows from the context what we mean. In
mathematics, we cannot operate in this way. Therefore, we must make a distinction
between inclusive and exclusive or.
In the statement “I go to work or I am tired” the operator indicates an inclusive or. I can
go to work and I can be tired at the same time. However, when we say that “I am alive or
I am dead” we clearly mean an exclusive or. A person cannot be alive and dead at the
same time.
3

2
The term “iff” meaning “if and only if” is used only in written text.
3
We exclude here the possibility of being a zombie, a state of existence (the living dead) that appears
frequently in horror movies.
8 THE MATHEMATICS OF GIS

Table 2. Truth tables for logical operators
Conjunction Disjunction Exclusive or
0 0 0 0 0 0 0 0 0
0 1 0 0 1 1 0 1 1
1 0 0 1 0 1 1 0 1
1 1 1 1 1 1 1 1 0
Negation Implication Equivalence
0 1 0 0 1 0 0 1
1 0 0 1 1 0 1 0
1 0 0 1 0 0
1 1 1 1 1 1
P Q P Q P Q P Q P Q P Q
P P P Q P Q P Q P Q
÷ ¬ ·

In the implication P Q ¬ we call P the premise, hypothesis, or antecedent, and Q the
conclusion or consequence. The implication can be read in many different ways:
“If P , then Q ”
“ P only if Q ”
“ P implies Q ”
“ P is a sufficient condition for Q ”
“ Q if P ”
“ Q follows from P ”
“ Q provided P ”
“ Q is a logical consequence of P ”
“ Q whenever P ”
If Q P ¬ is an implication then P Q ¬ is called the converse and P Q ÷ ¬ ÷ is called
the contrapositive.
Example 4. Let us consider the implication “If it rains, then I get wet”. The converse of this
implication reads as “If I get wet, then it rains”, and the contrapositive is “If I do not get wet, then
it does not rain”.
In natural language, the implication expresses a causal or inherent relationship between a
premise and a conclusion. The statement “If I take a shower, then I will get wet” clearly
states a causal relationship between taking a shower and getting wet. The statement “If
this is an airplane, then it has wings” expresses a property of airplanes.
In propositional logic, there need not be any relationship between the premise and the
conclusion of an implication. We have to keep this in mind in order not to get confused
by some propositions.
Example 5. Let us take P to be “the moon is larger than the earth” and Q as “the sun is hot”.
The implication “If the moon is larger than the earth, then the sun is hot” is true, although there is
no relationship whatsoever between the two propositions. The implication is true because P is
false and Q is true. According to the truth table for implications, anything (either a true or a false
statement) can follow from a false proposition.
Two propositions that have the same truth-values are said to be logically equivalent.
Q P · can be read in different ways:
“ P is equivalent to Q ”
PROPOSITIONAL LOGIC 9

“ P is a necessary and sufficient condition for Q ”
“ P if and only if Q ”
“ P iff Q ”
The truth tables for logical operators are used to determine the truth-values of arbitrary
propositional forms. Whenever there are n propositional variables involved in a
propositional form, we have
n
2 possible combinations of true and false to investigate.
Example 6. The truth table for the proposition ) ( Q P ÷ . ÷ is constructed as:
( )
0 0 1 0 1
0 1 0 0 1
1 0 1 1 0
1 1 0 0 1
P Q Q P Q P Q ÷ .÷ ÷ .÷

We see that for two variables we have to investigate four different cases.
2.3 Types of Proposit ional For ms
In propositional logic, we distinguish certain propositional forms that are either always
true or always false, regardless of the truth-values of the propositional variables.
Definition 4 (Tautology, Contradiction, Contingency). A propositional form whose
truth-value is true for all possible truth-values of its propositional variables is called a
tautology. A contradiction (or absurdity) is a propositional form that is always false. A
contingency is a propositional form that is neither a tautology nor a contradiction.
The following examples illustrate the concepts of tautology, contradiction, and
contingency.
Example 7. The propositional form P Q P ¬ . ) ( is a tautology.
1 1 1 1
1 0 0 1
1 0 1 0
1 0 0 0
) ( P Q P Q P Q P ¬ . .

Example 8. The propositional form P P ÷ . is a contradiction.
0 0 1
0 1 0
P P P P ÷ . ÷

This is propositional form corresponds to the law of the excluded middle (also called “tertium non
datur” with its Latin name) stating that something cannot be and not be at the same time.
Example 9. The propositional form Q Q P ¬ ÷ v ) ( is a contingency.
( )
0 0 1 1 0
0 1 0 0 1
1 0 1 1 0
1 1 0 1 1
P Q Q P Q P Q Q ÷ v ÷ v ÷ ¬

10 THE MATHEMATICS OF GIS

Definition 5 (Logical Identity). Two propositional forms ,...) , , ( R Q P u and
,...) , , ( R Q P + are said to be logically equivalent when their truth tables are identical, or
when the equivalence ,...) , , ( ,...) , , ( R Q P R Q P + · u is a tautology. Such
equivalence is also called a logical identity.
We can replace one propositional form with its equivalent form. This helps often to
simplify logical expressions. Table 3 lists the most important logical identities.
Table 3. Logical identities
1. ) ( P P P v · idempotence of v
2. P) (P P . · idempotence of .
3. ) ( ) ( P Q Q P v · v commutativity of v
4. ) ( ) ( P Q Q P . · . commutativity of .
5. )] ( [ ] ) [( R Q P R Q P v v · v v associativity of v
6. )] ( [ ] ) [( R Q P R Q P . . · . . associativity of .
7. ) ( ) ( Q P Q P ÷ . ÷ · v ÷
DE MORGAN’s Laws
8. ) ( ) ( Q P Q P ÷ v ÷ · . ÷
9. )] ( ) [( )] ( [ R P Q P R Q P . v . · v . distributivity of . over v
10. )] ( ) [( )] ( [ R P Q P R Q P v . v · . v distributivity of v over .
11. ( ) Pv · 1 1
12. ( ) P P . · 1
13. ( ) P P v · 0
14. ( ) P. · 0 0
15. ( ) P P v ÷ ·1 law of the excluded middle
16. 0 ) ( · ÷ . P P
17. ) ( P P ÷ ÷ · double negation
18. ) ( ) ( Q P Q P v ÷ · ¬ implication
19. )] ( ) [( ) ( P Q Q P Q P ¬ . ¬ · · equivalence
20. )] ( [ ] ) [( R Q P R Q P ¬ ¬ · ¬ . exportation
21. P Q P Q P ÷ · ÷ ¬ . ¬ )] ( ) [( absurdity
22. ) ( ) ( P Q Q P ÷ ¬ ÷ · ¬ contrapositive
In the table, 1 and 0 denote propositions that are always true and false, respectively.
Identity 18 allows us to replace the implication by negation and disjunction. The
equivalence can be replaced by implications through identity 19. Identities 7 and 8 (DE
MORGAN’s laws) allow the replacement of conjunction by disjunction and vice versa. All
the identities can be proven by constructing their truth tables using the truth tables of the
logical operators established in Table 1 on page 7.
Example 10. Simplify the following propositional form: ) ( Q P ÷ ¬ ÷ ÷ .
The numbers on the right indicate the identities that have been applied to simplify the
propositional form
) ( Q P ÷ ¬ ÷ ÷ (22)
) ( P Q ¬ ÷ (18)
) ( P Qv ÷ ÷ (7)
P Q ÷ . ÷÷ (17)
P Q ÷ . (4)
Q P . ÷
PROPOSITIONAL LOGIC 11

Many useful tautologies are implications. Table 4 lists the most important of them.
Table 4. Logical implications
1. ) ( Q P P v ¬ addition
2. P Q P ¬ . ) ( simplification
3. Q Q P P ¬ ¬ . )] ( [ modus ponens
4. P Q Q P ÷ ¬ ÷ . ¬ ] ) [( modus tollens
5. Q Q P P ¬ v . ÷ )] ( [ disjunctive syllogism
6. ) ( )] ( ) [( R P R Q Q P ¬ ¬ ¬ . ¬ hypothetical syllogism
7. )] ( ) [( ) ( R P R Q Q P ¬ ¬ ¬ ¬ ¬
8. )] ( ) [( )] ( ) [( S Q R P S R Q P . ¬ . ¬ ¬ . ¬
9. ) ( )] ( ) [( R P R Q Q P · ¬ · . ·
Some of these implications correspond to rules of inference that will be discussed later.
2.4 Appl i cat i ons i n GIS
In GIS applications, we find logical operators mainly in spatial analysis and database
queries. Figure 2 shows the Raster Calculator of ArcMap Spatial Analyst with its logical
connectors. In this example, all raster cells with an elevation between 1,000 and 1,500
will be selected. The logical “and” connector is represented by the character “&”.
l ogi cal connect ors

Figure 2. Raster Calculator with logical connectors
The logical implication can be found in every programming language in the form of the
if-statement, which takes the general form
if <condition> then <statement> else <statement>
The condition contains an expression that can be evaluated as either true or false
(proposition). Logical connectors or comparison operators are often part of the condition.
The following AML program prompts the user for a coverage name and deletes it if it
exists.
&sv covername = [response ‘Enter a coverage name’]
&if [exists %covername%] &then
KILL %covername% ALL
&else
&type Coverage %covername% does not exist!
2.5 Exerci ses
Exercise 1 Construct the truth table of the propositional form P Q Q P ¬ . · ] ) [( .
12 THE MATHEMATICS OF GIS

Exercise 2 Show that ) ( ) ( Q P Q P v ¬ . is a tautology.
Exercise 3 Simplify the propositional form ) ( ) ( Q P Q P . ÷ v v ÷ .
Exercise 4 Let P be the proposition “It is raining.” Let Q be the proposition “I will get wet.” Let R be the
proposition “I am sick.”
(a) Write the following propositions in symbolic notation:
(i) If it is raining, then I get wet and I am sick.
(ii) I am sick if it is raining.
(iii) I will not get wet.
(iv) It is raining and I am not sick.
(b) Write a sentence in English that corresponds to the following propositions:
(i) Q R .
(ii) R Q P ÷ v ¬ ) (
(iii) ) ( Q R v ÷
(iv) ) ( ) ( Q R R Q ¬ . ¬
Exercise 5 Write down the converse and contrapositive of the following propositions:
(a) “If it rains, then I get wet.”
(b) “I will stay only if he leaves.”
(c) “I will not pass the exam, if I do not study hard.”
Exercise 6 For the following expressions, find equivalent expressions using identities. The equivalent
expressions must use only . and ÷ and be as simple as possible.
(a) R Q P ÷ v v
(b) ] ) [( P R Q P ¬ . ÷ v
(c) ) ( P Q P ¬ ¬
Exercise 7 In a computer program you have the following statement x ← y and FUNC(y,z) where x, y
are logical variables, FUNC is a logical function and z is an output variable. The value of z is
determined by the execution of the function FUNC. Optimizing compilers generate code that is
only executed when really needed. Assume such an optimized code has been generated for your
program. Can you always rely on that a value for z is computed?

13

he language of propositional logic is not powerful enough to make all
the assertions needed in mathematics. We frequently need to make
general statements about the properties of an object or relationships
between objects, such as “All humans are mortal” or the equation with two
variables “x + y = 2”.
This chapter introduces the concepts of predicates and quantifiers that enrich the
language of logic and allow making assertions in a much more general way than
what is possible in propositional logic. The knowledge acquired about predicates
will be used to translate natural language statements into the form of predicates.

CHAPTER
3
Predicat e Logic

T
14 THE MATHEMATICS OF GIS

3.1 Predi cat es
In the language of propositions we cannot make assertions such as “ 5 = + y x ” or “ y x s
”, because the truth-value of this statements depends on the values of the variables x and
y . Only when we assign values to the variables, the assertions become propositions.
We also make assertions in natural language like “Ann lives in Vienna” or “All humans
are mortal” that correspond to a general construct “ x lives in y ” or “all x and ( ) M x ”.
These constructs express a relationship between objects or a property of objects.
Definition 6 (Predicate). A term designating a property or relationship is called a
predicate.
Assertions made with predicates and variables become a proposition when the variables
are replaced by specific values.
Example 11. In the assertion “x lives in y” x and y are variables, and “lives in” is a predicate.
When we replace x by “John” and y by “Vienna” it becomes the proposition “John lives in
Vienna.”
Example 12. Predicates appear commonly in computer programs as control statements of high-
level programming languages. The statement “if x < 5 then y ← 2 * y” for instance
contains the predicate “x < 5”. When the program runs the current value of x determines the truth-
value of “x < 5”.
Some predicates have a well-known notation in mathematics. Examples are “equal to” or
“greater than” that are usually written as “=” and “>”, respectively. Otherwise, we will
denote predicates with upper case letters.
Example 13. The assertion “x is a woman” can be written as ( ) W x , “x lives in y” can be written
as ) , ( y x L , and “ z y x = + ” could be written as ) , , ( z y x S .
Definition 7 (Variables, Universe). In the expression ) , , , (
2 1 n
x x x P , P is a
predicate
4
, and the
i
x are variables. When P has n variables we say that it has n
arguments or it is an n-place predicate. Values for the variables must come from a set
called the universe of discourse, or the universe. The universe is normally denoted as
U and must contain at least one element.
When we take values
n
c c c , , ,
2 1
from the universe and assign them to the variables of a
predicate ) , , , (
2 1 n
x x x P , we get a proposition ) , , , (
2 1 n
c c c P .
Definition 8. If ) , , , (
2 1 n
c c c P is true for every choice of elements from the universe,
then we say that P is valid in the universe U. If ) , , , (
2 1 n
c c c P is true for some
elements of the universe, we say that P is satisfiable in the universe U. The values

4
To be precise, we must distinguish between predicate variables and predicate constants. Whenever we
use specific predicates, such as W, L or S in Example 13, we actually deal with predicate constants,
whereas an expression like P with no immediate interpretation of the predicate denotes a predicate
variable.
PREDICATE LOGIC 15

n
c c c , , ,
2 1
that make ) , , , (
2 1 n
c c c P true are said to satisfy P. If ) , , , (
2 1 n
c c c P
is false for every choice of values of the universe we say that P is unsatisfiable in U.
3.2 Quant i fi ers
We have seen that a predicate can become a proposition by substituting values for the
arguments. We say that the variables are bound. There are two ways of binding variables
of predicates.
Definition 9 (Binding of Variables). Variables of predicates can be bound by
assigning a value to them, or by quantifying them. We know two quantifiers, the
universal and the existential quantifier.
If ) (x P is a predicate then the assertion “for all x , ) (x P ” (which means, “for all values
of x , the assertion ) (x P is true”) is a statement in which the variable x is universally
quantified. The universal quantifier “for all” is written as ¬, and can be read as “for all”,
“for every”, “for any”, “for arbitrary”, or “for each.” The statement “for all x , ) (x P ”
becomes “ ) (x xP ¬ ”. We say that ) (x xP ¬ is true if and only if ) (x P is valid in U ;
otherwise, it is false.
If ) (x P is a predicate then the assertion “for some x , ) (x P ” (which means, “there exists
at least one value of x for which the assertion ) (x P is true”) is a statement in which the
variable x is existentially quantified. The existential quantifier “there exists” is written
as -, and can be read as “there exists”, “for some” or “for at least one”. The statement
“for some x , ) (x P ” becomes “ ) (x xP - ”. We say that ) (x xP - is true if and only if ) (x P
is satisfiable in U ; otherwise, it is false.
There is also a variation of the existential quantifier to assert that there is one and only
one element in the universe, which makes a predicate true. This quantifier is read as
“there is one and only one x such that…”, “there is exactly one x such that…” or “there
is a unique x such that…”. It is written as ! - .
Example 14. Let us assume the universe to be all integers  and the following propositions
formed by quantification:
(1) ] 1 [ x x x < ÷ ¬
(2) ] 5 [ = ¬ x x
(3) ] [ x y x y x > + ¬ ¬
(4) ] 1 [ + < - x x x
(5) ] 5 [ = - x x
(6) ] 1 [ + = - x x x
(7) ] 5 [ ! = - x x
Propositions (1), (4), (5), and (7) are true. Propositions (3) is false in the integers; however, it
would be true in the positive integers
+
 . Propositions (2) and (6) are false.
As we have seen above variables can be bound by assigning values to them. We can also
express quantified assertions with propositions by assigning all elements of the universe
to the variables and combining them with logical operators.
16 THE MATHEMATICS OF GIS

Definition 10. If the universe U consists of the elements , , ,
3 2 1
c c c , then the
propositions ) (x xP ¬ and ) (x xP - can be written as . . . ) ( ) ( ) (
3 2 1
c P c P c P and
v v v ) ( ) ( ) (
3 2 1
c P c P c P , respectively.
All variables must be bound to transform a predicate into a proposition. If in an n-place
predicate m variables are bound, we say that the predicate has n m ÷ free variables.
Example 15. The predicate ) , , ( z y x P representing “ z y x < + ” has three variables. If we bind
one variable, e.g., x is assigned the value 2, then we get the predicate ) , , 2 ( z y P with two free
variables, representing “ z y < + 2 ”.
The order in which the variables are bound is the same as the order in the quantifier list
when more than one quantifier is applied to a predicate. Therefore ) , ( y x yP x¬ ¬ has to
be evaluated as )] , ( [ y x yP x ¬ ¬ . The order of the quantifiers is not arbitrary. It affects the
meaning of an assertion. y x- ¬ has not the same meaning as x y¬ - . The only exception
is that we can always replace y x¬ ¬ by x y¬ ¬ , and y x- - by x y- - .
Example 16. If ) , ( y x P denotes the predicate “x is child of y” in the universe of all persons. Then
the proposition ) , ( y x yP x- ¬ means, “Everyone is the child of someone”, whereas ) , ( y x xP y¬ -
means, “There is a person so that everyone is the child of this person”.
3.3 Quant i fi ers and Logi cal Operat ors
When we express mathematical or natural language statements, we generally need
quantifiers, predicates and logical operators. These statements can take on a variety of
different forms.
Example 17. Let the universe be the integers and ) (x E denote “ x is an even number”, ) (x O “ x
is an odd number”, ) (x N “ x is a non-negative integer”, and ) (x P “ x is a prime number.” The
following examples show how assertions can be expressed in the language of predicate logic.
(a) There exists an odd integer. ) (x xO -
(b) Every integer is even or odd. )] ( ) ( [ x O x E x v ¬
(c) All prime numbers are non-negative. )] ( ) ( [ x N x P x ¬ ¬
(d) The only even prime number is two. ] 2 )) ( ) ( [( = ¬ . ¬ x x P x E x
(e) There is only one even prime number. )] ( ) ( [ ! x P x E x . -
(f) Not all prime numbers are odd. )] ( ) ( [ x O x P x ¬ ÷¬ , or )] ( ) ( [ x O x P x ÷ . -
(g) If an integer is not even, then it is odd. )] ( ) ( [ x O x E x ¬ ÷ ¬
In analogy to tautologies, contradictions and contingencies in propositional logic we can
also establish types of assertions involving predicate variables
5
.
Definition 11 (Validity of assertions with predicate variables). An assertion
involving predicate variables is valid if it is true for every universe. An assertion is
satisfiable if there exist a universe and some interpretations of the predicate variable that
make it true. It is unsatisfiable if there is no universe and no interpretation that make the
assertion true. Two assertions
1
A and
2
A are logically equivalent if for every universe

5
For the notion of predicate variable, see footnote 4 on page 14.
PREDICATE LOGIC 17

and every interpretation of the predicate variables
2 1
A A · , i.e.,
1
A is true iff
2
A is
true.
The scope of a quantifier is the part of the assertion for which variables are bound by this
quantifier.
Example 18. In the assertion )] ( ) ( [ x Q x P x . ¬ the scope of the universal quantifier is
) ( ) ( x Q x P . . In the assertion )] ( [ )] ( [ x xQ x xP ¬ ¬ - the scope of - is ) (x P and the scope of ¬
is ) (x Q .
Table 5 shows a list of logical equivalencies and other relationships between assertions
involving quantifiers.
Table 5. Logical relationships involving quantifiers
1.
2.
3.
4.
5.
6.
7. ] ) ( [ ] ) ( [ Q x P x Q x xP v ¬ · v ¬
8.
9. ] ) ( [ ] ) ( [ Q x P x Q x xP v - · v -
10.
11.
12. )] ( ) ( [ )] ( ) ( [ x xQ x xP x Q x P x - . - ¬ . -
13. )] ( ) ( [ )] ( ) ( [ x Q x P x x xQ x xP v - · - v -
The logical equivalencies (3) and (5) can be used to propagate negation signs through a
sequence of quantifiers.
Equivalencies (6), (7), (8) and (9) tell us that whenever a proposition occurs within the
scope of a quantifier, it can be removed from the scope of the quantifier. Predicates
whose variables are not bound by a quantifier can also be removed from the scope of this
quantifier.
Statements (10) and (12) show that the universal quantifier distributes over the
conjunction, but the existential quantifier does not. (13) and (11) show that the existential
quantifier distributes over the disjunction, but the universal quantifier does not.
3.4 Compact Not at i on
The form of logical notation as presented here is often too complex to express relatively
simple assertions in mathematical language. Therefore, a compact form of logical
notation is used.
For the assertion “for every x such that 0 > x , ) (x P is true” we would have to write
)] ( ) 0 [( x P x x ¬ > ¬ . Instead we can write in compact notation ) (
0
x P x
x>
¬ . In the same
way we write for the assertion “there exists an x such that 5 = x and ) (x P is true”
)] ( ) 5 [( x P x x . = - in the long notation and ) (
5
x P x
x=
- in the compact notation. This
notation allows also to propagate the negation sign through quantifiers as mentioned in
logical equivalencies (3) and (5) of Table 5 above.
universe the of element arbitrary an is where ), ( ) ( c c P x xP ¬ ¬
universe the of element arbitrary an is where ), ( ) ( c x xP c P - ¬
) ( ) ( x xP x P x ÷- · ÷ ¬
) ( ) ( x xP x xP - ¬ ¬
) ( ) ( x xP x P x ÷¬ · ÷ -
] ) ( [ ] ) ( [ Q x P x Q x xP . ¬ · . ¬
] ) ( [ ] ) ( [ Q x P x Q x xP . - · . -
)] ( ) ( [ )] ( ) ( [ x Q x P x x xQ x xP . ¬ · ¬ . ¬
)] ( ) ( [ )] ( ) ( [ x Q x P x x xQ x xP v ¬ ¬ ¬ v ¬
18 THE MATHEMATICS OF GIS

3.5 Appl i cat i ons i n GIS
In relational database technology, we use the select operator to select a subset of tuples t
(or records) in a relation that satisfies a given selection condition. In general, we can
denote the select operator as
selection condition
(relation name) o or
( )
( )
t
R
¢
o when we substitute
selection condition with ( ) t ¢ and R for the relation name. The selection condition is a
predicate, i.e., it designates a property of the tuples, and we can thus write the general
selection as a predicative set expression { | ( )} t R t ¢ e .
Let ARC(ID,StartNode,EndNode,LPoly,RPoly) be a relation schema describing
arcs in a topologically structured data set. The selection operator
(LPoly = 'A' OR RPoly = 'A')
(ARC) o results in all arcs that form the boundary of polygon A. A
translation of this selection into standard SQL reads as
SELECT * FROM ARC WHERE LPoly = 'A' or RPoly = 'A';
3.6 Exerci ses
Exercise 8 Translate the following assertions into the notation of predicate logic (the universe is given in
parentheses):
(a) If three is odd, some numbers are odd. (integers)
(b) Some cats are blue. (animals)
(c) All cats are blue. (animals)
(d) There are areas, lines, and points. (geometric figures)
(e) If x is greater than y and y is greater than z, then x is greater than z. (integers)
(f) When it is night all cats are black. (animals)
(g) When it is daylight some cats are black. (animals)
(h) All students of this course are happy if they pass the mathematics exam. (university students)

19

his chapter introduces the concept of a logical argument. Starting from
a set of premises (or hypotheses) a conclusion is drawn. If the
conclusion follows logically from the premises, the argument is valid. If
this is not the case then the conclusion cannot be drawn from the hypotheses.
In a formal mathematical system, we assume a set of axioms that are a set of
given unquestioned true statements. From these axioms, we derive assertions that
can be shown to be true. These assertions are called theorems. A proof is an
argument, which established the truth of a theorem.

CHAPTER
4
Logical Inference

T
20 THE MATHEMATICS OF GIS

4.1 Logi cal Argument s
Often we assume that certain assumptions are true, and we draw a conclusion from these
assumptions. If, for instance, we assume that the two statements “Lisa is beautiful” and
“If Lisa is beautiful, all men will adore Lisa” are true, then we can conclude that “All men
Definition 12 (Logical Argument). A logical argument consists of a set of hypotheses
(or premises) that are assumed true. The conclusion follows from the premises. Rules
of inference specify which conclusions can be drawn from assertions known or assumed
to be true. An argument is said to be valid (or correct) when the conclusion follows
logically from the premises.
Logical arguments are usually written is the form of
Q
P
P
P
n

.
2
1

where the
i
P are the premises and Q is the conclusion.
Example 19. The argument presented above is written as

P
1
: Lisa is beautiful
P
2
: If Lisa is beautiful, all men will adore Lisa.
Conclusion: All men will adore Lisa.

The rule of inference applied is of the form

Q
Q P
P

¬

4.2 Provi ng Argument s Val i d i n Proposi t i onal Logi c
In general, arguments can be proven valid in two ways, using truth tables or using rules of
inference. In the first case, an argument has to be translated into its equivalent
tautological form. The procedure is straightforward:
(i.) Identify all propositions.
(ii.) Assign propositional variables to the propositions.
(iii.) Write the argument in its tautological form using the propositional variables.
(iv.) Evaluate the tautological form using a truth table.
Note, that the more propositions are involved the more tedious the procedure becomes.
In the case of applying rules of inference, the trick is to find the right rules and apply
them properly.
LOGICAL INFERENCE 21

4.2.1 Proving Argument s Valid wit h Trut h Tables
Every logical argument with n premises
n
P P P , , ,
2 1
. and the conclusion Q can be
written as a propositional form Q P P P
n
¬ . . . ) (
2 1
. If this propositional form is a
tautology, the argument is correct.
Example 20. The argument in Example 19 above contains the propositions P “Lisa is beautiful”
and Q “all men adore Lisa”. It has the tautological form Q Q P P ¬ ¬ . )] ( [ . The proof that this
is a tautology is left to the reader.
4.2.2 Proving Argument s Valid wit h Rules of Inference
A second way to prove an argument valid is to apply rules of inference. They are applied
to the premises until the conclusion follows (argument valid) or the conclusion cannot be
reached (argument invalid). Table 6 shows the most important rules of inference, their
tautological form and the name that was given to them by logicians.
Table 6. Rules of inference
Rule of inference Tautological form Name
Q P
P
v

) ( Q P P v ¬ addition
P
Q P

.

P Q P ¬ . ) ( simplification
Q
Q P
P

¬

Q Q P P ¬ ¬ . )] ( [ modus ponens
P
Q P
Q
÷
¬
÷

P Q P Q ÷ ¬ ¬ . ÷ )] ( [ modus tollens
Q
P
Q P

÷
v

Q P Q P ¬ ÷ . v ] ) [( disjunctive
syllogism
R P
R Q
Q P
¬
¬
¬

] [ )] ( ) [( R P R Q Q P ¬ ¬ ¬ . ¬ hypothetical
syllogism
Q P
Q
P
.

) ( ) ( Q P Q P . ¬ . conjunction
S Q
R P
S R Q P
v
v
¬ . ¬ ) ( ) (

] [ )] ( ) ( ) [( S Q R P S R Q P v ¬ v . ¬ . ¬ constructive
dilemma
R P
S Q
S R Q P
÷ v ÷
÷ v ÷
¬ . ¬ ) ( ) (

] [ )] ( ) ( ) [( R P S Q S R Q P ÷ v ÷ ¬ ÷ v ÷ . ¬ . ¬

destructive
dilemma
Some of these rules of inference are evident. The disjunctive syllogism, for instance,
simply says that if you have two options and you know that one is not available, then you
choose the other one
6
.
Example 21. The argument presented in Example 19 above is a straightforward application of
the modus ponens.

6
Most people would agree that even dogs or cats know this.
22 THE MATHEMATICS OF GIS

Example 22. In the same way as above the argument that “Women do not run after me”, and “If
I were attractive all women would run after me”, therefore “I am not attractive” is a
straightforward application of the modus tollens.
4.3 Provi ng Argument s Val i d i n Predi cat e Logi c
When we want to prove the validity of an argument that contains predicates and
quantifiers, we need more rules. Table 7 shows some of the rules of inference involving
predicates and quantifiers.
Table 7. Rules of inference involving predicates and quantifiers
Rule of inference Name
) (
) (
c P
x xP

¬

universal instantiation
) (
) (
x xP
x P
¬

universal generalization
) (
) (
c P
x xP

-

existential instantiation
) (
) (
x xP
c P
-

existential generalization
The universal instantiation allows us to conclude from the fact that if a predicate is valid
in a given universe, then it is also valid for one individual from that universe. The
universal generalization permits us to conclude that if we can prove that a predicate is
valid for every element of the given universe, then the universally quantified assertion
holds.
The existential instantiation concludes from the truth that there is at least one element of
the universe for which the predicate is true, that there is one element c for which ) (c P is
true. The existential generalization allows us to conclude from the truth that a predicate
is true for one particular element of the universe, that the existentially quantified assertion
) (x xP - is true.
Example 23. Let us consider the following argument:

Every man has a brain.
John Williams is a man.
Therefore, John Williams has a brain.

Let ) (x M denote the assertion “x is a man”, ) (x B denote the assertion “x has a brain”, and W
denote John Williams. Then the logical argument can be expressed as:

) ( . 3
) ( . 2
)] ( ) ( [ . 1
W B
W M
x B x M x

¬ ¬

A formal proof of the argument is as follows:

Assertion Reasons
1. )] ( ) ( [ x B x M x ¬ ¬ Hypothesis 1
2. ) ( ) ( W B W M ¬ Step 1 and universal instantiation
3. ) (W M Hypothesis 2
4. ) (W B Steps 2 and 3 and modus ponens
LOGICAL INFERENCE 23

We do not go deeper into the theory of proving arguments in general predicate logic.
4.4 Appl i cat i ons i n GIS
Rule-based systems apply rules to data provided using an inference engine. These
systems are also called expert systems, and are widely applied in the geosciences. Spatial
decision support systems (SDSS) are rule-based systems that are designed and tuned for
spatial data.
Rules are stored as implications in the form “if <premise> then <consequence>”. The
inference engine examines the given data in the database and determines if they match a
given premise. If this is the case, the consequence is applied accordingly. This is a
straightforward application of the modus ponens.
4.5 Exerci ses
Exercise 9 Translate the following argument into a symbolic notation and check if it is correct:
P1: If I study well, I will not fail in the mathematics exam.
P2: If I do not play soccer, I study.
P3: I failed the mathematics exam.
Conclusion: I played soccer.
Exercise 10 Translate the following argument into a symbolic notation and check if it is correct using a truth
table:
P1: If the Earth is a disk then I do not reach the USA.
P2: If I travel west then I reach the USA.
P3: I do not travel west and I reach the USA.
Conclusion: The Earth is not a disk.
Exercise 11 Translate the following argument into a symbolic notation and check if it is correct:
P1: If 6 is not even, then 5 is no prime number
7
.
P2: 6 is even.
Conclusion: 5 is a prime number.

7
A prime number is any natural number n that can only be divided by 1 and n.

25

ets are the very fundamental building block of many mathematical
theories. They are intuitively perceived as a collection of well-
distinguished objects. A formal definition and axiomatic foundation of
set theory is more complicated and will not be discussed here.
Starting from an intuitive definition of sets, we explore relations between sets and
operations on sets. The fundamental principles of subset and set equality as well
as set union, intersection, and difference are explained.

CHAPTER
5
Set Theor y

S
26 THE MATHEMATICS OF GIS

5.1 Set s and Element s
Set theory was developed by GEORG CANTOR (1845-1918) as what we call today naïve
set theory. This is a more intuitive approach than the axiomatic set theory. However, in
naïve set theory there is the possibility for logical contradictions (or paradoxes),
something that should not occur in a formal system.
Definition 13 (Set). A set is a collection of well-distinguished objects. Any object of
the collection is called an element or a member of the set. An element x of a set S is
written as S x e . If x is not a member of S we write S x e . If a set has a finite
number of elements we call it a finite set. A set with no elements is called the empty,
null or void set and is denoted as {} or C.
There are many ways to specify a set. A finite set can be specified explicitly by listing all
its elements. The set A consisting of the natural numbers smaller than 10 can be written
as } 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 { = A , or we can describe the set implicitly by means of a predicate
and a free variable, { | 10} A x x x = e . <  . We can also draw a set with a VENN diagram
(Figure 3).

Figure 3. VENN diagram
In order to indicate the “size” of a set we need a measure. This is defined as the number
of elements (or cardinality).
Definition 14 (Cardinality). The cardinality of a set S is the number of its elements,
written as | | S .
Example 24. The set alphabet} English the of character a is | { x x A = has cardinality 26 | | = A .
Example 25. The natural numbers  are an infinite set. Their cardinality is denoted as
0
×

(pronounced as aleph zero
8
). Every set S that has the same cardinality as the natural numbers is
called countably infinite.
9
The proof is usually established by finding a one-to-one function that
maps the natural numbers to S .
Example 26. The cardinality of the integers  and the rational numbers  is
0
× . The rational
numbers  are all fractions of the form
a
b
where , a be.
Example 27. The cardinality of the real numbers  is denoted as c (the continuum). They are
said to be uncountable infinite. There are more real numbers than rational numbers. An there are
more rational numbers than integers.

8
Aleph is a character in the Hebrew alphabet.
9
A set is finite if there exists a one to one correspondence between its elements and a subset of the
natural numbers for some (including for the empty set). A set is countable if it is
either finite or countably infinite.
A
{1, 2, , } n . n 0 n =
SET THEORY 27

Example 28. The cardinality of the set {1,1, 2, 2, 2, 3} A = is 3, because the elements of a set must
be distinguishable. In A , element 1 appears twice, 2 appears three times, and 3 appears once.
Since it does not matter how often an element is repeated, the number of elements is three.
Example 29. The set { } A = C has one element, the empty set. Therefore, its cardinality is 1.
Although the empty set has cardinality zero, here it appears as an element of set A .
5.2 Rel at i ons bet ween Set s
We know two relations between sets, subset and equality. The subset relation refers to
the containment of one set in another.
Definition 15 (Subset). If each element of a set A is an element of a set B then A is
subset of B , written as B A_ . B is called superset of A, written as A B _ . We call
a set A a proper subset of B when B Ac and B A= .
Two sets A and B are equal written as B A= if and only if B Ac and A B c .
The following statements can be derived from the definitions of sets and their
relationships:
(i.) If U is the universe of discourse, then U A c .
(ii.) For any set A, A Ac .
(iii.) If B Ac and C B c , then C A c .
(iv.) The empty set is subset of every set, or for any set A, A c C .
5.3 Operat i ons on Set s
In the following, we consider operations on sets that use given sets (operands) to produce
a new set (resultant).
Definition 16 (Union). The union of two sets A and B , written as B A is the set
} | { B x A x x B A e v e = .
Definition 17 (Intersection). The intersection of two sets A and B , written as B A·
is the set } | { B x A x x B A e . e = · . If C = · B A , we say that the two sets are
disjoint.
Definition 18 (Difference). The difference of two sets A and B , written as B A÷ (or
B A \ ) is the set } | { B x A x x B A e . e = ÷ .
Definition 19 (Complement). The complement of a set A, written as A, is the set
} | { A x x A U A e = ÷ = , where U is the universe of discourse.
Example 30. The following Venn diagram illustrates the operations C B A · .
28 THE MATHEMATICS OF GIS

Union and intersection can generally be defined for more than two sets. Let I be an
arbitrary finite or infinite index set. Every element I i e has assigned a set
i
A , then the
union of the
i
A is defined as ]} [ | {
i
I i
i
A x I i i x A e . e - =
e
¸
. In the same way we define
the intersection of the
i
A as ]} [ | {
i
I i
i
A x I i i x A e ¬ e ¬ =
e
¸
.
Table 8 summarizes some of the most important rules for set operations. They can be
easily proven by translating them into their equivalent form in the language of logic.
Table 8. Rules for set operations
1.
A A A =

2.
A A A = ·

3. ) ( ) ( C B A C B A =
associativity
4. ) ( ) ( C B A C B A · · = · ·
5.
A B B A =
commutativity
6.
A B B A · = ·
7. ) ( ) ( ) ( C A B A C B A · = ·
distributivity
8. ) ( ) ( ) ( C A B A C B A · · = ·
9.
B A B A · =
DE MORGAN’s law
10.
B A B A = ·
11. A A = C
12. A U A = ·
13. U U A =
14. C = C · A
15.
U A A =

16.
C = · A A

17.
A A =

18.
C = U

19.
U = C

20.
A B A c ÷

21.
If B Ac and D C c then ) ( ) ( D B C A c

22.
If B Ac and D C c then ) ( ) ( D B C A · c ·

23.
B A A c

24.
A B A c ·

25.
If B Ac then B B A =

26.
If B Ac then A B A = ·

27. A A = C ÷
28. C = ÷ · ) ( A B A
29. B A A B A = ÷ ) (
30. ) ( ) ( ) ( C A B A C B A ÷ · ÷ = ÷
31. ) ( ) ( ) ( C A B A C B A ÷ ÷ = · ÷
U
C
A B
C
SET THEORY 29

Another important concept in set theory is to look at the subsets of a given set. This leads
to the definition of the power set.
Definition 20 (Power Set). The set of all subsets of a set A is the power set of A,
denoted as ) (A ¸ .
If a set is finite, the power set is finite; if a set is infinite, the power set is infinite. The
power set of a set with n elements has
n
2 elements.
Example 31. The power set of } 3 , 2 , 1 { = A with three elements has 8 2
3
= elements and is written
as }} 3 , 2 , 1 { }, 3 , 2 { }, 3 , 1 { }, 2 , 1 { }, 3 { }, 2 { }, 1 { , { ) ( C = ¸ A . Note that the empty set and the set itself are
always elements of the power set.
5.4 Appl i cat i ons i n GIS
Overlay operations are among the most common functions that a GIS provides for spatial
analysis. Since spatial features such as points, arcs and polygons can be regarded as sets,
overlay operations correspond to set intersection, union, difference, and complement.
Table 9 shows the basic ArcInfo overlay commands and the corresponding set operations
in mathematical notation. Other ArcInfo functions such as CLIP, UPDATE, and
IDENTITY are based on combinations of overlay and graphical clip operations.
Table 9. ArcInfo overlay commands
Command A B Set Operation
ERASE in cover erase cover A B ÷
INTERSECT in cover intersect cover A B ·
UNION in cover union cover A B
Normally, it does not matter in which sequence we apply overlay operations of the same
type. The associative and commutative laws for set operations allow the application of
intersection and union in arbitrary order.
The distributive laws can be used to simplify spatial overlay operations by reducing the
number of operations. For example, if we have three data sets A, B and C. We need the
intersection of A and B and the intersection of A and C, and finally, compute the union of
the results. These operations amount to the following set operations ( ) ( ) A B A C · · .
This would need three overlay operations. However, the distributive law of set operations
allows us to reduce the number of operations to two as ( ) A B C · .
When we deal with polygon features in a GIS, we always have an embedding polygon
that contains all features of our data set (or coverage). Often it is called world polygon.
In set theoretic terms, this corresponds to the universe of discourse
10
.

10
In Chapter 9 we will se that also for topological reasons we need an embedding space for the cell
complex of spatial features.
30 THE MATHEMATICS OF GIS

5.5 Exerci ses
Exercise 12 Highlight in the following VENN diagram B A· .

Exercise 13 Highlight in the following VENN diagram ) ( C B A · .

Exercise 14 Highlight in the following VENN diagram B A .

Exercise 15 Specify the power set for each of the following sets:
(a) } , , { c b a
(b) }} { }, , {{ c b a
(c) } {C
Exercise 16 Let } , , , , , , { g f e d c b a U = be the universe, } , , , , { e d c b a A = , } , , , { g e c a B = and } , , , { g f e b C =
are sets. Compute the following:
(i) C B
(ii) A C·
(iii) C B ÷
(iv) The power set of C B ÷ .

U
A B
U
A B
C
U
A B

31

elations are a very important concept in mathematics. Based on the
fundamental principle of the Cartesian product we will introduce
relations as the foundation of mappings and functions. Relations are
based on a common understanding of relationships among objects. These
relationships may refer to a comparison between objects of the same set, or they
involve elements of different sets. Two special types of relations, the equivalence
relation and the order relation, play an important role in mathematics. The first is
used to classify objects; the latter one is the basis for the theory of ordered sets. In
this chapter, we deal only with binary relations only. They are relations between
two sets.

Relat ions and Funct ions

6
CHAPTER
R
32 THE MATHEMATICS OF GIS

6.1 Car t esi an Product
Definition 21 (Cartesian Product). The Cartesian product (or cross product) of two
sets A and B , denoted as B A× , is the set of all pairs } | , { B b A a b a e . e > < .
Example 32. Let } 2 , 1 { = A , } , { b a B = and C = C . Then
(a) } , 2 , , 2 , , 1 , , 1 { > < > < > < > < = × b a b a B A
(b) C = ×C A
Example 33. Consider the sets A = {Vienna, Amsterdam} and B = {Austria, Netherlands,
France}. The Cartesian product B A× is the set of six elements {<Vienna, Austria>, <Vienna,
Netherlands>, <Vienna, France>, <Amsterdam, Austria>, <Amsterdam, Netherlands>,
<Amsterdam, France>}.
The Cartesian product is not commutative, i.e., A B B A × = × . This can easily be seen in
the example above.
We can also graphically represent the Cartesian product. Assume we have two sets
{ | 2 3} A x x = s s and } 1 0 | { s s = y y B . Then the cross products
{ , | 2 3 0 1} A B x y x y × = < > s s . s s and { , | 2 3 0 1} B A y x x y × = < > s s . s s can be
graphically represented as in Figure 4.

Figure 4. Non-commutativity of the Cartesian product
Some properties of the Cartesian product are listed in Table 10.
Table 10. Properties of the Cartesian product
1. ) ( ) ( ) ( C A B A C B A × × = ×
2. ) ( ) ( ) ( C A B A C B A × · × = · ×
3. ) ( ) ( ) ( B A C A C B A × × = ×
4. ) ( ) ( ) ( B A C A C B A × · × = × ·
6.2 Bi nar y Rel at i ons
Although relations are generally defined with more than two sets, we restrict ourselves
here to binary relations between two sets.
1 2 3
1
2
3
A×B
1 2 3
1
2
3
B×A
1 2 3
1
2
3
A×B
1 2 3
1
2
3
A×B
1 2 3
1
2
3
B×A
1 2 3
1
2
3
B×A
RELATIONS AND FUNCTIONS 33

Definition 22 (Binary Relation). A binary relation R over B A× is a subset of
B A× . The set A is called the domain of R ; B is the codomain. We write
R b a >e < , also as aRb , and R b a >e < , is written as a Rb . If the relation is defined
over A A× , we call it a relation on A.
Example 34. Consider the set A = {Vienna, Amsterdam} and the set B = {Austria, Netherlands,
France}. The set C = {<Vienna, Austria>, <Amsterdam, Netherlands>} is a relation over B A×
that can be read as “is capital of.”
Definition 23 (Inverse Relation). Let R be a relation over B A× . The inverse
relation (or inverse)
1 ÷
R is defined as the relation over A B× such that
} , | , {
1
R b a a b R >e < > < =
÷
.
Example 35. Let A = {John, Ann, Frank} and B = {Mercedes, BMW} be two sets of persons and
cars. R = {<John, Mercedes>, <Ann, BMW>, <Frank, BMW>} is a relation “drives a.” Then R
-1
=
{<Mercedes, John>, <BMW, Ann>, <BMW, Frank>} is the inverse relation that can be read as “is
driven by.”
6.2.1 Relat ions and Predicat es
Every binary relation R on a set A corresponds to a predicate with two variables and A as
the universe of discourse. If the relation is given, the predicate can be defined as
1 2 1 2
( , ) is true if and only if , P a a a a R < >e . Likewise, if a predicate P is given we can
define a relation R such that
1 2 1 2
{ , | ( , ) is true} R a a P a a = < > .
6.2.2 Graphic Represent at ion of Binary Relat ions
It is often convenient to represent relations graphically. For this purpose, we will use
directed graphs (or digraphs
11
). If there is a relation between the two elements x and y ,
i.e., xRy , we use the following digraph representation

Example 36. Let } , , , { d c b a A = be a set and { , , , , , } R a c b b b c = < > < > < > a relation on A .
The digraph is represented by the following diagram.

6.2.3 Special Propert ies of Relat ions
Some properties of binary relations are so important that they must be discussed in more
detail. The following list defines these properties.

11
A graph is defined by two sets and , the set of nodes (points or vertices) and the set of edges
(arcs or lines), and an incidence relation on that describes which nodes are connected by edges. If
the arcs are directed, we call the graph a directed graph.
x y
a
c
d
b
a
c
d
b
V E
V V ×
34 THE MATHEMATICS OF GIS

Definition 24 (Properties of Relations). Let R be a binary relation on a set A. We say
that
(i.) R is reflexive if xRx for every x in A.
(ii.) R is irreflexive if xRx for no x in A.
(iii.) R is symmetric if xRy implies yRx for every y x, in A.
(iv.) R is antisymmetrix if xRy and yRx together imply y x = for every y x, in
A.
(v.) R is transitive if xRy and yRz together imply xRz for every z y x , , in A.
These properties are reflected in certain characteristics of a digraph representation of
relations. The digraph of a reflexive relation has a loop on every node of the graph. The
graph of an irreflexive relation has no loop on any node. A relation can be neither
reflexive nor irreflexive. In this case, it simply has loops on some nodes, but not on all.
The graph of a symmetric relation has either two or no arcs between any two distinct
nodes of the graph. For an antisymmetric relation the graph has either one arc or no arc
between any two distinct nodes of the graph. Loops may, but need not, occur in the
graphs of symmetric and antisymmetric relations.
If in the graph of a transitive relation, there is an arc from x to y and from y to z, then
there must also be an arc from x to z.
Example 37. Consider the set of three elements {1, 2, 3} and the relations represented in Figure 5.

Figure 5. Sample relations
(a)
1
R is reflexive, symmetric, antisymmetric, and transitive. It is the equality relation on the set.
It is not irreflexive.
(b)
2
R is symmetric but not reflexive, irreflexive, antisymmetric, or transitive.
(c)
3
R is irreflexive and antisymmetric, but not reflexive, symmetric or transitive.
(d)
4
R is irreflexive, symmetric, antisymmetric and transitive. It is not reflexive. It is the empty
relation on the set.
(e)
5
R is the universal relation on the set. It is reflexive, symmetric and transitive, but not
irreflexive or antisymmetric.
6.2.3.1 Equivalence Relat ion
A reflexive, symmetric and transitive relation is called equivalence relation. An
equivalence relation divides a set S into non-empty mutually disjoint sets or equivalence
1
2
3
1
2
3
1
2
3
1
2
3 1
2
3
R
1
R
2
R
3
R
4
R
5
RELATIONS AND FUNCTIONS 35

classes } , | { ] [ R x a x a >e < = where a is an element of S and R is an equivalence
relation. The set of all equivalence classes of S (written as R S / ) is called the quotient
set of S under R , i.e., } | ] {[ / R a a R S e = . An element ] [a y e is called a representative
of the class ] [a .
Example 38. Let R be the relation || (parallel) on the set of all lines in the plane. This relation is
an equivalence relation, because (i) for every line l we have l l || (reflexive), (ii) for every two
lines
2 1
, l l we have that if
1 2 2 1
|| || l l l l ¬ (symmetric), and (iii) if
2 1
|| l l and
3 2
|| l l then
3 1
|| l l
(transitivity). The relation classifies the set of lines into the equivalence classes of parallel lines.
Every element of one class is a representative of this class.
6.2.3.2 Order Relat ion
A reflexive, antisymmetric and transitive relation is called order relation. Order relations
allow the comparison of elements of a set.
Example 39. The subset relation between two sets is an order relation, because (i) for all sets we
have A A _ (reflexive), (ii) if B A _ and A B _ then it follows B A= (antisymmetric), and (iii)
if B A _ and C B _ then C A _ (transitive).
6.2.4 Composit ion of Relat ions
We can generate new relations by composing a sequence of relations. Formally, we
define the composition of relations as follows.
Definition 25 (Composition of Relations). Let
1
R be a relation from A to B , and
2
R be a relation from B to C . The composite relation from A to C , written as
2 1
R R is defined as
]} , , [ | , {
2 1 2 1
R c b R b a B b b C c A a c a R R >e < . >e < . e - . e . e > < = .
The composition of relations is not commutative, but associative.
A relation R on a set A can be composed with itself any number of times to form a
new relation on the set A. For RR we often write
2
R , for RRR we write
3
R , and so
on.
Example 40. If R is the relation “is father of”, then RR is the relation “is paternal grandfather of.”
Let } , , , { d c b a A = be a set and consider } , , , , , {
1
> < > < > < = d b b a a a R and
} , , , , , , , {
2
> < > < > < > < = b c d b c b d a R to be two relations on A . Then
} , , , {
2 1
> < > < = d a c a R R , } , {
1 2
> < = d c R R , } , , , , , {
2
1
> < > < > < = d a b a a a R , and
} , , , , , {
3
2
> < > < > < = d b b c c b R .
The composition of relations can be illustrated with a digraph as displayed in Figure 6.
36 THE MATHEMATICS OF GIS

Figure 6. Composition of relations
Let
1
R be a relation from A to B ,
2
R and
3
R be a relation from B to C , and
4
R be a
relation from C to D. Then the following statements are true:
(i.)
3 1 2 1 3 2 1
) ( R R R R R R R =
(ii.)
3 1 2 1 3 2 1
) ( R R R R R R R · c ·
(iii.)
4 3 4 2 4 3 2
) ( R R R R R R R =
(iv.)
4 3 4 2 4 3 2
) ( R R R R R R R · c ·
6.3 Funct i ons
Functions are a special kind of binary relations. They are used throughout mathematics.
Definition 26 (Function). A function (map, mapping or transformation) f from A to B,
written as B A f ÷ : , is a binary relation from A to B such that for every A a e , there
exists a unique B b e such that f b a >e < , . We write b a f = ) ( and we call A the
domain and B the codomain of f. a is the argument and b the value of the function for
the argument a .
To correctly specify a function we must indicate the domain, codomain and the value
) (x f for every argument x . Note that the important difference between a relation and a
function is that for a function it is not possible that an argument has more than one value,
and a value must exist for all elements of the domain.
Example 41. Consider the function from the natural numbers to the natural numbers : f ÷  
where 1 2 ) ( ÷ = x x f . This function maps all natural numbers to the odd numbers. One is mapped
to one, two to three, three to five, etc.
Example 42. Consider the sets } 2 , 1 { = A and } , , { c b a B = . When the domain and codomain are
finite, we can represent functions as digraphs. In the following Figure 7 (a) and (b) are functions;
(c) and (d) are no functions. (c) is not a function because not for every element of the domain we
have a value. (d) is not a function because the argument 1 has more than one value assigned.
A B C
R
1
R
2
R
1
R
2
A B C
R
1
R
2
R
1
R
2
RELATIONS AND FUNCTIONS 37

Figure 7. Functions and relations
6.3.1 Composit ion of Funct ions
In the same way as with relations, we can generate new functions by composing a
sequence of functions.
Definition 27 (Composition of Functions). Let B A g ÷ : and C B f ÷ : be two
functions. The composite function g f · is a function from A to C and
)) ( ( ) )( ( x g f x g f = · for all x in A. The composition of functions is not commutative,
but it is associative.
Note that a composite function is only defined when the codomain of the first function g
is equal to the domain of the second function f.
Example 43. Let : g ÷   with x x g 2 ) ( = and : f ÷   with 1 ) ( + = x x f . The composite
function 1 2 )) ( ( + = x x g f and the composite function 2 2 )) ( ( + = x x f g .
6.3.2 Classes of Funct ions
Certain characteristics of functions are so important that a special terminology has been
developed for them.
Definition 28 (Surjection). A function f from A to B is called surjective (onto or
surjection) if the image of the codomain is the image of the domain, or B A f = ) ( .
Definition 29 (Injection). A function f from A to B is called injective (one-to-one or
injection) if distinct arguments have distinct values, or if a a ' = then ) ( ) ( a f a f ' = .
Definition 30 (Bijection). A function f from A to B is bijective (one-to-one and onto, or
bijection) if it is surjective and injective.
Example 44. Let : {0,1} f ÷  be a function from the integers to the set {0,1} defined with
0 for is even
( )
1 for is odd
x
f x
x
¦
=
´
¹
. This function is surjective, but not injective.
1
2
a
b
c
1
2
a
b
c
(a) (b)
1
2
a
b
c
1
2
a
b
c
(c) (d)
38 THE MATHEMATICS OF GIS

Example 45. Consider the function : f ÷   in the integers with 1 2 ) ( ÷ = x x f . This function
is injective, but not surjective.
Example 46. Consider the function : f ÷   in the integers with 1 ) ( + = x x f . This function is
bijective.
In the case of functions from the real numbers to the real numbers, we can interpret the
properties of being surjective, injective or bijective in terms of the graph of the function:
Surj ect i vi t y: Every horizontal line intersects the graph of the function at least once.
I nj ect i vi t y: No horizontal line intersects the graph of the function more than once.
Bi j ect i vi t y: Every horizontal line intersects the graph of the function exactly once.
Example 47. Consider the function : f ÷   in the real numbers with
2 3
2 ) ( x x x f + = . Every
horizontal line intersects the graph of the function at least once. Therefore, the function is
surjective. The function is not injective, because there are lines (e.g., 0 = y ) that intersect the
graph more than once.

Example 48. Consider the function : f ÷   with 10 2 ) ( + =
x
x f . No horizontal line
intersects the graph more than once. Therefore, the function is injective. It is not surjective,
because there are lines that do not intersect the graph at all.
-10 -5 5 10
-10
-5
5
10
15
RELATIONS AND FUNCTIONS 39

Example 49. Consider the function : f ÷   with x x f = ) ( . Every horizontal line intersects
the graph of the function exactly once. Therefore, the function is bijective.

Example 50. Consider the function : f ÷   with
2
) ( x x f = . The function is neither
surjective nor injective.

-4 -2 2 4
15
20
25
30
35
40
-4 -2 2 4
-4
-2
2
4
-4 -2 2 4
5
10
15
20
25
40 THE MATHEMATICS OF GIS

These special properties of functions also propagate through composite functions. If
f g · is a composite function, then
(i.) If f and g are surjective, then f g · is surjective.
(ii.) If f and g are injective, then f g · is injective.
(iii.) If f and g are bijective, then f g · is bijective.
The converse of these statements is not true. However, we can establish the following:
(i.) If f g · is surjective, then f is surjective.
(ii.) If f g · is injective, then g is injective.
(iii.) If f g · is bijective, then f is surjective and g is injective.
Definition 31 (Inverse Function). Let B A f ÷ : be a bijection from A to B . The
converse relation of f is called the inverse function of f , written as
1 ÷
f .
The inverse function is only defined when the function is a bijection. The inverse
function then is also a bijection.
6.4 Appl i cat i ons i n GIS
Relations play an important role in GIS. The best-known examples of relations in GIS
are the spatial or topological relations between the building blocks of feature data sets.
These building blocks correspond to nodes, arcs and polygons in a two-dimensional
setting.
Formally, we distinguish between the following relations among the elements of the set
of nodes, arcs, and polygons. Every arc has a relation with two nodes (the start node and
the end node relation); every arc has a relation with two polygons (the left polygon and
the right polygon relation). Figure 8 shows a two-dimensional data set and the
topological relations between nodes, arcs and polygons.
3
A
B
C
E D
1
2
4
5
6
7
a
b
c
d
e
f
g
h
i
j

Figure 8. Topological relations
In this example we have the set of nodes, arcs, and polygons defined as
{1, 2,3, 4, 5, 6} N = , { , , , , , , , , , } A a b c d e f g h i j = , and { , , , , } P A B C D E = . The start node –
end node relation is defined as
{ ,1 , , 2 , , 2 , , 3 , , 3 , ,1 , , 2 , , 4 , , 4 ,
, 6 , , 3 , , 6 , , 6 , , 5 , , 4 , , 5 , , 7 , , 5 , ,1 }
AN a a b b c c d d e
e f f g g h h i j j
= < > < > < > < > < > < > < > < > < >
< > < > < > < > < > < > < > < > < > < >
,
whereas the left polygon – right polygon relation can be written as
RELATIONS AND FUNCTIONS 41

{ , , , 0 , , , , 0 , , , , 0 , , , , , , , , ,
, , , , , , , , , , , , , , , , , , , }
AP a C a b B b c A c d C d B e D e B
f B f A g D g A h C h D i D i E j C j A
= < > < > < > < > < > < > < > < > < > < >
< > < > < > < > < > < > < > < > < > < >

Other types of relations are those among spatial features in a data set. The best-known
examples are the eight relations between simple spatial regions that can be derived from
topological invariants of boundary and interior (see chapter 9). Figure 9 shows these
relations.
disjoint
meet
equal
inside
covered by
contains
covers
overlap

Figure 9. Spatial relations derived from topological invariants
Functions appear in many different forms in GIS. One typical application is map
projections. Here, a point on the surface of the earth whose location is given as latitude
¢ and longitude ì is mapped to a point on a plane by a set of two mapping rules for the
easting and northing, respectively, as
1
2
easting = ( , )
northing = ( , )
f
f
¢ ì
¢ ì

Not every map projection is a function in the mathematical sense. Many map projections,
for instance, map the pole to a line, which means that there is more than one value for a
given argument. These cases, where a point on the earth is mapped to a line or cannot be
mapped at all, are called singularities. Figure 10 shows two projections where the poles
are mapped to a line (a) and to a point (b). In the second projection, the South Pole
cannot be mapped at all.

(a) Eckert IV (b) Azimuthal equal area
Figure 10. Map projections with singularities
42 THE MATHEMATICS OF GIS

6.5 Exerci ses
Exercise 17 Let } , { b a A = , } 3 , 2 { = B and } 4 , 3 { = C . Compute:
(i) ) ( C B A ×
(ii) ) ( ) ( C A B A × ×
(iii) ) ( C B A · ×
(iv) ) ( ) ( C A B A × · ×
Exercise 18 Let } 4 , 3 , 2 , 1 { = W and consider the following relations on W :
} 3 , 3 , 2 , 2 , 1 , 1 {
} 4 , 2 , 3 , 1 {
} 1 , 4 , 3 , 2 , 1 , 1 {
} 2 , 1 , 1 , 1 {
4
3
2
1
> < > < > < =
> < > < =
> < > < > < =
> < > < =
R
R
R
R

Check these relations whether they are reflexive, irreflexive, symmetric, antisymmetric, or
transitive.
Exercise 19 Let } 4 , 3 , 2 , 1 { = X . Which one of the following relations is symmetric and which one is transitive?
In case the relation is not symmetric or transitive explain why.

} 4 , 4 , 1 , 2 , 4 , 1 , 4 , 3 , 1 , 2 {
} 1 , 1 , 2 , 4 , 1 , 3 {
} 4 , 4 , 2 , 3 , 1 , 2 , 4 , 1 , 3 , 2 {
> < > < > < > < > < =
> < > < > < =
> < > < > < > < > < =
h
g
f

Exercise 20 Let } 4 , 3 , 2 , 1 { = X . Which one of the following relations is a function from X to X ? In case the
relation is not a function explain why.

} 4 , 4 , 1 , 2 , 4 , 1 , 4 , 3 , 1 , 2 {
} 1 , 1 , 2 , 4 , 1 , 3 {
} 4 , 4 , 2 , 3 , 1 , 2 , 4 , 1 , 3 , 2 {
> < > < > < > < > < =
> < > < > < =
> < > < > < > < > < =
h
g
f

Exercise 21 Let
1
R and
2
R be relations on a set } , , , { d c b a A = where } , , , , , {
1
> < > < > < = d c c a a a R and
} , , , , , , , {
2
> < > < > < > < = d c b b c b d a R . Find
2 1
R R ,
1 2
R R ,
2
1
R , and
3
2
R .
Exercise 22 Let : f ÷   be defined as 2 3 ) (
2
+ ÷ = x x x f . Compute
h
x f h x f ) ( ) ( ÷ +
.
Exercise 23 Let f and g be functions from X = {1,2,3,4,5} in X defined as:
f = {<1,3>,<2,5>,<3,3>,<4,1>,<5,2>}
g = {<1,4>,<2,1>,<3,1>,<4,2>,<5,3>}
Determine (i) the codomain of f and g. (ii) Determine f g · and g f · .

43

ll points in space can be uniquely referenced by their coordinates.
Depending on the type of space, we distinguish between different
coordinate systems such as Cartesian coordinate systems for Euclidean
spaces or spherical coordinate systems for the surface of a sphere and elliptical
coordinate systems for the surface of an ellipsoid. The sphere and the ellipsoid
are geometric bodies used to approximate the shape of the earth.
Spatial features such as points, arcs and polygons as well as raster cells are
spatially referenced through their coordinates. Often, it is necessary to apply
transformations to these coordinates in order to shift, rotate, scale or warp the
features. In this chapter, we will discuss frequently used coordinate systems and
transformations applied to geometric features in a Euclidean space.

CHAPTER
7
Coordinat e Syst ems and
Transfor mat ions

A
44 THE MATHEMATICS OF GIS

7.1 Coordi nat e Syst ems
A coordinate system functions to assign any point in space a pair or triple of real
numbers, its coordinates. The most common coordinate systems are rectangular or
Cartesian coordinate systems and polar coordinate systems. In this chapter, we deal with
a two- or three-dimensional real space (also called the Euclidean space) where every
point has real-valued coordinates.
7.1.1 Cart esian Coordinat e Syst ems
In the real plane
2
 every point P has a unique pair of real numbers ( , ) x y with
, x y e assigned. On the other hand, every pair of real numbers ( , ) x y defines uniquely
a point in the real plane. We define a single point O , the origin, and two perpendicular
lines through that point, the axes. The horizontal axis is called x -axis, the vertical one is
the y -axis. Every point P is uniquely defined by its Cartesian coordinates ( , ) P x y .
Figure 11 illustrates these Cartesian coordinates.
P( x, y)
x-axi s
y-axi s
O
x
y

Figure 11. Cartesian coordinate system in the plane
We can easily extend the 2-dimensional coordinates in the plane to 3-dimensional
coordinates in space by defining a Cartesian coordinate system in
3
 . Every point P is
then clearly defined by the triple ( , , ) x y z of Cartesian coordinates (Figure 12).
x- axi s
y-axi s
z- axi s
P( x, y, z)
y
x
z
O

Figure 12. Cartesian coordinate system in 3-D space
COORDINATE SYSTEMS AND TRANSFORMATIONS 45

7.1.2 Polar Coordinat e Syst ems
A different way of assigning a point in the plane unique coordinates is the use of polar
coordinates. They are defined in a polar coordinate system which is given by a fixed
point O , the origin or pole, and a line through the pole, the polar axis. Every point in the
plane is then determined by its distance from the pole, the radius r , and the angle ¢
between the radius and the polar axis (Figure 13).
pol ar axi s O
P( r , ¢)
¢
r

Figure 13. Polar coordinate system in the plane
In a three-dimensional polar coordinate system (or spherical coordinate system) a point
P is defined by the radius r from the origin to the point and two angles: the angle ¢
between the projection of OP onto the , x y -plane, and the angle u between OP and the
positive z -axis (Figure 14).
x
y
z
P( r , ¢ , u)
O
r
u
¢

Figure 14. Spherical coordinate system
7.1.3 Transformat ions bet ween Cart esian and Polar Coordinat e Syst ems
The relationships between x and y and r and ¢ are illustrated in Figure 15 and can be
expressed by the following correspondences:
P
¢
r
x-axi s
y-axi s
O
y
x

Figure 15. Conversion between Cartesian and polar coordinates in the plane
46 THE MATHEMATICS OF GIS

2 2
cos
sin
tan with [0, 2 ] \ (2 1)
2
x r
y r
r x y
y
k k
x
¢
¢
t
¢ ¢ t
=
=
= +
¦ ¹
= e + e
´ `
¹ )

Example 51. Given the Cartesian coordinates of the point (3, 4) P we can compute its polar
coordinates as
2 2
3 4 9 16 25 5 r = + = + = = and
4
tan 1.3333
3
¢ = = , i.e., 53.13 ¢ =
·
. The
point thus has the polar coordinates (5, 53.13) P .
The conversion between three-dimensional Cartesian coordinates and spherical
coordinates can be performed using the following formulas (see also Figure 16):
2 2 2
2 2
2 2
2 2
sin cos
sin sin
cos
sin
cos
cos
tan with [0, ]
tan with [0, 2 ] \ (2 1)
2
x r
y r
z r
r x y z
y
x y
x
x y
z
r
x y
z
y
k k
x
u ¢
u ¢
u
¢
¢
u
u u t
t
¢ ¢ t
=
=
=
= + +
=
+
=
+
=
+
= e
¦ ¹
= e + e
´ `
¹ )

x- axi s
y-axi s
z-axi s
P
y
x
z
O
r
u
¢

Figure 16. Conversion between Cartesian coordinates and spherical coordinates
Example 52. Given a point (2, 3, 4) P in the three-dimensional Euclidean space
3
 we can
compute its spherical coordinates as
2 2 2
2 3 4 4 9 16 29 5.385 r = + + = + + = = ,
4
cos 0.743
5.385
u = = and
3
tan 1.5
2
¢ = = . From this we get 42.03 u =
·
and 56.31 ¢ =
·
.
COORDINATE SYSTEMS AND TRANSFORMATIONS 47

7.1.4 Geographic Coordinat e Syst em
A special case of a spherical coordinate system is the geographic coordinate system,
which is used to identify locations on the surface of the earth (Figure 17). The origin M
of the geographic coordinate system is the center of the earth. The equator E lies in the
plane defined by the x - and y -axes. The circle G defined by the intersection of the , x z
-plane with the earth is the zero meridian through Greenwich. Every point P on the
surface of the earth is uniquely defined by its latitude ¢ and longitude ì , denoted as
( , ) P ¢ ì .
M
y
z
x
ì
¢
G
P(¢,ì)
E
N
S

Figure 17. Geographic coordinate system
The latitude is measured as the angle between the equatorial plane and the radius from the
origin to the point towards north (positive latitude) or south (negative latitude). A latitude
on the northern hemisphere ranges from 0 to 90, and from 0 to -90 on the southern
hemisphere. Note that this is different from the way how the angle u is defined for
spherical coordinates.
The longitude is the angle between the planes through the zero meridian and the origin,
and the plane trough the point P and the origin. Longitudes are positive from 0 to 180
towards east and negative from 0 to 180 west.
Every circle through the poles is called a meridian; every circle parallel to the equatorial
plane is called a parallel. For practical calculations, the radius R of the earth is assumed
6,370 kilometers.
Example 53. The airport of Vienna, Austria, has a latitude of 48 07'
·
North and a longitude of
16 34'
·
East, or VIE(48.1167,16.5667) .
7.2 Vect ors and Mat ri ces
Vectors and matrices play an important role in the analytical treatment of geometric
figures. We can represent points in space by their respective point vectors, and we can
apply many calculations related to the characteristics of geometric figures using vector
representations.
7.2.1 Vect ors
In section 8.2.4 we have defined the algebraic structure of a vector space. The elements
of a vector space are called vectors several axioms for operations among vectors and
48 THE MATHEMATICS OF GIS

vectors with scalars are defined. Here, we define vectors as a class of arrows in two- or
three-dimensional real space.
Definition 32 (Vector). A vector is a class of parallel, directed arrows of the same
length in space. A single arrow is called a representative of the vector.
For simplicity, we will not make a difference between a vector and a representative, and
will simply call a representative a vector. The tail of a vector is called the initial point,
and the head of the arrow is called the terminal point.
Every point ( , , ) P x y z in
3
 can be represented by its point vector
x
P y
z
| |
|
=
|
|
\ .
,
as shown in
Figure 18
12
. In
2
 the point vector components reduce to two for the x - and y -
coordinate components.
x- axi s
y- axi s
z-axi s
P( x, y, z)
y
x
z
O
| |
|
=
|
|
\ .
¸,
x
P y
z

Figure 18. Point vector
The length of a vector is defined as
2 2 2
P x y z = + +
,
in
3
and
2 2
P x y = +
,
in
2
 .
A vector of length 1 is called a unit vector.
From section 8.2.4 we know that we can define operations of addition and multiplication
with a scalar for vectors:
x x x x
y y y y
z z z z
a b a b
a b a b a b
a b a b
+ | | | | | |
| | |
+ = + = +
| | |
| | |
+
\ . \ . \ .
,
,
and
x x
y y
z z
a a
a a a
a a
ì
ì ì ì
ì
| | | |
| |
= =
| |
| |
\ . \ .
,

Example 54. The sum of the two three-dimensional vectors (1, 2, 3) and (4, 5, 6) is
1 4 1 4 5
2 5 2 5 7
3 6 3 6 9
+ | | | | | | | |
| | | |
+ = + =
| | | |
| | | |
+
\ . \ . \ . \ .
.
Beside the addition of vectors and the multiplication of a vector with a scalar, we know
three different vector products. They all have also a geometric interpretation.

12
For the sake of a more compact vector notation we also write . ( , , ) P x y z =
,
COORDINATE SYSTEMS AND TRANSFORMATIONS 49

Definition 33 (Dot product). If a
,
and b
,
are two vectors the dot product (or
Euclidean inner product) is defined as
x x
y y x x y y z z
z z
a b
a b a b a b a b a b
a b
| | | |
| |
· = · = + +
| |
| |
\ . \ .
, ,

The result of the dot product is always a number (scalar). The dot product is
commutative and distributive, but not associative:
( )
a b b a
a b c a c b c
· = ·
+ · = · + ·
, , , ,
, , , , , , ,

The dot product can be used to compute the angle ¢ between two vectors a
,
and b
,

according to the following formula:
cos
| || |
a b
a b
¢
·
=
, ,
, ,
Example 55. The angle ¢ between the two vectors (1, 2, 3) a =
,
and (3,1,1) b =
,
is calculated
according to the formula as
1 3 2 1 3 1 8
cos 0.645
1 4 9 9 1 1 14 11
¢
· + · + ·
= = =
+ + · + + ·
. It follows that
49.86 ¢ =
·
.
Definition 34 (Cross product). If a
,
and b
,
are two vectors the cross product is
defined as
x x y z z y
y y z x x z
z z x y y x
a b a b a b
c a b a b a b a b
a b a b a b
| | ÷ | | | |
|
| |
= × = × = ÷
|
| |
| |
|
÷
\ . \ .
\ .
, , ,

The result of the cross product is a vector. It is distributive, but not commutative:
( ) a b c a c b c
a b b a
+ × = × + ×
× = ÷ ×
, , , , , , ,
, , , ,

The cross product can be geometrically interpreted as illustrated in Figure 19:
- The product vector c
,
is perpendicular to the vectors a
,
and b
,
.
- , a b
,
,
and c
,
form a right-handed coordinate system.
- The length of c
,
is equal to the area of the parallelogram spanned by a
,
and b
,
,
where ¢ is the angle between the two vectors, according to the following
formula sin c a b a b ¢ = × = · ·
, ,
, , ,
.
50 THE MATHEMATICS OF GIS

a
b
c
¢

Figure 19. Cross product of two vectors
Example 56. The cross product of the two vectors (1, 0, 0) a =
,
and (1,1, 0) b =
,
is equal to
1 1 0 0 0 1 0
0 1 0 1 1 0 0
0 0 1 1 0 1 1
a b
· ÷ · | | | | | | | |
| | | |
× = × = · ÷ · =
| | | |
| | | |
· ÷ ·
\ . \ . \ . \ .
,
,
and the length of the vector is 1. The angle between a
,
and
b
,
is 45
·
. Therefore we can compute the length of the cross product as
2
1 2 1
2
· · = .
Definition 35 (Scalar triple product). If , a b
,
,
and c
,
are three vectors the scalar triple
product is defined as
( ) ( ) ( )
( ) ( ) ( )
x y z z y y x z z x z x y y x
abc a b c c a b
a b c b c a b c b c a b c b c
= × · = · × =
÷ ÷ ÷ + ÷
,,, , , , , , ,

If the three vectors do not lie in the same plane, then they form a parallelepiped when
they are positioned with the common initial point (Figure 20). The result of the scalar
triple product is a number equal to the volume of this parallelepiped and can also be
computed according to the formula
( ) | | | | cos abc a b c ¸ = × · ·
,,, , , ,

where ¸ is the angle between the cross product vector of a b ×
,
,
and c
,
.
Example 57. The volume of the parallelepiped with (2, 6, 2), (0, 4, 2) a b = ÷ = ÷
,
,
, and
(2, 2, 4) c = ÷
,
is computed by inserting into the formula given in Definition 35 as
2 [4 ( 4) ( 2) 2] ( 6) [0 ( 4) ( 2) 2] 2 [0 2 4 2] 2 ( 12) ( 6) 4 2 ( 8)
24 24 16 8
· · ÷ ÷ ÷ · ÷ ÷ · · ÷ ÷ ÷ · + · · ÷ · = · ÷ ÷ ÷ · + · ÷ =
÷ + ÷ = ÷

a
b
c
¸
b a×

Figure 20. Scalar triple product
The following correspondences hold between the dot product, cross product and the
scalar triple product.
COORDINATE SYSTEMS AND TRANSFORMATIONS 51

2 2 2 2
( ) ( ) ( )
( ) ( ) ( )( ) ( )( )
( ) ( )
( ) ( ) ( ) ( )
a b c a c b a b c
a b c d a c b d a d b c
a b a b a b
a b c d c abd d abc
× × = · ÷ ·
× · × = · · ÷ · ·
× = ÷ ·
× × × = ÷
, , ,
, , , , , ,
, , , , , ,
, , , , , ,
, , ,
, , ,
, , ,, , ,
, , , , , ,

7.2.2 Mat rices
Rectangular arrays of real numbers occur in many contexts in mathematics and as data
structure in applications of computer science.
Definition 36 (Matrix). A matrix is a rectangular array of real numbers. The numbers
in the array are called the entries in the matrix.
A matrix M is a rectangular array of numbers with m rows and n columns represented
as:
11 12 13 1
21 22 23 2
1 2 3
n
n
m m m mn
m m m m
m m m m
M
m m m m
| |
|
|
=
|
|
|
\ .

. . . .

We call M a m n × -matrix. We also know that the matrices form a vector space and that
we can multiply matrices with matrices and matrices with vectors according to the
following rules:
Let A and B be two matrices. Their sum is defined as
11 12 1 11 12 1 11 11 12 12 1 1
21 22 2 21 22 2 21 21 22 22 2 2
1 2 1 2 1 1 2 2
n n n n
n n n n
m m mn m m mn m m m m mn mn
a a a b b b a b a b a b
a a a b b b a b a b a b
a a a b b b a b a b a b
+ + + | | | | | |
| | |
+ + +
| | |
+ =
| | |
| | |
| | |
+ + +
\ . \ . \ .

. . . . . . . . .

Note that the sum has the same number of rows and columns of the input matrices, and
that both matrices must have the same number of rows and columns. If the number of
rows and columns does not match, the sum is not defined.
The multiplication of a matrix A with a scalar s is defined as
11 12 1 11 12 1
21 22 2 21 22 2
1 2 1 2
n n
n n
m m mn m m mn
a a a sa sa sa
a a a sa sa sa
sA s
a a a sa sa sa
| | | |
| |
| |
= =
| |
| |
| |
\ . \ .

. . . . . .

The product of two matrices A and B is only defined if the number of columns of A is
equal the number of rows of B . Given a m p × -matrix A and a p n × -matrix B the
product of C AB = of A and B is a m n × -matrix where every element
ij
c of the
product is calculated according to the following schema
52 THE MATHEMATICS OF GIS

11 1 11 1 11 1
1
1
1
1
1 pn
n p n
p
i ip ij
m mp m mn
j
pj
b b a a c c
b
a a
b
c
b a
b
a c c
| | | | | |
| | |
· · · · · ·
| | |
| | · · |
= · ·
| | |
· · · · · ·
| | |
| | | |
\ . \ .
·
·
\
·
.

and
1 1 2 2
1
p
ij i j i j ip pj ik kj
k
c a b a b a b a b
=
= + + + =
¿
.
Example 58. The product of the two matrices
r s
t u
| |
|
\ .
and
1 2 3
1 2 3
a a a
b b b
| |
|
\ .
is computed as
1 2 3 1 1 2 2 3 3
1 2 3 1 1 2 2 3 3
a a a ra sb ra sb ra sb r s
b b b ta ub ta ub ta ub t u
+ + + | | | | | |
=
| | |
+ + +
\ .\ . \ .
.
Example 59. The product of
1 2
3 4
| |
|
\ .
and
5 6
7 8
| |
|
\ .
is calculated as
1 2 5 6 1 5 2 7 1 6 2 8 19 22
3 4 7 8 3 5 4 7 3 6 4 8 43 50
· + · · + · | || | | | | |
= =
| | | |
· + · · + ·
\ .\ . \ . \ .
.
7.3 Transfor mat i ons
When we rotate, shift or scale geometric figures we apply geometric transformations.
Here, we will focus on plane coordinate systems and their transformations. Another
problem related to transformations is to determine the parameters of a transformation
between two plane coordinate systems that compensates for scaling, rotation, skew and
translation. We will discuss the HELMERT (or similarity) transformation and the affine
transformation that both provide solutions to this problem.
7.3.1 Geomet ric Transformat ions
In the following sections, we will discuss geometric transformations in the plane using
Cartesian coordinates.
7.3.1.1 Translat ion
The shift of a geometric figure in horizontal and vertical direction results in a translation
operation (Figure 21). The translation factor in x -direction is
x
t , the factor in the y -
direction is
y
t . They need not be the same.
x
y
O
t
x
t
y
P( x, y)
P' ( x' , y' )

Figure 21. Translation
COORDINATE SYSTEMS AND TRANSFORMATIONS 53

Given the coordinates of a point ( , ) P x y , the coordinates of the new point ( , ) P x y ' ' ' are
calculated according to the following formula:
x
y
x x t
y y t
' = +
' = +

In matrix notation, we can write the translation of a point defined by its vector
x
P
y
| |
=
|
\ .
,

with a translation vector
x
y
t
t
t
| |
=
|
\ .
,
resulting in a new point
x
P
y
'
| |
' =
|
'
\ .
¸¸,
as P P t ' = +
¸¸, ,
,
or
x
y
t x x
t y y
' | | | | | |
= +
| | |
'
\ . \ . \ .
.
7.3.1.2 Rot at ion
The rotation of a geometric figure in a two-dimensional coordinate system with the angle
¢ is shown in Figure 22.
x
y
O
¢
P( x, y)
P' ( x' , y' )

Figure 22. Rotation
Given the coordinates of a point ( , ) P x y , the coordinates of the rotated point ( , ) P x y ' ' '
are calculated according to the following formula:
cos sin
sin cos
x x y
y x y
¢ ¢
¢ ¢
' = ÷
' = +

In matrix notation the rotation of a point
x
P
y
| |
=
|
\ .
,
with an angle ¢ can be denoted as
P RP ' =
¸¸, ,
with the rotation matrix
cos sin
sin cos
R
¢ ¢
¢ ¢
÷ | |
=
|
\ .
or
cos sin
sin cos
x x
y y
¢ ¢
¢ ¢
' ÷ | | | || |
=
| | |
'
\ . \ .\ .
.
7.3.1.3 Scaling
The scaling of a geometric figure can be described by the application of a multiplication
factor (or scaling factor) to the coordinates in a given coordinate system (Figure 23).
54 THE MATHEMATICS OF GIS

x
y
O
P( x, y)
P' ( x' , y' )

Figure 23. Scaling
Given the coordinates of a point ( , ) P x y , the coordinates of the scaled point ( , ) P x y ' ' ' are
calculated according to the following formula:
x
y
x s x
y s y
' = ·
' = ·

The factors
x
s and
y
s are the scale factors in the x - and y -directions. They need not be
the same.
In matrix notation the scaling of a point
x
P
y
| |
=
|
\ .
,
with scale factors
x
s and
y
s for x and
y , respectively, can be written as P SP ' =
¸¸, ,
with the scaling matrix
0
0
x
y
s
S
s
| |
=
|
\ .
or
0
0
x
y
s x x
s y y
' | | | | | |
=
| | |
'
\ . \ . \ .
.
7.3.2 Combinat ion of Transformat ions
When we want to perform rotation, scaling and translation to a point, either we can apply
the respective transformations in sequence, one after the other, or we can combine the
transformation matrices to one matrix for rotation and scaling and add the translation
vector. The general approach using the matrices defined in the previous sections is
written as
P SRP t ' = +
¸¸, ,
,

In the detailed notation this translates to
cos sin
sin cos
x x x
y y y
s s t x x
s s t y y
¢ ¢
¢ ¢
÷ ' | | | | | | | |
= +
| | | |
'
\ . \ . \ . \ .
.
Example 60. Let S be a square defined with the points
1
0
0
P
| |
=
|
\ .
,
2
1
0
P
| |
=
|
\ .
,
3
1
1
P
| |
=
|
\ .
and
4
0
1
P
| |
=
|
\ .
. We apply a rotation of 45 degrees, a scaling with the factor 2 in x -direction and 1 in y
-direction. Finally, we shift the figure three units to the right and two units up. The result can be
computed according to the transformation matrix
2 2
1 1
2 2
2 2
T
| |
÷
|
=
|
|
\ .
and the translation vector
COORDINATE SYSTEMS AND TRANSFORMATIONS 55

3
2
t
| |
=
|
\ .
,
as P TP t ' = +
,
. The following figure shows the original square in red and the
transformed figure in green where
1
3
2
P
| |
'
=
|
\ .
,
2
3 2
1
2
2
P
| |
+
|
'
=
|
+
|
\ .
,
3
3
2 2
P
| |
'
=
|
|
+
\ .
and
4
3 2
1
2
2
P
| |
÷
|
'
=
|
+
|
\ .
.
1 2 3 4
1
2
3

7.3.3 Homogeneous Coordinat es
An easier way to deal with geometric transformations is to use homogeneous coordinates.
Definition 37 (Homogeneous Coordinates). Every point with the Cartesian
coordinates ( , ) x y can be assigned the homogeneous coordinates ( , , ) t x t y t · · .
Conversely, given the homogeneous coordinates of a point ( , , ) r s t , we can determine
its Cartesian coordinates as
r
x
t
= and
s
y
t
= .
We assign to a point ( , ) P x y its homogeneous coordinates ( , ,1) x y . The geometric
transformations can then be expressed by 3 3 × -matrices.
cos sin 0
sin cos 0
0 0 1
R
¢ ¢
¢ ¢
÷ | |
|
=
|
|
\ .
rotation
0 0
0 0
0 0 1
x
y
s
S s
| |
|
=
|
|
\ .
scaling
1 0
0 1
0 0 1
x
y
t
T t
| |
|
=
|
|
\ .
translation
Note that now also the translation can be expressed through a translation matrix. This
allows us to combine all three transformations in one single transformation matrix
cos sin
sin cos
0 0 1
x x x
y y y
s s t
U s s t
¢ ¢
¢ ¢
÷ | |
|
=
|
|
\ .
.
56 THE MATHEMATICS OF GIS

The general transformation of a point including rotation, scaling and translation can then
be written simply as the multiplication of the transformation matrix with the point vector
P UP ' =
¸¸, ,
or
cos sin
sin cos
1 0 0 1 1
x x x
y y y
x s s t x
y s s t y
¢ ¢
¢ ¢
' ÷ | | | || |
| | |
' =
| | |
| | |
\ . \ .\ .

Example 61. The transformation of the square in the previous example can now be written as
2 2 3
2 2
2
2 2
1 1
0 0 1
x x
y y
| |
÷
| '
| | | |
|
| |
' =
|
| |
| |
|
\ . \ .
|
\ .

7.3.4 Transformat ion bet ween Coordinat e Syst ems
In many applications, we have to transform coordinates from one system into another
coordinate system. In principle, this relates to the geometric transformations discussed in
the previous sections. However, often we do not know the rotation angle, scale factor or
translation vector, or there are more distortions involved. In these cases, we must
determine the transformation parameters from known coordinates of points in both
systems. These points are called control points. The most common transformations used
are
- similarity transformation
- affine transformation
- projective transformation
The similarity transformation (also called HELMERT transformation) scales, rotates, and
translates the data. It does not independently scale the axes or introduce any skew. It is
also known as four-parameter transformation and has the general form
x Ax By C
y Bx Ay F
' = + +
' = ÷ + +

A minimum of two control points is required to be able to compute the four parameters
A, B , C , and F .
The affine transformation (or 6-parameter transformation) will differentially scale, skew,
rotate, and translate the data. It requires a minimum of three control points and has the
general form
x Ax By C
y Dx Ey F
' = + +
' = + +

Finally, the projective transformation (or 8-parameter transformation) can compensate
for greater distortions between the two coordinate systems and requires a minimum of
four control points. It has the general form
1
1
Ax By C
x
Gx Hy
Dx Ey F
y
Gx Hy
+ +
' =
+ +
+ +
' =
+ +

Example 62. Given two control points
1
P and
2
P , compute the parameters of a HELMERT
transformation. The coordinates of the control points are measured (digitized) on a digitizing
COORDINATE SYSTEMS AND TRANSFORMATIONS 57

device as
1 1 1
( , ) P x y and
2 2 2
( , ) P x y . The map coordinates of the tics are given as
1 1 1
( , ) P x y
' ' '
and
2 2 2
( , ) P x y
' ' '
. We can now compute the parameters of the HELMERT transformation by solving the
following system of linear equations for , , A B C and F .
1 1 1
1 1 1
2 2 2
2 2 2
x Ax By C
y Bx Ay F
x Ax By C
y Bx Ay F
'
= + +
'
= ÷ + +
'
= + +
'
= ÷ + +

Normally, we use more than the required minimum number of control points. We then
need to solve the resulting system of equations with a least squares approach. The root
mean square error (RMS) indicates the goodness of fit. Ideally, the best fit would result
in a RMS of zero, which is never the case when we use more than the required number of
control points. However, the RMS should be as small as possible to achieve a reliable set
of parameters for the transformation.
7.4 Appl i cat i ons i n GIS
In GIS, we apply geometric transformations in many different ways. One use of
transformations is in the graphic editing functions of every GIS. When we edit spatial
features, we need to shift, rotate, skew and scale them.
Another important application lies in the transformation of coordinates of datasets as it
occurs, for instance, in manual digitizing. Here, we have to set up a transformation from
the device coordinates, i.e., the coordinates produced by the digitizing device – usually in
millimeters or inches – to the world coordinates, i.e., the coordinates of the map
projection.
Figure 24 shows a sketch of a digitizing tablet with a map mounted on it. The origin of
the tablet coordinates lies at
t
O . The map coordinate system is indicated with
k
O and the
axes
k
x and
k
y . On the map we have identified four ticks (or control points) designated
with © . The map coordinates of these ticks are either known or can be determined
easily, for instance as grid intersection points or corner points of the map sheet whose
coordinates can be read from the map.
The map usually is not aligned with the coordinate system of the tablet. Before we can
start digitizing, we need to establish a relationship between the tablet coordinate and the
map coordinate system. This is done by choosing a proper transformation and by
computing its parameters. Usually, we select a four- or six-parameter transformation.
With the given coordinates of the ticks (in the map coordinate system) and their measured
coordinates (in the tablet coordinate system), we can compute the transformation
parameters and subsequently apply the transformation to every point measured on the
map. The transformation converts these coordinates into map coordinates.
Every GIS software package should provide this functionality for manual digitizing or
general coordinate transformation. The TRANSFORM command in Workstation Arc/INFO
is one example of such a function.
58 THE MATHEMATICS OF GIS

x
k
y
k
x
t
y
t
O
t
O
k

Figure 24. Manual digitizing setup
7.5 Exerci ses
Exercise 24 Given the geographic coordinates of Vienna airport as 48.12 ¢ = , 16.57 ì = and the radius of the
Earth as 6370 R km = , compute the Cartesian coordinates of the airport when the origin of the
Cartesian coordinate system is located at the center of the earth and the axes directions are as
illustrated in Figure 17.
Exercise 25 Explain why each of the following expressions makes no sense when the operation “ · ” denotes the
dot product of vectors: (a) ( ) a b c · ·
,
, ,
, (b) ( ) a b c + ·
,
, ,
, (c) ( ) k a b · ·
,
,
.
Exercise 26 Let (1,3, 2) a =
,
, (1, 2, 3) b =
,
and (2, 1, 4) c = ÷
,
. Compute (a) b c ×
,
,
, (b) ( ) 2 a b c × ÷
,
, ,
, and (c)
( ) ( ) a b b c × × ×
, ,
, ,
.
Exercise 27 What is wrong with the expression a b c × ×
,
, ,
?
Exercise 28 Let (1,3, 2) a =
,
, (1, 2,3) b =
,
and (2, 1, 4) c = ÷
,
. Compute ( , , ) a b c
,
, ,
.
Exercise 29 Given the triangle ABC  with the coordinates (1, 0) A , (3, 0) B and (2,1) C compute the
coordinates of the resulting figure when the triangle is rotated by 60
·
, scaled with a factor of 1.5
in both x - and y -direction, and translated 2 units to the right and 3 units down.
Exercise 30 Use a map sheet of your choice and perform the procedure for setting up the transformation
parameters in manual digitizing using four control points and a six-parameter transformation.

59

athematical structures are used to describe real world processes or
phenomena. As we have seen before, there are three main
structures in mathematics: algebras, topological structures, and
order structures. In this chapter we will describe algebraic structures (or algebras)
that are characterized by a set on which operations are defined for the elements of
this set.
These operations are needed when we want to “compute” or “calculate” with the
elements of a set. Often we need to identify mappings from one algebra to
another. If the structure is preserved under such a mapping, we call it a structure
preserving mapping or homomorphism.

CHAPTER
8
Algebraic St ruct ures

M
60 THE MATHEMATICS OF GIS

8.1 Component s of an Al gebra
Definition 38 (Algebra). Whenever we specify an algebra we need to describe the
following components:
- A set S , the carrier of the algebra.
- Operations defined on the elements of the carrier, and
- Distinguished elements of the carrier, the constants of the algebra
The carrier S of an algebra is a set of elements on which operations are defined.
Examples of carriers are number sets such as  (natural numbers),  (integers), or 
(real numbers). Operations are defined as a mapping S S
m
÷ : · where the m is called
the “arity” of the operation. Operations from S S S ÷ =
1
are called unary operations.
As an example of a unary operation consider the operation “–” that assigns the negative
value to an element, i.e., it takes the number x to x ÷ . Binary operations are mappings
from S S ÷
2
and operate on two elements of the carrier. Examples of a binary operation
are addition y x + and multiplication y x · of elements. The constants of an algebra are
distinguished elements of the carrier set with properties of special importance. Algebras
are denoted as n-tuples <carrier, operations, constants>.
Example 63. The real numbers  with the binary operations ) (+ (addition) and multiplication
) (· , the unary operation ) (÷ and the constants 0 and 1 are an algebra that is represented as the 6-
tuple , , , , 0,1 < + · ÷ >  .
8.1.1 Signat ure and Variet y
Often we look at a class of algebras such that every member of the class has the same
characteristics.
Definition 39 (Signature of an algebra). Two algebras have the same signature (or
are of the same species) if their n-tuples include the same number of operations and
constants and the arities of corresponding operations are the same.
Example 64. The algebras , , ,1, 0 < + · >  and > C · ¸ < , , , ), ( S S have the same signature
because they posses two binary operations + ( and ) · and ( and ) · and two constants (1 and 0)
and S ( and ) C , respectively.
Example 65. The algebras , , 0 < + >  and , < + >  are not of the same species, because the
number of constants is not the same. The second algebra does not possess any constants.
Algebras that have the same signature need not be related at all. In order to be able to
distinguish different classes of algebras that “behave” in the same way, we need certain
rules that are valid for the elements of the carrier. Such “rules” are called axioms and are
written as equations of elements of the carrier.
Definition 40 (Variety). A set of axioms for the elements of the carrier, together with a
signature, specifies a class of algebras called variety.
ALGEBRAIC STRUCTURES 61

Algebras that belong to the same variety behave in exactly the same way. Although the
carrier set, operations and constants may be different, all algebras of the same variety
obey the same axioms. In the following sections, we will discuss some of the more
important varieties of algebras.
Example 66. Consider the variety of algebras with the same signature , , 0 < + >  and the
following axioms: (i) x y y x + = + , (ii) ) ( ) ( z y x z y x + + = + + , and (iii) x x x = + = + 0 0 . Then
, , 0 < + >  , > C ¸ < , ), (S , > · ¸ < S S , ), ( , and , ,1 < >   are all members of this variety, where
the binary operations are denoted as “+”, “ ”, “ ·”, and “  ”, and the constants are “0”, “ C”, “
S ”, and “1”, respectively. Any theorem proven for this variety will hold for all algebras that
belong to this variety.
For the remainder of this chapter, whenever we deal with an arbitrary algebra A, we will
use the following notation > A =< k S A , , ,· , where S is the carrier, · denotes a binary
operation, A a unary operation, and k a constant.
8.1.2 Ident it y and Zero Element s
Constants possess special properties relative to one or more operations in an algebra. The
following definition describes the most important properties of constants for binary
operations.
Definition 41 (Identity and Zero Element). Let · be a binary operation on S . An
element S e 1 is an identity (or unit) for the operation · if S x e ¬ , x x x = = 1 1 · · .
An element S e 0 is a zero for the operation · if S x e ¬ , 0 0 0 = = · · x x . If no
confusion can result we may not specify the operation and speak of an identity (or
identity element) and a zero (or zero element).
Example 67. The algebra , ,1, 0 < · >  with the multiplication as operation has an identity 1 and a
zero 0.
Example 68. The algebra , , 0 < + >  has an identity 0 but no zero element.
If identities exist, we can define the inverse with respect to an operation.
Let · be a binary operation on S , and 1 an identity for this operation. If 1 = = x y y x · ·
for every y in S , then x is called (two-sided) inverse of y with respect to the operation
· .
Example 69. The algebra , , 0 < + >  has an identity 0 and every element x e has an inverse
with respect to the addition. The inverse of x is written as x ÷ and 0 ) ( = ÷ + x x .
Example 70. The algebra , ,1 < · >  has an identity 1 and all elements x of the real numbers
except 0 have an inverse
x
x
1
1
=
÷
such that 1
1
= ·
x
x .
8.2 Vari et i es of Al gebras
Algebras play an important role in many applications of computer science such as formal
languages and automata theory as well as in coding theory and switching theory. In
spatial analysis map algebra, i.e., operations on (usually raster) data sets, is very common.
In this section, we will discuss a few algebras of importance.
62 THE MATHEMATICS OF GIS

8.2.1 Group
Many algebraic structures are the basis of arithmetic, as we usually know it for numbers
(integers, rational and real numbers). One basic structure is a group that formalizes the
arithmetic of one binary operation (usually addition or multiplication for number sets).
Definition 42 (Group). A group is an algebra with the signature > <
÷
1 , , ,· S with one
binary ( · ) and one unary (
÷
) operation, where
÷
is the inverse with respect to · , and
the following axioms:
1. c b a c b a · · · · ) ( ) ( =
2. a a a = = · · 1 1
3. 1 = a a ·
If the operation · is also commutative, then we call the group a commutative group (or
Abelian group).
Example 71. The algebra , , , 0 < + ÷ >  is a commutative group where  are the integers, + the
usual addition, – the inverse (negative number) with regard to the addition, and 0 the identity for
the addition. The axioms can be easily verified as:
1. c b a c b a + + = + + ) ( ) (
2. a a a = + = + 0 0
3. 0 ) ( = ÷ + a a
4. a b b a + = +
Example 72. The algebra
1
{0}, , ,1
÷
< ÷ - >  is a commutative group where  are the real
numbers, - is the usual multiplication,
1 ÷
the inverse with regard to the multiplication, and 1 the
identity for the multiplication. The axioms are verified as follows:
1. c b a c b a - - = - - ) ( ) (
2. a a a = - = - 1 1
3. 1
1
= -
÷
a a
4. a b b a - = -
Example 73. The natural numbers  with addition and multiplication are not a group because
there is no inverse with regard to addition and multiplication.
8.2.2 Field
Fields are very general algebras that formally describe the interrelation of two binary
operations on a carrier set. Simply speaking, a field guarantees all arithmetic operations
(as we know them for instance from the usual number sets) without restrictions (except
division by zero).
Definition 43 (Field). A field is an algebra with the signature > + <
÷ ÷
1 , 0 , , , , ,
1
· S
where
÷
and
1 ÷
are the inverse operations for + and · , respectively; and the following
axioms:
1. > + <
÷
0 , , , S is a commutative group
2. c b a c b a · · · · ) ( ) ( =
3. c a b a c b a · · · + = + ) (
4. c b c a c b a · · · + = + ) (
ALGEBRAIC STRUCTURES 63

5. > ÷ <
÷
1 , , }, 0 {
1
· S is a commutative group
Example 74. The real numbers
1
, , , , , 0,1
÷ ÷
< + - >  are a field with addition and multiplication
as binary operations, and the inverse unary operations for addition and multiplication. The
numbers 0 and 1 function as identity elements for + and - , respectively. The axioms are verified
as
1. See Example 71
2. c b a c b a - - = - - ) ( ) ( (associative law of multiplication)
3. c a b a c b a - + - = + - ) ( (distributive law)
4. c b c a c b a - + - = - + ) ( (distributive law)
5. See Example 72
8.2.3 Boolean Algebra
Definition 44 (Boolean Algebra). A Boolean algebra has a signature > + <
÷
1 , 0 , , , , · S
where + and · are binary operations, and
÷
is a unary operation (the
complementation), with the axioms:
1. a b b a + = +
2. a b b a · · =
3. ) ( ) ( c b a c b a + + = + +
4. ) ( ) ( c b a c b a · · · · =
5. c a b a c b a · · · + = + ) (
6. ) ( ) ( ) ( c a b a c b a + + = + · ·
7. a a = + 0
8. a a = 1 ·
9. 1 = + a a
10. 0 = a a ·
Example 75. The power set ) ( A ¸ of a given set A with the usual set operations of union,
intersection and complement relative to A is a Boolean algebra > C · ¸ <
÷
A A , , , , ), ( . Let X ,
Y and Z be arbitrary subsets of A (i.e., elements of the power set of A ) then the axioms can
easily be verified as
1. X Y Y X =
2. X Y Y X · = ·
3. ) ( ) ( Z Y X Z Y X =
4. ) ( ) ( Z Y X Z Y X · · = · ·
5. ) ( ) ( ) ( Z X Y X Z Y X · · = ·
6. ) ( ) ( ) ( Z X Y X Z Y X · = ·
7. X X = C
8. X A X = ·
9. A X X =
10. C = · X X
8.2.4 Vect or Space
Some algebraic structures are defined on more than one set. Vector spaces are one
example.
64 THE MATHEMATICS OF GIS

Definition 45 (Vector Space). Let > + <
÷
0 , , , V be a commutative group and
> + <
÷ ÷
1 , 0 , , , , ,
1
· S a field. V is called a vector space over S , if for all V b a e , and
S e | o,
1. b a b a - + - = + - o o o ) (
2. a a a - + - = - + | o | o ) (
3. ) ( ) ( a a - - = - - | o | o
4. a a = - 1
The elements of V are called vectors; the elements of S are called scalars.
Example 76. The set of all vectors with + as the vector addition is a vector space over the real
numbers where - is the multiplication of a vector with a scalar.
Example 77. The set of all matrices with the matrix addition is a vector space over the real
numbers with - being the multiplication of a matrix with a scalar.
Vector spaces play an important role in the mathematical discipline of linear algebra, a
sub-discipline of algebra.
8.3 Homomor phi sm
Often we need to compare algebras to find out whether they are similar. If two algebras
are similar they show the same “behavior” in terms of their operations and they have
corresponding constants. Often we know an algebra very well; i.e., we have established
theorems for this algebra. If we can show that a different algebra is related to the given
algebra (usually we want to show that they are essentially the same in terms of their
behavior), then the same theorems (in a related way) also hold for the new algebra.
A formal way of investigating related algebras is to establish a structure-preserving
mapping from the (given) algebra to the new algebra. Such a mapping is called a
homomorphism.
Definition 46 (Homomorphism and Isomorphism). Let > A =< k S A , , ,· and
> ' A' ' ' =< ' k S A , , ,· be algebras with the same signature, and let h be a function such
that
1. S S h ' ÷ :
2. ) ( ) ( ) ( b h a h b a h · · ' =
3. )) ( ( )) ( ( a h a h A' = A
4. k k h ' = ) (
Then h is called a homomorphism from A to A' . If the function h is bijective then
we call it an isomorphism from A to A' , and A' is an isomorphic image of A under
the map h .
In the definition above · and ·' represent binary operations, A and A' unary
operations, and k and k' are constants.
Two algebras that are isomorphic are essentially the same algebra with different names.
A homomorphic image of an algebra is a “smaller” or “generalized” version of the given
algebra.
ALGEBRAIC

8.4 Ap
C STRUCTURES
Example
=< , 0 { B
) ( :¸ S h
0 ) ( = C h
Example
, , 0 < + 
surjectiv
logarithm
) ( b a h = ·
the math
their log
ppl i cat i on
Perhaps
carrier s
by cove
We kno
operatio
of calcu
An exam
cell carr
Spatial A
well as
The con
where w
We will
e 78. Let S
> · +
÷
1 , 0 , , , }, 1 ,
} 1 , 0 { ÷ defin
0 and ) ( = S h
e 79. Let 
0 > and the fu
ve, because f
mic function
l ) log( b a = · =
hematical bas
arithms.
s i n GIS
s the most p
set of the ma
erage, shapef
ow many ope
ulating slope,
mple of a co
ries the valu
Analyst raste
functions tha
ncept of stru
we map a su
S be a n
be two Boo
ned as = T h ) (
1 .
+
be the set o
unction : h
+

for 0 > x the
n is monoto
) log( ) og( b a +
is for the slid
prominent ap
ap algebra is
file, grid or la
erations for
on, subtractio
, aspect or hi
onstant of th
ue zero. Figu
er calculator
at can be app
Figu
ucture-preser
ubset of the r
is subject in
non-empty
olean algebra
¹
´
¦
e
e
=
T a
T a
if 1
if 0
of all positive
÷ with h
equation lo
one increasin
) ( ) ( ) b h a h + =
de rule that re
pplication of
the set of “m
ayer.
manipulatin
on, multiplic
he map algeb
ure 25 show
r. Here, we s
plied to map
ure 25. Raster
rving mappi
real world to
chapter 13.
set and tw
as. For any
T
T
is a homom
e real numbers
x x h log ) ( = is
y x
a
= og alw
ng; therefore
) and l ) 1 ( = h
eplaces multip
f algebras in
maps”, i.e., d
ng maps. Th
cation or div
bra would be
ws the expand
see various a
layers.
calculator int
ng finds an
o a represen
wo ¸ =< S A (
y S ae and
morphism from
s. Then
+
< 
s an isomorphi
ways has a s
e h is inje
0 ) 1 og( = . Th
plication of n
n GIS is the
data sets that
hey range fro
ision to mor
e the zero gr
ded user inte
arithmetic an
terface
application
ntation in a s
C ·
÷
S , , , , ),
) (S T ¸ e the
m A to B .
, ,1
+
· > is isom
ism. The fun
solution a x =
ective. Fur
he given isomo
numbers by a
e map algeb
t are often re
om simple a
e complex o
rid, where ev
erface of the
nd logical ope
in spatial m
spatial featur
65
> S and
e function
Note that
morphic to
ction h is
y
a . The
rthermore,
orphism is
ddition of
bra. The
eferred to
arithmetic
perations
very grid
e ArcMap
erators as

modeling,
re model.
66 THE MATHEMATICS OF GIS

8.5 Exerci ses
Exercise 31 Given are two algebras: , , , 0 < + ÷ >  with the integers as carrier set, two operations, addition ( + )
and negative number (-), and the constant 0; > ÷ + < 0 , , , E with the even numbers as carrier set, the
constant 0 and the operations ( + ) and (-) defined in the usual way (addition and negative number,
respectively). Show that both algebras are Abelian groups and that the function : f ÷E  ,
defined as x x f 2 ) ( = , is an isomorphism.
Exercise 32 Let } , { F T be a set where T stands for “true” and F stands for “false”. Show that
> ÷ . v < T F F T , , , , }, , { is a Boolean algebra with the binary operations “and” ( . ), “or” ( v ), and
the unary operation “not” ( ÷ ) being logical operators. The constants F and T are propositions
that are always false ( F ) and always true ( T ), respectively.
Exercise 33 Given are two algebras: , , , 0 < + ÷ >  with the integers as carrier set, two operations, addition ( + )
and negative number (-), and the constant 0; and > ÷ + < 0 , , , B with the carrier set } 1 , 0 { = B , the
constant 0 and two operations defined as
0 1 1
1 0 0
1 0 +
and x x = ÷ ) ( . Show that the function
: f B ÷  , defined as
¹
´
¦
=
odd is 1
even is 0
) (
x
x
x f , is a homomorphism. Why is f not an
isomorphism?

67

opology is a central concept in every GIS. It deals with the structural
representation of spatial features and their properties that remain
invariant under certain transformations. In this chapter, we introduce
the mathematical concept of a topological space based on the topology that is
induced on the real plane by a distance function.
We also show how simple structures can be used to build complex objects in GIS
databases, and how to check the consistency of a two-dimensional topologic
representation of spatial features.

CHAPTER
9
Topology

T
68 THE MATHEMATICS OF GIS

9.1 Topol ogi cal Spaces
In this chapter, we will deal with topological spaces, i.e., a set and a collection of subsets
of this set that satisfy certain conditions. There are two equivalent approaches to define a
topological space. The first one starts with the concept of a neighborhood of a point and
defines a topological space as a system of neighborhoods that fulfill certain conditions.
The concept of open sets follows from the definition of a neighborhood. The second
approach starts from a family of subsets of a given set (which are called open sets) and
defines a topology through properties of these open sets. The concept of a neighborhood
follows from the definition of a topological space.
9.1.1 Met ric Spaces and Neighborhoods
The first approach is more intuitive than the second one that is usually used in general
topology (or point-set topology). For our purpose, we chose the intuitive approach on the
Euclidean plane with a system of neighborhoods. In order to define a neighborhood we
need the concept of a distance. Generally, this can be achieved with a metric space.
Definition 47 (Metric Space). Let X be a nonempty set and d a function
0
X X
+
× ÷ such that for every , , x y z X e
(i) ( , ) 0 d x y = if and only if x y =
(ii) ( , ) ( , ) d x y d y x =
(iii) ( , ) ( , ) ( , ) d x y d y z d x z + > (triangle inequality)
We call the pair ( , ) X d a metric space and d a distance function (or metric) on X .
Example 80. Let us consider the real plane
2
 equipped with the Euclidean distance
2 2
1 1 2 2
( , ) ( ) ( )
E
d p q a b a b = ÷ + ÷ between two points
1 2
( , ) p a a = and
1 2
( , ) q b b = . We call this
space the 2-dimensional Euclidean space.
2
( , )
E
d  is a metric space. The Euclidean distance is
the shortest distance between two points. This is the usual space of plane geometry. We can
easily extend this space to three dimensions.
Example 81. The real numbers  with the distance function ( , ) d x y x y = ÷ are a metric space.
In every metric space, we can define a neighborhood for points of this space.
Definition 48 ( c -neighborhood). In a metric space ( , ) X d , for each x X e and each
0 c > , we define an (open) c -neighborhood of x as the set
( , ) { | ( , ) } N x y y X d x y c c = e . < . When no confusion is possible we call ( , ) N x c
neighborhood and write ( ) N x .
The set ( ) { ( , ) | 0}
d
x N x x X c c = e . > N is called the neighborhood system of x
induced by the metric d . In short we will write ( ) x N .
In the Euclidean plane
2
 an open disk with radius c around a point p is an c -
neighborhood (Figure 26).
TOPOLOGY 69

Figure 26. Open disk in
2

9.1.2 Topology and Open Set s
When we require a neighborhood system to satisfy certain conditions, we arrive at the
definition of a topological space.
Definition 49 (Topological space). Let X be a set and for every x X e there exists a
neighborhood system ( ) ( ) x X _¸ N that satisfies the following conditions
(neighborhood axioms):
(N1) The point x lies in each of its neighborhoods.
(N2) The intersection of two neighborhoods of x is itself a neighborhood.
(N3) Every superset U of a neighborhood N of x is a neighborhood of x . X is a
neighborhood of x .
(N4) Every neighborhood N of x contains a neighborhood V of x such that N is a
neighborhood of every point of V .
We then call the set with its neighborhood system ( , ( )) X x N a topological space.
Sometimes we denote a topological space simply by X .
Figure 27 illustrates the four neighborhood axioms. With the help of the concept of a
neighborhood, we can now define open sets.
Definition 50 (Open set). Let X be a topological space. A subset O of X is an open
set if it is a neighborhood for each of its points.
Example 82. The open intervals ( , ) a b in the real numbers and the open disks in
2
 are open
sets.
Definition 51 (Closed set). Let X be a topological space. A set C is closed if its
complement X C ÷ is open.
1 2
( , ) p a a =
c
D
70 THE MATHEMATICS OF GIS

Figure 27. Neighborhood axioms
Example 83. The closed interval [ , ] a b in the real numbers is a closed set, because its complement
( , ) ( , ) a b ÷· · is the union of two open sets, which again is an open set.
Example 84. The half-open interval ( , ] a b in the real numbers is neither open nor closed.
The previous example shows that “closed” does not mean “not open”. Sets can be neither
open nor closed, or they can be both open and closed (sometimes called clopen sets). The
following statements can be proven to be true for open sets.
(O1) The empty set C and the set X are open.
(O2) The intersection of any finite number of open sets is open.
(O3) The union of any number of open sets is open.
(O4) A subset U of X is a neighborhood of x X e if and only if there exists an open
set O with x O U e _ .
The intersection of an arbitrary number of open sets does not need to be open. Take for
example the intersection of an infinite collection of open intervals
1 1
( , )
n n
÷ + for 1, 2,3,... n =
Obviously, the intersection is the set {0} which is not an open set.
It can be proven that the intersection of an arbitrary number of closed sets, and the union
of a finite number of closed sets, are closed.
Our approach to the definition of a topological space is based on the concept of the c -
neighborhood defined in a metric space. For this definition we needed the distance, a
concept which is too special for general topological spaces. Statement (O4) above gives
us a way to define neighborhoods without the notion of distance. Here, we also see that a
neighborhood does not need to be an open set; it can also be a closed set. As an example
consider a point p of the Euclidean plane
2
 . Every closed disk around p is a
neighborhood of p , because it contains the open disk around p , which is an open set.
x
x
U
N
x
N
V
( i )
( i v) ( i i i )
( i i )
x
1
N
2
N
TOPOLOGY 71

9.1.3 Cont inuous Funct ions and Homeomorphisms
We can define mappings between topological spaces. A function that maps the
neighborhood of a point to the neighborhood of the image of this point is called a
continuous function. We can define it formally as follows.
Definition 52 (Continuous function). Let : f X Y ÷ be a function from the
topological space X to the topological space Y . We call f continuous at point
0
x X e if for every neighborhood V of
0
( ) f x there is a neighborhood U of
0
x such
that the image of U , i.e., ( ) f U , is a subset of V . If f is continuous at every point of
X , we call it a continuous function.
Figure 28 illustrates both concepts of continuity at a point and continuous function.
0
( ) f x
0
x
X
Y
U
V
( ) f U
f

Figure 28. Continuous function
The definition above is valid for any two topological spaces. For the real numbers ,
the definition of continuity usually reduces to the following statement:
A function : f ÷   is continuous at point
0
x if for every 0 c > there exists a 0 o >
such that
0
| | x x o ÷ < implies
0
| ( ) ( ) | f x f x c ÷ < . A function is continuous if it is
continuous at every point. Continuity of a function essentially means that the graph of
the function has no “jumps” or “gaps”.
Like in other mathematical structures, also for topological spaces we know structure-
preserving mappings. They map one topological space to another topological space
thereby preserving the topology.
Definition 53 (Homeomorphism). Let : h X Y ÷ be a function from the topological
space X to the topological space Y . If this function is continuous, bijective, and
possesses a continuous inverse, we call it a homoeomorphism (or topological mapping).
If two spaces are homeomorphic they are essentially the same and expose the same
topological behavior.
Example 85. Let ( 1,1) X = ÷ be an open interval in  and : f X ÷ a function defined as
( ) tan
2
f x x
t
= . This function is bijective, continuous and has a continuous inverse. Figure 29
shows the graph of the function. It is a homeomorphism. This means that the open interval (-1,1)
and the real numbers are homeomorphic.
72 THE MATHEMATICS OF GIS

-1 -0.5 0.5 1
-75
-50
-25
25
50
75

Figure 29. Example of a homeomorphic function
Example 86. The open disk
1
{( , ) | 1} D r r u = < given with its polar coordinates ( , ) r u and radius
1 is homeomorphic to the open disk
2
{( , ) | 2} D r r u = < with radius 2 through the function
(( , )) (2 , ) f r r u u = .
A property of a topological space that is preserved by a homeomorphism is called a
topological property or a topological invariant. Mathematical topology is mainly
focused on properties of topological spaces that remain invariant under topological
mappings.
The two previous examples show that length and area are not topological invariants,
because the length of the interval (-1,1) is different from the “length” of the real line, and
in the second example both disks are homeomorphic but their areas are not the same.
9.1.4 Alt ernat e Definit ion of a Topological Space
As mentioned earlier, a different, yet equivalent, definition of a topological space starts
with the idea of an open set, defines a topology as properties of a collection of open sets
and derives the definition of a neighborhood from the open sets. We take the properties
O1 to O3 of open sets as axioms and define a topological space as follows.
Definition 54 (Topological Space). Let X be a set and O a collection of subsets of
X , i.e., ( ) O X _¸ . We call O a topology on X when the subsets satisfy the
following three conditions:
(O1) , O X O Ce e
(O2) , A B O A B O e ¬ · e
(O3)
i i
i I
A O A O
¬ e
e ¬ e
¸

We call the
i
O open sets, ( , ) X O a topological space and the elements x X e the
points of the topological space.
The three conditions for a topology require that the empty set and the set itself must
always be a member of the topology. Further, the intersection of a finite number of open
TOPOLOGY 73

sets always is an open set, and the union of an arbitrary number of open sets is an open
set.
With the help of the open sets used in the definition of a topology we can now define a
neighborhood.
Definition 55. (Neighborhood). N is a neighborhood of the point x if N X _ and
there exists an open set A O e such that x A N e _ .
With this definition, we can prove the statements N1 to N4 of Definition 49 about
neighborhoods to be true.
Example 87. Two extreme topologies can be found on any set X . The first one consists only of
two elements { , } X C , the second one consists of all subsets of X , i.e., the power set ( ) X ¸ . We
can easily verify that the three conditions are satisfied for both topologies. The first topology is
called indiscrete topology. It is the coarsest of all topologies, because it consists only of two
elements. The second one is called discrete topology, which is the finest of all topologies.
Example 88. Consider the real line
1
 . We call a subset A of
1
 an open set if it is either empty
or with each of its points x A e contains an open interval
x
S that completely lies within A . All
open intervals ( , ) a b on the real line
1
 are open sets. The real line itself is an open set. Again,
we can show that these open sets are a topology on
1
 . We call it the natural topology. This can
be extended to the
n
 with open disks, balls, etc.
Both approaches to the definition of a topological space as mentioned above are equally
valid and lead to the same results. Figure 30 summarizes both approaches: the intuitive
approach based on the concept of a neighborhood, and the set theoretic abstract approach
based on the concept of open sets.

Figure 30. Equivalent approaches to the definition of a topological space, open sets and
neighborhoods and related theorems
The first one defines a topological space through properties of neighborhoods. Open sets
are then defined through neighborhoods, and the properties O1 to O4 follow as theorems.
( , { ( ) | } ) X x x X e N ( , ) X O
Topol ogi cal space
based on concept of
nei ghborhood
( N1 t o N4) :
Topol ogi cal space
Based on concept of
open set
( O1 t o O3) :
Def i ni t i on
of open set
Def i ni t i on of
nei ghborhood ( O4)
Propert i es
of open set s:
O1 t o O4
Propert i es
of nei ghborhoods:
N1 t o N4
More t heor ems
Axi oms
Theorems
74 THE MATHEMATICS OF GIS

The second approach defines a topological space through properties of open sets. It then
defines neighborhoods through property O4 of open sets, and derives N1 to N4 as
there.
9.2 Base, Int eri or, Cl osure, Boundar y, and Ext eri or
From the definition of a topological space we know that the union of open sets is an open
set. If in a topological space every open set can be generated as the union of some open
sets, we call these sets a base of the topology.
Definition 56 (Base). Let X be a topological space and a collection B of open sets
such that every open set of the topology is the union of members of B . Then B is
called a base for the topology and the elements of B are called basic open sets.
An equivalent definition for a base requires that for every point x X e that belongs to
an open set O there is always an element BeB such that x B O e c .
Example 89. The open disks in the Euclidean plane
2
 are a base for the natural topology of the
plane. This follows easily from the definition of a neighborhood. The number of the basic open
sets is uncountable infinite.
Example 90. The open disks in the Euclidean plane
2
 with radii and center coordinates being
rational numbers are a base for the natural topology of the plane. Note that the number of the
basic open sets is countably infinite.
Whereas a base for a topology is a global characteristic of a topological space, we can
also define a local base at a point of a topological space. This is a local characteristic of a
topological space determined only by the neighborhood of the point.
Definition 57 (Local base). A collection B of neighborhoods of a point x of a
topological space X is a local base at x if every neighborhood of x contains some
member of B .
Example 91. Consider the natural topology in the Euclidean plane
2
 and a point x . The system
of open disks
x
B with center x is a local base at x . This is true because for every open set O that
contains x there is an open disk with center at x that is contained in O .
Example 92. Let x be a point of a metric space. The countably infinite set of c -neighborhoods
of x defined as
1 1
2 3
{ ( ,1), ( , ), ( , ), } N x N x N x . is a local base at x .
The relationship between a base of a topology and a local base at a point can be expressed
in the following statement:
Let B be the base for a topology and x X e a point of the topological space. Then the
members of B that contain x form a local base at x .
For further investigations, we need the concepts of interior, closure, boundary and
exterior of a set.
Definition 58 (Interior, Closure, Boundary, Exterior). Given a subset A of a
topological space X we define the interior, closure and boundary as follows:
TOPOLOGY 75

- The union, of all open sets contained in A is called the interior of A (written as
A
°
).
- The smallest closed set containing A is called the closure of A (written as A ), in
other words it is the intersection of all closed sets containing A.
13

- The boundary of set A is the intersection of the closure of A with the closure of its
complement X A ÷ . The boundary
14
is written as A c .
- The exterior of a set A (written as A
÷
) is the interior of the complement of A, i.e.,
( ) A X A
÷
= ÷
·

An open set is its own interior. A closed set is equal to its closure. The following table
shows some properties of interior, closure, and boundary.
Table 11. Properties of interior, closure, and boundary of a set
Interior Closure Boundary
A A
°
_ , ( ) A A
° ° °
= A A _ , A A = A A A
°
c = ÷
A B A B
° °
_ ¬ _ A B A B _ ¬ _ ( ) A A X A
°
c = · ÷
( ) A B A B
° ° °
· = ·
A B A B = A A X A c = · ÷
i i
i I i I
A A
°
°
e e
| |
_
|
\ .
¸ ¸

i i
i I i I
A A
e e
_
¸ ¸

( ( )) A X A X A
° °
c = ÷ ÷
i i
i I i I
A A
°
°
e e
| |
_
|
\ .
¸ ¸

i i
i I i I
A A
e e
_
¸ ¸

( ) A X A c = c ÷
Example 93. Consider the set { , , , , } X a b c d e = , the topology O defined on X as
{ , ,{ },{ , },{ , , },{ , , , }} O X a c d a c d b c d e = C and the subset { , , } A b c d = of X . The interior of A is
{ , } A c d =
·
, because the only open sets contained in A are { , } c d and C whose union is { , } c d .
The closure of A is { , , , } A b c d e = , because among the closed sets
15
of X , i.e., C , X ,
{ , , , } b c d e , { , , } a b e , { , } b e , and { } a , the smallest one that contains A is { , , , } b c d e . The
boundary of A is the difference of the closure with the interior, i.e.,
{ , , , } { , } { , } A A A b c d e c d b e c = ÷ = ÷ =
·
. The exterior of A is the interior of the complement of
A , i.e., { , } a e
·
, which results to { } a .
Example 94. Let us consider an open subset A of the Euclidean plane
2
 . Figure 31 illustrates
the interior, boundary, closure and exterior of the set.

13
Note that we use for closure the same symbol as for the set complement. They are, however, not
related to each other.
14
The boundary of a set is often denoted as frontier of a set.
15
The closed sets are the complements of the open sets.
76 THE MATHEMATICS OF GIS

A
·
A c
A
A
÷

Figure 31. Interior (upper left), boundary (upper right), closure (lower left) and exterior (lower
right) of an open set
9.3 Cl assi fi cat i on of Topol ogi cal Spaces
There are several ways to classify topological spaces. Usually, this is done according to
the degree to which their points are separated, regarding their compactness, their overall
size, and their connectedness. Let us look at each of them in some detail.
9.3.1 Separat ion Axioms
In topology we know many different ways to distinguish disjoint sets and distinct points.
We first present axioms that separate two distinct points.
Definition 59 (T
0
space). We call a topological space T
0
(or a T
0
space) if for two
distinct points at least one has a neighborhood that does not contain the other point.
Definition 60 (T
1
space). We call a topological space T
1
(or a T
1
space) if two distinct
points have neighborhoods that do not contain the other point.
Definition 61 (HAUSDORFF Space). A topological space X is called a HAUSDORFF
space or T
2
space if two distinct points , a b X e possess disjoint open neighborhoods.
In other words, there exist two open sets A and B with a A e and b B e and
A B · = C.
Every metric space with the metric topology is T
2
. HAUSDORFF spaces are always T
1
,
and every T
1
space is always T
0
.
Figure 32 illustrates separation axioms T
0
, T
1
, and T
2
.
TOPOLOGY 77

y
x
1
( ) N x eN
1
y N e
0
T - axi om
2
1
x N
y N
e
e
1
T - axi om
y
2
( ) N y eN
x
1
( ) N x eN
1 2
N N · = C
2
T - axi om
y
2
( ) N y eN
x
1
( ) N x eN

Figure 32. Separation axioms T
0
, T
1
, and T
2

We now look at axioms that separate sets. First we define an axiom that separates closed
sets from the points that lie outside that set.
Definition 62 (Regular space). If a topological space is T
1
and for every closed set C
and every point x outside C there exists an open set A that contains C and a disjoint
neighborhood N of x , then we call this space a regular space or T
3
space.
Every metric space with the metric topology is regular. Every regular space is a
HAUSDORFF space. The converse is not true, because there are HAUSDORFF spaces that
are not regular.
Finally, we introduce a separation axiom that separates closed sets.
Definition 63 (Normal space). If a topological space is T
1
and for any two disjoint
closed sets
1
C and
2
C there exist disjoint neighborhoods that contain the closed sets,
then we call this space a normal space or T
4
space.
Every metric space with the metric topology is normal, and every normal space is regular.
The converse is not true, because there exist regular spaces that are not normal.
Figure 33 illustrates the axioms that lead to the definition of regular (T
3
and T
1
axioms)
and normal spaces (T
4
and T
1
axioms).
78 THE MATHEMATICS OF GIS

A N · = C
3
T - axi om
A B · = C
4
T - axi om
x
( ) N x eN
A O e
C
B O e
2
C
A O e
1
C

Figure 33. Separation axioms T
3
and T
4

The following Figure 34 shows the relations between the separation characteristics of
topological spaces.
Met r i c spaces
Nor mal spaces
Regul ar spaces
Hausdorf f spaces
T
1
spaces
T
0
spaces

Figure 34. Relationship between separation characteristics of topological spaces
Separation characteristics are topological properties of a space, i.e., if a topological space
X has a certain separation characteristic and there is a homeomorphism from X to a
topological space Y , also Y will have the same characteristic. We see that a metric
space is a very special case of a topological space that possesses all separation
characteristics.
9.3.2 Compact ness
In this section we discuss properties of topological spaces whose conditions are stronger
than separation characteristics. These conditions are defined by what is called open
covers. Finally, we will see that subsets of a Euclidean space which are both closed and
bounded
16
are of special importance.

16
A set is bounded when it is contained in some open ball with finite radius.
TOPOLOGY 79

Definition 64 (Open cover). Let X be a topological space and F a family of open
subsets of X . If the union of these subsets is the whole space X , we call F an open
cover of X . If ' F is a subfamily of F with X ' = ¸F , then ' F is a subcover of F .
Example 95. Consider all open disks in the Euclidean plane
2
 whose radius is 1 and their
centers have integer coordinates. The union of these disks covers the whole space. Therefore,
they are an open cover of
2
 . If we leave out one disk, their union is not the whole space any
more. Therefore, this family of open disks has no subcover.
If a topological space has a finite subcover, we call this space with a special name.
Definition 65 (Compact space). If every open cover of a topological space has a
finite subcover, we call a compact space.
The following spaces are compact:
- The closed unit interval [0, 1]
- Any finite topological space
- A closed interval, disk or ball in
1
 ,
2
 , or
3
 , respectively
The following statements can be made about compact spaces. Their proofs can be found
in the topological literature:
(i) A continuous image of a compact space is compact.
17

(ii) A closed subset of a compact space is compact.
(iii) A subset of the Euclidean -space is compact if and only if it is closed and
bounded.
(iv) A compact HAUSDORFF space is normal.
The results from the previous section about separation and the last item from the previous
list tell us that metric spaces as well as compact HAUSDORFF spaces are normal.
If we relax the condition for compactness to have a countable instead of a finite cover we
arrive at the definition of a LINDELÖF space.
Definition 66 (LINDELÖF space). If every open cover of a topological space has a
countable subcover, we call a LINDELÖF space (or we say that space is
LINDELÖF). Compact spaces are always LINDELÖF.
Example 96. The Euclidean plane
2
 equipped with the natural topology of open disks is a
LINDELÖF space.
Compactness is a topological property that remains invariant under homeomorphisms.

17
This proposition states that compactness as a topological property is even preserved under the weaker
condition of a continuous mapping (and not a homeomorphism).
X
X
n
X
X X
80 THE MATHEMATICS OF GIS

9.3.3 Size
A further characterization of topological spaces can be done according to their size. A
measure for the size of a set is its cardinality, or number of elements. We recall from
chapter 5 on set theory that a set is countable if it has either a finite number of elements
or is countably infinite.
In order to proceed we need the definition of the term dense.
Definition 67 (Dense set). A subset A of a topological space X is dense if its closure
is X , i.e., A X = .
Example 97. The rational numbers  are a dense subset of the real numbers, because it can be
shown that =   . The rational numbers are countably infinite.
With both properties of a set to be countable and dense we can impose some limit on the
size of a topological space which leads to the definition of a separable topological space.
Definition 68 (Separable space). A topological space is separable if it has a countable
dense subset.
Example 98. The -dimensional Euclidean space is separable.
Definition 69 (First-countable). A topological space is first-countable if every point
has a countable local base.
Example 99. Every metric space is first-countable. According to Example 92 we have identified
a countable local base for a metric space. It is therefore first-countable.
Example 100. Every discrete topological space is first-countable.
First-countable is a local property of a topological space, which is solely determined by
the properties of the neighborhoods of a point. Another property of a topological space is
related more to a global characteristic of space.
Definition 70 (Second-countable). A topological space is second-countable if it has a
countable base for its topology.
Example 101. The Euclidean plane
2
 is second-countable. According to Example 90 the open
disks with rational radii and center coordinates are a countable base for
2
 . Therefore,
2
 is
second-countable.
For topological spaces we can make the following statements with regard to their size
characteristics:
If a topological space is second-countable, then it is also first-countable, separable, and
LINDELÖF.
The properties of a topological space to be separable, first-countable, and second-
countable are topological properties and remain invariant under homeomorphisms.
n
TOPOLOGY 81

9.3.4 Connect edness
Connectedness of topological spaces deals with the property of such spaces that they
cannot be divided into two disjoint nonempty open sets whose union is the entire space.
Definition 71 (Connected Space). A space X is connected if whenever it is
represented as the union of two nonempty subsets X A B = then A B · = C or
A B · = C .
Intuitively speaking, a space is connected if it appears in one piece or it cannot be
represented as the union of two disjoint open subsets. The following conditions on a
topological space X are equivalent to formulate connectedness:
(i) X is connected.
(ii) The only subsets of X that are both open and closed are the empty set C and X .
(iii) X cannot be expressed as the union of two disjoint nonempty open sets.
Example 102. The Euclidean space
n
 is connected, because the empty set and
n
 are the only
sets that are both open and closed.
Example 103. Let { , , , , } X a b c d e = be a set and { , ,{ },{ , },{ , , },{ , , , }} O X a c d a c d b c d e = C a
topology on X . Then X is not connected, because { } a and { , , , } b c d e are disjoint open sets and
{ } { , , , } X a b c d e = is the union of two disjoint nonempty open subsets.
A somewhat stronger condition can be stated when we consider how two points in a
topological space can be connected.
Definition 72 (Path-connected space). A topological space X is path-connected if
any two points
1 2
, x x X e of the space can be connected by a path. A path in a
topological space X is a continuous function :[0,1] f X ÷ such that
1
(0) f x =
(beginning point) and
2
(1) f x = (end point).
In general, every path-connected space is connected. The converse is not true. However,
for regions
18
of the Euclidean plane
2
 with the natural topology we have the following
result:
Every open connected subset of
2
 is path-connected.
Connectedness is a topological property, i.e., it remains invariant under
homeomorphisms. The image of a connected set under a continuous mapping is
connected.

18
An open connected subset of a topological space is called a region.
82 THE MATHEMATICS OF GIS

9.4 Si mpl i ci al Compl exes and Cel l Compl exes
The topological spaces we have treated so far are usually very general and too complex
for many investigations. We, therefore, look for simpler spaces that can be used instead.
These spaces can then be pieced together to form more complex spaces, yet keeping a
recognizable shape and being easy to handle.
One class of these simple spaces is polyhedra. A polyhedron is a topological space that is
built of simple building blocks, the simplexes. A generalization of polyhedra leads to cell
complexes (or CW complexes) glued together from cells.
9.4.1 Simplexes and Polyhedra
We first need to introduce the concept of a simplex. Simply speaking, a simplex is the
simplest geometric figure of a respective geometric dimension in the Euclidean space,
i.e., a point in a zero-dimensional space, a straight line segment in a one-dimensional
space, a triangle in a two-dimensional space, and a tetrahedron in a three-dimensional
space.
Definition 73 (Simplex). Given 1 k + points
0 1
, , ,
n
k
v v v e   in general position,
where k n s , we call the smallest convex set containing them a closed k -simplex (or
simplex of dimension k ), written as
k
o . The points
0
, ,
k
v v . are called the vertices of
the simplex. A closed simplex can be written as
0 0 1 1
k
k k
v v v o ì ì ì = + + + where the
0 0
, ,
k
ì ì
+
e   and
0 1
1
k
ì ì ì + + + = .
If we require
0
, ,
k
ì ì
+
e   (positive real numbers excluding zero) we get an open k -
simplex, written as
k
o .
Figure 35 illustrates the definition with closed simplexes of dimensions 0, 1, 2, and 3.

Figure 35. Simplexes of dimension 0, 1, 2, and 3
0-simplex (point)
0
v
1-simplex (closed line segment)
0
v
1
v
2-simplex (triangle)
2
v
0
v
1
v
3-simplex (solid tetrahedron)
3
v
0
v
1
v
2
v
TOPOLOGY

9.4.2 Ce

Y
The con
face of
dimensi
In Figur
faces, v
faces, si
A simpl
Euclide
complex
Defin
Eucl
satisf
1. F
2. I
Figure 3
one on
simplici
howeve
common
Note th
Howeve
a Euclid
A simpl
polyhed
Polyhed
they are
ells and Ce
For man
other ha
possesse

19
Given
open sets
Y is call
nvex hull of
the simplex
ion k n < .
re 35 the clo
0 1
, v v and
2
v ,
ix 1-faces, an
lex is a topo
an space. W
x.
nition 74 (Si
idean space 
fied:
For every sim
If two simple
36 shows tw
the left is
ial complex.
er, no commo
n face.
Figure 36. V
at a simplici
er, if we con
dean space, w
licial comple
dron, written
dra possess u
e compact an
ell Complex
ny topologic
and, general
es many usef

a topological
s of X with Y
led a subspace
a nonempty
x. If a sim
osed 1-simpl
and three 1
nd four 2-fac
ological spac
We can now p
implicial Co
n
 is called
mplex all of its
exes intersect
o collections
a simplicial
. The lower
on face. Th
Valid simplicia
ial complex
nsider the uni
we can apply
ex K , when
as | | K .
useful proper
nd a metric sp
xes
cal investigat
topological
ful propertie
space X and
Y . This gives
of X .
y subset of th
mplex is of d
lex has two
-faces,
0 1
v v ,
ces.
ce with the n
piece togeth
omplex). A f
a simplicial
s faces must a
then they mu
s of simplexe
complex.
r triangle to
he line segm
al complex (le
is a set of si
ion of all sim
y the subspac
n viewed in t
rties. As clos
pace.
tions polyhe
spaces are t
s is a cell co
a subset Y of
us the open se
he vertices o
dimension n
0-faces
0
v a
,
1 2
v v , and v
natural topol
her simplexes
finite collecti
complex if th
also be in the
ust do so in a c
es in the 2-di
The right o
ouches the o
ent intersect
eft) and invalid
implexes and
mplexes in a
ce topology
19
this way, is a
sed and boun
dra are too s
too general.
mplex.
f this space, we
ets for a new t
f a closed si
n then a k -f
and
1
v . The
2 0
v v . The tet
logy derived
s in a define
ion K of clo
he following
collection.
common face
imensional E
one violates
other one on
ts the upper
d simplicial c
d as such not
simplicial co
9
and make i
a topological
nded subsets
special and t
A concept
e define a subs
topology on Y
implex
k
o is
face is a sim
triangle has
trahedron ha
d from its em
d way to a s
osed simplexe
two conditio
e.
Euclidean sp
the conditio
the base.
triangle, but
omplex (right
t a topologic
omplex as a
it a topologic
l space that
s of a Euclide
too complex
in between
space by inter
Y , the subspace
83
s called a
mplex of
s three 0-
as four 0-
mbedding
simplicial
es in a
ons are
ace. The
ons for a
There is,
t not in a

t)
cal space.
subset of
cal space.
we call a
ean space
. On the
that also
secting the
e topology.
84 THE MATHEMATICS OF GIS

Definition 75 (Unit Ball, Unit Sphere, Unit Cell, Cell). Let
n
 be the n-dimensional
Euclidean space with the natural topology.
The subspace { | | | 1}
n n
D x x = e s  is called the n-dimensional unit ball.
The ( 1) n ÷ -dimensional subspace
1
{ | | | 1}
n n
S x x
÷
= e =  is called the ( 1) n ÷ -
dimensional unit sphere.
The subspace { | | | 1}
n n
D x x = e <

 is called the n -dimensional unit cell. A
topological space homeomorphic to
n
D
·
is called a n-dimensional cell (or n-cell).
Example 104. In
2
 the unit ball is a closed disk with radius 1, the unit sphere is the circle with
radius 1, and the unit cell is the open disk with radius 1.
Example 105. Every open n -simplex is a n -cell.
Figure 37 shows unit balls of dimension 0, 1, 2, and 3 and corresponding 0-, 1-, 2-, and 3-
cells.

Figure 37. Unit balls and cells
We can now generalize the concept of a simplicial complex to a cell complex, which is
defined as a collection of cells that are glued together in a certain way.
Definition 76 (Cell decomposition, skeleton). A cell decomposition is a topological
space X and a set C of subspaces of X whose elements are cells such that X is the
disjoint union of these cells, i.e.,
c
X c
e
=
¸
C
. The n-dimensional skeleton of X is the
subspace { | dim( ) }
n
X c c n = e s
¸
C . We have then a sequence of subspaces
1 0 1 1 n n
X X X X X
÷ ÷
C = c c c c c . with
n
X X =
¸
.
Figure 38 shows a cell decomposition of a 2-dimensional space with the 1- and 0-
dimensional skeletons.
0-dimensional unit cell
1-dimensional unit cell
2-dimensional unit cell
3-dimensional unit cell
0-cell
1-cell
2-cell
3-cell
TOPOLOGY 85

Figure 38. Cell decomposition and skeletons
Example 106. The open simplexes of a polyhedron | | K are a cell decomposition of | | K . This
means that the disjoint union of 0-, 1-, and 2-cells (of for instance a 2-dimensional polyhedron) is
equal to | | K .
Definition 77 (Closure and boundary of cells). For every cell we have c a closed
cell or the closure of c in X . The difference c c c c = ÷ is the boundary of c .
It is important to note that the boundary of a cell in general is not the same as the
boundary of a set. The boundary of a set is always defined with regard to an embedding
space, whereas the boundary of a cell is depending on the dimension of the cell which is
clearly determined.
Example 107. Consider a line segment L in
3
 . The point set topological boundary of L is
defined as
3
L L L c = · ÷  , which is all of L . If, however, L is a 1-dimensional cell, then its
boundary are the two end points.
Definition 78 (Cell complex). A HAUSDORFF space X with a cell decomposition is a
cell complex (or CW complex) if the following conditions are met:
1. For every cell c there exists a continuous function :
n
f D X ÷ such that
1 1
( )
n n
f S X
÷ ÷
c and the open cell c is a homeomorphic image of the unit cell, i.e.,
( )
n
f D c =
·
.
2. Every closed cell c is contained in a finite union of open cells.
3. A subspace A X c , such that for every cell l, A c · is closed in c , is closed in
X .
A CW complex is n -dimensional if
1 n n
X X X
÷
= = . If a cell complex has a finite
number of cells it is called a finite CW complex..
Cell decomposition
of a 2-dimensional space
1-dimensional skeleton
0-dimensional skeleton
86 THE MATHEMATICS OF GIS

Condition 1 defines a function from the n-dimensional unit ball to the space X such that
the open cell appears as a homeomorphic image of the unit cell and the ( 1) n ÷ -sphere is
continuously mapped to a subset of the
1 n
X
÷
-space. In particular, we have
1
: ( , ) ( , )
n n
f D S c c
÷
÷ c or
1
( )
n n
f D S c c
÷
= c
·
. The closed cell and the boundary are
compact. Condition 2 is also called closure finite; condition 3 is the condition for the so-
called weak topology.
The following statements underline the differences between CW complexes and
simplicial complexes:
1. Cells of a CW complex need not be geometric simplexes.
2. The closure of a n-cell need not be a n-ball and the boundary of a n-cell need
not be a ( 1) n ÷ -sphere.
3. Not for every k n < with n being the dimension of the CW complex there need
to be cells of dimension k . However, every non-empty CW complex has at least
one 0-cell.
4. The closure c and boundary c c of a cell need not be the union of cells.
CW complexes can be easily constructed. Figure 39 illustrates the construction of a 2-
0
X (consisting of at least one
0-cell); we then glue 1-cells so that we get
1
X , then we glue 2-cells which gives us
2
X .
We see that
0 1 2
X X X c c .
Gluing of 2-cells
0
X
1
X
2
X

Figure 39. Construction of a CW complex
9.5 Appl i cat i ons i n GIS
The space used in GIS to represent spatial features is predominantly the 2-or 3-
dimensional Euclidean space
2
 or
3
 equipped with the natural topology of open disks
and balls. The Euclidean space is a metric space (therefore also a normal, regular, and
HAUSDORFF space), second-countable (therefore also first-countable, separable, and
TOPOLOGY 87

LINDELÖF), and connected. Closed and bounded subsets of a Euclidean space are
compact (such as closed cells and simplexes).
Spatial data sets consisting of linear features (network) in
2
 or
3
 are 1-dimensional
CW complexes where the arcs are the 1-cells and the nodes the 0-dimensional skeleton.
Polygon feature data sets are 2-dimensional CW complexes with the polygons as 2-cells
and the bounding arcs and nodes as the 1-dimensional skeleton.
9.5.1 Spat ial Dat a Set s
To represent 2-dimensional spatial features in a GIS we have two options: (i) to use a
simplicial complex, i.e., to represent all spatial features as a set of simplexes with certain
conditions (see Definition 74 of a simplicial complex), or (ii) to represent them as a cell
complex by considering the cells being glued together in a proper way (see Definition 78
of a CW complex).
In the first case, we must represent all features by a set of triangles. On the one hand,
triangles are very simple structures and easy to handle; on the other hand, every polygon
has to be approximated by a potentially large number of triangles which is often
undesirable. An exception is a triangular irregular network (TIN) to represent a digital
elevation model.
In the second case all features are cells glued together. This approach is much more
suitable for general polygon features, because it avoids the use of triangles. In fact, every
topologically structured data set in a GIS database is a digital representation of a 2-
dimensional cell complex.
Figure 40 shows a 2-dimensional spatial data set as a cell complex embedded in the
2
 .
This complex consists of four 0-cells (1, 2, 3, 4), six 1-cells (a, b, c, d, e, f), and three 2-
cells (A, B, C). The embedding Euclidean space
2
 functions as the “world polygon” or
“outside polygon” often denoted as W or O.
A
B
C
f
e
d
c
b
a
4 3
2
1
2

Figure 40. Two-dimensional spatial data set as cell complex
A data structure to represent this cell complex is the so-called arc-node structure. The 0-
cells are the nodes and the 1-cells are the arcs between the nodes. Every arc has a start
and an end node, thereby defining an orientation of the arc
20
. The orientation is indicated
by arrows in the figure. For every arc we note which polygon (2-cell) lies to the left and
which one to the right of it viewed in the direction from start node to end node.
Networks, like road or river networks, are best modeled as a one-dimensional subset (or
skeleton) of a cell complex. The topological relationships are then reduced to incidence
relationships between edges (arcs) and nodes. Such a structure is also called a graph.
Graph theory, although closely related to topology, has developed as an independent
mathematical discipline. A special type of graph frequently used in GIS is a planar graph.
It is completely embedded in the plane such that no two edges intersect except at nodes.

20
The orientation of an arc is usually determined by the digitization process, i.e., a line is followed from
the beginning (start node) to the end (end node).
88 THE MATHEMATICS OF GIS

An implementation of the arc-node structure in a relational database needs one table for
the arc-node relations, one for the polygon attributes, and one for the vertices of the arcs.
Table 12 shows the arc table of the arc-node structure of the cell complex in Figure 40.
Table 12. Arc table for the arc-node structure
Arc-id Start-node End-node Left-polygon Right-polygon
a 4 1 C W
b 1 2 A W
c 1 3 C A
d 3 2 B A
e 4 3 B C
f 4 2 W B
9.5.2 Topological Transformat ions
As we have seen, topology is the branch of mathematics that deals with properties of
spaces that remain invariant (i.e., do not change) under topological mappings. Assume
you have spatial features stored in a database using the arc-node structure. When you
apply a transformation (such as a map projection) to the data set, the neighborhood
relationships between A, B, and C remain, and the boundary lines have the same start and
end nodes. The areas are still bounded by the same boundary lines, only their shapes and
the length of the perimeters have changed (Figure 41).
h
1
M
2
M
A
B
C
f
e
d
c
b
a
4 3
2
1
2

A
B
C
f
e
d
c
b
a
4 3
2
1
2

Figure 41. Topological mapping
Topologically speaking, we have applied a homeomorphism from the cell
complex to the cell complex . They are topologically equivalent.
9.5.3 Topological Consist ency
A representation of a cell complex must be consistent, i.e., the topological properties must
not be violated. If we can show that the following rules are satisfied for every element in
the data set, we know that it is a topologically consistent 2-dimensional configuration.
(TC1) Every 1-cell is bounded by two 0-cells. (Every arc has a start node and an
end node).
(TC2) For every 1-cell there are two 2-cells. (For every arc there exist two adjacent
polygons, the left and right polygon).
(TC3) Every 2-cell is bounded by a closed cycle of 0- and 1-cells. (Every polygon
has a closed boundary consisting of an alternating sequence of nodes and
arcs.)
(TC4) Every 0-cell is surrounded by a closed cycle of 1- and 2-cells. (Around every
node there exists an alternating closed sequence of arcs and polygons.)
1 2
: h M M ÷
1
M
2
M
TOPOLOGY 89

(TC5) Cells intersect only in 0-cells. (If arcs intersect, they do so in nodes.)
These rules cannot be applied without additions or modifications to other dimensions. In
the following we will discuss how these conditions can be checked when we have an arc
table.
TC1 demands that every arc must have a start node and end node. The presence of a
NOT NULL value for the Start-node and End-node for every arc is sufficient.
TC2 ensures the neighborhood relationship of polygons. The presence of a NOT NULL
Left-polygon and Right-polygon for every arc is sufficient.
TC3 ensures that polygons are closed, i.e., starting at any node of the boundary of a
polygon, we have a closed cycle of nodes and arcs. We will illustrate a procedure for
polygon A in Figure 40:
Select all rows from the arc table where A appears either as Right-polygon or Left-
polygon.
Arc-id Start-node End-node Left-polygon Right-polygon
a 4 1 C W
b 1 2 A W
c 1 3 C A
d 3 2 B A
e 4 3 B C
f 4 2 W B
Make sure that for all selected records A appears always as the Left-polygon or always as
the Right-polygon. In our example we want A always to be the Right-polygon.
21
For
those rows where A is not the Right-polygon, we must swap Left- and Right-polygon. Of
course, if we do that, we must also swap Start- and End-node to maintain orientation. In
our case we must swap for arc b, which results in the following configuration:
Arc-id Start-node End-node Left-polygon Right-polygon
a 4 1 C W
b 2 1 W A
c 1 3 C A
d 3 2 B A
e 4 3 B C
f 4 2 W B
We now start at any Start-node of the selected rows and chain through the nodes. In our
example let us start with arc c and node 1 (Figure 42). The end-node of c is 3. In the
next step look up the record where 3 appears as the start node and continue as before.
When we return to the node where we started, the cycle is closed and the polygon
boundary is closed. Otherwise, we have an inconsistency in the polygon boundary.

Figure 42. Closed polygon boundary check

21
The choice could be based on the fact that for two out of three rows this condition is already fulfilled.
A
B
C
e
d
c
b
3
2
1
A
B
C
e
d
c
b
3
2
1
90 THE MATHEMATICS OF GIS

TC4 ensures the planarity of the cell complex near a node, i.e., for every node there must
be an “umbrella” of a closed cycle of alternating 1-cells and 2-cells. We will illustrate a
procedure for node 3 in Figure 40:
Select all rows from the arc table where 3 appears either as Start-node or End-node.
Arc-id Start-node End-node Left-polygon Right-polygon
a 4 1 C W
b 1 2 A W
c 1 3 C A
d 3 2 B A
e 4 3 B C
f 4 2 W B
Make sure that for all selected records 3 appears always as the Start-node or always as the
End-node. In our example we want 3 always to be the End-node. For those rows where 3
is not the End-node, we must swap Start- and End-node. Of course, if we do that, we
must also swap Left- and Right-polygon to maintain orientation. In our case we must
swap for arc d, which gives us
Arc-id Start-node End-node Left-polygon Right-polygon
a 4 1 C W
b 2 1 W A
c 1 3 C A
d 2 3 A B
e 4 3 B C
f 4 2 W B
We now start at any Left-polygon of the selected rows and chain through the polygons.
In our example let us start with arc c and Left-polygon C (Figure 43). The Right-polygon
of c is A. In the next step look up the record where A appears as the Left-polygon and
continue as before. When we return to the polygon where we started, the cycle is closed
and the “umbrella” is closed. Otherwise, we have an inconsistency in the node.

Figure 43. Node consistency check
TC5 must be checked by calculating intersections of arcs and pointing out intersections at
locations without nodes.
9.5.4 Spat ial Relat ions
Whereas relationships between simplexes or cells define consistency constraints for
spatial data, we can use the topological properties of interior, boundary, and exterior to
define relationships between spatial features. Since the properties of interior, boundary,
and exterior do not change under topological mappings, we can investigate their possible
relations between spatial features.
Let us assume two spatial regions and . Both have their respective boundary,
interior, and exterior. When we consider all possible combinations of intersections
between the boundaries, the interiors, and the exteriors of and , we know that these
C
e
3
C
e
3
c
d
A
C
B
e
A B
A B
TOPOLOGY 91

will not change under any topological transformation. This can be put into a rectangular
schema which is called the 9-intersection, written as
.
From these intersection patterns, we can derive eight mutual spatial relationships between
two regions. If, for instance, the boundary of intersects the boundary of , the
interiors of and do not intersect, and the exteriors of and intersect, we say
that and meet. Figure 44 shows all possible eight spatial relationships: disjoint,
meet, equal, inside, covered by, contains, covers, and overlap. These relationships can be
used, for instance, in queries against a spatial database.

Figure 44. Spatial relationships between two simple regions based on the 9-intersection
9.6 Exerci ses
Exercise 34

9
( , ) I A B

9
– – – –
( , )
A B A B A B
I A B A B A B A B
A B A B A B
c
c c c c
c
| | · · ·
|
= · · ·
|
|
· · ·
\ .
· · · ·
·
·
A B
A B A B
A B
disjoint
meet
equal
inside
covered by
contains
covers
overlap

93

ne of the basic structures mathematical disciplines are built upon is
order. A set is said to be (partially) ordered when an order relation is
defined between its elements, which makes them comparable. The
study of partially ordered sets and lattices (a special kind of ordered set) is
covered by an extensive amount of mathematical literature. This theory has
mainly been applied in computer science, such as in multiple inheritance or
Boolean algebra.
In this chapter, we will introduce the basic principles of partially ordered sets and
lattices and show how they can be applied to spatial features and their
relationships with each other.

CHAPTER
10
Ordered Set s

O
94 THE MATHEMATICS OF GIS

10.1 Poset s
Definition 79 (Partially Ordered Set). Let P be a set. A binary relation s on P
such that, for every P z y x e , ,
1. x x s (reflexive)
2. if y x s and x y s , then y x = (antisymmetric)
3. if y x s and z y s , then z x s (transitive)
is called a partial order on P . A set P equipped with a reflexive, antisymmetric and
transitive relation (order relation) s is called a partially ordered set (or poset) and is
written as ) ; ( s P . Usually we will write P with the meaning ‘ P is a poset’.
For every partially ordered set P we can find a new poset, the dual of P , by defining
that y x s in the dual if and only if x y s in P . Any statement about a partially ordered
set can be turned into a statement of its dual by replacing s with > and vice versa.
Example 108. The natural numbers with the relation s read as “less than or equal” are a poset.
When we take the power set ) ( X ¸ of a set X , i.e. all subsets of X , then ) ( X ¸ is ordered by
set inclusion and for every ) ( , X B A ¸ e we define B As if and only if B A _ .
Example 109. For spatial subdivisions A and B the order relation B As means that “ A is
contained in B ” or dually, that “ B contains A ”.
Any hierarchy is a poset with at most one element directly above any element. A special
type of hierarchy—and therefore a more special type of poset—is the totally ordered set
(or chain). This is a hierarchy in which at most one element is directly below any
specific element, which means that every element can be compared with every other
element in the set. The integer space is a typical example of a total ordering.
10.1.1 Order Diagrams
For every (finite) poset there exists a graphical representation, the diagram (or Hasse
diagram) of the poset. To describe how to construct a diagram we need the idea of
covering:
Definition 80 (Cover). By “ Acovers B ” (or “ B is covered by A”) in a poset P we
mean that A B s and there exists no P x e that A x B < < and we write B A ÷ > or
A B < ÷ . In other words, A covers B means that A is immediately greater than B
and there is no other element in between. The set of all elements that cover an element
X is called the cover of X , written as
÷
X . Dually, the set of all elements that are
covered by X is called the cocover of X and we write
÷
X .
A diagram of a poset P is drawn as a configuration of circles (representing the elements
of P ) and connecting lines (indicating the covering relation), where the circle for
element A is drawn above the circle for element B , when A covers B . The circles are
connected with a straight line. For a finite poset we obtain the diagram of the dual by
turning it upside down. Figure 45 shows a poset and its corresponding diagram.
ORDERED SETS 95

A
B C
D E
A
B
C
D
E

Figure 45. Poset and corresponding diagram
The circles and the connecting lines in a diagram can be viewed as vertices and edges of a
graph. Since the order relation defines a direction for the edges, a Hasse diagram is a
directed graph. There are no cycles in that graph, i.e. starting from a specific node and
moving along the edges of the graph in the given direction, no node is visited twice. Such
a graph is called a directed acyclic graph (or dag). There are many algorithms for
traversing directed acyclic graphs and for other related operations.
Definition 81 (Maximum and Minimum). Let P be a poset and P S _ . An element
S ae is the greatest (or maximum) element of S if x a > for every S x e and we
write S a max = . The greatest element of P , if it exists, is called the top element of P
and the least (or minimum) element of S , written as S min , and the bottom element of
P , if it exists, are defined by duality.
Example 110. In ) ( X ¸ we have X as the top element and the empty set as the bottom element.
The natural numbers under their usual order have 1 as the bottom element but no top element.
10.1.2 Upper and Lower Bounds
Definition 82 (Upper Bound). Let P be a poset and P S _ . An element P xe is an
upper bound of S if x s s for all S s e . A lower bound is defined by duality. The set
of all upper bounds of S is denoted by
*
S (or “S upper”) and the set of all lower
bounds (or “ S lower”) is written as
*
S ; in other words we define
} ) ( {
*
x s S s P x S s e ¬ e = and } ) ( {
*
x s S s P x S > e ¬ e = .
If
*
S has a least element, it is called least upper bound (l.u.b.), also join or supremum.
By duality, if
*
S has a largest element, it is called greatest lower bound (g.l.b.), meet or
infimum. If a least upper bound or a greatest lower bound exists, it is always unique. For
the least upper bound and the greatest lower bound of two elements x and y we write
sup{ , } x y or x y v (read as “ x join y “) and inf{ , } x y or x y . (read as “ x meet y ”),
respectively. For a subset S we write S v (the “join of S “) or sup S and S . (the “meet
of S ”) or inf S .
There are cases when a greatest lower bound or a least upper bound does not exist. This
may be the case because elements do not have common bounds or because a g.l.b. or
l.u.b. does not exist. Take for example the two elements B and C of Figure 45. The set
of their lower bounds are D and E . However, none of the lower bounds is greater than
the other, they are not comparable. Therefore, there is no greatest lower bound for the
subset } , { C B (see Figure 46).
96 THE MATHEMATICS OF GIS

Figure 46. Lower bounds
10.2 Lat t i ces
In the previous section we have seen that in the general case of a partially ordered set we
cannot expect that join and meet always exist. Therefore, a more specific order structure
is needed.
Definition 83 (Lattice). A lattice L is a poset in which every pair of elements has a
least upper bound and a greatest lower bound. A lattice is called complete, when meet
and join exist for every subset of the poset
22
.
If L is a lattice then . and v are binary operations on L and we have an algebraic
structure > v . < , , L with . and v satisfying the following conditions for all
L c b a e , , :
1. ) ( ) ( c b a c b a v v = v v , ) ( ) ( c b a c b a . . = . . (associative laws)
2. a b b a v = v , a b b a . = . (commutative laws)
3. a a a = v , a a a = . (idempotency laws)
4. a b a a = . v ) ( , a b a a = v . ) ( (absorption laws)
Every set L with two binary operations satisfying conditions (1) to (4) is a lattice. We
see that a lattice can be viewed as either being an order structure or an algebraic structure.
Many theories, e.g. Boolean algebras, rely heavily on the algebraic properties of lattices.
The order relation s is related to the algebraic operations of . and v by the following
statement:
Let L be a lattice and let x and y be elements of L. Then y x s is equivalent to each
of the conditions: x y x = . and y y x = v .
It can be proven that every finite lattice is complete. This is an important result because it
means that whenever we have a lattice with a finite number of elements we can always
find least upper bounds and greatest lower bounds for every subset of the lattice.
Example 111. Every chain is a lattice in which } , min{ y x y x = v and } , max{ y x y x = . .
Therefore, the natural numbers, integers, rational and real numbers all are lattices under their usual
order. None of them is a complete lattice. To show this let us take any of these sets and determine

22
Note that the difference between a lattice and a complete lattice is in the existence of the meet and join
for every pair of elements (lattice) or every subset of elements (complete lattice).
A
B C
D E
C BB C
ORDERED SETS 97

the supremum of the set itself. Since there is no greatest number in any of these sets, the set of the
upper bounds is empty and a least upper bound does not exist.
Example 112. The power set ) ( X ¸ of any set X is a complete lattice where meet and join are
defined as { }
¸
I i
i i
A I i A
e
= e . and { }
¸
I i
i i
A I i A
e
= e v , respectively.
If a subset ) ( X S ¸ _ is closed under finite unions and intersections, it is called a lattice
of sets. It is called a complete lattice of sets if it is closed under arbitrary unions and
intersections. Meet and join are then defined as set intersection and set union.
If L is a complete lattice then the following is true for every , S T L _ :
(i) s S ¬ e , s S s v and s S > . .
(ii) Let x L e . Then x S s . if and only if x s s for all s S e .
(iii) Let x L e . Then x S > v if and only if x s > for all s S e .
(iv) S T s v . if and only if s t s for all s S e and all t T e .
(v) If S T _ , then S T s v v and S T > . . .
(vi) ( ) ( ) ( ) S T S T = v v v v and ( ) ( ) ( ) S T S T = . . . . .
10.3 Nor mal Compl et i on
Not every poset is a lattice, because posets exist in which not all subsets have greatest
lower bounds and least upper bounds. For example, the subset } , { C B of the order in
Figure 46 has no greatest lower bound. It is, however, possible, to add elements to a
poset to create a lattice. This is in fact possible with all posets.
It is even more interesting to find the smallest number of elements necessary to add to a
poset to create a lattice. In other words, we want to build the minimal containing lattice
of a poset. The method for doing this is called normal completion.
In order to define the normal completion we need the concept of a closure operator,
which is defined as follows:
Definition 84 (Closure). Let X be a set. A map ) ( ) ( : X X C ¸ ÷ ¸ is called a
closure operator on X if, for all X B A _ , :
1. ) ( A C A_
2. If B A_ , then ) ( ) ( B C A C _
3. ) ( )) ( ( A C A C C =
A subset A of X is called closed if A A C = ) ( .
The following theorem summarizes the important facts about the normal completion of
posets. It even gives us a procedure for building the normal completion lattice.
Let P be a poset and
*
*
) (A the set of the lower bounds of the upper bounds of a subset
A of P . Then
1.
*
*
( ) ( ) C A A = defines a closure operator on P .
98 THE MATHEMATICS OF GIS

2. The family
*
*
DM( ) { | ( ) } P A P A A = _ = is a complete lattice (the DEDEKIND-
MACNEILLE completion, or normal completion or completion by cuts of P ), when
ordered by inclusion, in which { }
¸
I i
i i
A I i A
e
= e . and
{ } ) (
¸
I i
i i
A C I i A
e
= e v
.

3. The map ) ( : P DM P ÷ ¢ defined by
*
*
) ( ) ( x x = ¢ for all P xe is an order-
embedding, i.e. it is order-preserving and injective. In fact ¢ can be defined as
} | { ) (
*
x y P y x x s e = = ¢ , because
* *
*
) ( x x = for all P xe . ) (P DM is a
completion of P via ¢ and all greatest lower bounds and least upper bounds
which exist in P are preserved. This means, if P A_ and A v exists in P , then
) ( ) ( A A ¢ ¢ v v = , and ) ( ) ( A A ¢ ¢ . . = .
4. ) ( DM P is the smallest lattice in which P can be embedded in the sense, that if L
is any other lattice such that L P _ , we have L P P _ _ ) ( DM .
By calculating the normal completion we have to look at all subsets of the poset P . For
practical applications, this is rather inefficient, because every set with n elements has
n
2
subsets.
The theorem above has a simple corollary, which yields two important properties of the
normal completion lattice:
1. If L is a lattice, then ) ( DM L L = .
2. For all posets P we have )) ( ( ) ( P DM DM P DM = .
First, the corollary tells us that whenever the poset is already a lattice, the normal
completion does not add anything to the lattice. It leaves the lattice unchanged.
Secondly, it follows from the idempotency of a closure operator that applying the
completion more than once does not increase the number of elements added to the
completion lattice, i.e. the number of elements in the completion lattice is bounded by
n
2
for n elements in the poset.
10.3.1 Special Element s
Let P be a poset and S a subset of the poset. We had defined upper bounds and lower
bounds for the subset S . The set of all upper bounds of S was denoted as
*
S and the set
of all lower bounds of S as
*
S . For the normal completion lattice we need to identify all
*
*
) (S for all subsets of P .
If there exists a greatest element in P it is called top element and written as T; if there is
a least element in P it is called bottom element and written as ± .
There are two cases that require special attention: when P S = and when C = S . First,
let us investigate the case when P S = . If P has a top element, then } {
*
Τ = P and
T = P sup . When P has no top element, then C =
*
P and there is no supremum of P .
By duality, if P has a bottom element, then
*
{ } P = ± and inf P =± . If P does not have
a bottom element, then C =
*
P and the infimum does not exist.
Now, let us assume that C = S , i.e., S is the empty subset of P . Then (vacuously) for
all S s e we have that x s s for every element P xe . Thus P = C
*
and P sup exists, if
and only if P has a bottom element; i.e., then we have =± P sup . Dually, P = C
*

ORDERED SETS 99

(because again we have vacuously that for all C = eS s , x s > for every P xe ) and
T = P inf whenever P has a top element. Table 13 summarizes the result.
Table 13. Special elements and the closure operator in the normal completion
Subset
*
S
*
S
Top element
exists
No top element
Bottom element
exists
No bottom
element
P
{T} C } {± C
C P P P P
From the table above we can derive the following sets:
P P =
*
*
) (
¹
´
¦
C
±
= C
otherwise
element bottom a has if } {
) (
*
*
P

10.3.2 Normal Complet ion Algorit hm
The algorithm for the normal completion can be written as follows:
1. Determine all subsets, i.e., the power set ( ) P ¸ , of the poset P .
2. For every subset ( ) S P e¸ determine ( ) S
-
-

3. Arrange all ( ) S
-
-
to a poset where _ (subset) is the order relation.
4. Identify every element a P e of the original poset with its corresponding ( ) a
-
-

in the new poset.
5. Assign suitable symbols to the remaining elements of the new poset.
6. The resulting poset is the normal completion lattice of P .
To illustrate how this works we take the poset of Figure 45 and build the normal
completion lattice according to the algorithm. First we determine all subsets of the poset
{ , , , , } A B C D E . This results in 32 sets. For every subset S we must then compute ( ) S
-
-
.
The result is given in Table 14.
Table 14. Normal completion
S
S
-
( ) S
-
-

1 C { , , , , } A B C D E C
2 { } A { } A { , , , , } A B C D E
3 { } B { , } A B { , , } B D E
4 { } C { , } A C { , , } C D E
5 { } D { , , , } A B C D { } D
6 { } E { , , , } A B C E { } E
7 { , } A B { } A { , , , , } A B C D E
8 { , } A C { } A { , , , , } A B C D E
9 { , } A D { } A { , , , , } A B C D E
10 { , } A E { } A { , , , , } A B C D E
11 { , } B C { } A { , , , , } A B C D E
12 { , } B D { , } A B { , , } B D E
100 THE MATHEMATICS OF GIS

13 { , } B E { , } A B { , , } B D E
14 { , } C D { , } A C { , , } C D E
15 { , } C E { , } A C { , , } C D E
16 { , } D E { , , } A B C { , } D E
17 { , , } A B C { } A { , , , , } A B C D E
18 { , , } A B D { } A { , , , , } A B C D E
19 { , , } A B E { } A { , , , , } A B C D E
20 { , , } A C D { } A { , , , , } A B C D E
21 { , , } A C E { } A { , , , , } A B C D E
22 { , , } A D E { } A { , , , , } A B C D E
23 { , , } B C D { } A { , , , , } A B C D E
24 { , , } B C E { } A { , , , , } A B C D E
25 { , , } B D E { , } A B { , , } B D E
26 { , , } C D E { , } A C { , , } C D E
27 { , , , } A B C D { } A { , , , , } A B C D E
28 { , , , } A B C E { } A { , , , , } A B C D E
29 { , , , } A B D E { } A { , , , , } A B C D E
30 { , , , } A C D E { } A { , , , , } A B C D E
31 { , , , } B C D E { } A { , , , , } A B C D E
32 { , , , , } A B C D E { } A { , , , , } A B C D E
The resulting sets are { , , , , } A B C D E , { , , } B D E , { , , } C D E , { , } D E , { } D , { } E , and C.
When we arrange them in a poset according to the subset relation, we get the normal
completion lattice (Figure 48)
23
.
{ A, B, C, D, E}
{ D, E}
{ E} { D}
{ }
{ C, D, E} { B, D, E}

Figure 47. Normal completion lattice
Finally, we identify the original poset elements with their corresponding lattice elements
and denote the newly created elements with X and {} . Figure 48 shows the normal
completion of the poset. We see that two new elements were added to the poset to form a
lattice.

23
Note that we may use either {} or C to denote the empty set.
ORDERED SETS 101

poset
A
B C
D E
lattice
A
B C
D E
X
{ }

Figure 48. Normal completion
The new elements can be interpreted in a geometric way as shown in Figure 49. Element
X can be interpreted as the intersection of B and C .
A
B C
D E
X
{ }
B
C
D
E
A
X
X = B » C

Figure 49. Geometric interpretation of new lattice elements
10.4 Appl i cat ion i n GIS
The intuitive interpretation of order relations as “is contained in” or, dually, as “contains”
can be used for relationships among spatial features such as polygons, lines and points.
The structure of a poset accommodates both strict hierarchies (every object has exactly
one parent object) and relationships where one object possesses more than one parent
object.
Examples of hierarchies are administrative subdivisions where for instance every county
belongs to exactly one state, and every state belongs to exactly one country. General
posets can be used to represent situations where one object belongs to several parents,
such as agricultural production zones that may be part of several municipalities, or
regions that are composed of several unconnected polygons such as the Hawaiian Islands.
10.5 Exerci ses
Exercise 35 From the poset in Figure 45 determine the upper bounds of (a) { } D , (c) { , } D C , (c) { } A .
102 THE MATHEMATICS OF GIS

Exercise 36 From the poset in Figure 45 determine the greatest lower bound of (a) { , } B D , (b) { } A , (c)
{ , , } A B C
Exercise 37 The following relationships are given for the four regions A, B, C, and D: C is contained in A and
D is contained in B. Draw the poset for the four regions, compute and draw the normal
completion lattice.

103

he origin of graph theory lies in the investigation of topological
problems given by a set of points and the connections between
them. Today, graph theory is a branch of mathematics in its own
right dealing with problems that can be represented by a collection of
vertices and connecting edges.
This chapter deals with the basic principles of graphs, their representation
and ways to traverse them. The importance of graph theory for the analysis
of transpiration and flow problems is highlighted in the section on
applications to GIS.

CHAPTER
11
Graph Theor y

T
104 THE MATHEMATICS OF GIS

11.1 Int roducing Graphs
Generally, the origin of graph theory is attributed to the Swiss mathematician
LEONHARD EULER who published a paper in 1736 on what is now commonly
known as the Königsberg bridge problem. Figure 50 shows a sketch of the seven
bridges across the river Pregel in Königsberg (which is today’s Kaliningrad). The
problem is to determine whether it is possible to make a circular walk through
Königsberg by starting at a river bank and crossing every bridge exactly once.

Figure 50. The seven bridges of Königsberg
Euler solved the problem by abstracting the island and river banks to points and
representing the bridges by lines connecting these points. In the figure they are
represented by black points and red lines.
Figure 51 shows these points (vertices) and lines (edges) in a schematic way with
the vertices numbered
1
v to
4
v , and the edges
1
e to
7
e . Such a configuration is
called a graph. Starting from an arbitrary vertex we find after some tries that such
a circular walk is impossible
24
.
v
1
v
2
v
3
v
4
e
1
e
2
e
4
e
3
e
5
e
7
e
6

Figure 51. Graph of the Königsberg bridge problem

24
We will see later that the problem is to find an Eulerian circuit in the graph and that there is a
theorem stating when such a circuit exists.
GRAPH THEORY 105

11.1.1 Basic Concept s
Definition 85 (Graph). Given a non-empty set
1 2
{ , , , }
n
V v v v = . , the vertex-
set, a set
1 2
{ , , , }
m
E e e e = . , the edge-set, and a function : g E V V ÷ × , the
incidence map, which assigns to every element of E a pair ( , )
i j
v v of elements
of V . We call the triple ( , , ) G V E g = a graph.
The elements of V are called points (or vertices), the elements of E are called
edges. For an edge ( , )
i j
e v v = vertices
i
v and
j
v are called end points of e ; we
say that e is incident with
i
v and
j
v , and that
i
j
v . If
( ) ( , ) g e v v = we call e a loop. If ( ) ( )
i j
g e g e = we call
i
e and
j
e parallel
edges.
Here, we will deal only with finite graphs, i.e., the number of vertices and the
number of edges are both finite. When there is no confusion possible we will
denote a graph with ( , ) G V E = for short.
Example 113. The graph for the Königsberg bridge problem in Figure 51 can be written as
( , , ) G V E g = with the vertex-set
1 2 3 4
{ , , , } V v v v v = , the edge-set
1 2 3 4 5 6 7
{ , , , , , , } E e e e e e e e =
and the incidence map defined as
1 1 2
( ) ( , ) g e v v = ,
2 1 2
( ) ( , ) g e v v = ,
3 1 3
( ) ( , ) g e v v = ,
4 1 3
( ) ( , ) g e v v = ,
5 1 4
( ) ( , ) g e v v = ,
6 3 4
( ) ( , ) g e v v = ,
7 2 4
( ) ( , ) g e v v = . Edges
1
e ,
2
e and
3
e ,
4
e
are parallel. The graph contains no loop.
A graph without loops and parallel edges is called a simple graph. A graph with
loops and parallel edges is sometimes called a multigraph. The number of edges
incident with a vertex v is called the degree of v and is written as ( ) d v . A vertex
v with ( ) 0 d v = is called an isolated vertex.
Example 114. In the previous example the degree of vertex
1
v is 5, and the degrees of
vertices
2 3
, v v and
4
v are three.
A graph is called complete if there exists an edge for every pair of distinct vertices.
For n vertices the complete graph is denoted by
n
K . We call a graph regular
when every vertex has the same degree. If the degree is k then the graph is k -
regular. A complete graph
n
K is ( 1) n ÷ -regular, i.e., every vertex in a complete
graph
n
K has degree ( 1) n ÷ . Figure 52 illustrates some complete graphs.
K
2
K
3
K
4
K
1

Figure 52. Complete graphs
Two graphs
1 1 1
( , ) G V E = and
2 2 2
( , ) G V E = are isomorphic if there is a bijective
mapping
1 2
: i V V ÷ preserving the incidence relationships, i.e., for every
1 2 1
, v v V e
we have
1 2 1
( , ) v v E e implies
1 2 2
( ( ), ( )) i v i v E e . Isomorphic graphs have the same
106 THE MATHEMATICS OF GIS

structure, although they might look quite different at a first glance. Figure 53
shows two isomorphic graphs.
v
1
v
5
v
4
v
3
v
2
i(v
3
)
i(v
4
) i(v
1
)
i(v
5
)
i(v
2
)

Figure 53. Isomorphic graphs
If we remove a number of edges or vertices from a graph G we obtain a subgraph
S G _ . The removal of a vertex implies that all edges incident with it must also be
removed. However, if we remove an edge the vertices remain. The result could be
some isolated vertices. A subset of vertices V V ' c and edges with both end-points
in V' is called a subgraph induced by V' .
11.1.2 Pat h, Circuit , Connect ivit y
For many applications we need to traverse a graph, sometimes in a particular way.
A path from
1
v to
n
v is a sequence of alternating vertices and edges
1 1 2 2 1
, , , , , ,
n n
P v e v e e v
÷
= . such that for 1 i n s < ,
i
e is incident with
i
v and
1 i
v
÷
. For
a simple graph it is sufficient to list only the vertices in a path. If
1 n
v v = then the
path is called a cycle or circuit. A path is called a simple path if every vertex is
visited only once. In a simple circuit every vertex appears once except that
1 n
v v = .
The length of a path or a circuit is the number of edges it contains.
Example 115. In the graph of Figure 51
1 2 2 1 4
, , , , P v e v e v = is a simple path from
1
v to
4
v .
4 5 1 4 3 1 5 4
, , , , , , , C v e v e v v e v = is circuit. Note that it is not a simple circuit, because vertex
1
v
is visited twice.
When we assign a number (weight) to each edge of a graph we get a weighted
graph. In many applications such a weight is being used to represent the length of
an edge as distance or travel time. This must not be confused with the length of a
path as defined above.
Two vertices
i
v and
j
v are connected if there exists a path from
i
v to
j
v . Every
vertex is connected to itself. A subgraph induced by a set of vertices is called a
component of a graph. A graph with only one component is called connected,
otherwise it is disconnected. If the removal of a vertex v would disconnect the
graph, then v is called an articulation point. A block is a graph without any
articulation point. If the removal of an edge e would disconnect the graph then
this edge is call a cut-edge.
Figure 54 shows an example of a connected and disconnected graph. Graph H
has two components. The vertices
1 2
, v v G e are articulation points;
1
e G e is a
cut-edge.
GRAPH THEORY 107

H G
v
1
v
2
v
1
v
2
e
1

Figure 54. Connected (G) and disconnected (H) graph
11.2 Impor t ant Cl asses of Graphs
11.2.1 Direct ed Graph
If for every edge we assign one of its vertices as start point the graph becomes a
directed graph (or digraph). We draw the edges of a digraph with arrows
indicating their direction. A directed graph without cycles is called a directed
acyclic graph (or DAG). DAG’s play an important role in the representation of
partially ordered sets. Digraphs are used to represent transportation or flow
problems. Figure 55 shows two directed graphs. Graph G contains a cycle; H is
a DAG.
H
G

Figure 55. Directed graphs
In a digraph an edge ( , )
i j
v v is said to be incident from
i
v and incident to
j
v . The
number of edges incident from a vertex v is called the out-degree ( ) d v
+
, the
number of edges incident to v is the in-degree ( ) d v
÷
. A digraph is symmetric if
for every edge ( , )
i j
v v there is also an edge ( , )
j i
v v . A digraph is balanced if for
every vertex v the out-degree is equal to the in-degree, i.e., ( ) ( ) d v d v
+ ÷
= .
11.2.2 Planar Graph
An important class of graphs is the planar graphs. A graph is planar if it can be
drawn on a plane surface without intersecting edges
25
. Such a representation
divides the plane into connected regions (or faces). The faces are bound by edges
of the graph. One face encloses the graph. This face is often called the exterior
face.

25
This class of graphs plays an important role in the structuring of two-dimensional spatial data
sets for GIS.
108 THE MATHEMATICS OF GIS

A planar graph in the real drawing plane corresponds to a 2-dimensional cell
complex, where the vertices correspond to the 0-cells, the edges to the 1-cells, and
the faces to the 2-cells. Clearly, this cannot be extended to higher dimensions.
Figure 56 shows a planar graph. This graph has four vertices
1 2 3 4
{ , , , } V v v v v = , six
edges
1 2 3 4 5 6
{ , , , , , } E e e e e e e = , and four faces
1 2 3 4
{ , , , } F f f f f = . Face
4
f is the
exterior face.
v
3
v
1
v
2
v
4
e
6
e
5
e
4
e
3
e
2
e
1
f
4
f
3
f
2
f
1

Figure 56. Planar graph
EULER’s formula connects the number of vertices, edges and faces. It states that
for every connected planar graph with n vertices, e edges, and f faces we have
2 n e f ÷ + =
If we do not count the exterior face the formula changes to
1 n e f ÷ + =
Example 116. For the planar graph in Figure 56 with four vertices, six edges, and four
faces we have 4 6 4 2 ÷ + = .
For every planar graph G we can construct a graph
*
G whose vertices are the
regions of G ; the edges represent the adjacency of faces, i.e., there is an edge
connecting two vertices of
*
G if the two corresponding faces of G are adjacent.
The edge is drawn crossing the bounding edge of the faces in G . Such a graph is
called the dual graph. It is again planar. Figure 57 shows the planar dual graph of
the graph in Figure 56.
*
1
v
*
2
v
*
3
v
*
4
v

Figure 57. Dual graph
11.3 Represent at i on of Graphs
For many computational purposes we need efficient data structures and algorithms
to represent and traverse graphs. The best known structures to represent a graph
GRAPH THEORY 109

Given a graph ( , ) G V E = with n vertices an adjacency matrix is an n n × matrix
A, such that:
1 if ( , )
( , )
0 otherwise
i j E
A i j
e ¦
=
´
¹

For an undirected graph ( , ) ( , ) A i j A j i = . For a digraph A is usually asymmetric.
Figure 58 shows an undirected graph
1
G and a directed graph
2
G .
G
2
G
1
5
v
4
v
3
v
2
v
1
v
5
v
4
v
3
v
2
v
1
v

Figure 58. Undirected and directed graph
If we sort the columns and rows from
1
v to
5
1
G and
2
G are written as:
1
0 1 1 0 0
1 0 0 1 1
( ) 1 0 0 1 1
0 1 1 0 0
0 1 1 0 0
A G
| |
|
|
|
=
|
|
|
\ .

2
0 1 1 0 0
0 0 0 1 1
( ) 0 0 0 1 1
0 0 0 0 0
0 0 0 0 0
A G
| |
|
|
|
=
|
|
|
\ .

An adjacency list L shows for every vertex the vertices adjacent to it. The
adjacency lists for the graphs in Figure 58 are:
1 2 3
2 1 4 5
1 3 1 4 5
4 2 3
5 2 3
: ,
: , ,
( ) : : , ,
: ,
: ,
v v v
v v v v
L G v v v v
v v v
v v v

¸

1 2 3
2 4 5
2 3 4 5
4
5
: ,
: ,
( ) : : ,
:
:
v v v
v v v
L G v v v
v
v

÷

÷
¸

We see easily that the storage requirement for adjacency matrices is usually higher
For directed acyclic graphs it is often more convenient to represent also the
transitive relationships in the graph. This means that if we have ( , )
i j
v v E e and
( , )
j k
v v E e then we also show the relationship ( , )
i k
v v in the matrix or list. The
relationships ( , )
i i
v v are trivially contained in the transitive closure. This is called
the transitive closure of the graph. For the directed acyclic graph
2
G in Figure 58
we represent the transitive closure as:
110 THE MATHEMATICS OF GIS

2
1 1 1 1 1
0 1 0 1 1
( ) 0 0 1 1 1
0 0 0 1 0
0 0 0 0 1
A G
| |
|
|
|
=
|
|
|
\ .

1 2 3 4 5
2 4 5
2 3 4 5
4
5
: , , ,
: ,
( ) : : ,
:
:
v v v v v
v v v
L G v v v
v
v

÷

÷
¸

Based on the representation of a graph by a matrix or a list, efficient algorithms can
be formulated to traverse the graph. Traversal means that from a given start point
all other vertices of the graph are visited. One of the best known graph traversal
algorithms is the depth-first-search (DFS). It works in the following way:
Starting from a given vertex v visit an adjacent vertex that has not yet been
visited.
If no such vertex can be found then return to the vertex visited just before v
and repeat step 1.
11.4 Eul eri an and Hami lt oni an Tours, Shor t est Pat h Probl em
As mentioned above we often want to traverse a graph in a particular manner.
When we do not distinguish between path and cycle we will talk about a tour.
A tour through a graph in which every edge is traversed exactly once is called an
Eulerian tour. If we traverse the graph visiting each vertex exactly once we call
this a Hamiltonian tour. The shortest path problem is about finding the shortest
path between two given vertices in a graph.
11.4.1 Eulerian Graphs
An Eulerian graph is an undirected graph or digraph containing an Eulerian circuit.
The following statements can be proven for undirected graphs and digraphs:
An undirected graph contains an Eulerian circuit if and only if it is connected and
the number of vertices with odd degree is 0.
An undirected graph contains an Eulerian path if and only if it is connected and
the number of vertices with odd degree is 2 (denoted with
1
v and
2
v ).
A digraph contains an Eulerian circuit if and only if it is connected and balanced.
A digraph contains an Eulerian path if and only if it is connected and for the
degrees of the vertices we have:
1 2
1 1
2 2
( ) ( ) for all or
( ) ( ) 1
( ) ( ) 1
d v d v v v v
d v d v
d v d v
+ ÷
+ ÷
÷ +
= =
= +
= +

Example 117. When we recall the Königsberg bridge problem, we see that the question is
whether there exists an Eulerian circuit in the graph of Figure 51. The graph is connected.
However, there are four vertices with odd degree. Therefore, the problem cannot be solved.
Example 118. A famous problem in graph theory is the Chinese postman problem. In its
colloquial form it is about a postman who has to deliver the mail. In order to be more
efficient the question is whether he can traverse the street network of his town in such a
GRAPH THEORY 111

way that starting at the post office he walks every street not more than once before he
returns to the office. In graph theoretic terms we are checking whether there is an Eulerian
cycle in the graph of the street network.
11.4.2 Hamilt onian Tours
A graph is called Hamiltonian if it contains a Hamiltonian circuit. Unlike with
Eulerian graphs we do not have a simple way of determining whether a graph is
Hamiltonian. All known algorithms to find a Hamiltonian tour in graph are either
inefficient or solve the problem only through approximations.
Example 119. A generalization of the Hamiltonian cycle problem is the traveling salesman
problem. The problem can be formulated as: Given a number of cities and the costs of
traveling form one city to the other, what is the cheapest roundtrip that visits every city and
then returns to the starting city? The cities are the vertices of a weighted graph. There are
no efficient algorithms to solve the problem. Good approximations exist, however.
11.4.3 Short est Pat h Problem
The shortest path problem can be formulated as follows. Given are a weighted
graph with :  f E ÷ assigning weights to the edges, and two vertices
1
v and
2
v .
Find a path P from
1
v to
2
v such that for all edges e P e of the path ( )
e P
f e
e
¿
is
minimal among all paths connecting
1
v and
2
v .
Example 120. A well known algorithm to solve the shortest path problem for a connected
digraph with non-negative weights is DIJKSTRA’s algorithm named after the Dutch
computer scientist EDSGER DIJKSTRA.
11.5 Appl i cat ions i n GIS
Graphs have played an important role in GIS right from the early beginnings. The
reason is that in the early days of GIS the storage of map data (or cartographic
data) was the focus of interest. Early data structures for the representation of
spatial data (predominantly two-dimensional) are almost exclusively based on
planar graphs.
One of the famous examples is the GBF/DIME (Geographic Base File/Dual
Independent Map Encoding) file of the United States Bureau of the Census. This
file structure was introduced to conduct the 1970 census. The United States
Geological Survey developed the DLG (Digital Line Graph) file format to store
and transfer topographic base data.
In terms of data modeling planar graphs have been used extensively to represent
two-dimensional spatial data. So-called topological graphs are the backbone of
efficient representations. A topological graph is isomorphic to a planar graph
embedded in
2
 . The vertices are usually called nodes, the edges are called arcs
and the faces are the polygons. Such a topological graph is homeomorphic to a 2-
dimensional cell complex. A network consisting of nodes (vertices) and arcs
(edges) can be considered a graph or a 1-dimensional cell complex. Therefore,
planar graphs or cell complexes can be used interchangeably as long as we do not
exceed the 2-dimensional space. For 3-dimensional configurations we need to turn
to topology. Beside the representation of spatial features graphs play an important
role in the representation and analysis of networks.
112 THE MATHEMATICS OF GIS

Definition 86 (Network). A network is a finite connected digraph in which one
vertex x with ( ) 0 d x
+
> is the source of the network, and one vertex y with
( ) 0 d y
÷
> is the sink of the network.
The network analysis functions of a GIS provide tools to find the shortest path
from a A to B, to perform allocation analysis, to trace a network path, as well as
location-allocation analyses.
11.6 Exerci ses
Exercise 38 Draw .
Exercise 39

5
K

113

any phenomena show a degree of vagueness or uncertainty that
cannot be properly expressed with crisp sets of class boundaries.
Spatial features often do not have clearly defined boundaries, and
concepts like “steep”, “close”, or “suitable” can better be expressed with degrees
of membership to a fuzzy set than with a binary yes/no classification. This
chapter introduces the basic principles of fuzzy logic, a mathematical theory that
has found many applications in various domains. It can be applied whenever
vague phenomena are involved.

CHAPTER
12
Fuzzy Logic and GIS

M
114 THE MATHEMATICS OF GIS

12.1 Fuzzi ness
In human thinking and language we often use uncertain or vague concepts. Our thinking
and language is not binary, i.e., black and white, zero or one, yes or no. In real life we
add much more variation to our judgments and classifications. These vague or uncertain
concepts are said to be fuzzy. We encounter fuzziness almost everywhere in our everyday
lives.
12.1.1 Mot ivat ion
When we talk about tall people, the concept of “tall” will be depending on the context. In
a society where the average height of a person is 160cm, somebody will be considered to
be tall differently from a population with an average height of 180cm. In land cover
analysis we are not able to draw crisp boundaries of, for instance, forest areas or
grassland. Where does the grassland end and the forest start? The boundaries will be
vague or fuzzy.
In real life applications we might look for a suitable site to build a house. The criteria for
the area that we are looking for could be formulated as follows. The site must
- have moderate slope
- have favorable aspect
- have moderate elevation
- be close to a lake
- be not near a major road
- not be located in a restricted area
All the conditions mentioned above (except the one for the restricted area) are vague, but
correspond to the way we express these conditions in our languages and thinking. Using
the conventional approach the above mentioned conditions would be translated into crisp
classes, such as
- slope less than 10 degrees
- aspect between 135 degrees and 225 degrees, or the terrain is flat
- elevation between 1,500 meters and 2,000 meters
- within 1 kilometer from a lake
- not within 300 meters from a major road
If a location falls within the given criteria we would accept it, otherwise (even if it would
be very close to the set threshold) it would be excluded from our analysis. If, however,
we allow degrees of membership to our classes, we can accommodate also those locations
that just miss a criterion by a few meters. They will just get a low degree of membership,
but will be included in the analysis. Usually, we assign a degree of membership to a class
as a value between zero and one, where zero indicates no membership and one represents
full membership. Any value in between can be a possible degree of membership.
12.1.2 Fuzziness versus Probabilit y
Degrees of membership as values ranging between zero and one look very similar to
probabilities, which are also given as a value between zero and one. We might be
tempted to assume that fuzziness and probability are basically the same. There is,
however, a subtle, yet important, difference.
Probability gives us an indication with which likelihood an event will occur. Whether it
is going to happen, is not sure depending on the probability. Fuzziness is an indication to
what degree something belongs to a class (or phenomenon). We know that the
phenomenon exists. What we do not know, however, is its extent, i.e., to which degree
FUZZY LOGIC AND GIS 115

members of a given universe belong to the class. In the following sections we will
establish the mathematical basis to deal with vague and fuzzy concepts.
12.2 Cri sp Set s and Fuzzy Set s
In general set theory an element is either a member of a set or not. We can express this
fact with the characteristic function for the elements of a given universe to belong to a
certain subset of this universe. We call such a set a crisp set.
Definition 87 (Characteristic function). Let A be a subset of a universe X . The
characteristic function
A
_ of A is defined as : {0,1}
A
X _ ÷ with
1 iff
( )
0 iff
A
x A
x
x A
_
e ¦
=
´
e
¹

In this way we always can clearly indicate whether an element belongs to a set or not. If,
however, we allow some degree of uncertainty as to whether an element belongs to a set,
we can express the membership of an element to a set by its membership function.
Definition 88 (Fuzzy set). A fuzzy set A of a universe X is defined by a membership
function
A
µ such that : [0,1]
A
X µ ÷ where ( )
A
x µ is the membership value of x in
A. The universe X is always a crisp set.
If the universe is a finite set
1 2
{ , , , }
n
X x x x = . , then a fuzzy set A on X is expressed
as
1 1 2 2
1
( ) / ( ) / ( ) / ( ) /
n
A A A n n A i i
i
A x x x x x x x x µ µ µ µ
=
= + + + =
¿
. The term
( ) /
A i i
x x µ indicates the membership value to fuzzy set A for
i
x . The symbol “/” is
called separator, E and “+” function as aggregation and connection of terms.
If the universe is an infinite set
1 2
{ , , } X x x = . , then a fuzzy set A on X is expressed
as ( ) /
A
X
A x x µ =
}
. The symbols } and “/” function as aggregation and separator.
26

The empty fuzzy set C is defined as , ( ) 0 x X x µ
C
¬ e = .
For every element of the universe X we trivially have , ( ) 1
X
x X x µ ¬ e = , i.e., the
universe is always crisp.
A membership function assigns to every element of the universe a degree of membership
(or membership value) to a fuzzy set. This membership value must be between zero (no
membership) and one (definite membership). All other values between zero and one
indicate to which degree an element belongs to the fuzzy set. It is important to note that
the membership degree of 1 does not need to be obtained for members of a fuzzy set.
Example 121. Let us take three persons A, B, and C and their respective heights as 185cm (A),
165cm (B) and 186cm (C). We want to assign the different persons to classes for short, average,
and tall people, respectively.

26
Note that the symbols E , +, and } are not to be interpreted in their usual meaning as sum, addition,
and integral.
116 THE MATHEMATICS OF GIS

If we take a crisp classification and set the class boundaries to (-, 165] for short, (165, 185] for
average, and (185, -) for tall, we see that A falls into the average class, B into the short class, and
C into the tall class. We also see that A is nearly as tall as C, and yet they fall into different
classes. The characteristic functions of the three classes are displayed in Table 15.
Table 15. Characteristic function for height classes
Short Average Tall
A 0 1 0
B 1 0 0
C 0 0 1
When we choose a fuzzy set approach, we need to define three membership functions for the three
classes, respectively (Figure 59).
short tall average
120 130 140 150 160 170 180 190 200 210 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1

Figure 59. Membership functions for “short”, “average”, and “tall”
For short we select a linear membership function that produces a membership value of one for
persons shorter than 150cm and decreases until it reaches zero at 180cm.
The membership function for the average class produces values equal zero for persons shorter than
150cm, it then increases until it reaches one at 175cm. From there it decreases until it reaches zero
at 200cm.
The membership function for the tall class is zero up to 170cm. From there it increases until it
reaches one at 200cm. The membership values for the three persons to the three classes are given
in Table 16.
Table 16. Membership values for the height classes
Short Average Tall
A 0.00 0.60 0.50
B 0.50 0.60 0.00
C 0.00 0.56 0.53
Using the fuzzy set approach we can much better express the fact that A and C are nearly the same
height and that both have a higher degree of membership to the average class than to short or tall,
respectively.
12.3 Membershi p Funct ions
The selection of a suitable membership function for a fuzzy set is one of the most
important activities in fuzzy logic. It is the responsibility of the user to select a function
that is a best representation for the fuzzy concept to be modeled. The following criteria
are valid for all membership functions:
FUZZY LOGIC AND GIS 117

- The membership function must be a real valued function whose values are between
0 and 1.
- The membership values should be 1 at the center of the set, i.e., for those members
that definitely belong to the set.
- The membership function should fall off in an appropriate way from the center
through the boundary.
- The points with membership value 0.5 (crossover point) should be at the boundary
of the crisp set, i.e., if we would apply a crisp classification, the class boundary
should be represented by the crossover points.
We know two types of membership functions: (i) linear membership functions and (ii)
sinusoidal membership functions. Figure 60 shows the linear membership function. This
function has four parameters that determine the shape of the function. By choosing
proper values for a , b , c , and d , we can create S-shaped, trapezoidal, triangular, and
L-shaped membership functions.
a
b c
d
0 20 40 60 80 100
U
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Membership Value
¦
¦
¦
¦
¦
¹
¦
¦
¦
¦
¦
´
¦
>
s s
÷
÷
< <
s s
÷
÷
<
=
d x
d x c
c d
x d
c x b
b x a
a b
a x
a x
x
A
0
1
0
) ( µ

Figure 60. Linear membership function
If a rounded shape of the membership function is more appropriate for our purpose we
should choose a sinusoidal membership function (Figure 61). As with linear membership
functions we can achieve S-shaped, bell-shaped, and L-shaped membership functions by
proper selection of the four parameters.
a
b c
d
0 20 40 60 80 100
U
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Membership Value
¦
¦
¦
¦
¦
¦
¹
¦
¦
¦
¦
¦
¦
´
¦
>
s s |
.
|

\
|
|
.
|

\
|
÷
÷
+
< <
s s |
.
|

\
|
|
.
|

\
|
÷
÷
÷
<
=
d x
d x c
c d
c x
c x b
b x a
a b
a x
a x
x
A
0
cos 1
2
1
1
cos 1
2
1
0
) (
t
t
µ

Figure 61. Sinusoidal membership function
A special case of the bell-shaped membership functions is the Gaussian function derived
from the probability density function of the normal distribution with two parameters c
(mean) and o (standard deviation). Although this membership function is derived from
probability theory, it is used here as a membership function for a fuzzy set.
118 THE MATHEMATICS OF GIS

2
2
( )
2
( )
x c
A
x e
o
µ
÷ ÷
=
-20 -10 0 10 20
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Membership Value
U
c
2o

Figure 62. Gaussian membership function
Example 122. The membership functions in Example 121 are linear functions with the following
parameters:
Short
Average
Tall
1 150
180
( ) 150 180
30
0 180
0 150
150
150 175
25
( )
200
175 200
25
0 200
0 170
170
( ) 170 200
30
0 200
x
x
x x
x
x
x
x
x
x
x
x
x
x
x x
x
µ
µ
µ
s ¦
¦
÷ ¦
= < s
´
¦
> ¦
¹
s ¦
¦
÷
¦
< s
¦
=
´
÷
¦
s s
¦
¦
>
¹
s ¦
¦
÷ ¦
= < s
´
¦
> ¦
¹

12.4 Operat i ons on Fuzzy Set s
Operations on fuzzy sets are defined in a similar way as for crisp sets. However, not all
rules for crisp set operations are also valid for fuzzy sets. Like for crisp sets we have
subset, union, intersection, and complement. In addition, there are alternate operations
for union and intersection of fuzzy sets.
Definition 89 (Support). All elements of the universe X that have a membership
value greater than zero for a fuzzy set A are called the support of A , or
supp( ) { | ( ) 0}
A
A x X x µ = e > .
Example 123. The support of the fuzzy set for short people (Example 121) is those persons who
are shorter than 150cm.
Definition 90 (Height). The height of a fuzzy set A is the largest membership value in
A, written as hgt( ) A . If hgt( ) 1 A = then the set is called normal.
FUZZY LOGIC AND GIS 119

Example 124. The height of the fuzzy sets Short, Average, and Tall is 1. They are all normal
fuzzy sets.
We can always normalize a fuzzy set by dividing all its membership values by the height
of the set.
Definition 91 (Equality). Two fuzzy sets A and B are equal (written as A B = ) if for
all members of the universe X their membership values are equal, i.e.,
, ( ) ( )
A B
x X x x µ µ ¬ e = .
Subsets in fuzzy sets are defined by fuzzy set inclusion.
Definition 92 (Inclusion). A fuzzy set A is included in a fuzzy set B (written as
A B _ ) if for every element of the universe the membership values for A are less than
or equal to those of B , i.e., , ( ) ( )
A B
x X x x µ µ ¬ e s .
When we look at the graph of the membership functions a fuzzy set A will be included in
fuzzy set B when the graph of A is completely covered by the graph of B (Figure 63).
20 10 0 10 20
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Membership Value
A
B

Figure 63. Set inclusion
For the union of two fuzzy sets we have more than one operator. The most common ones
are presented here.
Definition 93 (Union). The union of two fuzzy sets A and B can be computed for all
elements of the universe X by one of the three operators:
1. ( ) max( ( ), ( ))
A B A B
x x x µ µ µ

=
2. ( ) ( ) ( ) ( ) ( )
A B A B A B
x x x x x µ µ µ µ µ

= + ÷ ·
3. ( ) min(1, ( ) ( ))
A B A B
x x x µ µ µ

= +
The max-operator is a non-interactive operator in the sense that the membership values of
both sets do not interact with each other. In fact, one set could be completely ignored in a
union operation when it is included in the other. The two other operators are called
interactive, because the membership value of the union is determined by the membership
values of both sets.
Example 125. Figure 64 illustrates the union operators for the fuzzy sets Short and Average from
Example 121.
120 THE MATHEMATICS OF GIS

120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Type 1
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Type 2
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Type 3

Figure 64. Fuzzy set union operators
Definition 94 (Intersection). The intersection of two fuzzy sets A and B can be
computed for all elements of the universe X by one of the three operators:
1. ( ) min( ( ), ( ))
A B A B
x x x µ µ µ
·
=
2. ( ) ( ) ( )
A B A B
x x x µ µ µ
·
= ·
3. ( ) max(0, ( ) ( ) 1)
A B A B
x x x µ µ µ
·
= + ÷
The min-operator a non-interactive, the two others are interactive operators as explained
above.
Example 126. Figure 65 illustrates the intersection of the fuzzy sets Short and Average from
Example 121.
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Type 1
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Type 2
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Type 3

Figure 65. Fuzzy set intersection
FUZZY LOGIC AND GIS 121

Definition 95 (Complement). The complement of a fuzzy set A in the universe X is
defined as , ( ) 1 ( )
A A
x X x x µ µ ¬ e = ÷ .
Example 127. Figure 66 shows the fuzzy set Average from Example 121 and its complement.
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Average
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Complement of Average

Figure 66. Fuzzy set and its complement
Many rules for set operations are valid for both crisp and fuzzy sets. Table 17 shows the
rules that are valid for both.
Table 17. Rules for set operations valid for crisp and fuzzy sets
1. A A A = idempotent law
2. A A A = ·
3. ) ( ) ( C B A C B A = associativity
4. ) ( ) ( C B A C B A · · = · ·
5. A B B A = commutativity
6. A B B A · = ·
7. ) ( ) ( ) ( C A B A C B A · = · distributivity
8. ) ( ) ( ) ( C A B A C B A · · = ·
9.
B A B A · =
DE MORGAN’s law
10.
B A B A = ·
11.
A A =
double complement
Table 18 shows those rules that in general are valid for crisp sets but not for fuzzy sets.
Table 18. Rules valid only for crisp sets
1.
A A X =
law of the excluded middle
2.
A A · = C
Figure 67 illustrates that the law of the excluded middle and the law of contradiction does
not generally hold for fuzzy sets.
220 120 140 160 180 200
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
A A A A ·

Figure 67. Law of the excluded middle and law of contradiction for fuzzy set Average.
122 THE MATHEMATICS OF GIS

12.5 Al pha-Cut s
If we wish to know all those elements of the universe that belong to a fuzzy set and have
at least a certain degree of membership, we can use o -level sets.
Definition 96 (o -Cut). A (weak) o -cut (or o -level set) A
o
with 0 1 o < s is the set
of all elements of the universe such that { | ( ) }
A
A x X x
o
µ o = e > . A strong o -cut
A
o
is defined as { | ( ) }
A
A x X x
o
µ o = e > .
Example 128. The 0.8-cut of the fuzzy set Tall contains all those persons who are 194cm or taller.
With o -level sets we can identify those members of the universe that typically belong to
a fuzzy set.
12.6 Li ngui st ic Vari ables and Hedges
In mathematics variables usually assume numbers as values. A linguistic variable is a
variable that assumes linguistic values which are words (linguistic terms). If, for
example, we have the linguistic variable “height”, the linguistic values for height could be
“short”, “average”, and “tall”. These linguistic values possess a certain degree of
uncertainty or vagueness that can be expressed by a membership function to a fuzzy set.
Often, we modify a linguistic term by adding words like “very”, “somewhat”, “slightly”,
or “more or less” and arrive at expressions such as “very tall”, “not short”, or “somewhat
average”.
Such modifiers are called hedges. They can be expressed with operators applied to the
fuzzy sets representing linguistic terms (see Table 19).
Table 19. Operators for hedges
Operator Expression
Normalization
norm( )
A
( )
( )
hgt( )
A
A
x
x
µ
µ
µ
=
Concentration
2
con( )
( ) ( )
A A
x x µ µ =
Dilation
dil( )
( ) ( )
A A
x x µ µ =
Negation not( )
( ) ( ) 1 ( )
A A A
x x x µ µ µ = = ÷
Contrast intensification
2
int( )
2
2 ( ) if ( ) [0, 0.5]
( )
1 2(1 ( )) otherwise
A A
A
A
x x
x
x
µ µ
µ
µ
¦ e
¦
=
´
÷ ÷
¦
¹

The following Table 20 shows the models being used to represent hedges for linguistic
terms.
Table 20. Hedges and their models
Hedge Operator
very A con( ) A
more or less A (fairly A ) dil( ) A
plus A
1.25
A
not A not( ) A
slightly A
int(norm(plus not(very ))) A A ·
Example 129. Figure 68 shows the membership functions for Tall, Very Tall, and Very Very Tall.
FUZZY LOGIC AND GIS 123

120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Tall
Very Tall
Very Very Tall

Figure 68. Membership functions for Tall, Very Tall, and Very Very Tall
Example 130. Figure 69 shows the membership functions for Tall and Not Very Tall.
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Tall
Not Very Tall

Figure 69. Membership function for Tall and Not Very Tall
Example 131. Figure 70 shows the membership functions for Tall and Slightly Tall.
120 140 160 180 200 220
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Tall Slightly Tall

Figure 70. Membership function for Tall and Slightly Tall
12.7 Fuzzy Inference
In binary logic we have only two possible values for a logical variable, true or false, 1 or
0. As we have seen in this chapter, many phenomena can be better represented by fuzzy
124 THE MATHEMATICS OF GIS

sets than by crisp classes. Fuzzy sets can also be applied to reasoning when vague
concepts are involved.
In binary logic reasoning is based on either deduction (modus ponens) or induction
(modus tollens). In fuzzy reasoning we use a generalized modus ponens which reads as
Premise
1
: If x is A then y is B
Premise
2
: x is A'
Conclusion: y is B'
Here, A, B , A' , and B' are fuzzy sets where A' and B' are not exactly the same as A
and B .
Example 132. Consider the generalized modus ponens for temperature control:
Premise
1
: If the temperature is low then set the heater to high
Premise
2
: Temperature is very low
Conclusion: Set the heater to very high
With logic inference we normally have more than one rule. In fact, the number of rules
can be rather large. We know several methods for fuzzy reasoning.
12.7.1 MAMDANI’s Direct Met hod
Here, we discuss the methods known as MAMDANI’S direct method. It is based on a
generalized modus ponens of the form
1 1 1
2 2 2
1
1
If is and is then is
If is and is then is
:
If is and is then z is
: is , y is
: is
n n n
x A y B z C
x A y B z C
p q
x A y B C
p x A B
q z C
¦
¦
¦
¬
´
¦
¦
¹
' '
'
.

Premise
1
becomes a set of rules as illustrated in Figure 71. A, B , and C are fuzzy sets,
x and y are premise variables, z is the consequence variable.
27

If x is A and y is B then z is C
premise
consequence

Figure 71. Inference rule in MAMDANI’s direct method
The reasoning process is then straightforward according to the following procedure. Let
0
x and
0
y be the input for the premise variables.
1. Apply the input values to the premise variables for every rule and compute the
minimum of
0
( )
i
A
x µ and
0
( )
i
B
y µ :

27
There can be more than two premise variables to express complex rules. The procedure can be
extended to this case without any problems.
FUZZY LOGIC AND GIS 125

1 1
2 2
1 1 0 0
2 2 0 0
n 0 0
Rule : min( ( ), ( ))
Rule : min( ( ), ( ))
Rule : min( ( ), ( ))
n n
A B
A B
n A B
m x y
m x y
m x y
µ µ
µ µ
µ µ
=
=
=
.

2. Cut the membership function of the consequence ( )
i
C
z µ at
i
m :
1 1
2 2
1 1 1
2 2 2
n
Conclusion of rule : ( ) min( , ( ))
Conclusion of rule : ( ) min( , ( ))
Conclusion of rule : ( ) min( , ( ))
n n
C C
C C
C n C n
z m z z C
z m z z C
z m z z C
µ µ
µ µ
µ µ
'
'
'
= ¬ e
= ¬ e
= ¬ e
.

3. Compute the final conclusion by determining the union of all individual
conclusions from step 2:
1 2
( ) max( ( ), ( ), , ( ))
n
C C C C
z z z z µ µ µ µ
' ' '
= .
The result of the final conclusion is a fuzzy set. For practical reasons we need a definite
value for the consequence variable. The process to determine this value is called
defuzzification. There are several methods to defuzzify a given fuzzy set. One of the
most common is the center of gravity (or center of area).
For a discrete fuzzy set the center of area is computed as
0
( )
( )
C
C
z z
z
z
µ
µ
·
=
¿
¿

For a continuous fuzzy set this becomes
0
( )
( )
C
C
z zdz
z
z dz
µ
µ
·
=
}
}

Example 133. Given the speed of a car and the distance to a car in front of it, we would like to
determine whether we should break, maintain the speed, or accelerate. Assume the following set
of rules for the given situation:
Rule 1 If the distance between the cars is short and the speed is low then maintain speed
Rule 2 If the distance between the cars is short and the speed is high then reduce speed
Rule 3 If the distance between the cars is long and the speed is low then increase speed
Rule 4 If the distance between the cars is long and the speed is high then maintain speed
Distance, speed, and acceleration are linguistic variables with the values “short”, “long”, “high”,
“low”, and “reduce”, “maintain”, and “increase”, respectively. They can be modeled as fuzzy sets
(Figure 72).
126 THE MATHEMATICS OF GIS

0 5 10 15 20 25 30 35 40
meters
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Distance
0 10 20 30 40 50 60 70 80 90 100
km
h
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Speed
-20 -15 -10 -5 0 5 10 15 20
km
h
2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Acceleration
Maintain
Short
Low Long High
Increase Decrease

Figure 72. Fuzzy sets of the rules
With a given distance
0
15 x = meters and a speed of
0
60 y = km/h we perform step 1. The results
are shown in Table 21.
Table 21. Fuzzy inference step 1
Rule Short Long Low High Min
1 0.75 0.25 0.25
2 0.75 0.75 0.75
3 0.25 0.25 0.25
4 0.25 0.75 0.25
Now we must cut the membership function for the conclusion variable at the minimum values
from step 1. The result is illustrated in Figure 73.
-20 -15 -10 -5 0 5 10 15 20
km
h
2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Rule1
-20 -15 -10 -5 0 5 10 15 20
km
h
2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Rule2
-20 -15 -10 -5 0 5 10 15 20
km
h
2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Rule3
-20 -15 -10 -5 0 5 10 15 20
km
h
2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Rule4

Figure 73. Fuzzy inference step 2
Finally, we must combine the individual membership functions from step 2 to the final result and
defuzzify it. The union of the four membership functions is displayed in Figure 74. The final
value after defuzzification is -5.46 and is indicated by the blue dot. The conclusion of this fuzzy
inference is that when the distance between the cars is 15 meters and the speed is 60 km/h, then we
have to break gently to reduce the speed.
FUZZY LOGIC AND GIS 127

-20 -15 -10 -5 0 5 10 15 20
km
h
2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
FinalResult

Figure 74. Fuzzy inference final result
12.7.2 Simplified Met hod
Often, the defuzzification process is too time-consuming and complicated. An alternative
approach is the simplified method where the conclusion is a real value c instead of a
fuzzy set. It is based on a generalized modus ponens of the form:
1 1 1
2 2 2
1
1
If is and is then is
If is and is then is
:
If is and is then z is
: is , y is
: is
n n n
x A y B z c
x A y B z c
p q
x A y B c
p x A B
q z c
¦
¦
¦
¬
´
¦
¦
¹
' '
'
.

Premise
1
becomes a set of rules as illustrated in Figure 75. The premise variables are
fuzzy sets; the conclusion is a real number (fuzzy singleton).
If x is A and y is B then z = c
premise consequence
fuzzy singleton

Figure 75. Simplified Method
The reasoning process is then straightforward in analogy to the previous method with the
difference that the result is not a fuzzy set that needs to be defuzzified but be can compute
the final result directly after step 2 in the algorithm.
The algorithm works as outlined in the following procedure procedure. Let
0
x and
0
y be
the input for the premise variables.
1. Apply the input values to the premise variables for every rule and compute the
minimum of
0
( )
i
A
x µ and
0
( )
i
B
y µ :
128 THE MATHEMATICS OF GIS

1 1
2 2
1 1 0 0
2 2 0 0
n 0 0
Rule : min( ( ), ( ))
Rule : min( ( ), ( ))
Rule : min( ( ), ( ))
n n
A B
A B
n A B
m x y
m x y
m x y
µ µ
µ µ
µ µ
=
=
=
.

2. Compute the conclusion value per rule as:
1 1 1 1
2 2 2 2
n
Conclusion of rule :
Conclusion of rule :
Conclusion of rule :
n n n
c m c
c m c
c m c
' = ·
' = ·
' = ·
.

3. Compute the final conclusion as:
1
1
n
i
i
n
i
i
c
c
m
=
=
'
' =
¿
¿

Example 134. Given the slope and the aspect maps of a region and the following set of rules, we
can conduct a risk analysis based on degrees of risk ranging from 1 (low risk) to 4 (very high risk).
The fuzzy sets for flat and steep slope are displayed in Figure 18 and Figure 19-
Rule 1 If slope is flat and aspect is favorable then risk is 1
Rule 2 If slope is steep and aspect is favorable then risk is 2
Rule 3 If slope is flat and aspect is unfavorable then risk is 1
Rule 4 If slope is steep and aspect is unfavorable then risk is 4
0 10 20 30 40
Percent
0.2
0.4
0.6
0.8
1
Membership
flat
steep

Figure 76. Membership functions for flat and steep slope
0 50 100 150 200 250 300 350
Aspect
0.2
0.4
0.6
0.8
1
Membership
favorable
unfavorable

Figure 77. Membership functions for favorable and unfavorable aspect.
For a slope of 10 percent and an aspect of 180 degrees we have the following results:
FUZZY LOGIC AND GIS 129

Slope (s) Aspect (a) Min(s,a) Conclusions
Rule1 0.5 1 0.5 0.5
Rule2 0.2 1 0.2 0.4
Rule3 0.5 0 0 0
Rule4 0.2 0 0 0
For the final result we get
0.5 0.4 0 0
1.29
0.5 0.2 0 0
c
+ + +
' = =
+ + +
, which means a low risk.
12.8 Appl i cat ions i n GIS
Many spatial phenomena are inherently fuzzy or vague or possess indeterminate
boundaries. Fuzzy logic has been applied for many areas in GIS such as fuzzy spatial
analysis, fuzzy reasoning, and the representation of fuzzy boundaries. The following
example illustrates how a fuzzy set can be computed from a given grid data set.
12.8.1 Object ive
The objective of this analysis is to determine high elevation in the area covered by the 1 :
24,000 topographic map sheet of Boulder, Colorado
12.8.2 Fuzzy Concept s
Elevation is considered high when it is above 1,700 meters. We represent the features
meeting the criterion as a fuzzy set with a sinusoidal membership function (Figure 78)
defined as
high elevation
0 1700
1 1700
( ) 1 cos 1700 2000
2 300
1 2000
x
x
x x
x
µ t
¦
s
¦
¦
¦
| ÷ | ¦ | |
= ÷ < s
´ | |
\ . \ .
¦
¦
¦ >
¦
¹
.

Figure 78. Membership function for “high elevation”
12.8.3 Soft ware Approach
The 1 : 24K DEM was downloaded from the USGS and imported into ArcGIS as a grid
ELEVATION. In principle, there are several ways to solve the problem: we can use
ArcInfo GRID, ArcMap Spatial Analyst, or ArcView 3.x Spatial Analyst. We can even
create our own fuzzy logic tool using the scripting environment of the geoprocessor in
ArcGIS 9. In the following, all approaches are illustrated. The grid involved is
1600 1800 2000 2200 2400
U
0.2
0.4
0.6
0.8
1
130
12.8.3.1
12.8.3.2
12.8.3.3

ELEVA
zero and
1 ArcInfo GR
To com
DOCEL
/*
/* high
/* ====
/*
docell
if (e
if (e
fel
if (e
end
We can
/* high
/* ====
/*
felevat
le 2000
2 ArcMap S
To solv
screen d
3 ArcView 3
If you d
in the A
how to u
ATION. The
d one.
RID
mpute the fuz
LL block:
h elevation
===========
elevation l
elevation g
levation =
elevation g
also use the
h elevation
===========
tion = con(
0, 0.5 * (1
pat ial Analy
ve the proble
dump shows
3.x
do not have A
ArcView GIS
use the Aven
e fuzzy set w
zzy set we us
n
=
le 1700) fe
gt 1700 & e
0.5 * (1 -
gt 2000) fe
GRID CON
n
=
(elevation
1 - COS(3.1
yst
m we use th
the comman
ArcGIS avai
S Spatial An
nue Con requ
will be a gri
se an AML s
elevation =
elevation l
- COS(3.141
elevation =
N command:
le 1700, 0
14159 * (el
he raster calc
nd to produce
ilable, the sa
nalyst map ca
uest for comp
id FELEVAT
script that is
= 0
le 2000) ~
159 * (elev
= 1
0, elevatio
levation -
culator of the
e the required
ame results c
alculator. T
puting the fu
TION whose
run from A
vation - 17
on gt 1700
1700) / 30
e Spatial An
d fuzzy set.
can be achiev
he following
uzzy set for h
THE MATHEMA
e values are
ArcInfo GRID
700) / 300
& elevati
00)), 1)
nalyst. The f
ved by using
g screen dum
high elevation
ATICS OF GIS
between
D and the
))
on ~
following

g requests
mp shows
n.
FUZZY LOG

12.8.3.4
GIC AND GIS
4 ArcGIS 9 S
We hav
raster da
Script
ve written a P
ata set. This
Python scrip
script is used
t that genera
d here as a to
ates a fuzzy r
ool in the Ar
raster data s
cToolbox.
et from a giv

131

ven input
132 THE MATHEMATICS OF GIS

12.8.4 Result
Figure 79 shows the result of the analysis with a fuzzy logic approach (left map) and a
crisp approach (right map). The grid size has been set to 10 meters according to the grid
cell size of the elevation model.
Fuzzy set Crisp set
Figure 79. Analysis with a fuzzy logic approach (left) and a crisp approach (right)
12.9 Exerci ses
Exercise 40 Determine a linear membership function for “moderate elevation” when the ideal elevation is
between 400 and 600 meters.
Exercise 41 Determine a Gaussian membership function for the aspect “south.”
Exercise 42 Use the 1:24,000 digital topographic data set of Boulder, Colorado and determine a suitable site
with the following characteristics:
(i) moderate slope
(ii) favorable aspect
(iii) moderate elevation
(iv) near a lake or reservoir
(v) not very close to a major road, and
(vi) not in a park or military reservation.
Choose suitable membership functions for the fuzzy terms.
Exercise 43 Design a simple fuzzy reasoning system for avalanche risk in the Rocky Mountains (Boulder, CO
area). The variables involved are slope, aspect, snow cover change. For simplicity we do not
consider surface cover. The snow cover change must be simulated. The rules are given as:
Rule 1: If the slope is very steep and the aspect is unfavorable and the snow cover change is big
then the risk is very high.
Rule 2: If the slope is moderate and the aspect is unfavorable and the snow cover change is big
then the risk is moderate.
FUZZY LOGIC AND GIS 133

Rule 3: If the slope is steep and the aspect is unfavorable and the snow cover change is small then
the risk is low.
Rule 4: If the slope is not steep and the aspect is unfavorable and the snow cover change is big
then the risk is moderate.

135

e live in a constantly changing world. What we perceive with our
senses are processes, states and events that happen or exist in the
real world. They may be natural or man-made, and are called real
world phenomena. In our brains, we process the input from our senses, which
leads to mental models, learning, cognition, and knowledge. Everything that
happens in the real world and that we process through our senses leads to models
of reality that we create for ourselves. Usually, we agree on common principles
and interpretations derived from experience, research or learning that enable us to
reach a consensus on the perception of real world phenomena.
This chapter deals with spatial modeling, a process that maps aspects of the real
world to abstract models. We discuss fundamental principles of space and time
and their bearing on GIS.

CHAPTER
13
Spat ial Modeling

W
136 THE MATHEMATICS OF GIS

13.1 Real Worl d Phenomena And Thei r Abst ract i ons
In the real world, we distinguish between natural and man-made phenomena. Natural
phenomena exist independently from human actions and are subject only to the laws of
nature. Examples are the landscape (topography), the weather, or natural processes that
shape and influence them. Man-made phenomena are objects that have come into
existence by human activities through construction or building processes.
Based on these phenomena we develop high-level abstract models for particular purposes
and applications. Features (abstractions of phenomena) populate these models that are
usually organized in layers. Examples of such models are a cadastre, topography, soil,
hydrography, land cover, or land use.
The fact that these models are abstractions of the real world can be illustrated by the
example of a cadastre. Let us assume that a cadastre is a legal and organizational
framework for the handling of land. It is a very important, clearly described and
understood concept. Yet, we do not see a cadastre when we look around us. What we see
are real world phenomena such as buildings, roads, fences around pieces of land, and
people. A cadastre abstracts from certain phenomena and their relationships to create
something new that is real in a given context.
Layers are an ordering principle for real world phenomena. Again, when we look around
us, we do not see the world in layers. Yet, we are used to organize phenomena of the real
world in such a way that we classify them according to a perceived purpose or
characteristic into subsets (layers) that allow us to deal with them efficiently.
13.1.1 Spat ial Dat a And Informat ion
In order to conceptualize mental models of the real world, we need to categorize the
phenomena we observe. These phenomena exist in space and time and have therefore a
spatial (geometric) and a temporal extent. They possess certain thematic characteristics
(also called attributes) that allow us not only to refer to them in terms of spatiotemporal,
but also according to thematic information. The thematic information of real world
phenomena is the basis for the definition of layers.
Humans perceive signals through their senses, process them and extract information that
leads to knowledge and wisdom. Here, we focus on spatial information, i.e., information
concerning phenomena with a spatiotemporal extent. It is obvious that thematic
information is an integral part of spatial phenomena.
Data are representations of information in a computer. Spatial data refer to spatial
information that we store in a computer for processing and analysis.
The following example illustrates the principle. Assume that we stand on top of a hill and
look at the landscape surrounding us. What we see are meadows, fields, trees, and roads.
The meadows are green with grass, the fields are yellow, the trees are green, and the road
is covered with brownish-black asphalt. Our brains have processed the optical signals
that we receive through our eyes and our minds recognize the phenomena observed. We
also have assigned attributes to them such as color, (relative) size and we might
remember that five years ago the road was not paved, and what is a field now has been a
forest.
Since we want to build a land cover database of this area, we need to store a
representation of the phenomena in a computer database. To achieve this we need to
define features, collect (spatial and attribute) data about them and enter them into a
database. A geographic information system (GIS) will be used to enter, store and
maintain, process, analyze and display these data.
SPATIAL MODELING 137

13.2 Concept s Of Space And Ti me
Space and time are two closely related concepts that have been the subject of
philosophical and scientific consideration since the dawn of mankind. The space that
humans live in is the three-dimensional (Euclidean) space as a frame of reference for our
senses of touch and sight. Of all possible physical and mathematical spaces, this is the
space that is illustrative and that we perceive as being real
28
.
Time is a measure for change in our immediate experience. Usually, we assume time to
be of a continuous linear nature extending from the past, through the present into the
future.
Space and time (at least as we perceive them) are so well known and appear to be given
beyond any doubt that we hardly ever contemplate their structure and characteristics in
our everyday lives. When we deal with information systems that process and manipulate
spatiotemporal features, we need clear and well-understood models of space and time.
The following sections describe how concepts of space and time developed in Western
philosophy and physics. We discuss them according to three epochs: (i) pre-Newtonian
concepts, (ii) the Newtonian and classical concepts, and (iii) contemporary concepts of
space and time.
13.2.1 Pre-Newt onian Concept s Of Space And Time
The concepts of space and time of this epoch are mainly dominated by the ideas of Greek
philosophers about the logical conditions for things to change and the structure of the
world in which change occurs.
HERACLITUS (around 500 BC) of Ephesos (western Turkey) studied the problem of
change, i.e., how can the identity of things be preserved when they change. He stated that
everything flows, nothing remains, and the only thing that really exists is change
(processes). “Everything flows” and “We cannot step into the same river twice” are
attributed to him.
At about the same time, PARMENIDES of Elea (southern Italy) developed a completely
opposite philosophy of the non-existence of the void. He postulates (through deductive
reasoning) that change does not exist and that the real world (the real being) is plenum (a
solid complete compact being), immutable, without change and eternal. A void (or empty
space, i.e., something non-existent) does not exist. What we perceive as change is a
delusion of our senses. PARMENIDES’ ideas were further developed and “proven” by his
student ZENO.
One of ZENO’s famous “proofs” that change and movement cannot exist is known as the
race between Achilles and the tortoise. The tortoise gets a head-start and begins the race
at point B, whereas ACHILLES starts from point A. When ACHILLES reaches point B, the
tortoise already has moved on to point C. When ACHILLES reaches point C, the tortoise
has moved on to another point, and so on. The lead of the tortoise gets smaller and
smaller, ad infinitum. We get an infinite number of (smaller and smaller) leads.
The argument is now: In order to reach the tortoise, ACHILLES must catch up an infinite
number of (finite in length) leads. It is impossible to run this infinite number of short
distances, because ACHILLES would have to run infinitely far (or forever). Therefore, it is
impossible for ACHILLES to catch the tortoise
29
. Since we can easily catch a tortoise
when we would run against it, we end up with a paradox. This proves that the assumption

28
Human geographers, of course, might disagree.
29
The solution of the paradox lies in the fact that an infinite series can converge to a finite value, i.e., in
our case the point where ACHILLES passes the tortoise. This mathematical result was, however, not
known until the 17
th
century.
138 THE MATHEMATICS OF GIS

that movement and change are real, leads to contradictions. Therefore, movement and
change are impossible.
DEMOCRITUS (460–370 BC) did not accept the non-existence of change as postulated by
PARMENIDES. Space is an absolute and empty entity existing independently from the
atoms that fill the space. Atoms are indivisible real things; they are immutable and
eternal, and have different size and weight. There is no empty space within atoms. An
atom is a plenum. Objects are formed as a collection of atoms. The importance of the
Atomist theory is evident in today’s modern particle physics.
Greek mathematics was strongly dominated by the Pythagorean number theoretic
approach. It was essentially arithmetic based on (philosophical) properties of numbers,
counting, and the ratios between numbers. The discovery of irrational numbers such as
(the length of the diagonal in the unit square) shook the foundation of Greek
mathematics that was based on counting in natural units. The need for a truly geometrical
description of the world became apparent.
The great philosopher PLATO (427–347 BC) and one member of his school, EUCLID (at
300 BC), laid the foundation for a new geometric modeling of the real world. This
geometric model of matter is based on right triangles as atoms and solids built from these
triangles. Matter consists of four elements: earth, air, fire, and water. Each element is
made of particles, i.e., solids (see Figure 80) that in turn are made from triangles.
Transformations between the elements fire, air and water are possible through geometric
transformations. Earth cannot be transformed.

Figure 80. Platonic solids as building blocks of matter
In his book The Elements, EUCLID developed a mathematical theory of geometry that
remained valid until the late 19th century. Euclidean geometry was considered a true
description of our physical world until it was discovered that many consistent geometric
systems are possible, some of them non-Euclidean, and that geometry is not a description
of the world but yet another formal mathematical system with no necessary reference to
real world phenomena.
13.2.2 Classical Concept s Of Space And Time
The time between the classical Greek period and the rise of modern science was
dominated by the philosophy and teaching of ARISTOTLE (384–322 BC). According to
his ideas, empty space is impossible, and time is the measure of motion with regard to
what is earlier and later. Space is defined as the limit of the surrounding body towards
what is surrounded.
Following from this approach space can be conceptualized in two possible ways:
Absol ut e space. Space as a set of places. It is an absolute real entity, the container
of all things. Its structure is fixed and invariable. Generally, this is considered the
space as described by the Euclidean geometry.
Rel at i ve space. Space is a system of relations. It is the set of all material things, and
relations are abstracted from them. Space is a property of things or things have spatial
properties.
2
Tetrahedron
(fire)
Cube
(earth)
Octahedron
(air)
Icosahedron
(water)
SPATIAL MODELING 139

The rise of modern science took shape in the works of Nikolaus COPERNICUS
(heliocentric system stating that the sun is the center of our planetary system), Johannes
KEPLER (mathematical foundation of the heliocentric system), and Galileo GALILEI
(foundations of mechanics) in the 16
th
and 17
th
centuries.
Isaac NEWTON (1643 – 1727) was a brilliant scientist (dynamic theory) and philosopher.
In his philosophy, he was an outspoken proponent of the concept of absolute space,
although it strictly contradicts his dynamics theory. The concept of absolute space
remained dominant until the late 19
th
century.
Gottfried Wilhelm LEIBNIZ (1646–1716) on the other hand sustained the concept of
relative space. For him, space is a system of relationships between things. It is
interesting to note that both NEWTON and LEIBNIZ are the founders of mathematical
calculus.
One of the greatest philosophers, Immanuel KANT (1724–1804), claimed that space and
time are not empirical physical objects or events. They are merely a priori true intuitions,
not developed by experience, but used by us to relate and order observations of the real
world. Space and time have empirical reality (they are absolute and a priori given) and
transcendental idealism (they belong to our conceptions of things but are not part of the
things). We cannot know anything about the things as such. In this regard, KANT can be
seen as a proponent of absolute space, yet in a far more elaborate and sophisticated way
than the previous philosophical approaches.
13.2.3 Cont emporary Concept s Of Space And Time
The development of modern physics (field theories, theory of relativity, quantum theory)
Euclidean geometry (describing the three-dimensional space of our perception) is only an
approximation to the real nature of the world.
The field theories (Michael FARADAY and James Clerk MAXWELL) lead to the
assumption that space is not empty, but is filled with energy. Therefore, a material
existence of space is strongly supported by these theories.
As a consequence of the special and general theory of relativity by Albert EINSTEIN
(1879–1955), space and time cannot anymore be considered as two separate entities. We
speak of space-time, which is considered a four-dimensional space that can only be
described by non-Euclidean geometry. Quantum mechanics states the principle of
uncertainty and the discrete character of matter and energy. It has become evident that
the space of our perception is not necessarily identical with the microscopic (sub-atomic)
space or the space of cosmic dimensions.
13.2.4 Concept s Of Space And Time In Spat ial Informat ion Syst ems
Spatial information is always related to geographic space, i.e., large-scale space. This is
the space beyond the human body, space that represents the surrounding geographic
world. Within such space, we move around, we navigate in it, and we conceptualize it in
different ways. Physical geographic space is the space of topographic, cadastral, and
other features of the geographic world. Geographic information system technology is
used to manipulate objects in geographic space, and to acquire knowledge from spatial
facts.
Geographic space is distinct from small-scale space, or tabletop space. In other words,
objects that are smaller than us, objects that can be moved around on a tabletop, belong to
small-scale space and are not subject of our interest.
The human understanding of space, influenced by language and cultural background,
plays an important role in how we design and use tools for the processing of spatial data.
140 THE MATHEMATICS OF GIS

In the same way as spatial information is always related to geographic space, it relates to
the time whose effects we observe in the changing geographic world around us. We are
less interested in pure philosophical or physical considerations about time or space-time,
but more in the observable spatiotemporal effects that can be described, measured and
stored in information systems.
13.3 The Real Wor l d And It s Model s
As mentioned in the previous sections we always create models of the real world in our
minds. When we want to acquire, store, analyze, visualize, and exchange information
about the real world, we use other media and means than just interpersonal
communication. We need representations of our mind models, i.e., models of the real
world that can be used to acquire, store, analyze and transfer information about real world
data.
The most common of these models are—in historic sequence—maps and databases. Both
been used to picture real world phenomena, databases can be used to represent real and
virtual worlds.
Real worlds are subsets of the reality that we perceive. Virtual worlds are computer
generated “realities” that exist only as potentialities with no counterpart in the real world.
Yet, we can visualize them, navigate through them and perceive them as “real” (therefore
the term virtual reality). There is no difference between real and virtual world models
with regard to their representation. The only difference is that the former is a model of
something that exists in the real world and the latter is a model of something that exists
only in a virtual (physically non-existent) world.
13.3.1 Maps
The best known (conventional) models of the real world are maps. Maps have been used
for thousands of years to represent information about the real world. We know maps
from ancient Mesopotamia and Egypt, through the Roman times, the Medieval Ages until
the present. Today, they are usually drawn on paper or other permanent material and
function as data storage and visualization medium. Their conception and design has
developed into an art and science with a high degree of scientific sophistication and
artistic craftsmanship. Maps have proven to be extremely useful models of reality for
many applications in various domains.
Yet, maps are two-dimensional (flat) and static. It is not easy to visualize three-
dimensional dynamic features without considerable abstractions in the spatial and
temporal domain. We distinguish between topographic and thematic maps. Other
cartographic products that are not maps are often used to represent three-dimensional and
dynamic phenomena. Such products are, for instance, block diagrams, animations, and
panoramic views.
A disadvantage of maps is that they are restricted to two-dimensional static
representations, and that they always are displayed in a given scale. The map scale
determines the spatial resolution of the graphic feature representation. The smaller the
scale, the less detail a map can show. The accuracy of the primary data, on the other
hand, puts limits to the scale in which a map sensibly can be drawn. The selection of a
proper map scale is one of the first and most important steps in a map conception.
A map is always a graphic representation at a certain level of detail, which is determined
by the scale. The process to derive less detailed representations from a detailed one is
called map generalization (or cartographic generalization). Map sheets have physical
boundaries, and features spanning two map sheets have to be cut into pieces.
SPATIAL MODELING 141

Cartography as the science and art of map making functions as an interpreter, translating
real world phenomena (primary data) into correct, clear and understandable
representations for our use. Maps also become a data source for other maps.
With the advent of computer systems, analog cartography became digital cartography. It
is important to note that whenever we speak about cartography today, we implicitly
assume digital cartography. The use of computers in map making is an integral part of
modern cartography. The role of the map changed accordingly. Increasingly, maps lose
their role as data storage. This role is taken over by databases. What remains is the
visualization function of maps.
When we look back into the history of digital cartography and geographic information
systems, we see that originally maps were considered the main data source for GIS
databases. To transfer the contents of a map into a computer database was the major
goal. We observe this also in the scientific literature of that time. The terms “map data
model” and “map data structure” were widely used. It was not clearly understood that we
actually want to store representations of real world phenomena (primary data) and not
map data (secondary data). In short, to store map data into a database instead of primary
data means to create the model of a model.
13.3.2 Dat abases
Spatial databases store representations of spatial phenomena in the real world to be used
in a geographic information system. They are also called GIS databases or geodatabases.
In the design of a database, we distinguish between three different levels of definition. A
language that we use to define the database is called a data model; each level typically
has its own data model. The data model used at the level closest to the end-users is called
a conceptual data model. In our context, it is used for spatial data modeling. The
intention is to define which concepts of interest exist in the application domain for which
a database is being designed, and what their relationships are. Such a definition identifies
the types of things relevant for a particular application, for example, a cadastral
administration, or a landslide hazard analysis system. A commonly used conceptual data
model is the entity-relationship (ER) model; it uses primitives like entity type to describe
independently existing entities, relationship type to define relationships between entities,
and attributes to describe characteristic values of entities and relationships. The complete
database definition is called the (conceptual) database schema. It can be compared to a
story written in a language that is the data model. Other, more implementation-oriented,
data models will be discussed in Section 13.4.1.
The assumption for the design of a spatial database schema is that spatial phenomena
exist in a two- or three-dimensional Euclidean space. All phenomena have various
relationships among each other and possess spatial (geometric), thematic and temporal
attributes. Phenomena are classified into thematic layers depending on the purpose of the
database. This is usually described by a qualification of the database as, for example,
cadastral, topographic, land use, or soil database.
The representations of spatial phenomena (i.e., spatial features) are stored in a scaleless
and seamless manner. Scaleless means that all coordinates are world coordinates given in
units that are normally used to reference features in the real world (geographic
coordinates, meters, feet). From there, calculations can be easily performed and any
(useful) scale can be chosen for visualization.
It must be noted, however, that scale plays a role when data are captured from maps as
data source. Here, the scale of the source map determines the accuracy of the feature
coordinates in the database. Likewise, the accuracy of measurements in field surveys
determines the quality of the data. If the coordinates are given in units other than
geographic coordinates, information concerning the spatial reference system should also
be present.
142 THE MATHEMATICS OF GIS

A seamless database does not show map sheet boundaries or other partitions of the
geographic space other than imposed by the spatial features themselves.
It is easy to query a database, and to combine data from different layers (spatial join or
overlay). Spatiotemporal databases consider not only the spatial and thematic but also the
temporal extent of the features they represent. Various spatial, temporal and
spatiotemporal data models have been developed.
13.3.3 Space And Time In Real World Models
In modern physics, it is common to speak of space-time to express the close connection
that exists between space and time according to the special and general theory of
relativity. Here, we do not consider the physical characteristics of space and time, but the
(simplified) ways of representing spatial phenomena in a GIS database.
In general, modeling can be described as creating a structure preserving mapping
(morphism) from a domain to a co-domain. In our case, the domain is the real world, and
the co-domain is a real world model. Such a mapping normally creates a ‘smaller’ (i.e.,
abstracted, generalized) image of the original. Structure preserving means that the
elements of the co-domain (spatial features) behave in the same (however simplified or
abstracted) way as the elements of the domain (spatial phenomena). Figure 81 illustrates
the principle of spatial modeling.

Figure 81. Spatial modeling is a structure preserving mapping from the real world to a spatial
model.
As mentioned above, we consider space to be the three-dimensional Euclidean space of
our common sense. All phenomena exist in this space and undergo changes, which we
perceive as the passing of time. In this sense, time is modeled indirectly as changes in
(spatial or thematic) attributes of the features.
We call a spatial data model that also considers time a spatiotemporal data model.
Sometimes such a model is addressed as four-dimensional, giving the impression that
time is the fourth dimension in addition to the three spatial dimensions. It is, however,
better to call it spatiotemporal instead of four-dimensional. First, time is not of the same
type as the spatial dimensions; it has a distinct different quality. Secondly, the term ‘four-
dimensional’ only makes sense when we always would consider three spatial dimensions.
In most of the cases, however, the spatial data model only considers two dimensions.
13.4 Real Wor l d Model s And Thei r Represent at i on
Spatial data are computer representations of spatial features. A modeling language for a
GIS database is a spatial data model. It is used in the design of spatial databases. A
spatial database holds a digital representation of the real world, sometimes called a digital
landscape model (DLM).
Morphism
Spatial phenomena
Domain
(Real World)
Spatial features
Co-domain
(Real World Model)
SPATIAL MO

13.4.1 D
ODELING
A DLM
space fo
levels o
features
is called
graphic
data set
Databas
database
with rea
derive g
result in
for data
Figure
We are
under c
of the fe
Some fe
For exa
vaguene
analysis
take car
Spatial
that dat
propose
Dat abase D
The des
schema
with a p
compris
M is the basi
or a spatial d
of detail. A
s. The transf
d model gene
representati
or map unde
se creation i
e schema tha
al data, there
graphic repre
n a cartograp
abase and car
82. Data mod
there to di
particularly
ertain transfo
eatures in a d
features poss
ample, soil
ess or uncert
s approach th
re of these un
data exist no
a models mu
ed.
Design
sign of a da
of the respe
particular da
ses four level
is for spatial
database is a
good data m
formation of
eralization.
ion (digital o
er certain me
is a two-step
at identifies t
eby creating a
esentations i
phic product.
rtographic de
deling from th
igital cartograp
interested in
formations. T
database. Th
ess a degree
types do n
tainty such a
han clear cu
ncertainties i
ot only in sp
ust be able t
atabase cons
ective level.
ata model. T
ls.
l analysis an
a geometric
model should
f a representa
This is differ
or analog) at
erely graphic
p process: f
types but no
a digital land
n digital or
. Figure 82
esign.
he real world t
phic models a
n properties
This is impo
hese propertie
e of uncertai
not have cr
s “moderate
ut class boun
n our spatial
pace but also
o handle. S
sists of seve
A schema is
This approac
nd manipulat
space in wh
d allow for m
ation from a
rent from ca
a smaller sc
c constraints.
first, the dat
occurrences
dscape mode
analogue for
shows the d
to a database (
and analogue p
of the geom
ortant to guar
es are related
inty in either
risp boundar
slope” or “c
ndaries. We
l data models
in time. Th
everal spatio
eral phases.
s a representa
ch is called t
tion of spati
hich we mod
multiple repr
detailed to a
rtographic g
cale is derive
.
tabase is des
s. Secondly,
el. From the
rm (cartogra
different aspe
(digital landsc
products for v
metric space
rantee a con
d to topology
r their thema
ries. Lingu
close to Vien
e have to dev
s. Fuzzy log
hey carry tem
otemporal da
The result
ation of the d
the ANSI/SP
ial data. Th
el features a
resentations o
a less detailed
eneralization
ed from a la
signed by d
the database
database (D
aphic model)
ects of data m
cape model), a
visualization
that remain
nsistent repre
y.
atic or spatia
uistic expres
nna” are often
vise proper
gic provides t
mporal chara
ata models h
of every ph
database as d
PARC archit
143
he feature
at various
of spatial
d version
n where a
arge-scale
defining a
e is filled
DLM), we
) that can
modeling

and from
invariant
esentation
al extent.
ssions of
n a better
means to
the tools.
acteristics
have been
hase is a
described
tecture; it
144 THE MATHEMATICS OF GIS

A database is generally thought to serve multiple users or user groups. They may have
different perceptions of the data stored. At this level, each user (group) is supported with
its own external view of the database. We may define an external view as a personalized
conceptual database schema. There will be as many external views as there are users and
user groups. Mainly domain experts do spatial modeling at this level.
All external views are merged into a single conceptual schema of the database. This is
usually done with high-level semantic data models such as the entity-relationship model
(ER model), the extended ER model (EER), or object-oriented data models. The basic
constructs of the ER model are entity types (e.g., country), attribute types (e.g.,
population) and relationship types (e.g., neighbor of). Instances of the types populate the
database, e.g., ‘Austria’, ‘8 million’, and ‘Germany, Switzerland’ are instances of the
entity type ‘country’, the attribute type ‘population’, and the relationship type ‘neighbor
of’, respectively. A conceptual schema is implementation-independent and not related to
any particular database management software. It provides an answer to the question what
phenomena are represented in the database.
The conceptual schema is translated into a logical schema using one of the logical data
models. Currently, the most popular one is the relational data model, which is based on
relational algebra. Most commercial database implementations provide support for this
model. It is easy to understand because it is based on relations—sets of records—that
have a straightforward implementation as tables. The logical schema is meant to provide
the definition of a redundancy-free data set.
A physical schema is the result of the implementation of the logical schema with
particular database management software. Table 22 summarizes the ANSI/SPARC
architecture.
Table 22. Data models and schemas in database design (the ANSI/SPARC architecture)
Schema Models used to derive the schema
External views Depending on different user perspectives, a subset of
the real world is defined and described (spatial
modeling).
Conceptual schema A synthesis of external views to create a conceptual
schema making use of semantic data modeling
techniques such as the entity-relationship approach.
Logical schema Transformation of the conceptual schema into a
logical schema using the relational model. Emphasis
is on redundancy removal.
Physical schema This is the mapping of the logical schema into data
structures and algorithms. It is normally not accessible
or visible to the user. Its emphasis is on processing
speed.
13.4.2 Spat ial Dat a Models
Among spatial data models, we can distinguish two major types, field- and object-based
models. Field-based models consider spatial phenomena to be of a continuous nature
where in every point in space a value of the field can be determined. Examples of such
phenomena are temperature, barometric pressure, or elevation. Object-based models
consider space to be populated by well distinguishable, discrete, bounded objects with the
space between objects potentially being empty. Examples are a cadastre with clearly
identifiable objects like parcels and buildings.
Field versus object can be viewed as a manifestation of the philosophical conception of
plenum versus atomic space (see Section 13.2.1), or as in modern physics, wave versus
particle (see Section 13.2.3). In GIS, fields are usually implemented with a tessellation
approach, objects with a (topological) vector approach. The following sections briefly
illustrate the two different model types.
SPATIAL MODELING 145

13.4.2.1 Field-based Models
The underlying space for a field-based model is usually taken as the two- or three-
dimensional Euclidean space. A field is a computable function from a geometrically
bounded set of positions (in 2D or 3D) to some attribute domain. Computable means that
for every position within the geometric bounds a value can be determined by either
measurement or by computation. A field-based model consists of a finite collection of
such fields (Figure 83).

Figure 83. Two data layers in a field-based model
Fields can be discrete, continuous and differentiable. Discrete fields represent features
with boundaries; continuous fields are used for features where the underlying function is
continuous, such as for temperature, barometric pressure or elevation. If the field
function is differentiable, we can even compute the slope at every position.
Though geometrically bounded, the domain of a field is still an infinite set of positions.
Computers cannot easily represent field values for all these positions, so we must accept
an approximation. The standard way to obtain this is to finitely represent the
geometrically bounded space through a subdivision into a regular or irregular tessellation,
consisting either of square (cubic) or triangular (tetrahedral) parts. These individual parts
are called locations; points often approximate them.
Our finite approximation of positions into locations leads so some forms of interpolation.
The field value at a location can be interpreted as one for the whole tessellation cell, in
which case the field is discrete, not continuous or even differentiable. Some convention
is needed to state which value prevails on cell boundaries; with square cells, this
convention often says that lower and left boundaries belong to the cell.
Another option is to interpret the field value at a location as representative only for some
position within the cell. Again that position is fixed by convention, and may be the cell
centroid or, for instance, its left lower corner. Field values for positions other than these
must be computed through some form of interpolation function, which will use one or
more nearby field values to compute the value at the requested position. This allows
representing continuous, even differentiable, functions.
To represent spatial features using a field-based approach we have to perform the
following steps:
1. Define or use a suitable model for the underlying space (tessellation).
2. Find suitable domains for the attributes.
3. Sample the phenomena at the locations of the tessellation to construct the spatial
field functions.
4. Perform analysis, i.e., compute with the spatial field functions.
Layer 1
Layer 2
146 THE MATHEMATICS OF GIS

13.4.2.2 Object -based Models
Object-based models decompose the underlying space into identifiable, describable
objects that have spatial, thematic, and temporal attributes, as well as relationships among
each other (Figure 84). The space outside the objects is empty. Examples of objects are
buildings, cities, towns, districts or countries; attributes are, for instance, the number of
floors, population, boundary or area.
In a GIS database implementation, objects are represented as a structured collection of
geometric primitives (points, lines, polygons, and volumes) under geometric, thematic
and topological constraints.
Object-based models are discrete models. Operations in the model always refer to the
manipulation of individual objects or sets of objects. Manipulations concern the spatial,
thematic, topological or temporal domain. Accordingly, they are realized through
geometric, attribute manipulation or topological operations.

Figure 84. Layers in an object based model
Topology plays a major role in object-based models. It is the ‘language’ that allows us to
specify and enforce consistency constraints for spatial databases. The majority of object-
based models are two-dimensional. Recently, three-dimensional data models have been
proposed. Their topology is more difficult to handle than in the standard two-
dimensional cases.
13.4.3 Spat iot emporal Dat a Models
Beside geometric, thematic and topological properties, spatial data possess also temporal
characteristics. It is, for instance, interesting to know who were the owners of a land
parcel in 1980, or how did land use of a given piece of land change over the last 20 years.
Spatiotemporal data models are data models that can also handle temporal information in
spatial data. Several models have been proposed. The most important ones will be
discussed briefly. Before we describe the major characteristics of the spatiotemporal data
models, we need a framework to describe the nature of time itself. Time can be
characterized according to the following properties:
Ti me densi t y. Time can be discrete or continuous. Discrete time is composed of
discrete elements (seconds, minutes, hours, days, months, or years). In continuous time,
for two points in time, there is always another point in between. We can also structure
time by events (points in time) or states (time intervals). When we represent states by
intervals bounded by nodes (events) we can derive temporal relationships between events
and states such as “before”, “overlap”, “after”, etc.
Di mensi onal i t y of t i me. Valid time (or world time) is the time when an event really
happened. Transaction time (or database time) is the time when the event was recorded
in the database.
Layer 1
Layer 2
SPATIAL MODELING 147

Ti me order. Time can be linear, extending from the past to the present, and into the
future. We know also branching time (possible scenarios from a certain point in time
onwards) and cyclic time (repeating cycles such as seasons or days of a week).
Measures of t i me. A chronon is the shortest non-decomposable unit of time that is
supported by a database (e.g., a millisecond). The life span of an object is measured by a
(finite) number of chronons. Granularity is the precision of a time value in a database
(e.g., year, month, day, second, etc.). Different applications require different granularity.
In cadastral applications, time granularity can be a day; in geological mapping, time
granularity is more likely in the order of thousands of years.
Ti me reference. Time can be represented as absolute (fixed time) or relative (implied
time). Absolute time marks points on the timeline where events happen (e.g., “6 July
1999 at 11:15 p.m.”). Relative time is indicated relative to other points in time (e.g.,
“yesterday”, “last year”, “tomorrow,” which are all relative to “now”, or “two weeks
later,” which may be relative to an arbitrary point in time.).
In spatiotemporal data models, we consider changes of spatial and thematic attributes
over time. In data analysis, we can keep the spatial domain fixed and look only at the
attribute changes over time for a given location in space. We would, for instance, be
interested how land cover changed for a given location or how the land use changed for a
given land parcel over time, provided its boundary did not change.
On the other hand, we can keep the attribute domain fixed and consider the spatial
changes over time for a given thematic attribute. In this case, we could be interested to
see which locations were covered by forest over a given period.
Finally, we can assume both the spatial and attribute domain variable and consider how
an object changed over time. This actually leads to notions of object motion, and these
are a subject of current research, with two of the applications being traffic control and
mobile telephony. But many more applications are on the horizon: think of wildlife
tracking, disease control, and weather forecasting. Here, the problem of object identity
becomes apparent. When does a change or movement cause an object to disappear and
become a new one?
In the following, we describe the major characteristics of some popular spatiotemporal
models.
13.4.3.1 Space-Time Cube Model
This model is based on a two-dimensional space (spanned by the x- and y-axis) whose
features are traced through time (along the z-axis) thereby creating a space-time cube.
The traces of objects through time create a worm-like trajectory in the space-time cube.
This model potentially allows absolute, continuous, linear, branching and cyclic time. It
supports only valid time. The attribute domain is kept fixed and the spatial domain
variable.
13.4.3.2 Snapshot Model
In the snapshot model, layers of the same theme are time-stamped. For every point in
time that we would like to consider, we have to store a layer and assign the time to it as
an attribute. We do not have any information about the events that caused different states
between layers. This model is based on a linear, absolute, discrete time. It supports only
valid time and multiple granularity. The spatial domain is fixed (field-based) and the
attribute domain is variable.
13.4.3.3 Space-Time Composit e Model
The space-time composite model starts with a two-dimensional situation (plane or layer)
at a given start time. Every change of features that happens later is projected onto the
initial plane and intersected with the existing features, thereby creating an incrementally
148 THE MATHEMATICS OF GIS

built polygon mesh. Every polygon in this mesh has its attribute history stored with it.
The space-time composite model is based on linear, discrete, relative time. It supports
both valid and transaction time, and multiple granularity. It keeps the attribute domain
fixed and the spatial domain variable.
13.4.3.4 Event -based Model
In an event-based model, we start with an initial state and record events (changes) along
the time line. Whenever a change occurs, an entry is recorded. This is a time-based
model. The spatial and thematic attribute domains are secondary. The model is based on
discrete, linear, relative time, supports only valid time and multiple granularity.
13.4.3.5 Spat iot emporal Object Model
This model is based on spatio-temporal objects (ST-objects) that are a complex of ST-
atoms (STA). Both objects and atoms have a spatial and a temporal extent. The model is
based on discrete, absolute, linear time, and supports valid and transaction time as well as
multiple granularity.
13.5 Summar y
Geographical information systems process spatial information. The information is
derived from spatial data in a database. To sensibly work with these systems, we need
models of spatial information as a framework for database design. These models address
the spatial, thematic and temporal dimensions of real world phenomena. An
understanding of the principle concepts of space and time rooted in philosophy, physics
and mathematics is a necessary prerequisite to develop and use spatial data models.
We know two major approaches to spatial data modeling, the analogue map approach,
and spatial databases. Today, the function of maps as data storage (map as a database) is
increasingly taken over by spatial databases. In databases, we store representations of
phenomena in the real world. These representations are abstractions according to selected
spatial data models. We know two fundamental approaches to spatial data modeling,
field-based and object-based models. Both have their merits, advantages and
Consistency is an important requirement for every model. Topology provides us with the
mathematical tools to define and enforce consistency constraints for spatial databases,
and to derive a formal framework for spatial relationships among spatial objects.
Spatial data not only possess spatial and thematic attributes, but extend also into the
temporal domain. A model of time for spatial information is an important ingredient for
any spatial data model, thus leading to what is called spatiotemporal data models.

149

his section contains solutions of the exercises mentioned in the text. The reader
is advised to first try to solve the problems him/herself before consulting this
section. For many of the problems a detailed solution is given; for some only
the results are mentioned.

CHAPTER
14
Solut ions of Exercises

T
150 THE MATHEMATICS OF GIS

Chapt er 2

Chapt er 3

Chapt er 4

Chapt er 5
Exercise 16 } , , , , { g f e d b C B = , C d c a A C = = · } , , { , } , { c a C B = ÷ , }} , { }, { }, { {{}, ) ( c a c a C B = ÷ ¸

Chapt er 6
Exercise 19 f is not symmetric because <1,4> is in f but not <4,1>. f is not transitive because <2,3> and <3,2>
in f but not <2,2>. g is not symmetric because <3,1> in g but not <1,3>. g is transitive. h is not
symmetric because <2,1> in h but not <1,2>. h is not transitive because <2,1> and <1,4> in h but
not <2,4>.
Exercise 20 is not a function because 2 has more than one value! is not a function because not all
elements of the domain appear in the relation! is a function! The fact that <2,1> appears twice
does not change the set of pairs.
Exercise 21 } , {
2 1
> < = d a R R , } , {
1 2
> < = d b R R , } , , , , , {
2
1
> < > < > < = d a c a a a R ,
} , , , , , {
3
2
> < > < > < = c b d b b b R
Exercise 22
3 2
3 2 2 3 2 3 3 2
) 2 3 ( 2 ) ( 3 ) ( ) ( ) (
2 2 2 2
2 2
÷ + =
÷ +
=
÷ + ÷ + ÷ ÷ + +
=
+ ÷ ÷ + + ÷ +
=
÷ +
h x
h
h h xh
h
x x h x h xh x
h
x x h x h x
h
x f h x f

Chapt er 7
Exercise 24
Exercise 26 (a) (11,2,-5), (b) (1,1,-9), (c) (7,14,21)
Exercise 27
Exercise 28 7
Chapt er 8
Exercise 31 Both algebras are commutative groups. This can easily be verified by the usual laws for addition
and negative numbers. The function x x f 2 ) ( = is surjective (all even numbers appear as values)
and injective (distinct arguments produce distinct values), therefore bijective. Furthermore, we
f g
h
SOLUTIONS OF EXERCISES 151

have that ) ( ) ( 2 2 ) ( 2 ) ( b f a f b a b a b a f + = + = + = + . ) ( 2 ) ( 2 ) ( a f a a a f ÷ = ÷ = ÷ = ÷ . 0 0 2 ) 0 ( = · = f .
Therefore the function is an isomorphism!
Exercise 32 This can be easily verified by substituting T and F into the axioms for a Boolean algebra and
applying the rules for logical operators.
F T F F F F F T T T
T T F F F T F T T T
F T F T T T
F F F T F T
T T F T T F T
T T F T T F T
T F T T F T
T F T T F T
T F F T
T F F T
= . = ÷ . = . = ÷ .
= v = ÷ v = v = ÷ v
= . = .
= v = v
v . v = . v
. v . = v .
. . = . .
v v = v v
. = .
v = v
) ( ) ( ) (
) ( ) ( ) (
) ( ) (
) ( ) (

Exercise 33 The function is surjective and maps every element of I to B. Because the function is surjective, it
cannot be an isomorphism! To prove that the function maps the binary operation properly, we
distinguish between four cases for , with
a b f(a+b) with + as usual f(a) f(b)
f(a)+f(b) with + as
defined in the
operation table
even even even + even = even, therefore 0 0 0 0
even odd even + odd = odd, therefore 1 0 1 1
odd even odd + even = odd, therefore 1 1 0 1
odd odd odd + odd = even, therefore 0 1 1 0
To prove that the unary operation maps correctly, we show that f(-even) = -f(even) = -0 = 0 and f(-
odd) = -f(odd) = -(1) = 1. The constant maps as f(0) = 0, because 0 is even.
Chapt er 9

Chapt er 10
Exercise 35 The order diagram of the poset looks like

The normal completion lattice is built as follows: ({A}
*
)
*
= {A,C}, ({B}
*
)
*
= {B,D}, ({C}
*
)
*
=
{C}, ({D}
*
)
*
= {D}, ({A,B}
*
)
*
= {A,B,C,D}, ({A,C}
*
)
*
= {A,C}, ({A,D}
*
)
*
= {A,B,C,D},
({B,C}
*
)
*
= {A,B,C,D}, ({B,D}
*
)
*
= {B,D}, ({C,D}
*
)
*
= {A,B,C,D}, ({A,B,C}
*
)
*
= {A,B,C,D},
({A,C,D}
*
)
*
= {A,B,C,D}, ({A,B,D}
*
)
*
= {A,B,C,D}, ({B,C,D}
*
)
*
= {A,B,C,D}, ({A,B,C,D}
*
)
*
=
{A,B,C,D}, ({ }
*
)
*
= {}

This gives the following poset ordered by set inclusion and after the mapping of corresponding
elements and renaming the universe:
b a + I b a e ,
A B
C D
152 THE MATHEMATICS OF GIS

Chapt er 11

Chapt er 12

{A,B,C,D}
{ }
{A,C} {B,D}
{C}
{D}
U
{ }
A B
C
D

153

Aliev R.A., Aliev R.R., 2001, Soft Computing and Its Applications. World Scientific Publishing
Co. Pte. Ltd., Singapore, London.
Armstrong, M.A., 1983, Basic Topology. Springer Verlag, New York.
Bonham-Carter G.F., 1994, Geographic Information Systems for Geoscientists: Modelling with
GIS. Pergamon, Elsevier Science, Kidlington, U.K.
Burrough P.A., McDonnell R.A., 1998, Principles of Geographical Information Systems. Oxford
University Press.
Burrough P.A., Frank A.U. (Eds.), 1996, Geographic Objects with Indeterminate Boundaries.
GISDATA II, Taylor & Francis, London.
Corbett, J.P. 1979. Topological Principles in Cartography. Technical paper – Bureau of the
Census; 48.
Davey, B.A., Priestley, H.A. 1990. Introduction to Lattices and Order. Cambridge: Cambridge
University Press.
Demicco R.V., Klir G.J., 2004, Fuzzy Logic in Geology. Elsevier Science (USA).
Dubois D., Prade H., 1980, Fuzzy Sets and Systems. Academic Press, San Diego.
Dubois D., Prade H., 2000, Fundamentals of Fuzzy Sets. Kluwer Academic Publishers, Boston,
London, Dordrecht.
Edgar W.J. 1989. The Elements of Logic. Macmillan Publishing Company, New York.
Grimaldi R.P. 1989. Discrete and Combinatorial Mathematics. An Applied Introduction. Second
Hootsmans R., 1996, Fuzzy Sets and Series Analysis for Visual Decision Support in Spatial Data
Exploration. PhD thesis, University Utrecht, The Netherlands. ISBN 90 6266 134 3.
Jiang B., 1996, Fuzzy Overlay Analysis and Visualization in Geographic Information Systems.
PhD Thesis, University Utrecht and ITC, The Netherlands. ISBN 90 6266 128 9.
Kainz W., Egenhofer M., Greasley I. 1993, Modeling Spatial Relations and Operations with
Partially Ordered Sets. International Journal of Geographical Information Systems, Vol. 7,
No. 3, 215–229.
Kainz W. 1995, Logical Consistency. In: S.C. Guptill and J.L. Morrison (eds.), Elements of Spatial
Data Quality, Elsevier Science.
Leung Y., 1997, Intelligent Spatial Decision Support Systems. Springer-Verlag, Berlin,
Heidelberg.
Petry F.E., Robinson V.B., Cobb M.A. (Eds.), 2005, Fuzzy Modeling with Spatial Information for
Geographic Problems. Springer-Verlag, Berlin, Heidelberg
References and
Bibliography
154 THE MATHEMATICS OF GIS

Stanat D.F., McAllister D.F. 1977. Discrete Mathematics in Computer Science. Prentice Hall, Inc.,
Englewood Cliffs, N.J.
Tanaka K., 1997, An Introduction to Fuzzy Logic for Practical Applications. Springer Verlag, New
York.
Tang X., 2004, Spatial Object Modelling in Fuzzy Topological Spaces with Applications to Land
Cover Change. PhD thesis, University of Twente, Enschede, The Netherlands, ITC
dissertation number 108.
Zadeh L., 1965, Fuzzy sets. Information and Control 8; 338-353
Zheng D., 2001, A Neuro-Fuzzy Approach to Linguistic Knowledge Acquisition and Assessment
in Spatial Decision Making. PhD thesis, University Vechta and ITC, Enschede.
Zimmermann H.J., 1987, Fuzzy Sets, Decision Making, and Expert Systems. Kluwer Academic
Publishers, Dordrecht, The Netherlands.
Zimmermann H.J., 2001, Fuzzy Set Theory and Its Applications, Fourth Edition. Kluwer Academic
Publishers, Boston, Dordrecht, London.

155

absurdity, 9
antisymmetrix, 34
Arabs, 2
argument
logical, 20
assertion, 6
Babylonians, 2
bijection. See bijective
bijective, 37
CANTOR, 26
cardinality, 26
Cartesian product, 32
Chinese, 2
codomain, 33, 36
complement, 27
composite function, 37
composite relation, 35
conclusion, 20
conjunction, 7
constructive dilemma, 21
contingency, 9
contrapositive, 8
converse, 8
cross product, 32, See Cartesian product
destructive dilemma, 21
difference, 27
digraph, 33
directed graph. See digraph
disjunction, 7
domain, 33, 36
Egyptians, 2
equivalence class, 35
equivalence relation, 35
EUCLID, 2
exclusive or, 7
existential, 15
existential generalization, 22
existential instantiation, 22
existential quantifier. See quantifier
function, 2, 36
hypotheses, 20
implication, 8
inclusive or, 7, See disjunction
Indians, 2
injection. See injective
injective, 37
intersection, 27
inverse function, 40
irreflexive, 34
logic, 2
logical and, 7, See conjunction
map, 36, See function
mapping, 36, See function
modus ponens, 21
modus tollens, 21
negation, 7
one-to-one. See injective
onto. See surjective
operators, 7
power set, 29
predicate, 14
premises, 20
proposition, 6
propositional forms, 6
propositional variables, 6
quantifier
existential, 15
universal, 15
quotient set, 35
reflexive, 34
relation, 2, 33
satisfiable, 15, 16
set, 26
set theory, 2
structures, 2
subset, 27
proper, 27
Sumerians, 2
superset, 27
surjection. See surjective
surjective, 37
syllogism, 21
disjunctive, 21
Index
156 THE MATHEMATICS OF GIS

hypothetical, 21
symmetric, 34
tautology, 9
transformation, 36, See function
transitive, 34
truth table, 7
union, 27
universal generalization, 22
universal instantiation, 22
universal quantifier. See quantifier
universe. See universe of discourse
universe of discourse, 14
unsatisfiable, 15, 16
valid, 16

Wolfgang Kainz Department of Geography and Regional Research University of Vienna Universitätsstraße 7, A-1010 Vienna, Austria E-Mail: wolfgang.kainz@univie.ac.at Version 2.1 (August 2010)

Contents
0. Preface ............................................................................ XI  1. The Structure of Mathematics ........................................ 1  1.1 Brief History of Mathematics ...................................................................... 2  1.2 Sub-disciplines of Mathematics................................................................... 2  2. Propositional Logic .......................................................... 5  2.1 Assertion and Proposition ............................................................................ 6  2.2 Logical Operators ......................................................................................... 7  2.3 Types of Propositional Forms...................................................................... 9  2.4 Applications in GIS .................................................................................... 11  2.5 Exercises ..................................................................................................... 11  3. Predicate Logic.............................................................. 13  3.1 Predicates .................................................................................................... 14  3.2 Quantifiers .................................................................................................. 15  3.3 Quantifiers and Logical Operators ............................................................ 16  3.4 Compact Notation ...................................................................................... 17  3.5 Applications in GIS .................................................................................... 18  3.6 Exercises ..................................................................................................... 18  4. Logical Inference ........................................................... 19  4.1 Logical Arguments..................................................................................... 20  4.2 Proving Arguments Valid in Propositional Logic .................................... 20
4.2.1 Proving Arguments Valid with Truth Tables ................................................................ 21  4.2.2 Proving Arguments Valid with Rules of Inference ....................................................... 21

4.3 Proving Arguments Valid in Predicate Logic ........................................... 22  4.4 Applications in GIS .................................................................................... 23  4.5 Exercises ..................................................................................................... 23  5. Set Theory ...................................................................... 25  5.1 Sets and Elements ...................................................................................... 26  5.2 Relations between Sets .............................................................................. 27  5.3 Operations on Sets...................................................................................... 27  5.4 Applications in GIS .................................................................................... 29  5.5 Exercises ..................................................................................................... 30  6. Relations and Functions ............................................... 31  6.1 Cartesian Product ....................................................................................... 32  6.2 Binary Relations ......................................................................................... 32
6.2.1 Relations and Predicates ................................................................................................ 33  6.2.2 Graphic Representation of Binary Relations................................................................ 33
I

... Topology........................1............ Closure......................................................................... 44  7...........................3..........1................4 Applications in GIS .......................................1.....................3....3 Scaling ......................................................2........................................ 68  9.......1 Geometric Transformations .......3 Transformations between Cartesian and Polar Coordinate Systems ......................................1 Equivalence Relation ............1 Topological Spaces ........................1.............................................................2...........3 Classification of Topological Spaces ....................................................................................5 Exercises .........................................................1 Signature and Variety .........................................................................................................................................4 Alternate Definition of a Topological Space .............4 Applications in GIS ........................................................II 6.... 44  7...................... 65  8...........4 Vector Space .......................................................3 Homogeneous Coordinates .................. 61  8................... 53  7...................................................... 37  6.........2 Order Relation ........... 56  7.................................... 36  6...............................1 Vectors .......... 76  ........................................................ 35  6...2 Topology and Open Sets...........................................5 Exercises ........................................................2............................................................................................................4 Applications in GIS .............................................2 Matrices ..1........... 52  7.................................................................................1 Components of an Algebra ................................3.............1.2............. 52  7.....4 Transformation between Coordinate Systems ..........1........................................................................2 Identity and Zero Elements .......................................................2.....................2 Rotation ...........1.............................................2 Field ...................3............... 52  7.2 Combination of Transformations ...................................5 Exercises ....................... 63  8..........................3 Functions .......................................................................................3....................................................................................................1 Cartesian Coordinate Systems ................................ 67  9.............. and Exterior....1 Coordinate Systems....................................................................1 Translation ...................................................................................3..................... 66  9.................................................................... 76  9..........................2 Vectors and Matrices ...................... 42  7..................................................3.........1...................2 Base.... 34  6......1 Group ... 45  7....................................2...1.... 47  7.......................... 62  8.......1 Metric Spaces and Neighborhoods ... 63  8......................... 47  7.........................................................................3 Transformations .................................... 61  8...............................1 Composition of Functions ........3..........................1................3.................... 51  7...................................... 47  7......................................4 Composition of Relations ..1 Separation Axioms .................................................................................................... 45  7.......................... 68  9........................................... 33  6............................ Algebraic Structures ..........2........ 59  8.................................................. 53  7..2 Polar Coordinate Systems ..................................4 Geographic Coordinate System .2 Classes of Functions ........ 40  6........................................................... 72  9.............................................................................................................. 64  8....... 60  8. 58  8.................3 Homomorphism ............................................................................................................ 57  7....................................................................................................................................2 Varieties of Algebras......... 71  9................... 43  7..............3...........3...............................................................3....................................................................................3 Boolean Algebra .................. 37  6........................................2............................................................................................................................................................... Boundary..................................... Interior......................2.....3 Continuous Functions and Homeomorphisms .......... 74  9....................1.............................................................. 35  6...................................................1.......................... 54  7.......... 55  7.................. 60  8........................................ Coordinate Systems and Transformations ............................2...... 62  8..............................3 Special Properties of Relations............ 69  9......................................................

.........3 Normal Completion ...................................................1......... 110  11........................................................................7 Fuzzy Inference ............................................................... Graph Theory .......2 Topological Transformations.......................................................................................1 Directed Graph ..................1 Fuzziness ......... Shortest Path Problem ...........1 Posets ...................................................3..............................................5.... 83  9...... 86  9...................... 78  9.......................................... 111  11........... 91  10...................................................2 Crisp Sets and Fuzzy Sets ......................4.....................................................5.... 82  9..4 Application in GIS ..................1...............................2 Planar Graph ...4 Simplicial Complexes and Cell Complexes................... Ordered Sets .... 110  11........................................................... 118  12..............2 Lattices................ 94  10............................................................................6 Exercises .............................3.................................. 101  10..........3.....4 Connectedness ......................................... 107  11............4.......................................... 94  10.......................................1 Spatial Data Sets .............................. Fuzzy Logic and GIS ......................................... 103  11..........5 Exercises ........................3................................ 115  12......................................................................................................... 122  12........... 105  11........5 Applications in GIS........................................................... 116  12...................2........................................... 96  10.................... 99  10.........2 Hamiltonian Tours ............... 112  12...................................... 114  12........................... Circuit........................................2 Cells and Cell Complexes ........................................ 87  9.......................................... 111  11............................................... 82  9................ 88  9.1.....1 Special Elements ..................................................................................................2 Normal Completion Algorithm ..............................................2 Compactness................................ 97  10.1......................................... 106  11..................................................................................3 Shortest Path Problem.....................................................1 Basic Concepts .................................................2 Fuzziness versus Probability....................................................................................5........1 Eulerian Graphs..................................... 123  ........................................................3 Size................................................................. 80  9....4 Eulerian and Hamiltonian Tours........................4.................................................................. 114  12.............................................. 95  10........................................................................................ Connectivity .............................................. 98  10......................................................... 81  9.......................................................................................................................... 108  11................................................................................................................................................. 111  11.... 101  11........ 93  10............4 Operations on Fuzzy Sets ............................................................................................................................... 90  9......................................................3 Topological Consistency ....................2 Path...6 Linguistic Variables and Hedges.....5................3 Representation of Graphs ............................................................................. 113  12................ 88  9.5 Alpha-Cuts.........................................2 Important Classes of Graphs..................................................4..............................................................1 Order Diagrams....................................6 Exercises ..........4...........5 Applications in GIS .....1.................... 107  11.............. 104  11................................................................................1.............2 Upper and Lower Bounds .........................................1 Simplexes and Polyhedra ..........................1 Motivation.............................................2......................................... 107  11..........................................................III 9........................1 Introducing Graphs ....3 Membership Functions .......................................4 Spatial Relations ......3........................... 114  12......................... 122  12..................................................................................................................

.............. 124  12........... 127  12....................................3........................3 Space And Time In Real World Models .......5 Summary ........1 Spatial Data And Information ............................................. 129  12.................................................................................................2 Databases .....................3........................................................2.........................................................................................................3 ArcView 3.................3...............3 Contemporary Concepts Of Space And Time ........................3..2 Spatial Data Models ..........................................................................................................................................................................................2........... 130  12.....................8................................3..3...........1 ArcInfo GRID.....................2 Classical Concepts Of Space And Time.............................................IV 12...............................................................4..........................................4.................... 149  15..................................................... Spatial Modeling ....3 Software Approach .. Solutions of Exercises ....... 137  13...... 155  ................................................................... 148  14........ 141  13.......... 132  12........ 146  13.......4.............4 Real World Models And Their Representation ..... 146  13......................................................................................3..................... Index ...........................................2 Fuzzy Concepts ....... 142  13................ 139  13........................................................................... 129  12....................................................... 148  13..............7.................................................................................................................................................................................................... 132  13.............1 Pre-Newtonian Concepts Of Space And Time ........................................4.3... 137  13............2...............4 ArcGIS 9 Script ...................................3.............................7................................4 Result....... 136  13....................5 Spatiotemporal Object Model ..............................1 Objective .....................4........................................................................... 153  16........................................3.... 143  13..4................................................8 Applications in GIS......4...................... 129  12...................4 Event-based Model . 130  12..................2.............................................. 131  12...............................4.......................................................2............x............. References and Bibliography ....2 Concepts Of Space And Time ................................3 The Real World And Its Models ............................1 Maps....8..........................1 Real World Phenomena And Their Abstractions ...1 MAMDANI’s Direct Method ..........................................................................................2 Object-based Models .... 142  13........................... 144  13.............. 138  13..................... 147  13..... 147  13....................................................8..... 130  12...... 135  13................................................. 145  13..... 148  13................... 140  13.................1 Space-Time Cube Model........3.....8............................................................................8.1................2 ArcMap Spatial Analyst . 140  13....................1 Field-based Models ..4...................2..................................................................8. 139  13.............9 Exercises ................................2 Simplified Method ..............8.......................................................................................... 147  13...................4 Concepts Of Space And Time In Spatial Information Systems ..............................................................3 Spatiotemporal Data Models ...........................4............................1 Database Design ........................ 136  13.............8.....2 Snapshot Model...................................................... 129  12........................................................3 Space-Time Composite Model ..................................3...................................................................................

................................................... Polar coordinate system in the plane ................. Raster Calculator with logical connectors .....List of Figures Figure 1......................................................................................................... Conversion between Cartesian and polar coordinates in the plane ............ 47  Figure 18................ Separation axioms T0...................................................... 45  Figure 15......... Cartesian coordinate system in 3-D space ......... Separation axioms T3 and T4 ............ Relationship between separation characteristics of topological spaces ...... open sets and neighborhoods and related theorems .......... Sub-disciplines of mathematics and their relationships ............................... 34  Figure 6...................................................... Functions and relations .................................................. 54  Figure 24....... Point vector .................................... 11  Figure 3............................... 72  Figure 30............................. Non-commutativity of the Cartesian product ........ Neighborhood axioms .................................... 45  Figure 14................... Spatial relations derived from topological invariants.................. Rotation ..................................................... Geographic coordinate system ..................... Raster calculator interface ....................................................... 58  Figure 25........... Equivalent approaches to the definition of a topological space.................................... 71  Figure 29.............................. closure (lower left) and exterior (lower right) of an open set .......................................................... Manual digitizing setup ...................... Cartesian coordinate system in the plane................................................................................................ 44  Figure 12.......................... Cross product of two vectors................... 44  Figure 13..................... 78  Figure 34.......................................................... 40  Figure 9.......... 50  Figure 20............ Example of a homeomorphic function ......................................................................................................................................................................... 50  Figure 21................................... Spherical coordinate system................................. 26  Figure 4.......... 36  Figure 7............................................................ 45  Figure 16........................................................ Map projections with singularities ...... Composition of relations ........... Continuous function ...................... 78  V ........................................... 53  Figure 23............... Scaling ............................................. boundary (upper right)..... 73  Figure 31.... 69  Figure 27......................................................................... 70  Figure 28............ Topological relations ......................... Translation................. 3  Figure 2.................................... 41  Figure 11............. 41  Figure 10............ 48  Figure 19...................................................... 32  Figure 5..................... 77  Figure 33...................................... and T2 ........................................... Conversion between Cartesian coordinates and spherical coordinates ...... Sample relations ............................................... 76  Figure 32.................................................................... 65  Figure 26........................................................................................................................... 52  Figure 22.................. Interior (upper left)......... 37  Figure 8.............. T1..................................... 46  Figure 17............................................................ Open disk in  2 ................................... VENN diagram.......... Scalar triple product ........................................

..... Simplexes of dimension 0....................................................................... Linear membership function ................................................................................... 106  Figure 54............................................................... 123  Figure 69...................... 109  Figure 59....................... Node consistency check ................................................... Poset and corresponding diagram .................... and 3 .. 120  Figure 66............... 89  Figure 43........ Topological mapping ................................................ 116  Figure 60............... and “tall” .......................................... Gaussian membership function ............................... 83  Figure 37....... 107  Figure 56.... Undirected and directed graph ........... Membership function for Tall and Slightly Tall .............. 90  Figure 44............... and Very Very Tall ............... Two-dimensional spatial data set as cell complex .. Sinusoidal membership function............. Isomorphic graphs ............... 117  Figure 61............................. Connected (G) and disconnected (H) graph .. Fuzzy set intersection ............ The seven bridges of Königsberg ................................................ 123  Figure 70....... 100  Figure 48...... 107  Figure 55............................................ 105  Figure 53................... 85  Figure 39.............................. Normal completion lattice ........................................................................................ Law of the excluded middle and law of contradiction for fuzzy set Average.................................................... 104  Figure 52............. 118  Figure 63......................... 121  Figure 67...... Closed polygon boundary check .................. 124  ............. 117  Figure 62............ Unit balls and cells.................... Fuzzy set union operators ........................................................................................................................................................................................................................................................... 101  Figure 49................................................ Lower bounds .... 119  Figure 64. Geometric interpretation of new lattice elements................................................... Construction of a CW complex...................... Inference rule in MAMDANI’s direct method........ 82  Figure 36.................................................... 104  Figure 51........................................................ 123  Figure 71........................................... 108  Figure 58... Set inclusion ................................... 120  Figure 65.......... Normal completion ............. Membership functions for Tall............................................................................................. 1.... Membership functions for “short”...............121  Figure 68................................. Cell decomposition and skeletons....................................... 84  Figure 38. 96  Figure 47.................................. Valid simplicial complex (left) and invalid simplicial complex (right) ................................................. Dual graph ........................................................... “average”.......... 88  Figure 42......................... Spatial relationships between two simple regions based on the 9-intersection91  Figure 45.......................................... Membership function for Tall and Not Very Tall ........................... Planar graph ............................... Graph of the Königsberg bridge problem............................................................VI Figure 35.... 86  Figure 40........................ 87  Figure 41......... 95  Figure 46................. Directed graphs ......................................... 2........................................................ Complete graphs ............... 108  Figure 57................. 101  Figure 50........................................................... Very Tall.................... Fuzzy set and its complement ..

............. Platonic solids as building blocks of matter ................ Simplified Method .................................................................................................. 127  Figure 75...................................................................................... 128  Figure 77. 145  Figure 84........... Data modeling from the real world to a database (digital landscape model)........... 146  ......................................................... .......... Membership functions for favorable and unfavorable aspect..... 126  Figure 73................... Fuzzy inference step 2 ............................................. 142  Figure 82........................... 126  Figure 74................................................. 138  Figure 81... 128  Figure 78...... Two data layers in a field-based model ...... 143  Figure 83......... Membership function for “high elevation”........VII Figure 72.................................................................................. ............................................ Fuzzy inference final result ...................................................... 132  Figure 80............... and from there to digital cartographic models and analogue products for visualization ............................................. Layers in an object based model .............................. Spatial modeling is a structure preserving mapping from the real world to a spatial model.......... 129  Figure 79.................................. Membership functions for flat and steep slope.................. 127  Figure 76............................... Analysis with a fuzzy logic approach (left) and a crisp approach (right) .... Fuzzy sets of the rules............

.

........................... Logical relationships involving quantifiers............................................. 7  Table 2................................................. Logical identities ................... Truth tables for logical operators........................................................ ArcInfo overlay commands ................... Properties of the Cartesian product .................................................... 22  Table 8.................................. Normal completion ............. 8  Table 3................. Data models and schemas in database design (the ANSI/SPARC architecture)144  IX ....................................................................................................................... 126  Table 22...................................................................................................................................................... Rules of inference.... Operators for hedges ... 116  Table 16...... 21  Table 7.................... 88  Table 13........................................... closure....... 10  Table 4......................................................................... 122  Table 20................... 75  Table 12...... Rules for set operations valid for crisp and fuzzy sets ................. Characteristic function for height classes................................... 99  Table 14...................... Special elements and the closure operator in the normal completion.. Rules for set operations ..................................................... Hedges and their models............................... Properties of interior......................... Fuzzy inference step 1 .................. 99  Table 15............................... 28  Table 9.......................................................... Arc table for the arc-node structure ................................................................................ Logical implications ......... Logical Connectors ............................. 122  Table 21.. Rules of inference involving predicates and quantifiers ..... 116  Table 17. 121  Table 18.......... Rules valid only for crisp sets.............................. 32  Table 11...................... 121  Table 19.......................... Membership values for the height classes.................................. 17  Table 6...................................... 29  Table 10......................................................List of Tables Table 1...................................... 11  Table 5.. and boundary of a set ...........................

.

Readers are expected to have a general knowledge of high school mathematics. The Binary Bible of Saint \$ilicon Logic and set theory can be regarded as the foundation of mathematics. Mathematics is written in the language of logic. The next chapter on coordinate systems and transformations builds the bridge between the foundation and the more advanced chapters on mathematical structures. The book is structured into 13 chapters Chapter 1 gives a brief overview of the structure of mathematics and how the different mathematical disciplines are built on top of more fundamental ones. the methods of drawing logical conclusions from given facts. consistency to spatial analysis. The next three chapters deal with mathematical logic. It appears also in programming languages as syntactic constructs to express propositions. It shows how vague concepts can be formalized in mathematical language and how they are applied to spatial decision making. These two chapters together with the three chapters on logic represent the foundation for the subsequent chapters dealing with mathematical structures. Yet there’s method in it. and to infer conclusions from given or assumed facts. topology. Propositional and predicate logic are presented as well as logical inference. and set theory is the very fundament on which all mathematical theories are built. These chapters address the mathematical core of many GIS functions from data storage. Uncertainty plays an increasingly important role in GIS. The purpose of this book is to provide the reader with the mathematical knowledge needed when they have to deal with spatial information systems. and mappings. the language and foundation of mathematics. Logic is not only the language of mathematics. ordered sets. set operations. Chapters 8 to 11 present the highly relevant subjects of algebra. The use of computers and software for the handling and processing of spatial data requires new contents such as discrete mathematics and topology. predicates. and graph theory. Chapter 5 and 6 are an introduction into the basic notions of sets. relations.” . XI . Chapter 12 addresses fuzzy logic and its applications in GIS. Much of chapter 7 would normally be considered to belong either to (analytical) geometry or to linear algebra.CHAPTER 0 Preface “Though this be madness.

The best way. Chapters 7. It shows that spatial modeling is built on solid mathematics as well as that there are challenging and interesting philosophical questions as to how to represent models of spatial features. The author appreciates any comments and hints that might help to improve the text or its appearance. and 13 can be read individually without losing too much of the context. of course. For someone with a particular interest in more advanced structures chapters 8 to 11 will be of interest. The book can be read in several ways as illustrated by the horizontal blocks in the following diagram. respectively.XII THE MATHEMATICS OF GIS Chapter 13 is a synthesis of the previous chapters together with some philosophical considerations about a space and time. 12. August 2010 . is to read all the text from chapter 1 to 13. This book is work in progress and not every chapter or section is complete. Wolfgang Kainz Vienna. Chapter 1: The Structure of Mathematics Chapter 2: Propositional Logic Chapter 3: Predicate Logic Chapter 4 Logical Inference Chapter 5: Set Theory Chapter 6: Relations and Functions Chapter 7: Coordinate Systems and Transformations Chapter 8: Algebraic Structures Chapter 9: Topology Chapter 10 Ordered Sets Chapter 11: Graph Theory Chapter 12 Fuzzy Logic Chapter 13: Spatial Modeling Readers interested in the logical and set theoretic foundations might want to read chapters 2 to 4 and chapters 5 and 6.

1 . Over the centuries. In the beginning.CHAPTER 1 The Structure of Mathematics M athematics is an activity that has been performed by humans since thousands of years. This chapter gives a brief history of mathematics and explains how the different theories and branches of mathematics are rooted in logic and set theory. mathematics has become a scientific discipline with many applications in all domains of life. The understanding of what mathematics is has changed over the centuries. mathematics was mainly devoted to practical calculations related to trade and land surveying.

2

THE MATHEMATICS OF GIS

1.1 Brief History of Mathematics
The first known cultures that actively performed mathematical calculations in ancient history were the Sumerians, Babylonians, Egyptians, and the Chinese. In the beginning, mathematics was always related to practical problems of commerce, trading and surveying. This is the reason why the ancient cultures mainly developed practical solutions for arithmetic and geometric problems. In the fifth century before Christ, the ancient Greeks started to do mathematics for its own sake, and to focus the scientific attention to mathematics as a science. The concept of axioms and logical deduction was developed then. The first great example of this approach is The Elements of EUCLID, the first textbook on geometry, which was valid until the 19th century. The Indians and Arabs further developed the number concept and trigonometry. In the 17th and 18th century, the concepts of calculus and analytical geometry were developed as a consequence of the intensive studies in physics and natural sciences. In the 19th century, mathematicians began to establish an axiomatic foundation of mathematical theories. Starting from a minimal set of axioms statements (theorems) can be derived whose validity can be formally established (proof). This axiomatic approach has been applied since then to formalize mathematics. Logic and set theory play an important role as the language and foundation principle, respectively.

1.2 Sub-disciplines of Mathematics
Logic is a formal language in which mathematical statements are written. It defines rules how to derive new statements from existing ones, and provides methods to prove their validity. Set theory deals with sets, the fundamental building block of mathematical structures, and the operations defined on them. The notation of set theory is the basic tool to describe structures and operations in mathematical disciplines. Relations define relationships among elements of a set or several sets. These relationships allow for instance the classification of elements into equivalence classes or the comparison of elements with regard to certain attributes. Functions (or mappings) are a special kind of relations. Sets whose elements are in certain relationships to each other or follow certain operations are mathematical structures. We distinguish between three major structures in mathematics, algebraic, order, and topologic structures. In sets with an algebraic structure we can do arithmetic, sets with an order structure allow the comparison of elements, and sets with a topologic structure allow to introduce concepts of convergence and continuity. Calculus is based on topology. Often, sets carry more than one structure. The real numbers, for instance, carry an algebraic, an order, and a topologic structure. Results from algebraic topology are used in the theory of geographic information systems (GIS). Figure 1 shows the sub-disciplines and their position in a general concept of mathematics and the fundamental building blocks.

THE STRUCTURE OF MATHEMATICS

3

Algebra

Ordered Sets Order Structures

Topology

Algebraic

Topological

Relations

Set Theory

Logic

Figure 1. Sub-disciplines of mathematics and their relationships

On top of the different structures and mixed structures, we find the many mathematical disciplines such as calculus, algebra, and (analytical) geometry. The classical theories of great importance in spatial data handling are (analytical) geometry, linear algebra, and calculus. With the introduction of digital technologies of GIS other branches of mathematics became equally important, such as topology, graph theory, and the investigation of non-continuous discrete sets and their operations. The latter two fall under the domain that is usually called finite or discrete mathematics that plays an important role in computer science and its applications.

P ropositional logic deals with assertions or statements that are either true or false and operators that are used to combine them. Any other statements for which we cannot 5 . and logical operators.CHAPTER 2 Propositional Logic establish whether they are true or false are not the subject of logic. Such statements are called propositions. The translation of natural language into propositions and the establishment of their truth-values with the help of truth tables are shown as well. propositional form. propositional variable. This chapter explains the principles of propositional logic by introducing the concepts of proposition.

Proposition (3) is false. and (4) is true. For the combination we use words such as “and”. 1 We call a logic in which assertions are either true or false a two-valued logic. .” is a combination of the propositional variables P and Q using the connectors “or” and “not”. We use upper case letters P.… for propositional variables. A propositional variable is an arbitrary proposition whose truth-value is unspecified. (7) and (8) are assertions. if it is false. We can combine propositions and propositional variables to form new assertions.” Assertion (1) and (2) can be true or false. For this. we will use the 1-0 notation for truth-values. Truth-values are usually written as true. proposition and truthvalues. and which is used in computing (a bit can only assume two states. The following statements illustrate the concept of assertion. If a proposition is true. we will only deal with a two-valued logic. but no propositions. An assertion is a statement. Definition 1 (Assertion and Proposition). it has a truth-value of false. Example 2. Q. The following statements are not propositions: (5) “Are you at home?” (6) “Use the elevator!” (7) “ x  y  12 ” (8) “ x  6 ” (5) and (6) are not assertions (they are a question and a command. and therefore they cannot be propositions. and “not”. If an assertion is either true or false. it has a truth-value of true. R. one or zero).1 Assertion and Proposition Propositional logic deals with statements that are either true or false. The law of the excluded middle characterized a two-valued logic. “P or not Q. F. on or off. 0. propositional variables and propositional forms. the assertion becomes a proposition.” “I pass the exam.” “3 + 4 = 8” “3 is an odd number and 7 is a prime number. The following are propositions: (1) (2) (3) (4) “It rains. false. we use Definition 2 (Propositional Variable). Example 1. “Beer is good and water has no taste” is a combination of the two propositions “Beer is good” and “Water has no taste” using the connector “and”.6 THE MATHEMATICS OF GIS 2. Here. Only when we replace the variables with some values. This is the logic on which most of the mathematical disciplines are built. Their truth-value depends on the value of the variables x and y . we call it a proposition. but not both1. or 1. In the following sections. Often we have to be more general in writing down assertions. or T. respectively). “or”.

. Logical Connectors Logical Connector Conjunction Disjunction Exclusive or Negation Implication Equivalence Symbol  Read or written as and or either … or but not both not implies. We exclude here the possibility of being a zombie. if…then… equivalent. iff2      To determine the truth-value for a combined statement we need to look at every possible combination of truth-values for the operands. This is done using truth tables that are defined for every operand.e. or logical connectives. When P stands for “Vienna is the capital of Austria” and Q stands for “Two is an odd number” then the propositional form in Example 2 “P or not Q” becomes the proposition “Vienna is the capital of Austria or two is an even number”. We use upper case Greek letters to denote propositional forms. The disjunction (or inclusive or) is true whenever at least one of the operands is true. when we say that “I am alive or I am dead” we clearly mean an exclusive or. the words “and”. Therefore. The other operators apply to two operands. The exclusive or is only true if either one or the other operand is true. It usually follows from the context what we mean. I can go to work and I can be tired at the same time. When we use the English term “or” we do not make explicit whether we mean the inclusive or exclusive or. a state of existence (the living dead) that appears frequently in horror movies. A person cannot be alive and dead at the same time. we cannot operate in this way. However. Definition 3 (Propositional Form). An operator such as “not” that operates only on one operand is called unary operator. The conjunction (or logical and) is only true if both operands are true. We use the symbols “0” for false and “1” for true. but never both. When we substitute propositions for the propositional variables of a propositional form.3 The term “iff” meaning “if and only if” is used only in written text. Table 2 shows the truth tables for the most common logical operators. A propositional form is an assertion that contains at least one propositional variable. we get a proposition. Example 3. “or”. those that operate on two operands such as “and” and “or” are called binary operators. and changes the truth-value of a proposition.2 Logical Operators In the example above P and Q are called operands. Negation is a unary operator. In mathematics.PROPOSITIONAL LOGIC 7 2. i. …if and only if…. Logical operators are used to combine propositions or propositional variables. we must make a distinction between inclusive and exclusive or. the truth-value of the new proposition depends on the logical connective and the truth-values of the old propositions. Table 1. Q. In the statement “I go to work or I am tired” the operator indicates an inclusive or. 3 2 . it applies to one variable. ( P. Table 1 shows the most common operators. When we use logical connectives to derive new propositions from old ones.) . and “not” are logical operators.

The statement “If this is an airplane. then the sun is hot” is true. We have to keep this in mind in order not to get confused by some propositions. and the contrapositive is “If I do not get wet. Truth tables for logical operators Conjunction P Q PQ 0 0 0 0 1 0 1 0 0 1 1 1 Disjunction P Q PQ 0 0 0 0 1 1 1 0 1 1 1 1 Exclusive or P Q PQ 0 0 0 0 1 1 1 0 1 1 1 0 Negation P P 0 1 1 0 Implication P Q PQ 0 0 1 1 0 1 0 1 1 1 0 1 Equivalence P Q PQ 0 0 1 1 0 1 0 1 1 0 0 1 In the implication P  Q we call P the premise. then it does not rain”. The implication can be read in many different ways: “If P . P  Q can be read in different ways: “ P is equivalent to Q ” .8 THE MATHEMATICS OF GIS Table 2. The statement “If I take a shower. The converse of this implication reads as “If I get wet. Example 5. then Q ” “ P only if Q ” “ P implies Q ” “ P is a sufficient condition for Q ” “ Q if P ” “ Q follows from P ” “ Q provided P ” “ Q is a logical consequence of P ” “ Q whenever P ” If P  Q is an implication then Q  P is called the converse and Q  P is called the contrapositive. According to the truth table for implications. the implication expresses a causal or inherent relationship between a premise and a conclusion. anything (either a true or a false statement) can follow from a false proposition. or antecedent. then I will get wet” clearly states a causal relationship between taking a shower and getting wet. In propositional logic. then it has wings” expresses a property of airplanes. there need not be any relationship between the premise and the conclusion of an implication. and Q the conclusion or consequence. hypothesis. Let us consider the implication “If it rains. then I get wet”. The implication is true because P is false and Q is true. In natural language. Example 4. Let us take P to be “the moon is larger than the earth” and Q as “the sun is hot”. The implication “If the moon is larger than the earth. although there is no relationship whatsoever between the two propositions. Two propositions that have the same truth-values are said to be logically equivalent. then it rains”.

The following examples illustrate the concepts of tautology. Contingency). Example 7. Whenever there are n propositional variables involved in a propositional form. A propositional form whose truth-value is true for all possible truth-values of its propositional variables is called a tautology. P Q  Q P   Q ( P  Q )  Q 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 1 0 1 1 . we have 2n possible combinations of true and false to investigate. Example 9. P P P  P 0 1 0 1 0 0 This is propositional form corresponds to the law of the excluded middle (also called “tertium non datur” with its Latin name) stating that something cannot be and not be at the same time. The propositional form ( P  Q)  Q is a contingency. A contingency is a propositional form that is neither a tautology nor a contradiction. Contradiction. A contradiction (or absurdity) is a propositional form that is always false. and contingency. The propositional form P  P is a contradiction. P Q Q 0 0 1 0 1 0 1 0 1 The 0 0 1 truth table 1 1 0 for the proposition ( P  Q ) is constructed as: P  Q ( P  Q) 1 1 0 0 1 We see that for two variables we have to investigate four different cases. we distinguish certain propositional forms that are either always true or always false. The propositional form ( P  Q )  P is a tautology. contradiction. P Q P  Q ( P  Q)  P 0 0 1 1 0 1 0 1 0 0 0 1 1 1 1 1 Example 8.PROPOSITIONAL LOGIC 9 “ P is a necessary and sufficient condition for Q ” “ P if and only if Q ” “ P iff Q ” The truth tables for logical operators are used to determine the truth-values of arbitrary propositional forms. Definition 4 (Tautology. regardless of the truth-values of the propositional variables.3 Types of Propositional Forms In propositional logic. Example 6. 2.

. 15. 14. 21. Logical identities 1.. 1 and 0 denote propositions that are always true and false.. 12. 3. 6. respectively. 11. 9. Simplify the following propositional form: (P  Q ) .. 2. Q.. 20. 13. Two propositional forms  ( P. Example 10. All the identities can be proven by constructing their truth tables using the truth tables of the logical operators established in Table 1 on page 7. 22. R. 16. This helps often to simplify logical expressions. 7.. R.) and  ( P.. 8. 17. Q. 19. Q. 10. 18. Identity 18 allows us to replace the implication by negation and disjunction. The numbers on the right indicate the identities that have been applied to simplify the propositional form (22) (P  Q ) (18) (Q  P) (7) (Q  P) Q  P (17) Q  P (4) P  Q .) is a tautology. We can replace one propositional form with its equivalent form. R. or when the equivalence  ( P. P  ( P  P) P  (P  P) ( P  Q)  (Q  P) ( P  Q)  (Q  P) [( P  Q)  R]  [ P  (Q  R)] [( P  Q)  R]  [ P  (Q  R)] ( P  Q )  (P  Q ) ( P  Q )  (P  Q ) [ P  (Q  R)]  [( P  Q )  ( P  R)] [ P  (Q  R)]  [( P  Q )  ( P  R)] ( P  1)  1 ( P  1)  P ( P  0)  P ( P  0)  0 ( P  P )  1 ( P  P)  0 P  (P ) ( P  Q )  ( P  Q ) ( P  Q )  [( P  Q )  (Q  P )] [( P  Q )  R]  [ P  (Q  R )] [( P  Q)  ( P  Q)]  P ( P  Q )  ( Q  P ) idempotence of  idempotence of  commutativity of  commutativity of  associativity of  associativity of  DE MORGAN’s Laws distributivity of  over  distributivity of  over  law of the excluded middle double negation implication equivalence exportation absurdity contrapositive In the table.. Table 3. 5. Table 3 lists the most important logical identities.)   ( P. 4. Q. Identities 7 and 8 (DE MORGAN’s laws) allow the replacement of conjunction by disjunction and vice versa.. R.. Such equivalence is also called a logical identity. The equivalence can be replaced by implications through identity 19...10 THE MATHEMATICS OF GIS Definition 5 (Logical Identity).) are said to be logically equivalent when their truth tables are identical.

The logical “and” connector is represented by the character “&”. &sv covername = [response ‘Enter a coverage name’] &if [exists %covername%] &then KILL %covername% ALL &else &type Coverage %covername% does not exist! 2. all raster cells with an elevation between 1.5 Exercises Exercise 1 Construct the truth table of the propositional form [( P  Q)  Q]  P . 2.4 Applications in GIS In GIS applications. Logical implications 1. In this example. we find logical operators mainly in spatial analysis and database queries. . Table 4 lists the most important of them. Logical connectors or comparison operators are often part of the condition. 6. logical connectors Figure 2. 5. Figure 2 shows the Raster Calculator of ArcMap Spatial Analyst with its logical connectors. P  ( P  Q) ( P  Q)  P [ P  ( P  Q )]  Q [( P  Q)  Q]  P [P  ( P  Q )]  Q [( P  Q)  (Q  R)]  ( P  R ) ( P  Q )  [(Q  R )  ( P  R )] [( P  Q )  ( R  S )]  [( P  R)  (Q  S )] [( P  Q)  (Q  R)]  ( P  R) addition simplification modus ponens modus tollens disjunctive syllogism hypothetical syllogism Some of these implications correspond to rules of inference that will be discussed later. Table 4. 3. 4.500 will be selected.000 and 1. which takes the general form if <condition> then <statement> else <statement> The condition contains an expression that can be evaluated as either true or false (proposition). 8. The following AML program prompts the user for a coverage name and deletes it if it exists. 9. 7. Raster Calculator with logical connectors The logical implication can be found in every programming language in the form of the if-statement. 2.PROPOSITIONAL LOGIC 11 Many useful tautologies are implications.

” (c) “I will not pass the exam. find equivalent expressions using identities. Simplify the propositional form ( P  Q)  (P  Q ) . FUNC is a logical function and z is an output variable. Let P be the proposition “It is raining.” For the following expressions. Optimizing compilers generate code that is only executed when really needed.” Let R be the proposition “I am sick.” (b) “I will stay only if he leaves. Assume such an optimized code has been generated for your program. if I do not study hard. then I get wet and I am sick. The equivalent expressions must use only  and  and be as simple as possible.” (a) Write the following propositions in symbolic notation: (i) If it is raining. (iv) It is raining and I am not sick. then I get wet.12 THE MATHEMATICS OF GIS Exercise 2 Exercise 3 Exercise 4 Show that ( P  Q)  ( P  Q) is a tautology. y are logical variables. The value of z is determined by the execution of the function FUNC. (a) P  Q  R (b) P  [(Q  R)  P] (c) P  (Q  P) Exercise 5 Exercise 6 Exercise 7 In a computer program you have the following statement x ← y and FUNC(y. (b) Write a sentence in English that corresponds to the following propositions: (i) RQ (ii) ( P  Q )  R (iii) ( R  Q) (iv) (Q  R )  ( R  Q ) Write down the converse and contrapositive of the following propositions: (a) “If it rains. Can you always rely on that a value for z is computed? . (ii) I am sick if it is raining. (iii) I will not get wet.” Let Q be the proposition “I will get wet.z) where x.

such as “All humans are mortal” or the equation with two variables “x + y = 2”. This chapter introduces the concepts of predicates and quantifiers that enrich the language of logic and allow making assertions in a much more general way than what is possible in propositional logic. We frequently need to make general statements about the properties of an object or relationships between objects. The knowledge acquired about predicates will be used to translate natural language statements into the form of predicates. 13 .CHAPTER 3 Predicate Logic T he language of propositional logic is not powerful enough to make all the assertions needed in mathematics.

When we replace x by “John” and y by “Vienna” it becomes the proposition “John lives in Vienna. x n ) . c 2 . and “lives in” is a predicate.  . These constructs express a relationship between objects or a property of objects. A term designating a property or relationship is called a predicate.14 THE MATHEMATICS OF GIS 3. Universe). c 2 . In the expression P ( x1 . Whenever we use specific predicates. because the truth-value of this statements depends on the values of the variables x and y . we will denote predicates with upper case letters. x 2 . c n ) . The universe is normally denoted as U and must contain at least one element. Example 13. If P (c1 .1 Predicates In the language of propositions we cannot make assertions such as “ x  y  5 ” or “ x  y ”. and “ x  y  z ” could be written as S ( x. c 2 . Otherwise.  . x 2 . Assertions made with predicates and variables become a proposition when the variables are replaced by specific values. respectively. In the assertion “x lives in y” x and y are variables. If P (c1 . we must distinguish between predicate variables and predicate constants. Predicates appear commonly in computer programs as control statements of highlevel programming languages. then we say that P is valid in the universe U. Definition 6 (Predicate). Definition 7 (Variables. we get a proposition P(c1 . The values To be precise. c 2 .” Example 12. c n ) is true for every choice of elements from the universe.  . Examples are “equal to” or “greater than” that are usually written as “=” and “>”. z ) . P is a predicate4. L or S in Example 13. Example 11. “x lives in y” can be written as L( x. Only when we assign values to the variables. c n ) is true for some elements of the universe.  . The assertion “x is a woman” can be written as W ( x) .  . y ) . The statement “if x < 5 then y ← 2 * y” for instance contains the predicate “x < 5”. x n ) . 4 . whereas an expression like P with no immediate interpretation of the predicate denotes a predicate variable. Definition 8. the assertions become propositions. When we take values c1 . Values for the variables must come from a set called the universe of discourse. We also make assertions in natural language like “Ann lives in Vienna” or “All humans are mortal” that correspond to a general construct “ x lives in y ” or “all x and M ( x) ”. When P has n variables we say that it has n arguments or it is an n-place predicate. such as W. we actually deal with predicate constants. c n from the universe and assign them to the variables of a predicate P ( x1 . Some predicates have a well-known notation in mathematics. When the program runs the current value of x determines the truthvalue of “x < 5”. or the universe.  . and the x i are variables. we say that P is satisfiable in the universe U. y.

We say that the variables are bound. The statement “for some x . As we have seen above variables can be bound by assigning values to them. and can be read as “there exists”. and (7) are true. Definition 9 (Binding of Variables). (5). the universal and the existential quantifier. the assertion P(x) is true”) is a statement in which the variable x is universally quantified. P (x) ” becomes “ xP (x) ”.  . (4). it would be true in the positive integers   . it is false. We know two quantifiers. We can also express quantified assertions with propositions by assigning all elements of the universe to the variables and combining them with logical operators. We say that xP (x ) is true if and only if P (x) is valid in U . however.” The statement “for all x . P (x) ” (which means. If P (c1 . Propositions (3) is false in the integers. “for every”. Variables of predicates can be bound by assigning a value to them. c 2 . c 2 . or by quantifying them.  . it is false. There are two ways of binding variables of predicates. It is written as ! . otherwise. This quantifier is read as “there is one and only one x such that…”. If P (x) is a predicate then the assertion “for all x . and can be read as “for all”. Example 14. “for all values of x . P (x) ” becomes “ xP (x ) ”. c n ) is false for every choice of values of the universe we say that P is unsatisfiable in U. “for arbitrary”.PREDICATE LOGIC 15 c1 . which makes a predicate true. . 3. c 2 . P (x) ” (which means. “there exists at least one value of x for which the assertion P (x) is true”) is a statement in which the variable x is existentially quantified. Propositions (2) and (6) are false.  . “for any”. We say that xP (x ) is true if and only if P (x ) is satisfiable in U . “there is exactly one x such that…” or “there is a unique x such that…”. or “for each. c n ) true are said to satisfy P.2 Quantifiers We have seen that a predicate can become a proposition by substituting values for the arguments. If P (x) is a predicate then the assertion “for some x . otherwise. “for some” or “for at least one”. The existential quantifier “there exists” is written as  . There is also a variation of the existential quantifier to assert that there is one and only one element in the universe. Let us assume the universe to be all integers  and the following propositions formed by quantification: (1) x[ x  1  x] x[ x  5] (2) xy[ x  y  x] (3) x[ x  x  1] (4) x[ x  5] (5) x[ x  x  1] (6) ! x[ x  5] (7) Propositions (1). The universal quantifier “for all” is written as  . c n that make P (c1 .

we generally need quantifiers. If we bind one variable. Every integer is even or odd. Not all prime numbers are odd. Then the proposition xyP ( x. All prime numbers are non-negative. y ) means. predicates and logical operators. The only even prime number is two. These statements can take on a variety of different forms. It is unsatisfiable if there is no universe and no interpretation that make the assertion true. and xy by yx . y ) means. xO(x) x[ E ( x )  O ( x)] x[ P( x)  N ( x)] x[( E ( x)  P( x))  x  2] ! x[ E ( x)  P( x)] x[ P ( x)  O ( x)] . xy has not the same meaning as yx . If in an n-place predicate m variables are bound. An assertion is satisfiable if there exist a universe and some interpretations of the predicate variable that make it true.” The following examples show how assertions can be expressed in the language of predicate logic. see footnote 4 on page 14. Let the universe be the integers and E (x) denote “ x is an even number”. It affects the meaning of an assertion.g. y. There is only one even prime number. z ) representing “ x  y  z ” has three variables. Example 16. If the universe U consists of the elements c1 . and P(x) “ x is a prime number. (a) (b) (c) (d) (e) (f) (g) There exists an odd integer. N (x) “ x is a non-negative integer”. z ) with two free variables. representing “ 2  y  z ”. contradictions and contingencies in propositional logic we can also establish types of assertions involving predicate variables5. y )] . c 3 . The predicate P( x. then it is odd. y ) has to be evaluated as x[yP( x. Two assertions A1 and A2 are logically equivalent if for every universe 5 For the notion of predicate variable.3 Quantifiers and Logical Operators When we express mathematical or natural language statements.. . An assertion involving predicate variables is valid if it is true for every universe. The order of the quantifiers is not arbitrary. then we get the predicate P(2. Example 17. “There is a person so that everyone is the child of this person”. y. All variables must be bound to transform a predicate into a proposition. Example 15. x is assigned the value 2. The only exception is that we can always replace xy by yx . c 2 . we say that the predicate has n  m free variables.16 THE MATHEMATICS OF GIS Definition 10. 3. If an integer is not even. e. or x[ P( x)  O( x)] x[E ( x)  O ( x)] In analogy to tautologies. y ) denotes the predicate “x is child of y” in the universe of all persons. whereas yxP ( x. Definition 11 (Validity of assertions with predicate variables). respectively. Therefore xyP( x. then the propositions xP (x) and xP (x) can be written as P(c1 )  P(c 2 )  P(c3 )   and P (c1 )  P (c 2 )  P (c 3 )   . “Everyone is the child of someone”. The order in which the variables are bound is the same as the order in the quantifier list when more than one quantifier is applied to a predicate.  . O (x) “ x is an odd number”. If P( x.

Table 5 shows a list of logical equivalencies and other relationships between assertions involving quantifiers.4 Compact Notation The form of logical notation as presented here is often too complex to express relatively simple assertions in mathematical language. Logical relationships involving quantifiers 1. 9. 8.PREDICATE LOGIC 17 and every interpretation of the predicate variables A1  A2 . (8) and (9) tell us that whenever a proposition occurs within the scope of a quantifier. Predicates whose variables are not bound by a quantifier can also be removed from the scope of this quantifier. 3. i. In the same way we write for the assertion “there exists an x such that x  5 and P (x) is true” x[( x  5)  P ( x)] in the long notation and x x 5 P( x) in the compact notation. it can be removed from the scope of the quantifier. In the assertion x[ P ( x)  Q ( x)] the scope of the universal quantifier is P( x)  Q( x) . xP ( x)  P(c). 5. but the existential quantifier does not. In the assertion [xP( x)]  [xQ( x)] the scope of  is P(x) and the scope of  is Q (x) . Equivalencies (6). (13) and (11) show that the existential quantifier distributes over the disjunction. but the universal quantifier does not..where c is an arbitrary element of the universe P(c)  xP( x).where c is an arbitrary element of the universe xP ( x)  xP ( x) xP( x)  xP( x) xP ( x)  xP( x) [xP( x)  Q]  x[ P( x)  Q ] [xP( x)  Q]  x[ P( x)  Q] [xP( x)  Q ]  x[ P ( x)  Q ] [xP( x)  Q]  x[ P( x)  Q] [xP( x)  xQ( x)]  x[ P( x)  Q ( x)] [xP( x)  xQ( x)]  x[ P( x)  Q ( x)] x[ P ( x)  Q ( x)]  [xP( x)  xQ( x)] [xP( x)  xQ( x)]  x[ P ( x)  Q ( x)] The logical equivalencies (3) and (5) can be used to propagate negation signs through a sequence of quantifiers. a compact form of logical notation is used. A1 is true iff A2 is true. 13. Table 5. For the assertion “for every x such that x  0 . P (x) is true” we would have to write x[( x  0)  P ( x)] . 6. This notation allows also to propagate the negation sign through quantifiers as mentioned in logical equivalencies (3) and (5) of Table 5 above. The scope of a quantifier is the part of the assertion for which variables are bound by this quantifier.e. 10. Statements (10) and (12) show that the universal quantifier distributes over the conjunction. Therefore. (7). . 3. 7. 4. Instead we can write in compact notation xx  0 P( x) . Example 18. 11. 2. 12.

3. Let ARC(ID. then x is greater than z. A translation of this selection into standard SQL reads as SELECT * FROM ARC WHERE LPoly = 'A' or RPoly = 'A'. some numbers are odd. it designates a property of the tuples. (university students) . (animals) (d) There are areas.RPoly) be a relation schema describing arcs in a topologically structured data set. lines. we use the select operator to select a subset of tuples t (or records) in a relation that satisfies a given selection condition. we can denote the select operator as  selection condition (relation name) or   ( t ) ( R ) when we substitute selection condition with  (t ) and R for the relation name.StartNode. (geometric figures) (e) If x is greater than y and y is greater than z.. The selection condition is a predicate.6 Exercises Exercise 8 Translate the following assertions into the notation of predicate logic (the universe is given in parentheses): (a) If three is odd. In general.EndNode. (integers) (f) When it is night all cats are black.LPoly. (animals) (h) All students of this course are happy if they pass the mathematics exam. (animals) (c) All cats are blue.e.18 THE MATHEMATICS OF GIS 3. and points. (animals) (g) When it is daylight some cats are black. The selection operator  (LPoly = 'A' OR RPoly = 'A') (ARC) results in all arcs that form the boundary of polygon A.5 Applications in GIS In relational database technology. (integers) (b) Some cats are blue. i. and we can thus write the general selection as a predicative set expression {t  R |  (t )} .

These assertions are called theorems. which established the truth of a theorem. If this is not the case then the conclusion cannot be drawn from the hypotheses.CHAPTER 4 Logical Inference T his chapter introduces the concept of a logical argument. we derive assertions that can be shown to be true. 19 . If the conclusion follows logically from the premises. Starting from a set of premises (or hypotheses) a conclusion is drawn. In a formal mathematical system. we assume a set of axioms that are a set of given unquestioned true statements. From these axioms. the argument is valid. A proof is an argument.

. All men will adore Lisa. The argument presented above is written as Lisa is beautiful If Lisa is beautiful. In the first case. we assume that the two statements “Lisa is beautiful” and “If Lisa is beautiful. using truth tables or using rules of inference. Evaluate the tautological form using a truth table. The conclusion follows from the premises. all men will adore Lisa” are true.20 THE MATHEMATICS OF GIS 4.) Identify all propositions. Rules of inference specify which conclusions can be drawn from assertions known or assumed to be true. arguments can be proven valid in two ways. Example 19. In the case of applying rules of inference. An argument is said to be valid (or correct) when the conclusion follows logically from the premises. and we draw a conclusion from these assumptions. for instance. If. The procedure is straightforward: (i. A logical argument consists of a set of hypotheses (or premises) that are assumed true.) (iii. Note.2 Proving Arguments Valid in Propositional Logic In general. all men will adore Lisa. Assign propositional variables to the propositions. then we can conclude that “All men will adore Lisa”. the trick is to find the right rules and apply them properly. that the more propositions are involved the more tedious the procedure becomes. Definition 12 (Logical Argument). Write the argument in its tautological form using the propositional variables. P1: P2: Conclusion: The rule of inference applied is of the form P PQ Q 4.1 Logical Arguments Often we assume that certain assumptions are true.) (iv. Logical arguments are usually written is the form of P 1 P2  Pn Q where the Pi are the premises and Q is the conclusion.) (ii. an argument has to be translated into its equivalent tautological form.

for instance.2. The disjunctive syllogism.2 Proving Arguments Valid with Rules of Inference A second way to prove an argument valid is to apply rules of inference. Example 20. If this propositional form is a 1 tautology. Example 21. The proof that this is a tautology is left to the reader. The argument presented in Example 19 above is a straightforward application of the modus ponens. Table 6. then you choose the other one6. It has the tautological form [ P  ( P  Q)]  Q . Rules of inference Rule of inference Tautological form P  ( P  Q) ( P  Q)  P P PQ PQ P P PQ Q Q PQ  P PQ P Q PQ QR P  R P Q PQ ( P  Q)  ( R  S ) PR Q  S ( P  Q)  ( R  S ) Q  S  P  R Name addition simplification modus ponens [ P  ( P  Q)]  Q [Q  ( P  Q )]  P modus tollens [( P  Q)  P]  Q disjunctive syllogism hypothetical syllogism conjunction [( P  Q)  (Q  R)]  [ P  R] ( P  Q)  ( P  Q) [( P  Q )  ( R  S )  ( P  R )]  [Q  S ] constructive dilemma [( P  Q )  ( R  S )  (Q  S )]  [P  R] destructive dilemma Some of these rules of inference are evident. The argument in Example 19 above contains the propositions P “Lisa is beautiful” and Q “all men adore Lisa”. . the argument is correct. They are applied to the premises until the conclusion follows (argument valid) or the conclusion cannot be reached (argument invalid). their tautological form and the name that was given to them by logicians..2. Pn and the conclusion Q can be 1 written as a propositional form ( P  P2    Pn )  Q .1 Proving Arguments Valid with Truth Tables Every logical argument with n premises P . 4. simply says that if you have two options and you know that one is not available. Table 6 shows the most important rules of inference.LOGICAL INFERENCE 21 4. P2 . 6 Most people would agree that even dogs or cats know this.

and W denote John Williams. Let us consider the following argument: Every man has a brain.3 Proving Arguments Valid in Predicate Logic When we want to prove the validity of an argument that contains predicates and quantifiers. B(x) denote the assertion “x has a brain”. Table 7 shows some of the rules of inference involving predicates and quantifiers. John Williams has a brain. that there is one element c for which P(c) is true. Example 23. The existential instantiation concludes from the truth that there is at least one element of the universe for which the predicate is true.22 THE MATHEMATICS OF GIS Example 22.  B(W ) A formal proof of the argument is as follows: 1. that the existentially quantified assertion xP ( x ) is true. we need more rules. 3. In the same way as above the argument that “Women do not run after me”. and “If I were attractive all women would run after me”. Assertion x[ M ( x)  B( x)] M (W )  B (W ) M (W ) B(W ) Reasons Hypothesis 1 Step 1 and universal instantiation Hypothesis 2 Steps 2 and 3 and modus ponens . The existential generalization allows us to conclude from the truth that a predicate is true for one particular element of the universe. Rules of inference involving predicates and quantifiers Rule of inference xP ( x)  P (c ) P( x)  xP( x) xP( x)  P (c ) Name universal instantiation universal generalization existential instantiation existential generalization P (c )  xP( x) The universal instantiation allows us to conclude from the fact that if a predicate is valid in a given universe. 4. 2. Table 7. Let M (x ) denote the assertion “x is a man”. 4. then the universally quantified assertion holds. Then the logical argument can be expressed as: 1. M (W ) 3. Therefore. then it is also valid for one individual from that universe. x[ M ( x)  B( x)] 2. therefore “I am not attractive” is a straightforward application of the modus tollens. John Williams is a man. The universal generalization permits us to conclude that if we can prove that a predicate is valid for every element of the given universe.

I will not fail in the mathematics exam. P2: If I travel west then I reach the USA. . then 5 is no prime number . and are widely applied in the geosciences.5 Exercises Exercise 9 Translate the following argument into a symbolic notation and check if it is correct: P1: If I study well. Exercise 10 Translate the following argument into a symbolic notation and check if it is correct using a truth table: P1: If the Earth is a disk then I do not reach the USA. P3: I do not travel west and I reach the USA. 4. Spatial decision support systems (SDSS) are rule-based systems that are designed and tuned for spatial data. Conclusion: 5 is a prime number. P3: I failed the mathematics exam. Conclusion: I played soccer. If this is the case.4 Applications in GIS Rule-based systems apply rules to data provided using an inference engine. 4. the consequence is applied accordingly.LOGICAL INFERENCE 23 We do not go deeper into the theory of proving arguments in general predicate logic. 7 A prime number is any natural number n that can only be divided by 1 and n. P2: If I do not play soccer. I study. Conclusion: The Earth is not a disk. Rules are stored as implications in the form “if <premise> then <consequence>”. These systems are also called expert systems. P2: 6 is even. This is a straightforward application of the modus ponens. Exercise 11 Translate the following argument into a symbolic notation and check if it is correct: 7 P1: If 6 is not even. The inference engine examines the given data in the database and determines if they match a given premise.

.

The fundamental principles of subset and set equality as well as set union. 25 . Starting from an intuitive definition of sets. They are intuitively perceived as a collection of well- distinguished objects. we explore relations between sets and operations on sets.CHAPTER 5 Set Theory S ets are the very fundamental building block of many mathematical theories. and difference are explained. intersection. A formal definition and axiomatic foundation of set theory is more complicated and will not be discussed here.

26

THE MATHEMATICS OF GIS

5.1 Sets and Elements
Set theory was developed by GEORG CANTOR (1845-1918) as what we call today naïve set theory. This is a more intuitive approach than the axiomatic set theory. However, in naïve set theory there is the possibility for logical contradictions (or paradoxes), something that should not occur in a formal system.
Definition 13 (Set). A set is a collection of well-distinguished objects. Any object of the collection is called an element or a member of the set. An element x of a set S is written as x  S . If x is not a member of S we write x  S . If a set has a finite number of elements we call it a finite set. A set with no elements is called the empty, null or void set and is denoted as {} or  .

There are many ways to specify a set. A finite set can be specified explicitly by listing all its elements. The set A consisting of the natural numbers smaller than 10 can be written as A  {1,2,3,4,5,6,7,8,9} , or we can describe the set implicitly by means of a predicate and a free variable, A  {x | x    x  10} . We can also draw a set with a VENN diagram (Figure 3).
A

Figure 3. VENN diagram

In order to indicate the “size” of a set we need a measure. This is defined as the number of elements (or cardinality).
Definition 14 (Cardinality). The cardinality of a set S is the number of its elements, written as | S | .
Example 24. The set A  {x | x is a character of the English alphabet} has cardinality | A | 26 . Example 25. The natural numbers  are an infinite set. Their cardinality is denoted as 0 (pronounced as aleph zero8). Every set S that has the same cardinality as the natural numbers is called countably infinite.9 The proof is usually established by finding a one-to-one function that maps the natural numbers to S . Example 26. The cardinality of the integers  and the rational numbers  is 0 . The rational
numbers  are all fractions of the form
a where a, b   . b

Example 27. The cardinality of the real numbers  is denoted as c (the continuum). They are said to be uncountable infinite. There are more real numbers than rational numbers. An there are more rational numbers than integers.

8 9

Aleph is a character in the Hebrew alphabet. A set is finite if there exists a one to one correspondence between its elements and a subset of the natural numbers {1, 2, , n} for some n (including n  0 for the empty set). A set is countable if it is either finite or countably infinite.

SET THEORY

27

Example 28. The cardinality of the set A  {1,1, 2, 2, 2,3} is 3, because the elements of a set must be distinguishable. In A , element 1 appears twice, 2 appears three times, and 3 appears once. Since it does not matter how often an element is repeated, the number of elements is three. Example 29. The set A  {} has one element, the empty set. Therefore, its cardinality is 1. Although the empty set has cardinality zero, here it appears as an element of set A .

5.2 Relations between Sets
We know two relations between sets, subset and equality. The subset relation refers to the containment of one set in another.
Definition 15 (Subset). If each element of a set A is an element of a set B then A is subset of B , written as A  B . B is called superset of A , written as B  A . We call a set A a proper subset of B when A  B and A  B .

Two sets A and B are equal written as A  B if and only if A  B and B  A . The following statements can be derived from the definitions of sets and their relationships: (i.) (ii.) (iii.) (iv.) If U is the universe of discourse, then A  U . For any set A , A  A . If A  B and B  C , then A  C . The empty set is subset of every set, or for any set A ,   A .

5.3 Operations on Sets
In the following, we consider operations on sets that use given sets (operands) to produce a new set (resultant).
Definition 16 (Union). The union of two sets A and B , written as A  B is the set A  B  {x | x  A  x  B} . Definition 17 (Intersection). The intersection of two sets A and B , written as A  B is the set A  B  {x | x  A  x  B} . If A  B   , we say that the two sets are disjoint. Definition 18 (Difference). The difference of two sets A and B , written as A  B (or A \ B ) is the set A  B  {x | x  A  x  B} . Definition 19 (Complement). The complement of a set A , written as A , is the set A  U  A  {x | x  A} , where U is the universe of discourse.

Example 30. The following Venn diagram illustrates the operations A  B  C .

28

THE MATHEMATICS OF GIS

U
A C B

Union and intersection can generally be defined for more than two sets. Let I be an arbitrary finite or infinite index set. Every element i  I has assigned a set Ai , then the
union of the Ai is defined as
the intersection of the Ai as

A
iI

i

 {x | i[i  I  x  Ai ]} . In the same way we define

A
iI

i

 {x | i[i  I  x  Ai ]} .

Table 8 summarizes some of the most important rules for set operations. They can be easily proven by translating them into their equivalent form in the language of logic.
Table 8. Rules for set operations 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31.

A A A A A A ( A  B)  C  A  ( B  C ) ( A  B)  C  A  ( B  C ) A B  B  A A B  B  A A  ( B  C )  ( A  B)  ( A  C ) A  ( B  C )  ( A  B)  ( A  C )
A B  A B A B  A B A  A A U  A A U U A  A  A U A A
A A U   U A B A If A  B and C  D then ( A  C )  ( B  D ) If A  B and C  D then ( A  C )  ( B  D ) A A B A B  A If A  B then A  B  B If A  B then A  B  A A A A  ( B  A)   A  ( B  A)  A  B A  ( B  C )  ( A  B)  ( A  C ) A  ( B  C )  ( A  B)  ( A  C )

associativity commutativity distributivity DE MORGAN’s law

SET THEORY

29

Another important concept in set theory is to look at the subsets of a given set. This leads to the definition of the power set.
Definition 20 (Power Set). The set of all subsets of a set A is the power set of A , denoted as (A) .

If a set is finite, the power set is finite; if a set is infinite, the power set is infinite. The power set of a set with n elements has 2 n elements.
Example 31. The power set of A  {1,2,3} with three elements has 2 3  8 elements and is written
as ( A)  {, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}} . Note that the empty set and the set itself are always elements of the power set.

5.4 Applications in GIS
Overlay operations are among the most common functions that a GIS provides for spatial analysis. Since spatial features such as points, arcs and polygons can be regarded as sets, overlay operations correspond to set intersection, union, difference, and complement. Table 9 shows the basic ArcInfo overlay commands and the corresponding set operations in mathematical notation. Other ArcInfo functions such as CLIP, UPDATE, and IDENTITY are based on combinations of overlay and graphical clip operations.
Table 9. ArcInfo overlay commands

Command ERASE INTERSECT UNION

A in cover in cover in cover

B erase cover intersect cover union cover

Set Operation A B A B A B

Normally, it does not matter in which sequence we apply overlay operations of the same type. The associative and commutative laws for set operations allow the application of intersection and union in arbitrary order. The distributive laws can be used to simplify spatial overlay operations by reducing the number of operations. For example, if we have three data sets A, B and C. We need the intersection of A and B and the intersection of A and C, and finally, compute the union of the results. These operations amount to the following set operations ( A  B)  ( A  C ) . This would need three overlay operations. However, the distributive law of set operations allows us to reduce the number of operations to two as A  ( B  C ) . When we deal with polygon features in a GIS, we always have an embedding polygon that contains all features of our data set (or coverage). Often it is called world polygon. In set theoretic terms, this corresponds to the universe of discourse10.

10 In Chapter 9 we will se that also for topological reasons we need an embedding space for the cell complex of spatial features.

30

THE MATHEMATICS OF GIS

5.5 Exercises
Exercise 12 Highlight in the following VENN diagram A  B .

U
A B

Exercise 13 Highlight in the following VENN diagram A  ( B  C ) .

U
A C B

Exercise 14 Highlight in the following VENN diagram A  B .

U
A B

Exercise 15 Specify the power set for each of the following sets: (a) {a, b, c} (b) {{a, b}, {c}} (c) {} Exercise 16 Let U  {a, b, c, d , e, f , g} be the universe, A  {a, b, c, d , e} , B  {a, c, e, g} and C  {b, e, f , g} are sets. Compute the following: (i) B  C (ii) C  A (iii) B  C (iv) The power set of B  C .

CHAPTER

6

Relations and Functions

R
two sets.

elations are a very important concept in mathematics. Based on the fundamental principle of the Cartesian product we will introduce relations as the foundation of mappings and functions. Relations are These

based on a common understanding of relationships among objects.

relationships may refer to a comparison between objects of the same set, or they involve elements of different sets. Two special types of relations, the equivalence relation and the order relation, play an important role in mathematics. The first is used to classify objects; the latter one is the basis for the theory of ordered sets. In this chapter, we deal only with binary relations only. They are relations between

31

is the set of all pairs { a. i. This can easily be seen in the example above. Netherlands>. Then A  B  { 1. 4.  2. France>. denoted as A B .1 Cartesian Product Definition 21 (Cartesian Product). <Amsterdam. x  | 2  x  3  0  y  1} can be graphically represented as in Figure 4. The Cartesian product (or cross product) of two sets A and B . Netherlands>. France>}.  2. b} and C   . Then the cross products A  B  { x. <Vienna. We can also graphically represent the Cartesian product. 2. 3. b  | a  A  b  B} . a .2 Binary Relations Although relations are generally defined with more than two sets.  1. Consider the sets A = {Vienna. B  {a.. A  ( B  C )  ( A  B)  ( A  C ) A  ( B  C )  ( A  B)  ( A  C ) ( A  B)  C  ( A  C )  ( A  B) ( A  B)  C  ( A  C )  ( A  B) 6. . <Vienna. Let A  {1.e. b } (a) A C   (b) Example 33. a . The Cartesian product is not commutative. Table 10.2} . Austria>. <Amsterdam. A  B  B  A . Netherlands. France}. y  | 2  x  3  0  y  1} and B  A  { y. we restrict ourselves here to binary relations between two sets. Properties of the Cartesian product 1. <Amsterdam. Amsterdam} and B = {Austria. Assume we have two sets A  {x | 2  x  3} and B  { y | 0  y  1} . Austria>. b . 3 3 AB 2 1 2 1 BA 1 2 3 1 2 3 Figure 4.32 THE MATHEMATICS OF GIS 6. Non-commutativity of the Cartesian product Some properties of the Cartesian product are listed in Table 10. The Cartesian product A B is the set of six elements {<Vienna. Example 32.

a2 ) is true} . Frank} and B = {Mercedes. Consider the set A = {Vienna. If the relation is given. xRy .2 Graphic Representation of Binary Relations It is often convenient to represent relations graphically. c. we will use directed graphs (or digraphs11). The inverse relation (or inverse) R 1 is defined as the relation over B  A such that R 1  { b.  b. The following list defines these properties. b . the set of nodes (points or vertices) and the set of edges (arcs or lines). If the arcs are directed. we use the following digraph representation x y Example 36. Let A  {a. b  R} . B is the codomain. Netherlands>} is a relation over A B that can be read as “is capital of. Example 35.” Then R-1 = {<Mercedes. BMW} be two sets of persons and cars. France}. c } a relation on A . 6. BMW>. the predicate can be defined as P(a1 . R = {<John. Austria>. Let R be a relation over A B .2. Amsterdam} and the set B = {Austria.” 6. If there is a relation between the two elements x and y . <BMW. John>.3 Special Properties of Relations Some properties of binary relations are so important that they must be discussed in more detail. <Ann. and  a. a  |  a. we call it a relation on A . A binary relation R over A B is a subset of A B .2. Netherlands. if a predicate P is given we can define a relation R such that R  { a1 .  b. <BMW.e. Ann. b  R is written as a R b . We write  a. Let A = {John. a2  | P( a1 . Example 34.2. we call the graph a directed graph.RELATIONS AND FUNCTIONS 33 Definition 22 (Binary Relation). The set C = {<Vienna. <Amsterdam. d } be a set and R  { a. <Frank. and an incidence relation on V V that describes which nodes are connected by edges. i. The digraph is represented by the following diagram. BMW>} is a relation “drives a. a b c d 6. For this purpose. If the relation is defined over A A . c . A graph is defined by two sets V and E .” Definition 23 (Inverse Relation). Frank>} is the inverse relation that can be read as “is driven by. Mercedes>. The set A is called the domain of R .. Likewise. a2  R . 11 . b  R also as aRb . a2 ) is true if and only if  a1 . Ann>. b.1 Relations and Predicates Every binary relation R on a set A corresponds to a predicate with two variables and A as the universe of discourse.

R is antisymmetrix if xRy and yRx together imply x  y for every x.) (iv. but not irreflexive or antisymmetric.) (v. 6. but need not.34 THE MATHEMATICS OF GIS Definition 24 (Properties of Relations). symmetric. antisymmetric. or transitive. It is not irreflexive. (c) R3 is irreflexive and antisymmetric. (e) R5 is the universal relation on the set. These properties are reflected in certain characteristics of a digraph representation of relations. Loops may.) (ii. The graph of an irreflexive relation has no loop on any node. (b) R 2 is symmetric but not reflexive. An equivalence relation divides a set S into non-empty mutually disjoint sets or equivalence . symmetric and transitive. R is irreflexive if xRx for no x in A .3. but not on all.) (iii. Sample relations (a) R1 is reflexive. Let R be a binary relation on a set A. A relation can be neither reflexive nor irreflexive. symmetric and transitive relation is called equivalence relation. It is not reflexive. z in A . It is reflexive. antisymmetric and transitive. If in the graph of a transitive relation. 2 1 2 2 3 1 3 1 3 R1 R2 R3 2 2 1 1 R4 3 R5 3 Figure 5. and transitive. symmetric. then there must also be an arc from x to z. there is an arc from x to y and from y to z. y in A . 2.) R is reflexive if xRx for every x in A . R is symmetric if xRy implies yRx for every x. irreflexive. y in A. (d) R 4 is irreflexive. In this case. It is the equality relation on the set. 3} and the relations represented in Figure 5. R is transitive if xRy and yRz together imply xRz for every x.2. It is the empty relation on the set. it simply has loops on some nodes. Example 37. symmetric or transitive. y. occur in the graphs of symmetric and antisymmetric relations. For an antisymmetric relation the graph has either one arc or no arc between any two distinct nodes of the graph. but not reflexive. The digraph of a reflexive relation has a loop on every node of the graph. We say that (i. antisymmetric.1 Equivalence Relation A reflexive. The graph of a symmetric relation has either two or no arcs between any two distinct nodes of the graph. Consider the set of three elements {1.

because (i) for all sets we have A  A (reflexive). d .  b. d } . and R2 be a relation from B to C . x  R} where a is an element of S and R is an equivalence relation.  a. we define the composition of relations as follows.” Let A  {a. for RRR we write R 3 . b } to be two relations on Then R1 R 2  { a. If R is the relation “is father of”. a . because (i) for every line l we have l || l (reflexive). Example 39. Every element of one class is a representative of this class. R12  { a. The composition of relations is not commutative. c  | a  A  c  C  b[b  B   a. Example 40.  a. c . Let R be the relation || (parallel) on the set of all lines in the plane. (ii) if A  B and B  A then it follows A  B (antisymmetric).  b.  c. For RR we often write R 2 . 6. d } . (ii) for every two lines l1 . d } . c  R2 ]} .2. b . b  R1   b.. R 2  { a. An element y  [a ] is called a representative of the class [a ] .2 Order Relation A reflexive. R 2 R1  { c. Definition 25 (Composition of Relations). but associative. 6. This relation is an equivalence relation. Example 38. and (iii) if A  B and B  C then A  C (transitive).3. Formally.2. antisymmetric and transitive relation is called order relation. d . c . The subset relation between two sets is an order relation. l 2 we have that if l1 || l 2  l 2 || l1 (symmetric). Let R1 be a relation from A to B . S / R  {[a ] | a  R} . i. d } be a set and consider R1  { a.  b. d } and A . a . c.RELATIONS AND FUNCTIONS 35 classes [a ]  {x |  a. 3 2 The composition of relations can be illustrated with a digraph as displayed in Figure 6. c . The composite relation from A to C . A relation R on a set A can be composed with itself any number of times to form a new relation on the set A .  a. b . .4 Composition of Relations We can generate new relations by composing a sequence of relations. The set of all equivalence classes of S (written as S / R ) is called the quotient set of S under R .  a. b. and (iii) if l1 || l 2 and l 2 || l 3 then l1 || l 3 (transitivity). then RR is the relation “is paternal grandfather of. b . d } . The relation classifies the set of lines into the equivalence classes of parallel lines.  b.  c. and R  { b. written as R1 R2 is defined as R1 R2  { a.e. and so on. Order relations allow the comparison of elements of a set.

This function maps all natural numbers to the odd numbers. we can represent functions as digraphs. codomain and the value f (x) for every argument x . Example 41. three to five. To correctly specify a function we must indicate the domain.2} and B  {a. (d) is not a function because the argument 1 has more than one value assigned. there exists a unique b  B such that  a. R2 and R3 be a relation from B to C . and R4 be a relation from C to D . When the domain and codomain are finite. and a value must exist for all elements of the domain. In the following Figure 7 (a) and (b) are functions. Composition of relations Let R1 be a relation from A to B . written as f : A  B . We write f (a )  b and we call A the domain and B the codomain of f. A function (map. c} . Then the following statements are true: (i. Example 42. Definition 26 (Function). They are used throughout mathematics. Note that the important difference between a relation and a function is that for a function it is not possible that an argument has more than one value. One is mapped to one. b. Consider the function from the natural numbers to the natural numbers f :    where f ( x)  2 x  1 .) (iii. etc. (c) is not a function because not for every element of the domain we have a value. a is the argument and b the value of the function for the argument a . (c) and (d) are no functions. b  f .3 Functions Functions are a special kind of binary relations. .36 THE MATHEMATICS OF GIS A B C R1 R2 R1R2 Figure 6. two to three.) (ii. mapping or transformation) f from A to B. is a binary relation from A to B such that for every a  A . Consider the sets A  {1.) R1 ( R2  R3 )  R1 R2  R1 R3 R1 ( R2  R3 )  R1 R2  R1 R3 ( R 2  R3 ) R 4  R 2 R 4  R3 R 4 ( R 2  R3 ) R 4  R 2 R 4  R3 R 4 6.) (iv.

but it is associative. but not injective. we can generate new functions by composing a sequence of functions.2 Classes of Functions Certain characteristics of functions are so important that a special terminology has been developed for them.3.3.1 Composition of Functions In the same way as with relations. The composite function f ( g ( x))  2 x  1 and the composite function g ( f ( x))  2 x  2 . This function is surjective. Definition 29 (Injection). Example 43. or if a  a then f (a)  f (a) .1} defined with 0 for x is even f ( x)   . A function f from A to B is bijective (one-to-one and onto. or bijection) if it is surjective and injective. Let f :   {0.RELATIONS AND FUNCTIONS 37 a 1 b 2 c (a) (b) 2 1 a b c a 1 b 2 c (c) (d) 2 1 a b c Figure 7. Definition 27 (Composition of Functions). Example 44. 6. A function f from A to B is called injective (one-to-one or injection) if distinct arguments have distinct values. The composition of functions is not commutative. Note that a composite function is only defined when the codomain of the first function g is equal to the domain of the second function f. Definition 28 (Surjection). or f ( A)  B . A function f from A to B is called surjective (onto or surjection) if the image of the codomain is the image of the domain. 1 for x is odd . The composite function f  g is a function from A to C and ( f  g )( x)  f ( g ( x)) for all x in A.1} be a function from the integers to the set {0. Let g : A  B and f : B  C be two functions. Let g :    with g ( x)  2 x and f :    with f ( x)  x  1 . Functions and relations 6. Definition 30 (Bijection).

because there are lines (e. Consider the function f :    in the integers with f ( x)  2 x  1 . injective or bijective in terms of the graph of the function: Surjectivity: Every horizontal line intersects the graph of the function at least once. Injectivity: No horizontal line intersects the graph of the function more than once. Consider the function f :    in the integers with f ( x)  x  1 . 15 10 5 -10 -5 -5 -10 5 10 Example 48.38 THE MATHEMATICS OF GIS Example 45. Example 47. Consider the function f :    with f ( x)  2 x  10 . because there are lines that do not intersect the graph at all. Bijectivity: Every horizontal line intersects the graph of the function exactly once. This function is bijective. Consider the function f :    in the real numbers with f ( x)  x 3  2 x 2 . but not surjective. The function is not injective. It is not surjective. .g. Example 46. Therefore. we can interpret the properties of being surjective. In the case of functions from the real numbers to the real numbers. This function is injective. Every horizontal line intersects the graph of the function at least once. the function is injective. the function is surjective. Therefore. No horizontal line intersects the graph more than once.. y  0 ) that intersect the graph more than once.

4 2 -4 -2 -2 2 4 -4 Example 50. 25 The function is neither 20 15 10 5 -4 -2 2 4 . Consider the function f :    with f ( x)  x 2 . Every horizontal line intersects the graph of the function exactly once.RELATIONS AND FUNCTIONS 39 40 35 30 25 20 15 -4 -2 2 4 Example 49. surjective nor injective. the function is bijective. Consider the function f :    with f ( x)  x . Therefore.

then f  g is surjective. B. arcs and polygons.3 . If f  g is a composite function. 2 . If f  g is bijective. arcs. e. then (i. every arc has a relation with two polygons (the left polygon and the right polygon relation).3.) (iii.  j. Let f : A  B be a bijection from A to B . If f and g are injective. E} .5 . 6. arcs.1 . j} .  b. d .  e. If f  g is injective.  d . 2 .3 . 1 C a h 5 D 4 d j g A f c E 7 i e 6 B 3 2 b Figure 8. 6 .) (iii. we distinguish between the following relations among the elements of the set of nodes.  b. Figure 8 shows a two-dimensional data set and the topological relations between nodes. whereas the left polygon – right polygon relation can be written as . 4.) (ii.5 . arcs and polygons in a two-dimensional setting. 7 . then f  g is injective. 4 .  a. The best-known examples of relations in GIS are the spatial or topological relations between the building blocks of feature data sets.1 . Topological relations In this example we have the set of nodes. i. we can establish the following: (i. g .4 Applications in GIS Relations play an important role in GIS.  f . and polygons. then f is surjective and g is injective.  c. 6 . These building blocks correspond to nodes. c. and polygons defined as N  {1. then f  g is bijective. The start node – end node relation is defined as AN  { a.  h. 6 . If f and g are bijective. The converse of these statements is not true. Every arc has a relation with two nodes (the start node and the end node relation). h.) Definition 31 (Inverse Function).  g .40 THE MATHEMATICS OF GIS These special properties of functions also propagate through composite functions. If f  g is surjective.  i. The inverse function then is also a bijection. 4 .) (ii.  d . A  {a.5 . The converse relation of f is called the inverse function of f . and P  { A.) If f and g are surjective. written as f 1 .6} .  j.  e.3 . 2.  h. then g is injective. b. then f is surjective. However. D. f .  f . 2 .1 } .  c. C .  g . The inverse function is only defined when the function is a bijection. 4 . Formally.5.

C . for instance.  f . which means that there is more than one value for a given argument.  b. A } Other types of relations are those among spatial features in a data set.  ) northing = f 2 ( . A . D . C .  i.  i.  d . A . E . 0 .  g . respectively. D . The best-known examples are the eight relations between simple spatial regions that can be derived from topological invariants of boundary and interior (see chapter 9). Here. Spatial relations derived from topological invariants Functions appear in many different forms in GIS. map the pole to a line. D . as easting = f1 ( . 0 . where a point on the earth is mapped to a line or cannot be mapped at all.  b. Many map projections.  h.  ) Not every map projection is a function in the mathematical sense. These cases. C .RELATIONS AND FUNCTIONS 41 AP  { a.  f . a point on the surface of the earth whose location is given as latitude  and longitude  is mapped to a point on a plane by a set of two mapping rules for the easting and northing.  c.  e.  h. B . B . are called singularities. C . D .  g .  j.  j. the South Pole cannot be mapped at all.  e.  c. disjoint covered by meet contains equal inside covers overlap Figure 9. One typical application is map projections.  d . (a) Eckert IV (b) Azimuthal equal area Figure 10. In the second projection. A . B . Figure 10 shows two projections where the poles are mapped to a line (a) and to a point (b).  a. Figure 9 shows these relations. 0 . Map projections with singularities . B .

1 } h  { 2.3>.<5.3 .<2.4 } g  { 3.  c.4 .4 } g  { 3. b.4} and consider the following relations on W : R1  { 1.  4.1 } h  { 2.4. irreflexive. symmetric. c . (ii) Determine g  f and f  g .  a.  2.  1.  2. a .2 } R2  { 1.3 . Which one of the following relations is a function from X to X ? In case the relation is not a function explain why. Compute: (i) A  ( B  C ) (ii) ( A  B)  ( A  C ) (iii) A  ( B  C ) (iv) ( A  B)  ( A  C ) Exercise 18 Let W  {1.  4.42 THE MATHEMATICS OF GIS 6.  3.<3.2>. d . b} .1 .2 .1 .  3. Exercise 22 Let f :    be defined as f ( x)  x 2  3 x  2 .  1.4 . .  1. h Exercise 23 Let f and g be functions from X = {1.1 .  1.<2. Find R1 R 2 .3>.1 .<4.  2. b .1 . R12 . f  { 2. c.4} . f  { 2. antisymmetric.2.  4.2 .1>.4 .3. c .2.2.4} .2 .  3.4 } Exercise 21 Let R1 and R 2 be relations on a set A  {a.2 .3.  1.2 .<5.2>} g = {<1.  4.3 } Check these relations whether they are reflexive. Which one of the following relations is symmetric and which one is transitive? In case the relation is not symmetric or transitive explain why. and R2 . R 2 R1 .5>.  3.<4.4 .3.3.1 .3 .1>. Compute f ( x  h)  f ( x ) . B  {2.1 .  2.4 } Exercise 20 Let X  {1.  1.  b.4 .5} in X defined as: f = {<1. d } .4 .1 .3} and C  {3. or transitive.5 Exercises Exercise 17 Let A  {a.  4.  2.4} .  3.4>.  c.1 .  4.  b. d } and 3 R 2  { a.  2.1 } R3  { 1.1>.2.3>} Determine (i) the codomain of f and g.1 . Exercise 19 Let X  {1.1 .<3.3 . d } where R1  { a.  1.4 } R4  { 1.  2.  4.

it is necessary to apply transformations to these coordinates in order to shift. The sphere and the ellipsoid are geometric bodies used to approximate the shape of the earth. In this chapter. scale or warp the features. we will discuss frequently used coordinate systems and transformations applied to geometric features in a Euclidean space. Spatial features such as points. arcs and polygons as well as raster cells are spatially referenced through their coordinates. 43 .CHAPTER 7 Coordinate Systems and Transformations A ll points in space can be uniquely referenced by their coordinates. we distinguish between different coordinate systems such as Cartesian coordinate systems for Euclidean spaces or spherical coordinate systems for the surface of a sphere and elliptical coordinate systems for the surface of an ellipsoid. rotate. Depending on the type of space. Often.

The most common coordinate systems are rectangular or Cartesian coordinate systems and polar coordinate systems. Figure 11 illustrates these Cartesian coordinates. and two perpendicular lines through that point. we deal with a two. y . the axes. y. In this chapter. y   assigned. The horizontal axis is called x -axis. Cartesian coordinate system in 3-D space . On the other hand. z ) of Cartesian coordinates (Figure 12). z-axis P(x.1 Cartesian Coordinate Systems In the real plane  2 every point P has a unique pair of real numbers ( x. Every point P is uniquely defined by its Cartesian coordinates P ( x. z) z x y x-axis y-axis O Figure 12.or three-dimensional real space (also called the Euclidean space) where every point has real-valued coordinates. y-axis x P(x.1 Coordinate Systems A coordinate system functions to assign any point in space a pair or triple of real numbers. every pair of real numbers ( x.1. Every point P is then clearly defined by the triple ( x. its coordinates. the origin. y ) defines uniquely a point in the real plane. We define a single point O . Cartesian coordinate system in the plane We can easily extend the 2-dimensional coordinates in the plane to 3-dimensional coordinates in space by defining a Cartesian coordinate system in  3 . y ) with x.44 THE MATHEMATICS OF GIS 7. 7. the vertical one is the y -axis. y) y O x-axis Figure 11. y ) .

the origin or pole.1. ) r  O polar axis Figure 13. P(r. and the angle  between the radius and the polar axis (Figure 13).COORDINATE SYSTEMS AND TRANSFORMATIONS 45 7. ) r  O  y x Figure 14. Polar coordinate system in the plane In a three-dimensional polar coordinate system (or spherical coordinate system) a point P is defined by the radius r from the origin to the point and two angles: the angle  between the projection of OP onto the x. y -plane. Spherical coordinate system 7. Every point in the plane is then determined by its distance from the pole. They are defined in a polar coordinate system which is given by a fixed point O . Conversion between Cartesian and polar coordinates in the plane .3 Transformations between Cartesian and Polar Coordinate Systems The relationships between x and y and r and  are illustrated in Figure 15 and can be expressed by the following correspondences: y-axis x r  O x-axis P y Figure 15. the polar axis.2 Polar Coordinate Systems A different way of assigning a point in the plane unique coordinates is the use of polar coordinates. the radius r . z P(r. and the angle  between OP and the positive z -axis (Figure 14).1. and a line through the pole.  .

2 ] \ (2k  1) k    x 2   z-axis P r  O  y x-axis z x y-axis Figure 16. Conversion between Cartesian coordinates and spherical coordinates Example 52. coordinates as r  22  32  42  4  9  16  29  5. i. The conversion between three-dimensional Cartesian coordinates and spherical coordinates can be performed using the following formulas (see also Figure 16): x  r sin  cos  y  r sin  sin  z  r cos r  x2  y 2  z 2 y sin   2 x  y2 cos   cos  tan   z r x x  y2 2 x2  y2 with   [0.5 . The 3 point thus has the polar coordinates P(5.13) .385 4 3 cos   0. 4) we can compute its polar 4 coordinates as r  32  42  9  16  25  5 and tan    1.31 .743 and tan    1.    y with   [0.   53.e.46 THE MATHEMATICS OF GIS x  r cos  y  r sin  r  x2  y 2 tan   Example 51. compute its Given a point P(2. 5.3. From this we get   42.13 .03 and   56. 4) in the three-dimensional Euclidean space  3 we can spherical . 2 ] \ (2k  1) k    x 2   Given the Cartesian coordinates of the point P(3.53..  ] z   y  tan   with   [0.385 2 .3333 .

We can represent points in space by their respective point vectors. and the plane trough the point P and the origin. and we can apply many calculations related to the characteristics of geometric figures using vector representations. 7. which is used to identify locations on the surface of the earth (Figure 17).and y -axes.1. Example 53.4 we have defined the algebraic structure of a vector space.4 Geographic Coordinate System A special case of a spherical coordinate system is the geographic coordinate system. denoted as P ( . Austria.COORDINATE SYSTEMS AND TRANSFORMATIONS 47 7.1167. The longitude is the angle between the planes through the zero meridian and the origin. Every point P on the surface of the earth is uniquely defined by its latitude  and longitude  . The elements of a vector space are called vectors several axioms for operations among vectors and . z -plane with the earth is the zero meridian through Greenwich.2. The equator E lies in the plane defined by the x . every circle parallel to the equatorial plane is called a parallel. For practical calculations. The airport of Vienna.2 Vectors and Matrices Vectors and matrices play an important role in the analytical treatment of geometric figures. Longitudes are positive from 0 to 180 towards east and negative from 0 to 180 west.2. A latitude on the northern hemisphere ranges from 0 to 90. 7.370 kilometers.5667) . or VIE(48. The origin M of the geographic coordinate system is the center of the earth. Note that this is different from the way how the angle  is defined for spherical coordinates. Every circle through the poles is called a meridian. Geographic coordinate system The latitude is measured as the angle between the equatorial plane and the radius from the origin to the point towards north (positive latitude) or south (negative latitude). Nz G M   P() y E x S Figure 17. the radius R of the earth is assumed 6.1 Vectors In section 8.  ) .16. The circle G defined by the intersection of the x. and from 0 to -90 on the southern hemisphere. has a latitude of 4807 North and a longitude of 1634 East.

The sum of the two three-dimensional vectors (1. y. 12 . Here.  x  Every point P ( x. directed arrows of the same length in space. 2. A vector is a class of parallel. y.  3  6  3  6  9         Beside the addition of vectors and the multiplication of a vector with a scalar.6) is  1  4 1 4   5          2   5    2  5   7  . z ) in  3 can be represented by its point vector P   y  as shown in   z   12 2 Figure 18 .3) and (4. From section 8. For simplicity. we know three different vector products.2.  For the sake of a more compact vector notation we also write P  ( x.4 we know that we can define operations of addition and multiplication with a scalar for vectors:  ax    ax   ax   bx   ax  bx          and  a  b   a y    by    a y  by  a    ay    ay       a   a  a  b   a b   z  z  z  z  z z Example 54.and y coordinate components. z ) . y. and will simply call a representative a vector. Definition 32 (Vector).5. and the head of the arrow is called the terminal point.or three-dimensional real space.48 THE MATHEMATICS OF GIS vectors with scalars are defined. They all have also a geometric interpretation. A vector of length 1 is called a unit vector. The tail of a vector is called the initial point. Point vector  The length of a vector is defined as P  x 2  y 2  z 2 in 3  and P  x 2  y 2 in  2 . we will not make a difference between a vector and a representative. z-axis x   P  y    z    P(x. A single arrow is called a representative of the vector. z) O y z x y-axis x-axis Figure 18. In  the point vector components reduce to two for the x . we define vectors as a class of arrows in two.

commutative and distributive.1) is calculated 1  3  2 1  3 1 8 according to the formula as cos     0. where  is the angle between the two vectors. 2.645 .   The angle  between the two vectors a  (1. If a and b are two vectors the cross product is defined as  a   b   a b  a z by      x  x  y z  c  a  b   a y    by    az bx  axbz  a  b  a b a b  y x  z  z  x y The result of the cross product is a vector. It follows that 1 4  9  9 11 14  11   49. .86 .1. but not associative:     a b  b  a        ( a  b)  c  a  c  b  c The dot product is   The dot product can be used to compute the angle  between two vectors a and b according to the following formula:   a b cos     | a || b | Example 55. It is distributive.3) and b  (3. but not commutative:        ( a  b)  c  a  c  b  c     a  b  b  a The cross product can be geometrically interpreted as illustrated in Figure 19:     The product vector c is perpendicular to the vectors a and b . according to the following      formula c  a  b  a  b  sin  . b and c form a right-handed coordinate system. If a and b are two vectors the dot product (or Euclidean inner product) is defined as a  b     x  x a  b   a y    by   axbx  a y by  az bz a  b   z  z The result of the dot product is always a number (scalar).     a .COORDINATE SYSTEMS AND TRANSFORMATIONS 49   Definition 33 (Dot product).     The length of c is equal to the area of the parallelogram spanned by a and b .   Definition 34 (Cross product).

The angle between a and  0   0   1 1  0 1   1           2 1. 4. .0) is equal to  1   1   0  0  0  1  0             a  b   0    1    0 1  1  0    0  and the length of the vector is 1. and  c  (2.0) and b  (1. cross product and the scalar triple product. The volume of the parallelepiped with a  (2. 2) . b is 45 . Scalar triple product The following correspondences hold between the dot product. If a .0. then they form a parallelepiped when they are positioned with the common initial point (Figure 20). The result of the scalar triple product is a number equal to the volume of this parallelepiped and can also be computed according to the formula      (abc) | a  b |  | c |  cos     where  is the angle between the cross product vector of a  b and c . b  (0. 4) is computed by inserting into the formula given in Definition 35 as 2  [4  ( 4)  ( 2)  2]  ( 6)  [0  ( 4)  ( 2)  2]  2  [0  2  4  2]  2  ( 12)  ( 6)  4  2  ( 8)  24  24  16  8 ab  c b a Figure 20. 6.1. Cross product of two vectors   The cross product of the two vectors a  (1. Therefore we can compute the length of the cross product as 1 2  2    Definition 35 (Scalar triple product). 2). 2.   Example 57.50 THE MATHEMATICS OF GIS c  b a Example 56. b and c are three vectors the scalar triple product is defined as         (abc)  (a  b)  c  c  (a  b)  ax (by cz  bz c y )  a y (bx cz  bz cx )  az (bx c y  by cx ) If the three vectors do not lie in the same plane. Figure 19.

The multiplication of a matrix A with a scalar s is defined as  a11 a12  a a22 sA  s  21     a  m1 am 2  a1n   sa11    a2 n   sa21          amn   sam1   sa12 sa22  sam 2  sa1n    sa2 n       samn   The product of two matrices A and B is only defined if the number of columns of A is equal the number of rows of B . If the number of rows and columns does not match. A matrix is a rectangular array of real numbers. A matrix M is a rectangular array of numbers with m rows and n columns represented as:  m11  m M   21    m  m1 m12 m22  mm 2 m13 m23  mm 3  m1n    m2 n       mmn   We call M a m  n -matrix. the sum is not defined. We also know that the matrices form a vector space and that we can multiply matrices with matrices and matrices with vectors according to the following rules: Let A and B be two matrices. Their sum is defined as  a11   a21    a  m1 a12 a22  am 2  a1n   b11 b12    a2 n   b21 b22           b  amn   m1 bm 2  b1n   a11  b11    b2 n   a21  b21          a b  bmn   m1 m1 a12  b12 a22  b22  am 2  bm 2  a1n  b1n    a2 n  b2 n       amn  bmn   Note that the sum has the same number of rows and columns of the input matrices.2 Matrices Rectangular arrays of real numbers occur in many contexts in mathematics and as data structure in applications of computer science.2. Definition 36 (Matrix). The numbers in the array are called the entries in the matrix. and that both matrices must have the same number of rows and columns. Given a m  p -matrix A and a p  n -matrix B the product of C  AB of A and B is a m  n -matrix where every element cij of the product is calculated according to the following schema .COORDINATE SYSTEMS AND TRANSFORMATIONS 51          a  (b  c )  (a  c )b  (a  b )c             (a  b )  (c  d )  (a  c )(b  d )  (a  d )(b  c )       (a  b )2  a 2b 2  (a  b )2            (a  b )  (c  d )  c ( abd )  d (abc ) 7.

Another problem related to transformations is to determine the parameters of a transformation between two plane coordinate systems that compensates for scaling.3 Transformations When we rotate. rotation. They need not be the same. 7. y) O x Figure 21. 7. we will focus on plane coordinate systems and their transformations. we will discuss geometric transformations in the plane using Cartesian coordinates. the factor in the y direction is t y . y') tx ty P(x.1. We will discuss the HELMERT (or similarity) transformation and the affine transformation that both provide solutions to this problem. y P'(x'. Here.3. Translation .52 THE MATHEMATICS OF GIS  a11     ai1      am1  a1 p   b11       aip          amp   bp1  p  b1 j  b1n   c11                            bpj  b pn   cm1  c1n        cij       cmn  and cij  ai1b1 j  ai 2b2 j    aipbpj   aik bkj . b2 b3   ta1  ub1 ta2  ub2 ta3  ub3  The product of a2 b2 a3   is computed as b3  Example 59.1 Geometric Transformations In the following sections. k 1 Example 58.  3 4  7 8   3  5  4  7 3  6  4  8   43 50   5 6   7 8 is calculated as 7.3. The translation factor in x -direction is t x . 1 2 and   3 4  1 2  5 6   1  5  2  7 1  6  2  8   19 22      .  r s   a1    t u  b1  a1 r s The product of the two matrices   and   t u  b1 a2 a3   ra1  sb1 ra2  sb2 ra3  sb3   .1 Translation The shift of a geometric figure in horizontal and vertical direction results in a translation operation (Figure 21). skew and translation. shift or scale geometric figures we apply geometric transformations.

the coordinates of the new point P( x.  y   y  y  7. y ) .COORDINATE SYSTEMS AND TRANSFORMATIONS 53 Given the coordinates of a point P ( x.1.3 Scaling an angle  can be denoted as  x   cos       y   sin   sin   x    . we can write the translation of a point defined by its vector P     y   x         tx  with a translation vector t    resulting in a new point P     as P  P  t or  y   ty   x   x   t x         t  .1. y)  O x Figure 22. Rotation Given the coordinates of a point P ( x. y) are calculated according to the following formula: x  x  t x y  y  t y   x In matrix notation. y) are calculated according to the following formula: x  x cos   y sin  y  x sin   y cos    x In matrix notation the rotation of a point P    with  y     cos   sin   P  RP with the rotation matrix R    or  sin  cos   7.2 Rotation The rotation of a geometric figure in a two-dimensional coordinate system with the angle  is shown in Figure 22. the coordinates of the rotated point P( x.3. y ) . y P'(x'. cos   y  The scaling of a geometric figure can be described by the application of a multiplication factor (or scaling factor) to the coordinates in a given coordinate system (Figure 23). y') P(x.3. .

y ) . Finally. P3    and 1  0  0  1  0 P4    . y) are calculated according to the following formula: x  s x  x y  s y  y The factors s x and s y are the scale factors in the x .54 THE MATHEMATICS OF GIS y P'(x'. y') P(x. y) O x Figure 23. the coordinates of the scaled point P( x. one after the other.  s y cos    y   t y     0 1  1 Let S be a square defined with the points P    . respectively.3. y  y  y   7. The result can be  2  2  and the translation vector computed according to the transformation matrix T   1 1  2 2   2 2  . The general approach using the matrices defined in the previous sections is written as     P  SRP  t In the detailed notation this translates to  x   sx cos       s sin  y   y Example 60. a scaling with the factor 2 in x -direction and 1 in y 1 -direction. Scaling Given the coordinates of a point P ( x. They need not be the same. We apply a rotation of 45 degrees.  sx sin    x   t x   .   x In matrix notation the scaling of a point P    with scale factors s x and s y for x and  y     sx 0  y . we shift the figure three units to the right and two units up. scaling and translation to a point. or we can combine the transformation matrices to one matrix for rotation and scaling and add the translation vector. P2    .2 Combination of Transformations When we want to perform rotation. either we can apply the respective transformations in sequence. can be written as P  SP with the scaling matrix S    or  0 sy   x   s x 0   x      0 s   .and y -directions.

P3  2  2  and P4  2  1  .  cos   R   sin   0   sx  S  0 0  1  T  0 0   sin  The geometric cos  0 0 sy 0 0  0 1  0  0 1  rotation scaling 0 tx   1 ty  0 1  translation Note that now also the translation can be expressed through a translation matrix. t  y. 2  The following figure shows the original square in red and the  3 2   3 2   3  3         . we can determine r s its Cartesian coordinates as x  and y  . Every point with the Cartesian coordinates ( x.3 Homogeneous Coordinates An easier way to deal with geometric transformations is to use homogeneous coordinates. y. 1  0 .1) . t ) . This allows us to combine all three transformations in one single transformation matrix  sx cos   U   s y sin   0   s x sin  s y cos  tx   ty  .3. t t We assign to a point P ( x. y ) can be assigned the homogeneous coordinates (t  x. y ) its homogeneous coordinates ( x.COORDINATE SYSTEMS AND TRANSFORMATIONS 55   3  t    as P  TP  t .  2        2 2   3 2 1 1 2 3 4 7. t ) . Conversely. Definition 37 (Homogeneous Coordinates). given the homogeneous coordinates of a point (r . s. P2     transformed figure in green where P   1  2  1  . transformations can then be expressed by 3  3 -matrices.

However. scale factor or translation vector. It has the general form Ax  By  C Gx  Hy  1 Dx  Ey  F y  Gx  Hy  1 x  Example 62. and F . The most common transformations used are    similarity transformation affine transformation projective transformation The similarity transformation (also called HELMERT transformation) scales. It is also known as four-parameter transformation and has the general form x  Ax  By  C y   Bx  Ay  F A minimum of two control points is required to be able to compute the four parameters A . In principle. The coordinates of the control points are measured (digitized) on a digitizing . Given two control points P and P2 . compute the parameters of a HELMERT 1 transformation. or there are more distortions involved. rotate. B . we must determine the transformation parameters from known coordinates of points in both systems. scaling and translation can then be written simply as the multiplication of the transformation matrix with the point vector    P  UP or  x   sx cos      y    s y sin  1  0    Example 61. It does not independently scale the axes or introduce any skew. These points are called control points.56 THE MATHEMATICS OF GIS The general transformation of a point including rotation.3. It requires a minimum of three control points and has the general form x  Ax  By  C y  Dx  Ey  F Finally. In these cases. this relates to the geometric transformations discussed in the previous sections. and translates the data. and translate the data. we have to transform coordinates from one system into another coordinate system. The  2  2  x   2    2  y    2 2 1     0 0   s x sin  s y cos  0 t x  x    t y  y  1  1    transformation of the square in the previous example can now be written as 3  x    2 y   1  1   7.4 Transformation between Coordinate Systems In many applications. the projective transformation (or 8-parameter transformation) can compensate for greater distortions between the two coordinate systems and requires a minimum of four control points. skew. The affine transformation (or 6-parameter transformation) will differentially scale. C . often we do not know the rotation angle. rotates.

Figure 24 shows a sketch of a digitizing tablet with a map mounted on it. . C and F . 7. The map coordinates of the tics are given as P1 ( x1 . The origin of the tablet coordinates lies at Ot .4 Applications in GIS In GIS. Before we can start digitizing. the coordinates produced by the digitizing device – usually in millimeters or inches – to the world coordinates. we select a four. x1  x2  Ax1  By1  C Ax2  By2  C y1   Bx1  Ay1  F y2   Bx2  Ay2  F Normally. i. which is never the case when we use more than the required number of control points.. we need to shift. skew and scale them. rotate. The transformation converts these coordinates into map coordinates. The root mean square error (RMS) indicates the goodness of fit. The TRANSFORM command in Workstation Arc/INFO is one example of such a function. Every GIS software package should provide this functionality for manual digitizing or general coordinate transformation.e. Usually. The map coordinate system is indicated with Ok and the axes xk and yk . the RMS should be as small as possible to achieve a reliable set of parameters for the transformation. for instance as grid intersection points or corner points of the map sheet whose coordinates can be read from the map. The map usually is not aligned with the coordinate system of the tablet.e. This is done by choosing a proper transformation and by computing its parameters. On the map we have identified four ticks (or control points) designated with  . we have to set up a transformation from the device coordinates.or six-parameter transformation. y2 ) . the best fit would result in a RMS of zero. we can compute the transformation parameters and subsequently apply the transformation to every point measured on the map. B . i. Another important application lies in the transformation of coordinates of datasets as it occurs. y1 ) and 1 P2 ( x2 . we apply geometric transformations in many different ways. we need to establish a relationship between the tablet coordinate and the map coordinate system. y2 ) . The map coordinates of these ticks are either known or can be determined easily.COORDINATE SYSTEMS AND TRANSFORMATIONS 57 device as P (x1.. One use of transformations is in the graphic editing functions of every GIS. With the given coordinates of the ticks (in the map coordinate system) and their measured coordinates (in the tablet coordinate system). for instance. we use more than the required minimum number of control points. We can now compute the parameters of the HELMERT transformation by solving the following system of linear equations for A. Here. Ideally. y1) and P2 ( x2 . in manual digitizing. the coordinates of the map projection. However. We then need to solve the resulting system of equations with a least squares approach. When we edit spatial features.

2) . b  (1. 2) . Compute (a .   16. b . b  (1. Manual digitizing setup 7. 4) . and translated 2 units to the right and 3 units down. 1.3) and c  (2.and y -direction. 2. 0) . (b) a  (b  c ) . B(3. Exercise 30 Use a map sheet of your choice and perform the procedure for setting up the transformation parameters in manual digitizing using four control points and a six-parameter transformation.    Exercise 27 What is wrong with the expression a  b  c ?       Exercise 28 Let a  (1.0) and C (2. scaled with a factor of 1. 4) .1) compute the coordinates of the resulting figure when the triangle is rotated by 60 .3. (c) k  (a  b ) .3) and c  (2. Exercise 25 Explain why each of the following expressions makes no sense when the operation “  ” denotes the         dot product of vectors: (a) a  (b  c ) . Compute (a) b  c .5 in both x . (b) ( a  b )  2c .12 .58 THE MATHEMATICS OF GIS yt yk xk Ok Ot xt Figure 24.3. Exercise 29 Given the triangle  ABC with the coordinates A(1.5 Exercises Exercise 24 Given the geographic coordinates of Vienna airport as   48.         Exercise 26 Let a  (1. 1.57 and the radius of the Earth as R  6370 km . c ) . and (c)     ( a  b )  (b  c ) . compute the Cartesian coordinates of the airport when the origin of the Cartesian coordinate system is located at the center of the earth and the axes directions are as illustrated in Figure 17. 2. .

and order structures. 59 . we call it a structure preserving mapping or homomorphism. In this chapter we will describe algebraic structures (or algebras) that are characterized by a set on which operations are defined for the elements of These operations are needed when we want to “compute” or “calculate” with the elements of a set. topological structures. there are three main structures in mathematics: algebras. As we have seen before. Often we need to identify mappings from one algebra to another.CHAPTER 8 Algebraic Structures M this set. athematical structures are used to describe real world processes or phenomena. If the structure is preserved under such a mapping.

Two algebras have the same signature (or are of the same species) if their n -tuples include the same number of operations and constants and the arities of corresponding operations are the same. operations. because the number of constants is not the same..  .1. Example 63.  (integers). The algebras   . In order to be able to distinguish different classes of algebras that “behave” in the same way.  . Binary operations are mappings from S 2  S and operate on two elements of the carrier. . i. the carrier of the algebra. . . A set of axioms for the elements of the carrier. The real numbers  with the binary operations () (addition) and multiplication () . Operations are defined as a mapping  : S m  S where the m is called the “arity” of the operation. 0  and  ( S ).1 Components of an Algebra Definition 38 (Algebra). the constants of the algebra The carrier S of an algebra is a set of elements on which operations are defined. 0  and   . The constants of an algebra are distinguished elements of the carrier set with properties of special importance. Definition 39 (Signature of an algebra).   have the same signature because they posses two binary operations ( and ) and ( and ) and two constants (1 and 0) and ( S and ) . Definition 40 (Variety). 8. respectively. we need certain rules that are valid for the elements of the carrier. specifies a class of algebras called variety. Such “rules” are called axioms and are written as equations of elements of the carrier. and Distinguished elements of the carrier.1  . constants>. together with a signature.1 Signature and Variety Often we look at a class of algebras such that every member of the class has the same characteristics.. As an example of a unary operation consider the operation “–” that assigns the negative value to an element. the unary operation () and the constants 0 and 1 are an algebra that is represented as the 6tuple   . or  (real numbers). Algebras that have the same signature need not be related at all. The second algebra does not possess any constants. Examples of carriers are number sets such as  (natural numbers). Whenever we specify an algebra we need to describe the following components:    A set S . Example 64. Example 65. Operations from S 1  S  S are called unary operations.. it takes the number x to  x .  . Examples of a binary operation are addition x  y and multiplication x  y of elements.1. Algebras are denoted as n -tuples <carrier. 0. The algebras   .e. Operations defined on the elements of the carrier. .60 THE MATHEMATICS OF GIS 8. S .   are not of the same species.

then x is called (two-sided) inverse of y with respect to the operation . Example 67. respectively. i. all algebras of the same variety obey the same axioms. In spatial analysis map algebra. 0  has an identity 0 and every element x   has an inverse with respect to the addition. we will discuss some of the more important varieties of algebras. If x  y  y  x  1 for every y in S . k  . Example 68.  a unary operation. An element 1  S is an identity (or unit) for the operation  if x  S . 0  with the multiplication as operation has an identity 1 and a The algebra   . and k a constant. . An element 0  S is a zero for the operation  if x  S .1. Any theorem proven for this variety will hold for all algebras that belong to this variety. The algebra   .  . Example 69. operations on (usually raster) data sets. zero 0. where the binary operations are denoted as “+”.2 Identity and Zero Elements Constants possess special properties relative to one or more operations in an algebra. Then   .  denotes a binary operation. Although the carrier set. we will discuss a few algebras of importance. we will use the following notation A  S . Let  be a binary operation on S . “  ”. and the constants are “0”. The inverse of x is written as  x and x  ( x)  0 . “ S ”.  . For the remainder of this chapter. The algebra  .. Definition 41 (Identity and Zero Element). and 1 an identity for this operation. and “  ”.  ( S ). where S is the carrier. 1  x  x  1  x . whenever we deal with an arbitrary algebra A . and (iii) x  0  0  x  x .1  are all members of this variety. Let  be a binary operation on S . operations and constants may be different. In this section.ALGEBRAIC STRUCTURES 61 Algebras that belong to the same variety behave in exactly the same way. and   . The following definition describes the most important properties of constants for binary operations..   .e. Example 66. 0  . If identities exist. . “  ”.1.  . “  ”. 8. x x 8..2 Varieties of Algebras Algebras play an important role in many applications of computer science such as formal languages and automata theory as well as in coding theory and switching theory. .1  has an identity 1 and all elements x of the real numbers 1 1 except 0 have an inverse x 1  such that x   1 . In the following sections. Example 70. 0  x  x  0  0 .  (S ). S  . If no confusion can result we may not specify the operation and speak of an identity (or identity element) and a zero (or zero element). Consider the variety of algebras with the same signature   . 0  and the following axioms: (i) x  y  y  x . . and “1”. 0  has an identity 0 but no zero element.  . (ii) ( x  y )  z  x  ( y  z ) .. is very common. we can define the inverse with respect to an operation.. The algebra   .

2. 8.  the usual addition. Definition 43 (Field). Definition 42 (Group). then we call the group a commutative group (or Abelian group). One basic structure is a group that formalizes the arithmetic of one binary operation (usually addition or multiplication for number sets). 4. a  a  1 If the operation  is also commutative.. respectively.  is the usual multiplication.1  with one binary (  ) and one unary (  ) operation. 2. and 0 the identity for the addition.  . and the following axioms: 1. . 2.1  is a commutative group where  are the real numbers. 3. A group is an algebra with the signature  S . Example 71.2 Field Fields are very general algebras that formally describe the interrelation of two binary operations on a carrier set. 1 the inverse with regard to the multiplication.1 Group Many algebraic structures are the basis of arithmetic.62 THE MATHEMATICS OF GIS 8. a  (b  c)  ( a  b)  c a 1  1  a  a a  a 1  1 ab  ba Example 73..0  is a commutative group a  (b  c)  (a  b)  c a  (b  c)  a  b  a  c ( a  b)  c  a  c  b  c . The natural numbers  with addition and multiplication are not a group because there is no inverse with regard to addition and multiplication. Simply speaking. A field is an algebra with the signature  S .  . and 1 the identity for the multiplication. a  (b  c)  (a  b)  c a0  0a  a a  (a)  0 ab ba Example 72. and the following axioms: 1. – the inverse (negative number) with regard to the addition. The algebra    {0}. rational and real numbers).. 3. 0  is a commutative group where  are the integers.0.  . 2.2.  S .  . The axioms can be easily verified as: 1. .1 . 3. a field guarantees all arithmetic operations (as we know them for instance from the usual number sets) without restrictions (except division by zero). as we usually know it for numbers (integers..1  where  and 1 are the inverse operations for  and  . a  1  1  a  a 3. where  is the inverse with respect to  . 4. The algebra   . 4. The axioms are verified as follows: 1. 1 . a  (b  c)  (a  b)  c 2.

3 Boolean Algebra Definition 44 (Boolean Algebra).1  are a field with addition and multiplication as binary operations. .4 Vector Space Some algebraic structures are defined on more than one set.. The numbers 0 and 1 function as identity elements for  and  . 8. X Y  Y  X X Y  Y  X ( X  Y )  Z  X  (Y  Z ) ( X  Y )  Z  X  (Y  Z ) X  (Y  Z )  ( X  Y )  ( X  Z ) X  (Y  Z )  ( X  Y )  ( X  Z ) X   X X A X XX A X X  8. A  . 10. 5. Vector spaces are one example.1 . 7. a  (b  c)  (a  b)  c (associative law of multiplication) 3.0... 9.  S  {0}. and the inverse unary operations for addition and multiplication. 4. Y and Z be arbitrary subsets of A (i. 0.  . See Example 72 8. The axioms are verified as 1. Let X . a  (b  c)  a  b  a  c (distributive law) 4. 7. 8. 10. 6.  . 4.e. 2..ALGEBRAIC STRUCTURES 63 5. elements of the power set of A ) then the axioms can easily be verified as 1. 6. .. 2. (a  b)  c  a  c  b  c (distributive law) 5. . with the axioms: 1. 3. abba abba (a  b)  c  a  (b  c) (a  b)  c  a  (b  c) a  (b  c)  a  b  a  c a  (b  c)  ( a  b)  ( a  c) a0a a 1 a a  a 1 aa 0 The power set ( A) of a given set A with the usual set operations of union. A Boolean algebra has a signature  S . Example 75. intersection and complement relative to A is a Boolean algebra  ( A). 5. 3. ..1  is a commutative group Example 74. and  is a unary operation (the complementation).1  where  and  are binary operations. respectively. 1 .2. See Example 71 2.2. The real numbers   . 9. .

1 . a sub-discipline of algebra. k  and A  S ..0  be a commutative group and  S . Definition 46 (Homomorphism and Isomorphism). 4.  . and A  is an isomorphic image of A under the map h . Let  V . and let h be a function such that 1. if for all a. Two algebras that are isomorphic are essentially the same algebra with different names.1  a field.   (a  b)    a    b 2. 2. 8. (   )  a    (   a) 4.3 Homomorphism Often we need to compare algebras to find out whether they are similar.e.  .. The set of all vectors with  as the vector addition is a vector space over the real numbers where  is the multiplication of a vector with a scalar.64 THE MATHEMATICS OF GIS Definition 45 (Vector Space). k   be algebras with the same signature. 1  a  a The elements of V are called vectors. . The set of all matrices with the matrix addition is a vector space over the real numbers with  being the multiplication of a matrix with a scalar.  S 1..  and   unary operations. the elements of S are called scalars. then the same theorems (in a related way) also hold for the new algebra. If we can show that a different algebra is related to the given algebra (usually we want to show that they are essentially the same in terms of their behavior). A formal way of investigating related algebras is to establish a structure-preserving mapping from the (given) algebra to the new algebra. i. V is called a vector space over S . Example 77. In the definition above  and   represent binary operations. Example 76. Often we know an algebra very well.. Vector spaces play an important role in the mathematical discipline of linear algebra. h: S  S h(a  b)  h( a )   h(b) h((a))   (h(a)) h( k )  k  Then h is called a homomorphism from A to A  . and k and k  are constants. 3. we have established theorems for this algebra.  . b V and . (   )  a    a    a 3. A homomorphic image of an algebra is a “smaller” or “generalized” version of the given algebra. Such a mapping is called a homomorphism. If the function h is bijective then we call it an isomorphism from A to A  .. Let A  S .0. .. If two algebras are similar they show the same “behavior” in terms of their operations and they have corresponding constants.

 ..1} defin as h(T )   ned is a homom morphism from A to B . on. Fur rthermore.e. data sets that are often re d t eferred to by cove erage. where w map a su we ubset of the r real world to a represen o ntation in a s spatial featur model.4 Ap pplications in GIS Perhaps the most p s prominent ap pplication of algebras in GIS is the map algeb f n e bra. e  Let S be a non-empty n set and tw wo A  ( S ). shapef file. grid or la ayer. l is . An exam mple of a co onstant of th map algeb would be the zero gr where ev he bra e rid. 8. For any a  S and T (S ) the function y e 0 if a  T h :( S )  {0. Note that m 1 if a  T h()  0 and h( S )  1 .  . Th given isomo he orphism is the math hematical basis for the slid rule that re de eplaces multip plication of n numbers by addition of their logarithms. Let   be the set of all positive real numbers Then    . S  and B  {0. The function h is   . aspect or hi . i. therefore h is inje e ective. 0  and the fu og surjectiv because f x  0 the equation lo a x  y alw ve. .. The carrier s of the ma algebra is the set of “m set ap maps”. Example 79.0. Raster calculator int ure terface The con ncept of stru ucture-preser rving mapping finds an application in spatial m modeling. very grid cell carr the valu zero. illshade. re We will return to thi subject in chapter 13.ALGEBRAIC STRUCTURES C 65 Example 78..1}. Th range fro simple a ng hey om arithmetic operatio of additio subtractio multiplic ons on. . The s logarithm mic function is monoto n one increasin ng. see arithmetic an logical ope nd erators as well as functions tha can be app at plied to map layers.. morphic to unction h :     with h( x)  log x is an isomorphi s ism. . Figu 25 show the expand user inte ries ue ure ws ded erface of the ArcMap e Spatial Analyst raste calculator Here.. we s various a A er r. cation or division to more complex operations of calcu ulating slope. We kno many ope ow erations for manipulatin maps.1  be two Boo olean algebra as. h(a  b)  log(a  b)  log(a )  log(b)  h(a )  h(b) and h(1)  log(1)  0 .1  is isom e o e s. Figu 25. for ways has a solution x  a y .

the constant 0 and the operations (  ) and (-) defined in the usual way (addition and negative number.. the  0 1 constant 0 and two operations defined as 0 0 1 1 1 and ( x)  x . . and the constant 0.1} . F ..5 Exercises Exercise 31 Given are two algebras:   .  . addition (  ) and negative number (-).66 THE MATHEMATICS OF GIS 8. . Exercise 32 Let {T . defined as f ( x)  2 x . 0  with the integers as carrier set. f :   B ... “or” (  ). defined as f ( x)   1 x is odd isomorphism? Why is f not an . is a homomorphism. . and the unary operation “not” (  ) being logical operators. respectively. Exercise 33 Given are two algebras:   .  . 0 Show that the function 0 x is even . two operations. and the constant 0. T  is a Boolean algebra with the binary operations “and” (  ).0  with the carrier set B  {0. Show that  {T .0  with the even numbers as carrier set. Show that both algebras are Abelian groups and that the function f :   E . . two operations.  E. and  B . is an isomorphism. respectively). 0  with the integers as carrier set. addition (  ) and negative number (-). . F } be a set where T stands for “true” and F stands for “false”. The constants F and T are propositions that are always false ( F ) and always true ( T ). F }.

It deals with the structural representation of spatial features and their properties that remain invariant under certain transformations. 67 . we introduce the mathematical concept of a topological space based on the topology that is induced on the real plane by a distance function. We also show how simple structures can be used to build complex objects in GIS databases. In this chapter. and how to check the consistency of a two-dimensional topologic representation of spatial features.CHAPTER 9 Topology T opology is a central concept in every GIS.

q)  (a1  b1 )2  (a2  b2 )2 between two points p  (a1 . In a metric space ( X . In order to define a neighborhood we need the concept of a distance. We can easily extend this space to three dimensions. Example 80.  )  { y | y  X  d ( x. We call this space the 2-dimensional Euclidean space. In the Euclidean plane  2 an open disk with radius  around a point p is an  neighborhood (Figure 26). The Euclidean distance is the shortest distance between two points. a set and a collection of subsets of this set that satisfy certain conditions. The second approach starts from a family of subsets of a given set (which are called open sets) and defines a topology through properties of these open sets. y )  0 if and only if x  y d ( x.1. this can be achieved with a metric space. z ) (triangle inequality) We call the pair ( X . y )  d ( y. b2 ) . d ) . i. For our purpose. Example 81. Definition 48 (  -neighborhood). In every metric space.1 Metric Spaces and Neighborhoods The first approach is more intuitive than the second one that is usually used in general topology (or point-set topology). The real numbers  with the distance function d ( x. Generally. The first one starts with the concept of a neighborhood of a point and defines a topological space as a system of neighborhoods that fulfill certain conditions. a2 ) and q  (b1 .  ) | x  X    0} is called the neighborhood system of x induced by the metric d . When no confusion is possible we call N ( x. z  X 0 (i) (ii) (iii) d ( x. The concept of open sets follows from the definition of a neighborhood. (  2 . 9. d E ) is a metric space. This is the usual space of plane geometry. y. In short we will write N ( x) .68 THE MATHEMATICS OF GIS 9.e. d ) a metric space and d a distance function (or metric) on X . we chose the intuitive approach on the Euclidean plane with a system of neighborhoods. The concept of a neighborhood follows from the definition of a topological space. for each x  X and each   0 . Let X be a nonempty set and d a function X  X    such that for every x. we will deal with topological spaces.. . y )   } . y )  x  y are a metric space. Let us consider the real plane  2 equipped with the Euclidean distance d E ( p. Definition 47 (Metric Space). There are two equivalent approaches to define a topological space. we can define a neighborhood for points of this space. y )  d ( y . x ) d ( x.  ) neighborhood and write N ( x) . we define an (open)  -neighborhood of x as the set N ( x.1 Topological Spaces In this chapter. The set Nd ( x)  {N ( x. z )  d ( x.

Let X be a topological space. a2 ) Figure 26. Definition 51 (Closed set). (N3) Every superset U of a neighborhood N of x is a neighborhood of x . Definition 49 (Topological space). N ( x)) a topological space. Let X be a topological space.1. (N2) The intersection of two neighborhoods of x is itself a neighborhood. A set C is closed if its complement X  C is open. The open intervals (a.2 Topology and Open Sets When we require a neighborhood system to satisfy certain conditions. X is a neighborhood of x . Open disk in  2 9. we arrive at the definition of a topological space. With the help of the concept of a neighborhood. b) in the real numbers and the open disks in  2 are open sets. Let X be a set and for every x  X there exists a neighborhood system N ( x) ( X ) that satisfies the following conditions (neighborhood axioms): (N1) The point x lies in each of its neighborhoods. Figure 27 illustrates the four neighborhood axioms. Example 82. We then call the set with its neighborhood system ( X . (N4) Every neighborhood N of x contains a neighborhood V of x such that N is a neighborhood of every point of V . A subset O of X is an open set if it is a neighborhood for each of its points. .TOPOLOGY 69 D  p  (a1 . we can now define open sets. Sometimes we denote a topological space simply by X . Definition 50 (Open set).

The union of any number of open sets is open. The intersection of an arbitrary number of open sets does not need to be open.. Here. Our approach to the definition of a topological space is based on the concept of the  neighborhood defined in a metric space. It can be proven that the intersection of an arbitrary number of closed sets.. The following statements can be proven to be true for open sets. The closed interval [a. it can also be a closed set. are closed. or they can be both open and closed (sometimes called clopen sets). a concept which is too special for general topological spaces. Example 84. Every closed disk around p is a neighborhood of p . we also see that a neighborhood does not need to be an open set. because its complement ( . As an example consider a point p of the Euclidean plane  2 . ) is the union of two open sets. n n Obviously.70 THE MATHEMATICS OF GIS N1 x x N2 (i) (ii) x N U x V N (iv) (iii) Figure 27. For this definition we needed the distance. which again is an open set. The intersection of any finite number of open sets is open. Take for example the intersection of an infinite collection of open intervals 1 1 ( . b] in the real numbers is neither open nor closed. A subset U of X is a neighborhood of x  X if and only if there exists an open set O with x  O  U . which is an open set. a)  (b. The half-open interval (a.3.. (O1) (O2) (O3) (O4) The empty set  and the set X are open. b] in the real numbers is a closed set.  ) for n  1. Sets can be neither open nor closed. because it contains the open disk around p . and the union of a finite number of closed sets. the intersection is the set {0} which is not an open set. Neighborhood axioms Example 83. The previous example shows that “closed” does not mean “not open”. Statement (O4) above gives us a way to define neighborhoods without the notion of distance. 2. .

It is a homeomorphism. we call it a continuous function. Let f : X  Y be a function from the topological space X to the topological space Y . A function that maps the neighborhood of a point to the neighborhood of the image of this point is called a continuous function. They map one topological space to another topological space thereby preserving the topology. This means that the open interval (-1.1) and the real numbers are homeomorphic. continuous and has a continuous inverse. For the real numbers  . also for topological spaces we know structurepreserving mappings. Like in other mathematical structures. Figure 29 2 shows the graph of the function.. bijective. Figure 28 illustrates both concepts of continuity at a point and continuous function. and possesses a continuous inverse.3 Continuous Functions and Homeomorphisms We can define mappings between topological spaces. we call it a homoeomorphism (or topological mapping). If f is continuous at every point of X .e. We can define it formally as follows. If this function is continuous. the definition of continuity usually reduces to the following statement: A function f :    is continuous at point x0 if for every   0 there exists a   0 such that | x  x0 |  implies | f ( x)  f ( x0 ) |  . Let h : X  Y be a function from the topological space X to the topological space Y . Let X  (1. If two spaces are homeomorphic they are essentially the same and expose the same topological behavior. Definition 53 (Homeomorphism). Continuity of a function essentially means that the graph of the function has no “jumps” or “gaps”. X Y f U V f (U ) x0 f (x 0 ) Figure 28.1) be an open interval in  and f : X   a function defined as x . This function is bijective. i. f ( x )  tan  . A function is continuous if it is continuous at every point. Definition 52 (Continuous function).1. f (U ) . Continuous function The definition above is valid for any two topological spaces.TOPOLOGY 71 9. Example 85. We call f continuous at point x0  X if for every neighborhood V of f ( x0 ) there is a neighborhood U of x0 such that the image of U . is a subset of V .

The two previous examples show that length and area are not topological invariants.72 THE MATHEMATICS OF GIS 75 50 25 -1 -0.1.1) is different from the “length” of the real line. a different. The open disk D1  {(r .4 Alternate Definition of a Topological Space As mentioned earlier. ( X . ))  (2r . and in the second example both disks are homeomorphic but their areas are not the same. the intersection of a finite number of open . Further.5 -25 0. O) a topological space and the elements x  X the points of the topological space. The three conditions for a topology require that the empty set and the set itself must always be a member of the topology. i.. Mathematical topology is mainly focused on properties of topological spaces that remain invariant under topological mappings. Definition 54 (Topological Space). 9. O ( X ) .5 1 -50 -75 Figure 29. B  O  A  B  O (O3) Ai  O  iI  A O i We call the Oi open sets. because the length of the interval (-1. yet equivalent. ) . Let X be a set and O a collection of subsets of X . ) | r  2} with radius 2 through the function f ((r . Example of a homeomorphic function Example 86.e. ) | r  1} given with its polar coordinates ( r . X  O (O2) A. definition of a topological space starts with the idea of an open set. We call O a topology on X when the subsets satisfy the following three conditions: (O1)   O. ) and radius 1 is homeomorphic to the open disk D2  {(r . defines a topology as properties of a collection of open sets and derives the definition of a neighborhood from the open sets. We take the properties O1 to O3 of open sets as axioms and define a topological space as follows. A property of a topological space that is preserved by a homeomorphism is called a topological property or a topological invariant.

We can easily verify that the three conditions are satisfied for both topologies. . All open intervals ( a. and the properties O1 to O4 follow as theorems. We call it the natural topology. With the help of the open sets used in the definition of a topology we can now define a neighborhood. and the union of an arbitrary number of open sets is an open set. The second one is called discrete topology. The first one consists only of two elements { X . With this definition. and the set theoretic abstract approach based on the concept of open sets. It is the coarsest of all topologies. which is the finest of all topologies. because it consists only of two elements. N is a neighborhood of the point x if N  X and there exists an open set A  O such that x  A  N . Both approaches to the definition of a topological space as mentioned above are equally valid and lead to the same results. Topological space based on concept of neighborhood (N1 to N4): Axioms Topological space Based on concept of open set (O1 to O3): ( X . b) on the real line 1 are open sets. We call a subset A of  1 an open set if it is either empty or with each of its points x  A contains an open interval S x that completely lies within A . The first topology is called indiscrete topology. Definition 55.. Two extreme topologies can be found on any set X . balls. Example 88. (Neighborhood).e. } . i. This can be extended to the  n with open disks. etc. {N (x )| x  X }) Definition of open set (X .TOPOLOGY 73 sets always is an open set. we can show that these open sets are a topology on 1 . Consider the real line  1 . open sets and neighborhoods and related theorems The first one defines a topological space through properties of neighborhoods. The real line itself is an open set. we can prove the statements N1 to N4 of Definition 49 about neighborhoods to be true. Open sets are then defined through neighborhoods. Again.O ) Definition of neighborhood (O4) Properties of open sets: O1 to O4 Theorems Properties of neighborhoods: N1 to N4 More theorems Figure 30. Example 87. Figure 30 summarizes both approaches: the intuitive approach based on the concept of a neighborhood. the power set ( X ) . the second one consists of all subsets of X . Equivalent approaches to the definition of a topological space.

The countably infinite set of  -neighborhoods of x defined as {N ( x. 9. Let x be a point of a metric space. 2 3 The relationship between a base of a topology and a local base at a point can be expressed in the following statement: Let B be the base for a topology and x  X a point of the topological space. Whereas a base for a topology is a global characteristic of a topological space. A collection B of neighborhoods of a point x of a topological space X is a local base at x if every neighborhood of x contains some member of B . The open disks in the Euclidean plane  2 with radii and center coordinates being rational numbers are a base for the natural topology of the plane. This follows easily from the definition of a neighborhood. More theorems about topological spaces follow from there. Exterior). 1 ). The system of open disks B with center x is a local base at x . Example 92. If in a topological space every open set can be generated as the union of some open sets. The number of the basic open sets is uncountable infinite. Boundary. Example 91. Example 89. Closure. An equivalent definition for a base requires that for every point x  X that belongs to an open set O there is always an element B  B such that x  B  O .} is a local base at x . we call these sets a base of the topology. Then B is called a base for the topology and the elements of B are called basic open sets. Consider the natural topology in the Euclidean plane  2 and a point x . Note that the number of the basic open sets is countably infinite. closure and boundary as follows: . This is true because for every open set O that x contains x there is an open disk with center at x that is contained in O . Interior. Closure. Then the members of B that contain x form a local base at x . This is a local characteristic of a topological space determined only by the neighborhood of the point. Definition 57 (Local base). Definition 56 (Base). we can also define a local base at a point of a topological space.74 THE MATHEMATICS OF GIS The second approach defines a topological space through properties of open sets.1). Definition 58 (Interior. Boundary. and derives N1 to N4 as theorems about neighborhoods. 1 ). For further investigations. closure. Example 90. Given a subset A of a topological space X we define the interior. and Exterior From the definition of a topological space we know that the union of open sets is an open set. boundary and exterior of a set. The open disks in the Euclidean plane  2 are a base for the natural topology of the plane. Let X be a topological space and a collection B of open sets such that every open set of the topology is the union of members of B . It then defines neighborhoods through property O4 of open sets.2 Base. we need the concepts of interior. N ( x. N ( x.

The exterior of A is the interior of the complement of A . Consider the set X  {a. the smallest one that contains A is {b. ( A )  A A  B  A  B Closure A A. and boundary. because the only open sets contained in A are {c. closure. i. however. d . closure and exterior of the set. e} . e}  {c. b. of all open sets contained in A is called the interior of A (written as A ). Figure 31 illustrates the interior. d }  {b. e} . 15 The closed sets are the complements of the open sets. 13 Note that we use for closure the same symbol as for the set complement.e. e} . e} . The boundary14 is written as A . A  A  A  {b. . d . The boundary of A is the difference of the closure with the interior. because among the closed sets 15 of X . and {a} . {a. d . c.13 The boundary of set A is the intersection of the closure of A with the closure of its complement X  A .. i. d .. The smallest closed set containing A is called the closure of A (written as A ). e} . d } and  whose union is {c. e} . c. c.{b.. e}} and the subset A  {b. d . {a. Let us consider an open subset A of the Euclidean plane  2 . in other words it is the intersection of all closed sets containing A .{a}. {b. d } of X .TOPOLOGY 75     The union. They are. c. The closure of A is A  {b.e. Example 94. A A A B A B A B  A B  Ai   Ai iI iI Boundary A  A  A A  A  ( X  A ) A  A  X  A ( A  B)  A  B       Ai    Ai iI  iI       Ai    Ai iI  iI    A  X  ( A  ( X  A )) A A i iI iI i A   ( X  A) Example 93. . c. closure. {b. c. not related to each other. 14 The boundary of a set is often denoted as frontier of a set. d }. d }. i. e} .. i. boundary.e. c. A  ( X  A) An open set is its own interior. A closed set is equal to its closure. d . X . Table 11.e. and boundary of a set Interior A  A . c. d } . The exterior of a set A (written as A ) is the interior of the complement of A .  . The following table shows some properties of interior. b. the topology O defined on X as O  { X .{c. e} . The interior of A is A  {c. Properties of interior. which results to {a} .{a. d } .

HAUSDORFF spaces are always T1. In other words.3 Classification of Topological Spaces There are several ways to classify topological spaces. Interior (upper left). Usually. We call a topological space T0 (or a T0 space) if for two distinct points at least one has a neighborhood that does not contain the other point. Definition 60 (T1 space). 9. their overall size.3. and T2.1 Separation Axioms In topology we know many different ways to distinguish disjoint sets and distinct points. Every metric space with the metric topology is T2. closure (lower left) and exterior (lower right) of an open set 9. this is done according to the degree to which their points are separated. . We call a topological space T1 (or a T1 space) if two distinct points have neighborhoods that do not contain the other point. regarding their compactness. Definition 61 (HAUSDORFF Space). there exist two open sets A and B with a  A and b  B and A B . boundary (upper right). A topological space X is called a HAUSDORFF space or T2 space if two distinct points a.76 THE MATHEMATICS OF GIS A A A A Figure 31. and every T1 space is always T0. b  X possess disjoint open neighborhoods. Let us look at each of them in some detail. Definition 59 (T0 space). We first present axioms that separate two distinct points. Figure 32 illustrates separation axioms T0. and their connectedness. T1.

and every normal space is regular. If a topological space is T1 and for any two disjoint closed sets C1 and C2 there exist disjoint neighborhoods that contain the closed sets. Definition 63 (Normal space). T1. Separation axioms T0. Every regular space is a HAUSDORFF space. The converse is not true. Every metric space with the metric topology is normal. because there exist regular spaces that are not normal. we introduce a separation axiom that separates closed sets. If a topological space is T1 and for every closed set C and every point x outside C there exists an open set A that contains C and a disjoint neighborhood N of x . and T2 We now look at axioms that separate sets. Every metric space with the metric topology is regular. Figure 33 illustrates the axioms that lead to the definition of regular (T3 and T1 axioms) and normal spaces (T4 and T1 axioms). then we call this space a regular space or T3 space. The converse is not true. First we define an axiom that separates closed sets from the points that lie outside that set. Finally. then we call this space a normal space or T4 space. because there are HAUSDORFF spaces that are not regular.TOPOLOGY 77 N 1  N (x ) N 1  N (x ) N 1  N (x ) x y x x y N 2  N (y ) y N 2  N (y ) y  N1 T0 -axiom x  N2 y  N1 T1 -axiom N1  N2   T2 -axiom Figure 32. . Definition 62 (Regular space).

We see that a metric space is a very special case of a topological space that possesses all separation characteristics. Separation axioms T3 and T4 The following Figure 34 shows the relations between the separation characteristics of topological spaces.78 THE MATHEMATICS OF GIS A O A O C1 C B O x N  N (x ) C2 A N   T3 -axiom A B   T4 -axiom Figure 33.2 Compactness In this section we discuss properties of topological spaces whose conditions are stronger than separation characteristics. . also Y will have the same characteristic. 9. i..e. if a topological space X has a certain separation characteristic and there is a homeomorphism from X to a topological space Y . Finally. These conditions are defined by what is called open covers. T0 spaces T1 spaces Hausdorff spaces Regular spaces Normal spaces Metric spaces Figure 34. we will see that subsets of a Euclidean space which are both closed and bounded16 are of special importance. 16 A set is bounded when it is contained in some open ball with finite radius. Relationship between separation characteristics of topological spaces Separation characteristics are topological properties of a space.3.

their union is not the whole space any more. The results from the previous section about separation and the last item from the previous list tell us that metric spaces as well as compact HAUSDORFF spaces are normal. we call this space with a special name. Definition 66 (LINDELÖF space). The union of these disks covers the whole space. we call F an open cover of X . If we relax the condition for compactness to have a countable instead of a finite cover we arrive at the definition of a LINDELÖF space. 17 This proposition states that compactness as a topological property is even preserved under the weaker condition of a continuous mapping (and not a homeomorphism). we call X a LINDELÖF space (or we say that space X is LINDELÖF). Example 96. The Euclidean plane  2 equipped with the natural topology of open disks is a LINDELÖF space. (iii) A subset of the Euclidean n -space is compact if and only if it is closed and bounded.17 (ii) A closed subset of a compact space is compact. . The following spaces are compact:    The closed unit interval [0. Definition 65 (Compact space). they are an open cover of  2 . Compact spaces are always LINDELÖF. Consider all open disks in the Euclidean plane  2 whose radius is 1 and their centers have integer coordinates. Example 95. Therefore. If every open cover of a topological space X has a finite subcover. this family of open disks has no subcover. If the union of these subsets is the whole space X . If we leave out one disk. we call X a compact space. If F  is a subfamily of F with  F   X . Compactness is a topological property that remains invariant under homeomorphisms. Their proofs can be found in the topological literature: (i) A continuous image of a compact space is compact.TOPOLOGY 79 Definition 64 (Open cover). or  3 . (iv) A compact HAUSDORFF space is normal. Therefore. respectively The following statements can be made about compact spaces. 1] Any finite topological space A closed interval. If every open cover of a topological space X has a countable subcover. If a topological space has a finite subcover.  2 . then F  is a subcover of F . Let X be a topological space and F a family of open subsets of X . disk or ball in 1 .

A topological space is first-countable if every point has a countable local base. Definition 70 (Second-countable). i. According to Example 92 we have identified a countable local base for a metric space. First-countable is a local property of a topological space. Every metric space is first-countable. separable. The rational numbers are countably infinite.The Euclidean plane  2 is second-countable. A topological space is second-countable if it has a countable base for its topology. then it is also first-countable. and LINDELÖF. Definition 69 (First-countable). Example 101.e. A measure for the size of a set is its cardinality. In order to proceed we need the definition of the term dense. The rational numbers  are a dense subset of the real numbers.. The n -dimensional Euclidean space is separable. first-countable. Definition 67 (Dense set). which is solely determined by the properties of the neighborhoods of a point. With both properties of a set to be countable and dense we can impose some limit on the size of a topological space which leads to the definition of a separable topological space. Example 97. Example 100.80 THE MATHEMATICS OF GIS 9. Definition 68 (Separable space). According to Example 90 the open disks with rational radii and center coordinates are a countable base for  2 . Therefore. and secondcountable are topological properties and remain invariant under homeomorphisms.3. or number of elements. Another property of a topological space is related more to a global characteristic of space. because it can be shown that    . The properties of a topological space to be separable. Example 98.3 Size A further characterization of topological spaces can be done according to their size.  2 is second-countable. A subset A of a topological space X is dense if its closure is X . . For topological spaces we can make the following statements with regard to their size characteristics: If a topological space is second-countable. A topological space is separable if it has a countable dense subset. Example 99. A  X . It is therefore first-countable. We recall from chapter 5 on set theory that a set is countable if it has either a finite number of elements or is countably infinite.Every discrete topological space is first-countable.

c. 18 An open connected subset of a topological space is called a region. Definition 72 (Path-connected space). c. b. because the empty set and  n are the only sets that are both open and closed. x2  X of the space can be connected by a path. d }. e} are disjoint open sets and X  {a}  {b. Connectedness is a topological property. d }. Example 103. every path-connected space is connected. The converse is not true. The following conditions on a topological space X are equivalent to formulate connectedness: (i) X is connected. Example 102. i. d . d .{c. because {a} and {b. Intuitively speaking. for regions18 of the Euclidean plane  2 with the natural topology we have the following result: Every open connected subset of  2 is path-connected.{b. e} is the union of two disjoint nonempty open subsets. A space X is connected if whenever it is represented as the union of two nonempty subsets X  A  B then A  B   or A B   .The Euclidean space  n is connected.. However. Definition 71 (Connected Space). A somewhat stronger condition can be stated when we consider how two points in a topological space can be connected.3. A topological space X is path-connected if any two points x1 . .{a. c. (iii) X cannot be expressed as the union of two disjoint nonempty open sets. . d .Let X  {a. In general. e}} a topology on X . a space is connected if it appears in one piece or it cannot be represented as the union of two disjoint open subsets.1]  X such that f (0)  x1 (beginning point) and f (1)  x2 (end point). c.TOPOLOGY 81 9. (ii) The only subsets of X that are both open and closed are the empty set  and X . Then X is not connected.4 Connectedness Connectedness of topological spaces deals with the property of such spaces that they cannot be divided into two disjoint nonempty open sets whose union is the entire space.e. c. e} be a set and O  { X . d . The image of a connected set under a continuous mapping is connected. it remains invariant under homeomorphisms.{a}. A path in a topological space X is a continuous function f :[0.

.. and 3 . These spaces can then be pieced together to form more complex spaces. A polyhedron is a topological space that is built of simple building blocks. a point in a zero-dimensional space. 0 If we require 0 . we call the smallest convex set containing them a closed k -simplex (or simplex of dimension k ).. a simplex is the simplest geometric figure of a respective geometric dimension in the Euclidean space. The points v0 . look for simpler spaces that can be used instead. a triangle in a two-dimensional space. Simplexes of dimension 0. 2. a straight line segment in a one-dimensional space. written as  k . 1. v1 . i. We. v0 v0 v2 v1 0-simplex (point) 1-simplex (closed line segment) 2-simplex (triangle) v0 v3 v1 v2 v0 v1 3-simplex (solid tetrahedron) Figure 35.. k    and 0  1    k  1 . written as  k . vk are called the vertices of the simplex. A closed simplex can be written as  k  0 v0  1v1    k vk where the 0 .82 THE MATHEMATICS OF GIS 9. and a tetrahedron in a three-dimensional space. yet keeping a recognizable shape and being easy to handle. therefore.1 Simplexes and Polyhedra We first need to introduce the concept of a simplex. Given k  1 points v0 . Simply speaking. . 2.4. A generalization of polyhedra leads to cell complexes (or CW complexes) glued together from cells. Definition 73 (Simplex). where k  n .e. One class of these simple spaces is polyhedra. the simplexes. k    (positive real numbers excluding zero) we get an open k simplex. 9. 1. vk   n in general position. Figure 35 illustrates the definition with closed simplexes of dimensions 0.4 Simplicial Complexes and Cell Complexes The topological spaces we have treated so far are usually very general and too complex for many investigations. and 3.

simplici complex. we define a subs f e space by intersecting the s ets t e open sets of X with Y . There is. As clos and boun sed nded subsets of a Euclide space s ean they are compact an a metric sp e nd pace. Polyhed possess u dra useful proper rties. but not in a er. mplex is of d dimension n then a k -f face is a sim mplex of ion dimensi k  n . n Figure 36. In Figur 35 the clo re osed 1-simpl has two 0-faces v0 and v1 . we y ce i cal A simpl licial comple K . If two simple intersect then they mu do so in a c I exes ust common face e. v0 . r ouches the o other one on the base. is a topological space that we call a ex n this l polyhed dron. The triangle has three 0lex a s faces. nsider the uni of all sim ion mplexes in a simplicial co omplex as a subset of Howeve if we con 9 a Euclid dean space. an four 2-fac ix nd ces. On the s too other ha and. Y is call a subspace of X . complex Defin nition 74 (Si implicial Co omplex). The lower triangle to howeve no commo face. v1v2 . V Valid simplicia complex (le and invalid simplicial complex (right al eft) d t) Note that a simplici complex is a set of si ial implexes and as such not a topologic space.2 Ce and Ce Complex ells ell xes For man topologic investigat ny cal tions polyhedra are too special and t complex. The right o violates the conditio for a one ons ial . This gives us the open se for a new topology on Y . d t cal er. led . when viewed in t way. v0 v1 . si 1-faces. written as | K | . The one on the left is a simplicial complex. F every sim For mplex all of its faces must a be in the collection. 9. the subspace topology. Th line segment intersect the upper triangle. s also 2. The tet trahedron ha four 0as faces. and three 1-faces. W can now p We piece togeth simplexes in a defined way to a s her s simplicial x. es ful 19 Given a topological space X and a subset Y of this space. v1 and v2 . on he ts t common face. A concept in between that also too possesse many usef properties is a cell complex. A f finite collecti K of clo ion osed simplexe in a es Euclidean space  n is called a simplicial complex if th following two conditio are he ons satisf fied: 1. w can apply the subspac topology19 and make it a topologic space. A simpl is a topo lex ological spac with the n ce natural topol logy derived from its em d mbedding Euclidean space.TOPOLOGY Y 83 The con nvex hull of a nonempty subset of th vertices of a closed si y he implex  k is called a s face of the simplex If a sim x. general topological spaces are t general.4. and v2 v0 . Figure 3 shows two collections of simplexe in the 2-di 36 s es imensional E Euclidean space.

  A Figure 37 shows unit balls of dimension 0.and 0dimensional skeletons. In  2 the unit ball is a closed disk with radius 1. X   c . and the unit cell is the open disk with radius 1. Unit Sphere. The (n  1) -dimensional subspace S n1  {x   n | | x |  1} is called the (n  1) dimensional unit sphere. Figure 38 shows a cell decomposition of a 2-dimensional space with the 1.. . 1-. The subspace Dn  {x   n | | x |  1} is called the n -dimensional unit ball. topological space homeomorphic to D n is called a n -dimensional cell (or n -cell).Every open n -simplex is a n -cell. 1.84 THE MATHEMATICS OF GIS Definition 75 (Unit Ball. The subspace D n  {x   n | | x |  1} is called the n -dimensional unit cell. 2. Unit Cell. Let n be the n -dimensional Euclidean space with the natural topology. i. Cell). Unit balls and cells We can now generalize the concept of a simplicial complex to a cell complex. The n -dimensional skeleton of X is the cC subspace X n  {c  C | dim(c)  n} . and 3 and corresponding 0-. and 3cells. Definition 76 (Cell decomposition. skeleton). A cell decomposition is a topological space X and a set C of subspaces of X whose elements are cells such that X is the disjoint union of these cells.  X 1 We have then a sequence of subspaces  X  X  X 0 1 n 1  X with n X n X. Example 104. 0-dimensional unit cell 0-cell 1-dimensional unit cell 1-cell 2-dimensional unit cell 2-cell 3-dimensional unit cell 3-cell Figure 37. 2-.e. the unit sphere is the circle with radius 1. which is defined as a collection of cells that are glued together in a certain way. Example 105.

Definition 78 (Cell complex). i. then its boundary are the two end points. For every cell c there exists a continuous function f : D n  X such that f ( S n1 )  X n1 and the open cell c is a homeomorphic image of the unit cell. L is a 1-dimensional cell. is closed in X. The boundary of a set is always defined with regard to an embedding space. A CW complex is n -dimensional if X  X n  X n1 . If a cell complex has a finite number of cells it is called a finite CW complex.The open simplexes of a polyhedron | K | are a cell decomposition of | K | . which is all of L ... For every cell we have c a closed cell or the closure of c in X . A HAUSDORFF space X with a cell decomposition is a cell complex (or CW complex) if the following conditions are met: 1. A  c is closed in c . f (Dn )  c . It is important to note that the boundary of a cell in general is not the same as the boundary of a set. If. 3. The point set topological boundary of L is defined as L  L   3  L . Example 107. Every closed cell c is contained in a finite union of open cells. 2. The difference c  c  c is the boundary of c . 1-. A subspace A  X .  . This means that the disjoint union of 0-. however. such that for every cell l.e. and 2-cells (of for instance a 2-dimensional polyhedron) is equal to | K | . Definition 77 (Closure and boundary of cells).Consider a line segment L in  3 . whereas the boundary of a cell is depending on the dimension of the cell which is clearly determined.TOPOLOGY 85 Cell decomposition of a 2-dimensional space 1-dimensional skeleton 0-dimensional skeleton Figure 38. Cell decomposition and skeletons Example 106.

CW complexes can be easily constructed. separable. Figure 39 illustrates the construction of a 2dimensional CW complex. and HAUSDORFF space). Not for every k  n with n being the dimension of the CW complex there need to be cells of dimension k . However. Cells of a CW complex need not be geometric simplexes.  In particular.5 Applications in GIS The space used in GIS to represent spatial features is predominantly the 2-or 3dimensional Euclidean space  2 or  3 equipped with the natural topology of open disks and balls. condition 3 is the condition for the socalled weak topology. Construction of a CW complex 9. we have f : ( Dn . The Euclidean space is a metric space (therefore also a normal. every non-empty CW complex has at least one 0-cell.86 THE MATHEMATICS OF GIS Condition 1 defines a function from the n -dimensional unit ball to the space X such that the open cell appears as a homeomorphic image of the unit cell and the (n  1) -sphere is continuously mapped to a subset of the X n1 -space. then we glue 2-cells which gives us X 2 . X0 X1 Start with 0-cells Gluing of 1-cells X 2 Gluing of 2-cells Figure 39. The closure of a n -cell need not be a n -ball and the boundary of a n -cell need not be a (n  1) -sphere. S n1 )  (c . Condition 2 is also called closure finite. 3. c) or f ( D n  S n1 )  c  c . 2. The following statements underline the differences between CW complexes and simplicial complexes: 1. The closed cell and the boundary are compact. regular. We see that X 0  X 1  X 2 . The closure c and boundary c of a cell need not be the union of cells. 4. We start with a discrete space X 0 (consisting of at least one 0-cell). we then glue 1-cells so that we get X 1 . and . second-countable (therefore also first-countable.

B. and connected. although closely related to topology. to represent all spatial features as a set of simplexes with certain conditions (see Definition 74 of a simplicial complex).e. Figure 40 shows a 2-dimensional spatial data set as a cell complex embedded in the  2 . A special type of graph frequently used in GIS is a planar graph. every topologically structured data set in a GIS database is a digital representation of a 2dimensional cell complex. On the one hand. has developed as an independent mathematical discipline. This approach is much more suitable for general polygon features. on the other hand. Two-dimensional spatial data set as cell complex A data structure to represent this cell complex is the so-called arc-node structure. Every arc has a start and an end node. Networks.. The orientation is indicated by arrows in the figure. Such a structure is also called a graph. we must represent all features by a set of triangles. Polygon feature data sets are 2-dimensional CW complexes with the polygons as 2-cells and the bounding arcs and nodes as the 1-dimensional skeleton. thereby defining an orientation of the arc20. 2. are best modeled as a one-dimensional subset (or skeleton) of a cell complex. 9. i. Closed and bounded subsets of a Euclidean space are compact (such as closed cells and simplexes). The 0cells are the nodes and the 1-cells are the arcs between the nodes.. In the first case. because it avoids the use of triangles. C). The embedding Euclidean space  2 functions as the “world polygon” or “outside polygon” often denoted as W or O. every polygon has to be approximated by a potentially large number of triangles which is often undesirable. f). six 1-cells (a. like road or river networks.e.TOPOLOGY 87 LINDELÖF). c. triangles are very simple structures and easy to handle. In fact. 20 The orientation of an arc is usually determined by the digitization process. d. a line is followed from the beginning (start node) to the end (end node). b. 4). This complex consists of four 0-cells (1. Graph theory. and three 2cells (A. The topological relationships are then reduced to incidence relationships between edges (arcs) and nodes. 2 a 1 c A d 2 B f C 3 e 4 b Figure 40.5. 3. .1 Spatial Data Sets To represent 2-dimensional spatial features in a GIS we have two options: (i) to use a simplicial complex. An exception is a triangular irregular network (TIN) to represent a digital elevation model. For every arc we note which polygon (2-cell) lies to the left and which one to the right of it viewed in the direction from start node to end node. Spatial data sets consisting of linear features (network) in  2 or  3 are 1-dimensional CW complexes where the arcs are the 1-cells and the nodes the 0-dimensional skeleton. e. In the second case all features are cells glued together. or (ii) to represent them as a cell complex by considering the cells being glued together in a proper way (see Definition 78 of a CW complex). i. It is completely embedded in the plane such that no two edges intersect except at nodes.

Topological mapping Topologically speaking. Arc table for the arc-node structure Arc-id a b c d e f Start-node 4 1 1 3 4 4 End-node 1 2 3 2 3 2 Left-polygon C A C B B W Right-polygon W W A A C B 9. i. If we can show that the following rules are satisfied for every element in the data set. (For every arc there exist two adjacent polygons. and the boundary lines have the same start and end nodes.and 2-cells. 9. do not change) under topological mappings.88 THE MATHEMATICS OF GIS An implementation of the arc-node structure in a relational database needs one table for the arc-node relations. and C remain. (Every polygon has a closed boundary consisting of an alternating sequence of nodes and arcs..e. (Every arc has a start node and an end node). B.5.and 1-cells. Table 12.2 Topological Transformations As we have seen. the topological properties must not be violated. 2 1 c b 2 A d B f 2 a C 3 e 4 b A d B f 2 1 c a C 3 e 4 M1 h M2 Figure 41. They are topologically equivalent. the neighborhood relationships between A. (TC1) (TC2) (TC3) Every 1-cell is bounded by two 0-cells. When you apply a transformation (such as a map projection) to the data set.e. For every 1-cell there are two 2-cells. The areas are still bounded by the same boundary lines.) Every 0-cell is surrounded by a closed cycle of 1. we have applied a homeomorphism h : M 1  M 2 from the cell complex M 1 to the cell complex M 2 . (Around every node there exists an alternating closed sequence of arcs and polygons. and one for the vertices of the arcs.) (TC4) . we know that it is a topologically consistent 2-dimensional configuration. the left and right polygon).3 Topological Consistency A representation of a cell complex must be consistent. one for the polygon attributes. topology is the branch of mathematics that deals with properties of spaces that remain invariant (i.5. Table 12 shows the arc table of the arc-node structure of the cell complex in Figure 40. Assume you have spatial features stored in a database using the arc-node structure. only their shapes and the length of the perimeters have changed (Figure 41). Every 2-cell is bounded by a closed cycle of 0..

.21 For those rows where A is not the Right-polygon. TC2 ensures the neighborhood relationship of polygons. The presence of a NOT NULL value for the Start-node and End-node for every arc is sufficient. The presence of a NOT NULL Left-polygon and Right-polygon for every arc is sufficient. In the next step look up the record where 3 appears as the start node and continue as before. 1 c b 2 A d C 3 e B Figure 42. In our case we must swap for arc b. We will illustrate a procedure for polygon A in Figure 40: Select all rows from the arc table where A appears either as Right-polygon or Leftpolygon.TOPOLOGY 89 (TC5) Cells intersect only in 0-cells. Otherwise. if we do that.and End-node to maintain orientation. Closed polygon boundary check 21 The choice could be based on the fact that for two out of three rows this condition is already fulfilled. In our example we want A always to be the Right-polygon. we have a closed cycle of nodes and arcs. Arc-id a b c d e f Start-node 4 1 1 3 4 4 End-node 1 2 3 2 3 2 Left-polygon C A C B B W Right-polygon W W A A C B Make sure that for all selected records A appears always as the Left-polygon or always as the Right-polygon. TC3 ensures that polygons are closed. In the following we will discuss how these conditions can be checked when we have an arc table.and Right-polygon. Of course.) These rules cannot be applied without additions or modifications to other dimensions. (If arcs intersect.. they do so in nodes. starting at any node of the boundary of a polygon. The end-node of c is 3. which results in the following configuration: Arc-id a b c d e f Start-node 4 2 1 3 4 4 End-node 1 1 3 2 3 2 Left-polygon C W C B B W Right-polygon W A A A C B We now start at any Start-node of the selected rows and chain through the nodes. When we return to the node where we started. we must also swap Start. we have an inconsistency in the polygon boundary. TC1 demands that every arc must have a start node and end node. we must swap Left. i. the cycle is closed and the polygon boundary is closed. In our example let us start with arc c and node 1 (Figure 42).e.

and End-node.e. When we consider all possible combinations of intersections between the boundaries. In our example we want 3 always to be the End-node. Arc-id a b c d e f Start-node 4 1 1 3 4 4 End-node 1 2 3 2 3 2 Left-polygon C A C B B W Right-polygon W W A A C B Make sure that for all selected records 3 appears always as the Start-node or always as the End-node. we have an inconsistency in the node. the interiors. Of course. In our example let us start with arc c and Left-polygon C (Figure 43). boundary.. and exterior to define relationships between spatial features. if we do that. we can investigate their possible relations between spatial features. which gives us Arc-id a b c d e f Start-node 4 2 1 2 4 4 End-node 1 1 3 3 3 2 Left-polygon C W C A B W Right-polygon W A A B C B We now start at any Left-polygon of the selected rows and chain through the polygons.5. and exterior do not change under topological mappings. Otherwise. we must swap Start. Both have their respective boundary. Since the properties of interior. In our case we must swap for arc d. we must also swap Left. Node consistency check TC5 must be checked by calculating intersections of arcs and pointing out intersections at locations without nodes. and exterior. Let us assume two spatial regions A and B . interior. 9. When we return to the polygon where we started. we know that these .90 THE MATHEMATICS OF GIS TC4 ensures the planarity of the cell complex near a node. i. and the exteriors of A and B . We will illustrate a procedure for node 3 in Figure 40: Select all rows from the arc table where 3 appears either as Start-node or End-node. we can use the topological properties of interior. for every node there must be an “umbrella” of a closed cycle of alternating 1-cells and 2-cells. The Right-polygon of c is A. C C 3 d e e B c A Figure 43.4 Spatial Relations Whereas relationships between simplexes or cells define consistency constraints for spatial data. the cycle is closed and the “umbrella” is closed. boundary.and Right-polygon to maintain orientation. For those rows where 3 is not the End-node. In the next step look up the record where A appears as the Left-polygon and continue as before.

inside. for instance. and the exteriors of A and B intersect.6 Exercises Exercise 34 . covers. contains.TOPOLOGY 91 will not change under any topological transformation. Figure 44 shows all possible eight spatial relationships: disjoint. in queries against a spatial database. equal. we say that A and B meet. we can derive eight mutual spatial relationships between two regions. These relationships can be used. for instance. the boundary of A intersects the boundary of B . and overlap. Spatial relationships between two simple regions based on the 9-intersection 9. B ) which is called the 9-intersection. written as  A  B  A   B A  B –    I 9 ( A.  A–  B  A–   B A–  B –    From these intersection patterns. B )    A  B   A   B  A  B –  . meet. If. disjoint covered by meet contains equal inside covers overlap Figure 44. This can be put into a rectangular schema I 9 ( A. the interiors of A and B do not intersect. covered by.

.

which makes them comparable. The study of partially ordered sets and lattices (a special kind of ordered set) is covered by an extensive amount of mathematical literature. A set is said to be (partially) ordered when an order relation is defined between its elements. In this chapter. we will introduce the basic principles of partially ordered sets and lattices and show how they can be applied to spatial features and their relationships with each other. This theory has mainly been applied in computer science. 93 . such as in multiple inheritance or Boolean algebra.CHAPTER 10 Ordered Sets O ne of the basic structures mathematical disciplines are built upon is order.

1.94 THE MATHEMATICS OF GIS 10. Usually we will write P with the meaning ‘ P is a poset’. For a finite poset we obtain the diagram of the dual by turning it upside down. By “ A covers B ” (or “ B is covered by A ”) in a poset P we mean that B  A and there exists no x  P that B  x  A and we write A   B or B   A . To describe how to construct a diagram we need the idea of covering: Definition 80 (Cover). ) . Dually. for every x. A covers B means that A is immediately greater than B and there is no other element in between. For every partially ordered set P we can find a new poset. In other words. The set of all elements that cover an element X is called the cover of X . if x  y and y  z .1 Order Diagrams For every (finite) poset there exists a graphical representation. A binary relation  on P such that. that “ B contains A ”. the diagram (or Hasse diagram) of the poset. Any hierarchy is a poset with at most one element directly above any element. by defining that x  y in the dual if and only if y  x in P . Let P be a set. The integer space is a typical example of a total ordering. A set P equipped with a reflexive. Figure 45 shows a poset and its corresponding diagram. which means that every element can be compared with every other element in the set. The circles are connected with a straight line. when A covers B . 10. all subsets of X . z  P 1. A special type of hierarchy—and therefore a more special type of poset—is the totally ordered set (or chain). antisymmetric and transitive relation (order relation)  is called a partially ordered set (or poset) and is written as ( P. the set of all elements that are covered by X is called the cocover of X and we write X  . if x  y and y  x . the dual of P . where the circle for element A is drawn above the circle for element B . B ( X ) we define A  B if and only if A  B .The natural numbers with the relation  read as “less than or equal” are a poset.For spatial subdivisions A and B the order relation A  B means that “ A is contained in B ” or dually. then ( X ) is ordered by set inclusion and for every A.1 Posets Definition 79 (Partially Ordered Set). When we take the power set ( X ) of a set X . y . Example 109. x  x (reflexive) 2. i. . Example 108. then x  y (antisymmetric) 3.e. Any statement about a partially ordered set can be turned into a statement of its dual by replacing  with  and vice versa. This is a hierarchy in which at most one element is directly below any specific element. then x  z (transitive) is called a partial order on P . written as X  . A diagram of a poset P is drawn as a configuration of circles (representing the elements of P ) and connecting lines (indicating the covering relation).

There are cases when a greatest lower bound or a least upper bound does not exist.b.l. meet or infimum.1. if it exists. or l. respectively.b. are defined by duality. they are not comparable. no node is visited twice. Since the order relation defines a direction for the edges. Poset and corresponding diagram E The circles and the connecting lines in a diagram can be viewed as vertices and edges of a graph.b. An element x  P is an upper bound of S if s  x for all s  S .e. in other words we define S *  {x  P (s  S ) s  x} and S *  {x  P (s  S ) s  x} .ORDERED SETS 95 A B D E C B A C D Figure 45. However.). This may be the case because elements do not have common bounds or because a g. There are many algorithms for traversing directed acyclic graphs and for other related operations. . if it exists. y} or x  y (read as “ x meet y ”). 10. Such a graph is called a directed acyclic graph (or dag). written as min S .u. it is called greatest lower bound (g.u.b. and the bottom element of P . The natural numbers under their usual order have 1 as the bottom element but no top element. Therefore. y} or x  y (read as “ x join y “) and inf{x. Take for example the two elements B and C of Figure 45. There are no cycles in that graph.l. does not exist. none of the lower bounds is greater than the other. If S * has a least element. By duality. An element a  S is the greatest (or maximum) element of S if a  x for every x  S and we write a  max S . For a subset S we write  S (the “join of S “) or sup S and  S (the “meet of S ”) or inf S . Let P be a poset and S  P . there is no greatest lower bound for the subset {B. it is called least upper bound (l. a Hasse diagram is a directed graph. Let P be a poset and S  P . The set of their lower bounds are D and E . A lower bound is defined by duality. it is always unique. if S * has a largest element. C} (see Figure 46). The set of all upper bounds of S is denoted by S * (or “S upper”) and the set of all lower bounds (or “ S lower”) is written as S * . also join or supremum. Definition 81 (Maximum and Minimum). is called the top element of P and the least (or minimum) element of S . The greatest element of P . i. starting from a specific node and moving along the edges of the graph in the given direction. For the least upper bound and the greatest lower bound of two elements x and y we write sup{x.).In ( X ) we have X as the top element and the empty set as the bottom element.2 Upper and Lower Bounds Definition 82 (Upper Bound). Example 110. If a least upper bound or a greatest lower bound exists.

e. Definition 83 (Lattice). A lattice is called complete. Then x  y is equivalent to each of the conditions: x  y  x and x  y  y .  with  and  satisfying the following conditions for all a. y} . To show this let us take any of these sets and determine 22 Note that the difference between a lattice and a complete lattice is in the existence of the meet and join for every pair of elements (lattice) or every subset of elements (complete lattice). Lower bounds 10. when meet and join exist for every subset of the poset22. (a  b)  c  a  (b  c) abb a. 4. y} and x  y  max{x. (a  b)  c  a  (b  c) . This is an important result because it means that whenever we have a lattice with a finite number of elements we can always find least upper bounds and greatest lower bounds for every subset of the lattice. The order relation  is related to the algebraic operations of  and  by the following statement: Let L be a lattice and let x and y be elements of L . It can be proven that every finite lattice is complete.Every chain is a lattice in which x  y  min{x. Therefore. None of them is a complete lattice. rely heavily on the algebraic properties of lattices. integers.2 Lattices In the previous section we have seen that in the general case of a partially ordered set we cannot expect that join and meet always exist. a more specific order structure is needed.96 THE MATHEMATICS OF GIS A B C D E Figure 46.g. . rational and real numbers all are lattices under their usual order. the natural numbers. We see that a lattice can be viewed as either being an order structure or an algebraic structure. b. c  L : 1. 2.. aaa a  ( a  b)  a . 3. Example 111. A lattice L is a poset in which every pair of elements has a least upper bound and a greatest lower bound. Therefore. Boolean algebras. a  ( a  b)  a (associative laws) (commutative laws) (idempotency laws) (absorption laws) Every set L with two binary operations satisfying conditions (1) to (4) is a lattice. If L is a lattice then  and  are binary operations on L and we have an algebraic structure  L. Many theories. abba aaa.

the subset {B. to add elements to a poset to create a lattice. If A  B . s  Let x  L . if and only if x  s for all s  S . In other words. 10. T  L : (i) (ii) (iii) (iv) (v) (vi) s  S . It is. It even gives us a procedure for building the normal completion lattice. This is in fact possible with all posets. respectively. C (C ( A))  C ( A) A subset A of X is called closed if C ( A)  A . however. because posets exist in which not all subsets have greatest lower bounds and least upper bounds. Let x  L . which is defined as follows: Definition 84 (Closure). A  C ( A) 2. Meet and join are then defined as set intersection and set union. iI If a subset S  ( X ) is closed under finite unions and intersections. In order to define the normal completion we need the concept of a closure operator. if and only if s  t for all s  S and all t  T . Let P be a poset and (A* ) * the set of the lower bounds of the upper bounds of a subset A of P . then  S  T and S  T . The power set ( X ) of any set X is a complete lattice where meet and join are defined as  A i i  I    Ai and iI  A i i  I    Ai . For example.ORDERED SETS 97 the supremum of the set itself. The method for doing this is called normal completion. If S  T . then C ( A)  C ( B) 3. . it is called a lattice of sets. the set of the upper bounds is empty and a least upper bound does not exist. (S  T )  ( S )  (T ) and (S  T )  (S )  (T ) . we want to build the minimal containing lattice of a poset. C} of the order in Figure 46 has no greatest lower bound. The following theorem summarizes the important facts about the normal completion of posets. Then 1. It is even more interesting to find the smallest number of elements necessary to add to a poset to create a lattice. Since there is no greatest number in any of these sets. Example 112. Then x   S  T S Then x   S S and s  S . C ( A)  ( A* )* defines a closure operator on P . if and only if x  s for all s  S . A map C :( X ) ( X ) is called a closure operator on X if.3 Normal Completion Not every poset is a lattice. Let X be a set. for all A. B  X : 1. If L is a complete lattice then the following is true for every S . It is called a complete lattice of sets if it is closed under arbitrary unions and intersections. possible.

The theorem above has a simple corollary. if there is a least element in P it is called bottom element and written as  . This means. i. If P does not have a bottom element. 2. i. because ( x * ) *  x* for all x  P . By duality. in which Ai i  I    Ai and   A i i  I   C ( Ai ) . The set of all upper bounds of S was denoted as S * and the set of all lower bounds of S as S * . it is order-preserving and injective. It leaves the lattice unchanged.e..e. we have P  DM ( P )  L . when ordered by inclusion.. If there exists a greatest element in P it is called top element and written as T. and  ( A)   ( A) . then  ( A)   ( A) . Now.98 THE MATHEMATICS OF GIS 2. that if L is any other lattice such that P  L . if and only if P has a bottom element. DM ( P ) is a completion of P via  and all greatest lower bounds and least upper bounds which exist in P are preserved. the normal completion does not add anything to the lattice. if P has a bottom element.3. S is the empty subset of P . Dually. There are two cases that require special attention: when S  P and when S   . First. then P *   and there is no supremum of P . then P*  {} and inf P  . i. let us assume that S   .e. The family DM( P)  { A  P | ( A* )*  A} is a complete lattice (the DEDEKINDMACNEILLE completion. i. For the normal completion lattice we need to identify all (S * ) * for all subsets of P . Then (vacuously) for all s  S we have that s  x for every element x  P . or normal completion or completion by cuts of P ). First. Thus  *  P and sup P exists. this is rather inefficient.e. it follows from the idempotency of a closure operator that applying the completion more than once does not increase the number of elements added to the completion lattice. For all posets P we have DM ( P )  DM ( DM ( P )) .1 Special Elements Let P be a poset and S a subset of the poset. the corollary tells us that whenever the poset is already a lattice. In fact  can be defined as  ( x )  x*  { y  P | y  x} . When P has no top element. If L is a lattice. then P*   and the infimum does not exist. 10. If P has a top element. iI iI 3. We had defined upper bounds and lower bounds for the subset S . 4. then L  DM ( L) . By calculating the normal completion we have to look at all subsets of the poset P . which yields two important properties of the normal completion lattice: 1. then we have sup P  . because every set with n elements has 2 n subsets. The map  : P  DM ( P ) defined by  ( x)  ( x * ) * for all x  P is an orderembedding. For practical applications. then P *  {Τ} and sup P  T . if A  P and  A exists in P . Secondly. DM( P) is the smallest lattice in which P can be embedded in the sense. let us investigate the case when S  P . the number of elements in the completion lattice is bounded by 2 n for n elements in the poset.  *  P .

C . E} {D} { E} { A. C . Assign suitable symbols to the remaining elements of the new poset. This results in 32 sets. s  x for every x  P ) and inf P  T whenever P has a top element. E} { A} { A} { A} { A} { A} { A. C . E} {B. C . 2. B} ( S  )  { A. For every subset S ( P ) determine ( S  ) 3. D. First we determine all subsets of the poset { A. The result is given in Table 14. D} { A. B. B. E} { A} { A. B. E} { A. C} { A. the power set ( P ) . Arrange all ( S  ) to a poset where  (subset) is the order relation. B.2 Normal Completion Algorithm The algorithm for the normal completion can be written as follows: 1. E} { A. D. Identify every element a  P of the original poset with its corresponding (a ) in the new poset. C . E} { A. Normal completion S 1 2 3 4 5 6 7 8 9 10 11 12  { A} {B} {C} {D} { E} { A. C} { A. For every subset S we must then compute ( S  ) . C . D. B. To illustrate how this works we take the poset of Figure 45 and build the normal completion lattice according to the algorithm. Table 13 summarizes the result. i. D. B. B. C . Table 13. B. Special elements and the closure operator in the normal completion S* Subset Top element exists No top element S* P  {T} P  P Bottom element exists {} P No bottom element  P From the table above we can derive the following sets: (P* )*  P {} if P has a bottom element ( * ) *   otherwise  10. D. Determine all subsets. C . B} { A. E} {C .ORDERED SETS 99 (because again we have vacuously that for all s  S   . E} {B. D . D. D} { A. 5. D. 6. 4. C . D. D. of the poset P . Table 14. E} { B . D. E} .3. B. E} { A. B} { A. C . The resulting poset is the normal completion lattice of P .e. B. D} S { A.. E} . C} {B.

B. D . E} { A. C . D. D. B. B. E} The resulting sets are { A. C} { A. B. {D. E} { A. D. C . {D} . C . C . B} { A. E} {D} {} Figure 47. C} { A. Figure 48 shows the normal completion of the poset. E} {B. B. C . E} { A. D. C . When we arrange them in a poset according to the subset relation. E} . E} {C . we identify the original poset elements with their corresponding lattice elements and denote the newly created elements with X and { } . E} { A. D} { A. D. B. D. D. B. E} { D . E} { A. D. C . E} {E} Finally. C . C. C . D. E} {D. D. E} { A. E} { A. E} { A. C} { A} { A} { A} { A} { A} { A} {B. C} { A} { A} { A} { A} { A} { A} { A} { A} { A. E} { A. C . B. {E} . E} { A. E} . B. B. D. D. D} { B . D. D. E} { B . D} { A. C . E} { A. D. B. C} { A. E} { A. D. C . B. B. B} { A. we get the normal completion lattice (Figure 48)23. D. E} { A. E} { A. E} { A. E} { A. Normal completion lattice {C. . D. D. C . D. C . B. E} . {A. C . D. D. C . {B. E} {C . D. D . 23 Note that we may use either {} or  to denote the empty set. B. D. D. B. C . and  . {C . B. B. E} {C . E} {C . D. E} { A. E} { A. D. D. B. E} { A. C . C . B. E} {B. E} { D . C . C . E} { A. B. B. C .100 THE MATHEMATICS OF GIS 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 {B. We see that two new elements were added to the poset to form a lattice. B. E} { A. C . E} { A. D. D. E} {C . D} {C . D} { A. E} . B. E} { B . C . E} {B.

(c) {D. Examples of hierarchies are administrative subdivisions where for instance every county belongs to exactly one state. Element X can be interpreted as the intersection of B and C . 10. as “contains” can be used for relationships among spatial features such as polygons. lines and points. The structure of a poset accommodates both strict hierarchies (every object has exactly one parent object) and relationships where one object possesses more than one parent object. . General posets can be used to represent situations where one object belongs to several parents. such as agricultural production zones that may be part of several municipalities. A A B X D {} X=B»C Figure 49. Normal completion E The new elements can be interpreted in a geometric way as shown in Figure 49.ORDERED SETS 101 poset A B C B lattice A C X D E D {} Figure 48. dually. (c) { A} . Geometric interpretation of new lattice elements C B E X D E C 10.4 Application in GIS The intuitive interpretation of order relations as “is contained in” or.5 Exercises Exercise 35 From the poset in Figure 45 determine the upper bounds of (a) {D} . C} . or regions that are composed of several unconnected polygons such as the Hawaiian Islands. and every state belongs to exactly one country.

Draw the poset for the four regions. D} . .102 THE MATHEMATICS OF GIS Exercise 36 From the poset in Figure 45 determine the greatest lower bound of (a) {B. and D: C is contained in A and D is contained in B. B. C} Exercise 37 The following relationships are given for the four regions A. compute and draw the normal completion lattice. C. (c) { A. B. (b) { A} .

CHAPTER 11 Graph Theory T he origin of graph theory lies in the investigation of topological problems given by a set of points and the connections between them. Today. This chapter deals with the basic principles of graphs. The importance of graph theory for the analysis of transpiration and flow problems is highlighted in the section on applications to GIS. 103 . their representation and ways to traverse them. graph theory is a branch of mathematics in its own right dealing with problems that can be represented by a collection of vertices and connecting edges.

In the figure they are represented by black points and red lines. Figure 50 shows a sketch of the seven bridges across the river Pregel in Königsberg (which is today’s Kaliningrad). Such a configuration is called a graph.104 THE MATHEMATICS OF GIS 11. The problem is to determine whether it is possible to make a circular walk through Königsberg by starting at a river bank and crossing every bridge exactly once. . the origin of graph theory is attributed to the Swiss mathematician LEONHARD EULER who published a paper in 1736 on what is now commonly known as the Königsberg bridge problem. Starting from an arbitrary vertex we find after some tries that such a circular walk is impossible24. The seven bridges of Königsberg Euler solved the problem by abstracting the island and river banks to points and representing the bridges by lines connecting these points. Figure 50. v2 e1 e2 e5 e7 v1 v4 e3 e4 e6 v3 Figure 51. and the edges e1 to e7 .1 Introducing Graphs Generally. Graph of the Königsberg bridge problem 24 We will see later that the problem is to find an Eulerian circuit in the graph and that there is a theorem stating when such a circuit exists. Figure 51 shows these points (vertices) and lines (edges) in a schematic way with the vertices numbered v1 to v4 .

K1 K2 K3 K4 Figure 52. E . A graph with loops and parallel edges is sometimes called a multigraph. g (e7 )  (v2 .e. v4 } . Isomorphic graphs have the same . g (e6 )  (v3 . A vertex v with d (v)  0 is called an isolated vertex. we say that e is incident with vi and v j .e. v3 and v4 are three. Complete graphs Two graphs G1  (V1 . v3 . g (e5 )  (v1 . e6 . v j ) of elements of V . E . Example 114. Here. v2 . Example 113. We call the triple G  (V . v3 ) . For an edge e  (vi . . E ) for short. g ) a graph. the incidence map. A complete graph K n is (n  1) -regular.GRAPH THEORY 105 11. g ) with the vertex-set V  {v1 . v2  V1 we have (v1 . The graph contains no loop. the number of vertices and the number of edges are both finite. the elements of E are called edges. Given a non-empty set V  {v1 . e4 . g (e4 )  (v1 . and the degrees of vertices v2 .e. e4 are parallel. We call a graph regular when every vertex has the same degree. v3 ) . the edge-set E  {e1 . e3 . v2 ) .1 Basic Concepts Definition 85 (Graph). a set E  {e1 . v j ) vertices vi and v j are called end points of e . v4 ) . and that vi is adjacent to v j . e7 } and the incidence map defined as g (e1 )  (v1 . When there is no confusion possible we will denote a graph with G  (V . Figure 52 illustrates some complete graphs. vn } . i (v2 ))  E2 . e5 . e2 . which assigns to every element of E a pair (vi . we will deal only with finite graphs. E2 ) are isomorphic if there is a bijective mapping i : V1  V2 preserving the incidence relationships. If the degree is k then the graph is k regular.. i. i. For n vertices the complete graph is denoted by K n . the vertexset. The elements of V are called points (or vertices). e2 and e3 . A graph is called complete if there exists an edge for every pair of distinct vertices. and a function g : E  V  V . E1 ) and G2  (V2 .1. g (e3 )  (v1 . g (e2 )  (v1 . g (e)  (v. the edge-set. v2 )  E1 implies (i (v1 ).. every vertex in a complete graph K n has degree (n  1) . . v4 ) . edges. In the previous example the degree of vertex v1 is 5. i.. The number of edges incident with a vertex v is called the degree of v and is written as d (v ) . v2 . em } . v) we call e a loop. v4 ) . for every v1 . v2 ) . The graph for the Königsberg bridge problem in Figure 51 can be written as G  (V . e2 . Edges e1 . If If g (ei )  g (e j ) we call ei and e j parallel A graph without loops and parallel edges is called a simple graph.

v3 .2 Path. If the removal of a vertex v would disconnect the graph. A subset of vertices V   V and edges with both end-points in V  is called a subgraph induced by V  . Note that it is not a simple circuit. . en 1 . v1 v3 v4 v2 i(v3) i(v5) i(v2) v5 i(v1) i(v4) Figure 53. A path is called a simple path if every vertex is visited only once. v1 . v2 . v4 is a simple path from v1 to v4 . e4 . e5 . v4 is circuit. In the graph of Figure 51 P  v1 . v1 . Graph H has two components. e1 . . e2 . If v1  vn then the path is called a cycle or circuit.1. Two vertices vi and v j are connected if there exists a path from vi to v j . Figure 54 shows an example of a connected and disconnected graph. The removal of a vertex implies that all edges incident with it must also be removed. C  v4 .106 THE MATHEMATICS OF GIS structure. Figure 53 shows two isomorphic graphs. Example 115. Connectivity For many applications we need to traverse a graph. Circuit. In a simple circuit every vertex appears once except that v1  vn . Every vertex is connected to itself. A subgraph induced by a set of vertices is called a component of a graph. although they might look quite different at a first glance. A path from v1 to vn is a sequence of alternating vertices and edges P  v1 . A graph with only one component is called connected. e1 . Isomorphic graphs If we remove a number of edges or vertices from a graph G we obtain a subgraph S  G . e5 . because vertex v1 is visited twice. A block is a graph without any articulation point. e2 . However. vn such that for 1  i  n . otherwise it is disconnected. ei is incident with vi and vi 1 . For a simple graph it is sufficient to list only the vertices in a path. When we assign a number (weight) to each edge of a graph we get a weighted graph. 11. The vertices v1 . The result could be some isolated vertices. In many applications such a weight is being used to represent the length of an edge as distance or travel time. if we remove an edge the vertices remain. e1  G is a cut-edge. then v is called an articulation point. The length of a path or a circuit is the number of edges it contains. This must not be confused with the length of a path as defined above. v2 . v2  G are articulation points. If the removal of an edge e would disconnect the graph then this edge is call a cut-edge. sometimes in a particular way.

GRAPH THEORY 107 G H e1 v1 v2 v1 v2 Figure 54. The faces are bound by edges of the graph. H is a DAG. G H Figure 55. One face encloses the graph. DAG’s play an important role in the representation of partially ordered sets. We draw the edges of a digraph with arrows indicating their direction.e. v j ) is said to be incident from vi and incident to v j . i.2.. Digraphs are used to represent transportation or flow problems. d  (v)  d  (v) . 25 This class of graphs plays an important role in the structuring of two-dimensional spatial data sets for GIS. the number of edges incident to v is the in-degree d  (v) . Such a representation divides the plane into connected regions (or faces). A digraph is symmetric if for every edge (vi . v j ) there is also an edge (v j . This face is often called the exterior face. A digraph is balanced if for every vertex v the out-degree is equal to the in-degree.2. vi ) .2 Planar Graph An important class of graphs is the planar graphs. A directed graph without cycles is called a directed acyclic graph (or DAG).2 Important Classes of Graphs 11. Graph G contains a cycle. The number of edges incident from a vertex v is called the out-degree d  (v) . A graph is planar if it can be drawn on a plane surface without intersecting edges 25 . . Figure 55 shows two directed graphs. 11. Directed graphs In a digraph an edge (vi . Connected (G) and disconnected (H) graph 11.1 Directed Graph If for every edge we assign one of its vertices as start point the graph becomes a directed graph (or digraph).

six edges.3 Representation of Graphs For many computational purposes we need efficient data structures and algorithms to represent and traverse graphs. Planar graph EULER’s formula connects the number of vertices. this cannot be extended to higher dimensions.. e2 . f 3 .108 THE MATHEMATICS OF GIS A planar graph in the real drawing plane corresponds to a 2-dimensional cell complex. six edges E  {e1 . f 4 } . * v4 * v2 * v1 * v3 Figure 57. The edge is drawn crossing the bounding edge of the faces in G . It is again planar. v2 . and f faces we have ne f  2 If we do not count the exterior face the formula changes to n  e  f 1 Example 116. For every planar graph G we can construct a graph G * whose vertices are the regions of G . Such a graph is called the dual graph. e6 } . and the faces to the 2-cells. Figure 56 shows a planar graph. e4 . Figure 57 shows the planar dual graph of the graph in Figure 56. edges and faces. the edges to the 1-cells. where the vertices correspond to the 0-cells. Clearly. the edges represent the adjacency of faces. . f4 e5 v3 e4 f3 e3 v4 v1 e6 f2 e1 v2 f1 e2 Figure 56.e. there is an edge connecting two vertices of G * if the two corresponding faces of G are adjacent. v3 . For the planar graph in Figure 56 with four vertices. e3 . Face f 4 is the exterior face. f 2 . and four faces F  { f1 . i. and four faces we have 4  6  4  2 . The best known structures to represent a graph are adjacency matrices and adjacency lists. This graph has four vertices V  {v1 . Dual graph 11. It states that for every connected planar graph with n vertices. e5 . v4 } . e edges.

v5   We see easily that the storage requirement for adjacency matrices is usually higher than adjacency lists. For a digraph A is usually asymmetric. i ) . vk )  E then we also show the relationship (vi . vi ) are trivially contained in the transitive closure. v3 v1 . E ) with n vertices an adjacency matrix is an n  n matrix A . vk ) in the matrix or list. adjacency lists for the graphs in Figure 58 are:  v1 : v :  2 L(G1 ) :  v3 :  v4 :  v5 :  v2 . For the directed acyclic graph G2 in Figure 58 we represent the transitive closure as: . v1 v1 v2 v3 v2 v3 v4 G1 v5 v4 G2 v5 Figure 58. v5 v1 . v5 v2 . v4 . such that: 1 if (i. This means that if we have (vi . Undirected and directed graph If we sort the columns and rows from v1 to v5 the adjacency matrices for G1 and G2 are written as: 0  1 A(G1 )  1  0 0  1 1 0 0  0 0 1 1 0 0 1 1  1 1 0 0 1 1 0 0  0  0 A(G2 )   0  0 0  1 1 0 0  0 0 1 1 0 0 1 1  0 0 0 0 0 0 0 0  The An adjacency list L shows for every vertex the vertices adjacent to it. Figure 58 shows an undirected graph G1 and a directed graph G2 . j )  E A(i. v3  v1 : v :  2 L(G2 ) :  v3 :  v4 :  v5 :  v2 . v5 v4 . v4 . The relationships (vi . For directed acyclic graphs it is often more convenient to represent also the transitive relationships in the graph. v j )  E and (v j . j )  A( j . This is called the transitive closure of the graph.GRAPH THEORY 109 Given a graph G  (V . v3 v4 . j )   0 otherwise For an undirected graph A(i. v3 v2 .

11. However. A digraph contains an Eulerian path if and only if it is connected and for the degrees of the vertices we have: d  (v)  d  (v) for all v  v1 or v2 d  (v1 )  d  (v1 )  1 d  (v2 )  d  (v2 )  1 Example 117. Example 118. we see that the question is whether there exists an Eulerian circuit in the graph of Figure 51. One of the best known graph traversal algorithms is the depth-first-search (DFS). When we do not distinguish between path and cycle we will talk about a tour. the problem cannot be solved. The following statements can be proven for undirected graphs and digraphs: An undirected graph contains an Eulerian circuit if and only if it is connected and the number of vertices with odd degree is 0. v5   Based on the representation of a graph by a matrix or a list. v5 v4 . Traversal means that from a given start point all other vertices of the graph are visited. Therefore. If no such vertex can be found then return to the vertex visited just before v and repeat step 1.4. v4 . If we traverse the graph visiting each vertex exactly once we call this a Hamiltonian tour. efficient algorithms can be formulated to traverse the graph. An undirected graph contains an Eulerian path if and only if it is connected and the number of vertices with odd degree is 2 (denoted with v1 and v2 ). there are four vertices with odd degree. Shortest Path Problem As mentioned above we often want to traverse a graph in a particular manner.110 THE MATHEMATICS OF GIS 1  0 A(G2 )   0  0 0  1 1 1 1  1 0 1 1 0 1 1 1  0 0 1 0 0 0 0 1   v1 : v :  2 L(G2 ) :  v3 :  v4 :  v5 :  v2 . v5 v4 . In order to be more efficient the question is whether he can traverse the street network of his town in such a . A famous problem in graph theory is the Chinese postman problem. A digraph contains an Eulerian circuit if and only if it is connected and balanced. The shortest path problem is about finding the shortest path between two given vertices in a graph. In its colloquial form it is about a postman who has to deliver the mail. The graph is connected.1 Eulerian Graphs An Eulerian graph is an undirected graph or digraph containing an Eulerian circuit. v3 . A tour through a graph in which every edge is traversed exactly once is called an Eulerian tour.4 Eulerian and Hamiltonian Tours. It works in the following way: Starting from a given vertex v visit an adjacent vertex that has not yet been visited. When we recall the Königsberg bridge problem. 11.

Such a topological graph is homeomorphic to a 2dimensional cell complex. however. and two vertices v1 and v2 . Find a path P from v1 to v2 such that for all edges e  P of the path minimal among all paths connecting v1 and v2 . Unlike with Eulerian graphs we do not have a simple way of determining whether a graph is Hamiltonian.4. A network consisting of nodes (vertices) and arcs (edges) can be considered a graph or a 1-dimensional cell complex. The problem can be formulated as: Given a number of cities and the costs of traveling form one city to the other. For 3-dimensional configurations we need to turn to topology. . A topological graph is isomorphic to a planar graph embedded in 2 .3 Shortest Path Problem The shortest path problem can be formulated as follows. One of the famous examples is the GBF/DIME (Geographic Base File/Dual Independent Map Encoding) file of the United States Bureau of the Census. The vertices are usually called nodes. The reason is that in the early days of GIS the storage of map data (or cartographic data) was the focus of interest. the edges are called arcs and the faces are the polygons. This file structure was introduced to conduct the 1970 census. Example 120. what is the cheapest roundtrip that visits every city and then returns to the starting city? The cities are the vertices of a weighted graph. Beside the representation of spatial features graphs play an important role in the representation and analysis of networks. 11. Given are a weighted graph with f : E   assigning weights to the edges.5 Applications in GIS Graphs have played an important role in GIS right from the early beginnings. A generalization of the Hamiltonian cycle problem is the traveling salesman problem. Early data structures for the representation of spatial data (predominantly two-dimensional) are almost exclusively based on planar graphs. Example 119. Good approximations exist.GRAPH THEORY 111 way that starting at the post office he walks every street not more than once before he returns to the office.4.  f (e) is eP 11.2 Hamiltonian Tours A graph is called Hamiltonian if it contains a Hamiltonian circuit. In graph theoretic terms we are checking whether there is an Eulerian cycle in the graph of the street network. In terms of data modeling planar graphs have been used extensively to represent two-dimensional spatial data. Therefore. A well known algorithm to solve the shortest path problem for a connected digraph with non-negative weights is DIJKSTRA’s algorithm named after the Dutch computer scientist EDSGER DIJKSTRA. So-called topological graphs are the backbone of efficient representations. All known algorithms to find a Hamiltonian tour in graph are either inefficient or solve the problem only through approximations. 11. There are no efficient algorithms to solve the problem. The United States Geological Survey developed the DLG (Digital Line Graph) file format to store and transfer topographic base data. planar graphs or cell complexes can be used interchangeably as long as we do not exceed the 2-dimensional space.

to trace a network path. A network is a finite connected digraph in which one vertex x with d  ( x)  0 is the source of the network. 11. Exercise 39 .112 THE MATHEMATICS OF GIS Definition 86 (Network). The network analysis functions of a GIS provide tools to find the shortest path from a A to B. as well as location-allocation analyses.6 Exercises Exercise 38 Draw K 5 . to perform allocation analysis. and one vertex y with d  ( y)  0 is the sink of the network.

a mathematical theory that has found many applications in various domains.CHAPTER 12 Fuzzy Logic and GIS M any phenomena show a degree of vagueness or uncertainty that cannot be properly expressed with crisp sets of class boundaries. or “suitable” can better be expressed with degrees of membership to a fuzzy set than with a binary yes/no classification. and concepts like “steep”. Spatial features often do not have clearly defined boundaries. It can be applied whenever vague phenomena are involved. “close”. 113 . This chapter introduces the basic principles of fuzzy logic.

we can accommodate also those locations that just miss a criterion by a few meters. These vague or uncertain concepts are said to be fuzzy. however. i. to which degree . 12. is its extent.500 meters and 2. The site must       have moderate slope have favorable aspect have moderate elevation be close to a lake be not near a major road not be located in a restricted area All the conditions mentioned above (except the one for the restricted area) are vague. otherwise (even if it would be very close to the set threshold) it would be excluded from our analysis. Using the conventional approach the above mentioned conditions would be translated into crisp classes.e. we assign a degree of membership to a class as a value between zero and one.1. however. yet important. black and white. the concept of “tall” will be depending on the context.1 Motivation When we talk about tall people. difference. forest areas or grassland. such as      slope less than 10 degrees aspect between 135 degrees and 225 degrees. but correspond to the way we express these conditions in our languages and thinking. which are also given as a value between zero and one. Our thinking and language is not binary.1. In land cover analysis we are not able to draw crisp boundaries of. Any value in between can be a possible degree of membership. We know that the phenomenon exists. i. If. What we do not know. We might be tempted to assume that fuzziness and probability are basically the same. zero or one.000 meters within 1 kilometer from a lake not within 300 meters from a major road If a location falls within the given criteria we would accept it. we allow degrees of membership to our classes. or the terrain is flat elevation between 1. Probability gives us an indication with which likelihood an event will occur. however. In a society where the average height of a person is 160cm. where zero indicates no membership and one represents full membership. somebody will be considered to be tall differently from a population with an average height of 180cm. for instance.2 Fuzziness versus Probability Degrees of membership as values ranging between zero and one look very similar to probabilities. They will just get a low degree of membership. but will be included in the analysis. In real life applications we might look for a suitable site to build a house. The criteria for the area that we are looking for could be formulated as follows. Fuzziness is an indication to what degree something belongs to a class (or phenomenon).. Whether it is going to happen. a subtle. is not sure depending on the probability. There is.e. Usually.. 12.1 Fuzziness In human thinking and language we often use uncertain or vague concepts. We encounter fuzziness almost everywhere in our everyday lives. Where does the grassland end and the forest start? The boundaries will be vague or fuzzy. In real life we add much more variation to our judgments and classifications. yes or no.114 THE MATHEMATICS OF GIS 12.

  ( x )  0 .26 X The empty fuzzy set  is defined as x  X . The characteristic function  A of A is defined as  A : X  {0. then a fuzzy set A on X is expressed as A   A ( x1 ) / x1   A ( x2 ) / x2     A ( xn ) / xn    A ( xi ) / xi i 1 n . we allow some degree of uncertainty as to whether an element belongs to a set. It is important to note that the membership degree of 1 does not need to be obtained for members of a fuzzy set. respectively.  X ( x )  1 . The symbols  and “/” function as aggregation and separator. . A membership function assigns to every element of the universe a degree of membership (or membership value) to a fuzzy set. the universe is always crisp. Definition 88 (Fuzzy set). Let us take three persons A. +. If the universe is an infinite set X  { x1 . The symbol “/” is called separator.1] where  A ( x ) is the membership value of x in A . 165cm (B) and 186cm (C). and tall people. and integral. and  are not to be interpreted in their usual meaning as sum. All other values between zero and one indicate to which degree an element belongs to the fuzzy set. In the following sections we will establish the mathematical basis to deal with vague and fuzzy concepts. i. A fuzzy set A of a universe X is defined by a membership function  A such that  A : X  [0.. xn } .e. Example 121. 26 Note that the symbols  . Let A be a subset of a universe X . This membership value must be between zero (no membership) and one (definite membership).1} with  A ( x)   1 iff 0 iff x A x A In this way we always can clearly indicate whether an element belongs to a set or not. For every element of the universe X we trivially have x  X . If the universe is a finite set X  { x1 . we can express the membership of an element to a set by its membership function. addition.FUZZY LOGIC AND GIS 115 members of a given universe belong to the class. however.  and “+” function as aggregation and connection of terms. x2 . Definition 87 (Characteristic function). The universe X is always a crisp set. x2 . then a fuzzy set A on X is expressed as A    A ( x) / x . We can express this fact with the characteristic function for the elements of a given universe to belong to a certain subset of this universe.} . average. .2 Crisp Sets and Fuzzy Sets In general set theory an element is either a member of a set or not. 12. If. We want to assign the different persons to classes for short. B. and C and their respective heights as 185cm (A). We call such a set a crisp set. The term  A ( xi ) / xi indicates the membership value to fuzzy set A for xi .

(165. The membership function for the tall class is zero up to 170cm.116 THE MATHEMATICS OF GIS If we take a crisp classification and set the class boundaries to (-. Membership values for the height classes A B C Short 0. The characteristic functions of the three classes are displayed in Table 15.50 0.56 Tall 0. and “tall” For short we select a linear membership function that produces a membership value of one for persons shorter than 150cm and decreases until it reaches zero at 180cm.8 0. and yet they fall into different classes.6 0.60 0. From there it increases until it reaches one at 200cm. respectively.50 0. From there it decreases until it reaches zero at 200cm. We also see that A is nearly as tall as C.4 0. we need to define three membership functions for the three classes. It is the responsibility of the user to select a function that is a best representation for the fuzzy concept to be modeled. Table 15. The membership function for the average class produces values equal zero for persons shorter than 150cm. “average”. 185] for average. -) for tall. 12.2 0. 165] for short.53 Using the fuzzy set approach we can much better express the fact that A and C are nearly the same height and that both have a higher degree of membership to the average class than to short or tall.3 0. it then increases until it reaches one at 175cm.5 0. Characteristic function for height classes A B C Short 0 1 0 Average 1 0 0 Tall 0 0 1 When we choose a fuzzy set approach. we see that A falls into the average class. B into the short class. The following criteria are valid for all membership functions: . short 1 0.7 0. Membership functions for “short”.3 Membership Functions The selection of a suitable membership function for a fuzzy set is one of the most important activities in fuzzy logic. and (185.00 0.60 0.00 0. The membership values for the three persons to the three classes are given in Table 16. respectively (Figure 59). Table 16.9 0.1 120 130 140 150 160 170 180 190 200 210 220 average tall Figure 59. and C into the tall class.00 Average 0.

The points with membership value 0. Sinusoidal membership function A special case of the bell-shaped membership functions is the Gaussian function derived from the probability density function of the normal distribution with two parameters c (mean) and  (standard deviation).8 0. Membership Value 1 a 0.3 0. trapezoidal.e.4 0..5 0. i. we can create S-shaped. and L-shaped membership functions by proper selection of the four parameters.2 0.9 0. i.2 0.1 0 20 b c d 40 60 80 U 100   0 x a  b a  A(x )   1  d  x d  c   0  xa axb b x c c x d x d Figure 60. if we would apply a crisp classification. and L-shaped membership functions. it is used here as a membership function for a fuzzy set. for those members that definitely belong to the set. b . This function has four parameters that determine the shape of the function. The membership function should fall off in an appropriate way from the center through the boundary.FUZZY LOGIC AND GIS 117     The membership function must be a real valued function whose values are between 0 and 1.8 0.1 0 20 b c d 40 60 80  0    1  1  cos    2     A(x )   1  1   2  1  cos      0 U 100   xa x  a   a  x  b b  a  b x c x  c   c  x  d d  c  x d Figure 61.7 0. Linear membership function If a rounded shape of the membership function is more appropriate for our purpose we should choose a sinusoidal membership function (Figure 61).5 0. the class boundary should be represented by the crossover points.6 0.6 0. Membership Value 1 a 0. The membership values should be 1 at the center of the set.3 0.4 0. We know two types of membership functions: (i) linear membership functions and (ii) sinusoidal membership functions.. By choosing proper values for a .5 (crossover point) should be at the boundary of the crisp set. As with linear membership functions we can achieve S-shaped. and d . . Figure 60 shows the linear membership function.7 0. bell-shaped.e. triangular. c .9 0. Although this membership function is derived from probability theory.

Definition 90 (Height). there are alternate operations for union and intersection of fuzzy sets. In addition.4 Operations on Fuzzy Sets Operations on fuzzy sets are defined in a similar way as for crisp sets. not all rules for crisp set operations are also valid for fuzzy sets.118 THE MATHEMATICS OF GIS Membership Value 1 0.3 0. written as hgt( A) .6 0. Example 123. The support of the fuzzy set for short people (Example 121) is those persons who are shorter than 150cm.7 0.1 -20 -10 A ( x )  e 2  ( x  c )2 2 2 c 0 10 20 U Figure 62.8 0. The membership functions in Example 121 are linear functions with the following parameters: x  150  1 180  x  150  x  180 Short ( x)    30 x  180  0  x  150  0  x  150  150  x  175   Average ( x)   25  200  x 175  x  200  25  0 x  200  x  170  0  x  170  170  x  200 Tall ( x)    30 x  200  0  12. intersection. All elements of the universe X that have a membership value greater than zero for a fuzzy set A are called the support of A . Definition 89 (Support).2 0.5 0. Gaussian membership function Example 122. . However.9 0. and complement. Like for crisp sets we have subset. or supp( A)  { x  X |  A ( x )  0} . union. If hgt( A)  1 then the set is called normal.4 0. The height of a fuzzy set A is the largest membership value in A .

e. 2. 3. A fuzzy set A is included in a fuzzy set B (written as A  B ) if for every element of the universe the membership values for A are less than or equal to those of B . i. The height of the fuzzy sets Short.  A ( x )   B ( x ) . and Tall is 1.1 20 10 0 10 20 B A Figure 63.  A ( x )   B ( x )) The max-operator is a non-interactive operator in the sense that the membership values of both sets do not interact with each other. Membership Value 1 0.7 0. In fact. We can always normalize a fuzzy set by dividing all its membership values by the height of the set.FUZZY LOGIC AND GIS 119 Example 124.5 0. Two fuzzy sets A and B are equal (written as A  B ) if for all members of the universe X their membership values are equal. x  X .  A B ( x )  max(  A ( x ). The most common ones are presented here. Definition 93 (Union). Example 125.4 0. The two other operators are called interactive. Definition 91 (Equality)..  B ( x ))  A B ( x )   A ( x )   B ( x )   A ( x )   B ( x )  A B ( x )  min(1. one set could be completely ignored in a union operation when it is included in the other.2 0. Subsets in fuzzy sets are defined by fuzzy set inclusion. x  X . Definition 92 (Inclusion).9 0.6 0. They are all normal fuzzy sets. The union of two fuzzy sets A and B can be computed for all elements of the universe X by one of the three operators: 1. . Set inclusion For the union of two fuzzy sets we have more than one operator. because the membership value of the union is determined by the membership values of both sets.8 0. When we look at the graph of the membership functions a fuzzy set A will be included in fuzzy set B when the graph of A is completely covered by the graph of B (Figure 63). i.  A ( x )   B ( x ) . Average.3 0.e.. Figure 64 illustrates the union operators for the fuzzy sets Short and Average from Example 121.

7 0.6 0.3 0.2 0.4 0.9 0.1 Type 2 120 140 160 180 200 220 Type 3 1 0.4 0.5 0.3 0.6 0.5 0.9 0.5 0. Fuzzy set intersection .6 0.7 0. the two others are interactive operators as explained above.3 0.7 0.7 0.3 0.8 0.1 120 140 160 180 200 220 140 160 180 200 220 1 0.8 0.  B ( x ))  A B ( x )   A ( x )   B ( x )  A B ( x )  max(0. Figure 65 illustrates the intersection of the fuzzy sets Short and Average from Example 121.4 0. 2.120 THE MATHEMATICS OF GIS Type 1 1 0.6 0. Example 126.9 0.1 120 Type 3 1 0.3 0.3 0.6 0.9 0.8 0.5 0.4 0.5 0.9 0.  A B ( x )  min(  A ( x ).7 0.6 0.2 0.2 0. Type 1 1 0.9 0.8 0.1 120 140 160 180 200 220 Type 2 Figure 65. Fuzzy set union operators Definition 94 (Intersection).1 120 140 160 180 200 220 1 0.2 0.8 0.4 0.  A ( x )   B ( x )  1) The min-operator a non-interactive. 3.1 120 140 160 180 200 220 Figure 64. The intersection of two fuzzy sets A and B can be computed for all elements of the universe X by one of the three operators: 1.8 0.2 0.5 0.2 0.4 0.7 0.

Law of the excluded middle and law of contradiction for fuzzy set Average.5 0.3 0.4 0.2 0.9 0. 9.7 0. 2. A A 1 0.9 0.1 120 140 160 180 200 220 A A Figure 67.1 120 140 160 180 200 220 1 0. 7. 4. Figure 66 shows the fuzzy set Average from Example 121 and its complement. 10.  A ( x)  1   A ( x) .5 0.6 0. 1.9 0. Rules for set operations valid for crisp and fuzzy sets 1. Rules valid only for crisp sets Table 18 shows those rules that in general are valid for crisp sets but not for fuzzy sets. Table 17.3 0. 2. A A  X A A   law of the excluded middle law of contradiction Figure 67 illustrates that the law of the excluded middle and the law of contradiction does not generally hold for fuzzy sets.6 0. Fuzzy set and its complement Many rules for set operations are valid for both crisp and fuzzy sets.7 0.5 0. 8.1 120 140 160 180 200 220 Complement of Average 1 0.2 0.8 0.2 0.9 0. The complement of a fuzzy set A in the universe X is defined as x  X .7 0. 11.6 0.3 0.5 0.2 0.4 0.6 0.8 0. 6. Table 17 shows the rules that are valid for both.1 120 140 160 180 200 220 Figure 66. Example 127. Average 1 0.8 0.4 0.8 0. . 3.7 0. 5.FUZZY LOGIC AND GIS 121 Definition 95 (Complement).4 0.3 0. A A A A A A ( A  B)  C  A  ( B  C ) ( A  B)  C  A  ( B  C ) A B  B  A idempotent law associativity commutativity distributivity DE MORGAN’s law double complement A B  B A A  ( B  C )  ( A  B)  ( A  C ) A  ( B  C )  ( A  B)  ( A  C ) A B  A B A B  A B A A Table 18.

25 not( A) int(norm(plus A  not(very A))) Example 129. we can use  -level sets. A linguistic variable is a variable that assumes linguistic values which are words (linguistic terms). If. for example.5 Alpha-Cuts If we wish to know all those elements of the universe that belong to a fuzzy set and have at least a certain degree of membership. 12. 0. the linguistic values for height could be “short”. The 0. “not short”.122 THE MATHEMATICS OF GIS 12. These linguistic values possess a certain degree of uncertainty or vagueness that can be expressed by a membership function to a fuzzy set. or “more or less” and arrive at expressions such as “very tall”. Operators for hedges Operator Normalization Concentration Dilation Expression  ( x)  norm( A) ( x)  A hgt(  A ) 2 con( A) ( x)   A ( x) Negation Contrast intensification  dil( A) ( x)   A ( x)  not( A ) ( x )   A ( x )  1   A ( x ) int( A) ( x)   2  2 A ( x)  2 1  2(1   A ( x))  if  A ( x)  [0. A (weak)  -cut (or  -level set) A with 0    1 is the set of all elements of the universe such that A  { x  X |  A ( x )   } .8-cut of the fuzzy set Tall contains all those persons who are 194cm or taller. “average”. Often. . we have the linguistic variable “height”. Figure 68 shows the membership functions for Tall. Such modifiers are called hedges.6 Linguistic Variables and Hedges In mathematics variables usually assume numbers as values. Table 19. “somewhat”. “slightly”. With  -level sets we can identify those members of the universe that typically belong to a fuzzy set. or “somewhat average”. and “tall”. A strong  -cut A is defined as A  { x  X |  A ( x )   } . Very Tall. Example 128. we modify a linguistic term by adding words like “very”.5] otherwise The following Table 20 shows the models being used to represent hedges for linguistic terms. They can be expressed with operators applied to the fuzzy sets representing linguistic terms (see Table 19). Definition 96 (  -Cut). Table 20. Hedges and their models Hedge very A more or less A (fairly A ) plus A not A slightly A Operator con( A) dil( A) A1. and Very Very Tall.

7 Fuzzy Inference In binary logic we have only two possible values for a logical variable.7 0.6 0. Very Tall.3 0.8 0. 1 0.9 0. true or false. Membership functions for Tall. Figure 70 shows the membership functions for Tall and Slightly Tall.4 0.9 0. Membership function for Tall and Slightly Tall 12.4 0.4 0.2 0.5 0.8 0.5 0.5 0.FUZZY LOGIC AND GIS 123 1 0. Membership function for Tall and Not Very Tall Example 131.6 0. 1 0. many phenomena can be better represented by fuzzy .3 0.7 0.3 0. Figure 69 shows the membership functions for Tall and Not Very Tall. As we have seen in this chapter.9 0.8 0. 1 or 0.2 0.7 0.1 120 140 160 180 200 220 Slightly Tall Tall Figure 70.1 120 140 160 180 200 Tall Very Very Tall Very Tall 220 Figure 68.2 0.6 0.1 120 140 160 180 200 220 Not Very Tall Tall Figure 69. and Very Very Tall Example 130.

x and y are premise variables. we discuss the methods known as MAMDANI’S direct method. Let x0 and y0 be the input for the premise variables. B .27 If x is A and y is B then z is C premise consequence Figure 71. The procedure can be extended to this case without any problems. 1. A . the number of rules can be rather large. In fuzzy reasoning we use a generalized modus ponens which reads as Premise1: Premise2: Conclusion: If x is A then y is B x is A y is B  Here. We know several methods for fuzzy reasoning. z is the consequence variable. Consider the generalized modus ponens for temperature control: Premise1: Premise2: Conclusion: If the temperature is low then set the heater to high Temperature is very low Set the heater to very high With logic inference we normally have more than one rule. and B  are fuzzy sets where A and B  are not exactly the same as A and B . Example 132.7. 12. and C are fuzzy sets. A . . Inference rule in MAMDANI’s direct method The reasoning process is then straightforward according to the following procedure. y is B q1 : z is C  Premise1 becomes a set of rules as illustrated in Figure 71. B . Fuzzy sets can also be applied to reasoning when vague concepts are involved. Apply the input values to the premise variables for every rule and compute the minimum of  Ai ( x0 ) and  Bi ( y0 ) : 27 There can be more than two premise variables to express complex rules.1 MAMDANI’s Direct Method Here. In binary logic reasoning is based on either deduction (modus ponens) or induction (modus tollens). In fact.124 THE MATHEMATICS OF GIS sets than by crisp classes. A . It is based on a generalized modus ponens of the form  If x is A1 and y is B1 then z is C1 If x is A and y is B then z is C  2 2 2 p q:     If x is An and y is Bn then z is Cn  p1 : x is A.

They can be modeled as fuzzy sets (Figure 72). speed. C ( z ). Cut the membership function of the consequence  Ci ( z ) at mi : Conclusion of rule1: Conclusion of rule 2 : Conclusion of rule n : C ( z )  min(m1 . For practical reasons we need a definite value for the consequence variable. “high”. Given the speed of a car and the distance to a car in front of it. and “increase”. “low”.  B1 ( y0 )) m2  min(  A2 ( x0 ).  Bn ( y0 )) 2. C ( z )) z  C2 2 2  Cn ( z )  min(mn . One of the most common is the center of gravity (or center of area).. For a discrete fuzzy set the center of area is computed as z0   For a continuous fuzzy set this becomes C ( z )  z  C ( z ) z0    ( z )  zdz   ( z)dz C C Example 133. Assume the following set of rules for the given situation: Rule 1 Rule 2 Rule 3 Rule 4 If the distance between the cars is short and the speed is low then maintain speed If the distance between the cars is short and the speed is high then reduce speed If the distance between the cars is long and the speed is low then increase speed If the distance between the cars is long and the speed is high then maintain speed Distance. or accelerate. C ( z )) z  C1 1 1 C ( z )  min(m2 . . maintain the speed. C ( z )) 1 2 n The result of the final conclusion is a fuzzy set. Compute the final conclusion by determining the union of all individual conclusions from step 2:  C ( z )  max( C ( z ). and acceleration are linguistic variables with the values “short”.  B2 ( y0 ))  mn  min(  An ( x0 ). “maintain”. and “reduce”. The process to determine this value is called defuzzification. “long”. Cn ( z )) z  Cn 3. we would like to determine whether we should break.FUZZY LOGIC AND GIS 125 Rule1: Rule 2 : Rule n : m1  min(  A1 ( x0 ). There are several methods to defuzzify a given fuzzy set. respectively.

4 0.4 0.8 0.1 0 5 10 15 20 25 30 35 40 meters Speed 1 0.25 0.9 0.7 0.3 0.8 0.6 0.8 0. The final value after defuzzification is -5.25 Now we must cut the membership function for the conclusion variable at the minimum values from step 1.7 0.3 0. Fuzzy inference step 2 Finally.75 0.6 0.3 0.2 0.9 0.2 0.75 0.3 0.6 0.6 Short Long 0.7 0.1 0 10 Low High km 20 30 40 50 60 70 80 90 100 h Acceleration 1 0.25 0.6 0. Rule1 1 0. Fuzzy inference step 1 Rule 1 2 3 4 Short 0. Table 21.5 0.2 0.7 0.7 0.75 0.5 0. Fuzzy sets of the rules With a given distance x0  15 meters and a speed of y0  60 km/h we perform step 1.6 0.1 -20 -15 -10 -5 0 5 10 15 20 km h2 -15 -10 -5 0 5 10 15 20 km h2 Figure 73.9 0.9 0.126 THE MATHEMATICS OF GIS Distance 1 0.3 0.5 0. .25 0.4 0.2 0.75 Min 0.2 0. The results are shown in Table 21.5 0.4 0.2 0.3 0.1 -20 Rule4 1 0. The result is illustrated in Figure 73. The union of the four membership functions is displayed in Figure 74.8 0.1 -20 -15 -10 -5 0 5 10 15 20 km h2 Decrease Maintain Increase Figure 72.2 0.75 Long Low 0.25 0. then we have to break gently to reduce the speed.8 0.3 0.4 0.4 0.9 0.9 0.25 0.5 0.8 0.25 High 0.6 0.5 0. we must combine the individual membership functions from step 2 to the final result and defuzzify it.46 and is indicated by the blue dot.1 -20 Rule3 1 0.1 -20 -15 -10 -5 0 5 10 15 20 km h2 -15 -10 -5 0 5 10 15 20 km h2 Rule2 1 0.4 0.9 0.5 0.8 0. The conclusion of this fuzzy inference is that when the distance between the cars is 15 meters and the speed is 60 km/h.7 0.7 0.

Apply the input values to the premise variables for every rule and compute the minimum of  Ai ( x0 ) and  Bi ( y0 ) : .FUZZY LOGIC AND GIS FinalResult 1 0.7 0.3 0. The algorithm works as outlined in the following procedure procedure.4 0. The premise variables are fuzzy sets. y is B q1 : z is c Premise1 becomes a set of rules as illustrated in Figure 75.8 0.2 0. Fuzzy inference final result 12.2 Simplified Method Often. Let x0 and y0 be the input for the premise variables.9 0.6 0.7. 1. the conclusion is a real number (fuzzy singleton).1 -20 -15 -10 -5 0 5 10 15 20 km h2 127 Figure 74.5 0. It is based on a generalized modus ponens of the form:  If x is A1 and y is B1 then z is c1 If x is A and y is B then z is c  2 2 2 p q:     If x is An and y is Bn then z is cn  p1 : x is A. fuzzy singleton If x is A and y is B then z = c premise consequence Figure 75. An alternative approach is the simplified method where the conclusion is a real value c instead of a fuzzy set. Simplified Method The reasoning process is then straightforward in analogy to the previous method with the difference that the result is not a fuzzy set that needs to be defuzzified but be can compute the final result directly after step 2 in the algorithm. the defuzzification process is too time-consuming and complicated.

Given the slope and the aspect maps of a region and the following set of rules.4 0.8 0.4 0. The fuzzy sets for flat and steep slope are displayed in Figure 18 and Figure 19- Rule 1 Rule 2 Rule 3 Rule 4 If slope is flat and aspect is favorable then risk is 1 If slope is steep and aspect is favorable then risk is 2 If slope is flat and aspect is unfavorable then risk is 1 If slope is steep and aspect is unfavorable then risk is 4 Membership 1 0. we can conduct a risk analysis based on degrees of risk ranging from 1 (low risk) to 4 (very high risk).2 Aspect unfavorable 0 50 100 150 200 250 300 350 Figure 77. Compute the conclusion value per rule as: Conclusion of rule1: Conclusion of rule 2 : Conclusion of rulen : 3. For a slope of 10 percent and an aspect of 180 degrees we have the following results: .  B1 ( y0 )) m2  min(  A2 ( x0 ).2 Percent flat steep 0 10 20 30 40 Figure 76.6 0.128 THE MATHEMATICS OF GIS Rule1: Rule 2 : Rule n : m1  min(  A1 ( x0 ). Compute the final conclusion as:  c   n i 1 i n c i 1 mi Example 134. Membership functions for favorable and unfavorable aspect.  B2 ( y0 ))  mn  min(  An ( x0 ).  Bn ( y0 ))  c1  m1  c1  c2  m2  c2   cn  mn  cn 2.8 0.6 0. Membership functions for flat and steep slope favorable Membership 1 0.

4 0 0 For the final result we get c   0. 0. The following example illustrates how a fuzzy set can be computed from a given grid data set.8.5 0.2 Fuzzy Concepts Elevation is considered high when it is above 1. ArcMap Spatial Analyst.8.2  0  0 12.4  0  0  1.2 Aspect (a) 1 1 0 0 Min(s.4 0. all approaches are illustrated. In principle. or ArcView 3. Fuzzy logic has been applied for many areas in GIS such as fuzzy spatial analysis. there are several ways to solve the problem: we can use ArcInfo GRID. The grid involved is .8. 300    2    1 x  2000   1 0. In the following.5  0.5  0. Membership function for “high elevation” 12.000 topographic map sheet of Boulder. We can even create our own fuzzy logic tool using the scripting environment of the geoprocessor in ArcGIS 9.FUZZY LOGIC AND GIS 129 Rule1 Rule2 Rule3 Rule4 Slope (s) 0.5 0.x Spatial Analyst.6 0. Colorado 12. We represent the features meeting the criterion as a fuzzy set with a sinusoidal membership function (Figure 78) defined as  x  1700 0   1    x  1700    high elevation ( x)   1  cos     1700  x  2000 .a) 0.2 0 0 Conclusions 0.5 0.3 Software Approach The 1 : 24K DEM was downloaded from the USGS and imported into ArcGIS as a grid ELEVATION. 12.700 meters. and the representation of fuzzy boundaries. fuzzy reasoning.2 U 1600 1800 2000 2200 2400 Figure 78.8 Applications in GIS Many spatial phenomena are inherently fuzzy or vague or possess indeterminate boundaries.5 0.29 .1 Objective The objective of this analysis is to determine high elevation in the area covered by the 1 : 24.2 0.8 0. which means a low risk.

3. The fuzzy set w be a gri FELEVAT e will id TION whose values are between e zero and one. nd e d 12. 1 14159 * (el levation . on le 2000 0.COS(3.8.2 ArcMap Spatial Analy 2 yst To solv the problem we use th raster calc ve he culator of the Spatial An e nalyst. The following screen dum shows g mp how to u the Aven Con requ for comp use nue uest puting the fu uzzy set for high elevation h n.3 ArcView 3.1700) / 30 00)).COS(3.3.130 THE MATHEMA ATICS OF GIS ELEVA ATION.141 159 * (elev vation .8.17 700) / 300)) if (e elevation g 2000) fe gt elevation = 1 end We can also use the GRID CON command: N /* high elevation h n /* ==== =========== = /* felevat tion = con( (elevation le 1700. 1) 12. d 12.1 ArcInfo GR 1 RID To com mpute the fuz set we us an AML s zzy se script that is run from A ArcInfo GRID and the D DOCEL block: LL /* /* high elevation h n /* ==== =========== = /* docell if (e elevation l 1700) fe le elevation = 0 if (e elevation g 1700 & e gt elevation l 2000) ~ le fel levation = 0.5 * (1 .3. .x 3 3 If you d not have A do ArcGIS avai ilable.8.1 0. The f following screen d dump shows the comman to produce the required fuzzy set.5 * (1 . the sa ame results c be achiev by using requests can ved g in the ArcView GIS Spatial An A S nalyst map ca alculator. 0 elevatio gt 1700 & elevation ~ 0.

FUZZY LOG AND GIS GIC 131 12.3.4 ArcGIS 9 Script 4 S We hav written a P ve Python script that genera a fuzzy r ates raster data set from a giv input ven raster da set. This script is used here as a to in the ArcToolbox.8. ata d ool .

Rule 2: If the slope is moderate and the aspect is unfavorable and the snow cover change is big then the risk is moderate.9 Exercises Exercise 40 Determine a linear membership function for “moderate elevation” when the ideal elevation is between 400 and 600 meters. Analysis with a fuzzy logic approach (left) and a crisp approach (right) 12. The rules are given as: Rule 1: If the slope is very steep and the aspect is unfavorable and the snow cover change is big then the risk is very high. Choose suitable membership functions for the fuzzy terms. The variables involved are slope. snow cover change. For simplicity we do not consider surface cover. The snow cover change must be simulated.132 THE MATHEMATICS OF GIS 12. Exercise 41 Determine a Gaussian membership function for the aspect “south. and (vi) not in a park or military reservation. . The grid size has been set to 10 meters according to the grid cell size of the elevation model. Fuzzy set Crisp set Figure 79. Exercise 43 Design a simple fuzzy reasoning system for avalanche risk in the Rocky Mountains (Boulder. CO area). aspect.4 Result Figure 79 shows the result of the analysis with a fuzzy logic approach (left map) and a crisp approach (right map). Colorado and determine a suitable site with the following characteristics: (i) moderate slope (ii) favorable aspect (iii) moderate elevation (iv) near a lake or reservoir (v) not very close to a major road.8.000 digital topographic data set of Boulder.” Exercise 42 Use the 1:24.

Rule 4: If the slope is not steep and the aspect is unfavorable and the snow cover change is big then the risk is moderate.FUZZY LOGIC AND GIS 133 Rule 3: If the slope is steep and the aspect is unfavorable and the snow cover change is small then the risk is low. .

.

and are called real world phenomena. Everything that happens in the real world and that we process through our senses leads to models of reality that we create for ourselves. 135 .CHAPTER 13 Spatial Modeling W e live in a constantly changing world. This chapter deals with spatial modeling. which leads to mental models. learning. In our brains. we process the input from our senses. a process that maps aspects of the real world to abstract models. we agree on common principles and interpretations derived from experience. What we perceive with our senses are processes. We discuss fundamental principles of space and time and their bearing on GIS. states and events that happen or exist in the real world. Usually. cognition. They may be natural or man-made. research or learning that enable us to reach a consensus on the perception of real world phenomena. and knowledge.

“Everything flows” and “We cannot step into the same river twice” are attributed to him. This mathematical result was. however. The lead of the tortoise gets smaller and smaller. might disagree. Usually. we assume time to be of a continuous linear nature extending from the past. through the present into the future. He stated that everything flows. not known until the 17th century. PARMENIDES of Elea (southern Italy) developed a completely opposite philosophy of the non-existence of the void. the tortoise has moved on to another point.2 Concepts Of Space And Time Space and time are two closely related concepts that have been the subject of philosophical and scientific consideration since the dawn of mankind. Time is a measure for change in our immediate experience. it is impossible for ACHILLES to catch the tortoise29. ACHILLES must catch up an infinite number of (finite in length) leads. because ACHILLES would have to run infinitely far (or forever). One of ZENO’s famous “proofs” that change and movement cannot exist is known as the race between Achilles and the tortoise. something non-existent) does not exist. the tortoise already has moved on to point C. It is impossible to run this infinite number of short distances. Space and time (at least as we perceive them) are so well known and appear to be given beyond any doubt that we hardly ever contemplate their structure and characteristics in our everyday lives. PARMENIDES’ ideas were further developed and “proven” by his student ZENO.. He postulates (through deductive reasoning) that change does not exist and that the real world (the real being) is plenum (a solid complete compact being). this is the space that is illustrative and that we perceive as being real28. we end up with a paradox. When ACHILLES reaches point B. immutable. in our case the point where ACHILLES passes the tortoise.e.. without change and eternal. whereas ACHILLES starts from point A. and so on. 29 28 . i. i. The solution of the paradox lies in the fact that an infinite series can converge to a finite value. This proves that the assumption Human geographers.1 Pre-Newtonian Concepts Of Space And Time The concepts of space and time of this epoch are mainly dominated by the ideas of Greek philosophers about the logical conditions for things to change and the structure of the world in which change occurs. of course. i. Of all possible physical and mathematical spaces. and (iii) contemporary concepts of space and time. At about the same time. When ACHILLES reaches point C. Therefore. we need clear and well-understood models of space and time. A void (or empty space.e. The tortoise gets a head-start and begins the race at point B.2. What we perceive as change is a delusion of our senses.SPATIAL MODELING 137 13. nothing remains. ad infinitum. When we deal with information systems that process and manipulate spatiotemporal features. The space that humans live in is the three-dimensional (Euclidean) space as a frame of reference for our senses of touch and sight. and the only thing that really exists is change (processes).e. HERACLITUS (around 500 BC) of Ephesos (western Turkey) studied the problem of change. how can the identity of things be preserved when they change. 13. (ii) the Newtonian and classical concepts. We get an infinite number of (smaller and smaller) leads. We discuss them according to three epochs: (i) pre-Newtonian concepts.. The argument is now: In order to reach the tortoise. The following sections describe how concepts of space and time developed in Western philosophy and physics. Since we can easily catch a tortoise when we would run against it.

the container of all things. movement and change are impossible. empty space is impossible. solids (see Figure 80) that in turn are made from triangles. Atoms are indivisible real things. Its structure is fixed and invariable. The importance of the Atomist theory is evident in today’s modern particle physics.2. Each element is made of particles. and relations are abstracted from them. Space is a property of things or things have spatial properties. 13. this is considered the space as described by the Euclidean geometry. An atom is a plenum. The great philosopher PLATO (427–347 BC) and one member of his school. . Earth cannot be transformed. Space is defined as the limit of the surrounding body towards what is surrounded. According to his ideas. and have different size and weight. and the ratios between numbers. EUCLID (at 300 BC). Space is a system of relations.e. Matter consists of four elements: earth. It is the set of all material things. and that geometry is not a description of the world but yet another formal mathematical system with no necessary reference to real world phenomena. and time is the measure of motion with regard to what is earlier and later. It is an absolute real entity. laid the foundation for a new geometric modeling of the real world. Therefore. Transformations between the elements fire. The discovery of irrational numbers such as 2 (the length of the diagonal in the unit square) shook the foundation of Greek mathematics that was based on counting in natural units.. DEMOCRITUS (460–370 BC) did not accept the non-existence of change as postulated by PARMENIDES. Greek mathematics was strongly dominated by the Pythagorean number theoretic approach. Relative space. and water. air. Tetrahedron (fire) Octahedron (air) Icosahedron (water) Cube (earth) Figure 80. Following from this approach space can be conceptualized in two possible ways: Absolute space. leads to contradictions. Space as a set of places.2 Classical Concepts Of Space And Time The time between the classical Greek period and the rise of modern science was dominated by the philosophy and teaching of ARISTOTLE (384–322 BC). This geometric model of matter is based on right triangles as atoms and solids built from these triangles. Objects are formed as a collection of atoms. Space is an absolute and empty entity existing independently from the atoms that fill the space. fire. Platonic solids as building blocks of matter In his book The Elements. air and water are possible through geometric transformations. The need for a truly geometrical description of the world became apparent. counting.138 THE MATHEMATICS OF GIS that movement and change are real. There is no empty space within atoms. some of them non-Euclidean. EUCLID developed a mathematical theory of geometry that remained valid until the late 19th century. It was essentially arithmetic based on (philosophical) properties of numbers. they are immutable and eternal. i. Generally. Euclidean geometry was considered a true description of our physical world until it was discovered that many consistent geometric systems are possible.

. Geographic information system technology is used to manipulate objects in geographic space. a material existence of space is strongly supported by these theories. Johannes KEPLER (mathematical foundation of the heliocentric system). Physical geographic space is the space of topographic. Immanuel KANT (1724–1804). 13. although it strictly contradicts his dynamics theory. yet in a far more elaborate and sophisticated way than the previous philosophical approaches. or tabletop space.4 Concepts Of Space And Time In Spatial Information Systems Spatial information is always related to geographic space. Gottfried Wilhelm LEIBNIZ (1646–1716) on the other hand sustained the concept of relative space. This is the space beyond the human body. influenced by language and cultural background. As a consequence of the special and general theory of relativity by Albert EINSTEIN (1879–1955). i. In other words. cadastral. The concept of absolute space remained dominant until the late 19th century. The human understanding of space. large-scale space. We speak of space-time. he was an outspoken proponent of the concept of absolute space. space and time cannot anymore be considered as two separate entities. which is considered a four-dimensional space that can only be described by non-Euclidean geometry. One of the greatest philosophers. but used by us to relate and order observations of the real world. and to acquire knowledge from spatial facts.2. It has become evident that the space of our perception is not necessarily identical with the microscopic (sub-atomic) space or the space of cosmic dimensions. claimed that space and time are not empirical physical objects or events.e. and other features of the geographic world. Within such space. not developed by experience. theory of relativity.3 Contemporary Concepts Of Space And Time The development of modern physics (field theories. KANT can be seen as a proponent of absolute space. In his philosophy. Geographic space is distinct from small-scale space. and we conceptualize it in different ways. 13. objects that can be moved around on a tabletop. space that represents the surrounding geographic world. objects that are smaller than us. space is a system of relationships between things. Quantum mechanics states the principle of uncertainty and the discrete character of matter and energy. and Galileo GALILEI (foundations of mechanics) in the 16th and 17th centuries. Isaac NEWTON (1643 – 1727) was a brilliant scientist (dynamic theory) and philosopher. Therefore. The field theories (Michael FARADAY and James Clerk MAXWELL) lead to the assumption that space is not empty.. quantum theory) and mathematics (non-Euclidean geometries) lead to the conclusion that traditional Euclidean geometry (describing the three-dimensional space of our perception) is only an approximation to the real nature of the world. It is interesting to note that both NEWTON and LEIBNIZ are the founders of mathematical calculus.2. belong to small-scale space and are not subject of our interest.SPATIAL MODELING 139 The rise of modern science took shape in the works of Nikolaus COPERNICUS (heliocentric system stating that the sun is the center of our planetary system). We cannot know anything about the things as such. we navigate in it. In this regard. For him. plays an important role in how we design and use tools for the processing of spatial data. They are merely a priori true intuitions. we move around. Space and time have empirical reality (they are absolute and a priori given) and transcendental idealism (they belong to our conceptions of things but are not part of the things). but is filled with energy.

The only difference is that the former is a model of something that exists in the real world and the latter is a model of something that exists only in a virtual (physically non-existent) world. on the other hand. The accuracy of the primary data. Map sheets have physical boundaries.140 THE MATHEMATICS OF GIS In the same way as spatial information is always related to geographic space. Maps have proven to be extremely useful models of reality for many applications in various domains.3. We distinguish between topographic and thematic maps. and features spanning two map sheets have to be cut into pieces.e. they are usually drawn on paper or other permanent material and function as data storage and visualization medium. store. The most common of these models are—in historic sequence—maps and databases. There is no difference between real and virtual world models with regard to their representation.3 The Real World And Its Models As mentioned in the previous sections we always create models of the real world in our minds.1 Maps The best known (conventional) models of the real world are maps. 13. through the Roman times. we can visualize them. Both have distinct characteristics. Other cartographic products that are not maps are often used to represent three-dimensional and dynamic phenomena. measured and stored in information systems. Today. A map is always a graphic representation at a certain level of detail. which is determined by the scale. The smaller the scale. the less detail a map can show.. store. i. puts limits to the scale in which a map sensibly can be drawn. databases can be used to represent real and virtual worlds. Real worlds are subsets of the reality that we perceive. we use other media and means than just interpersonal communication. navigate through them and perceive them as “real” (therefore the term virtual reality). analyze. animations. for instance. We need representations of our mind models. Their conception and design has developed into an art and science with a high degree of scientific sophistication and artistic craftsmanship. . advantages and disadvantages. Maps have been used for thousands of years to represent information about the real world. visualize. We know maps from ancient Mesopotamia and Egypt. models of the real world that can be used to acquire. Virtual worlds are computer generated “realities” that exist only as potentialities with no counterpart in the real world. but more in the observable spatiotemporal effects that can be described. it relates to the time whose effects we observe in the changing geographic world around us. and exchange information about the real world. A disadvantage of maps is that they are restricted to two-dimensional static representations. Whereas maps usually have been used to picture real world phenomena. Yet. When we want to acquire. maps are two-dimensional (flat) and static. The process to derive less detailed representations from a detailed one is called map generalization (or cartographic generalization). It is not easy to visualize threedimensional dynamic features without considerable abstractions in the spatial and temporal domain. We are less interested in pure philosophical or physical considerations about time or space-time. Such products are. The selection of a proper map scale is one of the first and most important steps in a map conception. The map scale determines the spatial resolution of the graphic feature representation. analyze and transfer information about real world data. and that they always are displayed in a given scale. the Medieval Ages until the present. Yet. block diagrams. and panoramic views. 13.

or soil database. thematic and temporal attributes. If the coordinates are given in units other than geographic coordinates. The representations of spatial phenomena (i. that scale plays a role when data are captured from maps as data source. cadastral. meters. a cadastral administration. A language that we use to define the database is called a data model. The data model used at the level closest to the end-users is called a conceptual data model. to store map data into a database instead of primary data means to create the model of a model. Increasingly. and what their relationships are. the scale of the source map determines the accuracy of the feature coordinates in the database. It is important to note that whenever we speak about cartography today. information concerning the spatial reference system should also be present. It can be compared to a story written in a language that is the data model. Scaleless means that all coordinates are world coordinates given in units that are normally used to reference features in the real world (geographic coordinates. or a landslide hazard analysis system. What remains is the visualization function of maps. relationship type to define relationships between entities. Here. From there. We observe this also in the scientific literature of that time. for example.e. however. Phenomena are classified into thematic layers depending on the purpose of the database. In the design of a database. It must be noted.3. The role of the map changed accordingly.4. The use of computers in map making is an integral part of modern cartography. The intention is to define which concepts of interest exist in the application domain for which a database is being designed. With the advent of computer systems. spatial features) are stored in a scaleless and seamless manner. A commonly used conceptual data model is the entity-relationship (ER) model. They are also called GIS databases or geodatabases. it uses primitives like entity type to describe independently existing entities. This is usually described by a qualification of the database as. clear and understandable representations for our use. In short.SPATIAL MODELING 141 Cartography as the science and art of map making functions as an interpreter. In our context. All phenomena have various relationships among each other and possess spatial (geometric). we see that originally maps were considered the main data source for GIS databases. each level typically has its own data model. Such a definition identifies the types of things relevant for a particular application. we distinguish between three different levels of definition. analog cartography became digital cartography. land use. .1. To transfer the contents of a map into a computer database was the major goal. Maps also become a data source for other maps. data models will be discussed in Section 13. The terms “map data model” and “map data structure” were widely used. for example. This role is taken over by databases. maps lose their role as data storage.. It was not clearly understood that we actually want to store representations of real world phenomena (primary data) and not map data (secondary data). it is used for spatial data modeling. and attributes to describe characteristic values of entities and relationships.2 Databases Spatial databases store representations of spatial phenomena in the real world to be used in a geographic information system.or three-dimensional Euclidean space. Likewise. The complete database definition is called the (conceptual) database schema. topographic. feet). The assumption for the design of a spatial database schema is that spatial phenomena exist in a two. 13. translating real world phenomena (primary data) into correct. When we look back into the history of digital cartography and geographic information systems. the accuracy of measurements in field surveys determines the quality of the data. more implementation-oriented. Other. we implicitly assume digital cartography. calculations can be easily performed and any (useful) scale can be chosen for visualization.

A modeling language for a GIS database is a spatial data model. and to combine data from different layers (spatial join or overlay).e. the term ‘fourdimensional’ only makes sense when we always would consider three spatial dimensions. giving the impression that time is the fourth dimension in addition to the three spatial dimensions. In this sense. Structure preserving means that the elements of the co-domain (spatial features) behave in the same (however simplified or abstracted) way as the elements of the domain (spatial phenomena)..3 Space And Time In Real World Models In modern physics. it is common to speak of space-time to express the close connection that exists between space and time according to the special and general theory of relativity. however. and the co-domain is a real world model. the spatial data model only considers two dimensions. Here. In general. In most of the cases.142 THE MATHEMATICS OF GIS A seamless database does not show map sheet boundaries or other partitions of the geographic space other than imposed by the spatial features themselves. sometimes called a digital landscape model (DLM).4 Real World Models And Their Representation Spatial data are computer representations of spatial features. we do not consider the physical characteristics of space and time. All phenomena exist in this space and undergo changes. Various spatial. Domain (Real World) Co-domain (Real World Model) Spatial phenomena Morphism Spatial features Figure 81. we consider space to be the three-dimensional Euclidean space of our common sense. In our case. better to call it spatiotemporal instead of four-dimensional. Figure 81 illustrates the principle of spatial modeling. It is used in the design of spatial databases. We call a spatial data model that also considers time a spatiotemporal data model. Spatiotemporal databases consider not only the spatial and thematic but also the temporal extent of the features they represent. 13. Secondly. modeling can be described as creating a structure preserving mapping (morphism) from a domain to a co-domain. but the (simplified) ways of representing spatial phenomena in a GIS database.3. generalized) image of the original. It is. time is not of the same type as the spatial dimensions. it has a distinct different quality. Spatial modeling is a structure preserving mapping from the real world to a spatial model. It is easy to query a database. temporal and spatiotemporal data models have been developed. which we perceive as the passing of time. A spatial database holds a digital representation of the real world. however. . abstracted. As mentioned above. Such a mapping normally creates a ‘smaller’ (i. the domain is the real world. Sometimes such a model is addressed as four-dimensional. time is modeled indirectly as changes in (spatial or thematic) attributes of the features. First. 13.

Data mod deling from th real world t a database ( he to (digital landsc cape model). a from and there to di igital cartograp models a analogue p phic and products for v visualization We are particularly interested in properties of the geom n metric space that remain invariant formations. Th hese propertie are related to topology es d y. DLM). there creating a digital land al eby dscape mode From the database (D el. formation of a representa f ation from a detailed to a less detailed version d is called model gene d eralization. A schema is a representa s ation of the d database as d described p ata This approac is called the ANSI/SP ch t PARC archit tecture. Figure 82. of the fe Some fe features possess a degree of uncertai e inty in either their thema or spatia extent. r atic al For exa ample. This is differ from cartographic generalization where a rent n graphic representati (digital or analog) at a smaller sc is derive from a la ion o cale ed arge-scale er erely graphic constraints. Several spatio ed.4. Figure 82 shows the d . propose 13. data set or map unde certain me se is p first. The result of every ph hase is a schema of the respe ective level. the database is filled s. it with a particular da model. the dat tabase is des signed by d defining a Databas creation i a two-step process: f database schema tha identifies t e at types but no occurrences Secondly. . e with rea data. Th carry tem hey mporal chara acteristics ust otemporal da models h ata have been that data models mu be able to handle.1 D Database D Design The des sign of a da atabase cons sists of seve eral phases. A good data m o model should allow for m d multiple repr resentations o spatial of features The transf s. This is impo T ortant to guar rantee a con nsistent repre esentation under certain transfo eatures in a d database. gic the Spatial data exist no only in sp ot pace but also in time. We have to dev proper means to e vise take car of these un re ncertainties in our spatial data models Fuzzy log provides t tools. we derive graphic repre g esentations in digital or analogue for (cartogra rm aphic model) that can ) result in a cartograp n phic product. soil types do n have cr not risp boundar ries. Th feature ial he space fo a spatial d or database is a geometric space in wh hich we model features a various at levels of detail. c . Lingu uistic expres ssions of vaguene or uncert ess tainty such as “moderate slope” or “c close to Vien nna” are often a better n analysis approach th clear cu class boun s han ut ndaries. l s.SPATIAL MO ODELING 143 A DLM is the basi for spatial analysis an manipulat M is l nd tion of spati data. different aspe of data m ects modeling for data abase and car rtographic de esign. T compris four level ses ls.

144

THE MATHEMATICS OF GIS

A database is generally thought to serve multiple users or user groups. They may have different perceptions of the data stored. At this level, each user (group) is supported with its own external view of the database. We may define an external view as a personalized conceptual database schema. There will be as many external views as there are users and user groups. Mainly domain experts do spatial modeling at this level. All external views are merged into a single conceptual schema of the database. This is usually done with high-level semantic data models such as the entity-relationship model (ER model), the extended ER model (EER), or object-oriented data models. The basic constructs of the ER model are entity types (e.g., country), attribute types (e.g., population) and relationship types (e.g., neighbor of). Instances of the types populate the database, e.g., ‘Austria’, ‘8 million’, and ‘Germany, Switzerland’ are instances of the entity type ‘country’, the attribute type ‘population’, and the relationship type ‘neighbor of’, respectively. A conceptual schema is implementation-independent and not related to any particular database management software. It provides an answer to the question what phenomena are represented in the database. The conceptual schema is translated into a logical schema using one of the logical data models. Currently, the most popular one is the relational data model, which is based on relational algebra. Most commercial database implementations provide support for this model. It is easy to understand because it is based on relations—sets of records—that have a straightforward implementation as tables. The logical schema is meant to provide the definition of a redundancy-free data set. A physical schema is the result of the implementation of the logical schema with particular database management software. Table 22 summarizes the ANSI/SPARC architecture.
Table 22. Data models and schemas in database design (the ANSI/SPARC architecture)
Schema External views Models used to derive the schema Depending on different user perspectives, a subset of the real world is defined and described (spatial modeling). A synthesis of external views to create a conceptual schema making use of semantic data modeling techniques such as the entity-relationship approach. Transformation of the conceptual schema into a logical schema using the relational model. Emphasis is on redundancy removal. This is the mapping of the logical schema into data structures and algorithms. It is normally not accessible or visible to the user. Its emphasis is on processing speed.

Conceptual schema

Logical schema

Physical schema

13.4.2 Spatial Data Models

Among spatial data models, we can distinguish two major types, field- and object-based models. Field-based models consider spatial phenomena to be of a continuous nature where in every point in space a value of the field can be determined. Examples of such phenomena are temperature, barometric pressure, or elevation. Object-based models consider space to be populated by well distinguishable, discrete, bounded objects with the space between objects potentially being empty. Examples are a cadastre with clearly identifiable objects like parcels and buildings. Field versus object can be viewed as a manifestation of the philosophical conception of plenum versus atomic space (see Section 13.2.1), or as in modern physics, wave versus particle (see Section 13.2.3). In GIS, fields are usually implemented with a tessellation approach, objects with a (topological) vector approach. The following sections briefly illustrate the two different model types.

SPATIAL MODELING

145

13.4.2.1 Field-based Models

The underlying space for a field-based model is usually taken as the two- or threedimensional Euclidean space. A field is a computable function from a geometrically bounded set of positions (in 2D or 3D) to some attribute domain. Computable means that for every position within the geometric bounds a value can be determined by either measurement or by computation. A field-based model consists of a finite collection of such fields (Figure 83).
Layer 1 Layer 2

Figure 83. Two data layers in a field-based model

Fields can be discrete, continuous and differentiable. Discrete fields represent features with boundaries; continuous fields are used for features where the underlying function is continuous, such as for temperature, barometric pressure or elevation. If the field function is differentiable, we can even compute the slope at every position. Though geometrically bounded, the domain of a field is still an infinite set of positions. Computers cannot easily represent field values for all these positions, so we must accept an approximation. The standard way to obtain this is to finitely represent the geometrically bounded space through a subdivision into a regular or irregular tessellation, consisting either of square (cubic) or triangular (tetrahedral) parts. These individual parts are called locations; points often approximate them. Our finite approximation of positions into locations leads so some forms of interpolation. The field value at a location can be interpreted as one for the whole tessellation cell, in which case the field is discrete, not continuous or even differentiable. Some convention is needed to state which value prevails on cell boundaries; with square cells, this convention often says that lower and left boundaries belong to the cell. Another option is to interpret the field value at a location as representative only for some position within the cell. Again that position is fixed by convention, and may be the cell centroid or, for instance, its left lower corner. Field values for positions other than these must be computed through some form of interpolation function, which will use one or more nearby field values to compute the value at the requested position. This allows representing continuous, even differentiable, functions. To represent spatial features using a field-based approach we have to perform the following steps: 1. Define or use a suitable model for the underlying space (tessellation). 2. Find suitable domains for the attributes. 3. Sample the phenomena at the locations of the tessellation to construct the spatial field functions. 4. Perform analysis, i.e., compute with the spatial field functions.

146

THE MATHEMATICS OF GIS

13.4.2.2 Object-based Models

Object-based models decompose the underlying space into identifiable, describable objects that have spatial, thematic, and temporal attributes, as well as relationships among each other (Figure 84). The space outside the objects is empty. Examples of objects are buildings, cities, towns, districts or countries; attributes are, for instance, the number of floors, population, boundary or area. In a GIS database implementation, objects are represented as a structured collection of geometric primitives (points, lines, polygons, and volumes) under geometric, thematic and topological constraints. Object-based models are discrete models. Operations in the model always refer to the manipulation of individual objects or sets of objects. Manipulations concern the spatial, thematic, topological or temporal domain. Accordingly, they are realized through geometric, attribute manipulation or topological operations.
Layer 1

Layer 2

Figure 84. Layers in an object based model

Topology plays a major role in object-based models. It is the ‘language’ that allows us to specify and enforce consistency constraints for spatial databases. The majority of objectbased models are two-dimensional. Recently, three-dimensional data models have been proposed. Their topology is more difficult to handle than in the standard twodimensional cases.
13.4.3 Spatiotemporal Data Models

Beside geometric, thematic and topological properties, spatial data possess also temporal characteristics. It is, for instance, interesting to know who were the owners of a land parcel in 1980, or how did land use of a given piece of land change over the last 20 years. Spatiotemporal data models are data models that can also handle temporal information in spatial data. Several models have been proposed. The most important ones will be discussed briefly. Before we describe the major characteristics of the spatiotemporal data models, we need a framework to describe the nature of time itself. Time can be characterized according to the following properties:
Time density. Time can be discrete or continuous. Discrete time is composed of discrete elements (seconds, minutes, hours, days, months, or years). In continuous time, for two points in time, there is always another point in between. We can also structure time by events (points in time) or states (time intervals). When we represent states by intervals bounded by nodes (events) we can derive temporal relationships between events and states such as “before”, “overlap”, “after”, etc. Dimensionality of time. Valid time (or world time) is the time when an event really happened. Transaction time (or database time) is the time when the event was recorded in the database.

In cadastral applications.4. for instance. Here. “last year”. time granularity can be a day. The attribute domain is kept fixed and the spatial domain variable. we have to store a layer and assign the time to it as an attribute. We know also branching time (possible scenarios from a certain point in time onwards) and cyclic time (repeating cycles such as seasons or days of a week). 13. Time can be represented as absolute (fixed time) or relative (implied time). It supports only valid time and multiple granularity. and weather forecasting.m. Granularity is the precision of a time value in a database (e. branching and cyclic time. For every point in time that we would like to consider. with two of the applications being traffic control and mobile telephony. discrete time. Relative time is indicated relative to other points in time (e. we can keep the spatial domain fixed and look only at the attribute changes over time for a given location in space. A chronon is the shortest non-decomposable unit of time that is supported by a database (e.g. It supports only valid time. second. and into the future. be interested how land cover changed for a given location or how the land use changed for a given land parcel over time. When does a change or movement cause an object to disappear and become a new one? In the following. thereby creating an incrementally . But many more applications are on the horizon: think of wildlife tracking. we can keep the attribute domain fixed and consider the spatial changes over time for a given thematic attribute. time granularity is more likely in the order of thousands of years. month. and these are a subject of current research.2 Snapshot Model In the snapshot model. the problem of object identity becomes apparent. In this case. “6 July 1999 at 11:15 p. we consider changes of spatial and thematic attributes over time. Time reference..” which are all relative to “now”. extending from the past to the present. Different applications require different granularity.). etc.. In data analysis.3. The traces of objects through time create a worm-like trajectory in the space-time cube..3. This actually leads to notions of object motion.1 Space-Time Cube Model This model is based on a two-dimensional space (spanned by the x.g.). “tomorrow. we can assume both the spatial and attribute domain variable and consider how an object changed over time. or “two weeks later. “yesterday”. absolute. Every change of features that happens later is projected onto the initial plane and intersected with the existing features. layers of the same theme are time-stamped. We would. a millisecond). Time can be linear. In spatiotemporal data models. This model potentially allows absolute.g.4.”). The life span of an object is measured by a (finite) number of chronons.g. Absolute time marks points on the timeline where events happen (e. Finally. provided its boundary did not change.3 Space-Time Composite Model The space-time composite model starts with a two-dimensional situation (plane or layer) at a given start time.and y-axis) whose features are traced through time (along the z-axis) thereby creating a space-time cube.. day. On the other hand. The spatial domain is fixed (field-based) and the attribute domain is variable. disease control.4. linear. We do not have any information about the events that caused different states between layers.” which may be relative to an arbitrary point in time. continuous.SPATIAL MODELING 147 Time order. we could be interested to see which locations were covered by forest over a given period. in geological mapping.3. we describe the major characteristics of some popular spatiotemporal models. 13. Measures of time. This model is based on a linear. 13. year.

These representations are abstractions according to selected spatial data models.4. discrete. linear. To sensibly work with these systems. The space-time composite model is based on linear. and spatial databases. We know two major approaches to spatial data modeling. Topology provides us with the mathematical tools to define and enforce consistency constraints for spatial databases. 13. Spatial data not only possess spatial and thematic attributes. An understanding of the principle concepts of space and time rooted in philosophy. field-based and object-based models. the function of maps as data storage (map as a database) is increasingly taken over by spatial databases. thematic and temporal dimensions of real world phenomena. supports only valid time and multiple granularity. It supports both valid and transaction time. The spatial and thematic attribute domains are secondary. The model is based on discrete. and supports valid and transaction time as well as multiple granularity. we store representations of phenomena in the real world. thus leading to what is called spatiotemporal data models. we start with an initial state and record events (changes) along the time line. Consistency is an important requirement for every model. the analogue map approach. relative time. linear time. relative time.5 Spatiotemporal Object Model This model is based on spatio-temporal objects (ST-objects) that are a complex of STatoms (STA).4.3.5 Summary Geographical information systems process spatial information. and multiple granularity. 13.148 THE MATHEMATICS OF GIS built polygon mesh. Both have their merits. Whenever a change occurs. Every polygon in this mesh has its attribute history stored with it. and to derive a formal framework for spatial relationships among spatial objects. 13. In databases. we need models of spatial information as a framework for database design. . advantages and disadvantages for particular applications.4 Event-based Model In an event-based model. physics and mathematics is a necessary prerequisite to develop and use spatial data models. The information is derived from spatial data in a database. but extend also into the temporal domain. It keeps the attribute domain fixed and the spatial domain variable. This is a time-based model.3. A model of time for spatial information is an important ingredient for any spatial data model. Today. These models address the spatial. We know two fundamental approaches to spatial data modeling. an entry is recorded. absolute. The model is based on discrete. Both objects and atoms have a spatial and a temporal extent.

For many of the problems a detailed solution is given.CHAPTER 14 Solutions of Exercises T his section contains solutions of the exercises mentioned in the text. The reader is advised to first try to solve the problems him/herself before consulting this section. 149 . for some only the results are mentioned.

Exercise 20 f is not a function because 2 has more than one value! g is not a function because not all elements of the domain appear in the relation! h is a function! The fact that <2. d .4> is in f but not <4.1> appears twice does not change the set of pairs.1> and <1.  a . d . g is not symmetric because <3. (b) (1. g is transitive. b .-5). {c}. f is not transitive because <2. a . B  C  {a. R1 R 2  { a. g} .1> in h but not <1.2>. {a}.21) Exercise 27 Exercise 28 7 Chapter 8 Exercise 31 Both algebras are commutative groups. ( B  C )  {{}. C  A  {a. e.  b. c} .2. d } .4> in h but not <2. d } . d } .4>. c. R12  { a.2> in f but not <2. {a. c } Exercise 21 Exercise 22 f ( x  h)  f ( x) ( x  h) 2  3( x  h)  2  ( x 2  3 x  2)   h h x 2  2 xh  h 2  3 x  3h  2  x 2  3 x  2 2 xh  h 2  3h   2x  h  3 h h Chapter 7 Exercise 24 Exercise 26 (a) (11. f .150 THE MATHEMATICS OF GIS Chapter 2 Chapter 3 Chapter 4 Chapter 5 Exercise 16 B  C  {b. Furthermore.  b.1> in g but not <1. h is not transitive because <2. (c) (7. c .14. therefore bijective.1>.  a .3>.1. d }  C . 3 R2  { b.-9).3> and <3. c}} Chapter 6 Exercise 19 f is not symmetric because <1. we . h is not symmetric because <2.2>. This can easily be verified by the usual laws for addition and negative numbers. The function f ( x)  2 x is surjective (all even numbers appear as values) and injective (distinct arguments produce distinct values). R 2 R1  { b.

({A. ({C}*)* = {C}.B.D}. ({B}*)* = {B.B.D}.C}*)* = {A.C.C. ({ }*)* = {} This gives the following poset ordered by set inclusion and after the mapping of corresponding elements and renaming the universe: .D}.D}*)* = {A. therefore 1 odd + odd = even. ({D}*)* = {D}. we distinguish between four cases for a  b . Because the function is surjective. ({B.D}*)* = {A.C. therefore 1 odd + even = odd. ({A.C}. it cannot be an isomorphism! To prove that the function maps the binary operation properly.D}*)* = {A.D}.C. Chapter 9 Chapter 10 Exercise 35 The order diagram of the poset looks like A B C D The normal completion lattice is built as follows: ({A}*)* = {A. because 0 is even. ({C. T  F  F T T  F  F T (T  F )  T  T  ( F  T ) (T  F )  T  T  ( F  T ) T  ( F  T )  (T  F )  (T  T ) T  ( F  T )  (T  F )  (T  T ) T F T FF F T T  T F T  F T  T  T  F  T F  F  F  T  T T  T  T  F  F F  F  F  T  F Exercise 33 The function is surjective and maps every element of I to B. ({A.D}.D}*)* = {A.D}*)* = {A.B.B.B. ({A. f (0)  2  0  0 .B. ({A.C.D}.B. ({B. b  I a even even odd odd b even odd even odd f(a+b) with + as usual even + even = even.C. therefore 0 f(a) 0 0 1 1 f(b) 0 1 0 1 f(a)+f(b) with + as defined in the operation table 0 1 1 0 To prove that the unary operation maps correctly.B.SOLUTIONS OF EXERCISES 151 have that f (a  b)  2(a  b)  2a  2b  f (a)  f (b) .D}.C}*)* = {A.C. ({B.C}.B. ({A. Therefore the function is an isomorphism! Exercise 32 This can be easily verified by substituting T and F into the axioms for a Boolean algebra and applying the rules for logical operators. with a.D}. f (a)  2(a)  2a   f (a) .D}*)* = {B.C.C. ({A. we show that f(-even) = -f(even) = -0 = 0 and f(odd) = -f(odd) = -(1) = 1.D}. The constant maps as f(0) = 0.C.B.D}*)* = {A.D}.C}*)* = {A.C.D}.B.C.B.B}*)* = {A. therefore 0 even + odd = odd.

C.D} A U B {C} {} {D} C {} D Chapter 11 Chapter 12 .D} {A.C} {B.152 THE MATHEMATICS OF GIS {A.B.

F. Geographic Information Systems for Geoscientists: Modelling with GIS. Prade H. London. Dubois D. Pergamon. London. Academic Press. Kidlington. The Netherlands.J. Ltd. 1996.. ISBN 90 6266 128 9.. Burrough P. Singapore..B. J. 1996. Berlin.A.A. Leung Y. The Netherlands. Second Edition.A. The Elements of Logic. Heidelberg 153 . 1983. Discrete and Combinatorial Mathematics. Cobb M. Topological Principles in Cartography. Addison-Wesley Publishing Company.. 7. 215–229.C.A.A. Berlin. Geographic Objects with Indeterminate Boundaries. H. Logical Consistency.E. London. Technical paper – Bureau of the Census. Kainz W. GISDATA II. PhD thesis. 1995. ISBN 90 6266 134 3. Taylor & Francis. Egenhofer M.. (Eds. Fuzzy Logic in Geology. San Diego... Corbett.A.. Robinson V. Vol.. 2000. Elsevier Science. 1989. Elsevier Science (USA). Modeling Spatial Relations and Operations with Partially Ordered Sets. Greasley I. M. Klir G.. Morrison (eds.P. 1989. Fuzzy Modeling with Spatial Information for Geographic Problems. 1997.A.. Frank A. (Eds. McDonnell R. In: S.U.. 1998. Guptill and J.. Burrough P. Fuzzy Sets and Series Analysis for Visual Decision Support in Spatial Data Exploration. 1979.R. Springer Verlag. Armstrong. Jiang B. Elsevier Science. U. 1993. An Applied Introduction.. PhD Thesis. Introduction to Lattices and Order. 1990. 48.P. Heidelberg. Macmillan Publishing Company. World Scientific Publishing Co. Cambridge: Cambridge University Press. Davey.J.. Petry F. Soft Computing and Its Applications. 1980.. International Journal of Geographical Information Systems. Kainz W.K... Grimaldi R. University Utrecht. Hootsmans R. Dordrecht. Basic Topology. Springer-Verlag.References and Bibliography Aliev R. Fuzzy Overlay Analysis and Visualization in Geographic Information Systems. Fuzzy Sets and Systems. 2001.V.. New York. Aliev R. Intelligent Spatial Decision Support Systems.). Elements of Spatial Data Quality. 2004. 2005. 3. Dubois D. Oxford University Press.A. No.. Fundamentals of Fuzzy Sets.). Boston. Springer-Verlag. Kluwer Academic Publishers. Priestley.. B. 1994. University Utrecht and ITC. Edgar W. 1996. Prade H.L. Principles of Geographical Information Systems. Demicco R. New York. Bonham-Carter G.). Pte..

Fuzzy Sets. Boston. University Vechta and ITC. Fuzzy Set Theory and Its Applications. A Neuro-Fuzzy Approach to Linguistic Knowledge Acquisition and Assessment in Spatial Decision Making.. Zimmermann H... McAllister D. Prentice Hall. Tang X. Zimmermann H... 2004. An Introduction to Fuzzy Logic for Practical Applications. Springer Verlag. The Netherlands. 1965.. The Netherlands. Tanaka K. Fourth Edition. New York. Dordrecht. 1977. Information and Control 8. Enschede. PhD thesis.. Zadeh L.F. .J.J. PhD thesis. 1987. Dordrecht. N. Englewood Cliffs. Inc. 2001. Kluwer Academic Publishers.J. ITC dissertation number 108.F. 338-353 Zheng D. Decision Making. Fuzzy sets. University of Twente. 2001. Discrete Mathematics in Computer Science. London. Enschede. 1997.154 THE MATHEMATICS OF GIS Stanat D. and Expert Systems.. Spatial Object Modelling in Fuzzy Topological Spaces with Applications to Land Cover Change. Kluwer Academic Publishers.

35 equivalence relation. 6 quantifier existential. 7. 37 CANTOR. See function modus ponens. See bijective bijective. 2 codomain. 40 irreflexive. 36 complement. 27 Sumerians. 2 equivalence class.Index absurdity. 6 propositional forms. 2 structures. 2 exclusive or. 37 syllogism. 2 subset. 16 set. 29 predicate. 20 proposition. 37 composite relation. 33. See Cartesian product destructive dilemma. 6 Babylonians. 2 logical and. 21 negation. 6 propositional variables. 8 cross product. 27 proper. 21 difference. 2 bijection. See surjective surjective. 35 conclusion. See injective injective. 21 contingency. 7 existential. 7 power set. 26 cardinality. 26 set theory. 33 satisfiable. 26 Cartesian product. 32. 15 universal. 8 converse. 9 contrapositive. See conjunction map. 36. 34 logic. 22 existential quantifier. 7 one-to-one. See disjunction Indians. 7 constructive dilemma. 27 surjection. 36. 35 EUCLID. 20 conjunction. 15 existential generalization. 20 155 implication. 36 Egyptians. See quantifier function. See digraph disjunction. See function mapping. 15. 2 superset. 21 modus tollens. See surjective operators. 34 relation. 2. 37 intersection. 7. 2 injection. 20 assertion. 21 disjunctive. 21 . 36 hypotheses. 2. 9 antisymmetrix. 7 domain. 14 premises. 22 existential instantiation. 35 reflexive. 34 Arabs. 32 Chinese. 27 digraph. 15 quotient set. 33 directed graph. 27 inverse function. 8 inclusive or. 33. 2 argument logical. 27 composite function. See injective onto. 9 contradiction.

9 transformation. See universe of discourse universe of discourse. 34 truth table. 7 union. 36. 22 universal instantiation. 21 symmetric. 15.156 THE MATHEMATICS OF GIS hypothetical. See quantifier universe. 16 valid. 14 unsatisfiable. See function transitive. 16 . 27 universal generalization. 22 universal quantifier. 34 tautology.