Hex Artifact Content
Not logged in

Artifact c22f4645ee5e82326ecc4ce2102752b686bb9170:

Wiki page [VirtualRouting] by sandro 2018-03-22 20:49:44.
0000: 44 20 32 30 31 38 2d 30 33 2d 32 32 54 32 30 3a  D 2018-03-22T20:
0010: 34 39 3a 34 34 2e 37 34 30 0a 4c 20 56 69 72 74  49:44.740.L Virt
0020: 75 61 6c 52 6f 75 74 69 6e 67 0a 50 20 63 61 30  ualRouting.P ca0
0030: 65 35 32 62 62 61 36 65 65 66 62 37 66 64 64 65  e52bba6eefb7fdde
0040: 32 37 31 38 34 37 64 63 66 35 31 38 64 32 31 39  271847dcf518d219
0050: 63 35 65 66 64 0a 55 20 73 61 6e 64 72 6f 0a 57  c5efd.U sandro.W
0060: 20 35 32 31 36 0a 3c 61 20 68 72 65 66 3d 22 68   5216.<a href="h
0070: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  ttps://www.gaia-
0080: 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69  gis.it/fossil/li
0090: 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69  bspatialite/wiki
00a0: 3f 6e 61 6d 65 3d 34 2e 33 2e 30 2d 64 6f 63 22  ?name=4.3.0-doc"
00b0: 3e 62 61 63 6b 3c 2f 61 3e 3c 68 72 3e 3c 62 72  >back</a><hr><br
00c0: 3e 0d 0a 3c 68 31 3e 49 6e 74 72 6f 64 75 63 74  >..<h1>Introduct
00d0: 69 6f 6e 3c 2f 68 31 3e 0d 0a 50 72 65 76 69 6f  ion</h1>..Previo
00e0: 75 73 20 76 65 72 73 69 6f 6e 73 20 6f 66 20 53  us versions of S
00f0: 70 61 74 69 61 4c 69 74 65 20 74 72 61 64 69 74  patiaLite tradit
0100: 69 6f 6e 61 6c 6c 79 20 73 75 70 70 6f 72 74 65  ionally supporte
0110: 64 20 61 20 3c 62 3e 70 75 72 65 20 53 51 4c 20  d a <b>pure SQL 
0120: 72 6f 75 74 69 6e 67 20 6d 6f 64 75 6c 65 3c 2f  routing module</
0130: 62 3e 20 74 68 61 74 20 77 61 73 20 6e 61 6d 65  b> that was name
0140: 64 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73  d <a href="https
0150: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e  ://www.gaia-gis.
0160: 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61  it/fossil/libspa
0170: 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d  tialite/wiki?nam
0180: 65 3d 56 69 72 74 75 61 6c 4e 65 74 77 6f 72 6b  e=VirtualNetwork
0190: 2b 72 65 6c 6f 61 64 65 64 22 3e 56 69 72 74 75  +reloaded">Virtu
01a0: 61 6c 4e 65 74 77 6f 72 6b 3c 2f 61 3e 2e 3c 62  alNetwork</a>.<b
01b0: 72 3e 3c 62 72 3e 0d 0a 53 69 6e 63 65 20 76 65  r><br>..Since ve
01c0: 72 73 69 6f 6e 20 3c 62 3e 35 2e 30 2e 30 3c 2f  rsion <b>5.0.0</
01d0: 62 3e 20 61 20 62 72 61 6e 64 20 6e 65 77 20 3c  b> a brand new <
01e0: 62 3e 72 6f 75 74 69 6e 67 20 6d 6f 64 75 6c 65  b>routing module
01f0: 3c 2f 62 3e 20 28 6d 6f 72 65 20 61 64 76 61 6e  </b> (more advan
0200: 63 65 64 20 61 6e 64 20 73 6f 70 68 69 73 74 69  ced and sophisti
0210: 63 61 74 65 64 29 20 69 73 20 6e 6f 77 20 61 76  cated) is now av
0220: 61 69 6c 61 62 6c 65 2c 20 74 68 61 74 20 69 73  ailable, that is
0230: 20 6e 61 6d 65 64 20 3c 62 3e 56 69 72 74 75 61   named <b>Virtua
0240: 6c 52 6f 75 74 69 6e 67 3c 2f 62 3e 2e 3c 62 72  lRouting</b>.<br
0250: 3e 0d 0a 54 68 65 20 6e 6f 77 61 64 61 79 73 20  >..The nowadays 
0260: 6f 62 73 6f 6c 65 74 65 20 3c 62 3e 56 69 72 74  obsolete <b>Virt
0270: 75 61 6c 4e 65 74 77 6f 72 6b 3c 2f 62 3e 20 73  ualNetwork</b> s
0280: 74 69 6c 6c 20 63 6f 6e 74 69 6e 75 65 73 20 74  till continues t
0290: 6f 20 62 65 20 73 75 70 70 6f 72 74 65 64 20 62  o be supported b
02a0: 79 20 76 65 72 73 69 6f 6e 20 3c 62 3e 35 2e 30  y version <b>5.0
02b0: 2e 30 3c 2f 62 3e 20 73 6f 20 74 6f 20 6e 6f 74  .0</b> so to not
02c0: 20 63 61 75 73 65 20 61 6e 20 61 62 72 75 70 74   cause an abrupt
02d0: 20 62 72 65 61 6b 20 74 6f 20 61 6c 72 65 61 64   break to alread
02e0: 79 20 65 78 69 73 74 69 6e 67 20 61 70 70 6c 69  y existing appli
02f0: 63 61 74 69 6f 6e 73 2c 20 62 75 74 20 77 69 6c  cations, but wil
0300: 6c 20 62 65 20 70 72 65 73 75 6d 61 62 6c 79 20  l be presumably 
0310: 73 75 70 70 72 65 73 73 65 64 20 69 6e 20 66 75  suppressed in fu
0320: 74 75 72 65 20 76 65 72 73 69 6f 6e 73 2e 3c 62  ture versions.<b
0330: 72 3e 0d 0a 55 73 69 6e 67 20 3c 62 3e 56 69 72  r>..Using <b>Vir
0340: 74 75 61 6c 52 6f 75 74 69 6e 67 3c 2f 62 3e 20  tualRouting</b> 
0350: 69 6e 73 74 65 61 64 20 6f 66 20 3c 62 3e 56 69  instead of <b>Vi
0360: 72 74 75 61 6c 4e 65 74 77 69 72 6b 3c 2f 62 3e  rtualNetwirk</b>
0370: 20 69 73 20 77 61 72 6d 6c 79 20 72 65 63 63 6f   is warmly recco
0380: 6d 6d 65 6e 64 65 64 20 66 6f 72 20 61 6e 79 20  mmended for any 
0390: 6e 65 77 20 64 65 76 65 6c 6f 70 6d 65 6e 74 2e  new development.
03a0: 20 0d 0a 3c 68 32 3e 54 65 6f 72 65 74 69 63 61   ..<h2>Teoretica
03b0: 6c 20 66 6f 75 6e 64 61 74 69 6f 6e 73 20 2d 20  l foundations - 
03c0: 61 6e 20 75 6c 74 72 61 2d 71 75 69 63 6b 20 72  an ultra-quick r
03d0: 65 63 61 6c 6c 3c 2f 68 32 3e 0d 0a 41 6c 6c 20  ecall</h2>..All 
03e0: 3c 62 3e 52 6f 75 74 69 6e 67 20 61 6c 67 6f 72  <b>Routing algor
03f0: 69 74 68 6d 73 3c 2f 62 3e 20 28 3c 69 3e 61 6b  ithms</b> (<i>ak
0400: 61 3c 2f 69 3e 20 3c 62 3e 53 68 6f 72 74 65 73  a</i> <b>Shortes
0410: 74 20 50 61 74 68 3c 2f 62 3e 20 61 6c 67 6f 72  t Path</b> algor
0420: 69 74 68 6d 73 29 20 61 72 65 20 62 61 73 65 64  ithms) are based
0430: 20 6f 6e 20 74 68 65 20 6d 61 74 68 65 6d 61 74   on the mathemat
0440: 69 63 73 20 6f 66 20 74 68 65 20 3c 61 20 68 72  ics of the <a hr
0450: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77  ef="https://en.w
0460: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b  ikipedia.org/wik
0470: 69 2f 47 72 61 70 68 5f 74 68 65 6f 72 79 22 3e  i/Graph_theory">
0480: 47 72 61 70 68 20 74 68 65 6f 72 79 3c 2f 61 3e  Graph theory</a>
0490: 20 61 6e 64 20 6d 6f 72 65 20 70 72 65 63 69 73   and more precis
04a0: 65 6c 79 20 6f 6e 20 3c 62 3e 57 65 69 67 68 74  ely on <b>Weight
04b0: 65 64 20 47 72 61 70 68 73 3c 2f 62 3e 2e 0d 0a  ed Graphs</b>...
04c0: 3c 62 72 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22  <br>..<img src="
04d0: 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  http://www.gaia-
04e0: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73  gis.it/gaia-sins
04f0: 2f 6e 65 74 77 6f 72 6b 2e 70 6e 67 22 20 61 6c  /network.png" al
0500: 74 3d 22 6e 65 74 77 6f 72 6b 22 3e 0d 0a 3c 62  t="network">..<b
0510: 72 3e 0d 0a 41 20 74 6f 70 6f 6c 6f 67 69 63 61  r>..A topologica
0520: 6c 6c 79 20 76 61 6c 69 64 20 3c 62 3e 4e 65 74  lly valid <b>Net
0530: 77 6f 72 6b 3c 2f 62 3e 20 69 73 20 61 20 64 61  work</b> is a da
0540: 74 61 73 65 74 20 66 75 6c 6c 66 69 6c 6c 69 6e  taset fullfillin
0550: 67 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  g the following 
0560: 72 65 71 75 69 72 65 6d 65 6e 74 73 3a 0d 0a 3c  requirements:..<
0570: 75 6c 3e 0d 0a 3c 6c 69 3e 41 6c 6c 20 69 74 65  ul>..<li>All ite
0580: 6d 73 20 69 6e 20 74 68 65 20 64 61 74 61 73 65  ms in the datase
0590: 74 20 61 72 65 20 63 61 6c 6c 65 64 20 3c 62 3e  t are called <b>
05a0: 4c 69 6e 6b 73 3c 2f 62 3e 20 28 3c 69 3e 61 6b  Links</b> (<i>ak
05b0: 73 3c 2f 69 3e 20 3c 62 3e 41 72 63 73 3c 2f 62  s</i> <b>Arcs</b
05c0: 3e 29 2c 20 61 6e 64 20 61 72 65 20 65 78 70 65  >), and are expe
05d0: 63 74 65 64 20 74 6f 20 72 65 70 72 65 73 65 6e  cted to represen
05e0: 74 20 73 6f 6d 65 20 6f 72 69 65 6e 74 65 64 20  t some oriented 
05f0: 63 6f 6e 65 63 74 69 6f 6e 20 6a 6f 69 6e 69 6e  conection joinin
0600: 67 20 74 77 6f 20 3c 62 3e 4e 6f 64 65 73 3c 2f  g two <b>Nodes</
0610: 62 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61 6d  b>.<br>..<u>Exam
0620: 70 6c 65 3c 2f 75 3e 3a 20 69 6e 20 74 68 65 20  ple</u>: in the 
0630: 61 62 6f 76 65 20 66 69 67 75 72 65 20 4c 69 6e  above figure Lin
0640: 6b 20 3c 62 3e 4c 33 3c 2f 62 3e 20 63 6f 6e 6e  k <b>L3</b> conn
0650: 65 63 74 73 20 4e 6f 64 65 73 20 3c 62 3e 4e 32  ects Nodes <b>N2
0660: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 4e 35 3c 2f  </b> and <b>N5</
0670: 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 53 6f  b>.</li>..<li>So
0680: 20 61 6c 6c 20 3c 62 3e 4c 69 6e 6b 73 3c 2f 62   all <b>Links</b
0690: 3e 20 61 72 65 20 61 6c 77 61 79 73 20 65 78 70  > are always exp
06a0: 65 63 74 65 64 20 74 6f 20 65 78 70 6c 69 63 69  ected to explici
06b0: 74 6c 79 20 72 65 66 65 72 65 6e 63 65 20 61 20  tly reference a 
06c0: 3c 62 3e 53 74 61 72 74 2d 4e 6f 64 65 3c 2f 62  <b>Start-Node</b
06d0: 3e 20 28 3c 69 3e 61 6b 61 3c 2f 69 3e 20 3c 62  > (<i>aka</i> <b
06e0: 3e 4e 6f 64 65 2d 46 72 6f 6d 3c 2f 62 3e 29 20  >Node-From</b>) 
06f0: 61 6e 64 20 61 6e 20 3c 62 3e 45 6e 64 2d 4e 6f  and an <b>End-No
0700: 64 65 3c 2f 62 3e 20 28 3c 69 3e 61 6b 61 3c 2f  de</b> (<i>aka</
0710: 69 3e 20 3c 62 3e 4e 6f 64 65 2d 54 6f 3c 2f 62  i> <b>Node-To</b
0720: 3e 29 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 4c  >)...<ul>..<li>L
0730: 69 6e 6b 73 20 61 72 65 20 61 6c 77 61 79 73 20  inks are always 
0740: 3c 62 3e 6f 72 69 65 6e 74 65 64 3c 2f 62 3e 2c  <b>oriented</b>,
0750: 20 61 6e 64 20 74 68 65 69 72 20 6e 61 74 75 72   and their natur
0760: 61 6c 20 64 69 72 65 63 74 69 6f 6e 20 69 73 20  al direction is 
0770: 3c 62 3e 46 72 6f 6d 2d 54 6f 3c 2f 62 3e 3a 0d  <b>From-To</b>:.
0780: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 69 6e 20 61 6e  .<ul>..<li>in an
0790: 20 3c 62 3e 75 6e 69 64 69 72 65 63 74 69 6f 6e   <b>unidirection
07a0: 61 6c 3c 2f 62 3e 20 4e 65 74 77 6f 72 6b 20 65  al</b> Network e
07b0: 61 63 68 20 4c 69 6e 6b 20 69 73 20 61 6e 20 3c  ach Link is an <
07c0: 62 3e 6f 6e 65 77 61 79 3c 2f 62 3e 20 63 6f 6e  b>oneway</b> con
07d0: 6e 65 63 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 49 66  nection.<br>..If
07e0: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20   the connection 
07f0: 69 73 20 61 76 61 69 6c 61 62 6c 65 20 61 6c 73  is available als
0800: 6f 20 69 6e 20 74 68 65 20 6f 70 70 6f 73 69 74  o in the opposit
0810: 65 20 64 69 72 65 63 74 69 6f 6e 20 61 20 73 65  e direction a se
0820: 63 6f 6e 64 20 4c 69 6e 6b 20 6d 75 73 74 20 62  cond Link must b
0830: 65 20 65 78 70 6c 69 63 69 74 6c 79 20 64 65 63  e explicitly dec
0840: 6c 61 72 65 64 2e 3c 62 72 3e 0d 0a 3c 75 3e 45  lared.<br>..<u>E
0850: 78 61 6d 70 6c 65 3c 2f 75 3e 3a 20 4c 69 6e 6b  xample</u>: Link
0860: 20 3c 62 3e 58 31 3c 2f 62 3e 20 67 6f 69 6e 67   <b>X1</b> going
0870: 20 66 72 6f 6d 20 4e 6f 64 65 20 3c 62 3e 41 3c   from Node <b>A<
0880: 2f 62 3e 20 74 6f 20 4e 6f 64 65 20 3c 62 3e 42  /b> to Node <b>B
0890: 3c 2f 62 3e 2c 20 61 6e 64 20 4c 69 6e 6b 20 3c  </b>, and Link <
08a0: 62 3e 58 32 3c 2f 62 3e 20 67 6f 69 6e 67 20 66  b>X2</b> going f
08b0: 72 6f 6d 20 4e 6f 64 65 20 3c 62 3e 42 3c 2f 62  rom Node <b>B</b
08c0: 3e 20 74 6f 20 4e 6f 64 65 20 3c 62 3e 41 3c 2f  > to Node <b>A</
08d0: 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 6e  b>.</li>..<li>in
08e0: 20 61 20 3c 62 3e 62 69 64 69 72 65 63 74 69 6f   a <b>bidirectio
08f0: 6e 61 6c 3c 2f 62 3e 20 4e 65 74 77 6f 72 6b 20  nal</b> Network 
0900: 61 6c 6c 20 4c 69 6e 6b 73 20 61 72 65 20 61 73  all Links are as
0910: 73 75 6d 65 64 20 74 6f 20 65 73 74 61 62 6c 69  sumed to establi
0920: 73 68 20 61 20 63 6f 6e 6e 65 63 74 69 6f 6e 20  sh a connection 
0930: 6f 6e 20 62 6f 74 68 20 64 69 72 65 63 74 69 6f  on both directio
0940: 6e 73 2e 3c 62 72 3e 0d 0a 44 65 66 69 6e 69 74  ns.<br>..Definit
0950: 69 6e 67 20 61 6e 20 65 76 65 6e 74 75 61 6c 20  ing an eventual 
0960: 3c 62 3e 6f 6e 65 77 61 79 3c 2f 62 3e 20 72 65  <b>oneway</b> re
0970: 71 75 69 72 65 73 20 73 6f 6d 65 20 61 70 70 72  quires some appr
0980: 6f 70 72 69 61 74 65 20 61 74 74 72 69 62 75 74  opriate attribut
0990: 65 20 74 6f 20 62 65 20 73 65 74 20 28 73 65 65  e to be set (see
09a0: 20 62 65 6c 6f 77 29 2e 3c 2f 6c 69 3e 0d 0a 3c   below).</li>..<
09b0: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 54  /ul></li>..<li>T
09c0: 68 65 20 3c 62 3e 53 74 61 72 74 2d 3c 2f 62 3e  he <b>Start-</b>
09d0: 20 61 6e 64 20 3c 62 3e 45 6e 64 2d 4e 6f 64 65   and <b>End-Node
09e0: 3c 2f 62 3e 20 63 6f 75 6c 64 20 65 76 65 6e 74  </b> could event
09f0: 75 61 6c 6c 79 20 62 65 20 74 68 65 20 73 61 6d  ually be the sam
0a00: 65 2c 20 61 6e 64 20 69 6e 20 74 68 69 73 20 63  e, and in this c
0a10: 61 73 65 20 77 65 27 6c 6c 20 68 61 76 65 20 61  ase we'll have a
0a20: 20 3c 62 3e 73 65 6c 66 2d 63 6c 6f 73 65 64 3c   <b>self-closed<
0a30: 2f 62 3e 20 4c 69 6e 6b 2e 3c 2f 6c 69 3e 0d 0a  /b> Link.</li>..
0a40: 3c 6c 69 3e 4e 65 74 77 6f 72 6b 27 73 20 4c 69  <li>Network's Li
0a50: 6e 6b 73 20 3c 62 3e 63 61 6e 3c 2f 62 3e 20 65  nks <b>can</b> e
0a60: 76 65 6e 74 75 61 6c 6c 79 20 64 65 66 69 6e 65  ventually define
0a70: 20 61 20 6c 69 6e 65 61 72 20 47 65 6f 6d 65 74   a linear Geomet
0a80: 72 79 20 28 3c 62 3e 4c 49 4e 45 53 54 52 49 4e  ry (<b>LINESTRIN
0a90: 47 3c 2f 62 3e 29 20 67 6f 69 6e 67 20 66 72 6f  G</b>) going fro
0aa0: 6d 20 74 68 65 20 3c 62 3e 53 74 61 72 74 2d 4e  m the <b>Start-N
0ab0: 6f 64 65 3c 2f 62 3e 20 74 6f 20 74 68 65 20 3c  ode</b> to the <
0ac0: 62 3e 45 6e 64 2d 4e 6f 64 65 3c 2f 62 3e 2c 20  b>End-Node</b>, 
0ad0: 62 75 74 20 74 68 69 73 20 69 73 20 61 6e 20 6f  but this is an o
0ae0: 70 74 69 6f 6e 61 6c 20 66 65 61 74 75 72 65 2c  ptional feature,
0af0: 20 6e 6f 74 20 61 20 6d 61 6e 64 61 74 6f 72 79   not a mandatory
0b00: 20 72 65 71 75 69 72 65 6d 65 6e 74 2e 3c 2f 6c   requirement.</l
0b10: 69 3e 0d 0a 3c 6c 69 3e 57 68 61 74 20 69 73 20  i>..<li>What is 
0b20: 61 62 73 6f 6c 75 74 65 6c 79 20 6d 61 6e 64 61  absolutely manda
0b30: 74 6f 72 79 20 69 73 20 74 68 61 74 20 65 61 63  tory is that eac
0b40: 68 20 3c 62 3e 4c 69 6e 6b 3c 2f 62 3e 20 6d 75  h <b>Link</b> mu
0b50: 73 74 20 65 78 70 6c 69 63 69 74 6c 79 20 72 65  st explicitly re
0b60: 66 65 72 65 6e 63 65 20 69 74 73 20 3c 62 3e 4e  ference its <b>N
0b70: 6f 64 65 73 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a  odes</b>.</li>..
0b80: 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  </ul></li>..<li>
0b90: 41 20 4e 65 74 77 6f 72 6b 20 73 75 70 70 6f 72  A Network suppor
0ba0: 74 69 6e 67 20 47 65 6f 6d 65 74 72 69 65 73 20  ting Geometries 
0bb0: 69 73 20 61 20 3c 62 3e 53 70 61 74 69 61 6c 20  is a <b>Spatial 
0bc0: 4e 65 74 77 6f 72 6b 3c 2f 62 3e 3b 20 6f 74 68  Network</b>; oth
0bd0: 65 72 77 69 73 65 20 61 20 4e 65 74 77 6f 72 6b  erwise a Network
0be0: 20 6c 61 63 6b 69 6e 67 20 61 6e 79 20 67 65 6f   lacking any geo
0bf0: 6d 65 74 72 79 20 69 73 20 61 20 3c 62 3e 4c 6f  metry is a <b>Lo
0c00: 67 69 63 61 6c 20 4e 65 74 77 6f 72 6b 3c 2f 62  gical Network</b
0c10: 3e 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 49 6e  >...<ul>..<li>In
0c20: 20 61 20 3c 62 3e 53 70 61 74 69 61 6c 20 4e 65   a <b>Spatial Ne
0c30: 74 77 6f 72 6b 3c 2f 62 3e 20 61 6c 6c 20 4c 69  twork</b> all Li
0c40: 6e 6b 73 20 3c 62 3e 6d 75 73 74 3c 2f 62 3e 20  nks <b>must</b> 
0c50: 68 61 76 65 20 61 20 63 6f 72 72 65 73 70 6f 6e  have a correspon
0c60: 64 69 6e 67 20 47 65 6f 6d 65 74 72 79 2e 3c 2f  ding Geometry.</
0c70: 6c 69 3e 0d 0a 3c 6c 69 3e 49 6e 20 61 20 3c 62  li>..<li>In a <b
0c80: 3e 4c 6f 67 69 63 61 6c 20 4e 65 74 77 6f 72 6b  >Logical Network
0c90: 3c 2f 62 3e 20 61 6c 6c 20 4c 69 6e 6b 73 20 3c  </b> all Links <
0ca0: 62 3e 61 72 65 20 73 74 72 69 63 74 6c 79 20 66  b>are strictly f
0cb0: 6f 72 62 69 64 64 65 6e 3c 2f 62 3e 20 74 6f 20  orbidden</b> to 
0cc0: 68 61 76 65 20 61 6e 79 20 67 65 6f 6d 65 74 72  have any geometr
0cd0: 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 49 6e 20  y.</li>..<li>In 
0ce0: 61 20 3c 62 3e 53 70 61 74 69 61 6c 20 4e 65 74  a <b>Spatial Net
0cf0: 77 6f 72 6b 3c 2f 62 3e 20 62 6f 74 68 20 74 68  work</b> both th
0d00: 65 20 3c 62 3e 53 74 61 72 74 50 6f 69 6e 74 3c  e <b>StartPoint<
0d10: 2f 62 3e 20 61 6e 64 20 3c 62 3e 45 6e 64 50 6f  /b> and <b>EndPo
0d20: 69 6e 74 3c 2f 62 3e 20 6f 66 20 65 61 63 68 20  int</b> of each 
0d30: 4c 69 6e 6b 27 73 20 3c 62 3e 4c 49 4e 45 53 54  Link's <b>LINEST
0d40: 49 4e 47 3c 2f 62 3e 20 61 72 65 20 61 6c 77 61  ING</b> are alwa
0d50: 79 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 65  ys expected to e
0d60: 78 61 63 74 6c 79 20 63 6f 69 6e 63 69 64 65 20  xactly coincide 
0d70: 77 69 74 68 20 74 68 65 20 63 6f 72 72 65 73 70  with the corresp
0d80: 6f 6e 64 69 6e 67 20 3c 62 3e 4e 6f 64 65 73 3c  onding <b>Nodes<
0d90: 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e  /b>.</li>..</ul>
0da0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 41 6c 6c 20 72  </li>..<li>All r
0db0: 65 66 65 72 65 6e 63 65 73 20 74 6f 20 74 68 65  eferences to the
0dc0: 20 73 61 6d 65 20 3c 62 3e 4e 6f 64 65 3c 2f 62   same <b>Node</b
0dd0: 3e 20 62 79 20 64 69 66 66 65 72 65 6e 74 20 4c  > by different L
0de0: 69 6e 6b 73 20 3c 62 3e 6d 75 73 74 3c 2f 62 3e  inks <b>must</b>
0df0: 20 65 78 61 63 74 6c 79 20 63 6f 69 6e 63 69 64   exactly coincid
0e00: 65 2e 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70  e.<br>..<u>Examp
0e10: 6c 65 3c 2f 75 3e 3a 20 4e 6f 64 65 20 3c 62 3e  le</u>: Node <b>
0e20: 4e 35 3c 2f 62 3e 20 69 73 20 73 68 61 72 65 64  N5</b> is shared
0e30: 20 62 79 20 4c 69 6e 6b 73 20 3c 62 3e 4c 33 3c   by Links <b>L3<
0e40: 2f 62 3e 2c 20 3c 62 3e 4c 36 3c 2f 62 3e 2c 20  /b>, <b>L6</b>, 
0e50: 3c 62 3e 4c 37 3c 2f 62 3e 2c 20 3c 62 3e 4c 39  <b>L7</b>, <b>L9
0e60: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 4c 31 30 3c  </b> and <b>L10<
0e70: 2f 62 3e 2c 20 73 6f 20 61 6c 6c 20 74 68 65 69  /b>, so all thei
0e80: 72 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20  r corresponding 
0e90: 4c 49 4e 45 53 54 52 49 4e 47 53 20 61 72 65 20  LINESTRINGS are 
0ea0: 65 78 70 65 63 74 65 64 20 74 6f 20 68 61 76 65  expected to have
0eb0: 20 6f 6e 65 20 6f 66 20 74 68 65 20 65 78 74 72   one of the extr
0ec0: 65 6d 69 74 79 20 70 6f 69 6e 74 73 20 65 78 61  emity points exa
0ed0: 63 74 6c 79 20 63 6f 69 6e 63 69 64 65 6e 74 20  ctly coincident 
0ee0: 77 69 74 68 20 61 6c 6c 20 74 68 65 20 6f 74 68  with all the oth
0ef0: 65 72 73 2e 3c 62 72 3e 0d 0a 49 66 20 73 75 63  ers.<br>..If suc
0f00: 68 20 61 20 63 6f 6e 64 69 74 69 6f 6e 20 69 73  h a condition is
0f10: 20 6e 6f 74 20 73 61 74 69 73 66 69 65 64 20 77   not satisfied w
0f20: 65 27 6c 6c 20 68 61 76 65 20 61 20 3c 62 3e 74  e'll have a <b>t
0f30: 6f 70 6f 6c 6f 67 69 63 61 6c 20 69 6e 63 6f 6e  opological incon
0f40: 73 69 73 74 65 6e 63 79 3c 2f 62 3e 2c 20 74 68  sistency</b>, th
0f50: 75 73 20 6c 65 61 64 69 6e 67 20 74 6f 20 61 6e  us leading to an
0f60: 20 3c 62 3e 69 6e 76 61 6c 69 64 3c 2f 62 3e 20   <b>invalid</b> 
0f70: 4e 65 74 77 6f 72 6b 2e 3c 2f 6c 69 3e 0d 0a 3c  Network.</li>..<
0f80: 6c 69 3e 41 63 63 6f 72 64 69 6e 67 6c 79 20 74  li>Accordingly t
0f90: 6f 20 74 68 65 20 61 62 6f 76 65 20 70 72 65 6d  o the above prem
0fa0: 69 73 65 2c 20 3c 62 3e 4e 6f 64 65 73 3c 2f 62  ise, <b>Nodes</b
0fb0: 3e 20 61 72 65 20 6e 65 76 65 72 20 65 78 70 65  > are never expe
0fc0: 63 74 65 64 20 74 6f 20 62 65 20 65 78 70 6c 69  cted to be expli
0fd0: 63 69 74 6c 79 20 64 65 63 6c 61 72 65 64 20 6a  citly declared j
0fe0: 75 73 74 20 62 65 63 61 75 73 65 20 74 68 65 79  ust because they
0ff0: 20 63 61 6e 20 62 65 20 69 6e 64 69 72 65 63 74   can be indirect
1000: 6c 79 20 72 65 63 6f 76 65 72 65 64 20 66 72 6f  ly recovered fro
1010: 6d 20 74 68 65 20 4c 69 6e 6b 73 27 20 64 65 66  m the Links' def
1020: 69 6e 69 74 69 6f 6e 73 2e 3c 2f 6c 69 3e 0d 0a  initions.</li>..
1030: 3c 6c 69 3e 3c 62 3e 4c 69 6e 6b 73 3c 2f 62 3e  <li><b>Links</b>
1040: 20 61 72 65 6e 27 74 20 73 74 72 69 63 74 6c 79   aren't strictly
1050: 20 72 65 71 75 69 72 65 64 20 74 6f 20 62 65 20   required to be 
1060: 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20  associated with 
1070: 61 6e 79 20 61 74 74 72 69 62 75 74 65 2c 20 62  any attribute, b
1080: 75 74 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  ut the following
1090: 20 61 74 74 72 69 62 75 74 65 73 20 61 72 65 20   attributes are 
10a0: 61 6c 6d 6f 73 74 20 75 6e 69 76 65 72 73 61 6c  almost universal
10b0: 6c 79 20 73 75 70 70 6f 72 74 65 64 3a 0d 0a 3c  ly supported:..<
10c0: 75 6c 3e 0d 0a 3c 6c 69 3e 61 20 3c 62 3e 6e 61  ul>..<li>a <b>na
10d0: 6d 65 3c 2f 62 3e 20 69 64 65 6e 74 69 66 79 69  me</b> identifyi
10e0: 6e 67 20 74 68 65 20 4c 69 6e 6b 2e 3c 62 72 3e  ng the Link.<br>
10f0: 0d 0a 3c 75 3e 45 78 61 6d 70 6c 65 73 3c 2f 75  ..<u>Examples</u
1100: 3e 3a 20 74 68 65 20 3c 69 3e 72 6f 61 64 20 74  >: the <i>road t
1110: 6f 70 6f 6e 79 6d 3c 2f 69 3e 20 69 6e 20 61 20  oponym</i> in a 
1120: 3c 62 3e 72 6f 61 64 20 6e 65 74 77 6f 72 6b 3c  <b>road network<
1130: 2f 62 3e 2c 20 6f 72 20 74 68 65 20 3c 69 3e 72  /b>, or the <i>r
1140: 69 76 65 72 20 6e 61 6d 65 3c 2f 69 3e 20 69 6e  iver name</i> in
1150: 20 61 6e 20 3c 62 3e 68 79 64 72 6f 67 72 61 70   an <b>hydrograp
1160: 68 69 63 20 6e 65 74 77 6f 72 6b 3c 2f 62 3e 2e  hic network</b>.
1170: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6f 6e 65 20 28  </li>..<li>one (
1180: 6f 72 20 65 76 65 6e 20 6d 6f 72 65 29 20 61 70  or even more) ap
1190: 70 72 6f 70 72 69 61 74 65 20 3c 62 3e 63 6f 73  propriate <b>cos
11a0: 74 20 76 61 6c 75 65 3c 2f 62 3e 28 73 29 2e 3c  t value</b>(s).<
11b0: 62 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70 6c 65 3c  br>..<u>Example<
11c0: 2f 75 3e 3a 20 74 68 65 20 3c 69 3e 74 69 6d 65  /u>: the <i>time
11d0: 3c 2f 69 3e 20 72 65 71 75 69 72 65 64 20 74 6f  </i> required to
11e0: 20 74 72 61 76 65 72 73 65 20 74 68 65 20 4c 69   traverse the Li
11f0: 6e 6b 20 28 6d 61 79 20 62 65 20 64 69 73 63 72  nk (may be discr
1200: 69 6d 69 6e 61 74 69 6e 67 20 62 65 74 77 65 65  iminating betwee
1210: 6e 20 70 65 64 65 73 74 72 69 61 6e 73 2c 20 62  n pedestrians, b
1220: 79 63 69 63 6c 65 73 2c 20 63 61 72 73 2c 20 6c  ycicles, cars, l
1230: 6f 72 72 69 65 73 20 61 6e 64 20 73 6f 20 6f 6e  orries and so on
1240: 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 20 70  ).</li>..<li>a p
1250: 61 69 72 20 6f 66 20 3c 62 3e 62 6f 6c 65 61 6e  air of <b>bolean
1260: 20 66 6c 61 67 73 3c 2f 62 3e 20 28 3c 62 3e 66   flags</b> (<b>f
1270: 72 6f 6d 2d 74 6f 3c 2f 62 3e 20 61 6e 64 20 3c  rom-to</b> and <
1280: 62 3e 74 6f 2d 66 72 6f 6d 3c 2f 62 3e 29 20 69  b>to-from</b>) i
1290: 6e 74 65 6e 64 65 6e 64 20 74 6f 20 73 70 65 63  ntendend to spec
12a0: 69 66 79 20 69 66 20 74 68 65 20 4c 69 6e 6b 20  ify if the Link 
12b0: 63 61 6e 20 62 65 20 74 72 61 76 65 72 73 65 64  can be traversed
12c0: 20 6f 6e 20 62 6f 74 68 20 64 69 72 65 63 74 69   on both directi
12d0: 6f 6e 73 20 6f 72 20 6a 75 73 74 20 69 6e 20 6f  ons or just in o
12e0: 6e 65 20 28 3c 62 3e 6f 6e 65 77 61 79 3c 2f 62  ne (<b>oneway</b
12f0: 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c  >).</li>..</ul><
1300: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 68 34  /li>..</ul>..<h4
1310: 3e 43 6f 72 6f 6c 6c 61 72 79 3c 2f 68 34 3e 0d  >Corollary</h4>.
1320: 0a 41 6e 79 20 74 6f 70 6f 6c 6f 67 69 63 61 6c  .Any topological
1330: 6c 79 20 76 61 6c 69 64 20 3c 62 3e 4e 65 74 77  ly valid <b>Netw
1340: 6f 72 6b 3c 2f 62 3e 20 28 69 72 72 65 73 70 65  ork</b> (irrespe
1350: 63 74 69 76 65 6c 79 20 69 66 20 69 74 27 73 20  ctively if it's 
1360: 6f 66 20 74 68 65 20 3c 62 3e 53 70 61 74 69 61  of the <b>Spatia
1370: 6c 3c 2f 62 3e 20 6f 72 20 3c 62 3e 4c 6f 67 69  l</b> or <b>Logi
1380: 63 61 6c 3c 2f 62 3e 20 74 79 70 65 29 20 69 73  cal</b> type) is
1390: 20 61 20 76 61 6c 69 64 20 3c 62 3e 47 72 61 70   a valid <b>Grap
13a0: 68 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 41 6e 64 20  h</b>.<br>..And 
13b0: 61 20 4e 65 74 77 6f 72 6b 20 61 6c 6c 6f 77 69  a Network allowi
13c0: 6e 67 20 74 6f 20 73 75 70 70 6f 72 74 20 28 64  ng to support (d
13d0: 69 72 65 63 74 6c 79 20 6f 72 20 69 6e 64 69 72  irectly or indir
13e0: 65 63 74 6c 79 29 20 73 6f 6d 65 20 61 70 70 72  ectly) some appr
13f0: 6f 70 72 69 61 74 65 20 3c 62 3e 63 6f 73 74 20  opriate <b>cost 
1400: 76 61 6c 75 65 3c 2f 62 3e 20 69 73 20 61 20 76  value</b> is a v
1410: 61 6c 69 64 20 3c 62 3e 57 65 69 67 68 74 65 64  alid <b>Weighted
1420: 20 47 72 61 70 68 3c 2f 62 3e 2c 20 61 6e 64 20   Graph</b>, and 
1430: 63 61 6e 20 63 6f 6e 73 65 71 75 65 6e 74 6c 79  can consequently
1440: 20 73 75 70 70 6f 72 74 20 3c 62 3e 52 6f 75 74   support <b>Rout
1450: 69 6e 67 20 61 6c 67 6f 72 69 74 68 6d 73 3c 2f  ing algorithms</
1460: 62 3e 2e 0d 0a 0d 0a 0d 0a 3c 68 72 3e 3c 62 72  b>.......<hr><br
1470: 3e 0d 0a 3c 61 20 68 72 65 66 3d 22 68 74 74 70  >..<a href="http
1480: 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73  s://www.gaia-gis
1490: 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70  .it/fossil/libsp
14a0: 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61  atialite/wiki?na
14b0: 6d 65 3d 34 2e 33 2e 30 2d 64 6f 63 22 3e 62 61  me=4.3.0-doc">ba
14c0: 63 6b 3c 2f 61 3e 0a 5a 20 39 34 62 37 32 31 62  ck</a>.Z 94b721b
14d0: 63 31 32 35 35 37 31 39 39 63 61 31 65 33 32 62  c12557199ca1e32b
14e0: 36 35 35 39 62 34 35 66 32 0a                    6559b45f2.