Draft - Not for public release (© Wolfgang Kainz) Wolfgang Kainz GIS MathematicsThe of Draft - Not for public release (© Wolfgang Kainz) Version 2.1 (August 2010) [email protected]: Vienna,Austria Universitätsstraße 7,A-1010 of Vienna University Department of Geography and Regional Research Wolfgang Kainz

Draft - Not for public release (© Wolfgang Kainz) I Contents 6. 5. 4. 3. 2. 1. 0.

6.2 Binary Relations Relations Binary 6.2 32 ...... Product Cartesian 6.1 32 ...... Exercises 5.5 30 ...... inGIS Applications 5.4 29 ...... on Sets Operations 5.3 27 ...... 27 Sets ...... Relationsbetween 5.2 26 ...... Elements and 5.1 Sets Exercises 4.5 23 ...... inGIS Applications 4.4 23 ...... Logic Predicate in Valid Arguments 4.3 Proving ...... 22 Logic Propositional in Valid Arguments 4.2 Proving ...... 20 Arguments Logical 4.1 20 ...... Exercises 3.6 18 ...... inGIS Applications 3.5 18 ...... Notation Compact 3.4 17 ...... Operators Logical and Quantifiers 3.3 ...... 16 Quantifiers 3.2 15 ...... Predicates 3.1 14 ...... Exercises 2.5 11 ...... inGIS Applications 2.4 11 ...... of FormsPropositional Types 2.3 9 ...... Operators Logical 2.2 7 ...... andProposition 2.1 Assertion 6 ...... 2 Mathematics...... of Sub-disciplines 1.2 ofMathematics History Brief 1.1 2 ...... Relations and Functions ...... 31 ...... Relations andFunctions Set Theory Inference Logical Logic Predicate Logic Propositional of Mathematics Structure The XI ...... Preface 4.2.2 Proving Arguments Valid Valid with Rules Proving Arguments 4.2.2 Tables with Truth Valid Arguments Proving 4.2.1 ...... 21 6.2.2 6.2.2 of Representation Graphic Re Binary RelationsandPredicates 6.2.1 ...... 25 ...... 13 ...... 19 ...... 5 ...... of Inference of ...... 21 lations ...... 33 lations ...... 1 ...... 33

Draft - Not for public release (© Wolfgang Kainz) II

9. 8. 7.

9.3 Classification of Topological Spaces ...... Spaces Topological of Classification 9.3 ...... 76 Exterior and Boundary, Closure, Interior, Base, 9.2 ...... 74 Spaces Topological 9.1 68 ...... Exercises 8.5 66 ...... inGIS Applications 8.4 65 ...... 64 Homomorphism 8.3 ...... Algebras of Varieties 8.2 61 ...... Algebra an of Components 8.1 ...... 60 Exercises 7.5 58 ...... inGIS Applications 7.4 57 ...... 52 Transformations 7.3 ...... andMatrices ...... 47 7.2 Vectors Systems Coordinate 7.1 44 ...... Exercises 6.5 42 ...... inGIS Applications 6.4 40 ...... 36 ...... Functions 6.3 Topology Topology Algebraic Structures 59 ...... Systemsand Transfo Coordinate 8.2.4 Vector Space Vector 8.2.4 ...... Algebra Boolean ...... 8.2.3 Field 8.2.2 ...... Group 8.2.1 ...... Identity and ZeroElements ...... 8.1.2 6 and Variety Signature 8.1.1 ...... Transformation7.3.4 between Coordinate Systems ...... 56 Coordi Homogeneous 7.3.3 ofTransformations Combination 7.3.2 GeometricTransformations 7.3.1 ...... 52 Matrices 7.2.2 ...... Vectors 7.2.1 ...... Geographic 7.1.4 Coordinate System and Transformations7.1.3 Cartesian between Systems Polar Coordinate 7.1.2 ...... 4 Coordinate Systems Cartesian 7.1.1 ...... 44 ClassesofFunctions 6.3.2 ...... ofFu Composition 6.3.1 CompositionofRelations 6.2.4 ...... of Relations SpecialProperties 6.2.3 9.3.1 Separation Axioms Separation 9.3.1 ...... Alternate Definition 9.1.4 andHomeomorphisms Continuous Functions ...... 9.1.3 71 andOpenSets Topology 9.1.2 ...... Neighborhoods ...... and Spaces Metric 9.1.1 68 6.2.3.2 Order Relation Relation ...... Order 6.2.3.2 Relation Equivalence ...... 6.2.3.1 7.3.1.3 Scaling Scaling 7.3.1.3 53 ...... Rotation 7.3.1.2 ...... Translation 7.3.1.1 ...... 67 ...... nctions ...... nctions 3 of a Topological Space a Topological of ...... 72 nates ...... 55 ...... 33 ...... 47 ...... 54 Polar Coordinate Systems Coordinate Polar ...... 45 rmations ...... rmations ...... 43 ...... 53 ...... 52 ...... 35 ...... 62 ...... 62 ...... 47 ...... 51 ...... 34 ...... 63 .... 63 ... 37 ... 76 .. 60 35 69 1 5 7

Draft - Not for public release (© Wolfgang Kainz)

12. 11. 10. 12.7 Fuzzy Inference ...... Inference Fuzzy 12.7 ...... 123 Linguisticand Hedges Variables 12.6 ...... 122 Alpha-Cuts 12.5 122 ...... Sets on Fuzzy Operations 12.4 ...... 118 Membership12.3 Functions ...... 116 Sets Fuzzy Crisp Setsand 12.2 ...... 115 Fuzziness 12.1 114 ...... Exercises 11.6 112 ...... in GIS Applications 11.5 ...... 111 Problem Path Shortest ...... Tours, Hamiltonian and Eulerian 11.4 110 of Graphs Representation 11.3 ...... 108 Important 11.2 Classes Graphs of ...... 107 Graphs Introducing 11.1 ...... 104 Exercises 10.5 101 ...... GIS in Application 10.4 ...... 101 Completion Normal 10.3 97 ...... Lattices 10.2 96 ...... Posets 10.1 94 ...... Exercises 9.6 91 ...... inGIS Applications 9.5 86 ...... CellComplexes...... and Complexes 9.4 Simplicial 82

Fuzzy Logicand GIS ...... 113 Graph Theory ...... 103 Ordered Sets 93 ...... 11.4.3 Shortest Path Problem Path 11.4.3 Shortest ...... 1 11.4.2 Hamiltonian Tours ...... Graphs 11.4.1 Eulerian ...... 110 Graph 11.2.2 Planar ...... 11.2.1 Directed Graph ...... Connectivity 11.1.2 Path,Circuit, ...... 10 11.1.1 Basic Concepts ...... 10.3.2 Normal CompletionAlgorithm 10.3.1 SpecialElements ...... Lower Bounds and 10.1.2 Upper ...... 95 Diagrams 10.1.1 Order ...... SpatialRelations 9.5.4 ...... Consistency Topological 9.5.3 ...... Transformations...... Topological 9.5.2 88 SpatialDataSets 9.5.1 ...... Complexes Cell ...... Cells and 9.4.2 8 Simplexes and Polyhedra 9.4.1 ...... 82 Connectedness 9.3.4 ...... Size 9.3.3 ...... Compactness 9.3.2 ...... 12.1.2 Fuzziness versus Probability Probability 12.1.2 Fuzziness versus ...... 114 12.1.1 Motivation ...... 99 ...... 80 ...... 114 ...... 78 ...... 90 ...... 87 ...... 81 ... 107 ... 105 .. 107 .... 98 ... 94 111 11 88 6 3 III

Draft - Not for public release (© Wolfgang Kainz)

IV

16. 15. 14. 13. 13.5 Summary ...... 148 Summary ...... 13.5 RealModels Their 13.4 World Representation And ...... 142 Its Models And The RealWorld 13.3 ...... 140 Of And Time Concepts 13.2 Space ...... 137 Abstractions Their And Phenomena Real World 13.1 ...... 136 Exercises 12.9 132 ...... in GIS Applications 12.8 ...... 129

Index ...... 155 Index ...... Bibliography and References ofExercises Solutions ...... 149 Spatial Modeling ...... 135 13.4.3 Spatiotemporal Data13.4.3 Models Spatiotemporal ...... 146 Models Data 13.4.2 Spatial ...... Design 13.4.1 Database ...... 13.3.3 World Models Space AndTimeInReal ...... 142 13.3.2 Databases ...... 141 13.3.1 Maps ...... Sp In Time And Space Of 13.2.4 Concepts Space Of Concepts 13.2.3 Contemporary SpaceAndTime Of Concepts 13.2.2 Classical ...... 138 And OfSpace Time Concepts 13.2.1 Pre-Newtonian ...... 137 Information ...... And Data 13.1.1 Spatial 136 12.8.4 Result ...... Approach 12.8.3 Software ...... 12.8.2 FuzzyConcepts ...... 129 12.8.1 Objective ...... Method 12.7.2 Simplified ...... 12.7.1 13.4.3.5 Spatiotemporal Object Model Model Object Spatiotemporal 13.4.3.5 .. 148 ...... Model Event-based ...... 13.4.3.4 13.4.3.3 Space-Time Comp Model Snapshot 13.4.3.2 ...... 13.4.3.1 Space-Time Cube Models Object-based ...... 13.4.2.2 Models Field-based 13.4.2.1 ...... Script 9 ArcGIS 12.8.3.4 ...... 3.x ArcView 12.8.3.3 ...... Analyst ...... 130 Spatial ArcMap ...... 12.8.3.2 GRID ArcInfo 12.8.3.1 ......

M AMDANI ’s Direct Method ’s Direct ...... 124 Model ...... osite Model ...... And Time And Time ...... 139 atial Information Systems Systems atial Information ...... 139 ...... 153 ...... 130 ...... 132 ...... 131 ...... 130 ...... 140 ...... 147 ...... 145 ...... 129 ...... 148 ...... 146 .... 147 . 143 . 127 144 129 147

Draft - Not for public release (© Wolfgang Kainz) V List ofFigures Figure 33. T Separation axioms Figure 30. approachesEquivalent to the definition ofatopological space, open sets and Figure 29. Example of a homeomorphic function ...... 72 Figure 28. Continuous function ...... 71 Figure 27. Neighborhood axioms ...... 70 Figure 31. Interior (upper (upperboundary left) andright), closure left), (lower exterior Figure 32. T Separation axioms Figure 18. Point vector ...... Figure 17. Geographic coordinate system ...... 47 coordinates spherical coordinates and Cartesian Figure 16.between Conversion ...... 46 and FigureCartesian polar 15. between in coordinates Conversion the plane ...... 45 Figure 14. Spherical coordinate system ...... 45 Figure 13. Polar coordinate system in theplane ...... 45 Figure 12. Cartesian coordinate system in 3-D space ...... 44 Figure 11. Cartesian coordinate system in the plane ...... 44 with singularities Figure 10. projections Map ...... 41 Figure 9. Spatial relations derived from topological invariants ...... 41 Figure 8. Topological relations ...... 40 Figure 7. Functions and relations ...... 37 Figure 6. Composition of relations ...... 36 Figure 5. Sample relations ...... 3 Figure4. Non-commutativity of theCartesian product ...... 32 Figure 26. Open disk in Figure 25. Raster calculator interface ...... 65 Figure 24. Manual digitizing setup ...... 58 Figure 23. Scaling ...... Figure 22. Rotation ...... Figure 21. Translation ...... Scalartripleproduct 20. Figure 50 ...... Figure19. Cross product of two vectors ...... 50 Figure 3. V Figure 2. Raster Calculator with logicalconnectors ...... 11 Figure 1. Sub-disciplines ofmathematics and their relationships ...... 3 acteristics of separation spaces acteristics between topological char Figure 34. Relationship ...... 78 neighborhoods and related theorems ...... 73 (lower right) ofanopen set ...... 76 ENN diagram ...... 26  2 ...... 69 3 0 and T and , T 1 , and T 4 ...... 78 2 ...... 77 ... 54 .. 53 . 52 48 4

Draft - Not for public release (© Wolfgang Kainz) VI

Figure 59. Membership functions for “short”, “aver for “short”, functions Membership 59. Figure Figure 58. Undirected and directed graph ...... 109 Figure 57. Dual graph ...... 1 Figure 56. Planar graph ...... 10 Figure 55. Directed graphs ...... 107 Figure 54. Connected (G) and disconnected (H) graph ...... 107 Figure 53. Isomorphic graphs ...... 106 Figure 52. Complete graphs ...... 105 Figure 51. Graph of the Königsberg bridge problem ...... 104 Figure 50. The sevenbridges of Königsberg ...... 104 Figure 49. Geometric ofnewlatticeel Figure 48. Normal completion ...... 101 Figure47. Normal completion lattice ...... 100 Figure 46. Lower bounds ...... 96 diagram andcorresponding Poset 45. Figure ...... 95 Figure between 44. two Spatial relationships Figure 43. Node consistency check ...... 90 Figure 42. Closed polygon boundary check ...... 89 Figure 41. Topologicalmapping ...... 88 Figure 40. Two-dimensional spatial data set as cell complex ...... 87 Figure 39. Construction of a CW complex ...... 86 Figure 38. Cell decomposition and skeletons ...... 85 Figure 37. Unit balls and cells ...... 84 Figure 36. Valid simplicial complex (left) an Figure 35. Simplexes of dimension 0, 1, 2, and 3 ...... 82 Figure 71. Inference rule inM Figure70. Membership functionfor Tall andSlightly Tall ...... 123 Figure 69. Membership function for Tall and Not Very Tall ...... 123 Figure 68. Membership functions for Tall, Very Tall, and Very Very Tall ...... 123 Average.121 set fuzzy for contradiction of middle law and oftheexcluded Law 67. Figure Figure66. Fuzzy set and its complement ...... 121 Figure 65. Fuzzy set intersection ...... 120 Figure 64. Fuzzy set unionoperators ...... 120 Figure 63. Set inclusion ...... 1 Figure 62. Gaussianmembership function ...... 118 Figure 61. Sinusoidal membership function ...... 117 Figure 60. Linearmembership function ...... 117 AMDANI ’s direct method...... 124 d invalid simplicial compdinvalid 9-intersection91 the on based regions simple age”, and “tall” and age”, “tall” ...... 116 ements ...... lex (right) ...... 83 ...... 101 08 19 8

Draft - Not for public release (© Wolfgang Kainz)

Figure 77. Membership functions for favorable Figure76. Membership functionsfor flatand steepslope ...... 128 Figure 75. Simplified Method ...... 127 Figure 74. Fuzzy inferencefinal result ...... 127 Figure 73. Fuzzy inferencestep 2 ...... 126 Figure 72. Fuzzy sets of the rules ...... 126 Figure 81. Spatial modeling is a structure preserving mapping from isa Figure 81.the modeling preserving realworld toa structure Spatial Figure 80. Platonic solids asbuilding blocks ofmatter ...... 138 (right) and a approach logic ... (left) afuzzy approach with crisp 79. Figure Analysis 132 Figure 78. Membership function for “high elevation” ...... 129 Figure 82.from Data modeling the real worl Figure 84. Layers in an object basedmodel ...... 146 Figure 83. Two data layers in a field-basedmodel ...... 145 spatial model...... 14 visualization ...... 1 and from to cartographic there digital models and analogue products for products and analogue models d to a database (digital landscape model), dmodel), toalandscape database (digital and unfavorable aspect...... unfavorableand aspect. 128 43 VII VII 2

Draft - Not for public release (© Wolfgang Kainz) Draft - Not for public release (© Wolfgang Kainz) IX List ofTables Table Table of interior,closure, 11. and bounda Properties Table 10. Properties ofthe Cartesian product ...... 32 Table 9.ArcInfo overlay commands ...... 29 Table 8.Rules for setoperations ...... 28 andquantifiers ...... predicates involving inference of Rules 7. Table 22 Table 6. Rules of inference ...... 2 TableLogical 5. relationships involving quantifiers ...... 17 Table 4.Logical implications ...... 11 Table 3.Logical identities ...... Table 2.Truth tables forlogical operators ...... 8 7 Connectors Logical 1. Table ...... Table 22. Data models and schemas in data in schemas models and Data 22. Table Table 21.Fuzzy inference step 1 ...... 126 Table 20.Hedges andtheir models ...... 122 Table 19.Operators for hedges ...... 122 Table 18. Rules valid only for crisp sets ...... 121 Table 17.Rules for set operations valid forcrisp and fuzzysets ...... 121 Table 16. Membership values for the height classes...... 116 Table 15.Characteristic functionfor height classes ...... 116 Table 14.Normal completion ...... 99 completion...... normal in the operator closure and the elements Special 13. Table 99 Table 12. Arc table for the arc-node structure ...... 88 base design (the ANSI/SPARC architecture)144 ANSI/SPARC (the base design ry of a set ry ...... 75 10 1

Draft - Not for public release (© Wolfgang Kainz) Draft - Not for public release (© Wolfgang Kainz)

XI CHAPTER 0 written in the written inthe oflogic,language set th and mathematical language and how they are howthey and language mathematical show It inGIS. applications logic andits fuzzy 12 addresses Chapter GIS. in role important an increasingly plays Uncertainty analysis. tospatial storage, consistency data from and graph theory. These chaptersaddress themathematical many GIScore of functions Chapters 8to 11present therelevant highly s algebra. linear orto geometry (analytical) either be to to normally chapter 7would considered belong the and thefoundation chapters more mathematicalstructures.advanced on Much of The next on chapter coordinate systems and transformations builds between the bridge structures. mathematical with chaptersdealing for thesubsequent foundation wi together chapters Thesetwo mappings. and relations, operations, set ofsets, notions thebasic into anintroduction Chapter5 and 6are facts. given from conclusions logical drawing of methods the inference, logical as well as presented logicare predicate and Propositional mathematics. of mathematical and foundation logic, thelanguage deal with chapters top of on built are disciplines mathematical different how the and mathematics of thestructure of overview brief a Chaptergives 1 chapters 13 into structured is book The andtopology. mathematics discrete software for the handling and processing of ma high school of knowledge general have a have to deal they when needed knowledge mathematical with reader the the of thisbook istoprovide purpose The facts. assumed fromgivenor conclusions and toinfer predicates, sy languages as programming in also appears isnot built.Logic theories are mathematical the regardedas can be theory set and Logic Preface Preface with spatial information systems. Readers are expected to applied to spatial decision making. applied tomaking. decision spatial s how vague concepts can be formalized in foundation of mathematicfoundation of more fundamental ones. The next three spatial datarequires newspatial such as contents eory is fundamenteory the very onwhichall ubjects of algebra, topology, ordered sets, ordered sets, topology, ofalgebra, ubjects ntactic constructs to express , propositions, ntactic express constructs to th thethreeth chapterson logicrepresentthe only the language of mathematics. It mathematics. It of onlythelanguage thematics. The use of computers and and of Theuse computers thematics. The Binary Bible ofSaint $ilicon “Though this be madness, Yet there’s method in it.” s. Mathematics is .

Draft - Not for public release (© Wolfgang Kainz) XII XII

following diagram. following diagram. asillu ways The bereadseveral book can in as to how to representmodels of spatial features. as well as challe there are that mathematics modelingbuilt onsolid is considerationsabout Itshows spatial that spaceandtime. a philosophical some with chapterstogether oftheprevious Chapter13 is asynthesis appearance. its or text the improve to help might that hints and comments any appreciates author The complete. is or section chapter every not and progress in iswork book This to read is ofcourse, bestThe way, context. muchof the without too losing be readindividually 13can Chapters and 7,12, advanced structures chapters particular inmore interest Forsomeonewitha 5and6, 2 to chapters respectively. 4 and theo and set inthelogical Readers interested Algebraic Structures Algebraic Chapter 8: Chapter Propositional Logic Chapter 2: 2: Chapter Set Theory Set Chapter 5: Chapter Chapter 9: Chapter Topology 8 to 11will be ofinterest. and Transformations Coordinate Systems allthetextchapter1 to13. from Spatial Modeling The Structure of Predicate Logic Mathematics Chapter 13: Chapter 12 Fuzzy Logic Fuzzy Chapter 7: Chapter 3: Chapter 1: Chapter nging and interesting philosophical questions nging and interesting questions philosophical retic foundations mightwant to readchapters retic foundations Relations and Ordered Sets Ordered Chapter 10 Chapter 6: Functions strated by the horizontalstrated by blocksin the Logical Inference Logical Chapter 4 Graph Theory Chapter 11: Chapter Vienna, August 2010 2010 August Vienna, THE MATHEMATICSOF GIS Wolfgang Kainz Kainz Wolfgang

Draft - Not for public release (© Wolfgang Kainz)

1 CHAPTER 1

theory. and set logic in are rooted mathematics of and branches theories howthe different explains and mathematics ofapplications inalldomains chapter a oflife. gives briefhistory This many with discipline a scientific become has mathematics the centuries, mainly devotedtopracticalmainly calculationsre M Mathematics of Structure The changed over the centuries. In the beginning, mathematics was beginning, the In centuries. the over changed mathematics has what is of Theunderstanding years. thousands of athematics is anactivity that has been performed by humans since lated to tradeandlandsurveying. Over

Draft - Not for public release (© Wolfgang Kainz) 1.2 1.1 2

Sub-disciplines of Mathematics of Sub-disciplines Mathematics of History Brief

important role as the language and foundation principle, respectively. respectively. principle, foundation and language as the role important an play set theory and Logic formalizemathematics. to then appliedsince been has esta be whose can beformally derived validity mathematical theories. Starting fromminimala of set axioms statements (theorems) can mathematics, mathematics, are mathematical mathematical are operations certain follow or other each to relationships certain in are elements Sets whose relations. of kind a special the comparisonof with elements to attributes. regard certain theclassificati allowforinstance relationships Relations operations in and structures isdefined onthem.ofthe operations notationtheory the The set basic tooldescribe to Set theory validity. how to derive new statementsfrom existing ones, and providesmethods to prove their Logic approach is of this great example Thefirst then. wasdeveloped deduction logical and axioms focusof sake, andto concept the scientificattentionmathematics toa science.The as Inbefore the fifthcentury Chri solutionsarithmetic andgeometricproblems. for the why reason isthe This surveying. mathematics wasalways topracti related beginning, Inthe Chinese. the and Egyptians, Babylonians, were the Sumerians, history ancient in calculations mathematical performed thatactively cultures known first The 17 Inthe trigonometry. concept and number the developed further and Arabs Indians The In the 19 a consequence of the intensive studies intensive the of consequence a until 19 the and the fundamental buildingblocks. Figure 1 shows and thesub-disciplines their (GIS). systems of geographic information the theory in used are topology algebraic from Results structure. topologic a and order, an algebraic, an carry for instance, numbers, real The structure. one more than carry sets Often, topology. on based is Calculus continuity. and and sets structure with a elements, topologic of thecomparison with anorder structureallow do arithmetic, sets can we structure th and 18 and is a formal language in which mathematical rules defines which isa formalstatementsarewritten.It languagein define relationships among elements among define relationships deals with sets, thefundamental buildin deals withsets, th th th century, mathematicians began to establish an axiomatic foundation of mathematicians foundation began anto establish axiomatic century, century, the concepts of calculus and analytical geometry were developed as as were developed geometry analytical and calculus of concepts the century, century. century. The algebraic

Elements structures , order of E of mathematical disciplines. . We distinguish between three major structures in . Wedistinguish in major structures betweenthree st, the ancientst, the Greeksstarted , and UCLID

in physics and natural sciences. physics in and natural , thefirst textbook ongeometry,valid whichwas topologic ancient cultures mainly developed practical developedmainly practical cultures ancient position inmathematics ageneralconceptof allow to introduce concepts of convergence allow introduceof convergence conceptsto cal problems of commerce, trading and and trading of commerce, problems cal on of elements into equivalenceon classesor into elements of blished (proof). This blished (proof). structures. In sets with an algebraic algebraic with an Insets structures. g block of mathematical structures, and and structures, mathematical of block g of a set or several sets. These sets. aset or several of to do mathematics foritsown (or mappings) (or Functions are axiomatic approach THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz) THE STRUCTUREOFMATHEMATICS

under the domain that is usually called thatis usually domain under the discrete se of non-continuous investigation mathematics important,equally became suchastopology, graph and the theory, of GISothercalculus. of branchesdigital of the With technologies introduction and algebra, linear geometry, (analytical) are handling data spatial in importance great of theories Theclassical geometry. (analytical) and algebra, ascalculus, such disciplines mathematical many the wefind structures, mixed and structures different the of On top applications. its scienceand incomputer role important Figure 1. Sub-disciplines of mathematics and their relationships Algebra leri Order Algebraic Structures Set Theory Set Ordered Relations Sets Logic finite ts and their operations. The latter two fall twofall The latter operations. andts their or or Topological discrete mathematics Topology that plays an an plays that

3 Draft - Not for public release (© Wolfgang Kainz) Draft - Not for public release (© Wolfgang Kainz)

5 CHAPTER 2 aswell. are shown with theoftruthtables truth-values help translationof natural intopropos language logical and The operators. form, , propositional , explainsof propositional principles the chapter logic. This of subject the arenot aretrueor false they whether establish P Propositional Logic Propositional are called propositions. Any other statements for which we cannot cannot for whichwe statements Any other propositions. called are statements Such them. combine to used are that operators or false and logicropositional withassertions deals logic by introducing the concepts of concepts introducinglogic the by itions and the establishment oftheir itions andthe orstatementsarethat either true

Draft - Not for public release (© Wolfgang Kainz) 2.1 6

Assertion and Proposition and Proposition Assertion

middle 1 of the propositional variables P and Q using connectorsthe “or” “not”.and “Beer isgood” and “Water has notaste” using the connector“and”. “P not or Q.” is a combination 2. Example “not”. and “or”, as“and”, such words use we combination combinecan propositionsWe andva propositional propositional forms. and variables propositional use we Forthis, assertions. down in writing general more be Often wehaveto values. The following are propositions: 1. Example or off, one orzero). on states, assume(a bitcanonly built,andwhichisused two incomputing are disciplines logic.with atwo-valued This isth deal with thatar statements deals logic Propositional assertion becomes aproposition. on the valueon ofthevariables cannot bepropositions. (8)are assertions, (7)and butpropositions. no Their truth-value depends assertionsnot (5) and(6)are (they areaquestion and acommand,respectively), andtherefore they statements are not propositions: Assertion (2) Proposition (1)and can or false. betrue (3) false, is and The (4)istrue. following assertionsWe callalogicwhich a in orfalse areeithertrue propositional variables. variables. propositional proposition isunspecwhose truth-value Definition 2 (Propositional Variable). 1-0 truth-values. for notation writtenastrue,false,orT,F,1, usually oftruehas atruth-value is eithertrue or false,butnotboth Proposition). Definition 1(Assertionand (1) (8) (2) (3) (5) (4) (6) (7) characterized a two-valued logic. logic. two-valued a characterized

“It rains.” rains.” “It “ “I pass the exam.” exam.” the pass “I “3 +4=8” “Areat home?” you numberan odd “3 aprimenumber.”is 7 is and “Use the elevator!” “ x

 6 yx “Beer isgood and water has no taste” is a combination the of two propositions The following statements illustrate the concept of assertion, proposition and truth- ”  12 ” x ; if it is false,it itis ; if and y . Only when we replace the variables with some values, the

1 , we, call ita ified. We useupper case letters propositional variable A propositional e logic onmoste logic whichmathematical of the has a truth-value of has atruth-value 0. In the following sections, we will use the usethe wewill 0. Inthefollowing sections, An e either trueorfalse.we Here,willonly e either assertion proposition riables to form new assertions. Forthe toformnewassertions. riables two-valued logic two-valued is a statement. If an assertion If a statement. is . If a proposition is true, it istrue, it . Ifaproposition false . The . are . Truth-values THE MATHEMATICSOF GIS is an arbitrary isanarbitrary P law of of thelaw excluded , Q , R ,… for

Draft - Not for public release (© Wolfgang Kainz)

2.2 LOGIC PROPOSITIONAL

Logical Operators frequently in horror movies. 3 2 “0”forthesymbols We use operators. logical common most for the tables truth the 2shows operand.Table every for defined of truth-values This isdonecombination fortheoperands. using needpossible lookat every statement to a combined we for the truth-value Todetermine most operators. common shows the variables. 1 propositional or Table combine propositions areusedto operators Logical “Vienna isthe capital ofAustria or two is an even number”. odd number” then the propositional form inExample 2 “P ornotQ” becomes the proposition 3. Example of theoldpropositions. truth-values and the old the ones, thetruth-valueof newtheconnective depends proposition on logical we proposition. get a When weuselogical pr Whenwe substitute propositionsforthe “or”and are called operator one iscalledunary operand Inthe example above logical operators same time. same at the dead alive and be cannot A person or. exclusive an mean weclearly dead” I am goto workandIcan betiredatthesametime In the statement “I go towork or I am tired” theoperator indicates an inclusive or. I can or. exclusive and inclusive between distinction a make must we Therefore, this way. in operate wecannot mathematics, In mean. we what context the from follows usually It or. exclusive or inclusive do Whenuse theEnglishwe we “or” term but both. never istrue, operand other or the whenever at least one ofthe operands istrue. and) isonly true ifboth operandstrue are apply operators other The of aproposition. Negation is a We exclude possibility here the of being azombie, a state of existence (theliving dead) appears that Theterm“iff” meaning “if and only if” is used only in written text. Disjunction Conjunction Equivalence Implication Exclusive or Negation propositional forms, forms, propositional todenote We caseGreekletters use upper variable. at leastonepropositional Definition 3(Propositional Form). Logical Connector Symbol Read or written as as written or Read Symbol Connector Logical

3

When P stands for“Vienna is the capital of Austria” and Q stands for “Two isan unary operator unary , or . binary operators logical connectives P  andQ , ) (,, PQ       , i.e., it applies to one variabit appliesone , i.e., to are called called are 

Table 1. Logical Connectors . equivalent, …ifand only if…,iff implies, if…then… not or and either …orbut not both ; those that operate on two operands such as “and” as “and” such operands two on operate that ; those A form propositional false . An operator such as “not” that operates only on Anoperator suchas“not” thatoperatesonly . operands opositional variables of a propositional form, and “1” for to two operands. The conjunction (or logical (orlogical to conjunction twooperands.The connectives toderive new propositions from . The disjunction (or inclusive or) is true or) istrue (orinclusive . The disjunction . However, when we say that “I am alive or alive or am that“I wesay when . However, The exclusive or is only trueifeither Theexclusiveoris only one not makeexplicit whether wemean the , the words “and”, “or”, and “not” are are “not” and “or”, “and”, , thewords true le, and changes the truth-value truth-value the andle, changes is an assertion that contains isanassertion thatcontains . 2

truth table s that are 7 Draft - Not for public release (© Wolfgang Kainz) 8

Two thesame thathave propositions truth-va statement) can follow from a falseproposition. Accordingfalsetrue.and thetruthis Q to fo table no relationship whatsoever betweenthe two propositi The implication “Ifthe moon larger is than theearth, then the sunhot” is istrue, although thereis 5. Example someby propositions. of an toinmind Wehave implication. conclusion keep thisorder in get confused not to In propositional logic, there need not relationship beany between thepremise and the airplanes. of a property expresses then ithaswings” this isanairplane, The statementwet. getting“Ifbetweenand shower taking relationship a a causal states statement “IfI The a conclusion. and premise In natural language,expresses the implication rain”. not does it implication reads as“Ifwet, Iget then it rains”, andcontrapositivethe “Ifis I donotget wet, then 4. Example the If In theimplication conclusion  “ “ “ “ “ “ “ “ “ “If contrapositive Q Q Q Q Q  P P P P QP is equivalent to isequivalent sufficient isa condition for implies only if P is a logical consequence of isalogical provided whenever whenever if follows from QP canbe read indifferent ways: , then is an implication then

P . The implication can be read in many different ways: ways: different many beimplication readcan The in . orconsequence ” Let us take P be“the moon to islarger thanthe earth” and“the Q as sunis hot”. Let us consider implicationthe “If itrains, then I get wet”. The converse ofthis Q Q Q ” . P ” ” P P ” ”  P Q QQPP Q Q PQP PQPQ PQPQ ” 111 10 11 1 1 10 11 1 1 10 11 0 10 100 11 01 0 1 00 01 0 0 00 01 0 00 Q ojnto ijnto Exclusive or Disjunction Conjunction Table 2. Truth tables for logical operators N ” we call call we PPQPQPQPQPP 00 10 01 1 01 10 100100101 gto mlcto Equivalence Implication egation  

P Q P  the ” ” PQ 111 1 11 0 1 10 11 0 10 is calledthe premise r implications, anythingfalse(eithera atrueor a causal or inherent relationship between a orinherent relationship a causal take ashower,thenI will get wet” clearly lues are said to be logically equivalent. logically aresaidtobe lues , ons. Theimplicationons. truebecause is P is hypothesis converse converse , or and and antecedent THE MATHEMATICSOF GIS

 , and PQ is called is Q the

Draft - Not for public release (© Wolfgang Kainz) 2.3 LOGIC PROPOSITIONAL

Types of Propositional Forms Types of propositional form,we have propositional We see that for two variables we have investigateto four different cases. datur” with its Latin name) stating that something cannot be and not be at the same time. time. same the at be not beand cannot something that stating name) Latin its with datur” This ispropositionalform thecorrespondsthe excluded to lawof middle (alsocalled“tertium non Example 9. Example 8. Example 7. Example contingency. and contradiction, illustrateconceptsof tautology, the examples The following false,trueor regardless always the of wedistinguishIn logic, propositional propositional certain forms thatareeitheralways 6. Example propositional forms. Whenever there are are there Whenever forms. propositional usedlogical operators for are truth tables The P P 1011 0 1 1 0 11 1 10 1001 0 0 1 0 11 1 10 1001 0 0 1 0 01 1 00 1001 1 0 0 0 01 1 00 contingency tautology truth-value for istrue all possible truth-values Contingency). Contradiction, 4 (Tautology, Definition “ “ “ QQPQ PQ QQPQPQQ P P P if and only if ifandonly andsufficientfor condition necessary isa iff    111 001010000

Q 001010 . A.  ” The propositional form propositional The The propositional form propositional The The propositional form The table truth forthe proposition PPPP is apropositional form nor atautology that isneither a contradiction. contradiction

1 1 1 1 )( Q ()  () ” PQPQPQP

(or 2 n possible combinations of true and false to investigate. and toinvestigate. true false of combinations possible absurdity P

truth-values of the pr truth-values ofthe   P ) is a propositional form that is always false. A false. always thatis form a propositional is ) )( is a contradiction. acontradiction. is  )(  PQP to determine to thetruth-values ofarbitrary n of its propositional variables is called a is called variables propositional ofits QQP is a tautology. tautology. a is propositional variables involved in a in involved variables propositional Q isacontingency. ” A propositional form whose form whose propositional A opositional variables.  QP )( is constructed as: 9

Draft - Not for public release (© Wolfgang Kainz) 10

propositional form The numbers on the right indicate the identities that have been applied tosimplify the Example 10. Example M table, the In mostidentities. Tableimportant logical thesimplify logical 3lists expressions. can onepropositional formWe replace with its equivalent form. Thishelps often to logical operators established in Table 1 on page 7. established1 onpage logical operators inTable constructingusing thetruth truth tables tablesofthe beproven by their can the identities equivalence can be replaced by implicatiocan bereplaced equivalence by ns throughidentity 19. Identities7 and8 (D The anddisjunction. negation by implication the replace to 18allows us Identity 21. 21. 17. 17. 16. 1. 14. 14. 3. 9. 2. 20. 20. 10. 10. 11. 11. 12. 12. 5. 4. 19. 19. 15. 15. 8. 18. 18. 13. 22. 22. 7. 6. ORGAN equivalence is also called a is alsocalled equivalence whenequivalence the (LogicalDefinition 5 Identity).  () () () () () P P PP PP PP ’s laws) allowthereplacementconjunctio ’s laws) of      

RQP 11 1 00 0 ,...),,( 1 PP Simplifythe following propositionalform: and and     PP P)(PP logically equivalentbe logically to said are PPP )( )(

0)(

1

0  

denote propositions that are always are that propositions denote PQQPPQQP  )()()()( QPQP

  )()( QPQPQPQP )]()[(  PQQP

 logical identity  )()()()(  )()(  

 RQPRQP RQPRQP   Table 3. Logical identities      )]([])[( )]([])[(  PQPQP QP  PQ 

PQ  

RQPRQP PQ

PQQPQP PQ

QP )( )]([])[( )( RQP RPQPRQP RPQPRQP Two propositional forms Two propositional )]()[()(

)( )]()[()]([ )]()[()]([

 .  when their truth tables are identical, or are identical, truth tables their when (18) (17) (22) (4) (4) (7) (7)

idempotence of of idempotence exportation exportation commutativity of of commutativity of commutativity middle excluded the of law of idempotence D equivalence

distributivity of distributivity of implication associativity of of associativity contrapositive

double negation absurdity associativity of of associativity n by disjunction and vice versa. All All versa. vice and disjunction by n RQP E ,...),,(,...),,( M ORGAN true and false, respectively. true andfalse,respectively. Such is atautology.  ’s Laws QP )(      .  

  over over

THE MATHEMATICSOF GIS

 

RQP ,...),,( and E

Draft - Not for public release (© Wolfgang Kainz) 2.4 LOGIC PROPOSITIONAL Exercise 1 2.5

Applications in Applications GIS Exercises Exercises

Construct the truth table of the propositional form &else &then %covername%] &if [exists &sv covername = [response exists. it program deletes ifit AML theThename following prompts userfor and a coverage (proposition). Logical connectors or comparis that orfalse canbeevaluatedaseithertrue anexpression contains The condition if if-statement inever can be found logicalimplication The will be selected. The logical and1,500 between 1,000 cellswith anelevation all raster Inthisexample, connectors. Calculator Raster the 2shows Figure queries. operators we findlogical applications, In GIS Someof implications these co usefulMany tautologies areimplications. 5. 9. 7. 6. 1. 2. 8. 3. 4. &type Coverage %covername% does not exist! exist! not does %covername% Coverage &type %covername%ALL KILL , which takes the general form which the takes , )(   then QPP PQP )( )]([ )]([

Figure 2. RasterFigure Calculator 2. withlogical connectors   ])[( QQPP QQPP 

PQQP “and” connectorisrepresen ‘Enter a coveragename’] ‘Enter

rrespond to rules of inference Table 4. Logical implications    else RPRQQP RPRQQP RPRQQP )()]()[( )]()[()( )()]()[(

Table 4 lists the most4 the importantTable lists of them.  y programmingy language intheformof the SQRPSRQP on operators are often part of the condition. condition. partofthe onare operators often oia connectors logical )]()[()]()[( of ArcMap Spatial Analyst with its logical withitsAnalyst logical ArcMap Spatial of mainly in spatial analysis and database anddatabase analysis inspatial mainly

modus tollens

hypothetical syllogism disjunctive syllogism addition

simplification

modus ponens ted by the character “&”. “&”. thecharacter by ted ])[( that will be discussed willbe that later.  PQQP .

11 11 Draft - Not for public release (© Wolfgang Kainz) Exercise 7 Exercise 2 12 Exercise 5 Exercise 4 Exercise 6 Exercise 3

(i) ) (iv) (iii) (a) (ii) determined by the execution of the function function the of execution the by determined In acomputer program you have the following statement expressions must use only For thefollowing expressions, find equivalent expressions using identities. The equivalent “Ipass not the exam,will do not study hard.”if I (c) leaves.” he if only stay “I will (b) “If itrains, then I get wet.” (a) Write down the converse and contrapositive of the following propositions: It is raining and I am notsick. (i) Iwill not get wet. (iv) Write a sentence inEnglish that corresponds tothe following(b) propositions: I am sick is if raining.it If itisraining, then I get wet and I am sick. (iii) (ii) (i) Writefollowing the propositions insymbolicnotation: (a) proposition “Iam sick.” Let Simplifypropositional the form Show that are logical variables, (c) (b) program. Can you always rely on that a value for only executed when really needed. Assume such anoptimized code hasbeen generated foryour P be the proposition bethe raining.”is “It Let   RQP (  PQP QR )( 



QR )( FUNC ()( PRQP

])[(   RQP QPQP  is a logical function and

) isatautology. QRRQ )()(

and Q be propositionthe “I will get wet.” Let FUNC  z  QPQP is computed? computed? is . Optimizing . compilers generate codethat is )()( . z and be as simple as possible. is an output variable. The value of x ← y and FUNC(y,z) THE MATHEMATICSOF GIS R bethe where x z , is y

Draft - Not for public release (© Wolfgang Kainz)

13 13 CHAPTER 3 form ofpredicates. the into statements language natural to translate used be will what is about predicates logic. in possible acquired propositional The knowledge oflogicmuchlanguage andmore allowmakingthan assertionsin a way general the enrich that andquantifiers of predicates concepts the introduces This chapter T

variables “ withtwo ortheequation mortal” are humans “All as such objects, between Predicate Logic general statements about the propert the about statements general make need to mathematics. Wefrequently in needed the assertions makeall enough to powerful not is propositional logic of language he x + y =2”. ies of an objectorrelationships an ies of

Draft - Not for public release (© Wolfgang Kainz) 3.1 14

Predicates

variable. like expression an whereas use specificpredicates, such as Vienna.” Vienna.” replace we When as 4 When we take values 13. Example denotepredicates with upper case letters. writtenusually as“greater than”thatare “=” Somepredicates have awell-known notationin 12. Example 11. Example values. specific by replaced are madeAssertions withpredicates andvariab 5 ”, because the truth-valueof thisstatements dependson the values ofvariables the In we cannotmake the ofpropositions language assertions such as “ are mortal” that correspond to a general construct “ construct general toa correspond that mortal” are We alsomake assertions in natural language value of “x <5”. containsthe predicate “x <5”.When the programruns current the value of xdetermines truth- the These constructs express a relationship between objects or a property of objects. ofobjects. property ora objects between relationship a express constructs These predicate ) predicate level programming languages. The statement “ y bedistinguish precise,To we must between . Only when we assign values to the va the to values we assign when Only . elements of the universe,we say that that say then we Definition 8. called the arguments predicate Definition 7 (Variables, Universe). predicate Definition 6 (Predicate). U andmust contain at least one element. yxL ),( , and “

4 . , and the , and The assertion “ Predicates appear commonly in computer programs as control statements of high- “ assertion In the or an itis universe of discourse of universe If If x 21 x by “John” and yby“Vienna”becomes it the proposition “Johnlives in  y P  ,,,( valid in the universeU isvalid xxxP x z n-place predicate n i ” could” bewrittenas When variables. are P 21 , we get a proposition, wegeta with no immediate interpretation of the predicate denotes a predicate apredicate denotes predicate the of interpretation no immediate with 21 x i oa”cnb rte s ) ( woman” a canwritten is be as  A term designating a property or relationship is called a a orrelationship called aproperty is term Adesignating  W x lives in y lives , ,,, cccP L ccc n or n , orthe ),,,( from the universeofvariables a fromthe andassign tothe them is

S in Example in actually 13,we deal with predicateconstants, true predicate variables ” In theexpression . mustValues forthevariables come from aset P universe for choice ofelementsevery from the universe, x riables, theassertions is intheuniverseU satisfiable and lesa become proposition whenthevariables like “Ann lives in Vienna” or “Allhumans if x < 5 and “>”, respectively. Otherwise, we will we Otherwise, and “>”,respectively. P mathematics. Examples are “equal to” or y are variables, and “lives in” is a predicate. . If . The universe is normally denoted as denoted normally is The universe . has zyxS ),,( . x n lives in in lives 21 and and it that wesay has variables Wx  then y ,,,( predicate constants cccP 21 n , “xin y”can, lives bewritten  become propositions. ) y . ” or “all cccP ← n 21 2 * 2* y ),,,( is THE MATHEMATICSOF GIS  yx true . The values . Thevalues xxxP  n x ),,,( ” for instance instance ” for for some for . Whenever we . Whenever and and , ” or “ ” or P i a is M x x () n and x 

”. y

Draft - Not for public release (© Wolfgang Kainz) 3.2 PREDICATE LOGIC

Quantifiers as “for some is a unique is a (4) wouldbe truepositive inthe integers Propositions (5),(1), (4), and (7) are true. Propositions (3) isfalse in integers;the however, it If ) it isfalse. otherwise, to the variables and combining variables to the universe assigning allelementsofthe by propositions with assertions quantified express We can toalso them. values assigning canby variables be bound above have seen As we 14. Example If of predicates. that We arguments. say the are variables Wehave canbecome thatapredicate seen “there is one and only one one element makesin theuniverse, apredicatetrue.Thisquantifierwhich isread as There thereisone andonly isalsoavariationoftheexistentialquto assertthat antifier (2) “for every”, “for any”, “for arbitrary”, or “for each.” The statement “for all “for statement The each.” “for or arbitrary”, “for any”, “for every”, “for (6) (5) variable variable (3) at leastone value of quantified (1) quantification: by formed (7) of eoe ) becomes “ is satisfiable in is satisfiable  universal universal know two them. We quantifying orby to them, value a assigning Definition 9(Bindingof Variables). is x ( , and can be read as “there exists”, “for some” or “for at least one”. The statement statement The one”. at “for least or some” “for exists”, “there as be read , can and assertion , the false xP xP )( 21 is a predicate then the assertion “for some some “for assertion the then is apredicate all “for assertion the then is a predicate x  for every choice of values of the universe we say that say we universe the of values of choice every for . The universal quantifier universal The . is x 

x ,,, and the the and , ) Let us assume the universe to be all integers ccc such that…”. It iswritten such as that…”. existentially quantified n that make that U ( ( xx xx xxP xP xx   ; otherwise, itisfalse. ; otherwise,  . esyta ) that We”. say eoe ) ” becomes “ xxx xxx quantifier. existential ]5[  ]5[   ]5[! x

xxx xP frwihteasrin ) for which the assertion ]1[ ]1[ ]1[ )( 

is astatementis true”) in which the variable xyxyx ][ x

such that…”, “there isexactly one them with logical operators. operators. them with logical  21    ( “for all” is written as all” iswritten “for . The existential quantifie  xxP . Propositions (2) and (6) are false. cccP . esyta ) thatsay ”. We n ),,,( ( . There are two ways of binding variables variables of binding ways two are . bound There Variablesof predicates can be bound by

xxP true  a proposition substitutingvaluesforthe by ! is . are said to said are true ( x xP , x i n nyi ) if and only if inis true”)astatement which the , )   xP and the following propositions )( ( xP ” (which means, “forall values satisfy  ( ” (whichmeans, “there exists xxP , and can be read as “for all”, all”, as “for read be can and , P is is r “there exists” iswritten r “thereexists”

P unsatisfiable inU x true . If. such that…” or“there i n nyi ) if only if and ( xP quantifiers x is validin is 21 universally  x . , ) , the , the cccP n ( ),,,( xP ( U

xP 15 15 ” ;

Draft - Not for public release (© Wolfgang Kainz) 3.3 16

Quantifiers and Logical Operators

also establish types of assertions involving predicate variablesofpredicate assertionsinvolvingestablish types also be evaluated as be evaluated variables, representing “ one variable, e.g., 5 In an to analogy contradictions tautologies, 17. Example different forms. of a variety on statements take can These operators. logical and predicates quantifiers, mathematicalWhen weexpressnatural or 16. Example Therefore predicate. a to isapplied one quantifier than more when The order inwhich the variables arebound is the sameas theorder in the quantifier list 15. Example predicate must beboundpredicate intoAll variables a toa transform proposition. Ifinan n the proposition is anoddnumber”, means, “There is a person so that everyone is childthe ofthis person”. following examples show how assertions can be expressed thein language ofpredicate logic. is that we can always replace replace always can is thatwe meaning of an assertion. For thenotion of predicate variable, seefootnote 4 on page 14. (d) The only even prime number is two. two. is number prime even only The (d) f Not allprime numbers are odd. (f) e There is only one even prime number. (e) b Every integer is even orodd. (b) (c) All prime numbers prime arenon-negative. All (c) g Ifaninteger is not even, thenit is odd. (g) a There exists an odd integer. (a) assertion true. Two assertions Twoassertions assertion true. Itmake true. is it satisfiable is variables predicate involving Definition 11 (Validity of assertions with predicate variables). propositions Definition 10. 1 m variables are bound, we say that the predicatehas

if there exist a universe and some interp some and universe a exist there if Let the universe betheintegers and If predicate The 2   If theuniverse x valueis assignedpredicate we the 2,getthe then  yxP unsatisfiable ),( xxP xN denotes the predicate “ 2 cPcPcP)( )( 3 and “  yxyPx )()()( ),( x   means,“Everyonethe is child of someone”, whereas  is a non-negative integer”, and yxyPx  )],([   zy  yx . The order of the quantifiers is the The orderof . , respectively. , respectively. ”. ”. as has meaning thesamenot if there is no universe and no ifthere is nouniverseand  zyxP A xxP ),,( valid yx 1 )(

rpeetn “ representing and U by by as can bewritten consists of the elements elements the of consists if it is true for every universe. An assertion is is Anassertion universe. truefor every ifitis  A 2    are are x d contingencies ind contingencies pr is child of is xy , and language statements, we generally need need generally we statements, language logically equivalent xxO xE )( x )(

 retations of the predicate variable variable that of thepredicate retations denote “ denote      y   y  xOxEx ” in the universe ofallpersons. Then xPxEx yx z )]()([ xNxPx )]()([! )]()([ ” hasthree variables. webind If by by xOxEx xOxPx

1 )]()([ )]()([

x interpretation that make the xP , or )( is aneven number”, 5 xxPxEx  not arbitrary. It affects the the affects It arbitrary. not nm “  .   x   opositional logicwecan xy a is prime number.” The if for every universe xy ]2))()([( 2

. . The only exception exception . Theonly

free THE MATHEMATICSOF GIS ccc An assertion 321  ,,, variables   cPcPcP zyP ),,2( 3 )()()( free two with , thenthe  xOxPx )]()([   yxyPx

),( and . has to to has -place xO )( “ yxxPy x ),(

Draft - Not for public release (© Wolfgang Kainz) PREDICATE LOGIC 3.4

Compact Notation logical equivalencies (3) and (5) of Table 5 above. 5 above. and(5) (3) logical equivalencies ofTable nega the propagate also to allows notation Forassertion the “forevery isused. notation simple assertions inmathematical language here presented as notation logical of form The disjunction the quantifier over distributes existential the show that (11) (13) and not. does quantifier existential but the conjunction, distributesthe over quantifier Statements showand (12) theuniversal that (10) quantifier. whose variables are not bound a quantifier by can also be removed from the scope of this be scopeof aquantifier,it can Equivalencies (6), (7), (8)and (9) tell usth sequence of quantifiers. The (3)and logicalequivalencies (5) canbe a usednegation to through propagate signs quantifiers. involving assertions between and other relationships equivalencies of logical alist Table5 shows 18. Example The way we write fortheasse wewrite way is quantifier. 13. 13. 12. 12. 11. 10. 7. 6. 5. 4. 3. 2. 1. 9. 8. re true. variables and interpretation ofthepredicate every scope  xQ )( . xQxP of a quantifier asser of the isthepart )()(   . In the assertion assertion the In .

In theassertion xPxx   )]()5[( xPxx )]()0[(  i h ogntto n ) innotation thelong and   Isedw a rt ncmatntto ) . Insteadwecanwrite compact notation in Table 5. LogicalTable relationships 5. involving quantifiers xxPxxP )()( xxPxPx xxPxPx )()( )()( rtion “thereexists an cxxPcP ccPxxP x     such that that such QxPxQxxP removed from the scope of the quantifier. Predicates Predicates thequantifier. of scope the from removed QxPxQxxP QxPxQxxP QxPxQxxP ])([])([ ])([])([ ])([])([ arbitrary an is where),()(  ])([])([ arbitrary an is where),()(

    xxQxxPxQxPx xQxPxxxQxxP  )]()([)]()([ xQxPxxxQxxP , but the universal quantifier does not. not. quantifierdoes universal butthe , )]()([)]()([ xQxPxxxQxxP )]()([)]()([ )]()([)]()([ x

xQxPx tion sign through quantifiers as mentionedthroughtion sign quantifiers as in  )]()([ at whenever a proposition occurs within the within occurs a proposition at whenever xxQxxP . Therefore,. acompact formof logical  0 )]([)]([ is often too complex toexpress oftentoocomplex is relatively the scopethe universal of quantifier is tion for which variables are bound by this by bound are variables which tion for , ) the scope of x  5 ( x xP ( sc that such xPx write have to we would is true”  universe theofelement universe theofelement in the notation.compact This AA 21  , i.e., , i.e., is x   x A xP 5  )( 1 0 ad ) and is trueiff and the scope of ( xPx . In thesame ( xP i true” is A 2 is  17 17

Draft - Not for public release (© Wolfgang Kainz) Exercise 8 3.6 3.5 18

Exercises Exercises in Applications GIS

(h) All students of this course are happy if they pass mathematicsthe (h) exam. (university students) When isdaylightit (animals) somecats areblack. (g) When isnightit cats(animals) all areblack. (f) Let selection as a predicativeselection asa setexpression of i.e.,itdesignates the predicate, general a property tuples,andcan thus wewritethe arcs in a topologically structured structured topologically a arcs in (e) If (e) If There are areas, lines, and points. (geometric figures) (d) Allcats areblue. (animals) (c) Someblue.(animals) cats are (b) If three isodd, some numbers are odd.(integers) (a) parentheses): Translate the following assertions into the notation of predicate logic (the universe is given in SELECT* FROM ARC WHERELPoly ='A'or RPoly ='A'; weusethese database technology, In relational denote the select operator as operator select denote the wecan (orgeneral, selectioncondition. In a given records) in arelationthat satisfies translation of this selection eeto odto ih ) ( selection conditionwith  (LPoly = 'A' OR RPoly = 'A') = RPoly OR 'A' = (LPoly ARC(ID,StartNode,EndNode,LPoly,RPoly) x is greater than (ARC) y and  y results in all arcs that form the boundary of polygon A. A A. polygon of boundary the thatform arcs inall results is greaterthan z into standardSQL reads as t  and selection condition R

a condition is for thename. Theselection relation {|()} Rt tR , then x , then (relation name)(relation  data set. The The set. data  lectoperator toselect asubset of tuples is greater is than . be a relation schema describing describing schema bea relation or  z  . (integers) . (integers) () t () R selection operator THE MATHEMATICSOF GIS when we substitute we when t

Draft - Not for public release (© Wolfgang Kainz)

19 19 CHAPTER 4 can be shown to be true. These asserti These true. to be can beshown assertions derive axioms, we statements. From that these true given unquestioned of aset are that ofaxioms a set assume we system, mathematical In aformal this is casenot thentheconclusion the cannot drawn be from the hypotheses. atruth of theorem. established the which argument, T

Logical Inference conclusion follows logically logically from follows conclusion the premises,isvalid.If theargument a setofpremises hypotheses)(or isdrawn. Ifthe aconclusion from Starting argument. alogical of concept chapterthe introduces his ons are called theorems. A proof theorems. is an ons arecalled

Draft - Not for public release (© Wolfgang Kainz) 4.1 20 4.2

Logical Arguments Proving Arguments Valid in Propositional Logic Logic Valid in Propositional Arguments Proving

where the the where P tautological form. The procedure is straightforward: straightforward: is procedure The form. tautological Ininference. thefirstcase,anargument of rules using tables or truth using twoways, in valid proven be can arguments general, In All men will adore Lisa. ofinferenceThe rule applied isoftheform Conclusion: 19. Example Logical argumentswrittenistheformusually of are will adore Lisa”. adoremenLisa” will “If Lisaisbeautiful,all th weassume forinstance, If, assumptions. these from a conclusion andwedraw true, assumptions certain are we that Often assume them properly. properly. them inference, of rules applying of case the In Note, that the more propositions are involved P 2 1 If Lisa isbeautiful, all men will adore Lisa. Lisaisbeautiful : : logically from logically the premises. beto be true. to said Anargument is of inference (or Definition 12(Logical Argument). (i.) (iv.) (iii.) (ii.) premises

P

Evaluate the tautological form using a truth table. table. using atruth form tautological the Evaluate variables. thepropositional using itstautological form in argument the Write propositional thepropositions. Assign variables to allpropositions.Identify i are the premises and and premises the are The argument The argument aboveiswritten presented as specify which conclusions can be drawn from assertions known or assumed or fromknown bedrawn assumed can assertions which conclusions specify ) that are assumed true. The The true. assumed are that ) P   Q QP

Q

istheconclusion. A logicalargument valid (or  conclusion  P P P the trickisto findthe right rulesandapply at thetwo“Lisais statements beautiful”and 1 Q 2 n are true, then wecanconclude “All menthat themore tedious procedure the becomes. has tobe intotranslated its equivalent

correct follows from thepremises. follows ) when the conclusion follows follows conclusion whenthe ) consists of consists a set of THE MATHEMATICSOF GIS hypotheses Rules Rules

Draft - Not for public release (© Wolfgang Kainz) 4.2.2 4.2.1 LOGICAL INFERENCE

Proving Arguments Valid with Rules of Inference Valid of Inference withRules Arguments Proving Valid Tables withTruth Arguments Proving tautological form and the name that was given to them by logicians. logicians. by them to given was name that and the form tautological th 6shows Table invalid). (argument reached written as a propositional formwritten asa the tautology, thetautology, argumentcorrect. is 6 21. Example one other the choose then you notavailable, one knowthat is havetwooptionsand thatyou says you if simply for instance, syllogism, The disjunctive evident. are of inference rules Some ofthese until conclusion theto thepremises follows A second wayvalidargument isto to provean 20. Example logical Every argument with is a tautology is left to the reader. and Most people agree would that even dogs or cats know this.    Q   P P P Rule ofinference P Q modus ponens Q Q     P     Q P QP QP   “all men adoreLisa”.has It the tautological form RP   QP QP QP RQ  QP QP

SQ RP

SQ 

RP

Theargument Example in 19 abovecontains thepropositions Theargument presentedin Example 19astraightforward above is application of   . SRQP SRQP )()( )()(

6 .

[ )(   n Table 6. RulesTable 6.ofinference QPP ( PQP premises premises )( )](

])[(  )]([  Tautological form  QPQP 21 QQPP )()( QPQP

 

PQPQ (argument valid)or the

apply rules of inference. They are applied applied are They inference. of rules apply e moste important rulesof inference, their n 21  )   RPRQQP ,,, ][)]()[( PPP QPPP 

n . Ifthispropositional form a is and the conclusion conclusion the and  SQRPSRQP ][)]()()[(

)]([       RPSQSRQP ][)]()()[( conclusion cannot be QQPP syllogism hypothetical dilemma constructive modus ponens conjunction modus tollens dilemma destructive syllogism disjunctive simplification simplification addition “Lisa is beautiful” beautiful” is P “Lisa . Theproof . that this Name Q cn be can 21 21 Draft - Not for public release (© Wolfgang Kainz) 4.3 22

Proving Arguments Valid in Predicate Logic

is truefor oneparticular element of the unive true. Theexistential generalization allows us straightforward application of the ofthe application straightforward attractive I were allwomen would run afterme”, therefore “Iattractive”am not ais A formal proof of argumentthe is as follows: Let Therefore, JohnWilliamshasa brain. 23. Example universepredicate isonethe forwhich true, element that there The from existential instantiation concludes the holds. universe, then the universally quantifiedgiven the elementassertionof every for valid is apredicate that prove wecan if that toconclude us permits generalization universal The universe. in agiven universe, fromisalso that one individual it then validfor The instantiation universal allows us to conclude and predicates quantifiers. quantifiers,7 weneedmore rules.Table s When wewantprove the to validityofan 22. Example denote John Williams. Then the logical argument can be expressed as: John Williams is a man.Williams a John is Every manhas abrain.  3. 2. 1. 4. Assertion Assertion  xxP )( WM xM istrue. WB )( )(.2 denote the assertion “ Rule ofinference WB )(.3 WM

)(  )(

 Inthe same way as abovethe argument that “Women dorun not after me”, “If and Let us consider the following argument:   

   Table 7. RulesTable 7.ofinference involvingpredicates andquantifiers  cP xP xBxMx cP cP )( xxP )( xxP )]()([.1 WBWM )( )( xxP )( xxP )( )(

)(

)()( xBxMx

)]()([

x is a isman”, modus tollens modus

universal generalization universal instantiation existential instantiation existential generalization Step 1 and universal instantiation instantiation universal and 1 Step Hypothesis 1 Hypothesis Steps 2 and 3 and Hypothesis 2 Hypothesis hows some of the rules of inference involving involving hows some ofinference of therules . xB )( rse, that the existentially quantified assertion quantified existentially the that rse, denote the assertion “ to conclude from the truth that a predicate trutha that to concludefromthe argument that contains predicates and and predicates contains that argument truth thattruth there is atleastoneelement of from the fact that if a predicate is valid isvalid ifapredicate that fact from the Name modus ponens Reasons Reasons x has abrain”,and

THE MATHEMATICSOF GIS c o hc ) for which W ( cP

is is

Draft - Not for public release (© Wolfgang Kainz) Exercise 9 4.5 4.4 LOGICAL INFERENCE

Exercise 11 Exercise 10

Exercises Exercises in Applications GIS

P2: 6 is even. even. is 6 P2: 7 If 6 is not even, then 5isno prime number 5 isaprimenumber. Conclusion: P1: I donot travel west and I reach the USA. Translatethe following argument into asymbolic notation and check iscorrect: if it USA. I reach then If Itravelwest the The Earth is notConclusion: a disk. If the Earth is a disk then I do not reach the USA. P3: P2: P1: table: I failed the mathematics exam. Translate the following argument into a symbolic notation and check if is it correct using a truth study. I soccer, play not Ido If Conclusion: I played soccer. If Istudy well, Iwillnot fail in the mathematics exam. P3: P2: P1: Translatethe following argument into asymbolic notation and check is correct: if it straightforward application of the this If given isthepremise. case,thecons match they a if anddetermines thedatabase in the givendata examines engine inference Rules arestoredasimplicatio spatial data. and tuned for designed are that systems are rule-based systems (SDSS) support decision Spatial geosciences. the in applied widely are and systems, expert called also are systems Rule-based systems apply rules to data pr predicatelogic. general in arguments ofproving theory deeperthe into notgo do We prime number Aprime isany natural number ns The in then form”. “if the modus ponens modus n that canonly be divided by 1 and ovided using an inference engine. These engine. aninference using ovided equence is appliedequence is accordingly. Thisa is . 7 . n . 23 23 Draft - Not for public release (© Wolfgang Kainz) Draft - Not for public release (© Wolfgang Kainz)

25 25 CHAPTER 5 explained. are anddifference intersection, as setunion, fundamental principlThe sets. operations on and relations sets between ofsets, intuitive weexplore definition Starting froman is complicatedmorebeset and willnothere. theory discussed S

distinguished distinguished objects. Aformal axiomatic foundationof and definition ofwell- collection a as perceived are intuitively They theories. many of etsfundamentalaremathematical very buildingblock the Set Theory Set Theory es of subset and set equality as wellas equality set and subset of es

Draft - Not for public release (© Wolfgang Kainz) 5.1 26

Sets and Elements and Elements Sets

as } called numbers more rational numbers than integers. beuncountablesaid to infinite.morereal There numbers are thanrationalthere are numbers.An (pronounced zero asaleph n revral, 10} | { variable, afree and 9 8 27. Example 26. Example 25. Example 24. Example of elements cardinality). (or number as the is defined This measure. a need we set a of “size” the to indicate order In its elements. The set Afinite aset. tospecify ways many are There G by developed was theory Set maps the natural numbers to something that should not occur in a formalsomething a not system. thatshouldoccurin therepossibility isthe theory set naïve set theory. This is a more Thisset theory. intuitive isa approach (Figure 3). aua ubr o oe (nldn empty the set is for set).A (including some for either finite or countably infinite. natural numbers A set is Alephis a character in the Hebrew alphabet. written as written Definition 14 (Cardinality). null a numberit call ofelements we as written member anelement ora ofthe is called An set. the collection element Definition 13 (Set). A  countably infinite countably or  finite void are all fractions of the form form the of fractions all are

The cardinality of the real numbers The cardinality ofthe integers The naturalnumbers The set if there exists correspondence toone ifthere aone between itselements andasubset of the set and is denoted setandis as denoted S 1 ,,} , 2, {1,  || . Sx  . If . x x Axx 9 ,8 , 7 , 6 ,5 , 4 ,3 , 2 ,1 { n .   A A set is a collection of well-distinguished objects. Any object of object of Any objects. of Aset a collection well-distinguished is 9 The proof isusually established by finding a one-to-one function that 8 x consisting of the natural numbers , orwecantheset describe meansimplicitly by of apredicate ). Everyset ). of amember is not S xxA . The  EORG Figure 3. V n  {} finite

are an infinite set. Theirare aninfinitecardinality set. is denoted as cardinality S or b a C that hasthesame cardinality asthe natural numbers is set. set. A setno with iscalledthe elements where where ANTOR   . We can also draw a set withaV set a draw . Wealso can . A and therationalnumbers ENN than the axiomatic set theory. However,in theaxiomatic settheory. than for logical contradictions paradoxes), (or n set canbespecifiedlistingexplicitly by all S  ab (1845-1918) as what we call today naïve naïve call today what we as (1845-1918) English theofcharacter a is |{  aset of , diagram w write we 0 is denoted as   . alphabet}

S is the number of its elements, itselements, of number the is smaller than 10 smallerbewritten than can  Sx c hscriaiy 26 cardinality has (the continuum). They are . Ifa . set hasafinite  THE MATHEMATICSOF GIS is x of a set a of  countable 0 ENN . Therational A empty diagram diagram ||  S if it is ifit is , .  0

Draft - Not for public release (© Wolfgang Kainz) 5.3 5.2 SET THEORY

Operations on Sets Relations betweenSets Since itdoes not matter how often an element is repeated, the number elementsof is three. Although the empty set has cardinality zero, here itappears as an element of set (ii.) (iii.) Example 30. Example In thefollowing,consideron we operations setsthatuse( given sets (i.) relationships: and their of sets the canbederived definitions from statements The following inanother. set one of the containment Weknow betweensets,subset two relations an 29. Example 28. Example a new set( new a (iv.) be distinguishable. In In distinguishable. be

Definition 19 (Complement). (Difference).Definition 18 disjoint is theset (Intersection).Definition 17 Definition 16(Union). Two sets a set subset Definition 15(Subset).

\ BA The empty set is subset of every set, or for any set any for or set, every of subset setis The empty If For set any If A of ) is the set ) is . a U resultant A

B proper subset h adnlt ftest {1,1,2,2,2,3} The cardinality ofthe set The following Venn diagram illustrates the operations The set A  is the ofdiscourse,universe then , written as and |{ B and ). ). B  A A    are equal written as written equal are A ,  AxxAUA , elementappears 1 twice, 2appearsthree times,andappears 3 once. A {} |{  }|{  of The  If each element of a set aset of element each If  , where , where  CB BxAxxBA  has one element, the empty set. Therefore, its cardinality is 1. A } B , then The . |{ . BA The when when  union . The  U  B difference intersection is the universe of discourse. ofdiscourse. is the universe A is called called is BxAxxBA  oftwosets  A }  complement . If.  CA  A . B BxAxxBA  } of two sets sets two of and . superset B  oftwosets if and only if d equality. Thesubsetd equality. relationrefers to  A A BA of aset of A UA  and  is anelementof aset is 3,because the elementsof aset must of B  . . , we say that thetwosetsare we say , A B A and , written as , written A A , written as , written A , A and , written as   B  , written , written as B B and A operands  , written as . CBA A . B   A A B  . B AB , is the set , is the then A is the set A . We. call ) to produce produce ) to  . A B  A (or is B

27 27 Draft - Not for public release (© Wolfgang Kainz) 28

Union and intersection can generally more can be definedUnion andgenerally intersection for than two sets. Let arbitrary finite or infinite index set. Every elementEvery set. finite index orarbitrary infinite union equivalent form in the language of logic. oflogic. language inthe form equivalent into their translating them by proven easily Table 8 summarizes some of the most canbe importaoperations. They nt rulesforset the 15. 15. 25. 25. 24. 17. 16. 13. 12. 23. 23. 22. 29. 29. 27. 27. 30. 30. 18. 18. 26. 26. 28. 28. 21. 14. 14. 20. 20. 19. 31. 31. 11. 11. 10. 10. 1. 5. 3. 7. 6. 2. 9. 8. 4. intersection of the the of If If If If If If If If U A A A A A A A A A A A A A       B U  A B B B B B AA AA A A 

B B B B    

    i  )( )( ofthe as is defined UAA then then then and and  UUA B B AA A A A AAAA AUA  B AA A ABA

   

)( )(

   B B A A A A  A  

  i 

as    DCDC   B B BAABA then then   

 Table 8. Rules forset operations  Ii B   A    U   Ii

CBACBA CBACBA i i )()(

     CABACBACABACBA CABACBA CABACBA )()()()()()( A

)()()()()()(  [|{

[|{ C   B DBCADBCA )()()()( 

  AxIiixA AxIiixA i Ii i ]}

D commutativity

distributivity

associativity ]} aset has assigned E . . In the same way we define define we way same In the . M

ORGAN ’s law ’s law THE MATHEMATICSOF GIS A i , thenthe I be an an be

Draft - Not for public release (© Wolfgang Kainz)

5.4 SET THEORY

Applications in Applications GIS losu ordc h ubro prtost w s ) ( asto two operations of number reduce the allows usto operations ofdistributive set law the However, operations. overlay three need This would complex of spatial features. NO i oe union cover incover UNION NESC i oe intersect cover incover INTERSECT 10 the results. Theseoperations amount of of AandBtheintersection intersection ofoperations. For if wehaveexample, number reducing the operations spatial by overlay used tosimplify laws canbe distributive The order. inarbitrary union and intersection laws commutative and associative The type. it Normally, does notmatter in which sequenc ERASE in of arebasedoncombinationsIDENTITY OtherArcInf notation. mathematical in setoperations andthecorresponding commands overlay theTable basic ArcInfo 9 shows complement. and difference, union, intersection, toset correspond operations overlay sets, as regarded be can polygons and arcs points, as such features spatial Since analysis. most common the among are operations Overlay 31. Example a power of set with set If a theset is power finite, set set. of thepower definition to the istolo insettheory Another important concept as In set theoretic terms, this corresponds to the universe of discourse of the universe to this corresponds terms, Intheoretic set that containsallfeatures of (or our data set polygon embedding an have always we aGIS, in features polygon with deal When we always elements ofthe power set. embeddinganfor topologicalthe cell we need also spacefor reasons se that will we 9 In Chapter denoted as denoted Definition 20(Power Set). A omn B Set A Command 

The power set of The powerset  A )( . n elements has Table 9. ArcInfo Table overlay 9. commands A The set of all subsets of a set of aset all subsets The setof  is finite; if a set is infinite, is if a is finite;infinite, set cover erase }3,2,1{ t h olwn e prtos()() ( ) ( operations set following the to with three elementshas 2 n overlay and graphical clip operations. operations. clip and graphical overlay elements. o functions such o functions as CLIP, UPDATE, and }}3,2,1{},3,2{},3,1{},2,1{},3{},2{},1{,{)( coverage). Often it is called world polygon. polygon. is calledworld Oftenit coverage). A and C, and finally, compute the union of of union the compute finally, and C, A and for set operationsallow theapplicationfor set of e we apply overlay operations of the same thesame of operations overlay apply e we . Notethat emptythe set and theset itself are ok at the subsets of a given set. This leads leads This set. a given of subsets at the ok three data sets A, B and C. We need the the We need BandC. A, sets data three functions that aGISprovides forspatial A cover  the power the set isinfinite. The BC A  3 is the is  10 82 . . elements and iswritten power setof A  BAC Operation Operation A A AB    B B

A , 29 29 . Draft - Not for public release (© Wolfgang Kainz)

Exercise 15 Exercise 14 Exercise 12 5.5 30 Exercise 16 Exercise 13

Exercises Exercises

(iii) (iii) (ii) (iv) of The powerset (i) following: the Compute sets. are Let (b) (a) } Specify the power setforeach of the following sets: V the following in Highlight V the following in Highlight V the following in Highlight (c) U U U      }{ CB

CB ,,{ AC cba

A A A

cba }}{},,{{ C

B B B gfedcbaU  },,,,,,{ CB be the universe, . ENN ENN ENN

diagram diagram diagram

A    BA B . .  CBA )( . edcbaA },,,,{ ,  gecaB },,,{ and THE MATHEMATICSOF GIS  gfebC },,,{

Draft - Not for public release (© Wolfgang Kainz)

31 31 CHAPTER CHAPTER 6 two sets. are They between relations relations only. with we dealbinary this chapter, only In ofordered sets. theory for the the basis is latter one objects; the used to classify relationand animporthe order relation, play ofrelations, equivalence Twospecial the types elementssets. ofdifferent involve mayobjects ofthesame betweenrelationships refer orthey set, toacomparison a commonunderstandingofrelationshipsbased onobjects.These among R Relations andFunctions relations as the foundation of mappings and functions. Relations are Relations are functions. mappings and of the foundation as relations fundamental principleof the will Cartesianproduct we introduce the on Based mathematics. in concept important avery are elations tant tant rolemathematics. in The firstis

Draft - Not for public release (© Wolfgang Kainz) 6.1 32 6.2

Cartesian Product Product Cartesian Binary Relations Binary

(b) here to binary relations between two sets. two sets. between relations binary here to Althoughgenerally are relations 10. Table in listed are product Cartesian the of properties Some i.e., isnotcommutative, product Cartesian The 33. Example 32. Example }. France>}. , ,

Consider the sets Let B CA A , denotedas 123  Figure 4. Non-commutativity ofthe Cartesian product  and A 4. 3. 2. 1.

 }2,1{ Table 10.Propertiesof theCartesian product B ,  A  = {Vienna,A = Amsterdam} andB={Austria, Netherlands,  definedmorewith thantwo sets, we restrict ourselves  B baB },{ BA , is the set of all , is pairs the setofall

and six elementsis thesetof {, , ,  . Then . Then babaBA A . Then the cross products products . cross Then the  1 2 3 } ,2 , ,2 , ,1 , ,1 {        

,| 01} 30 |2 {, BBA      CABACBA CABACBA BACACBA BACACBA )()()()()()( )()()( )()()( 

123 (or (or . This can be easily seen in  |,{ cross product cross B   rdam, Netherlands>, A THE MATHEMATICSOF GIS  BbAaba } ) of two ) of two . can be be can

Draft - Not for public release (© Wolfgang Kainz)

6.2.2 6.2.1 RELATIONS AND FUNCTIONS 6.2.3

GraphicRepresentation of Binary Relations Predicates and Relations Special Properties ofRelations ( France}. The set The digraph is represented by the following diagram. driven by.” {, ,} isthe relation inverse that“is canbereadas the arcs are directed, we call the graph a a graph the call we directed, are arcs the i.e., that can be read as “is capital of.” of.” capital as“is read be can that 11 properties. defines Thefollowing these list detail. im so are relations binary of properties Some 36. Example (or digraphs directed graphs It tois oftenrepresent For convenient graphically. will use relations we this purpose, binaryEvery relation 35. Example 34. Example cars. define a relation arelation define the universe of discourse. Ifthe relationdiscourse. is universe of the P arcs A graph is defined by two sets and , the set of ,the and A graphdefined is by sets two stu fadol f , is true ) if and only if , ( aa relation Definition 23 (Inverse Relation). over 22 (BinaryRelation).Definition A 12 orlines xRy = R {, , } is a relation “drives a.”Then   1 , also as also , B A , we use the following digraph representation representation digraph following use the we ,  . set The  (or ,ada niec eaino that describes which nodes are connected by edges. If ), and an incidence relation on

A Let Let Considerset the Rba , we callit arelation = {John,A = Ann, Frank}= {Mercedes, B and BMW} be setsofpersons two and R C inverse such that ={, } relation isa over  A R aRb on a set on is calledthe )  R , and dcbaA = A {Vienna,= Amsterdam} andthe set RbaabR 11  },,,{ RaaPaa 1 V },|,{ ). If there is a relation between the two elements elements two the between arelation is If there ).  be a set and   . the relation over definedas is aR aa  A xy { , | ( , ) is true} ) , ( | , { 12 on corresponds to a predicate with two variables and and variables two apredicatewith corresponds to directed graph directed , is written as written is ,

a 212 12 A E c A Let VV   domain .  Rba binary relation . Likewise, if a predicate ifapredicate . Likewise, R Racbbbc of portant that mustportant discussedmorethey bein over be a relation  . given, the predicate can be defined as the candefinedas given, be predicate {,,,,,} nodes  R b d ; ( B

points

aR i the is R

b over . or . If therelation is defined vertices codomain = {Austria,B Netherlands,=

A A   B B B ) and set the of P  . The is asubsetof a relation on is given we can isgiven wecan A . Wewrite sc that such inverse inverse x and and edges R A  -1 A as y = BA 33 33 , .

Draft - Not for public release (© Wolfgang Kainz) 34 6.2.3.1

Equivalence Relation

equivalence relation divides divides a relation set equivalence (d) (c) (a) A reflexive, symmetric and A reflexive, symmetric 37. Example If inthegraph ofatransitive antisymmetricof relations. symmetric and graphs in the not, occur but need may, Loops graph. of the nodes distinct twoany between or noarc eitherone has arc graph the an antisymmetricgraph. relation For of the nodes two distinct any no between or arcs two relationhas either asymmetric of graph The reflexive nor irreflexive. In graph ofloop on anirreflexive relationhasno any node. A can be relation neither The graph. the of node on every a loop relationhas a reflexive of digraph The relations. of representation digraph a of characteristics certain in reflected are properties These (b) (e) there must also be an arc from from arc an be must also there

(v.) (iv.) (iii.) (ii.) (i.) that Definition 24(Properties of Relations). irreflexive or antisymmetric. It isnot irreflexive. relation on the set. set. the on relation R R R R R 1 5 3

2 4

isirreflexive and antisymmetric, but not reflexive, symmetric or transitive. reflexive,is symmetric,antisymmetric, equalitytransitive. the and is relation It theset. on is the universalrelation It isreflexive, the set. on symmetricand transitive, but not

is irreflexive, symmetric, antisymmetric and transitive. It is not reflexive. It is the empty empty the is It reflexive. not is It transitive. and antisymmetric symmetric, irreflexive, is issymmetricnotreflexive, but irrefl

R R R R R A Consider the set of three elements {1, 2, 3} and the relations represented inFigure 5. is . is is is is transitive if symmetric irreflexive reflexive antisymmetrix 1 R 2 1 if if if 1 3 xRx this case, it simply hasloopsthiscase, itsimply onsome nodes, but noton all. xRy xRx xRy if x relation, there is an arc fromarc relation, there an is transitive rela R 2 to z for every every for Figure 5. Sample relations 4 and for no for implies implies xRy S

. into non-empty mutually disjoint sets or or sets disjoint mutually non-empty into 3 yRz and 1 exive, antisymmetric, or transitive. x together imply imply together x Let yRx in in yRx R 2 tion iscalled 2 A for every for R A . together imply imply together be a binary relation on aset relationon be abinary . 3 1 x xRz R , 2 y 5 in x 1 equivalence relation equivalence for every to x A 3  y . and from R 2 y 3 for every every for THE MATHEMATICSOF GIS x 3

,, A zy . We say in equivalence y to x , A y z . An . , then in

Draft - Not for public release (© Wolfgang Kainz) 6.2.4 6.2.3.2 RELATIONS AND FUNCTIONS

Composition of Relations ofRelations Composition

Order Relation of the class class of the Every element representativeoneclass is a of of thisclass. (transitivity).The relation classifies the set oflines into the equivalence classes of parallel lines. an equivalence relation, because (i)forevery line The composition ofrelations becan illustrated 40. Example of composition the define we Formally, relations. composisequence of newrelationsby ng a generate We can 39. Example of aset. comparisonofelements allow the called relationis and transitive antisymmetric reflexive, A 38. Example classes relation. The set of all equivalence classes of ofclasses allequivalence set The relation. set if have Let lines 2 2 3 of on. on. new relationontheset A relation but is associative. of not commutative, The composition relations Definition 25 (Composition of Relations). R 21  2 RR S be arelationfrom BA , }  21 ll  under 21 and is defined as isdefinedas AA we have that if (reflexive), (ii) if (ii) (reflexive),

If If The subset relation between two sets isan order relation, because (i)for allsets we Let a 21 R ][ R isthe relation “is father of”, then .  R aset on dcbaA R CB , i.e., },,,{ be the relationthe be then dacaRR ,|{][ andset considerbe a  },,,{  dbbccbR |,{ relations asfollows. A A , Rxaxa B   number itselfany with to can becomposed formof times a },,,,,{ . For to  . CA where where   (transitive). C BA bcdbcbdaR || 12 R (parallel) on the set ofalllines inthe plane. relation This is . The . and  R },,,,,,,{ |||| llll  we oftenwrite a 1221 (symmetric), and (iii) if to betwo relations on RaaRS is anelementof }|]{[/ dcRR  composite relation . An element  AB },{ then it follows then it Let with a digraph as displayed inFigure 6. asa digraph with RR is the relation “is paternal grandfather of.” S l , we have have we (written as (written R 1 2 R 1 be arelation from 2 ,[ 1 , for order relation  || S from from ll R ay (reflexive), (ii)for everytwo and  RR ][ 1 / is called a iscalled BA RS || we write we (antisymmetric), and (iii) (antisymmetric),and ll ) is called the A 21 R and to i a equivalence an is  C . Order relations . Order A A , written , written as representative R cb R ba Bbb CcAaca RR || to R dabaaaR 2 ll 3 32 . Then ]},  , and so andso , dbbaaaR then B },,,,,{ .  quotient , and },,,,,{ , and and || ll 35 35 31

Draft - Not for public release (© Wolfgang Kainz) 6.3 36

Functions

to one, two to three, three to five, etc. (ii.) (iv.) (i.) relation from Example 42. Example 41. Example value the and codomain domain, the indicate must we a function specify correctly To mathematics. area relations. Functions areused special kindbinary They throughout of Let (iii.) where have a value. (d) is not a function because the argument 1 has more than one value assigned. assigned. value one than has more 1 argument the because function a not is (d) a value. have no functions.(c) and(d)are(c) not afunction is becausefor every notelement ofthe domain we finite, we can represent functions as digraphs. In the following Figure 7 (a) and (b) are functions; and a value must thedomain.all elementsof and avalue existfor function isthatforafunction itisnot possibl

xf the argument domain and aunique exists as written Definition 26(Function).

)(

R argument for every 1 be a relation from

Considersets the : Consider functionthe from the natural numbers theto natural numbers C xxf B BC AB : , is a binary relation from A to B such that for every every for to Bsuchthat A from relation binary a is , :  to a the 12)( )( )( . . This functionThis maps. all natural numbersthe odd to numbers. One ismapped  )( D )(  codomain BAf . Then statements. thefollowing true:are Bb sc that such R R R x A 1 2 1 . Note that the important difference between a relation and a and a relation between difference thattheimportant . Note A function R Figure 6. Composition of relations to    A off  2  B RRRRRRR . a RRRRRRR RRRRRRR ,  RRRRRRR

3121321 3121321 4342432 R

}2,1{ 4342432

is the is

2 and ,. We write and (  map argument R fba ,  e that an argument has more than one value, value, more one than has anargument e that 3 mapping be froma relation cbaB },,{ and b . When the . domain and codomain are or transformation the call we and ( ) value  baf B of the function for offunctionthe for to THE MATHEMATICSOF GIS ) C f from , and  Aa A f , there A to R

the the  4 B be a a be  ,

Draft - Not for public release (© Wolfgang Kainz) 6.3.1 RELATIONS AND FUNCTIONS 6.3.2

Composition of Functions of Functions Composition Classes of Functions of Classes Functions function function Example 44. Example developed forthem. soim are offunctions characteristics Certain 43. Example thedomainis equalto of second the function Note that a composite function d the ofthe isonly define when codomain firstfunction sequence of functions. In theas with way relations, wecangeneratesame newcomposing a by functions fx () bijection Definition 30(Bijection). injection Definition 29(Injection). surjection Definition 28(Surjection). but itis associative. functions.The of Definition 27 (Composition Functions).      1for is odd 0for is even ) if it is surjective and injective. and ) ifit injective. is surjective or if values, distinct have ) ifdistinctarguments

) if the image of the codomain is the image of the domain, or domain, ofthe the image is of the codomain theimage ) if Let Let  x x g 2 1 2 1 f : :{0,1}  xxgf   xgfxgf  composite function composite  ))(())(( 12))(( . Thisfunction. surjective,is but not injective. and the composite function function composite the and for all for (c) (a) with with A function Afunction A function Afunction Figure 7. Functions and relations be afunction fromthe integers to the set Afunction x inA b a b a c c  . The composition of functions is not commutative, isnotcommutative, offunctions . Thecomposition 2)( f xxg from

f from and f from  f. portant thataspecialterminology been has A Let gf f to A : fromis a function to  B A  2 1 2 1 is to B is called is and : bijective with with B  is called surjective iscalled  (b) aa BAg (d) xxfg   ( then injective one-to-oneonto and 22))(( . xxf : be two two be :  b a b a c c ( 1)( {0,1} (. A . Thecomposite. one-to-one  toC

 )  CBf dfnd with defined ( BAf afaf onto  )()( and and . , or or or or or 37 37 g

Draft - Not for public release (© Wolfgang Kainz) 38

graph more than once. becausethat thereintersect arelines donot graph the all.at intersects thegraph more thanonce. Therefore, thefunction isinjective. surjective,It is not bijective. bijective. Example 48. Example 47. Example properties of being surjective, injective or b the we can interpret numbers, tothereal numbers real the from offunctions thecase In 46. Example 45. Example is injective,surjective. but not horizontal line intersectsthe graph ofthefunctio surjective.The functioninjective,is not because thereare lines(e.g., Bijectivity Injectivity Surjectivity

osdrtefnto : Consider thefunction Consider the function : Consider thefunction : Consider thefunction : No horizontal line intersects the graph of the function more than once. more thanonce. function the of thegraph intersects line Nohorizontal : : Every horizontal lineintersectsth : Every horizontal line intersects the intersects horizontalline : Every -10 -5 f f f

 f   :      -10 15 -5 10 i h neeswt 1 in the integers with ijective intermsof the 5 in the real numberswith nteitgr ih 1 in the integerswith e graph of the function exactly once. exactly ofthefunction graph e with with n at least once. Therefore, the function is is function the Therefore, once. least at n graph of thefunctionat graph of least once. 5 xf x  102)( 10 )( graph of the function: function: of the graph y . No horizontal. line

 xxf 2)( THE MATHEMATICSOF GIS  0 xxf  ) thatintersect the . This. function is . Thisfunction  2)( xxxf 23 . Every . Every

Draft - Not for public release (© Wolfgang Kainz) RELATIONS AND FUNCTIONS

Example 50. Example 49. Example the graph of the function exactly once. Therefore, functionthe isbijective. surjectiveinjective. nor

osdrtefnto : Consider the function : Consider thefunction -4 - - 4 4 f -2 - - f 2 2     10 15 20 2 15 20 25 30 35 40 -4 -2 5 5 4 2 with with ( . Everyhorizontal . line intersects ( 2 2 2 )  )( xxf  xxf 2 4 4 4 . Thefunction. neither is

39 39 Draft - Not for public release (© Wolfgang Kainz) 6.4 40

Applications in Applications GIS

(i.) The converse of these statements is not true (iii.) end node relation is defined as as relationdefined node is end (ii.) (i.) In this example we have the set of nodes, arcs, and polygons defined as as defined arcs,andpolygons ofnodes, In theset wehave thisexample topological relations between and data set the Figure 8 showsatwo-dimensional relation). the rightpolygon relati node archasa the end relation); every and node start (the nodes withtwo a relation has arc Every polygons. and arcs, of nodes, Formally, we distinguish between the followi setting. in atwo-dimensional nodes, arcsand polygons to blocks correspond These building or spatial the are GIS. in animportantrole Relations play a bijection. functionis also then when defined only is function inverse The If functions. through composite also propagate of functions properties These special (ii.) (iii.) whereas the left polygon – right polygon relation can be writtenas – relationcan right polygon theleft whereas N f 

 converseof relation Definition 31 (Inverse Function).

g

1 ,3 ,5 6} 5, 4, 3, 2, {1, is a composite function, isacomposite then      If If If If If If Naabbccdde d d c c b b a a AN ffgghhijjef 6,, 6,, 5,, 5,, 5,, } ,1 , ,5 , ,7 , ,5 , ,4 , ,5 , ,6 , ,6 , ,3 , ,6 f f f f f f                   and and and ,1, ,2, ,2, ,3, ,3,{ ,1, ,4, ,2, ,4, g g g is bijective, then isbijective, then isinjective, issurjective, then } , , , , , , , , , , { between the building blocks of feature data sets. sets. data feature of blocks building the between relations topological g g g A are bijective, then then bijective, are then areinjective, then surjective, are  f bd h j ghi f abcde is called the is called a nodes, arcs and polygons. polygons. arcsand nodes, Figure 8. Topological relations 2 C g h f

f D is injective. Let is surjective and inverse function issurjective. 4 5 f f d E f 1   i j The best-known examples of relations in GIS in GIS of relations examples best-known The  . However,. wecanestablishthefollowing: b e g g 7 : g on with two polygons (the left polygon andpolygon (theleft twopolygons on with is bijective. isbijective. isinjective. ng relations among theelements ofthe set n {,,,,} , , , , { , and the function is abijection. The inverse is surjective. is 6  B g BAf f of of A P be a bijection from g  f is injective. is ABCDE , written as , written 3 c

f THE MATHEMATICSOF GIS  . Thestart node – 1 . A to B . The. ,

Draft - Not for public release (© Wolfgang Kainz) RELATIONS AND FUNCTIONS

easting and northing, respectively, as respectively, andnorthing, easting projections. Here, a point on the surface of the earth whose location is given as latitude as latitude is given location whose earth the of surface the on point a Here, projections. appear di Functions in many cannot be mappedat cannot all. Pole South the projection, thesecond In (b). point toa and aline (a) to mapped are Figu called singularities. are at all, mapped be cannot or mapped toaline on the earthis point wherea cases, These givenargument. for instance,map thepoletomeansa thereismorevalue aline,which for that thanone mapin the afunction is projection Not every Other types of relations are those among spatia ofrelationsarethose among Other types relations. 9shows and9). Figurethese interior (see chapter of boundary topological invariants betweensimple theeightrelations are examples  A PaCa bBb cAc dCdBeDeB  and longitude longitude and                 Bf Dg Ch Di CjA jC iE iD hD hC gA gD fA fB ,,,,,,,,,,,,,,,,,,,} {,,,0,,,,0,,,,0,,,,,,,,, (a) EckertIV Figure 9. Spatial relations derived from topological invariants  mappingmappedto rulesforthe asetoftwo is apointonby aplane Figure 10. projections Map with singularities inside equal meet disjoint fferent forms in GIS. One typical application is map map is application typical One GIS. fferent formsin atn (,) , ( = easting otig= ) , ( = northing

re two10shows the poles projections where f mathematical sense. Many map projections, projections, map Many sense. mathematical 1 f 2  l features in a data set. The best-known Thebest-known adataset. in features l spatial regions that can be derived from thatcanbederived regions spatial    (b) Azimuthal equal area equal Azimuthal (b)

overlap covers contains covered by

41 41 Draft - Not for public release (© Wolfgang Kainz)

Exercise 21 Exercise 20 Exercise 17 6.5 42 Exercise 23 Exercise 19 Exercise 18 Exercise 22

Exercises Exercises

In case the relation isnot symmetric or transitive explain why. relation isnot a function explain why. Determinecodomain (i) the of g f Let Let Let Let Let Let Let (i) transitive. Check theserelations whetherare they reflexive, (iv) (ii) ) (iii) (iii) h h R R R R g g ={<1,3>,<2,5>,<3,3>,<4,1>,<5,2>} f f ={<1,4>,<2,1>,<3,1>,<4,2>,<5,3>} 1 3 4 2 2 f W X X R and f 1 :     and  g  be functions be from   baA },{ R CBACBA ()( , 2 )()( be defined be as be relationson aset B }4,3,2,1{ }4,3,2,1{ }4,3,2,1{

  . Which one ofthe following relations is a function from . Which one ofthe following relations is symmetric and which one is transitive? on relations following the consider and  CABA  CABA  }2,1,1,1{ )()( }4,2,3,1{

}3,2{ and    } 1,1 , 2,4} , 1,1 1,3 , { 2,4 , 1,3 {  } 1,4 , 3,2 , 1,1 { } 3,3 , 2,2 , 1,1 {   = {1,2,3,4,5} in in {1,2,3,4,5} X =

C f and    dcbbcbdaR   g . (ii) Determine 

}4,3{ 2 },,,,,,,{ . Compute: . Find.               } 4,4 , 1,2} , 4,4 4,1 , , 1,2 4,3 , , 4,1 1,2 , { 4,3 , 1,2 { } 4,4 , 2,3} , 4,4 1,2 , , 2,3 4,1 , , 1,2 3,2 , { 4,1 , 3,2 { xxxf

 23)( X defined as: irreflexive, symmetric, antisymmetric, or or antisymmetric, symmetric, irreflexive, . Compute RR dcbaA 21 },,,{ , where  W RR fg 12 and , : R 1 1 2 , and   h gf  . R 2 3 . xfhxf X )()( THE MATHEMATICSOF GIS . to X ? In? case the ,,,,,{ dccaaaR  } and

Draft - Not for public release (© Wolfgang Kainz)

43 43 CHAPTER CHAPTER 7 A

spaces orspherical coordinate systems fo space. Euclidean a features in geometric to applied transformations features.this Inchapter, wewilldisc tothesein coordinates ordertotransformations shift, rotate, scale orwarpthe toapply referenced Often,itis coordinates. spatially necessary through their Spatial features a such as points, arcs bodies usedtoapproximate are geometric the the earth. shape of systemscoordinate andfor thesurface anellipsoid. ellipsoid The sphere the of Transformations Systemsand Coordinate coordinate systems such as Cartesian coordinate systems coordinate Cartesian as coordinatefor Euclidean systemssuch ofspace, type onthe Depending be uniquely spacecan in llpoints uss frequently used coordinate systems and and systems usedcoordinate frequently uss nd polygons as well as raster cells as are aswellraster polygons nd r the surface of a sphere and elliptical elliptical and asphere of surface the r we distinguish between different between we distinguish referenced theirby coordinates.

Draft - Not for public release (© Wolfgang Kainz) 7.1.1 7.1 44

Coordinate Systems

Cartesian Coordinate Systems Coordinate Cartesian

the Figure 11 illustrates these coordinates. Cartesian hncerydfndb h rpe ) , , ( then clearly defined the by triple Cartesian coordinate system in definingaCartesian by space in coordinates 3-dimensional to plane the in coordinates 2-dimensional the extend easily We can plane real In the coordinates. real-valued has point the (alsocalled space real three-dimensional two- or a chapter, this wedealwith In systems. coordinate polar and Cartesian systems coordinate comm most The numbers, itscoordinates. system A coordinate functions to any assign a point in the real plane. We define a single point point single a We define plane. real the a point in lines throughthat point, the xy ,  y -axis. Every point Every -axis.  pair On assigned. ofthe otherhand, realnumbers every  Figure 12. Cartesian coordinate system in3-D space Figure 11. Cartesian coordinate system inthe plane 2 every point point every y-axis x-axis P axes is uniquely defined by its z-axis O . The horizontal axis iscalled axis . Thehorizontal x O

yz P y of realnumbers pair unique a has of Cartesian coordinates (Figure 12). 12). (Figure coordinates Cartesian of x on coordinate systems are rectangular or or rectangular are systems coordinate on z point in space pair ora of triple real P(x, y, z) P(x, y) x O y , the x-axis y-axis Cartesian Euclidean space Euclidean , and twoperpendicular, origin x -axis, theone is vertical ,) (, 

x coordinates 3 THE MATHEMATICSOF GIS y . Every point defines uniquely uniquely defines ) where every ,) (, x ( ) (,

P y xy with P is .

Draft - Not for public release (© Wolfgang Kainz) 7.1.2 AND TRANSFORMATIONS SYSTEMS COORDINATE 7.1.3

Polar Coordinate Systems Systems Coordinate Polar Transformations between Cartesian and Polar Coordinate Systems Coordinate Systems Cartesian andPolar between Transformations plane is thendetermineditsby expressed by the following correspondences: correspondences: the following by expressed The relationships between system (or coordinate In polar athree-dimensional point They are defined in apolar coordinates. the in a point assigning of way A different positive between projection ofthe 13). (Figure polar axis radiusandthe between the P theradius by is defined O , the z Figure 15. Conversion between Cartesian and polar coordinates in the plane -axis (Figure 14). (Figure-axis 14). origin orpole Figure 13. Polar coordinate system in theplane y-axis OP Figure 14. Spherical coordinate system , and a line through the pole, the pole, the through a line , and x x r and from theorigin to the point and two angles: the angle onto the the onto distance from the pole, the radius y O z O and and O   x   , r y r and coordinate system which is given by a fixed a fixed by given is which system coordinate x r r -plane, andangle the plane unique coordinates is the use of polar istheuseofpolar uniquecoordinates plane  are illustrated in Figure 15 and can be P(r spherical coordinate system coordinate spherical y P(r P ,  ) , x-axis polar axis polar  y polar axis polar ,  )  between between r . Every point inthe Every . , and the angle angle , andthe OP ) a point ) a point

and the the and   45 45

Draft - Not for public release (© Wolfgang Kainz) 46

compute its spherical coordinates as Example 52. Example 16): formulas(seealsoFigure following the beusing performed can coordinates three-dimensiona between conversion The 51. Example coordinates as point thus has the polar coordinates o 0.743 cos   5.385 Figure16. Conversion between Cartesian coordinates and sphericalcoordinates 4

Given the Cartesiancoordinates the point of Givenpoint a r   491634 255 and 22 cos cos a wt [, 21) (2 \ ] [0,2 with tan a wt [, 21) (2 \ ] [0,2 with tan a wt [,] [0, with tan sin a 1.5 tan       yr yr xr xr rxyz rxy zr x-axis               P r z x x y y  (2,3,4) i sin sin cos sin sin cos cos xy xy xy 2 3 222 22 22 22 22 P z-axis x z y         (5,53.13) O

 space Euclidean three-dimensional the in  . From. this we get y r . and r l Cartesian coordinates and spherical spherical and coordinates l Cartesian         a 1.3333 tan 62 5.385 29 16 9 4 4 3 2 z P 222 kk kk  x   3 4 y-axis P    2 2 (3,4) 42.03 we can compute its polar    and     .. 53.13 , i.e.,

THE MATHEMATICSOF GIS    56.31    . 3

 we can we can . The ,

Draft - Not for public release (© Wolfgang Kainz) 7.1.4 AND TRANSFORMATIONS SYSTEMS COORDINATE 7.2.1 7.2

Vectors and Matrices

Geographic Coordinate System Coordinate Geographic Vectors which is used to identify locations on the surface of the earth (Figure 17). The origin origin The 17). (Figure earth of the surface the on locations toidentify used is which and the plane trough the point planetrough the the and origin, and the meridian zero the through planes the between angle isthe longitude The spherical coordinates. Every circle through the poles is called a a called is poles the through circle Every and towards east negative from 0 to180 west. plane iscalled a surface of the earth is uniquely its defined latitude by is oftheearth uniquely surface of the geographic coordinate system is the center of the earth. The equator equator The earth. of the isthecenter system coordinate of thegeographic of a vector space are called vectors several axioms for operations among vectors and and vectors among foroperations axioms several vectors called are space of a vector thealgebraic defined wehave 8.2.4 section In representations. relatedmany calculations tothecharact apply can and we vectors, point their respective by in space points represent can We figures. geometric of treatment analytical roleinthe animportant play matrices and Vectors 53. Example this isdifferentfrom Notethat how theway anglehemisphere. 0 to90,andfrom 0to-90southern on the rangesfrom hemisphere onthe northern (positivela north towards point to origin the the from and theradius plane theequatorial between theangle as measured latitude is The -plane with the earth is the zero meridian Greenwich. Every pointthrough specialA case of aspherica plane definedby the 6,370 kilometers. 634 16 P (,)     East, or East, .

h ipr fVen,Asra a aiueo 807 48 The airport of Vienna, Austria, has alatitude of VIE(48.1167,16.5667) parallel x - and x . For practical calculations, the radius the radius . Forpracticalcalculations, Figure 17. GeographicFigure17. coordinate system E y l coordinateis the system -axes. The circle The circle -axes. P and the origin. Longitudes are positive 0 from to 180 G . M N S   z meridian titude) or south (negative latitude). Alatitude latitude). south or (negative titude) P( structure of a vector space. The elements The space. elements ofavector structure eristics of geometric figures using vector figures using geometric of eristics  G ) ; every every circle; parallel to the equatorial defined by the intersection of the theintersection by defined  geographic coordinate system coordinate geographic ad longitude and y  R  North and a longitude of of the earth is assumed assumed is earth of the  for defined is  E , denoted as lies in the P

on the the on x M , 47 47 z ,

Draft - Not for public release (© Wolfgang Kainz) 48

coordinate components. components. coordinate 12 a They products. vector different three know we scalar, with a vector a of multiplication the and vectors of addition the Beside 54. Example The the called is arrow the of head the and callwill simply a representative The avector. tail of a vector is called the For simplicity, we will notmake adifference three-dimensional real space. inor two- aclass ofarrows as vectors we define Here, defined. are scalars with vectors Figure 18 Figure with a scalar for vectors: for vectors: scalar with a multiplication of From and 8.2.4 thatoperations addition section weknow wecan define a called is 1 length of vector A Every pointEvery                           For the sake For ofamore the compact notationvector we write also 1414 5 36369 25257 length in space. A single arrow iscalleda Definition 32 (Vector).  of a vector is defined as as defined is vector a of length 12

. In P   The sum of the two three-dimensional vectors ,,) (, xyz babab a b a ab        2 vectorthepoint components reduce to two forthe in .             x-axis abab abab  A vector x z yyyyy 3 vectorpoint its by can be represented unit vector z-axis O xxx zzz Figure 18. Point vectorPoint Figure18.

Py  is a class of parallel, directed arrows of the same ofthesame directed arrows isaclassofparallel, P   terminal pointterminal y ll have also ageometric interpretation.       x z   . of the vector. representative ofthevector. xyz 222 between a vectorand a representative, and  and and P(x, y, z) y, P(x, z x .   aa aa  P  y-axis  in  ,,) (, xyz            aa aa 3 x z yy and . 1 ,3) 2, (1,   P P   THE MATHEMATICSOF GIS  x z      

and x z y xy 22 in as shown initial point, initial x (4,5,6) - and

in  y is 2 - .

Draft - Not for public release (© Wolfgang Kainz) COORDINATE SYSTEMS AND TRANSFORMATIONS AND TRANSFORMATIONS SYSTEMS COORDINATE

according totheformula as according to the following formula: formula: following tothe according The can crossproduct be in geometrically 55. Example The dotproduct can be used to compute theangle   The result of the cross product is a vector. is avector. product thecross of result The as defined Definition 34 (Cross product). associative: but not and distributive, commutative is product The dot (scalar). number a always product is dot ofthe result The Euclidean inner product (Dotproduct). Definition 33    49.86

The lengthof vector The product where where formula formula ab   , . 

and The angle  cabab   c following tothe according vectors, two the between angle is the     form a right-handed coordinate system. coordinatea right-handed system. form c   is equal to the area of the parallelogram spannedby  ) is defined as ) isdefinedas a ab ab b a cab  between two the vectors baba bab ab ab b a ab       c  o 0.645 cos      is perpendicular to the vectors tothevectors is perpendicular     ()   If bcacbc ab  ab ab () If abcacbc  xx zz yyxxyyzz  sin      411 14 1 1 9 9 4 1  cos  32 18 31 21 13 bababab bababab     bba ab    a   x yzxxzyy z  bba ab   a      and  . terpreted as illustrated in Figure 19: asillustratedin terpreted and  It is distributive, but not commutative: commutative: but not distributive, is It  |||| xyzzy zxyyx ab  b ab   b   the are twovectors the two vectors are       

a   

1 ,3) 2, (1,  

twovectors between a  and

and

b  b   . cross product dot product (3,1,1) . It follows that . Itfollows is calculated calculated is a  a  and and (or and is b  b 49 49  ,

Draft - Not for public release (© Wolfgang Kainz) 50

scalar triple product. product. scalar triple between hold correspondences The following 57. Example computedaccording formula tothe tripleproduct isanumber equalvolu tothe me of this parallelepiped and can also be are positionedwith point20).The result common(Figure ofthescalar initial the they If thethree vectorsdonot lieinthe same pl 56. Example where where b c    ab 4(4 )2 )[ )(2 ]2[ ]2(1)(6 8) ( 2 4 6) ( 12) ( 2 2] 4 2 [0 2 2] 2) ( 4) ( [0 6) ( 2] 2) ( 4) ( [4 2    42 68 16 24 24           is  product Definition 35(Scalar triple product).  22 4) (2,2, 45                       10001011 0110100 011001 1 0 . Therefore we can compute the length of the cross product as product cross the of length the compute can we Therefore . is the angle between the cross product vectorcrossproductof the istheanglebetween is defined as as is defined

computedis by inserting into the formula givenDefinition in 35 as The volume of the parallelepiped with with parallelepiped the of volume The Thecrossproduct ofthe two vectors  ba     b cacb b bc abc bc abc bc abc c c x ()()() b zz zz yyx xy z zx xz y zy yz Figure 19. Crossproduct of two vectors     ()() () Figure 20. Scalar triple product abc cab abc      ()| |||cos a b c b a abc b  and thelength angle ofthevector The is1. between

     a    f , If ab  ane, thenform aparallelepiped they when  and the dot product, cross product and the and the crossproduct dot product, the a  c   are three vectors the  (1,0,0)

ab  ab     2 ,) 04 2) (0,4, 6,2), (2, and and and  21 12  b c  

THE MATHEMATICSOF GIS .    11 0) (1,1, 2 2 scalar triple . is equal to

, and a  and

Draft - Not for public release (© Wolfgang Kainz) 7.2.2 AND TRANSFORMATIONS SYSTEMS COORDINATE

Matrices Matrices Let following rules: tothe vectorsaccording matricesmatrices with andmatrices with multiply we can product of product product is calculated according to the following schema schema following according tothe iscalculated product The rows and does notmatch,columns the sum isnot defined. of number the If columns. and rows of number same the have must matrices both that Note thatthe sum has the same of number rows and columns of the inputmatrices, and equal the number of rows of ofrows number the equal as: as: A matrix science. computer of in applications structure data and as inmathematics contexts many occur in numbers of real arrays Rectangular We call The         aab bbab abab b bb a aa aab bbab abab b bb a aa aab ba ab ab ab b bb a aa         m m 112 11 122 21 in the array are called the entries in the matrix.in the entries are the called array the in Definition 36(Matrix). 12 multiplication of a matrix A product of twomatrices product and and M M a B CAB       of is arectangularnumbers with array be two matrices. Their Their matrices. betwo mn   As sA nmm m mn 112 11 1 122 21 2 nn nn -matrix. We also know that the ma We thatthe know -matrix. also of   ()()()()         ()()()()()() b abc d abd c d c b a   bc cdadbc acbd cd ab A  aasasa a saaa aasasa a saaa aasasa a saaa         A m m 112 11  122 21 12 and 12  M   b acbabc abc

 matrix A   )() ()        A B ba ab ab ab and  ()()()          B  witha scalar   . Given a . m m mmm m m mmm m m mmm   i a is mmmn m mm 11 13 12 11 12 23 22 21 is a rectangular array of real numbers. The numbers numbers The of realnumbers. array a rectangular is      123 B 2 2 222 sum of number ofcolumns defined is ifthe only nmmmm m m m mn 1 2 mn mn 1 2 is defined as defined as is nn nn  mp  -matrix where every element element every where -matrix s  is defined as as defined is 12 222 22 12 12 21 21 11 11 1122 m m 112 11 122 21 -matrix          2 1 m trices form avector space and that rows and rows 1 2 n n A

and a a and n

columns represented columns mn 1 2 pn 

-matrix nmn mn 2 2 1 1 n n c ij n n o the of B

A the is 51 51 Draft - Not for public release (© Wolfgang Kainz) 7.3 52 7.3.1.1 7.3.1

Transformations

Geometric Transformations Transformations Geometric

Translation

direction is transformationprovideboththat solutionsproblem. tothis operation (Figure 21).The translation factorin (Figure operation The shift of a geometric figure horizontal an in Cartesian coordinates. usingplane geometricwe willIn insections, the discuss transformations thefollowing discuss theH Wetranslation. will and rotation, skewcompensates scaling, that coordinate systems for planebetween two de isto transformations to problem related Another transformations. andtheir systems coordinate focusonplane we will Here, gures fi we scale geometric apply shiftor geometricwe rotate, When transformations. 59. Example 58. Example and and               25 15271628 1922 56 12 54 64 43 50 48 36 47 35 8 7 4 3 rs tu a a bab ab cabab jijiji ji kj ik pj ip j i j i ij         a rasbrasbrasbaaa b taubtaubtaubbbb 2 3 3 2 2 1 1 123 2 3 3 2 2 1 1 123 122 2 11

t y The product of of product The The product of the two matrices  . They need not be . thesame. neednot They         a aa aa         mm 11 11 ii 1 1          a p p p y O         b bb 11    p Figure 21. Translation Translation 21. Figure 1

ELMERT  k P(x, y) p  1      P'(x', y')    12 34 t x b b 1    pj (or similarity) transformation and the affine affine andthe transformation similarity) (or . j termine theparameterstermine  d vertical direction results in a translation resultsatranslation vertical direction in d    . rs and tu t x y . b -direction is -direction 1 pn n  and            78 56 cc cc mm 11 11       1 aaa bbb 123 123     c x t ij x , the factor in the the factorin , the i cluae as calculated is of a transformation ofa THE MATHEMATICSOF GIS   n n

as computed is

y -

Draft - Not for public release (© Wolfgang Kainz) 7.3.1.2 AND TRANSFORMATIONS SYSTEMS COORDINATE 7.3.1.3

Rotation Scaling In matrix notation the rotation of a pointa matrix notation of In therotation are calculatedthe according to following formula: vector with atranslation factor (or scaling factor) to the coordinate the to factor) scaling (or factor The scaling of a geometric figure can be by described the application multiplication of a ) , ( a point of Given thecoordinates inatwo- figure geometric of a rotation The point a of coordinates Given the calculated according to the following formula: following formula: according tothe calculated In matrixInthe wecanwrite notation, tran      P  xx yy  is shown in Figure in isshown 22.    RP   with the rotation matrix withtherotation    t t x y . t      y O t t x y P R P P'(x', y') xy yx xy xx resultinga new point in ,) (, Figure 22. Rotation 22. Rotation Figure     xy xy      o sin cos i cos sin yyt x i cos sin o sin cos slation of a point defined by its vector its vector by defined point a of slation   s in a given coordinate system (Figure 23). 23). system (Figure givencoordinate s ina , the coordinates of the new point new thepoint of coordinates , the , the coordinates of the rotated point of therotated coordinates , the     P(x, y) dimensional coordinate system withthe angle P    xt         x y x y

  wt a angle an with   or or

x        x yy    P     o sin cos i cos sin     x y     can be denoted as as   P P    ,) (,  xy P Pt P

   ,) (, x  xy     . are x y or 53 53

Draft - Not for public release (© Wolfgang Kainz) 54 7.3.2

Combination of Transformations Transformations of Combination

calculated according to the following formula: followingformula: according tothe calculated The factors factors The computed according to the transformation matrix be can result The up. units two and right the to units three figure the shift we Finally, -direction. 60. Example written as defined matrices inthe is The usingthe previous sections approach vector. general matrix onetransformationmatrices fortranslation and and to rotationaddthe scaling the combine can we or other, the after one sequence, in transformations the respective When wewantto perform rotation, scaling and ofa point coordinates Given the In matrix notation the scaling of a pointmatrix Inof a notationscaling the the same. In the detailed notation this translates to Intranslates to notation thedetailed this       P y 4 x yy , respectively, can be written as can bewritten respectively, ,        1 0    . We apply a rotation of 45 degrees, a scaling with the factor 2 in in 2 factor the with a scaling degrees, 45 of a rotation apply . We s 0 x

s s 0 x y Let Let and x S s be a square defined with the points . y are thescale factors the in     xx yy    y O    P s s x y ,) (,

o sin cos xy i cos sin Figure 23. Scaling Scaling 23. Figure  P  P       ysy x , the coordinates of the scaled point point scaled the of coordinates , the   P    P(x, y)   SP  R t SRP  st sx st  yy    x xx y  matrix with thescaling  x y  T P'(x', y') translation totranslation apoint, eitherwecanapply  

factors with scale  x     

- and 11 22   22 22 x P y 1  -directions. They need not be not-directions.be Theyneed       0 0 . and thetranslation vector , P x 2 s THE MATHEMATICSOF GIS -direction and 1 in in 1 and -direction x  and    1 0 S  , s P    P y  s 0 3 ,) (, for x xy 

   s 1 1 0 x y and and and are are or or y

Draft - Not for public release (© Wolfgang Kainz) 7.3.3 AND TRANSFORMATIONS SYSTEMS COORDINATE

Homogeneous Coordinates transformations can then be expressed by by expressed then be transformations can transformed greenfigure where in allows us to combine all three transformati all three combine allows usto be ex can translation also the now Note that point a to assign We An easier way to deal with geometric transf t   its Cartesian coordinates as Cartesiancoordinates its ) , , ( point ofa coordinates givenhomogeneous the Conversely, ) , ( coordinates Definition 37Coordinates). (Homogeneous 1 2 3    2 3 as R P  1  Ss       Tt o i 0 sin cos i o 0 cos sin Pt TP   x 001             y s 001 00 10 001 01 x 2  c nb sindtehmgnoscodnts(,,) , , ( coordinates homogeneous the can beassigned . Thefollowing figure shows the original square inred and the  00 P y ,) (, xy t x y 3 sst s Us x  is ooeeu coordinates homogeneous its P  1 r  t       and s 4    x y 2 3 o sin cos i cos sin 001 , y   P 33  ons in one single transformationmatrix 2

ormations is to use homogeneous coordinates. coordinates. is to use ormations homogeneous   s t   pressed through atranslation This matrix. .      -matrices.

st yy translation translation scaling rotation 2 xx 32   1 2 Every point with the Cartesian , P 3  .      rst 22 ,,1)(,  x 3 y , we can determine can determine , we and . The geometric txtyt P  4        2 32   1 . 2 55 55 . Draft - Not for public release (© Wolfgang Kainz) 7.3.4 56

Transformation between Coordinate Systems Coordinate between Transformation

translates the data. translates the Itdoes not independently also known also known as A minimumof twocontrol points isrequiredA general form general form It requires data. the rotate, andtranslate The The Example 62. Example are points control called are points These systems. ofpoints inboth thetransformationfromknown coordinates parameters determine must we cases, these In involved. distortions more are orthere vector, translation we do often However, sections. the previous in discussed transformations geometric to relates the this principle, In system. coordinate Inmany wehave applications, to transfor 61. Example asthe be writtensimply multiplication of the then can and translation includingrotation,scaling of a point Thegeneral transformation transformation. Thecoordinates of the control points are measured (digitized) on adigitizing fourcontrol points. Ithas thegeneral form systems and requires thetwocoordinate aminimum between of for distortions greater transformation theprojective Finally,            P A  x yy 11  ,       B affine transformation(or similarity transformation similarity UP 

,         C projective transformation transformation affine similarity transformation or 001 22 22 223 , and

 The transformation of the square in the previous example can now be written as Givencontrol two points four-parameter transformation four-parameter F . 2 x

           x ssty s ys 001110   6-parameter transformation 6-parameter (also called called (also  sstx

yBxAyF xxx x yyy y x yDxEyF x   o sin cos i cos sin       (or 8-parameter transformation     P     1 D A xB C By Ax xHy Gx xHy Gx xB C By Ax and a minimum of three control points and has the the has and points control three of minimum a xByC xEyF H m from coordinates into one system another         ELMERT and has the general form general the and has transformation matrixtransformation withthepointvector not knowthe rotation angle,scale factoror scale the axes or introduce any skew. Itis skew. any orintroduce scale theaxes to be able computeto be to parameters thefour P . The most common transformations used used transformations common most The . 2    ,compute theparametersH a of  1 1 transformation

) will differentially scale,skew, will differentially )

) scales, rotates, and and rotates, ) scales, THE MATHEMATICSOF GIS ) cancompensate ELMERT

Draft - Not for public release (© Wolfgang Kainz) 7.4 AND TRANSFORMATIONS SYSTEMS COORDINATE

Applications in Applications GIS the tablet coordinatesliesat the tablet digitizingFigure 24shows ofa tablet asketch projection. or millimeters coorinches –to the world general coordinate transformation. The transformation. general coordinate shouldprovide GISEvery software package map coordinates. into map.coordinates transformation these The converts measured the on point toevery thetransformation apply andsubsequently parameters sy thetablet coordinate (in coordinates measured and system) their coordinate map the ticks (in ofthe given coordinates the With transformation. or six-parameter weselect a parameters. four- computing its Usually, system.map coordinate This is choosinga done by proper and by transformation start digitizing, we need to establish a rela establish a need to we start digitizing, Themap is usually not aligned with coordi the map. be read canfrom the coordinates map whose sheet the cornerpoints of or points grid intersection as forinstance easily, is one example of such a function. function. such a of is oneexample the device coordinates, i.e.,thecoordinates the devicecoordinates, digitizing.He occurs, forinstance,inmanual Another important application liesof datasetsasit transformationofcoordinates inthe them. scale and skew rotate, shift, to need we features, func editing graphic transformations inthe is transformations geometric Inapply GIS,we need tosolvethe systemresulting of equa minimum numberWethen ofcontrolpoints. more required we than the use Normally, device as following system oflinear equations for axes axes with of parameters for set achieve areliable to aspossible small as be should RMS the However, points. control of number the required than more weuse when case the never is which zero, in aRMSof error mean square P 222  ,) (, xy  x k and . Themap coordinatesof these ticks are either known or canbe determined P 111 . We cannow compute the parameters ofthe H ,) (, xy y k . . Onthemap four ticks(or controlpoints) have identified we designated and the transformation. (RMS) indicates the goodness of fit. Ideally, the best fit would result result would thebestfit offit.Ideally, the goodness (RMS)indicates xy Px 222 ,) (, O t . map The with coordinate indicated system is . Themap coordinates ofthe tics are given as x x yBxAyF yBxAyF 111 111 222 222     A       ,, BC   TRANSFORM xB C By Ax xB C By Ax tionship between the tablet coordinate and the andthe tablet coordinate the tionship between tions with a least squares approach. least squares Thetionswith a stem), we can compute the transformation and produced by theproduced by digitizin   dinates, i.e.,themap dinates, coordinates ofthe re, we have tore, we setupatransformationfrom tions of every GIS. When we edit spatial WhenGIS. we edit spatial tions of every this this forfunctionality manual digitizingor with a map mounted on it. The of mounted onmaporigin it.The witha in many different ways. One use of of One use ways. different many in nate system tablet. ofthe Before we can F . command in Workstation Arc/INFO Arc/INFO inWorkstation command

ELMERT transformation by solving the g device–usually in P 111  ,) (, O xy k and the the and root root and and 57 57 Draft - Not for public release (© Wolfgang Kainz) Exercise 25 Exercise 30 Exercise 27 Exercise 26 Exercise 24 7.5 58 Exercise 29 Exercise 28

Exercises Exercises

coordinates of the resulting figure when the triangle is rotated by illustrated Figure in 17. Cartesian coordinate system islocated at the center ofthe earth and the axesdirections are as Earth as Earth parameters manualin digitizing using four control points and a six-parameter transformation. mapyourUse sheetof choiceand a performthe procedure transformationsetting for up the Given the triangle Let (1,3,2) What wrong is with theexpression Let dot product of vectors: (a) Explain why each of the following expressions makes no sense when the operation “ Given the geographic coordinatesof Vienna airportas in both both in ()() bbc ab   a  a     x 1 ,2) 3, (1, R - and  6370 , . O , y b  y t b -direction, and translated 2 units to the right and 3 units down.  km t   1 ,3) 2, (1,  1 ,3) 2, (1, , compute the Cartesian coordinates ofthe airport when the origin of the ABC O y abc  k k ad 2 1,4) (2, and  and () wt te coordinates the with  Figure 24. Manual digitizing setup setup digitizing 24. Manual Figure  c   c   , (b) , (b) abc    2 1,4) (2,

x  k  abc    ? () . Compute . Compute   . Compute (a) . Compute  , (c) , (c) A  kab 1 0) (1,  (,,)  () abc   48.12   ,   B . bc  . (3,0) x ,  60 t     , scaled witha factor of 1.5 , (b) 16.57 and THE MATHEMATICSOF GIS ()2 C and theradius of the bc ab  (2,1)    cmue the compute ” denotesthe , and (c), and

Draft - Not for public release (© Wolfgang Kainz)

59 59 CHAPTER CHAPTER 8 orhomomorphism. mapping preserving another. If mapping, wecallita under the ispreserved sucha structure structure elements a mappings of set. Often toidentify fromwe algebra need to one the with or “calculate” “compute” wewant to when needed are operations These this set. of elements forthe aredefined operations onwhich aset by are characterized that Inthis chapter wewill order structures. algebraic (oralgebras) describe structures

M Algebraic Structures Structures Algebraic structures in mathematics: intopological and algebras, structures, structures main three are before,there seen As wehave phenomena. or processes world real to describe used are structures athematical

Draft - Not for public release (© Wolfgang Kainz) 8.1.1 8.1 60

Components of an Algebra Components of

Signature and Variety Variety and Signature

the “arity” of the operation. Operations from from Operations ofthe operation. the “arity” (real numbers). Operations are defined as a mapping mapping a as defined are Operations numbers). (real written asequationsofcarrier. elements of the called are “rules” Such carrier. the of elements the for valid are that rules distinguishdifferentalgebrasthat classeswe need of “behave”way,same inthe certain need not thesamesignature have Algebras that 65. Example 64. Example characteristics. thesame has class of the member every that such algebras of a class we at look Often 63. Example carrier The are denoted as as denoted are distinguished elementsthe of set with carrier and Examples of carriers are number sets such as as such sets number are carriers of Examples value to an element, i.e., it takes thenumberelement,it ani.e., to value negative the that assigns “–” operation the consider operation unary a of example an As are addition from number ofconstants is not the same. The second algebra does not possess any constants. becausebinaryposses two they operations tuple  )( h nr prto ) , theunary operation signature, specifies a class of algebras called called aclassofalgebras specifies signature, Definition 40 (Variety). operations are the same. and ofcorresponding the constants arities are of the same Definition 39(Signatureofanalgebra).    following components: Definition 38 (Algebra). (

S   and Operations A set Distinguished elements of the carrier, the carrier, ofthe elements Distinguished  2 ,,,,0,1  

SS S S x ) and operate on two elements of the carrier. Examples of a binary operation operation binary of a Examples carrier. the of elements two on operate and The algebras numbers real The The algebras algebras The , respectively.  , the elements of set isa algebra an of n -tuples . constants>. operations, -tuples

n -tuples include the same number of operations and and number ofoperations the same include -tuples and x (   and y  and of elements. The constants of an algebra are are algebra an of constants The elements. of  Two algebras have the same havethesame algebras Two , properties of special importance. Algebras Algebras importance. special of properties variety  constants x  ) to  and be related at all. In order to be able to be atall.Inorderto related are of thesame not species,because the 1 (natural numbers), numbers), (natural  . on which operations are defined. defined. operations are onwhich ( x  . of the algebra ofthe   and : Binary SS SSS ofthecarrier,together witha ,,,),( m  are called called are  )(  )  (addition) and multiplication andtwo constants and0) (1 operations are mappings mappings are operations SS have the same signature where the the where THE MATHEMATICSOF GIS  unary (integers), or signature axioms operations. operations. m is called is and are (or (or 

Draft - Not for public release (© Wolfgang Kainz) 8.1.2 STRUCTURES ALGEBRAIC 8.2

Varieties Algebras of

IdentityZero andElements for every belong to this variety. following axioms: (i) use the following notation notation following use the In this section, we will discuss a few algebras of importance. discuss afewalgebras will we Insection, this on operations i.e., algebra, map analysis spatial aswell asin theory languages andautomata Algebras play an importantroleinapp many 70. Example 69. Example Let If identitiesexist,candefine inverse we the respecttoanoperation. with 68. Example 67. Example operations. following definition describes the most impo Constantspossess relative to specialproperties algebra with anarbitrary deal we whenever ofthischapter, For theremainder 66. Example algebras. of varieties important more of the some will discuss we sections, following Inthe axioms. thesame obey variety of thesame all algebras maybedifferent, constants and set, operations carrier Although the same way. the behaveinexactly variety same to the belong that Algebras with respect to the addition. The inverse of the binary operations aredenoted “ as“+”, zero 0. operation, operation, except 0have an inverse   S .  ”, andrespectively.”, “1”, theoremAny forthis variety proven hold will forallalgebrasthat identity element)anda of an operation the andspeak specify may not we result can confusion An element element Definition 41(Identity andZero Element). ,,0  on operation be abinary , y  1

in  a operation, unary and The algebra The algebra The algebra algebra The Consider the variety of algebras with the same signature S S 0 S i an is  , then S ,),( x i a is  identity x  x  zero , 1  is called(two-sided)      zero yy     1  x ,,1,0 (or (or ,,0 ,,0 ,,1    (or unit   x such that that such forthe operation S  , (ii) zero element). , and 1an for identity this If operation. has anidentity 1and all elements ,),( has an identity 0 but no zero element. element. zero no 0 but identity an has has an identity 0 and every element element every and 0 identity an has  with themultiplication asoperationhasan identity and 1a SS k   ) for the operation operation ) for the a constant. aconstant. ,,,  , and kSA x x ”, “ iswritten as  1 x , where , where  lications of computer science such as formal asformal such science computer of lications   1 coding theory and switching theory. In codingtheoryand switchingtheory. (usually raster) data sets, isvery common.raster) datasets, (usually Let  one or more operations in an algebra. The more The one or operations inanalgebra. inverse ”, and“ rtant properties of constants for binary binary for constants of propertiesrtant . ,,1  if   S are all members of this variety, where where variety, this of members all are operation onbe abinary    of is the carrier, carrier, the is  x zyxzyx ”, and theconstants“ “0”, are )()( and   , and(iii) y if Sx with respect to theoperation ,   xx Sx x ,  xx  x of the real numbers  0)(   denotes a binary binary a denotes .   00  ,,0 (or (or identity has aninverse 000 . If no. A   S  11 , we will , we . An xxx ad the and  . Then   xxx xyyx . ”, “  61 61 1

Draft - Not for public release (© Wolfgang Kainz) 8.2.1 62 8.2.2

Group Field Field

there isno inverse withregard toaddition and multiplication. division by zero). zero). by division (as we knowthem for instancefrom the usual number sets)without restrictions (except speaki Simply set. acarrier on operations formal that algebras general very Fields are 73. Example 72. Example 71. Example ad (usually operation binary one of arithmetic the formalizes that is agroup structure basic One numbers). real and rational (integers, numbers it for know usually we as arithmetic, of basis the are structures algebraic Many numbers, the addition. The axioms can be easily verified as: usual addition, –theinverse (negative number)with regard tothe addition, and0theidentity for identity forthe multiplication. The axioms are verified as follows: 4. 3. 2. 1. axioms: where Definition 43(Field). group Abelian operation If the 3. 2. 1. axioms: the following ( binary Definition 42(Group). 2. 1. 3. 4. 4. 1. 3. 2.

(    S  is the usual multiplication, aa  and aa

) and one unary ( and oneunary )   ) 1 11 aa  The natural numbers The algebra The algebra 11 1   00

0,,,    )( 1  ). 1   abba  0)(   are the inverseoperations for abba   

is acommutative group 

is also commutative,thegroupa wecall then aaa aaa aaa

)()( )()( )()(   )()(  A   A group   cbacba  cbacba  cbacba cbacba

 

,,,0

   cabacba cbcacba field   ) operation,where

0,,,1 , {0},  is an algebra with thewith isanalgebra signature

is an algebra with the signature with isanalgebra with addition and multiplication are not a group because   is a commutative a is where group 1 1 the inverse with regard to the multiplication, and 1 the ng, guarantees all afield operations arithmetic commutative a is group where dition ormultiplication numberfor sets). ly describe the interrelation of two binary binary of two interrelation the describe ly  and  respect to is theinverse with  , respectively; and the following (or (or commutative group  S are the integers, are THE MATHEMATICSOF GIS S    1,,,    with one one with are thereal  1  , and 1,0,,,,,   the

Draft - Not for public release (© Wolfgang Kainz) 8.2.3 STRUCTURES ALGEBRAIC 8.2.4

Boolean Algebra Algebra Boolean Vector Space Space Vector as easily be verified as example. example. one are Vectorspaces set. than one more on aredefined structures algebraic Some 75. Example 74. Example intersection and complement relative to numbers0 andfunction 1 asidentity elementsfor as binary operations, and the inverse unary operations foraddition andmultiplication. The Y and 10. 9. 8. 7. 6. 5. 4. 3. 2. 1. 10. 9. 8. 7. 6. 5. 4. 3. 2. 1. complementation where Definition 44(BooleanAlgebra). 5. 1. 5. 4. 3. 2.

Z X X See Example71 See Example 72 ( be arbitrary subsets of    S 1 ( aa  0 aa 

X XX      )   The powerset The real numbers and )()( aa   0 aa 1 YY

XAX   )( XX A

)

     abba 

abba  ), with theaxioms: with ),

X XYYX 1 

1,,},0{

  and operations, are binary  )()( is a commutative group isacommutative    cbacba cbacba     (associativeof multiplication) law )()( cbcacba  cabacba   cbacba

(distributive law) (distributive law) )()( cabacba ZYXZYXZYXZYX

 A  A )()( )(

 (i.e., elements ofthe power set of cabacba  of agivenset )()()( ,,,,,0,1  

has a signature a algebrahas signature A Boolean ZXYXZYXZXYXZYX A )()()()()()(

 is aBoolean algebra 1  and are a field with addition and multiplication multiplication and addition with field a are A with the usualset operations union, of  , respectively., Theaxiomsareverified  operation (the is a unary A A ) then the axioms can can axioms the ) then  S ,,,,),( A    . Let 1,0,,,, 

X 63 63 , Draft - Not for public release (© Wolfgang Kainz) 8.3 64

Homomorphism Homomorphism

numbers with In thedefinition above homomorphism. mapping from the (given) algebra to the ne algebr of investigatingrelated way formal A behavior), thenthesame theorems (ina re they that we wantto show algebra (usually thistheorems foralgebra. If wecan show th Often constants. corresponding weknow well; wehaveestablished an very i.e., algebra have they and operations their of interms same “behavior” the show they similar are twoalgebras If are similar. they whether out tofind algebras tocompare need Often we algebra. of sub-discipline Vector spaces play an important roleinthe 77. Example 76. Example operations, andoperations, numbers where algebra. algebra. thegiven of version or “generalized” is a “smaller” ofanalgebra image A homomorphic names. different with algebra same the essentially are isomorphic are that algebras Two the map isomorphism an it call we Then 4. 3. 2. 1. that Isomorphism). and Definition 46(Homomorphism of elements The 4. 3. 2. 1. Definition 45(Vector Space). 

,  S   1      ( h :  S is called ahomomorphism ) (

h

       .  The setof all matrices with matrixthe addition isa vector space over thereal The set of all vectors with aa kkh )( 1 being the multiplication being the a scalar.of amatrixwith   SSh   

k isthe multiplication ofa vector with a scalar.   a ,,, )  1,0,,,,, and kSA V        a field. field. a are called called are  and let signature, withthesame be algebras   ahah  k  ))(())((   are constants. constants. are 

 bhahbah    )()()( from  a

and  V )()(  vectors

baba aaa a called is

A Let

 to from from  ; theelements of rpeet iay operations, binary represent  A as thevector addition is avector space over thereal lated way) also hold for the new algebra. new algebra. the for alsohold way) lated  , and A vector space vector V mathematical disciplineof linear algebra, a to are essentially the areessentially same in terms of their at a different algebra is related to thegiven relatedto is algebra different at a w algebra. Such a mapping is called a a mapping called is a Such algebra. w as is to establish a structure-preserving a structure-preserving to establish as is A A    0,,, is anisomorphic image of . If. thefunction  S and group be acommutative over over are called called are Let S , if forall h scalars such be afunction h THE MATHEMATICSOF GIS i ietv then bijective is   . and , ,,, kSA  A   Vba under under  and and and and unary unary

Draft - Not for public release (© Wolfgang Kainz) 8.4 ALGEBRAI

A p p C C plicatio STRUCTURES STRUCTURES E The co well as Spatial cell car An exa calc of operati kn We b carrier Perhap their log the mat logarith surjecti E We wil where  h B y cov xampl xampl     ,, )( bah Sh  )( n 0{ v u e )(: o o s o 0 0 w h m h m  s l n n e e e e 0 m , , r A A functions th functions arithms. s in GIS 1 rage, shape e, because themost lating slope lating returntoth  w many op w many ns ofadditi et of m et of the ematical bas ies the val 78. 79. cept of str cept of },  e map as map e ic functio and log( ple of ac of ple nalyst rast nalyst and thef

 }1,0{ Let Let Let Let ba defi Sh 1,0,,, )(     u n u u f p l) a f n o u a o , e i e erations for S og( is for the sli ile, grid or l or grid ile, or  e zero. Fig zero. e 1 is monot is nction aspect orh aspect bset of bset of the rominent a rominent p algebra is s subject in s subject ed as as ed nstant oft nstant t can beap t cture-prese r calculato n, subtracti b

. b e two Bo e two e the set e the

x b ) e a   h 0 log( Fig Th : the  )( ba u h   r  r p o o o p d i ) ) a r r o u n n o o r the set of “ . we Here, re 25. Raster Raster 25. re equation chapter 13. e mapalge llshade. manipulati ne increasi ving mappi f allpositiv lied to map e rulethatr yer. plication o  eal worldt lean algebr    on-empty re 25 sho n, multipli 1 0  if if with with

 a a   ()( l w bhah T T n o o e h b c a a s n f ) m o e set and t and set ng finds an ng finds g maps. T g maps. real number g layers. expan s the algebrasi ee various various ee s. For an s. calculator in ation or div ation ra would b g; thereforg; places multi is ahomo and a represe a aps”, i.e., aps”, i.e., )(   log h yx al xx  i w w m y n y a s w s w h l)1( e n e n t d e d d s og( p isionmor to

an isomorph an tation in a in tation erface erface rithmetic a rithmetic ays has a ays has

ey rangefr ey orphism fro orphism . Then GIS isth thezerog o ed user int ed user application ata sets tha sets ata lication of h  A Sa  i inj is  0)1 and and . T .    n n ( h s s n s e m m e e e o r t  i i S e complex o e complex d logical op olution e given isom patial featu patial umbers bya are often r often are ctive. Fu ctive. sm. The fun rfacethe of id, where e in spatial ,,1 m simple m simple

), map alge  A  to is iso is ST  )( B x th   . e b a m m ,,,, a e e r e o r v ddition of ction ction ArcMap ArcMap perations perations rithmetic S ra function function e model. e model. Note that that Note thermore, ferred to to ferred rators as as rators rphism is orphic to y odeling, ery grid  . The . The

and h is 65 Draft - Not for public release (© Wolfgang Kainz) Exercise 32 Exercise 31 8.5 66 Exercise 33

Exercises Exercises

and negative number constantandthe (-), 0; isomorphism? Given are two algebras: Let Given arealgebras: two and negative number (-),andthe constant and 0; constant0 andtheoperations ( that are always false( the unary operation “not” ( respectively).Show that both algebras are Abelian groups and that functionthe constant 0and two operations defined as defined as f :  FT  FT B },{ , defined as where be aset  ,,,,},,{ 2)( TF xxf  ,an isisomorphism. F ais Booleanalgebra with the binary operations “and” ( ) andalwaystrue(      ,,,0 ,,,0 xf ) being logical operators. The constants constants The operators. logical being )  )( T  ) and(-)definedin the usual (addition way andnegative number, stands“true” for and    operations,with theintegers ascarrierset,two addition ( with integers the as carrier set,two operations, addition (

x x T oddeven is is 1 0 ), respectively.   E , ahomomorphism. is Why is    B 10010 011 0,,,   and with the even numbers as carrier set, the the set, carrier as numbers even the with  0,,, F  with the carrier set stands for “false”.Show that )(  xx . Show. thefunctionthat F and THE MATHEMATICSOF GIS T  are propositions are ), “or” ), ( B

 f f :  nt an not  }1,0{  ), and and ), , the E   ) ) ,

Draft - Not for public release (© Wolfgang Kainz)

67 67 CHAPTER CHAPTER 9 ofspatial representation features. the consisand howtocheck databases, complex in GIS objects usedcan be to howsimplestructures build show We also function. adistance by the realplane induced on themathematical concept of a topological space based on the topology that is

T Topology Topology invariant under certainthisinvariant under transformations.In chapter, introduce we ofspatialrepresentation features isa every opology centralGIS. concept in It deals with structuralthe tency topologicof atwo-dimensional tency and their properties thatremain and their

Draft - Not for public release (© Wolfgang Kainz) 9.1.1 9.1 68

Topological Spaces

Metric Spaces and Neighborhoods

follows from the definition of a topological space. space. a topological of the definition from follows ofthese Theconcept open throughsets. properties ofaneighborhood atopology defines and sets) open called are (which set a given of ofsubsets a family from starts approach followsof Theconcept open sets theofneighborhood. second from The a definition atopologicaldefines space asasystem ofne with Thefirst space. topological one starts neighborhood (Figure 26). (Figure26). neighborhood space the 2-dimensional In the Euclidean plane plane theEuclidean In space. this of points for neighborhood a define can we metric space, every In 81. Example 80. Example Generally, of adistance. concept need the of we aneighborhood In order Euclideanneighborhoods. plane to define with asystem For onthe (orthe ourpurpose, topology). point-set wechose intuitive approach topology The firstapproachmore intuitivethan is the setsatisfyof this that certainconditions.Th In this chapter,wewilldeal easily extend this space tothree dimensions. the shortestdistance between two points.This isthe usual space of plane geometry. Wecan p bab a ab dpq E , ) ( ) ( (,) h e (){(,)|0} | ) , ( { ) metric the induced by ( The set neighborhood Definition 48 ( ) , ( thepair We call (iii) (ii) (i) Definition 47(Metric Space).  xyyXdxy X y y Nx XX

 , ,)} ) (, | { (,)



0   x dyx dxy x y dxz dyz dxy dxy , we define an (open) an (open) wedefine ,  

,)(,) ) (, ,)()(,) (,) ) (, 0 ) (, N The real numbers The real plane real the consider us Let  122 2 11 d  0 xNxxX and write and write sc htfreey , , every such thatfor      22 -neighborhood). Xd if if and only Euclidean space d  metric space ametric  I hr ewl rt () ( writewe will short . In Nx

2 with topological spaces,i.e., a () an  between two points with the distance function . open disk open 

Let x (triangle inequality) inequality) (triangle x namti pc ) , ( Inametric space  We ocnuini osbew al ) , ( wecall When possible . no confusionis . zX yz y and and (,)

  this can be achieved achieved be this can 2 X with radius withradius  the concept of a neighborhood of a point and and ofapoint theconceptof aneighborhood pproaches to definea approaches equivalent two are ere is calledthe d d and set be anonempty E

second one that is usually usedsecond onethat ingeneral is usually ighborhoods that fulfillcertainconditions.  adistancefunction -neighborhood is a metric space. The Euclidean distance is 2 N equipped with the the with equipped p  x ,) (, aa . Xd 12 x y x dxy  ,) (, neighborhood system neighborhood around apoint set andof subsets acollection of of , for each each , for and with a metricwith a space.  (or qbb   metric x ,) (, THE MATHEMATICSOF GIS 12 aremetric space.a Euclidean distance x as the set set the as  d ) on X a function a . We call this. and each each and p Nx i an is X of .  x

 -

Draft - Not for public release (© Wolfgang Kainz) 9.1.2 TOPOLOGY

Topology and Open Sets Open Sets and Topology sets. Example 82. Example open sets. define now we can neighborhood, axio Figure 27illustrates thefourneighborhood When we require aneighborhood tosa system definition of a topological space. space. a topological of definition complement complement Definition 51 (Closed set). each for of set itisaneighborhood points. its if Definition 50(Open set). )) ( byspace simply Sometimeswe denoteatopological , system thesetwithneighborhood ( its We thencall (N4) (N3) (N2) (N1) axioms): (neighborhood system neighborhood space). Definition 49(Topological

neighborhood of every point of point of every neighborhood neighborhood Every of neighborhood supersetEvery of The intersectionof twoneighborhoods The point

The open intervals intervals open The X  x C lies in each of its neighborhoods. neighborhoods. each ofits lies in is open. open. is U x of a neighborhood neighborhood a of N . Let )() ( () N Let x (,) Figure 26. Open disk in ab of X  be a topological space. A subset subset A space. a topological be x X in the real numbers and the open disks in Let contains aneighborhood D Aset be space. a topological X V . X paa conditions that satisfiesthefollowing beand asetforevery  N  ,) (, tisfy certainconditions of ms. Withhelp oftheconcept a the x 12 is itself a neighborhood. a neighborhood. itself is x X is a neighborhood of neighborhood a is  . Xx 2

N V of of a x O x topological space topological  C

such that such of X , we arrive atthe is there exists a a exists there X closed x isan .  2 X N ae open are if its ifits open is a a is is a is . 69 69 Draft - Not for public release (© Wolfgang Kainz) 70

Our approach to the definition of atopologi tothedefinition approach Our closed. are sets, closed of number finite of a anar of thattheintersection proven be can It theintersection isthese Obviously, neighborhood of neighborhood consider a point consider example doesnotset.Asan toalso need aclosed beanopenset;itcan neighborhood not the without todefineneighborhoods a way us whichfor topol concept is toospecial general neighborhoodmetric defined Fo a in space. example the intersection of aninfi of theintersection example Takefor need to beopen. not does sets ofopen number of anarbitrary intersection The sets. true be for openfollowing provento statementscanbe (sometimes canopen called andclosed beboth orthey opennor closed, neither be can Sets open”. mean “not not does “closed” that shows example previous The 84. Example 83. Example (,)(,)    (O4) (O3) (O2) (O1) ab

set A subset The union ofnumber any of open setsisopen. open. is sets finitenumber ofopen intersection ofany The The empty set

h afoe nevl ] , ( The half-open interval intervalThe closed O isthe union of two open sets, which again is an open set. with p U p , because it contains the open disk around around disk open the contains it because , plane Euclidean of the of x   (iii) OU X (i) and theset is a neighborhood of neighborhood is a x x Figure 27. NeighborhoodFigure27. axioms [,] ab N (,) .  nite collection of open intervals U ab 11 nn

t {0} which is not an open set. opennotan whichis {0} t in the real numbers isaclosed set, because complement its  X in therealnumbers isneither opennor closed. are open. open. are fr 1,2,3,... for cal space is based onthe conceptof the bitrary number of closed sets, and the union union of andthe number closedsets, bitrary r this definitionr this distance,a weneededthe ogical spaces. Statement (O4) above gives ogical spaces. gives (O4)above Statement n   x 2 ion of distance. Here, we also see that a  . Every closed disk around around disk closed Every . X if and only if there existsanopen if and only if

N 1 (iv) (ii) p , which is an open set. x x N N V THE MATHEMATICSOF GIS 2 clopen sets). The

p i a is  -

Draft - Not for public release (© Wolfgang Kainz) 9.1.3 TOPOLOGY

Continuous Functions and Homeomorphisms Homeomorphisms and Functions Continuous ucin : A function the statement: reduces to following usually continuity of the definition and the real numbers are homeomorphic. shows the graphof the function. is ahomeomorphism. It Thismeans thatthe open interval (-1,1) Example 85. Example topological behavior. the same expose and thesame essentially are they homeomorphic are twospaces If Thedefinition aboveisvalid for two any bothFigure 28illustrates conceptsofcon formallycontinuous as itfollows.We function.define can a called point is oftheimagethis neighborhood of apoint tothe neighborhood the maps that A function spaces. topological between mappings define We can thereby preserving the topology. topology. the preserving thereby preservingmappings. map They topo one Like in othermathematicalalso structures, the function has no“jumps” or “gaps”. point.of Continuity continuous every at such that f )tan() xx possesses a continuous inverse, we call it a it wecall inverse, acontinuous possesses space Definition 53 (Homeomorphism). that theimage of space topological Definition 52(Continuous function). x X 0  , we call ita we call ,  X X  2 if for neighborhood every ||

xx space to thetopological f Let  . Thisfunction is bijective, continuous and has a continuous inverse. Figure 29  0 X  continuous function. continuous  U  (1,1) x X U .. () ( , i.e., implies at point is continuous 0 to the topological space X in interval open an be f Figure 28. Continuous function U ( ()||() xfx fx , is a of issubset , V Let Y  of of . If this function is continuous, bijective, and this functioncontinuous,bijective, . Ifis f tinuity at tinuity a point and Let a function essentially of meansthe graph that XY hX f topological spaces. Fortherealnumbers spaces. topological 0 homoeomorphism : () for topological spaces we know we structure- know spaces topological for logical space to another topological space topological spaceanother to logical x  0 x  V  0 there isa neighborhood if for every Y  . A function if is continuous itis . If f . We call : be from topological a function the and XY f fx  is continuous at every point of of point every at continuous is fU () Y fX () V : 0 (or (or from be afunction the continuous function.   f topological mapping topological  

0 continuous a function defined as there exists a U of of at point atpoint x 0 such  ). ).

  0 71 71 ,

Draft - Not for public release (© Wolfgang Kainz) 72 9.1.4

Alternate Definition of a Topological Space Space Definitionof aTopological Alternate

always be a member of the topology. Further, topology. of the member bea always The three conditions for a topology require that set andthe empty thesetitself must space asfollows. a topological define and as axioms sets of open O3 O1 to properties the We take opensets. the from neighborhood ofa definition the and derives of open sets collection a of asproperties a topology defines set, open of an idea with the As mentioned equivale earlier, adifferent, yet thesame. buttheirareasarenot homeomorphic are disks both example second in the is di thelengthof(-1,1) because the interval The two previous show examples lengt that mappings. focused spaces topological on properties of that remain invariant under topological topological property a called is ahomeomorphism by ispreserved ofspacethat topological a property A 86. Example 1 ishomeomorphic to the open disk f (,) 2,) , (2 )) , (( of the topological space. space. points ofthetopological We callthe (O3) (O2) (O1) conditions: following three Space). Definition 54(Topological rr X  .. () ( , i.e.,

  A A ii ,   

OABO A BO OX The open disk XO OX  OAO   , O .  -1 i

  open sets open iI or a a or Figure 29. Example of a homeomorphic function

. Wecall . Drr -0.5 1 ) , , ( topological invariant topological

 (,)|1} | ) , {( XO

O -75 -50 -25 a Drr 25 50 75 Let a 2  topological space topological  topology (,)|2} | ) , {( X gvnwt t oa oriae ) , ( given with its polar coordinates fferent from the “length” of the real line, and line,and real ofthe “length” the from fferent  be asetand h and area are not topological invariants, h andareaarenottopological invariants, nt, definition of space starts a topological the intersection of a finite number of opennumberthe intersectionof ofafinite on  . Mathematical topology is mainly Mathematical is topology . 0.5 X with radius 2through thefunction whenthe the subsetssatisfy andtheelements O a collection of subsets of 1 THE MATHEMATICSOF GIS r x   and radius and X

the

Draft - Not for public release (© Wolfgang Kainz) TOPOLOGY

elements.second calledoneThe is or witheach of points its we can show that these open sets are a topology on on topology a are sets open these that show can we are then defined through neighborhoods, theproperties through and O1toastheorems. O4followdefined are then throug space a topological defines Theone first onof based the concept open sets. approach andtheset abstract theoretic neighborhood, of a on concept the approach based results.Figure andlead tothesame valid equally are above asmentioned space of a topological to thedefinition Both approaches 88. Example 87. Example tobetrue. neighborhoods With this definition, wecanprove the stat neighborhood. a now define wecan a topology of the definition in sets used open ofthe help the With set. an open numberopen setsis of anarbitrary of andtheunion set, is anopen sets always be extended the be to w lmns{,} , { two elements open intervals called can easily verify that the three conditions aresatisfiedforboth topologies. The firsttopology is (,{()| }) X based onconcept of there exists an open setan open there exists Definition 55. (Neighborhood). Topological space Topological Figure 30. Equivalent approaches to the definition of a topological space, open sets and indiscrete topology indiscrete neighborhood of open sets: (N1 to N4): to (N1 N of open set Properties Definition O1 toO4 O1

Considerreal line the set any on found be can topologies extreme Two xxX (,) X ab   on thereal line n , the second, one consists ofall subsets of with open disks, balls, etc.  . It is thecoarsest ofall topologies,. Itis because itconsists only oftwo x  A  A neighborhoods andrelatedtheorems containsopen an interval O More theorems More suchthat discrete topology discrete  Theorems  1

1 a subset . Wecall Axioms are opensets. The realline itself isanopenset.Again, N is a is x  30 summarizes both30 summarizes approaches:the intuitive neighborhood ements N1to N4ofDefinition49 about AN  h properties of neighborhoods. Open sets Open sets hneighborhoods. properties of  , which isthe finest of all topologies. 1 . Wecall it the . Based conceptof on A neighborhood (O4) neighborhood S of neighborhoods: of Topological space of x that completely within lies of the point thepoint of  X Definition of X (O1 to O3): (O1 to 1 Properties .. h oe e () ( set power the , i.e., . Thefirst one. consistsonly of N1 toN4 an open eitheran setif itis empty open set (,) X natural topology natural O x if NX   . This can can . This X

and A . We . We . All 73 73 Draft - Not for public release (© Wolfgang Kainz) 9.2 74

Base, Interior, Closure, Boundary, and Exterior

of opendisks members of of members Let statement: in thefollowing The between relationship a base of a topology 92. Example 91. Example point. theneighborhood ofthe by only space determined topological a of characteristic local a is This space. topological a of a point at base local a define also isaglobalchar base foratopology a Whereas 90. Example 89. Example sets, wecall thesesets opense every space set. If inatopological From thedefinition wek a topologicalspace of there. from follow aboutspaces More theorems topological neighborhoods. about theorems to N4as O4openN1 sets,and derives of property through neighborhoods defines sets.Itthen of open properties ce through spa a topological defines approach second The basic open sets iscountably infinite. rationalnatural for the numbers base are a topology the plane.of Note thatthenumber ofthe exterior of a set. aset. of exterior and boundary closure, of interior, concepts need the For further investigations,we contains contains sets isuncountable infinite. plane. This follows easily from definitionthe of a neighborhood. The number ofthe basic open of x topological space topological Definition 58 (Interior, of member space topological Definition 57 (Local base). an open set An definition equivalent for aba called a membersof of istheunion topology the open of set every that such Definition 56(Base). B defined as and for atopology base be the x there is an open disk with center at at center with disk open an is there base

Let Consider the natural topology the Euclideanin plane The open disks inthe Euclidean plane The open disks inthe Euclidean plane B B x B O 1,(,) ,} ), , ( ), , ( ,1), ( { that contain for the topology and the elements of with center center with xN Nx Nx Nx x . there is always an element an element isalways there be a point ofa metric space. Thecountably infinite set of X X a base of the topology. topology. the a baseof we define the interior, closure and boundary as follows: as follows: wedefinetheinterior,closure andboundary i a is Let x 11 23 is a islocal base at local base x Closure, Boundary,Exterior). form a local baseat X A collection collection A collection a and space be atopological se requires that for every point

 at at x isa local base at  x x X B t can be generated as the t can someopen as union generated be of neighborhood of if every x that iscontained in  a point of the topological space. Then the the Then space. topological of the a point . This is true because for every open set and a local base at a point can be expressed expressed be at a point can base and alocal B now thattheunionof open setsisanopen B acteristic of a topological space, we can wecan space, of atopological acteristic   of apoint of neighborhoods such that suchthat 2 B x 2 baseare a forthenatural topology ofthe with radii and center coordinates being . arecalledsets basicopen x . x Givena subset   2 O BO and a point  x .  X THE MATHEMATICSOF GIS . x B that belongs to to belongs that B cnan some contains  . Then of open sets -neighborhoods x . Thesystem. . A x o a of o a of B O is that

Draft - Not for public release (© Wolfgang Kainz) TOPOLOGY

The closureof 15 14 13 94. Example 93. Example shows of some properties closure, and interior, boundary. openits owninterior. setis An toA its closed equal The set is closure. following table the interior, boundary, closure and exterior ofthe set. boundary of related to each other. , ,} {,, XacdacdbcdeOX      Acd A bcde Theclosed sets complements are the of the open sets. Theboundary isof a set often denoted as not however, are, They complement. set the for as symbol same the closure for use we that Note A   .. } , { , i.e.,     

{}{,}{,,}{,,,}} , , , },{ , , },{ , },{ ,{ , { ,} {, cec be cd bcde A A The other words it is the intersection of all closed sets containing containing sets closed ofall theintersection is it other words The smallest closedset containing The complement The A A ae       ()   BAB A AB AA ,  BAB A AB , because the only open sets contained in   ). ). IiI iI IiI iI   

   {,,} boundary exterior

union, of allopenunion, contained in sets   abe  Let usconsider anopen subset Consider the set () AA AA , }{ {,} } {, ,} {,, , which results to, XA ii ii A    , Table 11. Properties ofinterior, closure, and boundary of a set A   Interior Closure Interior Boundary () is AA , of a set  X   {,} differenceis the closure ofthe the interior, with i.e., of set set of  be A

     A

, ,} {,,

, and bcde . The boundary The .

A A is theintersectionof the closure of (written as (written {} a {} abcde X a . , becauseamong theclosed sets  , the smallest one that contains contains that one smallest , the . The exterior of ,,,} {,,,   IiI iI IiI iI AA A AB AB frontier   adtesbe {,,} , , { subset the and    AA AA ii ii BAB A A 14   A  iswritten as the called is , of aset. ) is the interior of the complement of interior ofthe the ) is of the Euclidean plane plane Euclidean the of AA  A , thetopology

is called the the called is A

are

Abcd A  is theinteriorthe complementof of ,} {,  closure cd A . and and interior of of A           A with the closure of its of its theclosure with XAXA A AX AXA AAXA AXA AA A   O A . 15 X 13     A 2 whose union is (written as (written of

. Figure 31 illustrates . The interior of of AA dfnd on defined is () X ())(( () , ,} {,, A bcde  , i.e.,, (written as (written



 A A 

, i.e., ), in ), . The . ,} {, X , cd A X as is 75 75

, . Draft - Not for public release (© Wolfgang Kainz) 9.3.1 9.3 76

Classification of TopologicalClassificationof Spaces

Separation Axioms Separation

and every T every and Figure 32 illustratesseparation axioms T Every metric space with the metric topology is metricspacemetric T Every topology withthe Wepoints. separatetwodistinct firstpresentaxioms that points. anddistinct todisjointsets many different distinguish ways we Inknow topology detail. some in them of at each look us Let connectedness. their and size, overall their compactness, their regarding separated, are points their which to degree the to this is done according Usually, spaces. to topological classify ways several are There Figure 31. Interior (upperleft),Interior boundary (upperFigure31. right), closure (lower (lowerexterior left) and In other words,there space Definition 61(H do that contain thepoint. not other points haveneighborhoods Definition 60(T points at other distinct that least not one hasaneighborhood contain thepoint. does Definition 59 (T AB  orT 1 space is always T always is space 2 space . 1 0 AUSDORFF space). i w itntpit , points if twodistinct space). exist two open sets A A We call a topological space space topological a call We  We call a topological space 0 Space). .

right) of an open set set open an of right) A topological space space A topological 0 , T bX ab 1 , andT  A neighborhoods. open possess disjoint and 2 . H . 2 . T AUSDORFF B 1 (or a T with 0 (ora X is called a called is T aA 1  space spaces are always T always are spaces  T A 0 space THE MATHEMATICSOF GIS A and ) if two distinct twodistinct ) if  H ) if for two two for ) if bB AUSDORFF 

and

1 ,

Draft - Not for public release (© Wolfgang Kainz) TOPOLOGY

Finally, we introduce a separation axiom that separates closed sets. sets. closed introduceseparation axiomthatseparates we a Finally, regular. not are and normal spaces (T spaces normal and Figure 33 illustrates the axioms that lead to the definition of regular (T definitionof regular lead tothe that Figure 33illustrates theaxioms not thatare normal. spaces exist regular is there not The because converse true, Every metric metric spacewith topology the is H metricmetric topolog Every the spacewith set. outsidethat lie sets frompoints that the We now look ataxioms thatseparate sets.Fi AUSDORFF then we call this space a thisspace then wecall closed sets Definition 63(Normalspace). neighborhood andpoint every Definition 62(Regular space). Nx T-axiom 0 1 y   N N x () 1 space. therebecause space. The areH true, converse not is y C 1 and N x of of outside outside 4 C and T and x 2 Figure 32. SeparationFigure32. axioms T sets, containtheclosed that neighborhoods there exist disjoint , thenwe call thisspace a normal space normal 1 C axioms). axioms). Nx set open exists an there 1  T If a topological space is T is If atopological space If a topological space is T space Ifatopological 1 y x Ny N -axiom x 2   ()  N N or N 1 2 y () T 4 space rst we define an axiom that separates closed closed separates that rst wedefineanaxiom normal, and every normal space is regular. regular. is space normal every and normal, y is regular. Every regular space is a regularspace is Every isregular. y regular . 0 , T A

space 1 that contains that , and T 1 and for every closed set set closed every and for 1 and for any two disjoint two disjoint and for any or Nx NN 2 1

T T  12 2 3 Ny  AUSDORFF N -axiom space 2 x ()  C N 3  y and adisjoint . andT () spaces that that spaces 1 axioms) axioms)

C

77 77 Draft - Not for public release (© Wolfgang Kainz) 78 9.3.2

Compactness Compactness

characteristics. characteristics. topolo of a specialcase very a space is 16 bounded wewillseethat Finally, subsetsofcovers. and both closed a are spacewhichEuclidean These characteristics. than separation In we discussthis section properties oftopo Separation characteristicsaretopological prope topological spaces. FigureshowsThe therelationsfollowing 34 between the separation characteristics of topological space X A set is Asetis from isahomeomorphism characteristic and there separation has acertain Figure 34. Relationship between separation characteristics oftopological spaces 16 bounded are of special importance. importance. ofspecial are when it whenit is contained in some open ball with finite radius. A C T-axiom 3 Y  A Nx , also N  O  N Figure 33. Separation axioms T x () Y samecharacteris will havethe asof spaces Hausdorff eua spaces Regular Normal spaces ercspaces Metric

T T 1 0 spaces spaces conditions are defined by what is called open open called is what by defined are conditions logical spaces whose conditions are stronger are stronger conditions whose spaces logical gical space thatposse rties of a space, i.e., ifatopologicalrties ofaspace,i.e., space C A T 4 1 A  BO -axiom  B  O  3 andT C 2 4 tic. We see that a metric

sses all separation separation sses all THE MATHEMATICSOF GIS

X t a to

Draft - Not for public release (© Wolfgang Kainz) TOPOLOGY

condition of acontinuous mapping (and not a homeomorphism). they are open an cover of centershave integer coordinates. Theunion of arrive atthedefinition of a L If we relax the condition for compactness the If werelax toha 17 that property isa topological Compactness 96. Example uslist tellmetric that spaces asas well compact H The results from theprevioussection about se compact: are spaces following The finite hasa subcover space If a topological 95. Example L more. Therefore, thisfamily ofopen hasdisks no subcover. in the topological literature: literature: in thetopological becan found proofs Their spaces. about compact bemade can statements The following INDELÖF This proposition states thatcompactness asatopol onal ucvr ecl L a call we subcover, countable Definition 66 (L a call finite subcover,we Definition 65(Compact space). cover of subsets Definition 64(Open cover). (iv) (iii) (ii) (i)    INDELÖF

A compactH bounded. comp -spaceis oftheEuclidean A subset iscompact. space acompact of subset A closed compact. imagespace is ofacompact A continuous A closed interval, disk orballin finitetopological space Any 1] [0, unit interval The closed of space.

X The Euclidean plane Consider all open disks in the Euclidean plane ). Compact spaces are always L always are spaces Compact ). X . If . If the union of these subsets is the whole space thewholespace is ofthesesubsets Iftheunion . F INDELÖF AUSDORFF  is a subfamily of is asubfamily  X 2 . If we leavedisk,their If we outone union isnotwhole space the . any space). INDELÖF space is normal. compact Let X  n feeyoe oe fatplgclsae has a space ofatopological open cover Ifevery 2 feeyoe oe fatplgclsae has a space open Ifevery cover ofatopological equippedthe with natural topology ofopen disksis a X space. space. space. space. F L and space be a topological INDELÖF  with remains invariant under homeomorphisms. homeomorphisms. remains under invariant name. special a with space this call , we 1 INDELÖF , thesecovers disks thewhole space. Therefore, ogicalproperty iseven preserved under the weaker  paration andparation item thelast previous from the ve a countable instead of a finite coverwe a finite of ve acountableinstead  2 sae(rw a htsae is space that say we (or space , or F AUSDORFF  . act if and only ifis ifand it closedact and   X 3 17 , respectively , respectively , then

 spaces are normal. arenormal. spaces 2 whose radius is 1 and their F X  is a , we call , wecall F ofopen a family subcover F an X X of X open open F . 79 79 Draft - Not for public release (© Wolfgang Kainz) 9.3.3 80

Size Size

disks with rational radii and center coordinates are acountable base for second-countable. countable are topological properties and remain invariant under homeomorphisms. under remainandinvariant aretopological properties countable second- and The ofspaceto atopological properties first-countable, beseparable, characteristics: follFor topologicalspacesmake the we can 101. Example space. of characteristic more aglobal related to point. of a neighborhoods of the properties the a topolo of property local isa First-countable 100. Example 99. Example 98. Example space. topological separable a of definition the to leads which space atopological of size With both properties of aset to be countable 97. Example chapter 5 on settheory that aset is set is ofa itscardinalitmeasurethe size for A further characterization of topological spaces a countable local base for a metric space. thereforeIt is first-countable. shown that In order to proceedwe needoftheterm thedefinition dense. countablyor is infinite. L then space issecond-countable, If atopological countable for base itstopology. Definition 70 (Second-countable). local base. has acountable Definition 69(First-countable). subset. dense Definition 68 space). (Separable is Definition 67 (Dense set). INDELÖF X , i.e., 

The Euclidean plane Every discrete topological spacefirst-countable.is Every metric space isfirst-countable. According toExample 92 we haveidentified -dimensional Euclidean space is separable. The numbers rational The .  A  n . The rational numbers are countably infinite. X . Asubset   2 A topological space is first-countable if every point point ifevery first-countable is space A topological

A topological space is is space Atopological second-countable.is According Example to the open 90 are densea subset of the real numbers, because it can be countable A topological space is second-countable if it has a a ifithas issecond-countable Atopological space A space of atopological and densewe can impose some limiton the y, or number of elements. We recall from We recallfrom elements. of ornumber y, ifit has either afinite number of elements owingstatements with regard to their size gical space, which determinedby is solely Another property of a topological spaceis ofatopological property Another can be done according to their size. A A size. their to according bedone can it is also first-countable, separable, and separable, isalsofirst-countable, it separable X is if it has a countable it hasa if  dense THE MATHEMATICSOF GIS 2 . Therefore, if its closure if itsclosure  2 is

Draft - Not for public release (© Wolfgang Kainz) 9.3.4 TOPOLOGY

Connectedness Connectedness 18 connected. is mapping acontinuous under set connected a imageof The homeomorphisms. under itremains invariant i.e., property, topological isa Connectedness for regions conn path-connected spaceis every Ingeneral, connected. space canbe topological bestated ina how twopoints condition can whenweconsider stronger A somewhat 103. Example 102. Example topological space representedof as unionconditions disjointopensubsets. a the The ontwo following be itcannot or piece inone ifitappears isconnected a space speaking, Intuitively istheentirespace. union whose opensets nonempty disjoint two into divided be cannot of suchthey withtheproperty spacesthat deals spaces topological of Connectedness result: sets that are both open and closed. topology on abcdeXa An open connected subset of a topological space is called a called is space topological a of subset connected open An  Every open connected subset of subset open connected Every and point) (beginning space topological points two any 72 (Path-connectedDefinition space). subsets of two nonempty asthe represented union Definition 71 (ConnectedSpace). (iii) (ii) (i) AB }{,,} {,, {}



The only subsets of subsets only The X X cannot be expressed as the union astheunion beexpressed cannot connected. is 18 X of the Euclidean plane

Let space Euclidean The . Then . abcde X X isthe union of two disjoint nonempty open subsets. x  12 are equivalent to formulate connectedness: connectedness: toformulate equivalent are , ,,,} {,,, X X xX is not connected, because because connected, not is  i otnosfnto :[0,1] is a continuous function f (1) X that are both open and closed are the empty set empty the are and closed thatare both open  of the space canbe a connectedpath.A by path x 2  be a set and (end point).  n is connected, because the empty set and 2  ispath-connected. 2 Aspace we havethenatural topology thefollowing with A topological space Atopological of two disjoint nonempty open sets. sets. open nonempty disjoint of two ected. The converse is not Theconverse true.However, ected. {} XacdacdbcdeOX a  X and f region {}{,}{,,}{,,,}} , , , },{ , , },{ , },{ ,{ , { is XAB , ,} {,, bcde connected  .   X X are disjoint open sets and such that that such is then if whenever it iswhenever it if path-connected AB    n and f are theonly (0) in a  X or if x . 1

81 81 a Draft - Not for public release (© Wolfgang Kainz) 9.4.1 9.4 82

Simplicial Complexes andCell Complexes

Simplexes and Polyhedra Polyhedra and Simplexes

Figuredefinition 35illustrates the closed with space. space, atriangle in a spa two-dimensional in a one-dimensional line segment a straight space, azero-dimensional in apoint i.e., space, in the Euclidean dimension geometric of a figure respective geometric simplest We firstneed to introduce theconceptof a cells. from together glued CW complexes) (or complexes polyhedra leadstoof cell A generalization simplexes. the builtof simple buildingblocks, is that space is atopological A polyhedron polyhedra. is spaces simple ofthese One class tohandle. easy and being shape recognizable a keeping spaces, yet complex more toform together pieced be canthen spaces These for many investigations. We, look therefore, fo complex generalandtoo very usually sofarare treated have we spaces topological The simplex If we require as written be can A closedsimplex the simplex. dimension simplex of where Definition 73 (Simplex).  00 v ,, v  v 0 0 0 kn , written as , written  k v v  v 0 3 2 , we call the smallest conv smallest the call , we   v 0 and v v ,, 1  1 1  Figure 35. Simplexes ofdimension 0, 1, 2, and 3 v 

k k 01 k . 2   ), written as  Given  3-simplex (solidtetrahedron) 2-simplex (triangle) 1-simplex (closed line segment) (point) 0-simplex   numbers excludingzero)(positive real getan we 

k k   k 1 1 ex set containing thema . Thepoints . points ce, andtetrahedron a in a three-dimensional simplex. Simply speaking, a simplex is the a simplex isthe speaking, Simply simplex. simplexes dimensionsof 0, 1, 2, and3. r simpler spaces that can be used instead. instead. canbe used that spaces simpler r  vv vv 01 k ,, ,,  vv   0  ,, 011 00  vv vv k  k are called the n closed in general position,  THE MATHEMATICSOF GIS

k kk - (or simplex (or vertices where the where open

of k -

Draft - Not for public release (© Wolfgang Kainz) TOPOLOG 9.4.2

C Y Y e e

lls and C open set open face The co A simp a Eucli Howev Note th commo howev simplic on one Figure comple Euclide A simp s faces, faces, In Figu 19 possess h other For ma ar they Polyhe polyhe dimens Y Given iscal 2. 1. satis Eucl Defi of

e d d e v e e d e n d d l 3 e i s F a I I i x i n n i x i f l n n e r l at a simplic at a l idean space an space. space. an r, nocomm ed a a ed

01 on ron a topological compact a compact al complex a x 1-faces, of f twosimpl icial complicial ied: ra possess ra possess ex isa top vex hull ofvex hull Figure 36. ean space, space, ean r, if we co if r, e 35 the cl the e 35 nd, general nd, general the leftis 6 shows 6 shows tw ll Complell the simple y topologi y . s many use s many or every si or every face. ition 74(S , v , written kn X and subspace  with v . 2 W m n V n Y e u c w o w o , i o x e . n i o f x  o collection space a simplicial xes intersect sider the unsider the and three 1 andthree d a metric s d a al complex al complex al investiga The lowe The of of seful prope a nonempt mplicial C mplicial as alid simplicialid plex allofit ul propertie logical spa x sed 1-simp sed topological . If a Ifa si . d four 2-fa d four . This gives gives This . e can e can now n face. T n face. e can appl e can es n K is called is X || K . , whe X . and m y n n o h y r c c s p i a i a l l t t s r r is a set of s of is aset p s is a co cell then they m subsetof t a subset ties. Asclo viewed in in viewed mplex). -faces, -faces, us theus open s a of is plex e linesegm on ofallsi ex hastwo ions polyhe ions es. es. of simplex of the subspa faces must faces must e withthe l complex (l spaces are spaces triangle t triangle ace. ace. complex. complex. iece toget s implicial A vv Y 01 o h m o u f h e e i t c , a e d e d e n f s t t dra are too ent intersec complex mplex. mplex. er simplexe 0-faces 0-faces mplexes an mplexes

his way, is his way, uches the st doso a in The right ft) and invali e vertices o ts for a new new a ts for inite collect oo general. general. oo lso bein lso the e topology this w space, s in the 2-d the s in ed andbou imension plexes in a in plexes atural topo atural vv 12 , and ift v 0

o v n o 1 a a d d t t h h t n i s i s s a e l c 9 i 9 i d opology on f a closed s f a closed 20 ther one on s the upper upper s the simplicial c simplicial on nd ne violates ne violates collection. ogy derive ogy in a define mensional mensional pecial and and pecial e following as such no as such A concept concept A define a and make and topologica te a then ded subset ommon fac v simplicialc . The te K v 1 . The of cl of s k ub Y o o - s d E e e i i i t o o t s f f l t l t omplex (righ d way to a d way of aEuclid of t a topologi sed simplex mplex mplex triangle, bu two conditi oo complex oo from its e from its , the . rahedron h the conditi space that space atopologi pace in between ace isasi ace triangle ha uclidean sp uclidean mplex as a mplex the base.

s b ubspac y inter  k i o m a s c o c o c s e t e s e t t m secting the ace. The The ace. . Onthe . we calla we There is, is, There ) ns are subset of subset implicial s four 0- s four not in a in not three0- al space. s in a s in that also called a called al space. space. al topology an space ns fora bedding bedding plex of of plex

83 . Draft - Not for public release (© Wolfgang Kainz) 84

dimensional skeletons. skeletons. dimensional Figure 38 showsdecompositiona cell of a 2-dimensional space with the 1-and 0- way. in acertain together glued are that cells of collection asa defined simp a of concept the generalize now can We cells. 2-, 3- 0-, and 1-, 3 0, 2,and 1, of dimension corresponding unit 37balls Figure shows 105. Example 104. Example radius 1, and the unit cell isthe diskopen with radius 1. subspace subspace i.e., cells, of these union disjoint space Definition 76(Cell decomposition, skeleton). to space homeomorphic topological subspace The dimensional 1) The ( The subspace topology. natural space withthe Euclidean Definition 75(Unit Ball,Unit Sphere,Unit Cell,Cell).       2-dimensional unit cell 3-dimensional unitcell 0-dimensional unitcell 1-dimensional unitcell X X X XXX n X  0 1 101  set and a

Every open ccnXc In In unit sphere. unit n -dimensional subspace    xx Dx xx Dx 2  nn  the unit ball isaclosed disk radius with 1,theunit sphere isthecircle with   nn {|dim()} C   {|||1} {|||1} n of subspaces of C -simplex isa -simplex    Figure 37. Unit balls and cells nn

Xc D n is called the iscalled   xx Sx -cell. -cell. n c  i cle the called is  X . We have then a sequence of subspaces . ofsubspaces We havethenasequence iscalled a nn C with with  1 whoseelements are cells suchthat  . The {|||1} licial complexlicial to acell complex, which is  A  XX  n n n n -dimensional -dimensional cell decomposition cell -dimensional -dimensional -dimensional  n 2-cell 0-cell 1-cell 3-cell Let -dimensional .  i cle te 1) ( the called is n bethe unit ball unit of skeleton cell THE MATHEMATICSOF GIS (or (or is a topological topological a is . A . A cell unit n . -dimensional -dimensional n -cell). X X n is the the is is the the is 

-

Draft - Not for public release (© Wolfgang Kainz) TOPOLOGY

boundary end two points. arethe Example 107. Example determined. clearly is which cell of the dimension on the of acell is depending boundary the whereas space, an regard definedwith embedding to of asetisalways boundary ofaset.The boundary It is important tonote that theboundary of 106. Example equal to means thatthedisjoint union0-, of 1-,and2-cellsinstance (offor a2-dimensionalpolyhedron) is defined as number of itiscalleda CWcells finite complex.. A CW complex is 3. 2. 1. cell complex Definition 78(Cellcomplex). cell orthe boundaryDefinition 77(Closureand ofcells).

A subspace A subspace closedcell Every cell For every X || f f K of a 2-dimensional space 2-dimensional a of () () 0-dimensional skeleton 0-dimensional . SX Dc    eldecomposition Cell  L nn . n 

Consider segment line a | The open simplexes of apolyhedron | closure 11  (or LL  . CW complex  A of 3  n cell and theopen c c X -dimensional if -dimensional c Figure 38. Cell decomposition andskeletons in , which isall of acontinuousfunction there exists is contained in a finite union of open cells. cells. in afiniteunionofopen contained is , such that for every cell l, cell every for such that , X ) if the following conditions are met:following conditions are the ) if . The difference . difference The A H L AUSDORFF in XX XX c L i.e., cell, oftheunit image is ahomeomorphic   . If, however,. If, 3 . The point set topological boundary of acell inis notthesame general as the nn  space  ccc K  Forcell every have we 1-dimensional skeleton 1-dimensional aeacl eopsto f|| cellare decomposition a of |  A 1 . Ifa cellcomplex hasa finite X  is the decompositiona acell is with c L is closed in in closed is 1-dimensionalis a cell, then its boundary f : DX n  c of , is closed, is in c c such that that such . a closed closed a K

. This L is 85 85 Draft - Not for public release (© Wolfgang Kainz) 86 9.5

Applications in Applications GIS

continuously mapped ofthe toasubset continuously 1) ( the celland unit of the image ashomeomorphic a appears the open cell dimensional CW complex. We start with a discrete space CW2- complexes constructed. ofa can be easily construction 39 illustrates Figure the dimensional Euclidean dimensional space spatia represent to GIS in used space The from the afunction defines Condition 1 0-cell); we then glue 1-cells so that we get we so glue 1-cells that we then 0-cell); We see that simplicial complexes: complexes: simplicial the underline statements following The called weak topology. fi closure also called 2 is Condition compact. H and regular, normal, a also (therefore space metric a is space Euclidean The balls. and f AUSDORFF (,)(,) , ( ) , :( 3. 2. 4. 1. Scc c DS X X

nn 2 0 not be be a not to be cells of dimension dimension of cells be to The closure The closure Not forevery ofa The closure Cells of a CW not complex need be geometric simplexes. one 0-cell. 0-cell. one  1 Start with 0-cells with Start Gluing of 2-cells space), second-countable (therefore also first-countable, separable, and and separable, also first-countable, (therefore second-countable space), XXX  012  (1) n  c and boundary andboundary kn or or -sphere. -sphere.  Figure 39. Construction of a CW complex n f -cell need not bea -cell neednot . with () Scc c DS   nn 2  k or or n . However, every non-empty CW complex has at least least at has CWcomplex non-empty every . However,

need there CWof complex the thedimension being    1 3 c equipped with the natural topology of open disks topology natural equipped withthe n of a cellneed not be the union of cells. -dimensional unit ball to-dimensionalunit ball thespace X differences betweenCW complexes and 1 nite; condition3 is condition the for theso- l features predominantlyl features is the 2-or 3- , then weglue 2-ce n X X . The closed cell and the boundary are cell andtheboundary . The closed -ball and the boundary of a -ball and theboundary 1 n  1 -space. In particular, we have wehave In particular, -space. Gluing of 1-cells of Gluing X 0 (consisting ofat least one lls which gives us THE MATHEMATICSOF GIS n  X n -cell need -sphere is such that such

X 2 .

Draft - Not for public release (© Wolfgang Kainz)

9.5.1 TOPOLOGY

Spatial DataSets Networks, like road or rivernetworks, are be which oneto node. the end right ofitviewednode to directionstart in the from weno arc every For the figure. in arrows by It is completely embedded in the plane such that no two edges intersect except at nodes. intersect embeddedplane thatno twoedges inthe such It iscompletely graph. planar a is in GIS used graph frequently of type A special discipline. mathematical asanindependent developed has to related topology, although closely Graph theory, between relationships edges(arcs) nodes. and Thetopological a cellcomplex. of skeleton) 20 arc ofthe an orientation defining thereby node, anend and start a has arc Every nodes. the between arcs arethe 1-cells nodesandthe are the cells to represent th A datastructure as spatialdataset cell a embeddeda 2-dimensional complex the in Figure 40shows complex. cell dimensional of a2- darepresentation GIS tabaseisadigital datasetina structured topologically it because features, polygon general for suitable glue cells are features all case second the In elevation model. undesirable. Anexception isa triangular ir has toapproximatedbe by a potentially easy and structures simple very are triangles featur all represent must we case, In thefirst of aCWcomplex). (seeDefinition 78 way in aproper glued together being cells considering the by complex conditions (seeDefinition74 of simplicial complex, i.e.,to represent allspatia spatialTo featuresin 2-dimensional represent L cells B,C).Theembedding (A, Euclideanspace e, f),andthree2- c, d, b, (a, 1-cells 3, six 2, 4), of (1, 0-cells four This consists complex “outside polygon” often denoted as W or O. W or as often denoted polygon” “outside Spatial data sets Spatial data consisting of simplexes). and cells as closed (such compact the beginning (start node) to the end(end node). and the bounding arcs and nodes as the 1-dimensional skeleton. skeleton. 1-dimensional as the nodes and arcs thebounding and 2-cells as polygons with the complexes CW are 2-dimensional sets data feature Polygon skeleton. 0-dimensional the nodes the and 1-cells the are arcs the where CW complexes The orientation of an arc is usually determined by the digitization process, i.e., a line is followed from INDELÖF ), and connected. Closed and bounded subsets of a Euclidean space are ofaspace subsets Euclidean are andbounded and Closed ), connected. Figure 40. Two-dimensional spatial data set as cell complex linear features (network) in in (network) features linear is cell complex is the so-called arc-node structure. The0- structure. arc-node so-called isthe is cellcomplex a simplicial complex), a simplicial or (ii) to represent them asacell  b 2 2 1 A c d to handle; on the other hand, every polygon on topolygon hand, every handle; the other regular network (TIN) to represent a digital digital regulara network torepresent (TIN) large number of triangles which is often of islarge number triangleswhich te which polygon (2-cell) liesto the leftand te polygon(2-cell) which st modeled as a one-dimensional as st modeled subset a one-dimensional (or C a es by es by a setoftriangles.On one the hand, l features as a set of simplexes with certain certain with simplexes set of asa l features B relationships are incidence thento reduced relationships d together. Thisappr a GIS we have two options: (i)to usea aGISwehavetwo options: 3 avoids the useavoids theInfact,every oftriangles. Such a structure is also called isalso a graph. called astructure Such  e 2 functions as the“world polygon” or 4 f 20 . The orientation is indicated isindicated The orientation .  2 or  oach is much more 3

are 1-dimensional 1-dimensional are  2 87 87 . Draft - Not for public release (© Wolfgang Kainz) 9.5.2 88 9.5.3

Topological Transformations Transformations Topological Topological Consistency Consistency Topological

the data set, we know that it is a topologicaknow itisa the dataset,wethat follo the show that Ifwecan violated. notbe ofa A representation cell complex must be cons equivalent. topologically are They . complex tothecell complex ahomeomorphism have applied we speaking, Topologically 41). perimeters havechanged(Figure theof the length and theirshapes lines,boundary only same the by bounded still end nodes. Theareasare an remain, andC B, between A, relationships theneighborhood to dataset, map atransformationthe projection) a (such as apply you havespatial features storedin adataba Assume mappings. under topological change) do not (i.e., remain invariant spaces that of the is branch seen, topology have we As 40. Figure in complex cell the of structure arc-node the of table arc the shows 12 Table thearcs. of the vertices one for and attributes, forthepolygon one relations, the arc-node structure arc-node of the An implementation (TC4) (TC3) (TC2) (TC1) Arc-id Start-node Arc-id End-node

d 32 B A b 12 A W e 4 e 3 B C 1 c 3 C A 4 a 1 C W M f 4 2 W B 1 node there exists an alternating clos analternating thereexists node 0-cell is surroundeda Every by closed cy arcs.) consisting ofan boundary a closed has a closedcycl 2-cellisbounded by Every andrightpolygon). left the polygons, adjacent two there exist arc every (For two 2-cells. are there 1-cell every For end node). 1-cell Every is bounded by two0-cells. arc (Every has a startnode and an  b 2 2 1 Table 12. Arctable for the arc-node structure A c M d Figure Topological 41. mapping 1 C a B M 3

2 e 4 f lly consistent 2-dimensional configuration. configuration. 2-dimensional consistent lly h se using the arc-node structure. When you you When structure. arc-node the using se d the boundary lines have the same start and start same have the lines boundary the d wing rules are satisfied for every element in mathematics that deals with of properties in a relational database relational in a Left-polygon Right-polygon ed sequence of arcs and polygons.) ed sequence ofarcsand polygons.)  b istent, i.e., the topological properties musttopological properties i.e.,the istent, 2 2 alternating sequence of nodes and and ofnodes alternating sequence cle of 1- and 2-cells. (Around every every (Around cle of1-and2-cells. e of 0- and 1-cells. (Every polygon (Every e of1-cells. 0- and 1 A c M d 2 C a B 3 MM hM : e 12 4  needs one tablefor f THE MATHEMATICSOF GIS

cell from the

Draft - Not for public release (© Wolfgang Kainz) TOPOLOGY

NOT NULL value for the Start-node and End-node for every arc is sufficient. is sufficient. arc every for End-node and Start-node the for value NULL NOT polygon. polygon. Left- or Right-polygon as either Aappears where arc table the from allrows Select 40: Figure Ain polygon an nodes of cycle a closed have we polygon, arcissufficient. and Right-polygon for every Left-polygon 21 boundary. inthepolygon aninconsistency have we isclosed.Otherwise, boundary star we where node the to wereturn When next upstep look the record where3 appears Inthe 3. Theof cis 42). end-node1(Figure candnode start witharc us let example Inour nodes. andthrough chain the Start-nodeof the selected rows atany now start We In the Right-polygon. our example wewa as always or astheLeft-polygon always A appears records allselected for that sure Make TC3 TC2 TC1 table. the followingconditio we willdiscusshowthese In dimensions. modifications to other additionsorThese rulesbe appliedwithout cannot our case we must swap for arc b, which results in the following configuration: followingconfiguration: the resultsin for arcb,which must swap we ourcase course, if we do that, we must also swap Start- ifwedo wemustalso swap course, that, Of and Right-polygon. must swapLeft- we the Right-polygon, whererowsnot those Ais Thechoice could be onbased the fact that fortwo out of three rows this condition is already fulfilled. (TC5) ensures that polygons are closed, i.e., starting at any node of the boundary of a of boundary the of node atany starting i.e., areclosed, polygons that ensures of a presence NOT NULL ofpolygons. The relationship theneighborhood ensures astar have must arc thatevery demands Arc-id Start-node Arc-id End-node Start-node Arc-id End-node

d b d b c 4 a 1 C W c 4 a 1 C W e 4 e 3 B C 4 e 3 B C f 4 2 W B f 4 2 W B Cells intersectonly in 0-cells. (If ar Figure 42. Closed polygon boundary check check boundary polygon Closed 42. Figure 3 1 2 3 1 1 b 2 1 A 3 2 2 3 1 2 c d nt A always to betheRight-polygon. nt Aalways C B Left-polygon Right-polygon Left-polygon Right-polygon d arcs. We aprocedurefor willillustrate d arcs. ted, theisclosed cycle andthe polygon cs intersect, they do so in nodes.) and tomaintain In End-node orientation. t node and end node. The presence of a a of presence The node. end and node t as the start node and continue as before. as continue and thestartnode as 3 ns can be checked when wehave an arc e W A C B C B W A A A A A

21 For 89 89 Draft - Not for public release (© Wolfgang Kainz) 90 9.5.4

Spatial Relations

locations without nodes. End-node. or as Start-node either appears 3 tablewhere arc the from allrows Select procedure for node 3 in40: Figure be an “umbrella” ofalternat aclosedcycle between the boundaries, the interiors, and the exteriors of and , we know that these , that we know and exteriors of the and interiors, between the the boundaries, boundary, Both respective . their have intersections of combinations possible all When weconsider and exterior. interior, and regions Let us two assume spatial spatial features. between relations and exterior do not mappings, under wecaninvestigatechange topological their possible between relationships define spatial features to andexterior boundary, interior, of properties topological the use we can data, spatial or simplexes between relationships Whereas TC5 node. inthe aninconsistency have we Otherwise, theisclosed. and “umbrella” is closed cycle the we started, where polygon the to we return When before. as continue and as theLeft-polygon A appears where record the up look next step the In A. c is of TheRight-polygon 43). (Figure C In Left-polygon ourletusc and example startwitharc polygons. the through chain and rows selected the of Left-polygon at any start now We swap for arc d, which gives us main to Right-polygon must also swapLeft-and we ifwedo that, Ofcourse, End-node. and Start- mustswap we is notEnd-node, the where3 For rows those End-node. the tobe always 3 we want ourexample End-node. In asthe always or Start-node the as always 3 appears records selected forall that sure Make TC4 must be checked by calculating intersections of arcs and pointing out intersections at at out intersections pointing arcs and of calculatingintersections by mustchecked be must node there every for node, i.e., near a complex of the cell planarity the ensures Arc-id Start-node Arc-id End-node Start-node Arc-id End-node b 12 A W d b d e c 4 a 1 C W e c 4 a 1 C W f 4 2 W B f 4 2 W B 4 2 1 2 4 3 1 Figure 43.Node consistency check c C C A

A 3 d 3 1 3 2 3 3 3 . Since the properties of interior, boundary, boundary, . Sincetheproperties ofinterior, B ing ing 1-cells and We2-cells. will illustrate a Left-polygon Right-polygon Left-polygon Right-polygon cells define consistency constraints for for constraints definecells consistency e B e tain orientation. In our case we must Intain orientation. we our case W A C B B C B A B THE MATHEMATICSOF GIS A A A A C C B

Draft - Not for public release (© Wolfgang Kainz) TOPOLOGY Exercise 34 9.6

Exercises Exercises

inquerie for instance, used, wesay intersect, meet. Figure disjoint, 44 spatial relationships: showspossible eight all and canbe and overlap. Theserelationships covers, contains, by, equal,meet, covered inside, and of exteriors andthe notintersect, do that and of interiors two regions. If, forinstance, the boundar From wecanderive patterns, these intersection which is called the 9-intersection, written as schema will not changeunderany topolog A Figure 44.Spatial relationships between two simple regions based on the 9-intersection IAB 9 (,) B A B I 9 (,) inside equal meet disjoint BA AB B A AB AB s against a spatial database. aspatial s against          A ical transformation. Thiscan be put into arectangular A –––––        ABABBA ABAB BA   f itret h onayo ,the of intersects the boundary y of eight mutual spatial   A contains covered by overlap covers A – – . relationships B between

B 91 91 Draft - Not for public release (© Wolfgang Kainz) Draft - Not for public release (© Wolfgang Kainz)

93 93 CHAPTER CHAPTER 10 O study of partially ordered sets and lattic orderedand of partially study sets relationships witheachother. lattices and show canhow they beappliedtospatial and features their oforderedand introducepartially In thisprinciples sets chapter, we the basic will algebra. Boolean or multiple inheritance as in such science, computer in beenapplied mainly has theory This literature. ofmathematical amount an by covered extensive

Ordered Sets Ordered defined between its elements, which makes them comparable. The The makes comparable. them which elements, its defined between orderedrelation saidwhenanorderto (partially) is be set is order. A thene of basicstructuresmathem es (a special kind of ordered set) is es oforderedset) (aspecialkind atical discipline atical s are built upon is

Draft - Not for public release (© Wolfgang Kainz) 10.1 94 10.1.1

Posets Posets

Order Diagrams

turning it upside down. Figure 45 shows a poset and its corresponding diagram. its corresponding diagram. and a poset itupsidedown. 45 shows turning Figure connected withastraightline.Forfinite obtain posettheof thedual we diagram by contained in of A diagram of aposet of A diagram (finite)For every poset thereexists ordering. atotal of example a typical is space Theinteger set. the in element morespecial a ofposet—is type the therefore hierarchy—and of type el most one at is aposetwith hierarchy Any 109. Example 108. Example orderedset partially For every specificelement, whichmeans that every (or that set canturnedbe intoa statement ofitsdual replacing by set inclusionset andevery for When we takethe power set element covering: covering: diagram covered by by covered and there isno other element inbetween. Th mean that Definition 80 (Cover). as written relation(orderrelation) transitive is calleda 3. 2. 1. for every such that, Definition 79(Partially Ordered Set). P B X chain x

) and connecting lines (indicating the coveringfor the circle relation),where the is called   if if x ) of the poset. To describe how to To describe theposet. ) of y A A  ). This is a hierarchy in which at most one element is directly below any mostone elementisdirectly inwhich at Thisa hierarchy ). is x x dual ifandonly if in the is drawn above the circle for element element for circle the above is drawn . In otherwords,   x B

For spatial subdivisions For spatial The naturalnumbers therelation with (reflexive) partial order y y B ” ordually,that“ P X and and   iscalled the A );( cover . Usually we willwrite Usually . no exists there and y y   P , z x is drawn as a configuration of of configuration as a is drawn of By “ , then , then , on   X cocover A X P Pzyx B  , writtenas )( A covers x x . A set P contains of a set set a of XBA   covers we can find a newposet,thedual of )(, z y  y we define we of agraphical representation,the A (transitive) (transitive) (antisymmetric) is called set apartiallyordered  and B

P X x B mas that means X A  Let in and antisymmetric areflexive, with equipped P and we write andwe X ” (or “ ” (or ”. , i.e.subsetsall of Px B ement directly above any element. A special Aspecial element. any above directly ement element can be compared with every other other every with compared can be element meaningwith the ‘  P that eall elements setof thatcover an element . Dually,the setofall elements thatare the order relation construct a diagram we need the idea of A  . Any statement about a partially ordered ordered partially a about statement Any . P  read as “less thanor equal” are a poset. B relation A binary be aset. B B

, when is covered by if and only if  A circles (representing the elements greateris immediately than X    with AxB . A and wewrite covers covers X P , then

A  is a poset’. is aposet’. A  and vice versa. versa. vice and  ”) inaposet B (or THE MATHEMATICSOF GIS diagram BA B  totally ordered set means that“ . . The circles are X poset P )( A , by defining defining by , is ordered by  (or ) and is ) and  on P B we we Hasse or or P B A

is

Draft - Not for public release (© Wolfgang Kainz) 10.1.2 SETS ORDERED

Upper and Lower Bounds Bounds Lower Upper and respectively. For a subset asubset For respectively. the leastupperbound andthe lowerboundof greatest two elements infimum If 110. Example traversing directed acyclic graphs a called is a graph moving along theedges of the graph in thegive Theregraph.directed arethat nocycles in graph, starting i.e. fromspecificand anode theadi defines graph. Since orderrelation Thecircles and the connecting linesindiagram a be canviewed asvertices a andedges of By duality, ifBy duality, The naturalnumbers usualas undertheirthe orderhave1 bottom elementelement.top no but of theirlower bounds are subset for the bound lower greatest isno there Therefore, not comparable. are they the other, of l.u.b.does not exist. Take for example the two elements may be the case becauseelements nothave do common bounds because or or a g.l.b. This not exist. does bound upper oraleast bound lower greatest a when cases are There u{,} , sup{ S S bounds (or “ (or bounds of of allupperbounds bound upper Definition 82 (Upper Bound). and the least write Definition 81 (Maximum and Minimum). P * )o inf or ”) x  * element, itiscalled has aleast , if it exists, are defined by duality.if exists,by , it aredefined y Sa . If a least upper bound or a greatest lower bound exists, it is always unique. For For unique. itisalways exists, lowerbound oragreatest . Ifaleastupperbound i the is or or CB  },{ max

In A x (see Figure 46). 46). (seeFigure S S B  (or  of . * greatest (or has element, alargest it is called y Sa X S (ed s “ as (read minimum . Thegreatestelement of S )( if directed acyclic graph acyclic directed we have

lower s Figure 45. Poset and corresponding diagram  E D  D S S x ) xsSsPxS i dntd by denoted is and and we write write we for all all for ”) is written as ”) is ) maximum element } )( { X x and

as the top element and the empty set as the bottom element. element. bottom the as set empty the and element top the as join Let and and for other related operations. E . noneHowever, of thelower bounds is greater than

of  * y P least upperbound least  Ss )adif } , “) and inf{ element S poset and be a S C is defined by duality. The set duality. definedby . Alowerbound is , writtenas (the “ (the S P ). There are many algorithms for for algorithms many are dag (or ). There Let rection for the edges, a Hasse diagram isa rection fortheedges,aHassediagram * , if it exists, is called the , ifexists,called it is (r “ (or n direction, no node is visited twice. Such direction, noSuch node isvisitedn twice. of join of S P * x S greatest lower bound S upper be a poset and be aposet if ; in other words we define wedefine in otherwords ; y min , and the bottom andthe bottom , min or B DE S a (l.u.b.), also  B S “) or   and ”) and the set of all lower lower of all theset and ”) x PS x xsSsPxS  . An. element } )( { for every every for A . y sup C as“ (read of Figure 45. The set The 45. of Figure S C  top and join x PS

and (g.l.b.), element . An. element   or or element Sx S x  y ad we and supremum (the “ (the

meet Px we write write we of is an is meet of

P meet meet y

or or ”), ”), 95 95 . Draft - Not for public release (© Wolfgang Kainz) 10.2 96

Lattices

statement: statement: The order relation relation order The lattices. of properties algebraic onthe heavily rely algebras, Boolean e.g. theories, Many structure. analgebraic or structure an order being either as viewed be can a lattice see that order. None of them is a completeorder.Noneof themis lattice. Tos Therefore,naturalnumbers, the integers, rational andreal lattices numbersall are under usual their 22 111. Example co is lattice finite every that proven be can It Every set is needed. cannot expectthat join andmeet always exist. In thepreviouswe have section seenthatin for every findupper bounds least and lower greatest means that have a whenever witha welattice Note that the difference between a lattice and a complete lattice the existence in is of the meet and join of theconditions: Let 4. 3. 2. 1. structure If and subsetoftheposet for join every exist upper boundleast anda greatestlowerbound.iscalled Alattice Definition 83(Lattice).

L ,, L then is alattice pair and let be alattice  L Lcba (, of elements (lattice) orevery We lattice. a (4)is to conditions(1) operations satisfying with twobinary

Every chain alattice is in which :  L aaa  , ) ,,  abba  x  , abaa of operations algebraic tothe is related   with    y  and  A aaa  x  ( (absorption (absorption laws) ( (idempotency laws) x cbacba and and  )()( lattice    , Figure 46. Lower bounds and B B D operationson are binary abba ) y x  (commutative laws)  be elements of  subset abaa L  has a ofelements pair is aposet every in which A   the followingsatisfying conditions forall of elements (complete lattice). lattice). (complete elements of yy bounds for every subset ofbounds thelattice. for everysubset 22 howthis letus takeany and ofthese setsdetermine the general case of a pa a of case general the .  . mplete.This is an im C Therefore, a more specific order structure structure order specific more a Therefore, C E finite number of elements we can always number ofelementsfinite can we always  L  . Then. cbacba  )()( (associative laws) L and wehavean algebraic x   yxyx },min{ and y portant resultbecause it complete and eachis equivalentto rtially ordered set we rtially THE MATHEMATICSOF GIS  by the following the by , whenmeet 

yxyx },max{ .

Draft - Not for public release (© Wolfgang Kainz) 10.3 SETS ORDERED

Normal Completion Normal defined as (vi) (i) posets. It even usgives a procedure fo The following theorem summarizes theimport asfollows: defined which is In order to definethenormal completion method The of aposet. poset to create alattice. In other words, we toIt more interesting findsmalleis eventhe poset to create a lattice. This is } a to elements toadd possible, is, however, It bound. lower greatest no 46has Figure subset the example, For and leastupperbounds. bounds lower posets whichhave greatest not in subsets exist because all a lattice, poset is every Not If asubset 112. Example upper bounds isemptyleastupper and bound a does not exist. the supremumSinceof thethereset itself. isno (iv) (iii) (v) (ii) of If union. set and intersection as set defined then are join and Meet intersections.

L . It is calledsets a

1. Let A subset 3. 2. 1. operator closure Definition 84 (Closure).

A is a complete lattice then the following is true for every every for istrue then thefollowing lattice isa complete

of If Let Let If    P AA CA s )() ( () P be a poset and and aposet be ST  ()()() ST  TST S ST x x . Then    S A  

     The power set BA , of ACA L L i  , then s , then )(

 . Then . Then  *

X if ifand only XS on *  defines a closure operator on operator aclosure defines is called )(  ACACC is closedunderfinite unions S   )())((X complete and for doing iscalledfor this 

 x x ST if,for all A Ii   AIiA  *  Let  )( i   * s closed and the setof lower bounds of theupper bounds of asubset  X S S in fact possible withallposets.in fact

)(  s lattice if and only if ifandonly if ifandonly BCAC and and of any set and   X )()( S if

t ,  . be aset.Amap for all r building the normal completion lattice.  i

  (. of

ST ()()()

XBA ) TST S ST sets   greatestthethesesets,of the numberinanyof set wethe need conceptoperator,of aclosure want to buildminimal the containing lattice   : X st number elements of to necessary add toa   s AAC  if it is closed under arbitrary under ifitisclosedunions arbitrary and  normal completionnormal acompleteis lattice wheremeet and join are ant facts about thenormalof completion x x  P  S   . Ii . andall AIiA s s and intersections, a and it iscalled intersections, i  for all for all for , respectively. tT   s s TL ST   , S S . .  . . .  ,{ : CB XXC of the order in )()(: is called a a called is lattice 97 97 Draft - Not for public release (© Wolfgang Kainz) 98 10.3.1

Special Elements

of all lower boundsof all of and only if Now, let us assume that Now, letus that assume By duality,By if 2. There are two cases thatrequ are two cases There Let By calculating thenormal completion ha we for 1. normal completion lattice: the of properties important two which yields simple above hasa The corollary, theorem subsets. all a least element in least element a let usinvestigate thecasewhen practical applications,thisis rather bounds for the subset subset bounds for the completion lattice, i.e. the number of elements inthecompletion lattice isboundedcompletionlattice, i.e. the number of by completionmore thanonce doesnotincreas Secondly, it follows from idempotency ofa the closure operator the thatapplying completion does not addanythingthe tothelattice.It leaves lattice unchanged. tells usthat whenever First, thecorollary If there exists a greatest element a in If theregreatest exists a bottom element, then u .When sup S

* 4. 3. 2. n )( For all posets If P P  *

elements in the elementsposet. for all subsets of all subsets for  be aposet and L Ss The family is any other lattice such that suchthat is anyother lattice which exist in of completion embedding The map inclusion, in ordered by which M    T i atc,te ) then isalattice, that we have AC  N P i P EILLE )(DM P has element; a bottom i.e.,then we have is the smallest inwhichlattice is thesmallest  * has a bottom element, then   , i.e. it is order-preserving and injective. Infact and injective. isorder-preserving i.e.it , completion P P M } ) ( | { ) DM( P  it iscalled element bottom we have have we  P has no top element, then then element, no top has  P S AA  S S s ifaremeans, preserved. This P . The set of all upper bounds of bounds allupper setof The . )()( P P via a subset of the poset. We had defined upper bounds and lower lower and bounds upper defined We had poset. the of a subset as  * S , and   .  x Ii      ACIiA for every element every for S    , or i * ire specialattention:when P A APA )(  PDMP xyPyxx and the infimum does not exist. not exist. does infimum and the . For the normal completion lattice we need to identify all we needto identify completion lattice normal . Forthe and leastupperbounds bounds and all greatest lower , i.e., , }|{)( . )(:

 normal completion normal , because , (DM defined by by defined LL inefficient, because every set with P   . S it iscalledtopelement  LP  PS of subset is theempty * , wehave  . If . *  the poset is already a lattice, the normal normal the lattice, a already is poset the ve to ve to look allsubsets of at theposet P P AA  * * and written as P e the number of elements added to the added elements of number e the thatif inthe can beembedded sense, )()( )(  P (the lattice a complete is . has a topelement, then  {} * (()(   PDMDMPDM Px  completion by cuts completionby or xx ))  ** . Thus ad inf and xx . fr all for  * of thereno supremum and is S )()( PA  * was denoted as for all all for and  sup  and written as )(DM . PS P   i * P and when when and P  

.   LPP  . Then (vacuously) for Then (vacuously) .   Px P A  . If as defined can be  and  exists in in exists . THE MATHEMATICSOF GIS . Dually, n  Px elements has elements  P of i an is  Ii sup exists, if exists, sup does not have D S S AIiA P P T * EDEKIND i * and the set set the and P PDM ; ifthereis P ), when   )( order- , then , then  i a is P . First, Τ and }{ * . For . For L and  -

2 2 P P n n .

Draft - Not for public release (© Wolfgang Kainz) 10.3.2 SETS ORDERED

Normal Completion Algorithm The result is given in Table 14. given Table Theresult isin completion to latticeaccording thealgorithm. all subsets Firstwedetermine oftheposet To illustrate how this works we take the tion can comple be written as follows: normal the for algorithm The sets: following the derive can we above table the From have we again (because ,,,,} , , {, in Subset Subset A f  * P * BCDE P )( )( * *

   6. 5. 4. 3. 2. 1. T PP   

Table 13. Special elements and the closure operator inthe normal completion 12 11 10 whenever whenever 6 2 9 8 3 1 7 5 4

 The resulting poset is the normal completion completion The poset isthe normal lattice of resulting new poset. the of elements theremaining to symbols suitable Assign poset. in thenew Identify every element Arrange all For subset every i.e., thepowerset subsets, all Determine Top element . This results in 32 sets. For every subset every sets. For in32 Thisresults . exists exists {T} P P

P () has a top element. Table13 summarizes the result. ,} {, ,} {, otherwise S {,} {,} {,} {,} BD {} AD {} {} {} {} BC AE AC AB   C D E B S vacuously thatforall vacuously A S  SP to aposetwhere

* {}

 {}

No top element element top No Table 14. NormalTable 14. completion  element bottom a has if}{ () aP   P determine

of the withitscorresponding original poset

 poset ofFigure 45and build the normal ,,,,} , , {, ,,,} , , {, ABCDE ,,,} , {, (subset) istheorder relation. ABCD ABCE Bottom element Bottom element () S {,} {,} {,}  {} {} {} {} AB AC AB   S A A A A A A ()   P exists Ss

,} , , {, ,} , , {,  P 

, of theposet }{

S

wemust then compute , s  P S * x .

fr every for P No bottom bottom No element . ,,,,} , , {, ,} , , {, ,} , , {, ,} , , {, ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE  P ,,} {, ,,} {, ,,} {, CDE BDE BDE

() {} {} S  D E 

 

() Px a

 () ) and ) and S

 

 99 99 . Draft - Not for public release (© Wolfgang Kainz)

100 100

lattice. addedposet toforma tothe of the were completionposet. Wesee thattwonewelements completion lattice (Figure 48) a posetaccording them in wearrange When 23 with created elements thenewly denote and originalposet the weidentify elemen Finally, setsare Theresulting Note wemay that use either 17 27 16 15 26 14 13 31 30 29 28 25 24 23 22 21 20 19 18 32 ,,,,} , , {, ,,,} , {, ,} , {, ,} , {, } , , {, ABCDE ,,,} , {, BCDE ,,} {, CDE AC ABDE ABCD ,,} , {, } , {, ,,} {, ,} {, ,} {, ,} {, } , {, {,,} {,,} ABCE ,,,,} , , {, CDE ,} {, {,} {,} BDE BCE BCD ADE E AC D AC ABD ABE ABC {,} {B, D, E} D, {B, A CE CD D BE {} BCDE E Figure 47. Normal completion lattice lattice completion Normal 47. Figure {D} or 23 {,}

{A, B, C, D, E} D, C, B, {A,

{} {} .

 {}

todenote theempty set. {D, E} {D, , { } ,,} {, BDE {C, D,E} ts with their corresponding elementslattice {E} X to the subset relation, we get thenormal {,,} , and {} . . Figure 48 shows the normal and {} ABC {,} {,} {,} {,} ,,} {, {} {} {} {} {} {} {} {} {} {} {} AC AB AC AC AB CDE A A A A A A A A A A A A A A ,} , , {, ,} , , {, ,} , , {,

,} {,

, {,} D E , THE MATHEMATICSOF GIS {} D ,,,,} , , {, ,} , , {, ,} , , {, ,} , , {, ,} , , {, ,} , , {, ,} , , {, ,} , , {, ,} , , {, ,,,,} , , {, ,} , , {, ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ABCDE ,,} {, ,} {, ,} {, ,,} {, , CDE CDE CDE {,} BDE BDE {} D E E , and

 .

Draft - Not for public release (© Wolfgang Kainz) ORDERED SETS SETS ORDERED Exercise 35 10.5 10.4

Exercises Application in GIS

regions that are composed unconnect of several composed are that regions that zones production suchas agricultural posets canbe used representto situations General onecountry. exactly to state belongs every and onestate, exactly to belongs county every instance for where subdivisions administrative are hierarchies of Examples object. one parent object) andone parent relationships whereon exactly has object (every hierarchies strict both accommodates aposet of structure The can beused for relationships among spatial f From posetthe in Figure 45 determine the upper bounds of (a) ofor interpretation The intuitive The newelements canbeinterpreted inageom X can be interpreted as theintersectionof be interpreted can B DE B DE poset A Figure 49. Geometric interpretation of new lattice elements { } A X C C Figure 48. Normal completion completion Normal 48. Figure der relations as “is contained as“iscontained der relations X = B A B where one object belongs to several parents, parents, several to belongs one object where B may may be partor municipalities, of several and eaturessuch as polygons, linesandpoints. ed polygonssuch astheHawaiianIslands.ed etric way as shown in Figure 49. Element Element 49. inFigure as shown way etric e object possesses more possesses e object than one parent » X C C B D . E D lattice {} D { } A X , (c) in” or, dually, as “contains” in” or,dually, C E {,} C D C , (c) {} A .

101 101 Draft - Not for public release (© Wolfgang Kainz) Exercise 37 Exercise 36 102

completion lattice. D iscontained inB.Draw theposetfor the four regions, compute and draw thenormal The following relationships are given forthe four regions A, B,andD: Ciscontained C, inA and } , Fromposet Figure the 45 determine in thegreatest lowerbound(a) of { {,,} ABC

THE MATHEMATICSOF GIS BD b } , (b) { A , (c) , (c)

Draft - Not for public release (© Wolfgang Kainz) 103 103 CHAPTER CHAPTER 11

applications toGIS. the on section in highlighted is problems and flow of transpiration for theanalysis theory ofgraph importance The them. totraverse and ways dealsthe with This chapter basicofgraphs,theirrepresentation principles edges. vertices andconnecting of a collection by withproblems canberepresented that right dealing

T Graph Theory Theory Graph he origin of graph theory liesin graphtheory he originof them. Today, graph theory is a branch of mathematics istheory abranchof its own graph in Today, them. connections between the aset and problemspoints of givenby the of investigation topological

Draft - Not for public release (© Wolfgang Kainz) 11.1 104

Introducing Graphs

a circular walk isimpossible walk circular a a called the vertices numbered numbered the vertices 24 points(vertices these Figure 51shows and redlines. blackpoints representedby representingby linesbridges the connecting Euler solved theproblemby abstracting andthe island to banks river points and L graphthe originof is Generally, theory Königsberg by startinga riverbankan at by Königsberg problem is to determinewhether it is possible to make a circular walk through the bridges Königsberg across river Pregel (whichistoday’s in Kaliningrad). The problem.bridge known Königsberg as the theorem stating when such a circuit exists. exists. circuit a such when stating theorem ansee later find theproblemEulerianWewill that circuit to graph the that and is thereisa in EONHARD graph v e e 1 E 4 1 ULER . Starting from an arbitrary vertex arbitrary an from Starting . Figure 51. Graph of the Königsberg bridge problem who published a paper in 1736 on what is now commonly nowcommonly 1736 on whatis paper in whopublished a Figure seven 50. The bridges of Königsberg v e e 1 3 2 to v v 2 3 24 v . 4 , and the edges edges the , and e 5 ) andlines( ) d crossing every bridge exactly once. once. bridge exactly every d crossing e e attributed to the mathematicianSwiss 6 7 Figure 50 shows a sketch of the seven of the seven shows 50 a sketch Figure these points. In the figure they are are they figure In the points. these e 1 we find aftersome tries that such to edges e 7 . Such a configuration is . aconfiguration Such ) in a schematic way with schematic way a ) in THE MATHEMATICS OFGIS v 4

Draft - Not for public release (© Wolfgang Kainz) 11.1.1 THEORY GRAPH

Basic Concepts Basic Concepts graph Two graphs For iscalled A graph 114. Example parallel called edgesissometimes a loops and graphiscalled a A loops without paralleledges and ) , ( 113. Example denote a graph with number of edges finite.Whenare both grap finite with dealonly will we Here, vertices mapping mapping we have are parallel. The graph contains no loop. and theincidencemapdefined as when every vertex has the same degree. If the degree is thedegree If degree. same the has vertex every when incident with a vertex avertex with incident regular GVEg v g )(,) () wt ()0 ) ( with  evv edges. edges. that say edges of elements The of incidence map set Definition 85(Graph). 413 g (,,) n )(,) ()  , a set V evv graph thecomplete by is denoted vertices K . A complete graphcomplete . A K vv dv . We call the triple We the . call n  . For an edge 23 1 ,) (, VV iV hsdge (1) ( degree has , vE vv : 21 12 vertex-set with the e and

12  GVE Eee e , In previous the example the degree ofvertex The graph for the Königsberg bridge problem in Figure 51 can be written as  is 111 g  w call we   )(,) () iscalledan , which of element assigns to every ,,,} , , {, evv v complete incident with incident 514 ,) (, 4 12 are three. three. are V for every theincidence i.e., preserving relationships,  GVE implies implies are called called are evv v n   K  is called the  e 2 and ,) (, set Givenanon-empty if there exists an edge for every pair of distinct vertices. vertices. of pair distinct every for anedge exists ifthere a GVEg m ij . Figure 52 illustrates some 52 illustrates complete graphs.. Figure , Figure 52. Complete graphs isolated K loop  ()()) ),( (( g vi E iv iv GVE , the n

Vvvvv for short. for short. (,,) )(,) () evv i (1) ( is v 222 points vertices vertices 22 12 634 i I ()() ( ) ( If .   and ,,,} , , {,  ,) (, edge-set n g vertex. 1234 degree )( ) (, ()  (or evv g 112 v . agraph  j v  ege -regular, i.e., every vertex in a complete complete in a vertex every i.e., -regular, hs, i.e., the number of vertices and the the and vertices of thenumber i.e., hs, , and that andthat , i vertices ij there isnoconfusion possible will we , and are are n ucin : function anda , of of  K g . Isomorphicgraphs have thesame )(,) () 3 , theedge-set evv 724 v . The number of edges edges multigraphThe numberof . v isomorphic j adi rte s ) ( written as and is ), the elements of of theelements ),  , are called are Vvv v K E g we call call we  n )(,) () v simple graph a pair pair a evv . We call a graph regulargraph a call We . i ,,,} , , {, 212 is 12  v . Edges 1 k if there is a bijective ifthere isabijective adjacent to is 5,and degrees the of E end points ,) (, is graph the then  g e vv  i ij ,,,,,,} , , , , , {, and EVV eeeeeee 1234567 n K ,  e . A graph with Agraph. with 1 dv E 4 , the vertex- of elements of , g e are called are )(,) () e j of evv

2 313

v and parallel . A vertex . j  vV vv e 21 12 . If , the , ; we e 3  ,

k 105

e 4 - ,

Draft - Not for public release (© Wolfgang Kainz) 11.1.2 106

Path, Circuit, Connectivity Connectivity Circuit, Path,

Figure 54 shows an example of aconn of example an 54 shows Figure this edge is call a graph, then graph, then a simple graph it is sufficient to list only graphthe vertices it listonly a simple is sufficient to in apath. If some isolated vertices. A subsetof vertices vertices.A someisolated removed.However, ifremove we an edge visited only visitedonce. only In asimple a iscalled path cut-edge. cut-edge. shows two isomorphic graphs. shows graphs. isomorphic two 53 Figure first glance. ata different quite look might they although structure, When we assign a number (weight) toeachof graphedge awe get a weighted 115. Example A way. a particular in sometimes graph, a to traverse need we applications many For graph from a or vertices edges anumber of If weremove articulation point. If the removal of an edge point.Iftheremoval of an articulation in The has two components. The vertices The has twocomponents. otherwise it is otherwise itis component vertex isconnectedvertex toitself.A subgraph is visited twice. Two vertices above. defined as path time. This or travel distance as an edge aweightapplications such many In graph. Cvevevvev SG v v v Pveve e    V frompath length  45143154 1 1 2 112 is called a subgraph a iscalled ,,,,,,, ,, , , ,, ,, . The removalof avertex must edges impliesincident withit thatall alsobe v of a path or a circuit is the number of edges it contains. contains. it edges of number the is circuit or a a path of v of a graph. A graphof agraph.with 1 4

v In graph the of Figure 51 v is called anarticulation point  i disconnected and cycle v v cut-edge 1 3 nn to  v orcircuit j are is circuit. Note that it is not a simple circuit, because vertex v such thatfor n . induced and edges vertices of alternating is asequence Figure 53. Isomorphic graphs connected . If the removal of a vertex v v circuit every vertex appears once except that that except once appears vertex every circuit 2 5 . Apath is called a by by vG vv if there exists from ifthere apath Pvevev V 12 1 ,  ected and disconnect and ected   only oneonly component iscalled must notconfusedbe withthe length ofa . in the vertices the remain. Theresultcould be induced bya set of  12214 is usedbeing torepresent the lengthof  ,,,, VV  . Ablock ,  points; articulation are e i(v e the then disconnect graph would i 3 is incident with ) and edgeswithbothend-points path if every vertex is is vertex every if path simple i(v i(v is a simple path from 1 5 ) ) is a graph without any G v wud icnet the disconnect would a we obtain ed graph. Graph THE MATHEMATICS OFGIS i(v vertices is called a 4 v ) v i vv i to i(v 1 and  2 eG ) v connected 1 n subgraph j  then the the then v . Every v i 1  vv 1 1 to . For  i a is H v

v n 4 1 . , .

Draft - Not for public release (© Wolfgang Kainz)

11.2.2 11.2.1 11.2 THEORY GRAPH

Important Classes of Graphs Graphs Classes of Important

Directed Graph Graph Directed Planar Graph o vr de(,) , ( for edge every a DAG. a DAG. problems. Figure 55 shows two directed graphs. Graph graphs. directed two 55shows Figure problems. 25 edges intersecting without surface plane on a drawn graph is A graphs. planar of graphs isthe class An important an edge In a digraph Digraphs areused orderedsets. partially of rolein the representation animportant play DAG’s DAG). acyclic graph (or called a is cycles without graph Adirected direction. their indicating directed a becomes graph the point as start vertices its of one assign we edge every for If number of edges to edges incident of number face. face. exterior the called often is face This graph. the encloses face One graph. of the (orfaces regions connected theplane divides into every vertex vertex every sets for GIS. forGIS. sets number of edges incident from ofedgesincident a number vertex This class of graphs plays important an role in structuringthe two-dimensionalof spatial data graph (or (or graph v v 1 the out-degree is equal to the in-degree, i.e., in-degree, isequalthe theout-degree to vv FigureConnected54. anddisconnected (G) (H) graph G e ij 1 G ). We draw the edges of a digraph with arrows with arrows of adigraph edges ). Wedraw the digraph ,) (, v vv teei loa de(,) , ( edge an also is there ij 2 is said to be to said is Figure 55. Directed graphs v is the is in-degree incident from v to representtransp i cle the called is vv j

dv ). The facesare boundby edges i  () . A digraph is balanced if for balanced iffor A digraph is . . Adigraph is

25 v v G i . Such a representation Sucharepresentation . 1 and and H contains a cycle; cycle; a contains vdv dv out-degree H  )() () incident to planar v ortation or ortation flow  2 symmetric if it can be can ifit

dv 

. v () directed directed j . The H , the 107 if if is

Draft - Not for public release (© Wolfgang Kainz) 11.3 108

Representation of Graphs RepresentationGraphs of

the graph in Figure 56. Figure56. in the graph regions of of regions exterior face. for every connected planar graph with with graph planar connected every for connecting connecting two verticesof faceshave we complex, where the vertices correspond to correspond vertices the where complex, cell toa2-dimensional corresponds plane drawing real inthe graph A planar arematrices adjacency andadjacency lists. graphs.to representand traverse Thebe need we purposes computational many For graph planar For every 116. Example E vertices four has graph This graph. planar a shows 56 Figure this the2-cells. the facesto ca Clearly, edges edges called the The edge is drawn crossing the bounding edge of the faces in in faces of edge bounding the the crossing drawn edge is The If we do notcounttheface exterior the formula changes to ULER ’s formula Eeeeeee  dual ,,,,,} , , , , {, G

123456 4642 ; the edges represent the adjacency of faces, i.e., there is an edge isanedge there i.e., faces, of theadjacency represent edges the ; For theplanar graph inFigure 56with four vertices, sixedges,and four graph. It is again planar. Figure 57 shows the planar dual graph of of graph dual planar.shows theplanar again Itis Figure 57 graph.  connects the number of vertices, edges and faces. It states that statesthat It faces. and edges vertices, of number the connects G . v e 1 agraph construct we can 4 * f G 4 , and faces four * Figure 56. Planar graph Figure56. v if thetwocorresponding faces of Figure 57. Dual graphDual Figure57. v 2 v 1 1 * f ef ne 1 ef ne   n nnot be extended to higher dimensions. higher dimensions. to be extended nnot e e  vertices,  2 6 e st known structures to represent a graph graph representa to structures known st 3 the0-cells, edges to the 1-cells, and f 2 efficient data structures and algorithms algorithms and structures data efficient v v f v 3 2 * 3 3 * 1 2 F e

4  e e ,,,} , , {, v 5 edges, and edges, ffff 4 1234 G * the are vertices whose Vvvvv G THE MATHEMATICS OFGIS  f . Face . Such agraph is ,,,} , , {, faces wehave G 1234 ae adjacent. are f 4 i the is , six

Draft - Not for public release (© Wolfgang Kainz) THEORY GRAPH we represent the transitive closure as: adjacency lists for the graphs in Figure 58 are: 58are: inFigure graphs the listsfor adjacency ie rp (,) , ( graph Given a If we sort thecolumnsand rows from For an undirected graph Figure 58 shows anundirectedshows Figure 58 graph eainhp ) , relationships ( transitive relationships inthetransitive relationships gra isoften graphsit acyclic For directed lists.than adjacency matrices that requirementhigher We thestorage see easily foradjacency isusually the An G (,) L AG A vE vv ) ,, (): : () 2 jk , suchthat: Gvvvv are written as: are writtenas: transitive closure adjacency list 13145 1           vvvv vvv vvv         vvv 423 2145 523 10011 10011 123 1 00 011 00 011 00 011 v v :, :, :,, :, te eas hwterltosi ) , ( relationship the show also then we 2 4 vv ii GVE 

G the in tr contained are trivially L v of the graph. For the directed acyclic graph graph acyclic directed the For graph. the of 1 1

shows vertexfor every the vertices adjacent to it. The Figure 58. UndirectedFigure58. directed and graph A with

,)(,) ( ) (, jAji ij v v ij Ai 5 3 ,) (,  n ph. This meansph. This thatifwehave vertices an vertices  G    1 1if (,) 0otherwise v and a directed graph graph directed a and . For a digraph digraph . Fora 1 to more convenient torepresentalso the AG L () ) , (): : v Gvvv jE ij adjacency matrix 5 2 2345 the adjacency matrices for matrices adjacency the v v  vv  2 4         ik         ansitive closure. This is called This closure. is ansitive vvv v v vvv 00011 00 011 00000 00000 00011 4 245 5 123

: : :, :, matrixin the orlist.The   G A v 2 is usually asymmetric. usually is 1 G

2 is an . v v G ,) (, 5 3 vE vv 2 ij

in Figure 58 nn   matrix matrix G 1 and and 109

Draft - Not for public release (© Wolfgang Kainz) 11.4.1 11.4 110

Eulerianand Hamiltonian Tours, Path Shortest Problem

Eulerian Graphs Graphs Eulerian

efficientthe question iswhetherhecan traversethe street networkhis such oftownin a colloquial formis about it a postman who has to deliver the mail.In orderto be more However, there are fourvertices with odd degr whetherthereexists an Eulerian circuit inthegraph ofFiguregraph 51.The isconnected. Example 118. Example 117. Example digraphs: and graphs undirected for proven be can statements following The An Eulerian whichedge a every graph in A tourthrough When wedonot distinguish we between pathandwill talk about cycle a weoftenwanttotrav above mentioned As path between two given vertices in a graph. a graph. vertices in two given between path this a algorithmsthe is ofthegraph are visite all othervertices point start a given thatfrom means Traversal thegraph. totraverse be formulated ama graphby ofa representation Based on the AG () A digraph contains an Eulerian path if and only if it is connected and for the andA digraph if itisconnected containsanEulerianforthe pathifandonly balanced. connected and is if it if andonly an Euleriancircuit contains A digraph and connected is it if only and path if anEulerian graph contains An undirected and connected is if it only ifand circuit anEulerian contains graph Anundirected Eulerian graph If nosuch vertex canfoundbe thenretu Starting from a given vertex agivenStarting from vertex 2 Hamiltonian  visited. and repeat step 1. 1. and repeatstep         tour. If wetraversegraph visiti the tour. 11111 00001 00010 00111 1011 01

degrees of the vertices we have: wehave: vertices ofthe degrees o with vertices of the number vertices of the number A famous problem in graph theory is the Whenrecall we theKönigsberg bridgeproblem,we thequestion seethat is (DFS).depth-first-search Itworks inthe followingway: is an undirected graph or digraph digraph graphor isanundirected tour. tour. The pathshortest problem is about findingtheshortest vdv dv vdv dv vd vv vv dv dv  

 )()1 () )()1 () )( for () or all () 22 11    v with odd degree is 0. 0. degreeis odd with visit an adjacent vertex that has not yet been d. One of the best known graph traversalknown of best the One d. dd degree is 2(denoted with ee. Therefore, the problem cannot be solved. Gvvv v v LG is traversed exactly calledan once is exactly istraversed ) , (): : erse a graph in a particular manner. manner. aparticular in agraph erse rn to the vertex visited justvertex visitedbefore rn the to ng each vertex exactly once we call vertexoncecall exactly we ng each trix or a list, efficient algorithms can can algorithms efficient list, a or trix 2345         v vvv v vvvvv 12 Chinese postmanproblem 4 245 5 12345 containing an Eulerian circuit. ancontaining Eulerian circuit. : : :, :,,,  

THE MATHEMATICS OFGIS

v 1 and tour v 2 . In its . ). v

Draft - Not for public release (© Wolfgang Kainz) 11.5 11.4.3 11.4.2 THEORY GRAPH

Applications in GIS

Shortest Path Problem Shortest Path Problem Tours Hamiltonian problem role in therepresentation analysis and of networks. an features graphsplay important ofspatial representation Beside the to topology. toturn weneed configurations space. For3-dimensional 2-dimensional the exceed as complexes can longgraphs be asnot or cell usedplanar wedo interchangeably cell complex. a1-dimensional Therefore, agraph or considered canbe (edges) Acell complex. dimensional a2- to graph ishomeomorphic a topological Such polygons. faces arethe and the minimal among allpaths connecting no efficient algorithms tosolve the problem. Good approximations exist, however. thenthe starting returnsto The cities city? are thevertices weightedof a graph. Thereare travelingonecity form theto other, isthe what cheapest roundtrip that visits everycity and digraph with non-negative weights isD cycle in theinthecycle graphof street network. Eulerian an is there whether checking are we terms theoretic graph In office. the to returns way that starting at the post office he walks every street not more than once before he two-dimensionalspatialSo-called data. been torepresent have usedextensively modeling planargraphs In ofdata terms data. base transfertopographic and (Dig DLG developedthe Geological Survey was introdu file structure This Census. of the Bureau UnitedStates the of MapIndependentEncoding) file One of the famous examples isthe GBF/DIME (Geographic Base File/Dual planar graphs. two-dimensi (predominantly data spatial data) wasthefocus ofintere (or cartographic of ofGISthe map data in the that reason is days storage early role animportant have The in played Graphsbeginnings. GISright from theearly 120. Example : graph with can The problem path as be shortest follows. formulated areaweighted Given 119. Example through orsolvetheproblem only inefficient approximations. graph areeither in algorithms Allknown a to find tour Hamiltonian Hamiltonian. Eulerian graphs wedohave not asimple A graph iscalled Find apath computer scientist E scientist computer embedded in Atopological representations. efficient . Theproblem can be formulated as: Given anumber ofcities and coststhe of fE

P  A well known algorithm tosolve the shortest path problem foraconnected A generalization of the Hamiltonian cycle problem is the from from 2 . The vertices are usually called nodes, the edges are called arcs called arcs are theedges called nodes, usually . are The vertices  DSGER DSGER Hamiltonian  v assigning weights to the edges, and two vertices vertices two and edges, tothe weights assigning 1 to D IJKSTRA ced to conduct the 1970 census. United the1970 The States toconduct ced v 2 such that forall edges st. Early data structures for the representation of of representation forthe datastructures Early st. if it contains aHamiltonian circuit. Unlike with network . v 1 and IJKSTRA consisting of consisting nodes(vertices) andarcs topological graphs determining of way is whetheragraph onal) are almost exclusively based on based exclusively almost are onal) graph is isomorphic to a planar graph is aplanar isomorphic graph graph to v 2 ital LineGraph)fileformat to store . ’s algorithm named after the Dutch eP  ftept () ( path the of are the backbone of backbone of arethe traveling salesman v  eP  1 and f e v 111 is 2 . Draft - Not for public release (© Wolfgang Kainz) Exercise 39 Exercise 38 Exercise 11.6 112

Exercises

. Draw analyses. location-allocation from a A to B, perform allocation anal path theshortest tools GIS provide to find functions ofa analysis Thenetwork Definition 86 (Network). vertex dy  K )0 () 5  x with is the sink dx  )0 () of the network. ofthenetwork.  i the is A network source is a finite connected digraph in which one inwhichone isafiniteconnecteddigraph of the network, vertex and one of thenetwork, ysis, to trace a network path, as well as path,aswell network totrace a ysis, THE MATHEMATICS OFGIS y with with

Draft - Not for public release (© Wolfgang Kainz)

113 113 CHAPTER CHAPTER 12 areinvolved. phenomena vague whenever applications inItcandomains. has found many various beapplied chapter introduces the basic principles of This classification. yes/no a binary with set than a fuzzy membership to of degrees with expressed be better can or “suitable” “close”, “steep”, like concepts M

Fuzzy LogicandGIS Spatial featuresoftendefined not clearly boundaries, and do have classboundaries. expressedwith crispsets of cannot be properly thatuncertainty vagueness or adegreeof phenomena show any fuzzy logic, a mathematicallogic, that a fuzzy theory

Draft - Not for public release (© Wolfgang Kainz) 12.1.1 12.1 114 12.1.2

Fuzziness

Fuzziness versus Probability Motivation

fullmembership. can between valuein Any represents one and membership no indicates zero where one, and zero between value as a we analysis. but Usually, will beincludedinthe meters. by afew missa criterion that just locations those also accommodate can we classes, our to membership of degrees we allow close ourit wouldbe If, however, toexcludedfrom setthreshold) analysis. be very the If alocation fallswithin we thegiven criteria classes, suchas approachthethe conventional mentioned above Using our andthinking. languages in conditions these weexpress way tothe correspond the (except above mentioned All theconditions phenomenon exists. What we do not know, however, is its extent, i.e., to which degree towhich i.e., is itsextent, however, do know, we What not exists. phenomenon that the We know phenomenon). class (or a to belongs something degree what probability. on the depending not sure happen,is going is to Probability important, difference. however, yet asubtle, tempted to assume and that fuzziness prob probabilities,givenas a whicharealsovalu Degrees of membership asvalues ranging forbe formulated could must we arelooking asfollows. Thesite that the area In reallifeapplicationsmight we look forasuitable site to buildhouse. a Thecriteriafor vague or fuzzy. does grassland. Wheregrassland the end and or areas forest instance, for of, boundaries crisp todraw able not are we analysis from of height with be talldifferently 180cm. In apopulationland cover anaverage willbe to considered is160cm,of aperson where somebody theaverageheight a society aboutofWhen people,theconcept we talk tall lives. We encounter befuzzy. are saidto concepts uncertain vague or more These muchvariationtoour and judgments classifications. add we life no. Inreal or one,or yes zero andwhite, black i.e., binary, languageisnot and thinking concepts.Our In and language weorvague human use thinking often uncertain           

not withinmeters 300 frommajora road within 1 kilometer from alake meters 2,000 and meters 1,500 between elevation and 225 degrees between 135 aspect 10 degrees slope lessthan area restricted ina located be not be be have have have close a major road road notmajor neara givesusan indication with which likelihood anevent willoccur. it Whether moderate favorable moderate

to a lake alake elevation elevation slope aspect aspect They will They just geta low degree ofmembership, be a possible degreeofmembership. between zero and one look very similar lookvery one to between zeroand degrees, or the terrain is flat or the terrainisflat degrees, fuzziness wouldacceptit,otherwise (evenifitwould ability are basically thesame. Thereare basically is, ability “tall” will bedepending“tall” on context. the In e between e between zero and one. We might be the forest start? Theboundariesbe will start? forest the one for the restricted area) are vague, but area)are but vague, fortherestricted one assign a degree of membership assigntodegree of aclass conditions wouldbe translated crisp into almost everywhere in our everyday everyday inour everywhere almost is an indication to isanindicationFuzziness to THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz) 12.2 FUZZY LOGIC AND GIS

Crisp Setsand Fuzzy Sets and integral.and and tall people, respectively. 165cm (B)and 186cm (C).We want toassign the different persons to classes for short, average, 26 121. Example degree of 1 the membership does not need members of to beobtained for a set.fuzzy indicate to which degree anelementbelongs to membership). (definite one and membership) (no zero between be must value membership set. This a fuzzy to value) membership (or membership of element adegree theuniverse of toevery function assigns membership A we can expressmembership the of anelementamembership to setits by function. however,allow wesome degree of uncertainty as towhetheran elementbelongs toset,a not.If, toasetor element belongs an indicatewhether canclearly we always In thisway a set a such We call universe. ofthis subset certain fact withthecharacteristic In an generalsettheory elementme not. We a mberof a orthis is set canexpress either concepts. and fuzzy with vague deal basisto mathematical the establish will we sections Infollowing the theclass. to belong universe a given ofmembers Note that the symbols universe is always crisp. isalways universe universe of the element For every The / ) as ( If the universe is an infinite set called separator as If theuniverse is set a finite function Definition 88(Fuzzyset). characteristic function Definition 87 (Characteristic function).   A ii Ai A . The universe universe . The A ()/ () empty fuzzy set fuzzy empty x x A     

X x       

 1iff 0iff valuetofuzzy set membership indicates the A AAnnAiiAA Let Let us take three persons A,B, andC their respective heights as 185cm (A), A sc that such ) ) ) ()/ ()/ ()/ ()/ xx xxx xx xx xx xx 122 2 11 ,  X

x x . The symbols and “+” function as “+” function and   is always a crisp set. a set. crisp is always   , +,and is definedas is  A A

A

function for the elements of a given universe to belong toa to universe belong of agiven the elements for function :[0,1] A fuzzyset X  X  A  to be are not interpreted intheir usual meaning assum, addition,  Xxx ,,,} , , {, of xx xx    12 and “/” function as aggregation and separator. and asaggregation function “/” and ,,} , {,  X where where Xx xX

12 A have we trivially   and and aggregation A auniverse of Let is defined as  ,()0 n  All other values between zero and one one and between zero other values All   the fuzzy set. It fuzzy isthe to important note that , then a fuzzy set set a fuzzy , then , then afuzzy set A A () x of auniverse be asubset crisp set crisp i the is  i  n 1 . X connection A  is defined by a by defined is . for membership value Xx xX  x  A i A A ,()1 . The symbol “/” is “/” symbol The . on  ofterms. on :{0,1} X . The term . Theterm X X  X is expressedis is expressed is membership , i.e., the X of of . The 26 with

x in 115 115 Draft - Not for public release (© Wolfgang Kainz) 116 116 12.3

Membership FunctionsMembership

in Table 16. reaches one at 200cm. The membership values for the three persons to the three classes are given are valid for all membership functions: are validforall that fortheis arepresentation fuzzy best fuzzy logic.It is in theactivities important most the set isoneof for afuzzy function membership of asuitable selection The respectively. heightand that both have ahigher degreeofmembership to the average class thanshort to ortall, Using the fuzzyset approach better wecanmuch express arethe factthatandC nearly A the same classes, respectively (Figure 59). three for the functions membership three define to we need approach, set afuzzy we choose When classes. The characteristic functions of the three classes are displayed in Table 15. intotheC tall is nearly see class.Wealso A that astall andyet C,they fall into different average, and(185,falls-) fortall,wesee thatA If we takeacrispclassification and set theboundaries class (-,short,to for (165, 165] 185] for The membership function for the for function The membership shorterpersonsthan 150cm and decreases until itreaches zeroat 180cm. The membership function for the for function The membership at 200cm. 150cm, then it increases until itreaches one at 175cm. Fromthere it decreases until reachesit zero For short weselect a linear membership function that produces amembership value of one for 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 120 Figure 59. Membership functions for “short”,“average”, and “tall” 130 short 0.00 0.60 0.50 A 0 1 A 0 C 0 0 1 0 C 0 B 0.00 0.56 0.53 C 0.50 0.60 0.00 B Short Short Average Tall Short Average Tall Table 16. Membership values for the height classes Table 15. CharacteristicTable 15. function forheight classes 100 140 150 average tall class is zero upto170cm. From there increasesit until it 160 class produces values equal zero for persons shorter than average 170 concept to bemodeled. The following criteria responsibility ofthe userto select afunction into theaverageclass, and theshort class,Binto 180 190 200 tall 210 220 THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz) FUZZY LOGIC AND GIS

from the probability density function of the normal distribution with distribution twoparametersof the function normal density probability from the A special caseof bell-shapedthe membership of proper selection the four parameters. S-shaped,bell-shape canfunctionsachieve we should choose a sinusoidal membership functi we If forour purpose shapea more function rounded membership is of the appropriate L-shaped membership functions. proper values for choosing By of theshape function. the determine that parameters four function has membershipsinusoidal functions.membership Figure60shows thelinear function. This membership functions: of types two We know (mean) and probability theory,probability it isuseda hereas Membership Value Membership Value     0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

1 1 0 0 The membership function must be a real a real be must function membership The should beshould therepresented by crossover points. theclass boundary a crisp classification, i.e., ifwe set, wouldapply of thecrisp value0.5(crossovermembership point)should pointswithbeattheboundary The through the boundary. center from way the falloffinanappropriate should function membership The to definitely the belong set. that members those for i.e., set, the of center at the 1 be should values membership The 0 and1.  20 20 a a (standard Although thisfunction deviation). membership from is derived a 40 40 , bc bc b , Figure 61. SinusoidalFigure 61. membership function c FiguremembershipLinear 60. function 60 60 , and d d 80 80 d , we can create S-shaped, trapezoidal, triangular, and and S-shaped, trapezoidal,, wecancreate triangular, membership function for a fuzzy membership set. for function a fuzzy 100 100  U U A x on (Figure 61). As with linear membership with linear 61). As on (Figure functions is the Gaus valued function whose values are between valuesarebetween whose valued function )( d, and d, L-shapedand membership functions by   A (i) linear membership (i) linear and(ii) functions                x 2 2 1 1 )(                       cos1 cos1 0 0   1   0 0 1 ab cd xd ax             ab cd cx ax         dx         ax  sian function sian function derived dxc bxa cxb   dx   ax  dxc bxa cxb

117 117 c

Draft - Not for public release (© Wolfgang Kainz) 118 118 12.4

Operations on Fuzzy Sets Fuzzy Sets on Operations

parameters: are shorter than 150cm. Example 123. Example sets. offor fuzzy intersection union and subset, union,intersection, and complement. sets.Likeforcrispsetswehave forfuzzy valid arealso rules forcrispsetoperations all not However, sets. crisp asfor way a similar in defined are sets fuzzy on Operations 122. Example Definition 90(Height). set afuzzy for zero than greater value Definition 89(Support). up 0} ) ( | { ) supp( A rte s g() hgt( as , written AxX x Membership Value  

The membership functions inExample are 121 linear functions with thefollowing The support of fuzzy the set for short people (Example 121) isthose persons who 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -20 A  A I ht 1 ) hgt( . If Figure 62. Gaussian membership function The  ofAll elements theuniverse Average   -10 Short Tall height A . ) ( 5 180 150 ) ( () xx x xx     of a fuzzy set of afuzzy then theis called set 2                        c 0  180 200 x x   30 30 25 25 1150 200 0 0170 0180 200 0 150 0 170 150   In addition, there are alternate operations operations arealternate Inaddition,there x x A 7 200 170 7 200 175 5 175 150 10 are called the A x x x x x x is the largest membership value in value membership is thelargest          x x A () normal X xe 20 membership that have a U

 . support  THE MATHEMATICSOF GIS () 2 x  of 2 c 2

A , or , or

Draft - Not for public release (© Wolfgang Kainz) FUZZY LOGIC AND GIS

valuesof both sets. interactive arecalled Thetwooperatorsthe when it operation included other union other. is in In other. each with interact not do sets both fuzzy sets. sets. fuzzy Example 121. Example 125. Example isa max-operator The here. presented are ones common most The operator. one than more have we sets fuzzy two of union For the set a fuzzy functions membership of the graph at the we look When setinclusion. fuzzy by defined setsare fuzzy Subsets in of theset. height the by values membership its dividingall setby a fuzzy normalize always can We 124. Example fuzzy set 3. 2. 1. elements oftheuniverse Definition 93(Union). of or equal those to Definition 92(Inclusion). membersall of theuniverse (Equality).Definition 91   AB

x     xx Xx BABAB A B A AB AB AB B ) if for every element of the universe the membership values for for values membership the universe ofthe element every for ) if    Membership , because the membership value of the union is determined by the membership membership the by determined union is the of value membership the , because ,() ()  when the graph of when graph the )( )( () () () min(1, () () ()) () () max(() ()) (),

AB x x x Theheight offuzzy the setsShort, Average,andTall is1. Theyare allnormal Figure 64 illustrates unionthe operators forthe fuzzy sets Short and Average from 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1    20  V alue xxxx B non-interactive , i.e.,  B A The B A . xx X Twofuzzy sets xx set Afuzzy by one of the three operators: operators: oneby ofthethree  10 union x A  Figure 63. Set inclusion is completely covered by the graph of coveredby iscompletely xx Xx of two fuzzy sets fuzzy oftwo

,() () operator inmembership thesensethat of values X 

A AB their membership values are equal, i.e., fact, ignored fact, one couldbe set in a completely 0 A A is and 

included B B . are

A 10 and in afuzzy set equal B (written as can be computed for all A 20 will be included in willbeincluded in A B B lessthan are A (Figure 63). (rte as (written  B ) if for if )

119 119 Draft - Not for public release (© Wolfgang Kainz) 120 120

Example 121. Example 126. Example above. explained as operators interactive are others the two anon-interactive, min-operator The 3. 2. 1. computed for allelements oftheuniverse Definition 94(Intersection). 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

1 1 1 120 Type 3 Type 3 120 120 120 Type 1 Type 1    BAB A AB AB AB    140 140 140 140 )( () max(0, 1) () () () () )min(() ()) (),

xxxx x Figure65 illustrates the intersectionfuzzyShort ofthe sets Average and from   160 160 160 160 xx B A 180 180 180 180 xx B A Figure 64. Fuzzy setunion operators Figure 65. Fuzzy set intersection intersection set Fuzzy 65. Figure 200 200 200 200

The intersection

220 220 220 220 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 X

1 120 Type 2 120 Type 2 by one of the three operators: oneofthethreeoperators: by oftwofuzzy sets 140 140 160 160 180 180 200 A THE MATHEMATICSOF GIS 200 and 220 220 B cn be can

Draft - Not for public release (© Wolfgang Kainz) FUZZY LOGIC AND GIS

not generally hold sets.for fuzzy generally not of theexclud law 67Figure the illustratesthat ar general in that rules those shows 18 Table both. for valid are rules that forboth arevalid rulesforsetoperations Many 127. Example 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 defined as defined 95 (Complement).Definition 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 120 Figure 67. Lawofthe excluded middle and law of contradiction for fuzzy set Average. Average 120 11. 11. 10. 10. 5. 1. 9. 8. 2. 7. 3. 2. 6. 1. 4. 140 140

   Figure 66 shows thefuzzy set Average from Example 121 and its complement. x AA AAX ABBA A A A A A Table Rules 17. forsetoperations validand forcrispfuzzy sets     AA 160  160 xx Xx AA B B  A A ,()1 ()

    )( )(  A   BB A A A A 180 180

Figure 66. Fuzzy set and itscomplement   Table 18. RulesTable 18. validonlyfor crispsets   B B   A 200 200     The A 220 complement   220   . CBACBA CBACBA 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 )()( 1

e valid for crisp sets but not for fuzzy sets. butnotfor fuzzy crisp sets e validfor 120   0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Complement of Average of Complement ed middleed and thelawof contradiction does 120 CABACBA CABACBA crisp and fuzzy sets. Table 17 shows the the shows 17 sets.Table fuzzy and crisp )()()()()()( of afuzzy set

140 140 160 AA 160  A 180 double complement complement double distributivity law of contradiction idempotent law law of the excluded middle D commutativity associativity associativity 180 universe the in E M ORGAN 200 200 ’s law ’s law 220 220

X is 121 121 Draft - Not for public release (© Wolfgang Kainz) 12.6 12.5 122

Linguistic Variables and Hedges Hedges Variablesand Linguistic Alpha-Cuts

a fuzzy set. a fuzzy Example 129. Example terms. used torepresentbeing forlinguistic hedges models the 20 shows Table following The 19). Table (see setsrepresentinglinguisticterms fuzzy modifiersSuch are called average”. or “more or less” and arrive at expressions such as “very tall”, “not short”, or “somewhat modify alinguisticOften, we term adding like wordsby “very”, “somewhat”, “slightly”, set. a function toafuzzy bemembership orvagueness by can that expressed uncertainty “short”, “average”, and“tall”. These linguistic values possessa certaindegree of “height variable thelinguistic have we example, asvalues.Inmathematics variablesassumeA numbers usually With 128. Example use wecan membership, of degree at least a certain theuniversethat of tobelong afuzzy set elements and have allthose know wewishto If variable that assumes linguistic values which are words assumes ( that values variable are which linguistic of all elements of the universe such that Definition 96( A   isdefined as -level sets we can identify those members of the universe that typically belong to to belong typically that universe of the members those identify can we sets -level slightly Concentration Concentration Normalization not not less or more very Negation Dilation Dilation plus plus Contrast intensification intensification Contrast A

A A The 0.8-cut of the fuzzy set Tall contains all those persons who are 194cm ortaller. Figuremembership 68showsthe functions Very Tall,Very and for Tall, Tall. Very

A

 A AxX x Operator Expression -Cut).  Hed (fairly (fairly   {|()} g eO A ( hedges A Table 20. Hedges and their models Table 19. Operators for hedges ) weak  . They . They canbe expressed withoperators applied tothe A )  -cut  n(ompu o(ey))) not(very int(norm(plus i() dil( o() con( o() not(      (or A AxX x . n() int( o() con( i() dil( om ) norm( o() not( 1.25  A AA A AA A AA   A ”, the linguistic”, the values for height could be A () )() () )( () 1 () () )() () {|()}

x x x ()

x ) set -level

x              2 1()otherwise12(1 ()) -level sets. g() hgt( A 2   AA xx  A x  () x ( if2() ()[0,0.5]  A x  

A A

AA 2  

linguistic terms with with xx A p erator  x isa variable linguistic 2 . Astrong 01 THE MATHEMATICSOF GIS

 

is the set set the is  ). If, for for If, ).  -cut

Draft - Not for public release (© Wolfgang Kainz) FUZZY LOGIC AND GIS 12.7

Fuzzy Inference 0. As we have seen in this chapter, many phenomena can be better represented by fuzzy fuzzy by represented better can be phenomena many chapter, in this seen have 0. As we In logic two values binary possible we have only 131. Example 130. Example 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 Figure 68. Membership functions for functions Membership Figure 68. 1 1 1 120 120 120

Figuremembership 70showsthe functions Slightlyand for Tall Tall. Figuremembership 69showsthe functions Very NotTall.and for Tall FigureMembership69. functionandVery forTallNotTall lgtyTall Slightly Figure 70. Membership function for Tall and Slightly Tall Tall Slightly and Tall for function Membership 70. Figure 140 140 140 Tall Tall 160 160 160 180 180 180 Tall, Very Tall, and Very Very Tall for a logical variable, true or false, 1 or variable, trueora logical false, for 1 or 200 200 200 o eyTall Not Very eyVr Tall Very Very eyTall Very 220 220 220 Tall

123 123 Draft - Not for public release (© Wolfgang Kainz) 12.7.1 124

M AMDANI

Premise 27 Let procedure. following the to according straightforward isthen process reasoning The known the methods asdiscuss M Here, we methods forreasoning. fuzzy Weknow several rather large. canbe have moreWith logic inference we normally than onerule. In fact,thenumber of rules 132. Example ( In logic binary reasoning is based on either deduction ( are involved. concepts vague when toreasoning applied be also setscan Fuzzy crisp classes. by sets than generalized generalized and and extended to this case without any problems. problems. any without case this to extended Here, Here, x x modus tollens There can be more than two premisevariables to express complex rules. Theprocedure canbe 0 and and 1. B

’s Direct Method Method Direct ’s A . Premise Premise ocuin Set the heater to Conclusion: minimum of of minimum rule and variables forevery the inputcompute thepremise values to the Apply y 1 y , becomes a set of rulesasillustratedinFigure71.of becomesa set arepremise variables 0 B bepremise the input variables. forthe modus ponens ,

Consider the generalized A 2 1 ). In fuzzy reasoning weusea reasoning ). In fuzzy Ifthe temperature is : Temperature : is If premise  , and , and Premise Premise Conclusion: Conclusion: x Figure 71. Inference rule in M  is A i B pq () x   qz px 0 2 1 are fuzzy sets where sets where fuzzy are A of the form form ofthe : : 1 1 : is i , y is is : and and : ,         z If f i n s te is then is and is If f i n s then z is is and is If x y B If is and is then is is then is and is If isthe i is is () x x x x y y modus ponens very low is 0 very high very A B is is consequence y C AyB AyB zC :  AyB zC  consequence variable consequence A 22 22 nn nn

11 11 low

then B AMDANI then set the heaterthen the set to generalized modus modus ponens generalized

AB then AMDANI A   y  for temperature control: C and and is  ’ S B ’s directmethod direct method. direct Itis based ona B z

 are not exactly the same as as thesame exactly are not is modus ponens A . , C 27 B

high , and

THE MATHEMATICSOF GIS which reads as as reads which C are fuzzy sets, fuzzy are ) or induction) or

A

Draft - Not for public release (© Wolfgang Kainz) FUZZY LOGIC AND GIS

(Figure 72). “low”,and“reduce”, “maintain”, and“increase”,respectively. Theycanbe modeled asfuzzysets Distance, speed, and acceleration are linguistic variables with the values “short”,“long”, “high”, Ifthe distance between carsthe islong and the speed is high then maintain speed Rule 4 Ifthe distance between carsthe islong and the speed is low then increase speed Rule 3 Ifthe distance between carsthe isshort and the speed is high then reduce speed Rule 2 Ifthe distance between carsthe isshort and the speed is low then maintain speed Rule 1 of rules for the given situation: determine whether we should break, maintain the speed, or accelerate. Assume the following set Example 133. Example For adiscreteset fuzzy the centerof areaas iscomputed most commonis thecenterofgravity defuzzification iscalled value this determine to process The variable. consequence the for value The resulttheof final reasonspractical conclusionneed set.For we isa a definite fuzzy For a continuous fuzzy set this becomes set thisbecomes fuzzy For acontinuous 3. 2.

conclusions fromconclusions step 2: theunion determining individual ofall by thefinalconclusion Compute ) ( oftheconsequence the membership Cut function

Given the speed of a car and the distance to a car infront of it, we would like to . There are several methods to defuzzify a given fuzzy set. agiven fuzzy Oneof the methods defuzzify . Thereareseveral to ocuino ue:()mn )) ( , min( ) ( : Conclusion of rule ocuino ue:()mn )) ( , min( ) ( : Conclusion of rule ocuino ue:()mn )) ( , min( ) ( : Conclusion of rule  ue:mn ,()) ( ), ( min( : Rule ue:mn ,()) ( ), ( min( : Rule ue:mn ,()) ( ), ( min( : Rule CCCC ()max((),(),,()) zzzz n00 200 0 22 100 0 11  n 222 111 mxy mxy z mxy z (or center of area). ofarea). center (or 0 0 nAB          CnC n CC CC   12 nn 22   11        zmzzCzmzzCzmzzC C  C ()  C       zzdz  () C () zdz AB AB zz ()  11 22 nn z 

  C  i z n at

m  i :  

125 125 Draft - Not for public release (© Wolfgang Kainz) 126 126

With agivendistance have to break gently reduceto the speed. inferenceisthat when thedistance betweenthemeters cars 15 and is thespeed km/h, is60 then we value after defuzzification -5.46 is andisindicated bythe blue dot.Theconclusion ofthis fuzzy final The 74. Figure in displayed is functions membership four the of union The it. defuzzify Finally, wemust combine the individual membership functions fromstep 2to the final result and from step 1. The result isillustrated inFigure 73. values minimum the at variable conclusion the for function membership the cut must we Now are shown in Tableareshown in 21. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Rule3 Rule1 1 1 1 1 Acceleration Distance -20 -20 -20 0 Rule Short Rule Short Lon Decrease 02 .50.25 0.75 0.25 4 0.25 3 0.25 0.25 0.75 2 0.75 0.75 1 0.75 0.25 0.25 Short -15 -15 5 -15 10 -10 -10 -10 15 -5 -5 -5 Maintain 20 0 0 0 x 0 25  5 5 5 15 30 10 10 10 metersand aspeedof Long Figure 73. Fuzzy inference step 2 Figure 72. Fuzzy sets of the rulesFuzzy of the sets Figure 72. Increase Table 21. Fuzzy inference step 1Fuzzy inference step Table 21. 35 15 15 15 40 20 20 20 g meters km km h h km h 2 2 2 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Rule4 Rule2 1 1 Speed 0 -20 -20 o Hi Low 10 -15 -15 Low y 20 0  -10 -10 30 60 -5 -5 40 km/h performTheresults we step1. 50 0 0 g hMin 60 5 5 70 10 10 High 80 THE MATHEMATICSOF GIS 15 15 90 20 20 100 km km km h h h 2 2

Draft - Not for public release (© Wolfgang Kainz) 12.7.2 FUZZY LOGIC AND GIS

Simplified Method Method Simplified the inputforpremise thevariables. fuzzy sets; the conclusion is a real number (fuzzy singleton). singleton). (fuzzy number areal is sets;theconclusion fuzzy The algorithm worksasoutlined in the algorithm.2 inthe afterstep directly result the final notsetdifference thattheresultis that afuzzy isthenstraightforward in process The reasoning generalized a on is based It set. fuzzy a realvalue is theconclusion method where simplified approach is the istoo tim process defuzzification Often, the Premise 1.

minimum of of minimum the compute and rule every for variables premise tothe values the input Apply 1 becomesrulesas asetof Final premise 0.9 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1 Result -20 If x  -15 A is i () pq x  qz 0 px A 1 1 Figure 74. Fuzzy inferenceFigure 74.result final -10 and : i : i : : and Figure 75. Simplified Method         illustrated in Figure 75. variables Thepremise are f i n s te is then is and is If If is and is then z is is and is If -5 B If is and is then is then is and is If i () x x x y y 0 modus ponens following procedure procedure. Let procedure. procedure following 0 : consequence is is y c AyB AyB zc AyB zc nnn 22 22 11 11 e-consuming and complicated. An alternative B s needs to be defuzzified but be can compute compute but becan needs bedefuzzified to , 5 AB then analogy tothepreviousmethodanalogy with the  s y 

c i  10 of theform: s

fuzzy singleton z 15 = c 20

km h 2 c x instead ofa 0 and and

y 0 be 127 127 Draft - Not for public release (© Wolfgang Kainz) 128 128

Rule 4 If slope is steep and aspect is unfavorable then risk is 4 is risk then unfavorable is aspect and steep is slope If Ifslope isflat and aspect is unfavorable then risk1 is 4 Rule Ifslope is steep and aspect is favorable then riskis 2 Rule 3 1 is risk then favorable is aspect and flat is slope If Rule 2 1 Rule andThe fuzzyflat steepsets for slope aredisplayed Figurein and Figure 18 19- can conduct a risk analysis based on degrees ofriskranging from (low1 risk) to 4 (veryhigh risk). For ofslope a 10 percent and an aspect of180 degrees we have the following results: Example 134. Example 3. 2.

Compute the final conclusion as: conclusion thefinal Compute value per rule as: theconclusion Compute Figure 77. Membership functions for favorable and unfavorable aspect.

Given theslope andtheaspect mapsregion andthefollowing ofa rules, setof we Membership Membership 0.2 0.4 0.6 0.8 0.2 0.4 0.6 0.8 1 1 Figure 76. Membership functions for flat and steep slope 0 0 50 ue:mn ,()) ( ), ( min( : Rule ue:mn ,()) ( ), ( min( : Rule ue:mn ,()) ( ), ( min( : Rule ocuino ue: ofConclusion rule ocuino ue: Conclusion of rule ocuino ue: rule of Conclusion 10 100 flat n00 200 0 22 100 0 11 150 mxy mxy mxy 20 nAB c      200    favorable i n    250 i n n 2222  1111  30 1 1 AB AB m c steep 11 22 nn i  i cmc cmc

cmc 300 nnn         40 unfavorable 350    Percent Aspect

THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz) 12.8.2 12.8.1 12.8 FUZZY LOGIC AND GIS 12.8.3

Applications in GIS

Software Approach Approach Software Concepts Fuzzy Objective ue . 0.5 Rule1 0.5 0.5 1 ue . 0 0 0 0.2 Rule4 0 0 0 0.5 Rule3 0 0.2 Rule2 0.2 0.4 1 defined as as defined 78) (Figure function membership setwithasinusoidal fuzzy a as criterion the meeting ArcGIS 9. In the following, all approaches are illustrated. The grid involved is is Thegrid involved areillustrated. In9. thefollowing,all approaches ArcGIS the sc logictoolusing fuzzy own our create even Wecan Analyst. Spatial 3.x or ArcView Analyst, Spatial ArcMap GRID, ArcInfo use wecan problem: the tosolve ways several are there In principle, ELEVATION. asa grid into ArcGIS imported and USGS the from 1DEMwasdownloaded The : 24K Elevation is considered Colorado of mapsheet Boulder, 24,000 topographic : the1 by covered area the in elevation high determine is to analysis this of objective The be setcan illustrates howafuzzy example following The boundaries. fuzzy of representation and the reasoning, fuzzy analysis, spatial fuzzy as such GIS in areas many for applied been has logic Fuzzy boundaries. spatial areinherently phenomena Many For thefinal result we get

 Slope (s) Aspect (a) Min(s,a) Conclusions Conclusions Min(s,a) (a) Aspect (s) Slope 0.4 0.6 0.8 0.2 high elevation high 1 Figure Membershipfunction 78. “high elevation” for c high 1600   cos 1 ) ( xx . . 0 0 0 0.2 0 0.5 0.4 0.5 when it is above 1,700 meters. We representfeatures 1,700 the itisabove when                11 23    1800    computed from agiven griddata set. 12 0 1.29 fuzzy or vague or possess or indeterminate orvague fuzzy x 2000 ripting environment of the geoprocessor in of theenvironment geoprocessor in ripting 0 , which means a low risk. 7 0 0 0 2200 702000 1700 x x   1700 0 0 2400 0 . U

129 129 Draft - Not for public release (© Wolfgang Kainz) 12.8.3. 12.8.3. 130 12.8.3. 3 2 1 1 3 2

ArcView ArcView S ArcMap G ArcInfo

zero an ELEV screen To sol 200 le feleva /* === /* hig /* We can end if ( fe if ( if ( docell /* === /* hig /* /* DOCE To co how to to how in the If you m m A A v A A L 3 3 d d d R R 0 t = h e l e e = h 0 t = h e l e e = h u patial Anal e the proble e the pute the fu also use the use also the Th TION. o not have have o not ump shows shows ump L block: L block: .x .x rcView GI rcView one. , 0.5*( ion = con ======elevatio levation evation = levation levation ======elevatio se the Ave se the ID z S n e A 1 ( = n g g l = n y m we use t use m we zy set zy we u the comma GRID CO fuzzy set ue Spatial A Spatial - elevation t 2000) f 0.5(1 * t 1700 & e 1700) f s rcGIS ava t

Con C OS(3. req N n h n u i w s 1 e - e e alyst mapc alyst lable, the s e raster cal raster e command: d to produc d to e an AML e an est for estcom for 4159 * (e le 1700, levation levation levation ill be a grill bea C OS(3.14 a c i e p a s l 0 = 1 l = l 0 = 1 l = me results me results d FELEVA ulator of of th ulator therequire cript is that lculator. T lculator. uting the f uting the evation - , elevati 1 (ele59 * e 2000) ~ 0 u u c e e T d d o v he followin runfrom zzy set for set zzy an be be an achie Spatial A Spatial fuzzy set. fuzzy 1 n gt1700 ation - ION whos 700) /3 A 17 n h h g g v v e 0 7 alyst. The The alyst. rcInfo GRI igh elevatio screen du ed by usin ed by values are 0)), 1) & elevati 00)300 / THE MATHEM m m g D A f n on ~ ))

requests requests ollowing TICS OF GIS between p shows . and the andthe

Draft - Not for public release (© Wolfgang Kainz) 12.8.3. FUZZY LO

G G 4 4 IC AND GIS GIS AND IC

ArcGIS 9 9 ArcGIS raster d raster We ha v S S a e written a e written ta set. ta set. This cript P script is use is script ython scrip ython d t that gener t that here as a t as here a o tes a fuzzy ol in the Ar the in ol r cToolbox. cToolbox. aster data s et from a gi et from

v en input en input

131 131 Draft - Not for public release (© Wolfgang Kainz) Exercise 42 Exercise 41 Exercise 43 12.9 12.8.4 132 Exercise 40

Exercises

Result Result

(i) (iv) (iii) (ii) (vi) (v) Rule 2: Rule 1: consider surfacecover cover.Thesnowchange must besimulated. Therulesare as: given area). Thevariables involved areslope, aspect,snow cover change.Forsimplicity we do not Design asimple fuzzy reasoning systemavalanchefor the Rocky riskin Mountains (Boulder,CO with the following characteristics: Use 1:24,000the digital topographic data set of Boulder,Colorado and determine a suitable site Determine aGaussianmembership functionaspect forthe “south.” between 400 and 600 meters. is elevation ideal the when elevation” for “moderate function membership a linear Determine (right) approach a crisp and (left) approach logic fuzzy a with Analysis 79. Figure model. cell size oftheelevation hasbeensettocrispapproachmap). Thegridsize 10according (rightmeters the grid to logic approachmap)fuzzy andresult ofa 79shows (left theanalysiswitha Figure the Choose suitable membership functions forthe fuzzy terms.

moderate elevation aspect favorable slope moderate not in a parkinnot ormilitary reservation. veryroad,notclose and toamajor near a lake or reservoir then risk the is moderate. If the slope is moderate and the aspect isunfavorable and the snow cover change is big high. very is risk the then If theslopevery is steep and theaspect isunfavorable and thesnow cover change is big Fuzzy set Crisp set THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz) FUZZY LOGIC AND GIS

Rule 4: Rule 3:

the risk islow. Ifslope theissteepand theaspect isunfavorable and thesnow coverchange smallthen is then risk the is moderate. If the slope isnot steep and the aspect isunfavorable and the snow cover change is big 133 133 Draft - Not for public release (© Wolfgang Kainz) Draft - Not for public release (© Wolfgang Kainz)

135 135 CHAPTER CHAPTER 13 W onGIS. and their bearing models. f Wediscuss abstract world to real the of maps aspects that a process modeling, spatial with deals chapter This of real world phenomena. the perception a on reach consensus usto that enable or derived learning fromresearch experience, and interpretations principles common on weagree Usually, forourselves. create we that of reality pr we and that the realworld in happens leads models,to mental learning, cogni world phenomena. In our brains, we process the inputfrom our senses, which

Spatial Modeling real world. They mayare real orman-made, and be calledreal world. They natural inthe orexist happen events that and states processes, are senses our What weperceive with changingworld. a constantly e livein ocess through our modelsocess through senses leadsto undamentaltime and principles ofspace tion, and knowledge. thatEverything

Draft - Not for public release (© Wolfgang Kainz) 13.1.1 13.1 136

Real World Phenomena Abstractions And Their

Spatial Data And Information Information Spatial Data And

maintain, process, analyze and display these data. data. these display and analyze process, maintain, Ageographicdatabase. information system andattribut (spatial collect features, define representation of the phenomena in a computer database. Toachieve this we need to a store to we need area, this of database cover a land build to we want Since forest. remember thatfive ago years paved, the wasnot road and what isahasnowa field been also haveassigned attributestothemsu We observed. thephenomena minds recognize andour eyes our through that wereceive is covered withbrownish-black asphalt. Ou theroad and green, are the trees yellow, fieldsare the grass, with green are meadows The and roads. trees, fields, meadows, are see we What us. surrounding landscape at the look theprinciple. Thefollowingexample illustrates acomp in store thatwe information in of Data arerepresentations information phenomena. partof spatial isan integral information thematic that isobvious It extent. a spatiotemporal with phenomena concerning leads toknowledge andwisdom. Here, we focu perceivesignalsHumans through theirsenses ofthe layers. definition basis for the is phenomena tobut according thematic also information. (also calledattributes) that allow us tonot only referto them interms of spatiotemporal, characteristics thematic certain possess They extent. a temporal and (geometric) spatial and havethereforea and time inspace exist phenomena These observe. we phenomena the categorize to need we world, real the of models mental conceptualize to order In efficiently. withthem deal us to thatallow (layers) into subsets characteristic or purpose perceived a themaccording to classify thatwe way a such in world real ofthe phenomena organize to used weare Yet, inlayers. the world not see do us, we around look we when Again, phenomena. world real for principle an ordering are Layers in agivencontext. isreal that something new certain from abstracts Acadastre people. suchphenomena are realworld as buildings, see What we us. around welook cadastre when a not see we do Yet, concept. understood framework forthe handling of land. It is ofa Let example cadastre. us assume that The models fact these areabstractionsthat ofthereal world can be the by illustrated land or use. land cover, hydrography, soil, topography, acadastre, are Examples models ofsuch organizedusually inlayers. of (abstractions and applications. Features high-levelBased onthese wedevelop phenomena humanby activitiesthrough existence shape Man-made phen and influence them. nature. Examples are thelandscape (topography), the weather,or natural processes that from exist act human phenomena independently Inthe realworld, distinguish we between uter for processing and analysis. andanalysis. for processing uter construction or building processes. buildingprocesses. or construction ch as color, (relative) size and we might might we sizeand (relative) ascolor, ch natural and man-made and natural phenomenato andtheirrelationships create phenomena) populate these models that these models are populate phenomena) e) data about themand data theme) enter into a The thematic information ofrealworld r brains opticalsignals have processedthe acomputer. Spatial data refer to spatial , process themand extractinformation that a very important, clearly described and and described clearly important, avery a cadastre is a legal and organizational organizational isand a legal cadastre a (GIS) will be usedand willbe toenter,store (GIS) Assume westand that on top of a hill and omena are objects thathave comeinto roads, fences around pieces of land, of land, and fencesaround pieces roads, s on spatial information, i.e., information information s onspatialinformation, i.e., ions and are subject only tolaws of the only subject andare ions abstract models for particular purposes forparticularpurposes models abstract phenomena. Natural THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz) 13.2.1 13.2 SPATIAL MODELING

Concepts Of Space And Time Time And Space Of Concepts

Pre-Newtonian Concepts OfSpaceAnd Time smaller, has moved on topoint, and so on. another our case theour point whereA One of Z One of delusion of oursenses. P delusion is a change as What perceive we exist. does not non-existent) something i.e., space, w compact immutable, being), solid complete reasoning) that change does not exist and that the real world (the real being) is being) real (the world thereal that and exist not does change that reasoning) deductive (through postulates He void. the of of thenon-existence philosophy opposite known until the 17 29 28 H world inwhichchange occurs. structure ofthe and the tochange forthings conditions the about logical philosophers ofGreek theideas by dominated mainly are thisepoch of and time ofspace concepts The real being as perceive we that and isillustrative that space thisisthe spaces, mathematical and physical Of allpossible sight. and of touch senses humans in isthethree-dimensional(Euc live dawn consideration theofsince mankind. and scientific Thespace that philosophical of subject the been thathave concepts related twoclosely are time and Space number of(finite in leads. length) Itis im student Z tortoise already has moved on to point C. WhenA C. point to on moved has already tortoise change, i.e., how can the identity ofthingschange, i.e.,howbe cantheidentity At about the At aboutthe sameP time, him. attributed to (processes). “Everything flows”“We cannot and step into thesame river twice”are nothing remains, and the flows, everything space and time. time. and space an Newtonian concepts, (ii)the pre-Newtonian (i) three epochs: to according them We discuss and physics. philosophy Western in developed time and space of concepts how describe sections following The and clear need we features, spatiotemporal manipulate systemsand that process information with we deal When lives. everyday our in andcharacteristics structure their contemplate ever hardly we that doubt any beyond given be to appear and known well so are them) perceive we as least (at time and Space future. the into present the through past, the from extending nature linear acontinuous of be to time weassume Usually, experience. immediate our in change for measure isa Time at point B,whereasA beginsgets a and therace head-start The tortoise the tortoise. and Achilles between race impossible for A for impossible whenwould we run against assumption the we that it, proves endupwith This aparadox. The argument is now: In order to reach the tortoise, A the The argument tortoise, is now:In reach to order distances, because A The solutionof paradox the lies inthe thatfact infinitean series canconvergea to finite value, i.e., in Human geographers, ofcourse, might disagree. ERACLITUS ad infinitum ENO ENO (around 500 BC) of Ephesos (western Turkey) studied the problem of problem studiedthe Turkey) (western of Ephesos BC) 500 (around ’s famous “proofs” that change and movement cannot exist is known as the asthe movement cannotisknown exist and that change famous ’s “proofs” . th century. CHILLES . We get an infinite number CHILLES CHILLES CHILLES to catch the tortoise the catch to ARMENIDES ARMENIDES would have to run infinitely far (or forever). Therefore, it is itis Therefore, far (orforever). to infinitely run have would starts from point A. When A When A. point from starts passesthetortoise. Thismathematical was,result however, not d classical concepts,d classical and (iii) ’ ideas’ were further developed and “proven” by his of Elea (southern Italy) developed a completely acompletely developed Italy) (southern Elea of possible to runthis infi lidean) space asa frame ofreference for our well-understood models of space and time. modelsand time. of space well-understood ithout change and eternal. A void (or empty eternal. Avoid ithout changeand(or empty preserved whentheychange.He stated that The lead of the tortoiseThe getssmallerlead of and 29 only thingonly exists ischange thatreally of (smaller and sm and of (smaller . Since we can easily catch a tortoise catch a tortoise easily . can Since we CHILLES CHILLES 28 . reaches point C, the tortoise CHILLES contemporary concepts of must catch up an infinite aller) leads. aller) nite number of short reaches point B, the pointB, the reaches plenum (a 137 137 Draft - Not for public release (© Wolfgang Kainz) 138 138 13.2.2

Classical Concepts Of Space And Time AndTime OfSpace Concepts Classical

transformations. Earth geometric through possible are air andwater fire, the elements between Transformations i.e., made ofparticles, solid triangles. Matter consists ofea triangles. Matterconsists four elements: geometric model of matter is based on rightas atoms andtriangles solids built from these modelingthe300 laid of BC), the foundation foranewgeometric real world. This realphenomena. world to reference necessary no with system mathematical formal another yet but world of the ofthemnon-Euclid systems some arepossible, of description our world untilitphysical was remained until the late19th century. valid atom is a is atom An atoms. space within isno empty There weight. sizeand different have and eternal, atoms that fill the space. Atoms are indi are Atoms the space. fill that atoms Following from this approach space can be conceptualized in two possible ways: ways: possible two in conceptualized be can space approach this from Following surrounded. what is as ofthesurroundingthe limit body isdefined towards Space later. and earlier what is regardto motion of with spacemeasure isimpossible, isthe empty andtime his ideas, dominated by the philosophy ofA and teaching by thephilosophy dominated was science modern of rise the and period Greek theclassical between time The book his In D impossible. are change and movement Therefore, contradictions. to leads real, are change and movement that P The great philosopher P philosopher great The descriptionworld ofthe became apparent. mathematics that was based on counting in natu as such numbers irrational of The discovery numbers. between ratios the and counting, base properties arithmeticd on ofnumbers, (philosophical) Itwasessentially approach. mathematics dominateGreek strongly was Atomist theory is evident in to ARMENIDES EMOCRITUS 2 space as described by the Euclidean geometry. geometry. the Euclidean by described as space of allthings. Itsstructure isfixedand in properties. properties. isa Space them. from abstracted are relations Relative space Relative Absolute space Greek of foundation the square)shook unit inthe diagonal of the (the length plenum Tetrahedron The Elements . Space is an absolute and empty entity existing independently empty and from the absolute an is Space . (460–370 BC) did not accept the non-existence of change as postulated by by postulated did (460–370 BC) non-existencechangeas the of not accept (fire) . Objects are formed as a collection of atoms. The importance of the of The importance atoms. of a collection as formed are Objects . . Space is a system of relations. It is the set of all material things, and and things, material ofall theset It is of relations. system a Spaceis . Figure 80. Platonic solids as building blocks ofmatter . Spaceas a set ofplaces. It is anabsolute real entity, the container cannot be transformed. LATO , E (427–347 BC) and one member of hisE school,of member one BC)and (427–347 UCLID s (see Figure 80) that in turn are madefrom triangles. turn inare 80) that s (seeFigure day’s modernday’s particle physics. Octahedron (air) developed a mathematical theory of geometry that that geometry of theory mathematical a developed visible real things; they are immutable and and immutable are they things; real visible Euclidean geometry Euclidean was consideredtrue a discovered that many consistent geometric variable. this isconsidered Generally, the d by the Pythagorean number theoretic theoretic number the Pythagorean d by ean, and that geometry is not a description isnotadescription thatgeometry and ean, ral units. Theunits. needral for a geometrical truly rth, air,fire, and water. Each element is Icosahedron RISTOTLE property of thingsor property have spatial (water) (384–322 BC). According to (earth) THE MATHEMATICSOF GIS Cube

UCLID (at

Draft - Not for public release (© Wolfgang Kainz) 13.2.3 SPATIAL MODELING 13.2.4

Concepts OfSpace AndTime InSpatial Information Systems Contemporary Concepts Of Space And Time than the previous philosophical approaches. way sophisticated and elaborate more a far in yet space, absolute of proponent seen asa Isaac N Isaac remained dominant until the late 19 space ofabsolute concept The theory. his dynamics contradicts it strictly although Inhe hisphilosophy, anof proponent was outspoken space, the conceptof absolute plays anplays important howwedesign data. role and usein ofspatial for theprocessing tools cultural background, by languageand space,influenced of understanding human The ourinterest. of not subject are and space small-scale that us,objects than smaller are that objects words, other In space. or tabletop space, small-scale from distinct is space Geographic facts. geographic in objects manipulate to used other features of geographicthe world. Physicaldifferent ways. geographic space is itin weconceptualize it,and in navigate we move around, we Within such space, world. geographic surrounding the that represents space body, human the beyond the space Spatial information re is always The field theories (Michael F world. the of nature real tothe approximation thethree-dimens (describing geometry Euclidean geometries)mathematics (non-Euclidean and Thedevelopmentmodern of physics (fieldtheo transcendental idealism C Nikolaus of works the in shape took science modern of rise The time are not empirical physical objects or events. They are merely merely are They events. or objects physical empirical not are time interesting to notebothinterestingN that to Forhim, spacerelative space. isasystem As a consequence of the special and general theory of relativity by Albert E Albert by of relativity theory general and special of the consequence As a these by theories. supported isstrongly of space existence assumption that spaceis but notempty, is One of the greatest philosophers, Immanuel K Immanuel philosophers, One ofthe greatest calculus. Gottfried Wilhelm L space or the space of cosmic dimensions. dimensions. cosmic of space orthe space spacethe of ourperceptionnecessaril isnot that evident Ithasbecome energy. and matter of character and discrete the uncertainty described by non-Euclidean geometry. Quantum mechanics states the principle of be only that can space afour-dimensional is considered which speak of space-time, (1879–1955), spaceandtime anymore beco cannot (foundations of mechanics) in the16 K system), Johannes planetary the centerofour is sun the that stating system (heliocentric things). We cannot know anything about the things as such. In this regard, K regard, this as such.In aboutthe things anything know cannot We things). world. Space and time have time and Space world. of thereal observations and order torelate us by used but experience, by developed not EPLER EWTON (mathematical foundation of the heliocentric and system), G Galileo oftheheliocentric (mathematical foundation (1643 – 1727) was a brilliant scientist (dynamic theory) and philosopher. (1643– (dynamic 1727)scientist theory) wasabrilliant EIBNIZ (they belong to our conceptions of things but are not part of the of the part butare not ofthings ourconceptions belongto (they (1646–1716) on the other hand sustained the conceptof onother handthe sustained the (1646–1716) empirical reality lated togeographic space, i.e., large-scale space. This is EWTON ARADAY th th century. century. and17 and L and and Clerk James M Geographic information is system technology space, and to acquire knowledge from spatial spatial from knowledge acquire and to space, can be moved around on a tabletop, belong to movedbelongcan be to around onatabletop, y identical with the microscopic (sub-atomic) (sub-atomic) microscopic the with identical y th filled with energy. Therefore, a material filled with amaterial energy. Therefore, centuries. (they are absolute and and absolute are (they EIBNIZ ANT the space of topographic, cadastral,and of relationships between It things. is ries, theory ofries, quantumrelativity, theory) lead to that theconclusion traditional ional space of our perception) is only an perception) isonly spaceofour ional (1724–1804), claimed that space and and space that claimed (1724–1804), nsidered as two separate entities. We nsidered entities. astwoseparate are the founders of mathematical mathematical of founders arethe AXWELL a priori a priori trueintuitions, ) lead to) the lead given) and and given) ANT OPERNICUS INSTEIN can be be can ALILEI 139 139

Draft - Not for public release (© Wolfgang Kainz) 13.3.1 13.3 140

The Real The And ItsModels World

Maps

boundaries, and features spanning two map sheets have to be cut into pieces. pieces. cutinto map tobe sheets have two spanning andfeatures boundaries, calledmap generalization (orcartographic ge less de derive to process The thescale. by detail,determinedof which is level certain agraphic ata representation map always A is conception. mapa stepsin mostimportant the firstand of one is map scale proper ma a thescale inwhich to puts limits hand, on theother data, of the primary Theaccuracy show. can map detaila theless scale, the smaller The representation. feature graphic of the spatialresolution the determines are always they that and representations, ar maps of is that they A disadvantage panoramic views. and diagrams, block animations, forinstance, are, products Such phenomena. dynamic mapsare of arenot that products cartographic WeOther maps.temporalthematic betweentopographic distinguish and domain. and spatial the in abstractions considerable without features dynamic dimensional toisnot visualizethree- andIt easy static. maps (flat) Yet, aretwo-dimensional applicationsmany in variousdomains. Mapshaveproven artistic to craftsmanship. ahi with science and anart into developed visualization and storage asdata function the present. they Today, are usually draw until Ages Medieval the times, Roman the through Egypt, and Mesopotamia ancient from for thousandstorepresent of years informa The bestknown models of (conventional) the real worldaremaps. Maps have beenused non-existent)world. (physically inavirtual only th and world real the exists in that something Theonlyrepresentation.with regard totheir diff reality). There is no virtual the term (therefore perceive them them,as them navigatethrough and “real” Yet, wecanvisualize aspotentia existonly “realities”that generated that thereality of subsets are worlds Real worlds. virtual world phenomena, real been used topicture a advantages characteristics, have distinct Both databases. sequence—maps and are—inhistoric models mostof these common The data. world real about information and transfer analyze store, acquire, to used be can that world modelsWemindmodels, of ofour the real communication. need representations i.e., interpersonal just than means and media other use we world, real the about minds. When we want to acquire, store, an al we sections previous mentioned inthe As systems. stored ininformation and measured described, be can that effects spatiotemporal theobservable in more but less interested in orpure philosophical physi us. We are around world geographic inthe changing observe we effects the timewhose to relates it space, geographic to related is always information asspatial way same In the nd disadvantages. Whereas maps usually have have usually maps Whereas disadvantages.nd erence between real and virtual world models models world virtual and real between erence displayed in a given scale. The map scale scale map The scale. inagiven displayed non paper or other permanent material and p sensibly can be drawn. The selection of a of selection The can bedrawn. sensibly p medium. Their conception and design has Their conceptionand design medium. tailed representations tailed froma detailedoneis tion about the realWemapsworld. know ways create models of the real world in our ofthereal world in models our create ways we perceive. Virtual worlds are computer computer are worlds Virtual perceive. we cal considerations about time or space-time, about timeor space-time, cal considerations databases databases can beused torepresent real and alyze, visualize, and exchange information information exchange and visualize, alyze, difference ismodelis thattheformer a difference of ten used to represent three-dimensional and and three-dimensional ten usedtorepresent e latter is a modelexistsa of something e latteris that gh degree of scientific sophisticationand ghdegree ofscientific lities with no counterpart in the real world. inno counterpart realworld. the with lities be extremely useful models of reality for for reality of models useful extremely be neralization). Map sheets have physical physical have Mapsheets neralization). e restricted to two-dimensional static static two-dimensional to e restricted THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz) 13.3.2 SPATIAL MODELING

Databases Databases database definition is calledthe(conceptual) char and attributes todescribe independently existingentities, The representations of spatial phenomena (i.e., spatial features) are stored in a stored in are features) spatial (i.e., phenomena ofspatial representations The cadastral, topographic,ordatabase. land soiluse, aqu by described database. This is usually ofthe purpose on the depending layers thematic into classified are Phenomena attributes. spatial(geometric), thematic andpossess eachother among and relationships temporal exist atwo-in orthree-dimensional Eucl designof aspatialda The assumption forthe modelsdata willbe discussed in Section 13.4.1. story written inalanguagestory thatis thedata model isthe analysis hazard alandslide or administration, the of types things relevant for a a particularexample, cadastral for application, re whattheir and designed, databasebeing a is intention co which istodefine language that we use to defi to use we that language betw database,Inof wedistinguish a thedesign geodatabases. or GISdatabases alsocalled are They system. information in ageographic Spatial databases store represen goal. We observe alsoin this major the was database computer a into map a of contents the transfer To databases. forGIS source data main the considered were maps originally see that we systems, andgeographic information ofdigitalcartography history the back Wheninto we look maps. visualization function of their roleas data storage. This role is ta Increasingly, mapmaps of lose Therole changed the modernaccordingly. cartography. of part isanintegral making map in computers use of The cartography. digital assume is important to notewhenever that we sp It cartography. digital became cartography systems, of computer analog advent the With representations forMaps our also use. phenomenareal world (primary data) into correct, clearandunderstandable translating as functions an interpreter, making art ofmap and as science the Cartography be present. be present. geographicconcerning information coordinates, data. of the the given quality inunitsIf than are coordinates other the determines surveys in offield measurements theaccuracy Likewise, inthe database. coordinates of thefeature the accuracy determines map of thesource thescale Here, data source. as maps from captured are data a rolewhen plays that scale however, must noted, It be (useful) scale canbe chosen for visualization. any and performed easily be can calculations there, From feet). meters, coordinates, units that are normally used to reference features in the realworld (geographic and and a model useddatamodel. The owndata has its data means to create the model of a model. modela of means tocreatethe data data). Inshort, (secondary stormap data to andnot data) (primary phenomena world real of want representations to store actually model” and“mapdata structure” were widely conceptual data model dataconceptual seamless manner. Scaleless means that all coordinates are world coordinates given in in given coordinates world are coordinates all that means Scaleless manner. entity-relationship (ER)model . Inour context, itis used forspatial modeling.data The ne the database is called a a called is ne thedatabase d relationships. The complete complete andThe values ofentities relationships. acteristic thescientificliterature of th ncepts of interest exist in the application in domain exist forwhich the of interest ncepts tations ofspatialtations in phenomena the real world to be used relationship todefine type become data a sourcemaps.other for ken over databases. by What remains is the model. more implementation-oriented, Other, ; it uses primitives like entity type type to entity describe primitives like ; ituses e map data instead e into adatabase ofprimary idean space. All phenomena have various eak about cartography today, we implicitly weimplicitly today, cartography eak about system. Acommonly usedconceptualdata alification of the as,forexample, alification database at the level closest to the end-users is called iscalled end-users the closest to level the at database schema database used. It was not clearly understood that we that we understood used. It not was clearly lationships are. Such a definition identifies identifies lationships are.Suchadefinition tabase schema is that spatial phenomena phenomena spatial schema is that tabase een three different levels of definition.A of een threedifferentlevels the spatial the reference system should also data model at datatime. The “map terms relationshipsentities, between . It can be compared to a a to compared be can . It ; each level typically typically level each ; scaleless 141 141

Draft - Not for public release (© Wolfgang Kainz) 13.3.3 142 13.4

Real RepresentationModels World And Their

Space And Time In Real WorldTime InReal Models And Space

spatiotemporal data models have been developed. developed. been have models data spatiotemporal and temporal spatial, Various represent. they features ofthe extent temporal overlay). Spatiotemporaloverlay). databases consider landscape model (DLM). digital a representation holds database spatial GIS database is aspatialmodel. data Itis of computer representations data are Spatial however, theInofmost thecases, spatial makesonly sensewhendimensional’ we always ithasadistin dimensions; as thespatial type it spatiotemporal better tocall timeis, in addition isthefourthdimension It however, tothe three spatialdimensions. that impression the giving as four-dimensional, modelis addressed a Sometimes such model th a spatialdata Wecall features. ofthe attributes thematic) or (spatial as changes in modeled time. is of indirectly as thepassing Inthistime sense, perceive we which changes, undergo and exist in space this Allphenomena sense. common our consider spacementionedwe tobe As above, modeling. of spatial the principle doma elementsof the as the abstracted) way or simplified (however same the in behave features) (spatial co-domain the of elements thatthe means preserving Structure original. of the image generalized) abstracted, (i.e., ‘smaller’ a creates mapping normally a Such model. world real is a co-domain the and world, real the is domain the case, our In toaco-domain. domain a from (morphism) mapping preserving a structure ascreating described be can modeling general, In sp representing of (simplified) ways physi the consider do not we Here, relativity. of theory general and special the to according time and space between that exists connection theclose toexpress space-time of iscommon speak it to modernphysics, In combine to and a database, toquery It iseasy themselves. features thespatial by imposed than other space geographic mapdoes notshow A seamless shee database Figure 81. Spatial modeling is a structure preserving mapping from the real world to a spatial Spatial phenomena (Real World) (Real Domain instead of four-dimensional.instead theofsame First, time isnot at alsoconsidersat time aspatiotemporalmodel. data Morphism atial phenomena in a GIS database.atial phenomena in aGIS data model only data model considers twoonly dimensions. model. model. ct different quality. Secondly, theterm ‘four- Secondly, differentct quality. spatial features. Amodeling language fora in (spatial phenomena).in (spatial Figure 81 illustrates notonly the spatialand used in theused in design ofspatial A databases. cal characteristics of space and time, but the butthe time, and space of characteristics cal of the real world, sometimes called a digital digital calleda realworld,sometimes of the thethree-dimensionalspaceof Euclidean data fromdifferent laye wouldconsider three spatial dimensions. t boundariespartitions orother of the (Real World Model) (Real World Spatial features Spatial Co-domain thematic but alsothe thematic THE MATHEMATICSOF GIS rs (spatial join or or join rs (spatial

Draft - Not for public release (© Wolfgang Kainz) SPATIAL M 13.4.1

D D O O DELING DELING atabase atabase space f A DL For ex Some f the of c under We are for dat result i derive with re databas Databa set data graphic is calle feature levels compri with a schema The de propos that dat Spatial take ca analysi vaguen Figure M fe a o o e s r n a s d a s s s s g g s D e e o p a p a s s e ertain trans ertain a models m base and ca and base data exist n data exist e of these u these of e 82. Data mo Data 82. . The t . The A f detail. d. d. e creation e creation es fourleve approacht l data, ther l data, or map und map or of the resp the of particularly particularly acartogra representat gen model is the bas atures ina atures ss or uncer or ss ign of a d raphic repr mple, soilmple, r a spatial r a atures poss atures articular d schema th esign there tod r ans e fo e a p d r t i i i n i f a o a e u e d e d l h ess adegre ainty such a such ainty gital cartogra on (digital ctive level. s for spatia s a two-ste by creating by tographic d tographic good data ta model. ormation o ormation s. s. hic product tabase con tabase atabase. T t identifies t identifies certainties i certainties sentations i sentations interested i ralization. t onlyins types do types m r certain st be able st bet eling fromt atabase is atabase rmations. an clear c an clear m p f u h o o e e T n s h e p e a p a l . n t a T a T

s “moderate s “moderate p p o handle. o handle. S This isdiffe n digital or or n digital n our spatia ace butalso analysis a A schema i A schema t class bout class ists of sev ists sign. sign. ese properti ese Figure 82 of uncerta of r analog) at r analog) ypes but no e real world world e real rely graphi rely geometric a represent ot have ot have c process: process: odel shoul odel his approa digital lan properties properties hic models models hic his is imp is his d e r n c o c n a a s s i l d t f r e isp bounda in time. T space in w in space everal spati everal analogue fo analogue nty ineithe nty data model data ral phases. ral phases. constraints allow for nd analogue shows the shows the h iscalled o adatabase arepresent d manipula tion from a slope” or or “ slope” tortant gua of the geo the of daries. W daries. irst, theda occurrence ent from ca ent from a smaller s a smaller scape mod s are relate m h d m e c c e s s h h o r . c d c t s d t s t t p r ( r a r r rtographic g rtographic ich wemo to detailed have to de The result Theresult ifferent asp lose to Vie lose to he ANSI/S . Secondly, . l. From the l. ies. Ling ies. abase is de ion ofspat digital lands theirthem . Fuzzy lo m (cartogr ey carry te carry ey space etric ale isderiv ale temporal d temporal antee a antee co to topolog for roducts tion ofthe ultiple rep ultiple d n g n n v a a r a r P u m a i a i y y e c a d v s e eneralizatio el features el features database ( esentations esentations the databas sistent repr al data. al data. T ic provides provides ic that remain isualization isualization na” are ofte are na” phic model lessdetaile ape model), istic expre ta models cts of data cts of data ARC archi . igned by by igned of every p of every tic or spati d from a l a d from atabase as ise proper poral char poral D d h h h h a e a a n n ) ) t s a t d h e o a m n d efining a means to to means ecture; it ecture; it sentation sentation rge-scale rge-scale e feature e feature ave been that can thatcan t various t various he tools. he tools. cteristics cteristics invariant LM), we sions of sions

nd from where a where escribed l extent. isfilled ase is a ase isa f spatial a better a version odeling 143 143 Draft - Not for public release (© Wolfgang Kainz) 144 144 13.4.2

Spatial Data Models Spatial Data Models

phenomena are temperature, barometric pressure, or elevation. elevation. or pressure, barometric are temperature, phenomena ofsuch Examples determined. be can the of field a value point in space every in where particle plenum models. field-and object-based models, major types, we Amongcandistinguish two data spatial architecture. theANSI/SPARC databasemanagementparticular 22summarizes software. Table im ofthe result isthe schema A physical set. data a redundancy-free of the definition have astraightforward implementationas tables.meant logical schemais The to provide model. Itis because to easy understand algebra. Mostco relational models.on based model, themost is Currently, which data popular oneisrelational the data logical one ofthe using schema translatedinto alogical conceptual The schemais represented phenomena inare database. the particular any database management software. is schema A conceptual respectively. of’, ‘neighbor type therelationship and ‘population’, the attribute‘country’, type type entity database, e.g.,‘Austria’, ‘8 the populate of). Instancesofthe (e.g., types neighbor types and population) relationship (e.g., types attribute country), (e.g., types model areentity theER of constructs model),the extended(ER ERmodel (EER), or usually donewithhigh-level semantic data Thisis database. the of schema conceptual single into a merged are views external All domainuser groups. Mainly experts and users are there as external views many as be will There schema. database conceptual ma We database. of the view external its own At th stored. data ofthe perceptions different A database thought isgenerally to muserve illustrate the two differentillustrate thetwo model types. briefly sections following The approach. vector a (topological) with objects approach, Field versus object can be viewed as a mani asa viewed be can object Field versus identifiableparcels objects like andbuildings. clearly with a cadastre are Examples empty. being potentially objects between space well by spacetodistin consider bepopulated Physical schema Logical schema Conceptual schema External views Table 22. Data models and schemas in database design (the ANSI/SPARC architecture) versus versus (see Section 13.2.3). In GIS, fields fields InGIS, 13.2.3). Section (see Field-based models Field-based Schema atomic space million’, and ‘Germany, Switzerland’ are instances of the of the areinstances Switzerland’ million’, and‘Germany, mmercial database implementations provide support for this this for support provide mmercial implementations database (see Section 13.2.1), or as in modern physics, modernas inphysics, or 13.2.1), (seeSection consider spatial phenomenaof tobe a continuous nature speed. or visible to the on emphasis user. is processingIts structures and algorithms. normally Itis not accessible This themappingis of the logical schema into data redundancy on is removal. logical schema using therelational model. Emphasis approach. entity-relationship the as such techniques schema making useof semantic data modeling A synthesis of external views to create aconceptual modeling). worldthe real is defined and described (spatial Depending on different user perspectives, a subset of Transformation oftheconceptual schema into a do spatialmodeling at this level. it isbasedon relations— implementation-independent andnotrelated to modelsmodel such as the entity-relationship Models used to derive the schema derive usedto Models guishable, discrete, bounded objects with the objectswiththe bounded discrete, guishable, ltiple users or user groups. They may have have may They user groups. usersor ltiple festation ofthephilosophical of conception are usually implemented usually tessellation are with a is level, each user (group) is supported with supportedis level,eachuser(group) with plementation of the logical schema logicalwith ofthe plementation y define an external view as a personalized personalized viewasa defineanexternal y It provides an answer to the question what what question the to answer an provides It object-oriented data models. The basic models. data object-oriented basic The Object-based models Object-based sets of records—that sets ofrecords—that THE MATHEMATICSOF GIS wave versus versus

Draft - Not for public release (© Wolfgang Kainz) 13.4.2.1 SPATIAL MODELING

Field-based Models are called called are consisting either of square(cubic) or triangul geometrically bounded spacethrough asubdivisi an approximation. Thestandard to way ob values representfield cannoteasily Computers positions. bounded,Thoughgeometrically setof stillan infinite thedomain ofafieldis position. at every slope the compute even we can functiondifferentiable, is field If the elevation. or pressure barometric temperature, for as such continuous, is function underlying the where forfeatures used are fields continuous with boundaries; Fields canbe discrete, continuo 83). (Figure fields such measurement computation.by or A field-base for positionbound thegeometric within every of positionsbounded set (in2Dor3D)to someattribute domain. Computablemeans that geometrically a from function computable isa field A space. Euclidean dimensional taken astheorthree- modeltwo- space forafield-based isusually underlying The Our finite approximation of positions intoof positions Our finite approximationlocati following steps: following steps: perform have to we the approach afield-based using spatialTo features represent representing continuous, even differentiable, functions. thevalu fieldvalues to more nearby compute must becomputed through some formof in centroid or, for instance, itsleftlowercorner positionwithinthethat positionis cell.Again Another option is interpret to value thefield belong thatboundaries cell. oftensays lowerand left tothe convention on cell boundaries;prevails value with squarecells,which state this to is needed discrete field is the case which cell, in tessellation whole the for asone be interpreted can at a location value field The 4. 3. 2. 1.

Perform analysis, i.e., compute with the spatial field functions. functions. field spatial the with compute i.e., analysis, Perform field functions. Sample the phenomenaof the at thelocations tessellation thespatial to construct Finddomains suitable the for attributes. Defineuse asuitablemodel or forunderlying thespace (tessellation). locations ; points often; approximate them. Figure 83. Twodata layers in a field-based model , not continuous or even differentiable. Some convention Some convention even differentiable. or not continuous , us anddifferentiable. Discrete fieldsrepresent features ar (tetrahedral) parts. These individual parts parts individual These parts. (tetrahedral) ar at a location as representative only for some some for only asrepresentative at alocation . positions Field values for other than these terpolation function, which will use one or function,whichone or willuse terpolation fixed by convention, and may be the cell convention,beby may cell fixed and the e at the position.allows requested This at e d model consists of a finite collection of model consistsofafinited for all these positions, so we must accept must accept sowe these positions, for all ons leads so some forms of interpolation. formsons leadssosome ofinterpolation. on into a regular or irregular tessellation, tessellation, orirregular a on regular into s a value can be determined by either either by be determined can value s a tain this istofinitely represent the Layer 2 Layer 1

145 145 Draft - Not for public release (© Wolfgang Kainz) 13.4.2.2 146 13.4.3

Spatiotemporal Data Models Models Data Spatiotemporal

Object-based ModelsObject-based

Dimensionality of time. density. Time properties: following tothe according characterized th describe to aframework need we models, data the spatiotemporal of characteristics major the wedescribe Before briefly. discussed spatial data. Several models have been pr modelsmodels th aredata data Spatiotemporal 20 years. landuse in 1980,or howdid parcel of agiven change overthelast pieceofland ofaland the owners were know who ing to Itis,forinstance, interest characteristics. thematic andtopological properties,spatial geometric, Beside datapossess also temporal cases. dimensional ismorehandle difficulttothan Theirtopology inthestandardtwo- proposed. models are two-dimensional. Recently, based for constraints consistency enforce and specify majorismodels. plays a Itthe‘language’ role inTopology thatallowsusto object-based operations. topological or manipulation attribute geometric, topological ordomain.thematic, temporal objects orsets of of individual manipulation the to refer model always inthe Operations models. discrete are models Object-based constraints. topological and thematic geometric, under andvolumes) lines,polygons, (points, geometric primitives of collection structured a as arerepresented objects implementation, database In aGIS or area. boundary floors, population, countries; buildings, cities, towns,districts or are objects of Examples is empty. objects the outside 84).Thespace (Figure other each and tempor thematic, have spatial, that objects describable identifiable, spaceinto underlying models the decompose Object-based and states such as “before”, “overlap”, “after”, etc. etc. “after”, “overlap”, “before”, as such states and events nodes between canderivetemporal relationships (events) by we intervals bounded by states Whenwe represent intervals). (time or states time) in (points events by time alsostructure Wecan inbetween. point another isalways there intime, points two for time, In continuous or years). months, days, hours, minutes, (seconds, elements discrete in the database. database. in the time(or database time Transaction happened. Time can be discrete or continuous. Discrete time is of composed orDiscrete Time can continuous. discrete be Figure 84. Layers in an object based model Valid time)time is (orworld thetime when an eventreally objects. Manipulations concern the spatial, spatial, concern Manipulations the objects. oposed. Themost important ones willbe al attributes, asrelationships among aswell attributes are,for in Accordingly,they are realized through ) is the time when thetimerecorded) isthewhen eventwas at can also handle informationat can temporal in spatial databases. The majority spatial databases.The of object- three-dimensional data models have been models havebeen data three-dimensional e nature of time itself. Time can be Time can itself. e natureof time Layer 2 Layer 1 stance, thenumber of THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz) SPATIAL MODELING 13.4.3.3 13.4.3.2 13.4.3.1

Space-Time Composite Model ModelSnapshot Space-Time Cube Model onwards)cyclic andtime (repeating cyclessuch as seasonsdays or of aweek). scenarios from acertainpointin (possible time branching time future. We knowalso Time order. Time granularity is more likely in the order of thousands of years. of thousandsyears. of order is inthe more likely granularity mapping, time ingeological canbeaday; time granularity applications, In cadastral granularity. different require applications Different etc.). second, month, day, (e.g., year, (finite) number ofchronons. isth Granularity millisecond).(e.g., a adatabasesupported by initial planeandintersectedwiththe existing projectedonto the is happens later that features of change time. start Every given at a The space-time compositemodel starts with a variable. attribute domainis valid time andmultiplegranularity. The sp Thismodelbetween layers. isbasedon alinear, informationan attribute.Wedonothaveany have we consider, to like would thatwe time In thesnapshotmodel, layerssame ofthe variable. supports validtime.only The dom attribute This model potentially allows absolute, contin of objects through The create traces time a worm-like cube. in trajectory thespace-time cube. space-time a creating thereby z-axis) the (along time through traced are features Thismodel based two-dimensional is on sp a reference. Time Measures of time. models. models. ofpopularspatiotemporal somemajor characteristics describe theIn we thefollowing, anew one? become becomes apparent. When does a orchangemovement cause anobject todisappear and forecast weather and control, disease tracking, moreapplicati mobile Butmany telephony. and control traffic being the applications two of with research, ofcurrent asubject are an object leadschanged time. motion, tonotions over actually objectand This of these how consider and variable domain attribute and thespatial both assume we can Finally, see which werecoveredlocations forest by over a givenperiod. changesover time for agiven thematic attribute. In this case, wecouldbe interested to On the hand, wecan fixed other domain keepand attribute the consider the spatial provid over time, parcel given land landcoverchangedforagive interested how locatio given a for time over changes attribute over time. In dataanalysis, wekeepcan the attributesand thematic changes ofspatial consider models, we data In spatiotemporal to berelative may which later,” weeks “two or relative to“now”, all are which “tomorrow,” year”, “last “yesterday”, 1999 at 11:15 p.m.”). Relative time is indicais timeRelative p.m.”). 11:15 1999 at time). Absolute time markspoints onthe Time can be linear, extending from the past to the present, and into the the and into present, tothe past the from extending be linear, can Time Time canbe represented as absolute (fixed time) or relative (implied A chronon is the shortest non-decomposable unit of time that is thatis unitoftime non-decomposable shortest chrononthe A is an arbitrary pointan arbitrary in time.). ed its boundary did not change. change. not did boundary its ed themeare time-stamped. Forevery point in timeline where events happen (e.g., “6 July July “6 (e.g., happen events where timeline n location or how the land use changed for a for land usechanged hown the or location atial domain is fixed (field-based) and the (field-based) andthe fixed domain is atial about the events that caused different states states different that caused theevents about features, therebyfeatures, creating an incrementally andto storealayer assign the time to it as The life span of an object is measured aobject isby an The lifespanof uous, linear, branching and cyclic time. linear,cyclic uous, It branching and whose y-axis) thex-and by (spanned ace ons are on the horizon: think of wildlife spatial domain fixedand lookonly at the ain is kept fixed and the spatial domain ain iskeptspatial domain fixedandthe two-dimensional situationtwo-dimensional (plane or layer) ing. Here, the problem ofobjectidentityHere, the ing. e precision of a time value in a database inadatabase value atime of e precision ted relative to other points in time (e.g., (e.g., timeotherpoints in to relative ted n in space. We would, for instance, be be instance, would,for We space. n in absolute, discrete time. It supports only 147 147 Draft - Not for public release (© Wolfgang Kainz) 13.5 13.4.3.5 13.4.3.4 148

Summary Summary

Spatiotemporal Object Model Event-based Model

mathematical tools to define and enforce co enforce and tools todefine mathematical provideswiththe model. us for Topology every requirement isanimportant Consistency applications.disadvantagesfor particular and merits, advantages their Both and object-basedmodels. have field-based fundamen two We know models. data spatial selected to according abstractions are representations These world. real the in phenomena of representations westore Indatabases, spatial databases. takenoverby increasingly of thefunction Today, databases. spatial and We know twomajorapproaches to spatial prerequisite necessary isa mathematics and conceptsphysics and principle of understanding ofspace time the rooted in philosophy, the spatial, thematic and An temporal dimeof realworld phenomena. nsions address models These design. database for as aframework information spatial of models fromspatial To derived datainadatabase. Geographical informationsystems processsp multiple granularity. linearand supp time,absolute, on discrete, based a have atoms and objects Both (STA). atoms ofST- complex area that (ST-objects) objects onspatio-temporal based is model This on supports relativetime, linear, discrete, model. The spatialand thematic attribute the time line. Whenever a change occurs,an entryis recorded. Thisatime-basedis In an event-basedmodel,an in westartwith variable. domainfixedspatial andthe both valid time, and transaction and multiple Itkeeps granularity. theattributedomain on based model is composite The space-time mesh.builtpolygon polygon Every inthismesh stored hasits history attribute withit. spatial dataany model, thus temporal domain. Amodelof timefor spatial information an is important ingredient for possessSpatial datanotonly objects. spatial among relationships spatial for framework derivea formal to and leading to what is called spatiotemporal data models.leading towhatiscalledspatiotemporal data spatial andthematic attribut ly valid time and multiple andgranularity. validtime ly domains are secondary. The model is based on on isbased model The secondary. are domains to develop and usespatialmodels. data data modeling, the analogue map approach, approach, map analogue the modeling, data sensibly work with these systems, we need systems, withthese work sensibly itial state and record events (changes) along state andrecordevents (changes) itial nsistency constraints fo constraints nsistency is model The extent. atemporal and spatial maps as data storage (map asadatabase) is linear, discrete, Itsupports relativetime. tal approaches to spatialtal approachesmodeling, to data atial information.atial Theinformation is orts valid and transaction timeorts validand astransaction well as es, but extendalsointoes, the THE MATHEMATICSOF GIS r spatial databases,

Draft - Not for public release (© Wolfgang Kainz)

149 149 CHAPTER CHAPTER 14

the results arementioned. T

Solutions of Exercises Exercises Solutions of section. For many of the problems a detailed solution is given; for some only only given;some for ofdetailed solution theproblemsis a many For section. to solvetheproblems firsttry him/herselfis advised this beforeconsulting to ofthe exer solutions contains his section

cises mentioned in the text. The reader Thereader text. the in mentioned cises

Draft - Not for public release (© Wolfgang Kainz) Exercise Exercise Exercise 22 Exercise 6Chapter Exercise 16 5Chapter 4Chapter 3Chapter 2Chapter 150 xrie3 Both algebras are commutative groups. This can easily be verified bythe usual laws for addition Exercise 31 8Chapter 7 28 Exercise Exercise 27 (a)(11,2,-5), (b) (1,1,-9), (c)(7,14,21) Exercise 26 Exercise 24 7Chapter

21 isnota function because not all isnot a function because 2has more than one value! 20 19

does not change the set of pairs. is a function! Thefact that <2,1> appears twice elements ofthe domain appear inthe relation! not <2,4>. symmetric because <2,1> inh

in f and negativenumbers. Thefunction and injective (distinct arguments produce distinct values), therefore bijective. Furthermore, we isnot symmetric because <1,4> is in f 2 3 2 f butnot<2,2>. 21  h  2 daRR xfhxf  },{  , g gfedbCB h is not symmetricis not in because<3,1> },,,,{ , 12 2 cbdbbbR  but not <1,2>. 2 },,,,,{

dbRR  xxhxhxhx },{ h  , f but not <4,1>. f },,{  1  2  CdcaAC 2)( 2 , } xxf h is surjective (all even numbers appear as values) values) as appear numbers even (all surjective is isnot transitive because <2,1> and <1,4> in h h xxhxhx 2    32232332 )2 3 (2) (3 ) ()( ) ( hhxh isnottransitive because <2,3> and <3,2> g  but not <1,3>. g <1,3>. not but ,{ g caCB , }} hx  dacaaaR 32 

},,,,,{ ,  istransitive. THE MATHEMATICSOF GIS h ,{},{},{{{},)( isnot cacaCB h but

Draft - Not for public release (© Wolfgang Kainz) xrie3 This can be easily verified by substituting T and F into the axioms for a Boolean algebra and Exercise 32 xrie3 The function is surjective and maps every element of I toB. Because the function is surjective, it Exercise 33 Chapter 9Chapter SOLUTIONS OF EXERCISES Theorderdiagramthe poset of lookslike Exercise35 10Chapter elements and renaming the universe: This gives the following poset ordered by set inclusion and after the mapping of corresponding ({B,C} applying the rules for logical operators. Therefore the function isan isomorphism! itnus ewe orcssfr ih ,with distinguish between four casesfor cannot be an isomorphism! To prove that the function maps binarythe operation properly, we ({A,C,D} have that {A,B,C,D}, ({ } odd) =-f(odd) -(1)= =1.The constant maps as f(0) 0, = because 0 is even. To provethattheunary operation The normal completion lattice isbuilt as follows: ({A} {C}, ({D} {C}, vn d ee d d,teeoe1 1 0 0 odd, even therefore odd= + 1 0 odd even even+ = even, therefore 0 even even even A 0 1 1 therefore odd, = even + odd even od odd C b (+)wt suul () f(b) f(a) f(a+b) asusual with + b a d od )()( * ) * = {A,B,C,D}, ({B,D} {A,B,C,D}, = * *   ) ) * D B * TFFTTFFT = {A,B,C,D}, ({A,B,D} {A,B,C,D}, = d ={D},({A,B} d d vn hrfr 1 1 even, odd odd= + therefore0

* )  *  ={} FTFTTT FFFTFT   TFTTFTTFTTFT )()(    TTFTTFTTTFTTFT  * )()()()()()( ) * = {A,B,C,D}, ({A,C} {A,B,C,D}, = *  ) * maps correctly, we show that f(-eve that correctly,weshow maps = {B,D}, ({C,D} {B,D}, =    *  ) ba TTFFFTFTTT * FTFFFFFTTT = {A,B,C,D}, ({B,C,D} {A,B,C,D}, =

 bfafb a ba baf , )( )( 2 2) (2) (  . * Iba ) * * ) = {A,B,C,D}, ({A,B,C} {A,B,C,D}, = *  * ={A,C},({A,D} ) * = {A,C}, ({B} ={A,C},   * ) *  = {A,B,C,D}, ({A,B,C,D} {A,B,C,D}, =  f(a)+f(b) with + as with+ f(a)+f(b) n) = -f(even) = -0 = 0 andf(- = -0 -f(even) = = n) operation table defined in the  * * ) )  * * = {B,D}, ({C} {B,D}, = = {A,B,C,D}, = 1 0 0 1 afaaaf )(2)(2)( * ) . * = {A,B,C,D}, f *  ) * =  * ) * 002)0( = 151 151 . Draft - Not for public release (© Wolfgang Kainz) 12Chapter 11Chapter 152

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

THE MATHEMATICSOF GIS

Draft - Not for public release (© Wolfgang Kainz)

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

Zimmermann H.J., 2001, Zimmermann H.J., 1987, Zheng D., 2001, ANeuro-Fuzzy Approach toLinguistic Knowledge Acquisition and Assessment Zadeh L.,1965,Fuzzy sets. Tang X., 2004,Spatial Object Modelling in Fuzzy Topological Spaces with Applications toLand Tanaka K., 1997, StanatD.F., McAllister D.F.1977. Publishers, Boston, Dordrecht, London. Publishers, Dordrecht,Netherlands. The Spatialin DecisionMaking. PhD thesis,University Vechta andITC,Enschede. dissertation number108. Cover Change. PhD thesis,University of Twente, Enschede,Netherlands, The ITC York. Englewood Cliffs, N.J. An Introduction to Fuzzy Logic for Practical Applications Practical for Logic Fuzzy to Introduction An Fuzzy Set Theory and Its Applications Fuzzy Sets,Decision Making, and Expert Systems Information andControl 338-353 8; Discrete Mathematicsin Computer Science , Fourth Edition. KluwerAcademic . Springer Verlag, New THE MATHEMATICSOF GIS . Kluwer Academic Academic . Kluwer . Prentice Hall, Inc., Inc., Hall, . Prentice

Draft - Not for public release (© Wolfgang Kainz) hypotheses, 20 hypotheses, 36 2, function, C 37 bijective, exclusive or, 7 cross product, 32, cross product, converse, 8 8 contrapositive, 9 contradiction, 9 contingency, 21 dilemma, constructive 7 conjunction, 20 conclusion, 35 composite relation, 37 composite function, 27 complement, 36 33, codomain, 2 Chinese, 32 product, Cartesian 26 cardinality, 155 155 existential E 35 relation, equivalence class,35 equivalence 2 Egyptians, 36 33, domain, 7 disjunction, bijection. 2 Babylonians, assertion, 6 argument Arabs, 2 antisymmetrix, 34 9 absurdity, existential quantifier. 22existential instantiation, 22 generalization, existential directed graph. directed graph. 33 digraph, 27 difference, dilemma,destructive 21 UCLID ANTOR logical, 20 , 2 , 26 , 26 See , 15 bijective bijective

See See digraph digraph Index See Cartesian product product Cartesian quantifier quantifier inclusive or,7, implication, 8 map, 36, injection. 2Indians, logical and, 7, logical and, 2 logic, 34 irreflexive, 40 inverse function, intersection, 27 injective, 37 surjection. surjection. 27 superset, Sumerians, 2 27 subset, 2 structures, 2 set theory, 26set, 15, 16 satisfiable, relation, 2,33 34 reflexive, quotient set, 35 tollens modus ponens modus mapping syllogism, 21 syllogism, 21 37 surjective, one-to-one. 7 negation, quantifier propositional variables,6 propositional forms, 6 6 proposition, premises, 20 predicate, 14 power 29 set, operators, 7 onto. onto. disjunctive, 21 disjunctive, 27 proper, 15 universal, existential, 15 See , 36, , 36, surjective See See See See function function injective injective See function , 21 , 21 surjective surjective See See injective conjunction conjunction disjunction disjunction

Draft - Not for public release (© Wolfgang Kainz) universal generalization, 22 22 generalization, universal 27 union, 7 truth table, 34 transitive, transformation, 36, 9 tautology, 34 symmetric, 156 hypothetical, 21

See function function

universal quantifier. quantifier. universal universal instantiation, 22 universe. universe. valid, 16 16 valid, 15,16 unsatisfiable, 14 of discourse, universe See universe ofdiscourse See quantifier quantifier THE MATHEMATICS OFGIS