Lecture 5: Sptil Algorithms GEOG 49: Advnced GIS Sptil Anlsis Algorithms Bsis of much of GIS nlsis tod Mnipultion of mp coordintes Bsed on Eucliden coordinte geometr http://stronom.swin.edu.u/~pbourke/geometr/ t / / t /
A mtter of nlticl crtogrph Theoreticl nd mthemticl bckground behind crtogrph Seeks to find how geogrphic properties of spce cn be used in nlsis, modeling, nd prediction Anlticl Crtogrph consists of the bsic mthemticl lgorithms nd principles of crtogrph tht survive independentl of prticulr technolog AC Algorithms Algorithm specil method for solving problem stted s formul or set of sequentil instructions Church s Theorem if problem cn be stted s series of sequentil instructions, then it cn be utomted Crtogrphic trnsformtionl lgorithms re the nuts nd bolts from which GIS re constructed
Mtrices If ou re going to understnd AC lgorithms, ou should understnd something bout mtri lgebr Mtri: set of numbers of smbols rrnged in squre or rectngulr rr of m rows nd n columns. The rrngement is such tht certin defined mthemticl opertions cn be performed in sstemtic nd efficient w Liner equtions nd mtrices Given set of liner equtions + + c + z 8 + + c + z 4 + + c + + z We cn define them in mtri form c c c And further define them in mtri nottion AX C
So, if we hve sstem of liner equtions AX C We cn lgebricll reformt the eqution b pre-multipling both sides b the identit mtri AX C A X A C IX A C X A C Solving simultneous equtions We cn solve the following eqution simultneousl l through h bsed lgebric mnipultion + 5 8 solving for, we reduce to + 5 + 8 + now dd the two equtions + 5 + 8 + 9 4
5 Solving simultneous equtions with mtrices Or, we cn use mtrices + 8 5 8 5 C X A More complicted formuls 4 8 8 5 + + + z z + + z
Trnsformtionl View of Crtogrph Tpes of dt/tpes of mps Mp scle Dimensionl Smboliztion Generliztion Dt model Trnsformtions Gol is to epress trnsformtion s n eplicit mth opertion so tht 0 in full described w nd n inverse trnsformtion 0 Invertible trnsformtions Specil subset, llows for prediction of error, sptil modeling Point-to-point t i t trnsformtions ti ver centrl, more thn n other Cn hve multi-step trnsformtions 6
Dimensionl Trnsformtions Coordinte trnsformtions Projections Geometric trnsformtions Mesurements from coordintes Affine trnsformtions Rottion, trnsltion, nd scling Sttisticl spce trnsformtions Plnr mp trnsformtions Distnce between two points Figured out,400 ers go b Pthgors ( ) + ( ) d to Is this invertible? Onl if we hve three points Length of line npts length ( ) + ( ) i i i i i 7
Plnr mp trnsformtions II Weighted verge point Cities (,,P) P popultion npts P i i i npts P i i npts P i i i npts P i i Intersection point of two lines (, ) (, ) Line (p, q) Line ( 4, 4 ) (, ) 8
Intersection point of two lines If (, ) nd (, ) lie on the sme line then: + b + b remember m + b (the eqution of line) If (, ) nd ( 4, 4 ) lie on the sme line then: + b + 4 b 4 Intersection point of two lines If n intersection eists, it must lie on both lines: + b + b Solve for simultneous equtions: b + ( b ) Rerrnge to get: b ( b ) 9
Intersection point of two lines Solving for : b b And b substituting, solve for : ( ) + b ( b b) An emple of line intersection 0
50 70 0 0 70 0 60 0 b b 70 0 + b + b + 50b + 0b + 40 ( b b ) 0 0 ( 4 ) 60 6 6.667 4 0 50 + b + 0b + 0b 40 0 b b 4 0 0 + b 4 + 0 + b 0 +. ( ) ( b b ) 0 0 4 Intersection of two lines If the denomintor bove is 0, the lines re prllel If the denomintor nd the numertor bove is 0, the lines re coincident In the computer, we hve rel problem with 0 Actul zero lmost never hppens Mens we must check within limits of coordinte precision Solution is not elegnt test ever combintion of line segments Bounding Bo heuristic
Distnce between point nd line P P P Distnce between point nd line Eqution for the line P P+ u ( P P) The shortest distnce from P to P is perpendiculr line. This mens the dot product of the line nd the perpendiculr is 0. Substitute for the eqution of the line ( P P) 0 ( P P) dot ( P P) 0 [ P P- u(p - P)] dot The dot product is often used to clculte l the cosine of the ngle between two vectors.
Distnce between point nd line Solve for u u ( )( ) + ( )( ) ( ) ( ) Find the intersection point ( ) ( ) + u + u Distnce is length of line between P nd intersection point Clockwise vs. counter clockwise 0 0 ( pt ) ( ) ( ) ( pt ) 0 5 pt 0 Wht if its on the line? 0 5 0 0 5 0 5 0 0, pt 0 0 pt 0 5 0 5 0 0 0 5 0 5 0 0, pt 0
Are of polgon A npts + i ( ) ( ) i i Project lines from ech verte to some outside perpendiculr. Ech re under the line is tringle nd rectngle. Sum the res s ou move round the polgon. Outside res get subtrcted out i i 4
Wht we hve covered this semester Brief nd fst review of GIS Structure of GIS (HW/SW, file bsed, object bsed, object- reltionl) GIS dt models (rster, vector, TIN) Object modeling nd geodtbses Geo-reltionl model, object oriented concepts, object behvior, benefits of geodtbses Mking fetures smrt, qulities of fetures in geodtbse, subtpe, reltionship clsses Crtogrphic modeling Generl principles in crtogrphic modeling, trnsfer of principles to Model Builder, sptil SQL Dtbse design Dt models, entit-reltionship digrms, sptil entities in E-R digrms, phsicl nd logicl design, design steps (model user view, define entities nd reltionships, trnsition to phsicl model) ESRI Geodtbse structure (geodtbse, feture dtset, feture nd object clsses, reltionship clsses, rules) Wht we hve covered this semester Vector GIS opertions Vector functions (scle chnge, buffer, clip, overl, Theissen polgons, Delun tringultion) Mp trnsformtions (conforml, ffine, polnomils, rubbersheeting), rster trnsformtion (WTC emple) Sptil lgorithms (concept of n lgorithm, mthemtics of nlticl crtogrph: distnce, intersection, continment) 5
How ou got our hnds dirt Review of clssic GIS functions for site selection Getting rel world dt into GIS (even when the dt isn t ver good) rubbersheeting nd rster trnsformtion Integrtion of clssic GIS functions in modern computing environment (model builder) Creting geodtbse (controlled environment) Creting geodtbse (non controlled environment) Wht s on the written em 0 definitions short nswers (lists, benefits/limittions, etc.) computtion (i.e. re, centroid, distnce, intersection) esss (conceptul ides) 6
Wht s on the prcticum Hnds-on work Crete geodtbse Digitize boundries Crete smll GIS nlsis 7