Hex Artifact Content
Not logged in

Artifact ca0e52bba6eefb7fdde271847dcf518d219c5efd:

Wiki page [VirtualRouting] by sandro 2018-03-22 17:41:42.
0000: 44 20 32 30 31 38 2d 30 33 2d 32 32 54 31 37 3a  D 2018-03-22T17:
0010: 34 31 3a 34 32 2e 38 30 38 0a 4c 20 56 69 72 74  41:42.808.L Virt
0020: 75 61 6c 52 6f 75 74 69 6e 67 0a 55 20 73 61 6e  ualRouting.U san
0030: 64 72 6f 0a 57 20 32 37 39 37 0a 3c 61 20 68 72  dro.W 2797.<a hr
0040: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e  ef="https://www.
0050: 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73  gaia-gis.it/foss
0060: 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 65  il/libspatialite
0070: 2f 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e 33 2e 30  /wiki?name=4.3.0
0080: 2d 64 6f 63 22 3e 62 61 63 6b 3c 2f 61 3e 3c 68  -doc">back</a><h
0090: 72 3e 3c 62 72 3e 0d 0a 3c 68 31 3e 49 6e 74 72  r><br>..<h1>Intr
00a0: 6f 64 75 63 74 69 6f 6e 3c 2f 68 31 3e 0d 0a 50  oduction</h1>..P
00b0: 72 65 76 69 6f 75 73 20 76 65 72 73 69 6f 6e 73  revious versions
00c0: 20 6f 66 20 53 70 61 74 69 61 4c 69 74 65 20 74   of SpatiaLite t
00d0: 72 61 64 69 74 69 6f 6e 61 6c 6c 79 20 73 75 70  raditionally sup
00e0: 70 6f 72 74 65 64 20 61 20 3c 62 3e 70 75 72 65  ported a <b>pure
00f0: 20 53 51 4c 20 72 6f 75 74 69 6e 67 20 6d 6f 64   SQL routing mod
0100: 75 6c 65 3c 2f 62 3e 20 74 68 61 74 20 77 61 73  ule</b> that was
0110: 20 6e 61 6d 65 64 20 3c 61 20 68 72 65 66 3d 22   named <a href="
0120: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61  https://www.gaia
0130: 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c  -gis.it/fossil/l
0140: 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b  ibspatialite/wik
0150: 69 3f 6e 61 6d 65 3d 56 69 72 74 75 61 6c 4e 65  i?name=VirtualNe
0160: 74 77 6f 72 6b 2b 72 65 6c 6f 61 64 65 64 22 3e  twork+reloaded">
0170: 56 69 72 74 75 61 6c 4e 65 74 77 6f 72 6b 3c 2f  VirtualNetwork</
0180: 61 3e 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 53 69 6e  a>.<br><br>..Sin
0190: 63 65 20 76 65 72 73 69 6f 6e 20 3c 62 3e 35 2e  ce version <b>5.
01a0: 30 2e 30 3c 2f 62 3e 20 61 20 62 72 61 6e 64 20  0.0</b> a brand 
01b0: 6e 65 77 20 3c 62 3e 72 6f 75 74 69 6e 67 20 6d  new <b>routing m
01c0: 6f 64 75 6c 65 3c 2f 62 3e 20 28 6d 6f 72 65 20  odule</b> (more 
01d0: 61 64 76 61 6e 63 65 64 20 61 6e 64 20 73 6f 70  advanced and sop
01e0: 68 69 73 74 69 63 61 74 65 64 29 20 69 73 20 6e  histicated) is n
01f0: 6f 77 20 61 76 61 69 6c 61 62 6c 65 2c 20 74 68  ow available, th
0200: 61 74 20 69 73 20 6e 61 6d 65 64 20 3c 62 3e 56  at is named <b>V
0210: 69 72 74 75 61 6c 52 6f 75 74 69 6e 67 3c 2f 62  irtualRouting</b
0220: 3e 2e 3c 62 72 3e 0d 0a 54 68 65 20 6e 6f 77 61  >.<br>..The nowa
0230: 64 61 79 73 20 6f 62 73 6f 6c 65 74 65 20 3c 62  days obsolete <b
0240: 3e 56 69 72 74 75 61 6c 4e 65 74 77 6f 72 6b 3c  >VirtualNetwork<
0250: 2f 62 3e 20 73 74 69 6c 6c 20 63 6f 6e 74 69 6e  /b> still contin
0260: 75 65 73 20 74 6f 20 62 65 20 73 75 70 70 6f 72  ues to be suppor
0270: 74 65 64 20 62 79 20 76 65 72 73 69 6f 6e 20 3c  ted by version <
0280: 62 3e 35 2e 30 2e 30 3c 2f 62 3e 20 73 6f 20 74  b>5.0.0</b> so t
0290: 6f 20 6e 6f 74 20 63 61 75 73 65 20 61 6e 20 61  o not cause an a
02a0: 62 72 75 70 74 20 62 72 65 61 6b 20 74 6f 20 61  brupt break to a
02b0: 6c 72 65 61 64 79 20 65 78 69 73 74 69 6e 67 20  lready existing 
02c0: 61 70 70 6c 69 63 61 74 69 6f 6e 73 2c 20 62 75  applications, bu
02d0: 74 20 77 69 6c 6c 20 62 65 20 70 72 65 73 75 6d  t will be presum
02e0: 61 62 6c 79 20 73 75 70 70 72 65 73 73 65 64 20  ably suppressed 
02f0: 69 6e 20 66 75 74 75 72 65 20 76 65 72 73 69 6f  in future versio
0300: 6e 73 2e 3c 62 72 3e 0d 0a 55 73 69 6e 67 20 3c  ns.<br>..Using <
0310: 62 3e 56 69 72 74 75 61 6c 52 6f 75 74 69 6e 67  b>VirtualRouting
0320: 3c 2f 62 3e 20 69 6e 73 74 65 61 64 20 6f 66 20  </b> instead of 
0330: 3c 62 3e 56 69 72 74 75 61 6c 4e 65 74 77 69 72  <b>VirtualNetwir
0340: 6b 3c 2f 62 3e 20 69 73 20 77 61 72 6d 6c 79 20  k</b> is warmly 
0350: 72 65 63 63 6f 6d 6d 65 6e 64 65 64 20 66 6f 72  reccommended for
0360: 20 61 6e 79 20 6e 65 77 20 64 65 76 65 6c 6f 70   any new develop
0370: 6d 65 6e 74 2e 20 0d 0a 3c 68 32 3e 54 65 6f 72  ment. ..<h2>Teor
0380: 65 74 69 63 61 6c 20 66 6f 75 6e 64 61 74 69 6f  etical foundatio
0390: 6e 73 20 2d 20 61 6e 20 75 6c 74 72 61 2d 71 75  ns - an ultra-qu
03a0: 69 63 6b 20 72 65 63 61 6c 6c 3c 2f 68 32 3e 0d  ick recall</h2>.
03b0: 0a 41 6c 6c 20 3c 62 3e 52 6f 75 74 69 6e 67 20  .All <b>Routing 
03c0: 61 6c 67 6f 72 69 74 68 6d 73 3c 2f 62 3e 20 28  algorithms</b> (
03d0: 3c 69 3e 61 6b 61 3c 2f 69 3e 20 3c 62 3e 53 68  <i>aka</i> <b>Sh
03e0: 6f 72 74 65 73 74 20 50 61 74 68 3c 2f 62 3e 20  ortest Path</b> 
03f0: 61 6c 67 6f 72 69 74 68 6d 73 29 20 61 72 65 20  algorithms) are 
0400: 62 61 73 65 64 20 6f 6e 20 74 68 65 20 6d 61 74  based on the mat
0410: 68 65 6d 61 74 69 63 73 20 6f 66 20 74 68 65 20  hematics of the 
0420: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f  <a href="https:/
0430: 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72  /en.wikipedia.or
0440: 67 2f 77 69 6b 69 2f 47 72 61 70 68 5f 74 68 65  g/wiki/Graph_the
0450: 6f 72 79 22 3e 47 72 61 70 68 20 74 68 65 6f 72  ory">Graph theor
0460: 79 3c 2f 61 3e 20 61 6e 64 20 6d 6f 72 65 20 70  y</a> and more p
0470: 72 65 63 69 73 65 6c 79 20 6f 6e 20 3c 62 3e 57  recisely on <b>W
0480: 65 69 67 68 74 65 64 20 47 72 61 70 68 73 3c 2f  eighted Graphs</
0490: 62 3e 2e 0d 0a 3c 62 72 3e 0d 0a 3c 69 6d 67 20  b>...<br>..<img 
04a0: 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77  href="http://www
04b0: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69  .gaia-gis.it/gai
04c0: 61 2d 73 69 6e 73 2f 6e 65 74 77 6f 72 6b 2e 70  a-sins/network.p
04d0: 6e 67 22 20 61 6c 74 3d 22 6e 65 74 77 6f 72 6b  ng" alt="network
04e0: 22 3e 0d 0a 3c 62 72 3e 0d 0a 41 20 74 6f 70 6f  ">..<br>..A topo
04f0: 6c 6f 67 69 63 61 6c 6c 79 20 76 61 6c 69 64 20  logically valid 
0500: 3c 62 3e 4e 65 74 77 6f 72 6b 3c 2f 62 3e 20 69  <b>Network</b> i
0510: 73 20 61 20 64 61 74 61 73 65 74 20 66 75 6c 6c  s a dataset full
0520: 66 69 6c 6c 69 6e 67 20 74 68 65 20 66 6f 6c 6c  filling the foll
0530: 6f 77 69 6e 67 20 72 65 71 75 69 72 65 6d 65 6e  owing requiremen
0540: 74 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 41  ts:..<ul>..<li>A
0550: 6c 6c 20 69 74 65 6d 73 20 69 6e 20 74 68 65 20  ll items in the 
0560: 64 61 74 61 73 65 74 20 61 72 65 20 63 61 6c 6c  dataset are call
0570: 65 64 20 3c 62 3e 4c 69 6e 6b 73 3c 2f 62 3e 20  ed <b>Links</b> 
0580: 28 3c 69 3e 61 6b 73 3c 2f 69 3e 20 3c 62 3e 41  (<i>aks</i> <b>A
0590: 72 63 73 3c 2f 62 3e 29 2c 20 61 6e 64 20 61 72  rcs</b>), and ar
05a0: 65 20 65 78 70 65 63 74 65 64 20 74 6f 20 72 65  e expected to re
05b0: 70 72 65 73 65 6e 74 20 73 6f 6d 65 20 6f 72 69  present some ori
05c0: 65 6e 74 65 64 20 63 6f 6e 65 63 74 69 6f 6e 20  ented conection 
05d0: 6a 6f 69 6e 69 6e 67 20 74 77 6f 20 3c 62 3e 4e  joining two <b>N
05e0: 6f 64 65 73 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a  odes</b>.</li>..
05f0: 3c 6c 69 3e 53 6f 20 61 6c 6c 20 3c 62 3e 4c 69  <li>So all <b>Li
0600: 6e 6b 73 3c 2f 62 3e 20 61 72 65 20 61 6c 77 61  nks</b> are alwa
0610: 79 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 65  ys expected to e
0620: 78 70 6c 69 63 69 74 6c 79 20 72 65 66 65 72 65  xplicitly refere
0630: 6e 63 65 20 61 20 3c 62 3e 53 74 61 72 74 2d 4e  nce a <b>Start-N
0640: 6f 64 65 3c 2f 62 3e 20 28 3c 69 3e 61 6b 73 3c  ode</b> (<i>aks<
0650: 2f 69 3e 20 3c 62 3e 4e 6f 64 65 2d 46 72 6f 6d  /i> <b>Node-From
0660: 3c 2f 62 3e 29 20 61 6e 64 20 61 6e 20 3c 62 3e  </b>) and an <b>
0670: 45 6e 64 2d 4e 6f 64 65 3c 2f 62 3e 20 28 3c 69  End-Node</b> (<i
0680: 3e 61 6b 61 3c 2f 69 3e 20 3c 62 3e 4e 6f 64 65  >aka</i> <b>Node
0690: 2d 54 6f 3c 2f 62 3e 29 2e 3c 62 72 3e 0d 0a 54  -To</b>).<br>..T
06a0: 68 65 20 3c 62 3e 53 74 61 72 74 2d 3c 2f 62 3e  he <b>Start-</b>
06b0: 20 61 6e 64 20 3c 62 3e 45 6e 64 2d 4e 6f 64 65   and <b>End-Node
06c0: 3c 2f 62 3e 20 63 6f 75 6c 64 20 65 76 65 6e 74  </b> could event
06d0: 75 61 6c 6c 79 20 62 65 20 74 68 65 20 73 61 6d  ually be the sam
06e0: 65 2c 20 61 6e 64 20 69 6e 20 74 68 69 73 20 63  e, and in this c
06f0: 61 73 65 20 77 65 27 6c 6c 20 68 61 76 65 20 61  ase we'll have a
0700: 20 3c 62 3e 73 65 6c 66 2d 63 6c 6f 73 65 64 20   <b>self-closed 
0710: 4c 69 6e 6b 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 4e  Link</b>.<br>..N
0720: 65 74 77 6f 72 6b 27 73 20 4c 69 6e 6b 73 20 3c  etwork's Links <
0730: 62 3e 63 61 6e 3c 2f 62 3e 20 65 76 65 6e 74 75  b>can</b> eventu
0740: 61 6c 6c 79 20 64 65 66 69 6e 65 20 61 20 6c 69  ally define a li
0750: 6e 65 61 72 20 47 65 6f 6d 65 74 72 79 20 28 3c  near Geometry (<
0760: 62 3e 4c 49 4e 45 53 54 52 49 4e 47 3c 2f 62 3e  b>LINESTRING</b>
0770: 29 20 67 6f 69 6e 67 20 66 72 6f 6d 20 74 68 65  ) going from the
0780: 20 3c 62 3e 53 74 61 72 74 2d 4e 6f 64 65 3c 2f   <b>Start-Node</
0790: 62 3e 20 74 6f 20 74 68 65 20 3c 62 3e 45 6e 64  b> to the <b>End
07a0: 2d 4e 6f 64 65 3c 2f 62 3e 2c 20 62 75 74 20 74  -Node</b>, but t
07b0: 68 69 73 20 69 73 20 61 6e 20 6f 70 74 69 6f 6e  his is an option
07c0: 61 6c 20 66 65 61 74 75 72 65 2c 20 6e 6f 74 20  al feature, not 
07d0: 61 20 6d 61 6e 64 61 74 6f 72 79 20 72 65 71 75  a mandatory requ
07e0: 69 72 65 6d 65 6e 74 2e 3c 62 72 3e 0d 0a 57 68  irement.<br>..Wh
07f0: 61 74 20 69 73 20 61 62 73 6f 6c 75 74 65 6c 79  at is absolutely
0800: 20 6d 61 6e 64 61 74 6f 72 79 20 69 73 20 74 68   mandatory is th
0810: 61 74 20 65 61 63 68 20 3c 62 3e 4c 69 6e 6b 3c  at each <b>Link<
0820: 2f 62 3e 20 6d 75 73 74 20 65 78 70 6c 69 63 69  /b> must explici
0830: 74 6c 79 20 72 65 66 65 72 65 6e 63 65 20 69 74  tly reference it
0840: 73 20 3c 62 3e 4e 6f 64 65 73 3c 2f 62 3e 2e 3c  s <b>Nodes</b>.<
0850: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 41 20 4e 65 74 77  /li>..<li>A Netw
0860: 6f 72 6b 20 73 75 70 70 6f 72 74 69 6e 67 20 47  ork supporting G
0870: 65 6f 6d 65 74 72 69 65 73 20 69 73 20 61 20 3c  eometries is a <
0880: 62 3e 53 70 61 74 69 61 6c 20 4e 65 74 77 6f 72  b>Spatial Networ
0890: 6b 3c 2f 62 3e 3b 20 6f 74 68 65 72 77 69 73 65  k</b>; otherwise
08a0: 20 61 20 4e 65 74 77 6f 72 6b 20 6c 61 63 6b 69   a Network lacki
08b0: 6e 67 20 61 6e 79 20 67 65 6f 6d 65 74 72 79 20  ng any geometry 
08c0: 69 73 20 61 20 3c 62 3e 4c 6f 67 69 63 61 6c 20  is a <b>Logical 
08d0: 4e 65 74 77 6f 72 6b 3c 2f 62 3e 2e 3c 62 72 3e  Network</b>.<br>
08e0: 0d 0a 49 6e 20 61 20 3c 62 3e 53 70 61 74 69 61  ..In a <b>Spatia
08f0: 6c 20 4e 65 74 77 6f 72 6b 3c 2f 62 3e 20 61 6c  l Network</b> al
0900: 6c 20 4c 69 6e 6b 73 20 3c 62 3e 6d 75 73 74 3c  l Links <b>must<
0910: 2f 62 3e 20 68 61 76 65 20 61 20 63 6f 72 72 65  /b> have a corre
0920: 73 70 6f 6e 64 69 6e 67 20 47 65 6f 6d 65 74 72  sponding Geometr
0930: 79 2e 3c 62 72 3e 0d 0a 49 6e 20 61 20 3c 62 3e  y.<br>..In a <b>
0940: 4c 6f 67 69 63 61 6c 20 4e 65 74 77 6f 72 6b 3c  Logical Network<
0950: 2f 62 3e 20 61 6c 6c 20 4c 69 6e 6b 73 20 3c 62  /b> all Links <b
0960: 3e 61 72 65 20 73 74 72 69 63 74 6c 79 20 66 6f  >are strictly fo
0970: 72 62 69 64 64 65 6e 3c 2f 62 3e 20 74 6f 20 68  rbidden</b> to h
0980: 61 76 65 20 61 6e 79 20 67 65 6f 6d 65 74 72 79  ave any geometry
0990: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 49 6e 20 61  .</li>..<li>In a
09a0: 20 3c 62 3e 53 70 61 74 69 61 6c 20 4e 65 74 77   <b>Spatial Netw
09b0: 6f 72 6b 3c 2f 62 3e 20 62 6f 74 68 20 74 68 65  ork</b> both the
09c0: 20 3c 62 3e 53 74 61 72 74 50 6f 69 6e 74 3c 2f   <b>StartPoint</
09d0: 62 3e 20 61 6e 64 20 3c 62 3e 45 6e 64 50 6f 69  b> and <b>EndPoi
09e0: 6e 74 3c 2f 62 3e 20 6f 66 20 65 61 63 68 20 4c  nt</b> of each L
09f0: 69 6e 6b 27 73 20 3c 62 3e 4c 49 4e 45 53 54 49  ink's <b>LINESTI
0a00: 4e 47 3c 2f 62 3e 20 61 72 65 20 61 6c 77 61 79  NG</b> are alway
0a10: 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 65 78  s expected to ex
0a20: 61 63 74 6c 79 20 63 6f 69 6e 63 69 64 65 20 77  actly coincide w
0a30: 69 74 68 20 74 68 65 20 63 6f 72 72 65 73 70 6f  ith the correspo
0a40: 6e 64 69 6e 67 20 3c 62 3e 4e 6f 64 65 73 3c 2f  nding <b>Nodes</
0a50: 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 41 6c  b>.</li>..<li>Al
0a60: 6c 20 72 65 66 65 72 65 6e 63 65 73 20 74 6f 20  l references to 
0a70: 74 68 65 20 73 61 6d 65 20 3c 62 3e 4e 6f 64 65  the same <b>Node
0a80: 3c 2f 62 3e 20 62 79 20 64 69 66 66 65 72 65 6e  </b> by differen
0a90: 74 20 4c 69 6e 6b 73 20 3c 62 3e 6d 75 73 74 3c  t Links <b>must<
0aa0: 2f 62 3e 20 65 78 61 63 74 6c 79 20 63 6f 69 6e  /b> exactly coin
0ab0: 63 69 64 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c  cide.</li>..</ul
0ac0: 3e 0d 0a 66 61 76 61 20 0d 0a 0d 0a 3c 68 72 3e  >..fava ....<hr>
0ad0: 3c 62 72 3e 0d 0a 3c 61 20 68 72 65 66 3d 22 68  <br>..<a href="h
0ae0: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  ttps://www.gaia-
0af0: 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69  gis.it/fossil/li
0b00: 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69  bspatialite/wiki
0b10: 3f 6e 61 6d 65 3d 34 2e 33 2e 30 2d 64 6f 63 22  ?name=4.3.0-doc"
0b20: 3e 62 61 63 6b 3c 2f 61 0a 5a 20 65 30 38 62 36  >back</a.Z e08b6
0b30: 61 30 34 32 32 65 32 66 65 34 38 37 37 31 66 32  a0422e2fe48771f2
0b40: 64 37 36 66 35 65 38 39 64 38 62 0a              d76f5e89d8b.