Hex Artifact Content
Not logged in

Artifact afbc1e6a09974dd3ff30e02e4cd79b7680864626:

Wiki page [toponet-start] by sandro 2015-11-02 07:46:09.
0000: 44 20 32 30 31 35 2d 31 31 2d 30 32 54 30 37 3a  D 2015-11-02T07:
0010: 34 36 3a 30 39 2e 32 32 30 0a 4c 20 74 6f 70 6f  46:09.220.L topo
0020: 6e 65 74 2d 73 74 61 72 74 0a 50 20 33 30 35 64  net-start.P 305d
0030: 36 39 37 38 66 32 64 33 32 62 32 30 61 33 38 39  6978f2d32b20a389
0040: 61 37 36 32 35 37 65 66 38 35 31 34 39 37 62 63  a76257ef851497bc
0050: 66 39 61 36 0a 55 20 73 61 6e 64 72 6f 0a 57 20  f9a6.U sandro.W 
0060: 31 31 30 39 32 0a 3c 74 61 62 6c 65 20 63 65 6c  11092.<table cel
0070: 6c 73 70 61 63 69 6e 67 3d 22 31 32 22 20 77 69  lspacing="12" wi
0080: 64 74 68 3d 22 31 30 30 25 22 3e 0d 0a 3c 74 72  dth="100%">..<tr
0090: 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22  ><td colspan="2"
00a0: 3e 0d 0a 3c 74 61 62 6c 65 20 77 69 64 74 68 3d  >..<table width=
00b0: 22 31 30 30 25 22 20 62 67 63 6f 6c 6f 72 3d 22  "100%" bgcolor="
00c0: 23 66 30 66 30 66 38 22 3e 0d 0a 3c 74 72 3e 3c  #f0f0f8">..<tr><
00d0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72  td align="center
00e0: 22 3e 0d 0a 3c 68 31 3e 46 61 6d 69 6c 69 61 72  ">..<h1>Familiar
00f0: 69 7a 69 6e 67 20 77 69 74 68 20 54 6f 70 6f 6c  izing with Topol
0100: 6f 67 79 2d 4e 65 74 77 6f 72 6b 3a 20 61 6e 20  ogy-Network: an 
0110: 65 6c 65 6d 65 6e 74 61 72 79 20 74 75 74 6f 72  elementary tutor
0120: 69 61 6c 3c 2f 68 31 3e 0d 0a 3c 2f 74 64 3e 3c  ial</h1>..</td><
0130: 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 74  /tr></table>..<t
0140: 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25  able width="100%
0150: 22 3e 3c 74 72 3e 0d 0a 3c 74 64 20 77 69 64 74  "><tr>..<td widt
0160: 68 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 6c  h="33%" align="l
0170: 65 66 74 22 3e 3c 61 20 68 72 65 66 3d 22 68 74  eft"><a href="ht
0180: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67  tps://www.gaia-g
0190: 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62  is.it/fossil/lib
01a0: 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f  spatialite/wiki?
01b0: 6e 61 6d 65 3d 74 6f 70 6f 2d 73 74 61 72 74 22  name=topo-start"
01c0: 3e 70 72 65 76 69 6f 75 73 20 70 61 67 65 3c 2f  >previous page</
01d0: 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 61 6c 69  a></td>..<td ali
01e0: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 61 20 68  gn="center"><a h
01f0: 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77  ref="https://www
0200: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73  .gaia-gis.it/fos
0210: 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74  sil/libspatialit
0220: 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 6d 69 73 63  e/wiki?name=misc
0230: 2d 64 6f 63 73 22 3e 62 61 63 6b 20 74 6f 20 69  -docs">back to i
0240: 6e 64 65 78 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c  ndex</a></td>..<
0250: 74 64 20 77 69 64 74 68 3d 22 33 33 25 22 20 61  td width="33%" a
0260: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 3c 61 20  lign="right"><a 
0270: 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77  href="https://ww
0280: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f  w.gaia-gis.it/fo
0290: 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69  ssil/libspatiali
02a0: 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 74 6f 70  te/wiki?name=top
02b0: 6f 2d 69 6e 74 65 72 6d 65 64 69 61 74 65 22 3e  o-intermediate">
02c0: 6e 65 78 74 20 70 61 67 65 3c 2f 61 3e 3c 2f 74  next page</a></t
02d0: 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65  d>..</tr></table
02e0: 3e 0d 0a 3c 68 33 3e 54 75 74 6f 72 69 61 6c 20  >..<h3>Tutorial 
02f0: 23 32 3a 20 6e 65 74 77 6f 72 6b 20 65 64 69 74  #2: network edit
0300: 69 6e 67 20 62 79 20 75 73 69 6e 67 20 62 61 73  ing by using bas
0310: 69 63 20 49 53 4f 20 53 51 4c 20 66 75 6e 63 74  ic ISO SQL funct
0320: 69 6f 6e 3c 2f 68 33 3e 0d 0a 49 6e 20 74 68 69  ion</h3>..In thi
0330: 73 20 74 75 74 6f 72 69 61 6c 20 77 69 6c 6c 20  s tutorial will 
0340: 71 75 69 63 6b 6c 79 20 65 78 70 6c 6f 72 65 20  quickly explore 
0350: 74 68 65 20 49 53 4f 20 53 51 4c 2f 4d 4d 20 6d  the ISO SQL/MM m
0360: 61 69 6e 20 63 6f 72 65 20 73 75 70 70 6f 72 74  ain core support
0370: 69 6e 67 20 54 6f 70 6f 6c 6f 67 79 2d 4e 65 74  ing Topology-Net
0380: 77 6f 72 6b 20 28 6e 61 6d 65 6c 79 3a 20 53 70  work (namely: Sp
0390: 61 74 69 61 6c 20 4e 65 74 77 6f 72 6b 29 2e 3c  atial Network).<
03a0: 62 72 3e 0d 0a 57 65 27 6c 6c 20 75 73 65 20 76  br>..We'll use v
03b0: 65 72 79 20 73 69 6d 70 6c 65 20 67 65 6f 6d 65  ery simple geome
03c0: 74 72 69 65 73 20 28 73 74 72 61 69 67 68 74 20  tries (straight 
03d0: 73 65 67 6d 65 6e 74 73 29 20 73 6f 20 74 6f 20  segments) so to 
03e0: 61 76 6f 69 64 20 61 6e 79 20 70 6f 73 73 69 62  avoid any possib
03f0: 6c 65 20 63 6f 6d 70 6c 65 78 69 74 79 20 74 68  le complexity th
0400: 75 73 20 6d 61 6b 69 6e 67 20 62 61 73 69 63 61  us making basica
0410: 6c 6c 79 20 73 69 6d 70 6c 65 20 66 6f 6c 6c 6f  lly simple follo
0420: 77 69 6e 67 20 61 6e 64 20 75 6e 64 65 72 73 74  wing and underst
0430: 61 6e 64 69 6e 67 20 61 6e 79 20 73 74 65 70 2e  anding any step.
0440: 3c 62 72 3e 0d 0a 59 6f 75 20 63 61 6e 20 69 6e  <br>..You can in
0450: 64 69 66 66 65 72 65 6e 74 6c 79 20 75 73 65 20  differently use 
0460: 3c 62 3e 73 70 61 74 69 61 6c 69 74 65 20 43 4c  <b>spatialite CL
0470: 49 3c 2f 62 3e 20 6f 72 20 3c 62 3e 73 70 61 74  I</b> or <b>spat
0480: 69 61 6c 69 74 65 5f 67 75 69 3c 2f 62 3e 20 69  ialite_gui</b> i
0490: 6e 20 6f 72 64 65 72 20 74 6f 20 74 65 73 74 20  n order to test 
04a0: 65 61 63 68 20 53 51 4c 20 73 74 61 74 65 6d 65  each SQL stateme
04b0: 6e 74 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61  nt.<br><br>..<ta
04c0: 62 6c 65 20 62 67 63 6f 6c 6f 72 3d 22 23 66 66  ble bgcolor="#ff
04d0: 66 66 65 30 22 20 63 65 6c 6c 73 70 61 63 69 6e  ffe0" cellspacin
04e0: 67 3d 22 38 22 20 63 65 6c 6c 70 61 64 64 69 6e  g="8" cellpaddin
04f0: 67 3d 22 38 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20  g="8">..<tr><td 
0500: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c  align="center"><
0510: 62 3e 43 41 56 45 41 54 3c 2f 62 3e 3c 2f 74 64  b>CAVEAT</b></td
0520: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e  ></tr>..<tr><td>
0530: 0d 0a 41 6e 79 20 64 69 72 65 63 74 20 6d 61 6e  ..Any direct man
0540: 69 70 75 6c 61 74 69 6f 6e 20 6f 66 20 74 68 65  ipulation of the
0550: 20 6c 6f 77 2d 6c 65 76 65 6c 20 44 42 20 74 61   low-level DB ta
0560: 62 6c 65 73 20 69 6d 70 6c 65 6d 65 6e 74 69 6e  bles implementin
0570: 67 20 61 6e 20 49 53 4f 20 4e 65 74 77 6f 72 6b  g an ISO Network
0580: 20 77 69 6c 6c 20 61 6c 6d 6f 73 74 20 63 65 72   will almost cer
0590: 74 61 69 6e 6c 79 20 63 61 75 73 65 20 61 20 6d  tainly cause a m
05a0: 61 6a 6f 72 20 64 69 73 61 73 74 65 72 2e 3c 62  ajor disaster.<b
05b0: 72 3e 0d 0a 59 6f 75 20 61 72 65 20 6e 65 76 65  r>..You are neve
05c0: 72 20 65 78 70 65 63 74 65 64 20 74 6f 20 65 78  r expected to ex
05d0: 65 63 75 74 65 20 61 6e 79 20 3c 62 3e 49 4e 53  ecute any <b>INS
05e0: 45 52 54 3c 2f 62 3e 2c 20 3c 62 3e 55 50 44 41  ERT</b>, <b>UPDA
05f0: 54 45 3c 2f 62 3e 20 6f 72 20 3c 62 3e 44 45 4c  TE</b> or <b>DEL
0600: 45 54 45 3c 2f 62 3e 20 73 74 61 74 65 6d 65 6e  ETE</b> statemen
0610: 74 20 6f 6e 20 62 65 68 61 6c 66 20 6f 66 20 73  t on behalf of s
0620: 75 63 68 20 74 61 62 6c 65 73 2e 3c 62 72 3e 0d  uch tables.<br>.
0630: 0a 59 6f 75 20 61 6c 77 61 79 73 20 68 61 76 65  .You always have
0640: 20 74 6f 20 63 61 6c 6c 20 74 68 65 20 61 70 70   to call the app
0650: 72 6f 70 72 69 61 74 65 20 49 53 4f 20 53 51 4c  ropriate ISO SQL
0660: 20 66 75 6e 63 74 69 6f 6e 73 20 66 6f 72 20 61   functions for a
0670: 6e 79 20 6f 70 65 72 61 74 69 6f 6e 20 74 61 72  ny operation tar
0680: 67 65 74 69 6e 67 20 61 20 54 6f 70 6f 6c 6f 67  geting a Topolog
0690: 79 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 70 72  y in order to pr
06a0: 65 73 65 72 76 65 20 61 20 70 72 6f 70 65 72 20  eserve a proper 
06b0: 63 6f 6e 73 69 73 74 65 6e 63 79 2e 0d 0a 3c 2f  consistency...</
06c0: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74  td></tr>..<tr><t
06d0: 64 3e 0d 0a 49 66 20 79 6f 75 20 61 72 65 20 73  d>..If you are s
06e0: 74 72 6f 6e 67 6c 79 20 69 6e 74 65 72 65 73 74  trongly interest
06f0: 65 64 20 69 6e 20 62 65 74 74 65 72 20 75 6e 64  ed in better und
0700: 65 72 73 74 61 6e 64 69 6e 67 20 6d 61 6e 79 20  erstanding many 
0710: 69 6e 74 65 72 6e 61 6c 20 69 6d 70 6c 65 6d 65  internal impleme
0720: 6e 74 61 74 69 6f 6e 20 6d 65 63 68 61 6e 69 73  ntation mechanis
0730: 6d 73 20 79 6f 75 20 63 6f 75 6c 64 20 65 76 65  ms you could eve
0740: 6e 74 75 61 6c 6c 79 20 69 6e 73 70 65 63 74 20  ntually inspect 
0750: 66 72 6f 6d 20 74 69 6d 65 20 74 6f 20 74 69 6d  from time to tim
0760: 65 20 74 68 65 20 63 6f 6e 74 65 6e 74 20 6f 66  e the content of
0770: 20 74 68 65 20 70 68 79 73 69 63 61 6c 20 44 42   the physical DB
0780: 20 74 61 62 6c 65 73 20 73 75 70 70 6f 72 74 69   tables supporti
0790: 6e 67 20 74 68 65 20 74 65 73 74 20 54 6f 70 6f  ng the test Topo
07a0: 6c 6f 67 79 3a 0d 0a 3c 76 65 72 62 61 74 69 6d  logy:..<verbatim
07b0: 3e 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d  >..SELECT * FROM
07c0: 20 74 65 73 74 6e 65 74 5f 6e 6f 64 65 3b 0d 0a   testnet_node;..
07d0: 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20  ..SELECT * FROM 
07e0: 74 65 73 74 6e 65 74 5f 6c 69 6e 6b 3b 0d 0a 3c  testnet_link;..<
07f0: 2f 76 65 72 62 61 74 69 6d 3e 3c 2f 74 64 3e 3c  /verbatim></td><
0800: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 75  /tr>..<tr><td><u
0810: 3e 50 6c 65 61 73 65 20 6e 6f 74 65 3c 2f 75 3e  >Please note</u>
0820: 3a 20 74 68 65 20 61 63 74 75 61 6c 20 6c 61 79  : the actual lay
0830: 6f 75 74 20 61 64 6f 70 74 65 64 20 62 79 20 74  out adopted by t
0840: 68 65 73 65 20 6c 6f 77 2d 6c 65 76 65 6c 20 44  hese low-level D
0850: 42 20 74 61 62 6c 65 73 20 63 6f 75 6c 64 20 65  B tables could e
0860: 76 65 6e 74 75 61 6c 6c 79 20 63 68 61 6e 67 65  ventually change
0870: 20 69 6e 20 66 75 74 75 72 65 20 76 65 72 73 69   in future versi
0880: 6f 6e 73 2e 3c 62 72 3e 0d 0a 41 73 20 61 20 67  ons.<br>..As a g
0890: 65 6e 65 72 61 6c 20 70 72 69 6e 63 69 70 6c 65  eneral principle
08a0: 20 61 6e 79 20 64 69 72 65 63 74 20 69 6e 74 65   any direct inte
08b0: 72 61 63 74 69 6f 6e 20 77 69 74 68 20 74 68 65  raction with the
08c0: 20 6c 6f 77 2d 6c 65 76 65 6c 20 44 42 20 74 61   low-level DB ta
08d0: 62 6c 65 73 20 73 68 6f 75 6c 64 20 62 65 20 61  bles should be a
08e0: 6c 77 61 79 73 20 63 61 72 65 66 75 6c 6c 79 20  lways carefully 
08f0: 61 76 6f 69 64 65 64 20 65 76 65 6e 20 66 6f 72  avoided even for
0900: 20 3c 62 3e 53 45 4c 45 43 54 3c 2f 62 3e 20 71   <b>SELECT</b> q
0910: 75 65 72 69 65 73 20 28 75 73 65 20 69 6e 73 74  ueries (use inst
0920: 65 61 64 20 74 68 65 20 61 70 70 72 6f 70 72 69  ead the appropri
0930: 61 74 65 20 49 53 4f 20 53 51 4c 20 66 75 6e 63  ate ISO SQL func
0940: 74 69 6f 6e 73 29 2e 3c 62 72 3e 0d 0a 41 6e 79  tions).<br>..Any
0950: 77 61 79 2c 20 61 74 20 6c 65 61 73 74 20 66 6f  way, at least fo
0960: 72 20 64 69 64 61 63 74 69 63 20 2f 20 64 65 62  r didactic / deb
0970: 75 67 67 69 6e 67 20 70 75 72 70 6f 73 65 73 2c  ugging purposes,
0980: 20 65 78 65 63 75 74 69 6e 67 20 73 6f 6d 65 20   executing some 
0990: 53 45 4c 45 43 54 20 73 74 61 74 65 6d 65 6e 74  SELECT statement
09a0: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 69 6e 73   in order to ins
09b0: 70 65 63 74 20 74 68 65 20 61 63 74 75 61 6c 20  pect the actual 
09c0: 63 6f 6e 74 65 6e 74 73 20 6f 66 20 74 68 65 73  contents of thes
09d0: 65 20 74 61 62 6c 65 73 20 69 73 20 61 6e 20 61  e tables is an a
09e0: 62 73 6f 6c 75 74 65 6c 79 20 68 61 72 6d 6c 65  bsolutely harmle
09f0: 73 73 20 6f 70 65 72 61 74 69 6f 6e 2e 0d 0a 3c  ss operation...<
0a00: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62  /td></tr>..</tab
0a10: 6c 65 3e 3c 62 72 3e 3c 62 72 3e 3c 68 72 3e 0d  le><br><br><hr>.
0a20: 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 63  .<table cellspac
0a30: 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 64  ing="4" cellpadd
0a40: 69 6e 67 3d 22 36 22 3e 0d 0a 3c 74 72 3e 3c 74  ing="6">..<tr><t
0a50: 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 0d 0a  d>..<ul>..<li>..
0a60: 57 65 27 6c 6c 20 73 74 61 72 74 20 62 79 20 63  We'll start by c
0a70: 72 65 61 74 69 6e 67 20 61 20 62 72 61 6e 64 20  reating a brand 
0a80: 6e 65 77 20 49 53 4f 20 54 6f 70 6f 6c 6f 67 79  new ISO Topology
0a90: 2d 4e 65 74 77 6f 72 6b 20 28 6f 66 20 74 68 65  -Network (of the
0aa0: 20 53 70 61 74 69 61 6c 20 74 79 70 65 29 20 6e   Spatial type) n
0ab0: 61 6d 65 64 20 3c 62 3e 74 65 73 74 6e 65 74 3c  amed <b>testnet<
0ac0: 2f 62 3e 3b 20 61 6c 6c 20 6e 65 74 77 6f 72 6b  /b>; all network
0ad0: 20 67 65 6f 6d 65 74 72 69 65 73 20 61 72 65 20   geometries are 
0ae0: 65 78 70 65 63 74 65 64 20 74 6f 20 62 65 20 6c  expected to be l
0af0: 6f 63 61 74 65 64 20 6f 6e 20 3c 62 3e 53 52 49  ocated on <b>SRI
0b00: 44 3d 34 33 32 36 3c 2f 62 3e 20 28 61 6b 61 20  D=4326</b> (aka 
0b10: 3c 69 3e 57 47 53 38 34 20 6c 6f 6e 67 2f 6c 61  <i>WGS84 long/la
0b20: 74 3c 2f 69 3e 29 20 61 6e 64 20 77 69 6c 6c 20  t</i>) and will 
0b30: 68 61 76 65 20 3c 62 3e 32 44 20 58 59 3c 2f 62  have <b>2D XY</b
0b40: 3e 20 64 69 6d 65 6e 73 69 6f 6e 73 3a 0d 0a 3c  > dimensions:..<
0b50: 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43  verbatim>..SELEC
0b60: 54 20 43 72 65 61 74 65 4e 65 74 77 6f 72 6b 28  T CreateNetwork(
0b70: 27 74 65 73 74 6e 65 74 27 2c 20 31 2c 20 34 33  'testnet', 1, 43
0b80: 32 36 2c 20 30 2c 20 30 29 3b 0d 0a 3c 2f 76 65  26, 0, 0);..</ve
0b90: 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a  rbatim>..</li>..
0ba0: 3c 6c 69 3e 0d 0a 4e 6f 77 20 77 65 27 6c 6c 20  <li>..Now we'll 
0bb0: 69 6e 73 65 72 74 20 61 20 62 75 6e 63 68 20 6f  insert a bunch o
0bc0: 66 20 49 73 6f 6c 61 74 65 64 20 4e 6f 64 65 73  f Isolated Nodes
0bd0: 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53  :..<verbatim>..S
0be0: 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e  ELECT ST_AddIsoN
0bf0: 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27  etNode('testnet'
0c00: 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 31 38 30  , MakePoint(-180
0c10: 2c 20 39 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53  , 90, 4326));..S
0c20: 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e  ELECT ST_AddIsoN
0c30: 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27  etNode('testnet'
0c40: 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 31 38 30  , MakePoint(-180
0c50: 2c 20 36 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53  , 60, 4326));..S
0c60: 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e  ELECT ST_AddIsoN
0c70: 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27  etNode('testnet'
0c80: 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 31 38 30  , MakePoint(-180
0c90: 2c 20 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45  , 0, 4326));..SE
0ca0: 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e 65  LECT ST_AddIsoNe
0cb0: 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27 2c  tNode('testnet',
0cc0: 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 31 38 30 2c   MakePoint(-180,
0cd0: 20 2d 33 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53   -30, 4326));..S
0ce0: 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e  ELECT ST_AddIsoN
0cf0: 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27  etNode('testnet'
0d00: 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 31 38 30  , MakePoint(-180
0d10: 2c 20 2d 36 30 2c 20 34 33 32 36 29 29 3b 0d 0a  , -60, 4326));..
0d20: 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f  SELECT ST_AddIso
0d30: 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74  NetNode('testnet
0d40: 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 31 38  ', MakePoint(-18
0d50: 30 2c 20 2d 39 30 2c 20 34 33 32 36 29 29 3b 0d  0, -90, 4326));.
0d60: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73  .SELECT ST_AddIs
0d70: 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65  oNetNode('testne
0d80: 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 39  t', MakePoint(-9
0d90: 30 2c 20 39 30 2c 20 34 33 32 36 29 29 3b 0d 0a  0, 90, 4326));..
0da0: 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f  SELECT ST_AddIso
0db0: 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74  NetNode('testnet
0dc0: 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 39 30  ', MakePoint(-90
0dd0: 2c 20 33 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53  , 30, 4326));..S
0de0: 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e  ELECT ST_AddIsoN
0df0: 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27  etNode('testnet'
0e00: 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 39 30 2c  , MakePoint(-90,
0e10: 20 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c   0, 4326));..SEL
0e20: 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e 65 74  ECT ST_AddIsoNet
0e30: 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27 2c 20  Node('testnet', 
0e40: 4d 61 6b 65 50 6f 69 6e 74 28 2d 39 30 2c 20 2d  MakePoint(-90, -
0e50: 33 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c  30, 4326));..SEL
0e60: 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e 65 74  ECT ST_AddIsoNet
0e70: 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27 2c 20  Node('testnet', 
0e80: 4d 61 6b 65 50 6f 69 6e 74 28 2d 39 30 2c 20 2d  MakePoint(-90, -
0e90: 36 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c  60, 4326));..SEL
0ea0: 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e 65 74  ECT ST_AddIsoNet
0eb0: 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27 2c 20  Node('testnet', 
0ec0: 4d 61 6b 65 50 6f 69 6e 74 28 2d 39 30 2c 20 2d  MakePoint(-90, -
0ed0: 39 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c  90, 4326));..SEL
0ee0: 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e 65 74  ECT ST_AddIsoNet
0ef0: 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27 2c 20  Node('testnet', 
0f00: 4d 61 6b 65 50 6f 69 6e 74 28 33 30 2c 20 30 2c  MakePoint(30, 0,
0f10: 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54   4326));..SELECT
0f20: 20 53 54 5f 41 64 64 49 73 6f 4e 65 74 4e 6f 64   ST_AddIsoNetNod
0f30: 65 28 27 74 65 73 74 6e 65 74 27 2c 20 4d 61 6b  e('testnet', Mak
0f40: 65 50 6f 69 6e 74 28 30 2c 20 30 2c 20 34 33 32  ePoint(0, 0, 432
0f50: 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f  6));..SELECT ST_
0f60: 41 64 64 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74  AddIsoNetNode('t
0f70: 65 73 74 6e 65 74 27 2c 20 4d 61 6b 65 50 6f 69  estnet', MakePoi
0f80: 6e 74 28 2d 33 30 2c 20 30 2c 20 34 33 32 36 29  nt(-30, 0, 4326)
0f90: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
0fa0: 64 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73  dIsoNetNode('tes
0fb0: 74 6e 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74  tnet', MakePoint
0fc0: 28 33 30 2c 20 39 30 2c 20 34 33 32 36 29 29 3b  (30, 90, 4326));
0fd0: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49  ..SELECT ST_AddI
0fe0: 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e  soNetNode('testn
0ff0: 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 33  et', MakePoint(3
1000: 30 2c 20 33 30 2c 20 34 33 32 36 29 29 3b 0d 0a  0, 30, 4326));..
1010: 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f  SELECT ST_AddIso
1020: 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74  NetNode('testnet
1030: 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 31 38 30  ', MakePoint(180
1040: 2c 20 39 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53  , 90, 4326));..S
1050: 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e  ELECT ST_AddIsoN
1060: 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27  etNode('testnet'
1070: 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 31 38 30 2c  , MakePoint(180,
1080: 20 33 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45   30, 4326));..SE
1090: 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e 65  LECT ST_AddIsoNe
10a0: 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27 2c  tNode('testnet',
10b0: 20 4d 61 6b 65 50 6f 69 6e 74 28 31 38 30 2c 20   MakePoint(180, 
10c0: 30 2c 20 34 33 32 36 29 29 3b 0d 0a 3c 2f 76 65  0, 4326));..</ve
10d0: 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e 3c 2f  rbatim>..</li></
10e0: 75 6c 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 3c 69  ul></td>..<td><i
10f0: 6d 67 20 73 72 63 3d 22 68 74 74 70 3a 2f 2f 77  mg src="http://w
1100: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67  ww.gaia-gis.it/g
1110: 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67  aia-sins/topofig
1120: 73 2f 6e 65 74 2d 31 2e 70 6e 67 22 20 61 6c 74  s/net-1.png" alt
1130: 3d 22 6e 65 74 2d 65 78 61 6d 70 6c 65 2d 31 22  ="net-example-1"
1140: 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  ></td></tr>..<tr
1150: 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22  ><td colspan="2"
1160: 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  ><hr></td></tr>.
1170: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d  .<tr><td>..<ul>.
1180: 0a 3c 6c 69 3e 0d 0a 54 68 65 6e 20 77 65 27 6c  .<li>..Then we'l
1190: 6c 20 69 6e 73 65 72 74 20 61 20 62 75 6e 63 68  l insert a bunch
11a0: 20 6f 66 20 4c 69 6e 6b 73 3a 0d 0a 3c 76 65 72   of Links:..<ver
11b0: 62 61 74 69 6d 3e 53 45 4c 45 43 54 20 53 54 5f  batim>SELECT ST_
11c0: 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74  AddLink('testnet
11d0: 27 2c 20 31 2c 20 32 2c 20 0d 0a 20 20 20 20 53  ', 1, 2, ..    S
11e0: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
11f0: 4c 49 4e 45 53 54 52 49 4e 47 28 2d 31 38 30 20  LINESTRING(-180 
1200: 39 30 2c 20 2d 31 38 30 20 36 30 29 27 2c 20 34  90, -180 60)', 4
1210: 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53  326));..SELECT S
1220: 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e  T_AddLink('testn
1230: 65 74 27 2c 20 33 2c 20 34 2c 20 0d 0a 20 20 20  et', 3, 4, ..   
1240: 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74   ST_GeomFromText
1250: 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 31 38  ('LINESTRING(-18
1260: 30 20 30 2c 20 2d 31 38 30 20 2d 33 30 29 27 2c  0 0, -180 -30)',
1270: 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54   4326));..SELECT
1280: 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73   ST_AddLink('tes
1290: 74 6e 65 74 27 2c 20 34 2c 20 35 2c 20 0d 0a 20  tnet', 4, 5, .. 
12a0: 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65     ST_GeomFromTe
12b0: 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d  xt('LINESTRING(-
12c0: 31 38 30 20 2d 33 30 2c 20 2d 31 38 30 20 2d 36  180 -30, -180 -6
12d0: 30 29 27 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45  0)', 4326));..SE
12e0: 4c 45 43 54 20 53 54 5f 41 64 64 4c 69 6e 6b 28  LECT ST_AddLink(
12f0: 27 74 65 73 74 6e 65 74 27 2c 20 35 2c 20 36 2c  'testnet', 5, 6,
1300: 20 0d 0a 20 20 20 20 53 54 5f 47 65 6f 6d 46 72   ..    ST_GeomFr
1310: 6f 6d 54 65 78 74 28 27 4c 49 4e 45 53 54 52 49  omText('LINESTRI
1320: 4e 47 28 2d 31 38 30 20 2d 36 30 2c 20 2d 31 38  NG(-180 -60, -18
1330: 30 20 2d 39 30 29 27 2c 20 34 33 32 36 29 29 3b  0 -90)', 4326));
1340: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c  ..SELECT ST_AddL
1350: 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31  ink('testnet', 1
1360: 2c 20 37 2c 20 0d 0a 20 20 20 20 53 54 5f 47 65  , 7, ..    ST_Ge
1370: 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e 45  omFromText('LINE
1380: 53 54 52 49 4e 47 28 2d 31 38 30 20 39 30 2c 20  STRING(-180 90, 
1390: 2d 39 30 20 39 30 29 27 2c 20 34 33 32 36 29 29  -90 90)', 4326))
13a0: 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64  ;..SELECT ST_Add
13b0: 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20  Link('testnet', 
13c0: 32 2c 20 38 2c 20 0d 0a 20 20 20 20 53 54 5f 47  2, 8, ..    ST_G
13d0: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
13e0: 45 53 54 52 49 4e 47 28 2d 31 38 30 20 36 30 2c  ESTRING(-180 60,
13f0: 20 2d 39 30 20 33 30 29 27 2c 20 34 33 32 36 29   -90 30)', 4326)
1400: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
1410: 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c  dLink('testnet',
1420: 20 33 2c 20 39 2c 20 0d 0a 20 20 20 20 53 54 5f   3, 9, ..    ST_
1430: 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49  GeomFromText('LI
1440: 4e 45 53 54 52 49 4e 47 28 2d 31 38 30 20 30 2c  NESTRING(-180 0,
1450: 20 2d 39 30 20 30 29 27 2c 20 34 33 32 36 29 29   -90 0)', 4326))
1460: 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64  ;..SELECT ST_Add
1470: 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20  Link('testnet', 
1480: 36 2c 20 31 32 2c 20 0d 0a 20 20 20 20 53 54 5f  6, 12, ..    ST_
1490: 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49  GeomFromText('LI
14a0: 4e 45 53 54 52 49 4e 47 28 2d 31 38 30 20 2d 39  NESTRING(-180 -9
14b0: 30 2c 20 2d 39 30 20 2d 39 30 29 27 2c 20 34 33  0, -90 -90)', 43
14c0: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
14d0: 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65  _AddLink('testne
14e0: 74 27 2c 20 37 2c 20 38 2c 20 0d 0a 20 20 20 20  t', 7, 8, ..    
14f0: 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28  ST_GeomFromText(
1500: 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 39 30 20  'LINESTRING(-90 
1510: 39 30 2c 20 2d 39 30 20 33 30 29 27 2c 20 34 33  90, -90 30)', 43
1520: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
1530: 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65  _AddLink('testne
1540: 74 27 2c 20 38 2c 20 39 2c 20 0d 0a 20 20 20 20  t', 8, 9, ..    
1550: 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28  ST_GeomFromText(
1560: 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 39 30 20  'LINESTRING(-90 
1570: 33 30 2c 20 2d 39 30 20 30 29 27 2c 20 34 33 32  30, -90 0)', 432
1580: 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f  6));..SELECT ST_
1590: 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74  AddLink('testnet
15a0: 27 2c 20 39 2c 20 31 30 2c 20 0d 0a 20 20 20 20  ', 9, 10, ..    
15b0: 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28  ST_GeomFromText(
15c0: 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 39 30 20  'LINESTRING(-90 
15d0: 30 2c 20 2d 39 30 20 2d 33 30 29 27 2c 20 34 33  0, -90 -30)', 43
15e0: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
15f0: 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65  _AddLink('testne
1600: 74 27 2c 20 31 30 2c 20 31 31 2c 20 0d 0a 20 20  t', 10, 11, ..  
1610: 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78    ST_GeomFromTex
1620: 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 39  t('LINESTRING(-9
1630: 30 20 2d 33 30 2c 20 2d 39 30 20 2d 36 30 29 27  0 -30, -90 -60)'
1640: 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43  , 4326));..SELEC
1650: 54 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65  T ST_AddLink('te
1660: 73 74 6e 65 74 27 2c 20 31 31 2c 20 31 32 2c 20  stnet', 11, 12, 
1670: 0d 0a 20 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f  ..    ST_GeomFro
1680: 6d 54 65 78 74 28 27 4c 49 4e 45 53 54 52 49 4e  mText('LINESTRIN
1690: 47 28 2d 39 30 20 2d 36 30 2c 20 2d 39 30 20 2d  G(-90 -60, -90 -
16a0: 39 30 29 27 2c 20 34 33 32 36 29 29 3b 0d 0a 53  90)', 4326));..S
16b0: 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69 6e 6b  ELECT ST_AddLink
16c0: 28 27 74 65 73 74 6e 65 74 27 2c 20 34 2c 20 31  ('testnet', 4, 1
16d0: 31 2c 20 0d 0a 20 20 20 20 53 54 5f 47 65 6f 6d  1, ..    ST_Geom
16e0: 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e 45 53 54  FromText('LINEST
16f0: 52 49 4e 47 28 2d 31 38 30 20 2d 33 30 2c 20 2d  RING(-180 -30, -
1700: 39 30 20 2d 36 30 29 27 2c 20 34 33 32 36 29 29  90 -60)', 4326))
1710: 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64  ;..SELECT ST_Add
1720: 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20  Link('testnet', 
1730: 35 2c 20 31 32 2c 20 0d 0a 20 20 20 20 53 54 5f  5, 12, ..    ST_
1740: 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49  GeomFromText('LI
1750: 4e 45 53 54 52 49 4e 47 28 2d 31 38 30 20 2d 36  NESTRING(-180 -6
1760: 30 2c 20 2d 39 30 20 2d 39 30 29 27 2c 20 34 33  0, -90 -90)', 43
1770: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
1780: 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65  _AddLink('testne
1790: 74 27 2c 20 39 2c 20 31 35 2c 20 0d 0a 20 20 20  t', 9, 15, ..   
17a0: 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74   ST_GeomFromText
17b0: 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 39 30  ('LINESTRING(-90
17c0: 20 30 2c 20 2d 33 30 20 30 29 27 2c 20 34 33 32   0, -30 0)', 432
17d0: 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f  6));..SELECT ST_
17e0: 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74  AddLink('testnet
17f0: 27 2c 20 31 35 2c 20 31 34 2c 20 0d 0a 20 20 20  ', 15, 14, ..   
1800: 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74   ST_GeomFromText
1810: 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 33 30  ('LINESTRING(-30
1820: 20 30 2c 20 30 20 30 29 27 2c 20 34 33 32 36 29   0, 0 0)', 4326)
1830: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
1840: 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c  dLink('testnet',
1850: 20 31 34 2c 20 31 33 2c 20 0d 0a 20 20 20 20 53   14, 13, ..    S
1860: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
1870: 4c 49 4e 45 53 54 52 49 4e 47 28 30 20 30 2c 20  LINESTRING(0 0, 
1880: 33 30 20 30 29 27 2c 20 34 33 32 36 29 29 3b 0d  30 0)', 4326));.
1890: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69  .SELECT ST_AddLi
18a0: 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31 33  nk('testnet', 13
18b0: 2c 20 32 30 2c 20 0d 0a 20 20 20 20 53 54 5f 47  , 20, ..    ST_G
18c0: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
18d0: 45 53 54 52 49 4e 47 28 33 30 20 30 2c 20 31 38  ESTRING(30 0, 18
18e0: 30 20 30 29 27 2c 20 34 33 32 36 29 29 3b 0d 0a  0 0)', 4326));..
18f0: 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69 6e  SELECT ST_AddLin
1900: 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31 37 2c  k('testnet', 17,
1910: 20 31 39 2c 20 0d 0a 20 20 20 20 53 54 5f 47 65   19, ..    ST_Ge
1920: 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e 45  omFromText('LINE
1930: 53 54 52 49 4e 47 28 33 30 20 33 30 2c 20 31 38  STRING(30 30, 18
1940: 30 20 33 30 29 27 2c 20 34 33 32 36 29 29 3b 0d  0 30)', 4326));.
1950: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69  .SELECT ST_AddLi
1960: 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31 34  nk('testnet', 14
1970: 2c 20 31 37 2c 20 0d 0a 20 20 20 20 53 54 5f 47  , 17, ..    ST_G
1980: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
1990: 45 53 54 52 49 4e 47 28 30 20 30 2c 20 33 30 20  ESTRING(0 0, 30 
19a0: 33 30 29 27 2c 20 34 33 32 36 29 29 3b 0d 0a 53  30)', 4326));..S
19b0: 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69 6e 6b  ELECT ST_AddLink
19c0: 28 27 74 65 73 74 6e 65 74 27 2c 20 31 30 2c 20  ('testnet', 10, 
19d0: 31 35 2c 20 0d 0a 20 20 20 20 53 54 5f 47 65 6f  15, ..    ST_Geo
19e0: 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e 45 53  mFromText('LINES
19f0: 54 52 49 4e 47 28 2d 39 30 20 2d 33 30 2c 20 2d  TRING(-90 -30, -
1a00: 33 30 20 30 29 27 2c 20 34 33 32 36 29 29 3b 0d  30 0)', 4326));.
1a10: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69  .SELECT ST_AddLi
1a20: 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31 32  nk('testnet', 12
1a30: 2c 20 31 34 2c 20 0d 0a 20 20 20 20 53 54 5f 47  , 14, ..    ST_G
1a40: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
1a50: 45 53 54 52 49 4e 47 28 2d 39 30 20 2d 39 30 2c  ESTRING(-90 -90,
1a60: 20 30 20 30 29 27 2c 20 34 33 32 36 29 29 3b 0d   0 0)', 4326));.
1a70: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69  .SELECT ST_AddLi
1a80: 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31 36  nk('testnet', 16
1a90: 2c 20 31 37 2c 20 0d 0a 20 20 20 20 53 54 5f 47  , 17, ..    ST_G
1aa0: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
1ab0: 45 53 54 52 49 4e 47 28 33 30 20 39 30 2c 20 33  ESTRING(30 90, 3
1ac0: 30 20 33 30 29 27 2c 20 34 33 32 36 29 29 3b 0d  0 30)', 4326));.
1ad0: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69  .SELECT ST_AddLi
1ae0: 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31 36  nk('testnet', 16
1af0: 2c 20 31 38 2c 20 0d 0a 20 20 20 20 53 54 5f 47  , 18, ..    ST_G
1b00: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
1b10: 45 53 54 52 49 4e 47 28 33 30 20 39 30 2c 20 31  ESTRING(30 90, 1
1b20: 38 30 20 39 30 29 27 2c 20 34 33 32 36 29 29 3b  80 90)', 4326));
1b30: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c  ..SELECT ST_AddL
1b40: 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31  ink('testnet', 1
1b50: 39 2c 20 31 38 2c 20 0d 0a 20 20 20 20 53 54 5f  9, 18, ..    ST_
1b60: 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49  GeomFromText('LI
1b70: 4e 45 53 54 52 49 4e 47 28 31 38 30 20 33 30 2c  NESTRING(180 30,
1b80: 20 31 38 30 20 39 30 29 27 2c 20 34 33 32 36 29   180 90)', 4326)
1b90: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
1ba0: 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c  dLink('testnet',
1bb0: 20 31 39 2c 20 32 30 2c 20 0d 0a 20 20 20 20 53   19, 20, ..    S
1bc0: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
1bd0: 4c 49 4e 45 53 54 52 49 4e 47 28 31 38 30 20 33  LINESTRING(180 3
1be0: 30 2c 20 31 38 30 20 30 29 27 2c 20 34 33 32 36  0, 180 0)', 4326
1bf0: 29 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  ));..</verbatim>
1c00: 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f  ..</li>..</ul></
1c10: 74 64 3e 0d 0a 3c 74 64 3e 3c 69 6d 67 20 73 72  td>..<td><img sr
1c20: 63 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61  c="http://www.ga
1c30: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
1c40: 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 6e 65 74  ins/topofigs/net
1c50: 2d 32 2e 70 6e 67 22 20 61 6c 74 3d 22 6e 65 74  -2.png" alt="net
1c60: 2d 65 78 61 6d 70 6c 65 2d 32 22 3e 3c 2f 74 64  -example-2"></td
1c70: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
1c80: 63 6f 6c 73 70 61 6e 3d 22 32 22 3e 3c 68 72 3e  colspan="2"><hr>
1c90: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
1ca0: 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e  <td>..<ul>..<li>
1cb0: 0d 0a 57 65 27 6c 6c 20 6e 6f 77 20 61 73 73 69  ..We'll now assi
1cc0: 67 6e 20 61 20 6d 6f 64 69 66 69 65 64 20 67 65  gn a modified ge
1cd0: 6f 6d 65 74 72 79 20 74 6f 20 4c 69 6e 6b 2d 36  ometry to Link-6
1ce0: 2c 20 4c 69 6e 6b 31 34 20 61 6e 64 20 4c 69 6e  , Link14 and Lin
1cf0: 6b 2d 31 35 3a 20 0d 0a 3c 76 65 72 62 61 74 69  k-15: ..<verbati
1d00: 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54 5f 43 68  m>..SELECT ST_Ch
1d10: 61 6e 67 65 4c 69 6e 6b 47 65 6f 6d 28 27 74 65  angeLinkGeom('te
1d20: 73 74 6e 65 74 27 2c 20 36 2c 20 0d 0a 20 20 20  stnet', 6, ..   
1d30: 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74   ST_GeomFromText
1d40: 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 31 38  ('LINESTRING(-18
1d50: 30 20 36 30 2c 20 2d 31 33 35 20 36 30 2c 20 2d  0 60, -135 60, -
1d60: 31 33 35 20 33 30 2c 20 2d 39 30 20 33 30 29 27  135 30, -90 30)'
1d70: 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43  , 4326));..SELEC
1d80: 54 20 53 54 5f 43 68 61 6e 67 65 4c 69 6e 6b 47  T ST_ChangeLinkG
1d90: 65 6f 6d 28 27 74 65 73 74 6e 65 74 27 2c 20 31  eom('testnet', 1
1da0: 34 2c 20 0d 0a 20 20 20 20 53 54 5f 47 65 6f 6d  4, ..    ST_Geom
1db0: 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e 45 53 54  FromText('LINEST
1dc0: 52 49 4e 47 28 2d 31 38 30 20 2d 33 30 2c 20 2d  RING(-180 -30, -
1dd0: 31 31 30 20 2d 33 30 2c 20 2d 31 31 30 20 2d 36  110 -30, -110 -6
1de0: 30 2c 20 2d 39 30 20 2d 36 30 29 27 2c 20 34 33  0, -90 -60)', 43
1df0: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
1e00: 5f 43 68 61 6e 67 65 4c 69 6e 6b 47 65 6f 6d 28  _ChangeLinkGeom(
1e10: 27 74 65 73 74 6e 65 74 27 2c 20 31 35 2c 20 0d  'testnet', 15, .
1e20: 0a 20 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d  .    ST_GeomFrom
1e30: 54 65 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47  Text('LINESTRING
1e40: 28 2d 31 38 30 20 2d 36 30 2c 20 2d 31 32 30 20  (-180 -60, -120 
1e50: 2d 36 30 2c 20 2d 39 30 20 2d 39 30 29 27 2c 20  -60, -90 -90)', 
1e60: 34 33 32 36 29 29 3b 0d 0a 0d 0a 3c 2f 76 65 72  4326));....</ver
1e70: 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c  batim>..</li>..<
1e80: 6c 69 3e 0d 0a 4e 6f 77 20 77 65 27 6c 6c 20 73  li>..Now we'll s
1e90: 70 6c 69 74 20 4c 69 6e 6b 2d 32 30 20 62 79 20  plit Link-20 by 
1ea0: 69 6e 73 65 72 74 69 6e 67 20 61 20 6e 65 77 20  inserting a new 
1eb0: 4e 6f 64 65 20 28 4e 6f 64 65 2d 32 31 29 2e 3c  Node (Node-21).<
1ec0: 62 72 3e 0d 0a 57 65 27 76 65 20 63 61 6c 6c 65  br>..We've calle
1ed0: 64 20 61 20 3c 62 3e 22 6d 6f 64 22 3c 2f 62 3e  d a <b>"mod"</b>
1ee0: 20 6f 70 65 72 61 74 6f 72 2c 20 61 6e 64 20 63   operator, and c
1ef0: 6f 6e 73 65 71 75 65 6e 74 6c 79 20 4c 69 6e 6b  onsequently Link
1f00: 2d 32 30 20 77 69 6c 6c 20 62 65 20 6d 6f 64 69  -20 will be modi
1f10: 66 69 65 64 20 61 6e 64 20 4c 69 6e 6b 2d 32 38  fied and Link-28
1f20: 20 77 69 6c 6c 20 62 65 20 69 6e 73 65 72 74 65   will be inserte
1f30: 64 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a  d:..<verbatim>..
1f40: 53 45 4c 45 43 54 20 53 54 5f 4d 6f 64 47 65 6f  SELECT ST_ModGeo
1f50: 4c 69 6e 6b 53 70 6c 69 74 28 27 74 65 73 74 6e  LinkSplit('testn
1f60: 65 74 27 2c 20 32 30 2c 20 4d 61 6b 65 50 6f 69  et', 20, MakePoi
1f70: 6e 74 28 31 35 30 20 2c 33 30 2c 20 34 33 32 36  nt(150 ,30, 4326
1f80: 29 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  ));..</verbatim>
1f90: 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 0d 0a 57  ..</li>..<li>..W
1fa0: 65 27 6c 6c 20 67 6f 20 74 6f 20 73 70 6c 69 74  e'll go to split
1fb0: 20 4c 69 6e 6b 2d 31 39 20 73 6f 20 4e 6f 64 65   Link-19 so Node
1fc0: 2d 32 32 20 77 69 6c 6c 20 62 65 20 69 6e 73 65  -22 will be inse
1fd0: 72 74 65 64 2e 3c 62 72 3e 0d 0a 54 68 69 73 20  rted.<br>..This 
1fe0: 74 69 6d 65 20 77 65 27 76 65 20 63 61 6c 6c 65  time we've calle
1ff0: 64 20 61 20 3c 62 3e 22 6e 65 77 22 3c 2f 62 3e  d a <b>"new"</b>
2000: 20 6f 70 65 72 61 74 6f 72 20 61 6e 64 20 63 6f   operator and co
2010: 6e 73 65 71 75 65 6e 74 6c 79 20 4c 69 6e 6b 2d  nsequently Link-
2020: 31 39 20 68 61 73 20 62 65 65 6e 20 72 65 6d 6f  19 has been remo
2030: 76 65 64 20 61 6e 64 20 72 65 70 6c 61 63 65 64  ved and replaced
2040: 20 62 79 20 4c 69 6e 6b 2d 32 39 20 61 6e 64 20   by Link-29 and 
2050: 4c 69 6e 6b 2d 33 30 3a 0d 0a 3c 76 65 72 62 61  Link-30:..<verba
2060: 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54 5f  tim>..SELECT ST_
2070: 4e 65 77 47 65 6f 4c 69 6e 6b 53 70 6c 69 74 28  NewGeoLinkSplit(
2080: 27 74 65 73 74 6e 65 74 27 2c 20 31 39 2c 20 4d  'testnet', 19, M
2090: 61 6b 65 50 6f 69 6e 74 28 31 35 30 20 2c 30 2c  akePoint(150 ,0,
20a0: 20 34 33 32 36 29 29 3b 0d 0a 3c 2f 76 65 72 62   4326));..</verb
20b0: 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 6c  atim>..</li>..<l
20c0: 69 3e 0d 0a 46 69 6e 61 6c 6c 79 20 77 65 27 6c  i>..Finally we'l
20d0: 6c 20 61 64 64 20 61 20 6e 65 77 20 4c 69 6e 6b  l add a new Link
20e0: 20 28 4c 69 6e 6b 2d 33 31 29 20 63 6f 6e 6e 65   (Link-31) conne
20f0: 63 74 69 6e 67 20 4e 6f 64 65 2d 32 31 20 74 6f  cting Node-21 to
2100: 20 4e 6f 64 65 2d 32 32 3a 0d 0a 3c 76 65 72 62   Node-22:..<verb
2110: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54  atim>..SELECT ST
2120: 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65  _AddLink('testne
2130: 74 27 2c 20 32 31 2c 20 32 32 2c 20 53 54 5f 47  t', 21, 22, ST_G
2140: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
2150: 45 53 54 52 49 4e 47 28 31 35 30 20 33 30 2c 20  ESTRING(150 30, 
2160: 31 35 30 20 30 29 27 2c 20 34 33 32 36 29 29 3b  150 0)', 4326));
2170: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c  ..</verbatim>..<
2180: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 74 64 3e  /li>..</ul></td>
2190: 0d 0a 3c 74 64 3e 3c 69 6d 67 20 73 72 63 3d 22  ..<td><img src="
21a0: 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  http://www.gaia-
21b0: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73  gis.it/gaia-sins
21c0: 2f 74 6f 70 6f 66 69 67 73 2f 6e 65 74 2d 33 2e  /topofigs/net-3.
21d0: 70 6e 67 22 20 61 6c 74 3d 22 6e 65 74 2d 65 78  png" alt="net-ex
21e0: 61 6d 70 6c 65 2d 33 22 3e 3c 2f 74 64 3e 3c 2f  ample-3"></td></
21f0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c  tr>..<tr><td col
2200: 73 70 61 6e 3d 22 32 22 3e 3c 68 72 3e 3c 2f 74  span="2"><hr></t
2210: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
2220: 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 0d 0a 4e  >..<ul>..<li>..N
2230: 6f 77 20 77 65 27 6c 6c 20 6d 65 72 67 65 20 28  ow we'll merge (
2240: 61 6b 61 20 68 65 61 6c 29 20 4c 69 6e 6b 2d 31  aka heal) Link-1
2250: 38 20 61 6e 64 20 4c 69 6e 6b 2d 32 39 20 61 6e  8 and Link-29 an
2260: 64 20 63 6f 6e 73 65 71 75 65 6e 74 6c 79 20 74  d consequently t
2270: 68 65 20 4e 6f 64 65 20 73 68 61 72 65 64 20 62  he Node shared b
2280: 79 20 62 6f 74 68 20 74 68 65 6d 20 28 4e 6f 64  y both them (Nod
2290: 65 2d 31 33 29 20 77 69 6c 6c 20 62 65 20 72 65  e-13) will be re
22a0: 6d 6f 76 65 64 2e 3c 62 72 3e 0d 0a 57 65 27 76  moved.<br>..We'v
22b0: 65 20 63 61 6c 6c 65 64 20 61 20 3c 62 3e 22 6e  e called a <b>"n
22c0: 65 77 22 3c 2f 62 3e 20 6f 70 65 72 61 74 6f 72  ew"</b> operator
22d0: 2c 20 73 6f 20 62 6f 74 68 20 4c 69 6e 6b 2d 31  , so both Link-1
22e0: 38 20 61 6e 64 20 4c 69 6e 6b 2d 32 39 20 77 69  8 and Link-29 wi
22f0: 6c 6c 20 62 65 20 72 65 6d 6f 76 65 64 20 61 6e  ll be removed an
2300: 64 20 72 65 70 6c 61 63 65 64 20 62 79 20 4c 69  d replaced by Li
2310: 6e 6b 2d 33 32 3a 0d 0a 3c 76 65 72 62 61 74 69  nk-32:..<verbati
2320: 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54 5f 4e 65  m>..SELECT ST_Ne
2330: 77 4c 69 6e 6b 48 65 61 6c 28 27 74 65 73 74 6e  wLinkHeal('testn
2340: 65 74 27 2c 20 31 38 2c 20 32 39 29 3b 0d 0a 3c  et', 18, 29);..<
2350: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69  /verbatim>..</li
2360: 3e 0d 0a 3c 6c 69 3e 0d 0a 57 65 27 6c 6c 20 6e  >..<li>..We'll n
2370: 6f 77 20 72 65 6d 6f 76 65 20 4c 69 6e 6b 2d 32  ow remove Link-2
2380: 32 3b 20 74 68 65 20 77 65 27 6c 6c 20 68 65 61  2; the we'll hea
2390: 6c 20 4c 69 6e 6b 2d 31 31 20 61 6e 64 20 4c 69  l Link-11 and Li
23a0: 6e 6b 2d 31 32 20 73 6f 20 74 6f 20 72 65 6d 6f  nk-12 so to remo
23b0: 76 65 20 4e 6f 64 65 2d 31 30 2e 3c 62 72 3e 0d  ve Node-10.<br>.
23c0: 0a 54 68 69 73 20 74 69 6d 65 20 74 6f 6f 20 77  .This time too w
23d0: 65 27 76 65 20 63 61 6c 6c 65 64 20 61 20 3c 62  e've called a <b
23e0: 3e 22 6e 65 77 22 3c 2f 62 3e 20 6f 70 65 72 61  >"new"</b> opera
23f0: 74 6f 72 2c 20 73 6f 20 62 6f 74 68 20 4c 69 6e  tor, so both Lin
2400: 6b 2d 31 31 20 61 6e 64 20 4c 69 6e 6b 2d 31 32  k-11 and Link-12
2410: 20 77 69 6c 6c 20 62 65 20 72 65 6d 6f 76 65 64   will be removed
2420: 20 61 6e 64 20 72 65 70 6c 61 63 65 64 20 62 79   and replaced by
2430: 20 4c 69 6e 6b 2d 33 33 3a 0d 0a 3c 76 65 72 62   Link-33:..<verb
2440: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54  atim>..SELECT ST
2450: 5f 52 65 6d 6f 76 65 4c 69 6e 6b 28 27 74 65 73  _RemoveLink('tes
2460: 74 6e 65 74 27 2c 20 32 32 29 3b 0d 0a 53 45 4c  tnet', 22);..SEL
2470: 45 43 54 20 53 54 5f 4e 65 77 4c 69 6e 6b 48 65  ECT ST_NewLinkHe
2480: 61 6c 28 27 74 65 73 74 6e 65 74 27 2c 20 31 31  al('testnet', 11
2490: 2c 20 31 32 29 3b 0d 0a 3c 2f 76 65 72 62 61 74  , 12);..</verbat
24a0: 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  im>..</li>..<li>
24b0: 0d 0a 46 69 6e 61 6c 6c 79 20 77 65 27 6c 6c 20  ..Finally we'll 
24c0: 68 65 61 6c 20 4c 69 6e 6b 2d 31 36 20 61 6e 64  heal Link-16 and
24d0: 20 4c 69 6e 6b 2d 31 37 20 73 6f 20 74 6f 20 72   Link-17 so to r
24e0: 65 6d 6f 76 65 20 4e 6f 64 65 2d 31 35 2e 3c 62  emove Node-15.<b
24f0: 72 3e 0d 0a 41 6e 79 77 61 79 20 74 68 69 73 20  r>..Anyway this 
2500: 74 69 6d 65 20 77 65 27 76 65 20 63 61 6c 6c 65  time we've calle
2510: 64 20 61 20 3c 62 3e 22 6d 6f 64 22 3c 2f 62 3e  d a <b>"mod"</b>
2520: 20 6f 70 65 72 61 74 6f 72 2c 20 73 6f 20 4c 69   operator, so Li
2530: 6e 6b 2d 31 36 20 77 69 6c 6c 20 62 65 20 6d 6f  nk-16 will be mo
2540: 64 69 66 69 65 64 20 61 6e 64 20 4c 69 6e 6b 2d  dified and Link-
2550: 31 37 20 77 69 6c 6c 20 62 65 20 72 65 6d 6f 76  17 will be remov
2560: 65 64 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d  ed:..<verbatim>.
2570: 0a 53 45 4c 45 43 54 20 53 54 5f 4d 6f 64 4c 69  .SELECT ST_ModLi
2580: 6e 6b 48 65 61 6c 28 27 74 65 73 74 6e 65 74 27  nkHeal('testnet'
2590: 2c 20 31 36 2c 20 31 37 29 3b 0d 0a 3c 2f 76 65  , 16, 17);..</ve
25a0: 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a  rbatim>..</li>..
25b0: 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 0d 0a 3c 74  </ul>..</td>..<t
25c0: 64 3e 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70  d><img src="http
25d0: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e  ://www.gaia-gis.
25e0: 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70  it/gaia-sins/top
25f0: 6f 66 69 67 73 2f 6e 65 74 2d 34 2e 70 6e 67 22  ofigs/net-4.png"
2600: 20 61 6c 74 3d 22 6e 65 74 2d 65 78 61 6d 70 6c   alt="net-exampl
2610: 65 2d 34 22 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  e-4"></td></tr>.
2620: 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e  .<tr><td colspan
2630: 3d 22 32 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f  ="2"><hr></td></
2640: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c  tr>..<tr><td>..<
2650: 75 6c 3e 0d 0a 3c 6c 69 3e 0d 0a 4e 6f 77 20 77  ul>..<li>..Now w
2660: 65 27 6c 6c 20 72 65 6d 6f 76 65 20 62 6f 74 68  e'll remove both
2670: 20 4c 69 6e 6b 2d 32 37 20 61 6e 64 20 4c 69 6e   Link-27 and Lin
2680: 6b 2d 33 30 2e 3c 62 72 3e 0d 0a 54 68 69 73 20  k-30.<br>..This 
2690: 61 63 74 69 6f 6e 20 77 69 6c 6c 20 66 72 65 65  action will free
26a0: 20 4e 6f 64 65 2d 32 30 20 66 72 6f 6d 20 61 6e   Node-20 from an
26b0: 79 20 4c 69 6e 6b 20 72 65 66 65 72 65 6e 63 65  y Link reference
26c0: 3b 20 69 6e 20 6f 74 68 65 72 20 77 6f 72 64 73  ; in other words
26d0: 20 6e 6f 77 20 4e 6f 64 65 2d 32 30 20 69 73 20   now Node-20 is 
26e0: 6f 6e 63 65 20 61 67 61 69 6e 20 61 6e 20 49 73  once again an Is
26f0: 6f 6c 61 74 65 64 20 4e 6f 64 65 2c 20 61 6e 64  olated Node, and
2700: 20 77 65 20 63 61 6e 20 73 61 66 65 6c 79 20 72   we can safely r
2710: 65 6d 6f 76 65 20 69 74 3a 0d 0a 3c 76 65 72 62  emove it:..<verb
2720: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54  atim>..SELECT ST
2730: 5f 52 65 6d 6f 76 65 4c 69 6e 6b 28 27 74 65 73  _RemoveLink('tes
2740: 74 6e 65 74 27 2c 20 32 37 29 3b 0d 0a 53 45 4c  tnet', 27);..SEL
2750: 45 43 54 20 53 54 5f 52 65 6d 6f 76 65 4c 69 6e  ECT ST_RemoveLin
2760: 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 33 30 29  k('testnet', 30)
2770: 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 52 65 6d  ;..SELECT ST_Rem
2780: 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74  IsoNetNode('test
2790: 6e 65 74 27 2c 20 32 30 29 3b 0d 0a 3c 2f 76 65  net', 20);..</ve
27a0: 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a  rbatim>..</li>..
27b0: 3c 6c 69 3e 0d 0a 41 73 20 61 20 6c 61 73 74 20  <li>..As a last 
27c0: 73 74 65 70 20 63 6f 6e 63 6c 75 64 69 6e 67 20  step concluding 
27d0: 74 68 69 73 20 74 75 74 6f 72 69 61 6c 20 77 65  this tutorial we
27e0: 20 63 61 6e 20 6e 6f 77 20 63 68 65 63 6b 20 6f   can now check o
27f0: 75 72 20 4e 65 74 77 6f 72 6b 20 66 6f 72 20 63  ur Network for c
2800: 6f 6e 73 69 73 74 65 6e 63 79 3a 20 0d 0a 3c 76  onsistency: ..<v
2810: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54  erbatim>..SELECT
2820: 20 53 54 5f 56 61 6c 69 64 53 70 61 74 69 61 6c   ST_ValidSpatial
2830: 4e 65 74 28 27 74 65 73 74 6e 65 74 27 29 3b 0d  Net('testnet');.
2840: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 59 6f  .</verbatim>..Yo
2850: 75 20 63 61 6e 20 65 78 61 6d 69 6e 65 20 74 68  u can examine th
2860: 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20  e corresponding 
2870: 64 69 61 67 6e 6f 73 74 69 63 20 72 65 70 6f 72  diagnostic repor
2880: 74 20 73 74 6f 72 65 64 20 69 6e 20 74 68 65 20  t stored in the 
2890: 74 65 6d 70 6f 72 61 72 79 20 44 42 20 74 61 62  temporary DB tab
28a0: 6c 65 20 6e 61 6d 65 64 20 3c 62 3e 54 45 4d 50  le named <b>TEMP
28b0: 2e 74 65 73 74 6e 65 74 5f 76 61 6c 69 64 61 74  .testnet_validat
28c0: 65 5f 73 70 61 74 69 61 6c 6e 65 74 3c 2f 62 3e  e_spatialnet</b>
28d0: 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53  :..<verbatim>..S
28e0: 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 54 45 4d  ELECT * FROM TEM
28f0: 50 2e 74 65 73 74 6e 65 74 5f 76 61 6c 69 64 61  P.testnet_valida
2900: 74 65 5f 73 70 61 74 69 61 6c 6e 65 74 3b 0d 0a  te_spatialnet;..
2910: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41 73 20  </verbatim>..As 
2920: 79 6f 75 20 63 61 6e 20 65 61 73 69 6c 79 20 63  you can easily c
2930: 68 65 63 6b 2c 20 74 68 65 20 74 61 62 6c 65 20  heck, the table 
2940: 69 73 20 63 6f 6d 70 6c 65 74 65 6c 79 20 65 6d  is completely em
2950: 70 74 79 2c 20 61 6e 64 20 74 68 69 73 20 6d 65  pty, and this me
2960: 61 6e 73 20 74 68 61 74 20 79 6f 75 72 20 4e 65  ans that your Ne
2970: 74 77 6f 72 6b 20 69 73 20 66 75 6c 6c 79 20 63  twork is fully c
2980: 6f 6e 73 69 73 74 65 6e 74 2e 20 0d 0a 3c 2f 6c  onsistent. ..</l
2990: 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e  i>..</ul>..</td>
29a0: 0d 0a 3c 74 64 3e 3c 69 6d 67 20 73 72 63 3d 22  ..<td><img src="
29b0: 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  http://www.gaia-
29c0: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73  gis.it/gaia-sins
29d0: 2f 74 6f 70 6f 66 69 67 73 2f 6e 65 74 2d 35 2e  /topofigs/net-5.
29e0: 70 6e 67 22 20 61 6c 74 3d 22 6e 65 74 2d 65 78  png" alt="net-ex
29f0: 61 6d 70 6c 65 2d 35 22 3e 3c 2f 74 64 3e 3c 2f  ample-5"></td></
2a00: 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72  tr>..</table><br
2a10: 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65 20 77 69  ><br>..<table wi
2a20: 64 74 68 3d 22 31 30 30 25 22 3e 3c 74 72 3e 0d  dth="100%"><tr>.
2a30: 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 25 22  .<td width="33%"
2a40: 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e 3c 61   align="left"><a
2a50: 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77   href="https://w
2a60: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66  ww.gaia-gis.it/f
2a70: 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c  ossil/libspatial
2a80: 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 74 6f  ite/wiki?name=to
2a90: 70 6f 2d 73 74 61 72 74 22 3e 70 72 65 76 69 6f  po-start">previo
2aa0: 75 73 20 70 61 67 65 3c 2f 61 3e 3c 2f 74 64 3e  us page</a></td>
2ab0: 0d 0a 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e  ..<td align="cen
2ac0: 74 65 72 22 3e 3c 61 20 68 72 65 66 3d 22 68 74  ter"><a href="ht
2ad0: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67  tps://www.gaia-g
2ae0: 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62  is.it/fossil/lib
2af0: 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f  spatialite/wiki?
2b00: 6e 61 6d 65 3d 6d 69 73 63 2d 64 6f 63 73 22 3e  name=misc-docs">
2b10: 62 61 63 6b 20 74 6f 20 69 6e 64 65 78 3c 2f 61  back to index</a
2b20: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 77 69 64 74  ></td>..<td widt
2b30: 68 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 72  h="33%" align="r
2b40: 69 67 68 74 22 3e 3c 61 20 68 72 65 66 3d 22 68  ight"><a href="h
2b50: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  ttps://www.gaia-
2b60: 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69  gis.it/fossil/li
2b70: 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69  bspatialite/wiki
2b80: 3f 6e 61 6d 65 3d 74 6f 70 6f 2d 69 6e 74 65 72  ?name=topo-inter
2b90: 6d 65 64 69 61 74 65 22 3e 6e 65 78 74 20 70 61  mediate">next pa
2ba0: 67 65 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74  ge</a></td>..</t
2bb0: 72 3e 3c 2f 74 61 62 6c 65 3e 0a 5a 20 66 32 39  r></table>.Z f29
2bc0: 63 37 35 30 34 61 62 38 66 62 35 65 61 39 34 31  c7504ab8fb5ea941
2bd0: 33 39 38 37 31 32 30 61 33 64 38 66 38 0a        3987120a3d8f8.