Hex Artifact Content
Not logged in

Artifact 622941303df8e99b6f6fa73553a0c9c3b06ba899:

Wiki page [toponet-start] by sandro 2015-12-15 12:28:01.
0000: 44 20 32 30 31 35 2d 31 32 2d 31 35 54 31 32 3a  D 2015-12-15T12:
0010: 32 38 3a 30 31 2e 37 37 35 0a 4c 20 74 6f 70 6f  28:01.775.L topo
0020: 6e 65 74 2d 73 74 61 72 74 0a 50 20 38 66 37 66  net-start.P 8f7f
0030: 31 65 33 66 39 63 65 32 31 64 32 34 36 38 63 64  1e3f9ce21d2468cd
0040: 35 39 63 39 66 38 36 62 30 61 39 64 36 62 33 37  59c9f86b0a9d6b37
0050: 36 64 33 65 0a 55 20 73 61 6e 64 72 6f 0a 57 20  6d3e.U sandro.W 
0060: 31 31 30 39 38 0a 3c 74 61 62 6c 65 20 63 65 6c  11098.<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 49 53 4f 2b  e/wiki?name=ISO+
0230: 54 6f 70 6f 6c 6f 67 79 22 3e 62 61 63 6b 20 74  Topology">back t
0240: 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f 74 64 3e  o index</a></td>
0250: 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 25  ..<td width="33%
0260: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  " align="right">
0270: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f  <a href="https:/
0280: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74  /www.gaia-gis.it
0290: 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69  /fossil/libspati
02a0: 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d  alite/wiki?name=
02b0: 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 69 61 74  topo-intermediat
02c0: 65 22 3e 6e 65 78 74 20 70 61 67 65 3c 2f 61 3e  e">next page</a>
02d0: 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 61  </td>..</tr></ta
02e0: 62 6c 65 3e 0d 0a 3c 68 33 3e 54 75 74 6f 72 69  ble>..<h3>Tutori
02f0: 61 6c 20 23 32 3a 20 6e 65 74 77 6f 72 6b 20 65  al #2: network e
0300: 64 69 74 69 6e 67 20 62 79 20 75 73 69 6e 67 20  diting by using 
0310: 62 61 73 69 63 20 49 53 4f 20 53 51 4c 20 66 75  basic ISO SQL fu
0320: 6e 63 74 69 6f 6e 3c 2f 68 33 3e 0d 0a 49 6e 20  nction</h3>..In 
0330: 74 68 69 73 20 74 75 74 6f 72 69 61 6c 20 77 69  this tutorial wi
0340: 6c 6c 20 71 75 69 63 6b 6c 79 20 65 78 70 6c 6f  ll quickly explo
0350: 72 65 20 74 68 65 20 49 53 4f 20 53 51 4c 2f 4d  re the ISO SQL/M
0360: 4d 20 6d 61 69 6e 20 63 6f 72 65 20 73 75 70 70  M main core supp
0370: 6f 72 74 69 6e 67 20 54 6f 70 6f 6c 6f 67 79 2d  orting Topology-
0380: 4e 65 74 77 6f 72 6b 20 28 6e 61 6d 65 6c 79 3a  Network (namely:
0390: 20 53 70 61 74 69 61 6c 20 4e 65 74 77 6f 72 6b   Spatial Network
03a0: 29 2e 3c 62 72 3e 0d 0a 57 65 27 6c 6c 20 75 73  ).<br>..We'll us
03b0: 65 20 76 65 72 79 20 73 69 6d 70 6c 65 20 67 65  e very simple ge
03c0: 6f 6d 65 74 72 69 65 73 20 28 73 74 72 61 69 67  ometries (straig
03d0: 68 74 20 73 65 67 6d 65 6e 74 73 29 20 73 6f 20  ht segments) so 
03e0: 74 6f 20 61 76 6f 69 64 20 61 6e 79 20 70 6f 73  to avoid any pos
03f0: 73 69 62 6c 65 20 63 6f 6d 70 6c 65 78 69 74 79  sible complexity
0400: 20 74 68 75 73 20 6d 61 6b 69 6e 67 20 62 61 73   thus making bas
0410: 69 63 61 6c 6c 79 20 73 69 6d 70 6c 65 20 66 6f  ically simple fo
0420: 6c 6c 6f 77 69 6e 67 20 61 6e 64 20 75 6e 64 65  llowing and unde
0430: 72 73 74 61 6e 64 69 6e 67 20 61 6e 79 20 73 74  rstanding any st
0440: 65 70 2e 3c 62 72 3e 0d 0a 59 6f 75 20 63 61 6e  ep.<br>..You can
0450: 20 69 6e 64 69 66 66 65 72 65 6e 74 6c 79 20 75   indifferently u
0460: 73 65 20 3c 62 3e 73 70 61 74 69 61 6c 69 74 65  se <b>spatialite
0470: 20 43 4c 49 3c 2f 62 3e 20 6f 72 20 3c 62 3e 73   CLI</b> or <b>s
0480: 70 61 74 69 61 6c 69 74 65 5f 67 75 69 3c 2f 62  patialite_gui</b
0490: 3e 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 74 65  > in order to te
04a0: 73 74 20 65 61 63 68 20 53 51 4c 20 73 74 61 74  st each SQL stat
04b0: 65 6d 65 6e 74 2e 3c 62 72 3e 3c 62 72 3e 0d 0a  ement.<br><br>..
04c0: 3c 74 61 62 6c 65 20 62 67 63 6f 6c 6f 72 3d 22  <table bgcolor="
04d0: 23 66 66 66 66 65 30 22 20 63 65 6c 6c 73 70 61  #ffffe0" cellspa
04e0: 63 69 6e 67 3d 22 38 22 20 63 65 6c 6c 70 61 64  cing="8" cellpad
04f0: 64 69 6e 67 3d 22 38 22 3e 0d 0a 3c 74 72 3e 3c  ding="8">..<tr><
0500: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72  td align="center
0510: 22 3e 3c 62 3e 43 41 56 45 41 54 3c 2f 62 3e 3c  "><b>CAVEAT</b><
0520: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c  /td></tr>..<tr><
0530: 74 64 3e 0d 0a 41 6e 79 20 64 69 72 65 63 74 20  td>..Any direct 
0540: 6d 61 6e 69 70 75 6c 61 74 69 6f 6e 20 6f 66 20  manipulation of 
0550: 74 68 65 20 6c 6f 77 2d 6c 65 76 65 6c 20 44 42  the low-level DB
0560: 20 74 61 62 6c 65 73 20 69 6d 70 6c 65 6d 65 6e   tables implemen
0570: 74 69 6e 67 20 61 6e 20 49 53 4f 20 4e 65 74 77  ting an ISO Netw
0580: 6f 72 6b 20 77 69 6c 6c 20 61 6c 6d 6f 73 74 20  ork will almost 
0590: 63 65 72 74 61 69 6e 6c 79 20 63 61 75 73 65 20  certainly cause 
05a0: 61 20 6d 61 6a 6f 72 20 64 69 73 61 73 74 65 72  a major disaster
05b0: 2e 3c 62 72 3e 0d 0a 59 6f 75 20 61 72 65 20 6e  .<br>..You are n
05c0: 65 76 65 72 20 65 78 70 65 63 74 65 64 20 74 6f  ever expected to
05d0: 20 65 78 65 63 75 74 65 20 61 6e 79 20 3c 62 3e   execute any <b>
05e0: 49 4e 53 45 52 54 3c 2f 62 3e 2c 20 3c 62 3e 55  INSERT</b>, <b>U
05f0: 50 44 41 54 45 3c 2f 62 3e 20 6f 72 20 3c 62 3e  PDATE</b> or <b>
0600: 44 45 4c 45 54 45 3c 2f 62 3e 20 73 74 61 74 65  DELETE</b> state
0610: 6d 65 6e 74 20 6f 6e 20 62 65 68 61 6c 66 20 6f  ment on behalf o
0620: 66 20 73 75 63 68 20 74 61 62 6c 65 73 2e 3c 62  f such tables.<b
0630: 72 3e 0d 0a 59 6f 75 20 61 6c 77 61 79 73 20 68  r>..You always h
0640: 61 76 65 20 74 6f 20 63 61 6c 6c 20 74 68 65 20  ave to call the 
0650: 61 70 70 72 6f 70 72 69 61 74 65 20 49 53 4f 20  appropriate ISO 
0660: 53 51 4c 20 66 75 6e 63 74 69 6f 6e 73 20 66 6f  SQL functions fo
0670: 72 20 61 6e 79 20 6f 70 65 72 61 74 69 6f 6e 20  r any operation 
0680: 74 61 72 67 65 74 69 6e 67 20 61 20 54 6f 70 6f  targeting a Topo
0690: 6c 6f 67 79 20 69 6e 20 6f 72 64 65 72 20 74 6f  logy in order to
06a0: 20 70 72 65 73 65 72 76 65 20 61 20 70 72 6f 70   preserve a prop
06b0: 65 72 20 63 6f 6e 73 69 73 74 65 6e 63 79 2e 0d  er consistency..
06c0: 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  .</td></tr>..<tr
06d0: 3e 3c 74 64 3e 0d 0a 49 66 20 79 6f 75 20 61 72  ><td>..If you ar
06e0: 65 20 73 74 72 6f 6e 67 6c 79 20 69 6e 74 65 72  e strongly inter
06f0: 65 73 74 65 64 20 69 6e 20 62 65 74 74 65 72 20  ested in better 
0700: 75 6e 64 65 72 73 74 61 6e 64 69 6e 67 20 6d 61  understanding ma
0710: 6e 79 20 69 6e 74 65 72 6e 61 6c 20 69 6d 70 6c  ny internal impl
0720: 65 6d 65 6e 74 61 74 69 6f 6e 20 6d 65 63 68 61  ementation mecha
0730: 6e 69 73 6d 73 20 79 6f 75 20 63 6f 75 6c 64 20  nisms you could 
0740: 65 76 65 6e 74 75 61 6c 6c 79 20 69 6e 73 70 65  eventually inspe
0750: 63 74 20 66 72 6f 6d 20 74 69 6d 65 20 74 6f 20  ct from time to 
0760: 74 69 6d 65 20 74 68 65 20 63 6f 6e 74 65 6e 74  time the content
0770: 20 6f 66 20 74 68 65 20 70 68 79 73 69 63 61 6c   of the physical
0780: 20 44 42 20 74 61 62 6c 65 73 20 73 75 70 70 6f   DB tables suppo
0790: 72 74 69 6e 67 20 74 68 65 20 74 65 73 74 20 54  rting the test T
07a0: 6f 70 6f 6c 6f 67 79 3a 0d 0a 3c 76 65 72 62 61  opology:..<verba
07b0: 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 2a 20 46  tim>..SELECT * F
07c0: 52 4f 4d 20 74 65 73 74 6e 65 74 5f 6e 6f 64 65  ROM testnet_node
07d0: 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52  ;....SELECT * FR
07e0: 4f 4d 20 74 65 73 74 6e 65 74 5f 6c 69 6e 6b 3b  OM testnet_link;
07f0: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 3c 2f 74  ..</verbatim></t
0800: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
0810: 3e 3c 75 3e 50 6c 65 61 73 65 20 6e 6f 74 65 3c  ><u>Please note<
0820: 2f 75 3e 3a 20 74 68 65 20 61 63 74 75 61 6c 20  /u>: the actual 
0830: 6c 61 79 6f 75 74 20 61 64 6f 70 74 65 64 20 62  layout adopted b
0840: 79 20 74 68 65 73 65 20 6c 6f 77 2d 6c 65 76 65  y these low-leve
0850: 6c 20 44 42 20 74 61 62 6c 65 73 20 63 6f 75 6c  l DB tables coul
0860: 64 20 65 76 65 6e 74 75 61 6c 6c 79 20 63 68 61  d eventually cha
0870: 6e 67 65 20 69 6e 20 66 75 74 75 72 65 20 76 65  nge in future ve
0880: 72 73 69 6f 6e 73 2e 3c 62 72 3e 0d 0a 41 73 20  rsions.<br>..As 
0890: 61 20 67 65 6e 65 72 61 6c 20 70 72 69 6e 63 69  a general princi
08a0: 70 6c 65 20 61 6e 79 20 64 69 72 65 63 74 20 69  ple any direct i
08b0: 6e 74 65 72 61 63 74 69 6f 6e 20 77 69 74 68 20  nteraction with 
08c0: 74 68 65 20 6c 6f 77 2d 6c 65 76 65 6c 20 44 42  the low-level DB
08d0: 20 74 61 62 6c 65 73 20 73 68 6f 75 6c 64 20 62   tables should b
08e0: 65 20 61 6c 77 61 79 73 20 63 61 72 65 66 75 6c  e always careful
08f0: 6c 79 20 61 76 6f 69 64 65 64 20 65 76 65 6e 20  ly avoided even 
0900: 66 6f 72 20 3c 62 3e 53 45 4c 45 43 54 3c 2f 62  for <b>SELECT</b
0910: 3e 20 71 75 65 72 69 65 73 20 28 75 73 65 20 69  > queries (use i
0920: 6e 73 74 65 61 64 20 74 68 65 20 61 70 70 72 6f  nstead the appro
0930: 70 72 69 61 74 65 20 49 53 4f 20 53 51 4c 20 66  priate ISO SQL f
0940: 75 6e 63 74 69 6f 6e 73 29 2e 3c 62 72 3e 0d 0a  unctions).<br>..
0950: 41 6e 79 77 61 79 2c 20 61 74 20 6c 65 61 73 74  Anyway, at least
0960: 20 66 6f 72 20 64 69 64 61 63 74 69 63 20 2f 20   for didactic / 
0970: 64 65 62 75 67 67 69 6e 67 20 70 75 72 70 6f 73  debugging purpos
0980: 65 73 2c 20 65 78 65 63 75 74 69 6e 67 20 73 6f  es, executing so
0990: 6d 65 20 53 45 4c 45 43 54 20 73 74 61 74 65 6d  me SELECT statem
09a0: 65 6e 74 20 69 6e 20 6f 72 64 65 72 20 74 6f 20  ent in order to 
09b0: 69 6e 73 70 65 63 74 20 74 68 65 20 61 63 74 75  inspect the actu
09c0: 61 6c 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 74  al contents of t
09d0: 68 65 73 65 20 74 61 62 6c 65 73 20 69 73 20 61  hese tables is a
09e0: 6e 20 61 62 73 6f 6c 75 74 65 6c 79 20 68 61 72  n absolutely har
09f0: 6d 6c 65 73 73 20 6f 70 65 72 61 74 69 6f 6e 2e  mless operation.
0a00: 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f  ..</td></tr>..</
0a10: 74 61 62 6c 65 3e 3c 62 72 3e 3c 62 72 3e 3c 68  table><br><br><h
0a20: 72 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73  r>..<table cells
0a30: 70 61 63 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70  pacing="4" cellp
0a40: 61 64 64 69 6e 67 3d 22 36 22 3e 0d 0a 3c 74 72  adding="6">..<tr
0a50: 3e 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69  ><td>..<ul>..<li
0a60: 3e 0d 0a 57 65 27 6c 6c 20 73 74 61 72 74 20 62  >..We'll start b
0a70: 79 20 63 72 65 61 74 69 6e 67 20 61 20 62 72 61  y creating a bra
0a80: 6e 64 20 6e 65 77 20 49 53 4f 20 54 6f 70 6f 6c  nd new ISO Topol
0a90: 6f 67 79 2d 4e 65 74 77 6f 72 6b 20 28 6f 66 20  ogy-Network (of 
0aa0: 74 68 65 20 53 70 61 74 69 61 6c 20 74 79 70 65  the Spatial type
0ab0: 29 20 6e 61 6d 65 64 20 3c 62 3e 74 65 73 74 6e  ) named <b>testn
0ac0: 65 74 3c 2f 62 3e 3b 20 61 6c 6c 20 6e 65 74 77  et</b>; all netw
0ad0: 6f 72 6b 20 67 65 6f 6d 65 74 72 69 65 73 20 61  ork geometries a
0ae0: 72 65 20 65 78 70 65 63 74 65 64 20 74 6f 20 62  re expected to b
0af0: 65 20 6c 6f 63 61 74 65 64 20 6f 6e 20 3c 62 3e  e located on <b>
0b00: 53 52 49 44 3d 34 33 32 36 3c 2f 62 3e 20 28 61  SRID=4326</b> (a
0b10: 6b 61 20 3c 69 3e 57 47 53 38 34 20 6c 6f 6e 67  ka <i>WGS84 long
0b20: 2f 6c 61 74 3c 2f 69 3e 29 20 61 6e 64 20 77 69  /lat</i>) and wi
0b30: 6c 6c 20 68 61 76 65 20 3c 62 3e 32 44 20 58 59  ll have <b>2D XY
0b40: 3c 2f 62 3e 20 64 69 6d 65 6e 73 69 6f 6e 73 3a  </b> dimensions:
0b50: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45  ..<verbatim>..SE
0b60: 4c 45 43 54 20 43 72 65 61 74 65 4e 65 74 77 6f  LECT CreateNetwo
0b70: 72 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31 2c  rk('testnet', 1,
0b80: 20 34 33 32 36 2c 20 30 2c 20 30 29 3b 0d 0a 3c   4326, 0, 0);..<
0b90: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69  /verbatim>..</li
0ba0: 3e 0d 0a 3c 6c 69 3e 0d 0a 4e 6f 77 20 77 65 27  >..<li>..Now we'
0bb0: 6c 6c 20 69 6e 73 65 72 74 20 61 20 62 75 6e 63  ll insert a bunc
0bc0: 68 20 6f 66 20 49 73 6f 6c 61 74 65 64 20 4e 6f  h of Isolated No
0bd0: 64 65 73 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  des:..<verbatim>
0be0: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49  ..SELECT ST_AddI
0bf0: 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e  soNetNode('testn
0c00: 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d  et', MakePoint(-
0c10: 31 38 30 2c 20 39 30 2c 20 34 33 32 36 29 29 3b  180, 90, 4326));
0c20: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49  ..SELECT ST_AddI
0c30: 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e  soNetNode('testn
0c40: 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d  et', MakePoint(-
0c50: 31 38 30 2c 20 36 30 2c 20 34 33 32 36 29 29 3b  180, 60, 4326));
0c60: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49  ..SELECT ST_AddI
0c70: 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e  soNetNode('testn
0c80: 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d  et', MakePoint(-
0c90: 31 38 30 2c 20 30 2c 20 34 33 32 36 29 29 3b 0d  180, 0, 4326));.
0ca0: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73  .SELECT ST_AddIs
0cb0: 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65  oNetNode('testne
0cc0: 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 31  t', MakePoint(-1
0cd0: 38 30 2c 20 2d 33 30 2c 20 34 33 32 36 29 29 3b  80, -30, 4326));
0ce0: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49  ..SELECT ST_AddI
0cf0: 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e  soNetNode('testn
0d00: 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d  et', MakePoint(-
0d10: 31 38 30 2c 20 2d 36 30 2c 20 34 33 32 36 29 29  180, -60, 4326))
0d20: 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64  ;..SELECT ST_Add
0d30: 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74  IsoNetNode('test
0d40: 6e 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28  net', MakePoint(
0d50: 2d 31 38 30 2c 20 2d 39 30 2c 20 34 33 32 36 29  -180, -90, 4326)
0d60: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
0d70: 64 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73  dIsoNetNode('tes
0d80: 74 6e 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74  tnet', MakePoint
0d90: 28 2d 39 30 2c 20 39 30 2c 20 34 33 32 36 29 29  (-90, 90, 4326))
0da0: 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64  ;..SELECT ST_Add
0db0: 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74  IsoNetNode('test
0dc0: 6e 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28  net', MakePoint(
0dd0: 2d 39 30 2c 20 33 30 2c 20 34 33 32 36 29 29 3b  -90, 30, 4326));
0de0: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49  ..SELECT ST_AddI
0df0: 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e  soNetNode('testn
0e00: 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d  et', MakePoint(-
0e10: 39 30 2c 20 30 2c 20 34 33 32 36 29 29 3b 0d 0a  90, 0, 4326));..
0e20: 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f  SELECT ST_AddIso
0e30: 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74  NetNode('testnet
0e40: 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 39 30  ', MakePoint(-90
0e50: 2c 20 2d 33 30 2c 20 34 33 32 36 29 29 3b 0d 0a  , -30, 4326));..
0e60: 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f  SELECT ST_AddIso
0e70: 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74  NetNode('testnet
0e80: 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 39 30  ', MakePoint(-90
0e90: 2c 20 2d 36 30 2c 20 34 33 32 36 29 29 3b 0d 0a  , -60, 4326));..
0ea0: 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f  SELECT ST_AddIso
0eb0: 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74  NetNode('testnet
0ec0: 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 2d 39 30  ', MakePoint(-90
0ed0: 2c 20 2d 39 30 2c 20 34 33 32 36 29 29 3b 0d 0a  , -90, 4326));..
0ee0: 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73 6f  SELECT ST_AddIso
0ef0: 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65 74  NetNode('testnet
0f00: 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 33 30 2c  ', MakePoint(30,
0f10: 20 30 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c   0, 4326));..SEL
0f20: 45 43 54 20 53 54 5f 41 64 64 49 73 6f 4e 65 74  ECT ST_AddIsoNet
0f30: 4e 6f 64 65 28 27 74 65 73 74 6e 65 74 27 2c 20  Node('testnet', 
0f40: 4d 61 6b 65 50 6f 69 6e 74 28 30 2c 20 30 2c 20  MakePoint(0, 0, 
0f50: 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20  4326));..SELECT 
0f60: 53 54 5f 41 64 64 49 73 6f 4e 65 74 4e 6f 64 65  ST_AddIsoNetNode
0f70: 28 27 74 65 73 74 6e 65 74 27 2c 20 4d 61 6b 65  ('testnet', Make
0f80: 50 6f 69 6e 74 28 2d 33 30 2c 20 30 2c 20 34 33  Point(-30, 0, 43
0f90: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
0fa0: 5f 41 64 64 49 73 6f 4e 65 74 4e 6f 64 65 28 27  _AddIsoNetNode('
0fb0: 74 65 73 74 6e 65 74 27 2c 20 4d 61 6b 65 50 6f  testnet', MakePo
0fc0: 69 6e 74 28 33 30 2c 20 39 30 2c 20 34 33 32 36  int(30, 90, 4326
0fd0: 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41  ));..SELECT ST_A
0fe0: 64 64 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65  ddIsoNetNode('te
0ff0: 73 74 6e 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e  stnet', MakePoin
1000: 74 28 33 30 2c 20 33 30 2c 20 34 33 32 36 29 29  t(30, 30, 4326))
1010: 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64  ;..SELECT ST_Add
1020: 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74  IsoNetNode('test
1030: 6e 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28  net', MakePoint(
1040: 31 38 30 2c 20 39 30 2c 20 34 33 32 36 29 29 3b  180, 90, 4326));
1050: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49  ..SELECT ST_AddI
1060: 73 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e  soNetNode('testn
1070: 65 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 31  et', MakePoint(1
1080: 38 30 2c 20 33 30 2c 20 34 33 32 36 29 29 3b 0d  80, 30, 4326));.
1090: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 49 73  .SELECT ST_AddIs
10a0: 6f 4e 65 74 4e 6f 64 65 28 27 74 65 73 74 6e 65  oNetNode('testne
10b0: 74 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 31 38  t', MakePoint(18
10c0: 30 2c 20 30 2c 20 34 33 32 36 29 29 3b 0d 0a 3c  0, 0, 4326));..<
10d0: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69  /verbatim>..</li
10e0: 3e 3c 2f 75 6c 3e 3c 2f 74 64 3e 0d 0a 3c 74 64  ></ul></td>..<td
10f0: 3e 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 3a  ><img src="http:
1100: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
1110: 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f  t/gaia-sins/topo
1120: 66 69 67 73 2f 6e 65 74 2d 31 2e 70 6e 67 22 20  figs/net-1.png" 
1130: 61 6c 74 3d 22 6e 65 74 2d 65 78 61 6d 70 6c 65  alt="net-example
1140: 2d 31 22 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  -1"></td></tr>..
1150: 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d  <tr><td colspan=
1160: 22 32 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74  "2"><hr></td></t
1170: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 75  r>..<tr><td>..<u
1180: 6c 3e 0d 0a 3c 6c 69 3e 0d 0a 54 68 65 6e 20 77  l>..<li>..Then w
1190: 65 27 6c 6c 20 69 6e 73 65 72 74 20 61 20 62 75  e'll insert a bu
11a0: 6e 63 68 20 6f 66 20 4c 69 6e 6b 73 3a 0d 0a 3c  nch of Links:..<
11b0: 76 65 72 62 61 74 69 6d 3e 53 45 4c 45 43 54 20  verbatim>SELECT 
11c0: 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74  ST_AddLink('test
11d0: 6e 65 74 27 2c 20 31 2c 20 32 2c 20 0d 0a 20 20  net', 1, 2, ..  
11e0: 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78    ST_GeomFromTex
11f0: 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 31  t('LINESTRING(-1
1200: 38 30 20 39 30 2c 20 2d 31 38 30 20 36 30 29 27  80 90, -180 60)'
1210: 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43  , 4326));..SELEC
1220: 54 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65  T ST_AddLink('te
1230: 73 74 6e 65 74 27 2c 20 33 2c 20 34 2c 20 0d 0a  stnet', 3, 4, ..
1240: 20 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54      ST_GeomFromT
1250: 65 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28  ext('LINESTRING(
1260: 2d 31 38 30 20 30 2c 20 2d 31 38 30 20 2d 33 30  -180 0, -180 -30
1270: 29 27 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c  )', 4326));..SEL
1280: 45 43 54 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27  ECT ST_AddLink('
1290: 74 65 73 74 6e 65 74 27 2c 20 34 2c 20 35 2c 20  testnet', 4, 5, 
12a0: 0d 0a 20 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f  ..    ST_GeomFro
12b0: 6d 54 65 78 74 28 27 4c 49 4e 45 53 54 52 49 4e  mText('LINESTRIN
12c0: 47 28 2d 31 38 30 20 2d 33 30 2c 20 2d 31 38 30  G(-180 -30, -180
12d0: 20 2d 36 30 29 27 2c 20 34 33 32 36 29 29 3b 0d   -60)', 4326));.
12e0: 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c 69  .SELECT ST_AddLi
12f0: 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 35 2c  nk('testnet', 5,
1300: 20 36 2c 20 0d 0a 20 20 20 20 53 54 5f 47 65 6f   6, ..    ST_Geo
1310: 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e 45 53  mFromText('LINES
1320: 54 52 49 4e 47 28 2d 31 38 30 20 2d 36 30 2c 20  TRING(-180 -60, 
1330: 2d 31 38 30 20 2d 39 30 29 27 2c 20 34 33 32 36  -180 -90)', 4326
1340: 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41  ));..SELECT ST_A
1350: 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27  ddLink('testnet'
1360: 2c 20 31 2c 20 37 2c 20 0d 0a 20 20 20 20 53 54  , 1, 7, ..    ST
1370: 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c  _GeomFromText('L
1380: 49 4e 45 53 54 52 49 4e 47 28 2d 31 38 30 20 39  INESTRING(-180 9
1390: 30 2c 20 2d 39 30 20 39 30 29 27 2c 20 34 33 32  0, -90 90)', 432
13a0: 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f  6));..SELECT ST_
13b0: 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74  AddLink('testnet
13c0: 27 2c 20 32 2c 20 38 2c 20 0d 0a 20 20 20 20 53  ', 2, 8, ..    S
13d0: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
13e0: 4c 49 4e 45 53 54 52 49 4e 47 28 2d 31 38 30 20  LINESTRING(-180 
13f0: 36 30 2c 20 2d 39 30 20 33 30 29 27 2c 20 34 33  60, -90 30)', 43
1400: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
1410: 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65  _AddLink('testne
1420: 74 27 2c 20 33 2c 20 39 2c 20 0d 0a 20 20 20 20  t', 3, 9, ..    
1430: 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28  ST_GeomFromText(
1440: 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 31 38 30  'LINESTRING(-180
1450: 20 30 2c 20 2d 39 30 20 30 29 27 2c 20 34 33 32   0, -90 0)', 432
1460: 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f  6));..SELECT ST_
1470: 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74  AddLink('testnet
1480: 27 2c 20 36 2c 20 31 32 2c 20 0d 0a 20 20 20 20  ', 6, 12, ..    
1490: 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28  ST_GeomFromText(
14a0: 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 31 38 30  'LINESTRING(-180
14b0: 20 2d 39 30 2c 20 2d 39 30 20 2d 39 30 29 27 2c   -90, -90 -90)',
14c0: 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54   4326));..SELECT
14d0: 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73   ST_AddLink('tes
14e0: 74 6e 65 74 27 2c 20 37 2c 20 38 2c 20 0d 0a 20  tnet', 7, 8, .. 
14f0: 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65     ST_GeomFromTe
1500: 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d  xt('LINESTRING(-
1510: 39 30 20 39 30 2c 20 2d 39 30 20 33 30 29 27 2c  90 90, -90 30)',
1520: 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54   4326));..SELECT
1530: 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73   ST_AddLink('tes
1540: 74 6e 65 74 27 2c 20 38 2c 20 39 2c 20 0d 0a 20  tnet', 8, 9, .. 
1550: 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65     ST_GeomFromTe
1560: 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d  xt('LINESTRING(-
1570: 39 30 20 33 30 2c 20 2d 39 30 20 30 29 27 2c 20  90 30, -90 0)', 
1580: 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20  4326));..SELECT 
1590: 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74  ST_AddLink('test
15a0: 6e 65 74 27 2c 20 39 2c 20 31 30 2c 20 0d 0a 20  net', 9, 10, .. 
15b0: 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65     ST_GeomFromTe
15c0: 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d  xt('LINESTRING(-
15d0: 39 30 20 30 2c 20 2d 39 30 20 2d 33 30 29 27 2c  90 0, -90 -30)',
15e0: 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54   4326));..SELECT
15f0: 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73   ST_AddLink('tes
1600: 74 6e 65 74 27 2c 20 31 30 2c 20 31 31 2c 20 0d  tnet', 10, 11, .
1610: 0a 20 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d  .    ST_GeomFrom
1620: 54 65 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47  Text('LINESTRING
1630: 28 2d 39 30 20 2d 33 30 2c 20 2d 39 30 20 2d 36  (-90 -30, -90 -6
1640: 30 29 27 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45  0)', 4326));..SE
1650: 4c 45 43 54 20 53 54 5f 41 64 64 4c 69 6e 6b 28  LECT ST_AddLink(
1660: 27 74 65 73 74 6e 65 74 27 2c 20 31 31 2c 20 31  'testnet', 11, 1
1670: 32 2c 20 0d 0a 20 20 20 20 53 54 5f 47 65 6f 6d  2, ..    ST_Geom
1680: 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e 45 53 54  FromText('LINEST
1690: 52 49 4e 47 28 2d 39 30 20 2d 36 30 2c 20 2d 39  RING(-90 -60, -9
16a0: 30 20 2d 39 30 29 27 2c 20 34 33 32 36 29 29 3b  0 -90)', 4326));
16b0: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c  ..SELECT ST_AddL
16c0: 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 34  ink('testnet', 4
16d0: 2c 20 31 31 2c 20 0d 0a 20 20 20 20 53 54 5f 47  , 11, ..    ST_G
16e0: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
16f0: 45 53 54 52 49 4e 47 28 2d 31 38 30 20 2d 33 30  ESTRING(-180 -30
1700: 2c 20 2d 39 30 20 2d 36 30 29 27 2c 20 34 33 32  , -90 -60)', 432
1710: 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f  6));..SELECT ST_
1720: 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74  AddLink('testnet
1730: 27 2c 20 35 2c 20 31 32 2c 20 0d 0a 20 20 20 20  ', 5, 12, ..    
1740: 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28  ST_GeomFromText(
1750: 27 4c 49 4e 45 53 54 52 49 4e 47 28 2d 31 38 30  'LINESTRING(-180
1760: 20 2d 36 30 2c 20 2d 39 30 20 2d 39 30 29 27 2c   -60, -90 -90)',
1770: 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54   4326));..SELECT
1780: 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73   ST_AddLink('tes
1790: 74 6e 65 74 27 2c 20 39 2c 20 31 35 2c 20 0d 0a  tnet', 9, 15, ..
17a0: 20 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54      ST_GeomFromT
17b0: 65 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28  ext('LINESTRING(
17c0: 2d 39 30 20 30 2c 20 2d 33 30 20 30 29 27 2c 20  -90 0, -30 0)', 
17d0: 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20  4326));..SELECT 
17e0: 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74  ST_AddLink('test
17f0: 6e 65 74 27 2c 20 31 35 2c 20 31 34 2c 20 0d 0a  net', 15, 14, ..
1800: 20 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54      ST_GeomFromT
1810: 65 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28  ext('LINESTRING(
1820: 2d 33 30 20 30 2c 20 30 20 30 29 27 2c 20 34 33  -30 0, 0 0)', 43
1830: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
1840: 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65  _AddLink('testne
1850: 74 27 2c 20 31 34 2c 20 31 33 2c 20 0d 0a 20 20  t', 14, 13, ..  
1860: 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78    ST_GeomFromTex
1870: 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 30 20  t('LINESTRING(0 
1880: 30 2c 20 33 30 20 30 29 27 2c 20 34 33 32 36 29  0, 30 0)', 4326)
1890: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
18a0: 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c  dLink('testnet',
18b0: 20 31 33 2c 20 32 30 2c 20 0d 0a 20 20 20 20 53   13, 20, ..    S
18c0: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
18d0: 4c 49 4e 45 53 54 52 49 4e 47 28 33 30 20 30 2c  LINESTRING(30 0,
18e0: 20 31 38 30 20 30 29 27 2c 20 34 33 32 36 29 29   180 0)', 4326))
18f0: 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64  ;..SELECT ST_Add
1900: 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20  Link('testnet', 
1910: 31 37 2c 20 31 39 2c 20 0d 0a 20 20 20 20 53 54  17, 19, ..    ST
1920: 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c  _GeomFromText('L
1930: 49 4e 45 53 54 52 49 4e 47 28 33 30 20 33 30 2c  INESTRING(30 30,
1940: 20 31 38 30 20 33 30 29 27 2c 20 34 33 32 36 29   180 30)', 4326)
1950: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
1960: 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c  dLink('testnet',
1970: 20 31 34 2c 20 31 37 2c 20 0d 0a 20 20 20 20 53   14, 17, ..    S
1980: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
1990: 4c 49 4e 45 53 54 52 49 4e 47 28 30 20 30 2c 20  LINESTRING(0 0, 
19a0: 33 30 20 33 30 29 27 2c 20 34 33 32 36 29 29 3b  30 30)', 4326));
19b0: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64 64 4c  ..SELECT ST_AddL
19c0: 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20 31  ink('testnet', 1
19d0: 30 2c 20 31 35 2c 20 0d 0a 20 20 20 20 53 54 5f  0, 15, ..    ST_
19e0: 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49  GeomFromText('LI
19f0: 4e 45 53 54 52 49 4e 47 28 2d 39 30 20 2d 33 30  NESTRING(-90 -30
1a00: 2c 20 2d 33 30 20 30 29 27 2c 20 34 33 32 36 29  , -30 0)', 4326)
1a10: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
1a20: 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c  dLink('testnet',
1a30: 20 31 32 2c 20 31 34 2c 20 0d 0a 20 20 20 20 53   12, 14, ..    S
1a40: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
1a50: 4c 49 4e 45 53 54 52 49 4e 47 28 2d 39 30 20 2d  LINESTRING(-90 -
1a60: 39 30 2c 20 30 20 30 29 27 2c 20 34 33 32 36 29  90, 0 0)', 4326)
1a70: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
1a80: 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c  dLink('testnet',
1a90: 20 31 36 2c 20 31 37 2c 20 0d 0a 20 20 20 20 53   16, 17, ..    S
1aa0: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
1ab0: 4c 49 4e 45 53 54 52 49 4e 47 28 33 30 20 39 30  LINESTRING(30 90
1ac0: 2c 20 33 30 20 33 30 29 27 2c 20 34 33 32 36 29  , 30 30)', 4326)
1ad0: 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41 64  );..SELECT ST_Ad
1ae0: 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c  dLink('testnet',
1af0: 20 31 36 2c 20 31 38 2c 20 0d 0a 20 20 20 20 53   16, 18, ..    S
1b00: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
1b10: 4c 49 4e 45 53 54 52 49 4e 47 28 33 30 20 39 30  LINESTRING(30 90
1b20: 2c 20 31 38 30 20 39 30 29 27 2c 20 34 33 32 36  , 180 90)', 4326
1b30: 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f 41  ));..SELECT ST_A
1b40: 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27  ddLink('testnet'
1b50: 2c 20 31 39 2c 20 31 38 2c 20 0d 0a 20 20 20 20  , 19, 18, ..    
1b60: 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28  ST_GeomFromText(
1b70: 27 4c 49 4e 45 53 54 52 49 4e 47 28 31 38 30 20  'LINESTRING(180 
1b80: 33 30 2c 20 31 38 30 20 39 30 29 27 2c 20 34 33  30, 180 90)', 43
1b90: 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54  26));..SELECT ST
1ba0: 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73 74 6e 65  _AddLink('testne
1bb0: 74 27 2c 20 31 39 2c 20 32 30 2c 20 0d 0a 20 20  t', 19, 20, ..  
1bc0: 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78    ST_GeomFromTex
1bd0: 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28 31 38  t('LINESTRING(18
1be0: 30 20 33 30 2c 20 31 38 30 20 30 29 27 2c 20 34  0 30, 180 0)', 4
1bf0: 33 32 36 29 29 3b 0d 0a 3c 2f 76 65 72 62 61 74  326));..</verbat
1c00: 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c  im>..</li>..</ul
1c10: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 3c 69 6d 67  ></td>..<td><img
1c20: 20 73 72 63 3d 22 68 74 74 70 3a 2f 2f 77 77 77   src="http://www
1c30: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69  .gaia-gis.it/gai
1c40: 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f  a-sins/topofigs/
1c50: 6e 65 74 2d 32 2e 70 6e 67 22 20 61 6c 74 3d 22  net-2.png" alt="
1c60: 6e 65 74 2d 65 78 61 6d 70 6c 65 2d 32 22 3e 3c  net-example-2"><
1c70: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c  /td></tr>..<tr><
1c80: 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22 3e 3c  td colspan="2"><
1c90: 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  hr></td></tr>..<
1ca0: 74 72 3e 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c  tr><td>..<ul>..<
1cb0: 6c 69 3e 0d 0a 57 65 27 6c 6c 20 6e 6f 77 20 61  li>..We'll now a
1cc0: 73 73 69 67 6e 20 61 20 6d 6f 64 69 66 69 65 64  ssign a modified
1cd0: 20 67 65 6f 6d 65 74 72 79 20 74 6f 20 4c 69 6e   geometry to Lin
1ce0: 6b 2d 36 2c 20 4c 69 6e 6b 31 34 20 61 6e 64 20  k-6, Link14 and 
1cf0: 4c 69 6e 6b 2d 31 35 3a 20 0d 0a 3c 76 65 72 62  Link-15: ..<verb
1d00: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54  atim>..SELECT ST
1d10: 5f 43 68 61 6e 67 65 4c 69 6e 6b 47 65 6f 6d 28  _ChangeLinkGeom(
1d20: 27 74 65 73 74 6e 65 74 27 2c 20 36 2c 20 0d 0a  'testnet', 6, ..
1d30: 20 20 20 20 53 54 5f 47 65 6f 6d 46 72 6f 6d 54      ST_GeomFromT
1d40: 65 78 74 28 27 4c 49 4e 45 53 54 52 49 4e 47 28  ext('LINESTRING(
1d50: 2d 31 38 30 20 36 30 2c 20 2d 31 33 35 20 36 30  -180 60, -135 60
1d60: 2c 20 2d 31 33 35 20 33 30 2c 20 2d 39 30 20 33  , -135 30, -90 3
1d70: 30 29 27 2c 20 34 33 32 36 29 29 3b 0d 0a 53 45  0)', 4326));..SE
1d80: 4c 45 43 54 20 53 54 5f 43 68 61 6e 67 65 4c 69  LECT ST_ChangeLi
1d90: 6e 6b 47 65 6f 6d 28 27 74 65 73 74 6e 65 74 27  nkGeom('testnet'
1da0: 2c 20 31 34 2c 20 0d 0a 20 20 20 20 53 54 5f 47  , 14, ..    ST_G
1db0: 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27 4c 49 4e  eomFromText('LIN
1dc0: 45 53 54 52 49 4e 47 28 2d 31 38 30 20 2d 33 30  ESTRING(-180 -30
1dd0: 2c 20 2d 31 31 30 20 2d 33 30 2c 20 2d 31 31 30  , -110 -30, -110
1de0: 20 2d 36 30 2c 20 2d 39 30 20 2d 36 30 29 27 2c   -60, -90 -60)',
1df0: 20 34 33 32 36 29 29 3b 0d 0a 53 45 4c 45 43 54   4326));..SELECT
1e00: 20 53 54 5f 43 68 61 6e 67 65 4c 69 6e 6b 47 65   ST_ChangeLinkGe
1e10: 6f 6d 28 27 74 65 73 74 6e 65 74 27 2c 20 31 35  om('testnet', 15
1e20: 2c 20 0d 0a 20 20 20 20 53 54 5f 47 65 6f 6d 46  , ..    ST_GeomF
1e30: 72 6f 6d 54 65 78 74 28 27 4c 49 4e 45 53 54 52  romText('LINESTR
1e40: 49 4e 47 28 2d 31 38 30 20 2d 36 30 2c 20 2d 31  ING(-180 -60, -1
1e50: 32 30 20 2d 36 30 2c 20 2d 39 30 20 2d 39 30 29  20 -60, -90 -90)
1e60: 27 2c 20 34 33 32 36 29 29 3b 0d 0a 0d 0a 3c 2f  ', 4326));....</
1e70: 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e  verbatim>..</li>
1e80: 0d 0a 3c 6c 69 3e 0d 0a 4e 6f 77 20 77 65 27 6c  ..<li>..Now we'l
1e90: 6c 20 73 70 6c 69 74 20 4c 69 6e 6b 2d 32 30 20  l split Link-20 
1ea0: 62 79 20 69 6e 73 65 72 74 69 6e 67 20 61 20 6e  by inserting a n
1eb0: 65 77 20 4e 6f 64 65 20 28 4e 6f 64 65 2d 32 31  ew Node (Node-21
1ec0: 29 2e 3c 62 72 3e 0d 0a 57 65 27 76 65 20 63 61  ).<br>..We've ca
1ed0: 6c 6c 65 64 20 61 20 3c 62 3e 22 6d 6f 64 22 3c  lled a <b>"mod"<
1ee0: 2f 62 3e 20 6f 70 65 72 61 74 6f 72 2c 20 61 6e  /b> operator, an
1ef0: 64 20 63 6f 6e 73 65 71 75 65 6e 74 6c 79 20 4c  d consequently L
1f00: 69 6e 6b 2d 32 30 20 77 69 6c 6c 20 62 65 20 6d  ink-20 will be m
1f10: 6f 64 69 66 69 65 64 20 61 6e 64 20 4c 69 6e 6b  odified and Link
1f20: 2d 32 38 20 77 69 6c 6c 20 62 65 20 69 6e 73 65  -28 will be inse
1f30: 72 74 65 64 3a 0d 0a 3c 76 65 72 62 61 74 69 6d  rted:..<verbatim
1f40: 3e 0d 0a 53 45 4c 45 43 54 20 53 54 5f 4d 6f 64  >..SELECT ST_Mod
1f50: 47 65 6f 4c 69 6e 6b 53 70 6c 69 74 28 27 74 65  GeoLinkSplit('te
1f60: 73 74 6e 65 74 27 2c 20 32 30 2c 20 4d 61 6b 65  stnet', 20, Make
1f70: 50 6f 69 6e 74 28 31 35 30 20 2c 33 30 2c 20 34  Point(150 ,30, 4
1f80: 33 32 36 29 29 3b 0d 0a 3c 2f 76 65 72 62 61 74  326));..</verbat
1f90: 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  im>..</li>..<li>
1fa0: 0d 0a 57 65 27 6c 6c 20 67 6f 20 74 6f 20 73 70  ..We'll go to sp
1fb0: 6c 69 74 20 4c 69 6e 6b 2d 31 39 20 73 6f 20 4e  lit Link-19 so N
1fc0: 6f 64 65 2d 32 32 20 77 69 6c 6c 20 62 65 20 69  ode-22 will be i
1fd0: 6e 73 65 72 74 65 64 2e 3c 62 72 3e 0d 0a 54 68  nserted.<br>..Th
1fe0: 69 73 20 74 69 6d 65 20 77 65 27 76 65 20 63 61  is time we've ca
1ff0: 6c 6c 65 64 20 61 20 3c 62 3e 22 6e 65 77 22 3c  lled a <b>"new"<
2000: 2f 62 3e 20 6f 70 65 72 61 74 6f 72 20 61 6e 64  /b> operator and
2010: 20 63 6f 6e 73 65 71 75 65 6e 74 6c 79 20 4c 69   consequently Li
2020: 6e 6b 2d 31 39 20 68 61 73 20 62 65 65 6e 20 72  nk-19 has been r
2030: 65 6d 6f 76 65 64 20 61 6e 64 20 72 65 70 6c 61  emoved and repla
2040: 63 65 64 20 62 79 20 4c 69 6e 6b 2d 32 39 20 61  ced by Link-29 a
2050: 6e 64 20 4c 69 6e 6b 2d 33 30 3a 0d 0a 3c 76 65  nd Link-30:..<ve
2060: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
2070: 53 54 5f 4e 65 77 47 65 6f 4c 69 6e 6b 53 70 6c  ST_NewGeoLinkSpl
2080: 69 74 28 27 74 65 73 74 6e 65 74 27 2c 20 31 39  it('testnet', 19
2090: 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 31 35 30 20  , MakePoint(150 
20a0: 2c 30 2c 20 34 33 32 36 29 29 3b 0d 0a 3c 2f 76  ,0, 4326));..</v
20b0: 65 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d  erbatim>..</li>.
20c0: 0a 3c 6c 69 3e 0d 0a 46 69 6e 61 6c 6c 79 20 77  .<li>..Finally w
20d0: 65 27 6c 6c 20 61 64 64 20 61 20 6e 65 77 20 4c  e'll add a new L
20e0: 69 6e 6b 20 28 4c 69 6e 6b 2d 33 31 29 20 63 6f  ink (Link-31) co
20f0: 6e 6e 65 63 74 69 6e 67 20 4e 6f 64 65 2d 32 31  nnecting Node-21
2100: 20 74 6f 20 4e 6f 64 65 2d 32 32 3a 0d 0a 3c 76   to Node-22:..<v
2110: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54  erbatim>..SELECT
2120: 20 53 54 5f 41 64 64 4c 69 6e 6b 28 27 74 65 73   ST_AddLink('tes
2130: 74 6e 65 74 27 2c 20 32 31 2c 20 32 32 2c 20 53  tnet', 21, 22, S
2140: 54 5f 47 65 6f 6d 46 72 6f 6d 54 65 78 74 28 27  T_GeomFromText('
2150: 4c 49 4e 45 53 54 52 49 4e 47 28 31 35 30 20 33  LINESTRING(150 3
2160: 30 2c 20 31 35 30 20 30 29 27 2c 20 34 33 32 36  0, 150 0)', 4326
2170: 29 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  ));..</verbatim>
2180: 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f  ..</li>..</ul></
2190: 74 64 3e 0d 0a 3c 74 64 3e 3c 69 6d 67 20 73 72  td>..<td><img sr
21a0: 63 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61  c="http://www.ga
21b0: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
21c0: 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 6e 65 74  ins/topofigs/net
21d0: 2d 33 2e 70 6e 67 22 20 61 6c 74 3d 22 6e 65 74  -3.png" alt="net
21e0: 2d 65 78 61 6d 70 6c 65 2d 33 22 3e 3c 2f 74 64  -example-3"></td
21f0: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
2200: 63 6f 6c 73 70 61 6e 3d 22 32 22 3e 3c 68 72 3e  colspan="2"><hr>
2210: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
2220: 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e  <td>..<ul>..<li>
2230: 0d 0a 4e 6f 77 20 77 65 27 6c 6c 20 6d 65 72 67  ..Now we'll merg
2240: 65 20 28 61 6b 61 20 68 65 61 6c 29 20 4c 69 6e  e (aka heal) Lin
2250: 6b 2d 31 38 20 61 6e 64 20 4c 69 6e 6b 2d 32 39  k-18 and Link-29
2260: 20 61 6e 64 20 63 6f 6e 73 65 71 75 65 6e 74 6c   and consequentl
2270: 79 20 74 68 65 20 4e 6f 64 65 20 73 68 61 72 65  y the Node share
2280: 64 20 62 79 20 62 6f 74 68 20 74 68 65 6d 20 28  d by both them (
2290: 4e 6f 64 65 2d 31 33 29 20 77 69 6c 6c 20 62 65  Node-13) will be
22a0: 20 72 65 6d 6f 76 65 64 2e 3c 62 72 3e 0d 0a 57   removed.<br>..W
22b0: 65 27 76 65 20 63 61 6c 6c 65 64 20 61 20 3c 62  e've called a <b
22c0: 3e 22 6e 65 77 22 3c 2f 62 3e 20 6f 70 65 72 61  >"new"</b> opera
22d0: 74 6f 72 2c 20 73 6f 20 62 6f 74 68 20 4c 69 6e  tor, so both Lin
22e0: 6b 2d 31 38 20 61 6e 64 20 4c 69 6e 6b 2d 32 39  k-18 and Link-29
22f0: 20 77 69 6c 6c 20 62 65 20 72 65 6d 6f 76 65 64   will be removed
2300: 20 61 6e 64 20 72 65 70 6c 61 63 65 64 20 62 79   and replaced by
2310: 20 4c 69 6e 6b 2d 33 32 3a 0d 0a 3c 76 65 72 62   Link-32:..<verb
2320: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54  atim>..SELECT ST
2330: 5f 4e 65 77 4c 69 6e 6b 48 65 61 6c 28 27 74 65  _NewLinkHeal('te
2340: 73 74 6e 65 74 27 2c 20 31 38 2c 20 32 39 29 3b  stnet', 18, 29);
2350: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c  ..</verbatim>..<
2360: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 0d 0a 57 65 27 6c  /li>..<li>..We'l
2370: 6c 20 6e 6f 77 20 72 65 6d 6f 76 65 20 4c 69 6e  l now remove Lin
2380: 6b 2d 32 32 3b 20 74 68 65 20 77 65 27 6c 6c 20  k-22; the we'll 
2390: 68 65 61 6c 20 4c 69 6e 6b 2d 31 31 20 61 6e 64  heal Link-11 and
23a0: 20 4c 69 6e 6b 2d 31 32 20 73 6f 20 74 6f 20 72   Link-12 so to r
23b0: 65 6d 6f 76 65 20 4e 6f 64 65 2d 31 30 2e 3c 62  emove Node-10.<b
23c0: 72 3e 0d 0a 54 68 69 73 20 74 69 6d 65 20 74 6f  r>..This time to
23d0: 6f 20 77 65 27 76 65 20 63 61 6c 6c 65 64 20 61  o we've called a
23e0: 20 3c 62 3e 22 6e 65 77 22 3c 2f 62 3e 20 6f 70   <b>"new"</b> op
23f0: 65 72 61 74 6f 72 2c 20 73 6f 20 62 6f 74 68 20  erator, so both 
2400: 4c 69 6e 6b 2d 31 31 20 61 6e 64 20 4c 69 6e 6b  Link-11 and Link
2410: 2d 31 32 20 77 69 6c 6c 20 62 65 20 72 65 6d 6f  -12 will be remo
2420: 76 65 64 20 61 6e 64 20 72 65 70 6c 61 63 65 64  ved and replaced
2430: 20 62 79 20 4c 69 6e 6b 2d 33 33 3a 0d 0a 3c 76   by Link-33:..<v
2440: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54  erbatim>..SELECT
2450: 20 53 54 5f 52 65 6d 6f 76 65 4c 69 6e 6b 28 27   ST_RemoveLink('
2460: 74 65 73 74 6e 65 74 27 2c 20 32 32 29 3b 0d 0a  testnet', 22);..
2470: 53 45 4c 45 43 54 20 53 54 5f 4e 65 77 4c 69 6e  SELECT ST_NewLin
2480: 6b 48 65 61 6c 28 27 74 65 73 74 6e 65 74 27 2c  kHeal('testnet',
2490: 20 31 31 2c 20 31 32 29 3b 0d 0a 3c 2f 76 65 72   11, 12);..</ver
24a0: 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c  batim>..</li>..<
24b0: 6c 69 3e 0d 0a 46 69 6e 61 6c 6c 79 20 77 65 27  li>..Finally we'
24c0: 6c 6c 20 68 65 61 6c 20 4c 69 6e 6b 2d 31 36 20  ll heal Link-16 
24d0: 61 6e 64 20 4c 69 6e 6b 2d 31 37 20 73 6f 20 74  and Link-17 so t
24e0: 6f 20 72 65 6d 6f 76 65 20 4e 6f 64 65 2d 31 35  o remove Node-15
24f0: 2e 3c 62 72 3e 0d 0a 41 6e 79 77 61 79 20 74 68  .<br>..Anyway th
2500: 69 73 20 74 69 6d 65 20 77 65 27 76 65 20 63 61  is time we've ca
2510: 6c 6c 65 64 20 61 20 3c 62 3e 22 6d 6f 64 22 3c  lled a <b>"mod"<
2520: 2f 62 3e 20 6f 70 65 72 61 74 6f 72 2c 20 73 6f  /b> operator, so
2530: 20 4c 69 6e 6b 2d 31 36 20 77 69 6c 6c 20 62 65   Link-16 will be
2540: 20 6d 6f 64 69 66 69 65 64 20 61 6e 64 20 4c 69   modified and Li
2550: 6e 6b 2d 31 37 20 77 69 6c 6c 20 62 65 20 72 65  nk-17 will be re
2560: 6d 6f 76 65 64 3a 0d 0a 3c 76 65 72 62 61 74 69  moved:..<verbati
2570: 6d 3e 0d 0a 53 45 4c 45 43 54 20 53 54 5f 4d 6f  m>..SELECT ST_Mo
2580: 64 4c 69 6e 6b 48 65 61 6c 28 27 74 65 73 74 6e  dLinkHeal('testn
2590: 65 74 27 2c 20 31 36 2c 20 31 37 29 3b 0d 0a 3c  et', 16, 17);..<
25a0: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69  /verbatim>..</li
25b0: 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 0d  >..</ul>..</td>.
25c0: 0a 3c 74 64 3e 3c 69 6d 67 20 73 72 63 3d 22 68  .<td><img src="h
25d0: 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67  ttp://www.gaia-g
25e0: 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f  is.it/gaia-sins/
25f0: 74 6f 70 6f 66 69 67 73 2f 6e 65 74 2d 34 2e 70  topofigs/net-4.p
2600: 6e 67 22 20 61 6c 74 3d 22 6e 65 74 2d 65 78 61  ng" alt="net-exa
2610: 6d 70 6c 65 2d 34 22 3e 3c 2f 74 64 3e 3c 2f 74  mple-4"></td></t
2620: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73  r>..<tr><td cols
2630: 70 61 6e 3d 22 32 22 3e 3c 68 72 3e 3c 2f 74 64  pan="2"><hr></td
2640: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e  ></tr>..<tr><td>
2650: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 0d 0a 4e 6f  ..<ul>..<li>..No
2660: 77 20 77 65 27 6c 6c 20 72 65 6d 6f 76 65 20 62  w we'll remove b
2670: 6f 74 68 20 4c 69 6e 6b 2d 32 37 20 61 6e 64 20  oth Link-27 and 
2680: 4c 69 6e 6b 2d 33 30 2e 3c 62 72 3e 0d 0a 54 68  Link-30.<br>..Th
2690: 69 73 20 61 63 74 69 6f 6e 20 77 69 6c 6c 20 66  is action will f
26a0: 72 65 65 20 4e 6f 64 65 2d 32 30 20 66 72 6f 6d  ree Node-20 from
26b0: 20 61 6e 79 20 4c 69 6e 6b 20 72 65 66 65 72 65   any Link refere
26c0: 6e 63 65 3b 20 69 6e 20 6f 74 68 65 72 20 77 6f  nce; in other wo
26d0: 72 64 73 20 6e 6f 77 20 4e 6f 64 65 2d 32 30 20  rds now Node-20 
26e0: 69 73 20 6f 6e 63 65 20 61 67 61 69 6e 20 61 6e  is once again an
26f0: 20 49 73 6f 6c 61 74 65 64 20 4e 6f 64 65 2c 20   Isolated Node, 
2700: 61 6e 64 20 77 65 20 63 61 6e 20 73 61 66 65 6c  and we can safel
2710: 79 20 72 65 6d 6f 76 65 20 69 74 3a 0d 0a 3c 76  y remove it:..<v
2720: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54  erbatim>..SELECT
2730: 20 53 54 5f 52 65 6d 6f 76 65 4c 69 6e 6b 28 27   ST_RemoveLink('
2740: 74 65 73 74 6e 65 74 27 2c 20 32 37 29 3b 0d 0a  testnet', 27);..
2750: 53 45 4c 45 43 54 20 53 54 5f 52 65 6d 6f 76 65  SELECT ST_Remove
2760: 4c 69 6e 6b 28 27 74 65 73 74 6e 65 74 27 2c 20  Link('testnet', 
2770: 33 30 29 3b 0d 0a 53 45 4c 45 43 54 20 53 54 5f  30);..SELECT ST_
2780: 52 65 6d 49 73 6f 4e 65 74 4e 6f 64 65 28 27 74  RemIsoNetNode('t
2790: 65 73 74 6e 65 74 27 2c 20 32 30 29 3b 0d 0a 3c  estnet', 20);..<
27a0: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69  /verbatim>..</li
27b0: 3e 0d 0a 3c 6c 69 3e 0d 0a 41 73 20 61 20 6c 61  >..<li>..As a la
27c0: 73 74 20 73 74 65 70 20 63 6f 6e 63 6c 75 64 69  st step concludi
27d0: 6e 67 20 74 68 69 73 20 74 75 74 6f 72 69 61 6c  ng this tutorial
27e0: 20 77 65 20 63 61 6e 20 6e 6f 77 20 63 68 65 63   we can now chec
27f0: 6b 20 6f 75 72 20 4e 65 74 77 6f 72 6b 20 66 6f  k our Network fo
2800: 72 20 63 6f 6e 73 69 73 74 65 6e 63 79 3a 20 0d  r consistency: .
2810: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c  .<verbatim>..SEL
2820: 45 43 54 20 53 54 5f 56 61 6c 69 64 53 70 61 74  ECT ST_ValidSpat
2830: 69 61 6c 4e 65 74 28 27 74 65 73 74 6e 65 74 27  ialNet('testnet'
2840: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d  );..</verbatim>.
2850: 0a 59 6f 75 20 63 61 6e 20 65 78 61 6d 69 6e 65  .You can examine
2860: 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69   the correspondi
2870: 6e 67 20 64 69 61 67 6e 6f 73 74 69 63 20 72 65  ng diagnostic re
2880: 70 6f 72 74 20 73 74 6f 72 65 64 20 69 6e 20 74  port stored in t
2890: 68 65 20 74 65 6d 70 6f 72 61 72 79 20 44 42 20  he temporary DB 
28a0: 74 61 62 6c 65 20 6e 61 6d 65 64 20 3c 62 3e 54  table named <b>T
28b0: 45 4d 50 2e 74 65 73 74 6e 65 74 5f 76 61 6c 69  EMP.testnet_vali
28c0: 64 61 74 65 5f 73 70 61 74 69 61 6c 6e 65 74 3c  date_spatialnet<
28d0: 2f 62 3e 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  /b>:..<verbatim>
28e0: 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20  ..SELECT * FROM 
28f0: 54 45 4d 50 2e 74 65 73 74 6e 65 74 5f 76 61 6c  TEMP.testnet_val
2900: 69 64 61 74 65 5f 73 70 61 74 69 61 6c 6e 65 74  idate_spatialnet
2910: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  ;..</verbatim>..
2920: 41 73 20 79 6f 75 20 63 61 6e 20 65 61 73 69 6c  As you can easil
2930: 79 20 63 68 65 63 6b 2c 20 74 68 65 20 74 61 62  y check, the tab
2940: 6c 65 20 69 73 20 63 6f 6d 70 6c 65 74 65 6c 79  le is completely
2950: 20 65 6d 70 74 79 2c 20 61 6e 64 20 74 68 69 73   empty, and this
2960: 20 6d 65 61 6e 73 20 74 68 61 74 20 79 6f 75 72   means that your
2970: 20 4e 65 74 77 6f 72 6b 20 69 73 20 66 75 6c 6c   Network is full
2980: 79 20 63 6f 6e 73 69 73 74 65 6e 74 2e 20 0d 0a  y consistent. ..
2990: 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f  </li>..</ul>..</
29a0: 74 64 3e 0d 0a 3c 74 64 3e 3c 69 6d 67 20 73 72  td>..<td><img sr
29b0: 63 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61  c="http://www.ga
29c0: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
29d0: 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 6e 65 74  ins/topofigs/net
29e0: 2d 35 2e 70 6e 67 22 20 61 6c 74 3d 22 6e 65 74  -5.png" alt="net
29f0: 2d 65 78 61 6d 70 6c 65 2d 35 22 3e 3c 2f 74 64  -example-5"></td
2a00: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
2a10: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65  <br><br>..<table
2a20: 20 77 69 64 74 68 3d 22 31 30 30 25 22 3e 3c 74   width="100%"><t
2a30: 72 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33  r>..<td width="3
2a40: 33 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22  3%" align="left"
2a50: 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a  ><a href="https:
2a60: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
2a70: 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74  t/fossil/libspat
2a80: 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65  ialite/wiki?name
2a90: 3d 74 6f 70 6f 2d 73 74 61 72 74 22 3e 70 72 65  =topo-start">pre
2aa0: 76 69 6f 75 73 20 70 61 67 65 3c 2f 61 3e 3c 2f  vious page</a></
2ab0: 74 64 3e 0d 0a 3c 74 64 20 61 6c 69 67 6e 3d 22  td>..<td align="
2ac0: 63 65 6e 74 65 72 22 3e 3c 61 20 68 72 65 66 3d  center"><a href=
2ad0: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69  "https://www.gai
2ae0: 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f  a-gis.it/fossil/
2af0: 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69  libspatialite/wi
2b00: 6b 69 3f 6e 61 6d 65 3d 49 53 4f 2b 54 6f 70 6f  ki?name=ISO+Topo
2b10: 6c 6f 67 79 22 3e 62 61 63 6b 20 74 6f 20 69 6e  logy">back to in
2b20: 64 65 78 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74  dex</a></td>..<t
2b30: 64 20 77 69 64 74 68 3d 22 33 33 25 22 20 61 6c  d width="33%" al
2b40: 69 67 6e 3d 22 72 69 67 68 74 22 3e 3c 61 20 68  ign="right"><a h
2b50: 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77  ref="https://www
2b60: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73  .gaia-gis.it/fos
2b70: 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74  sil/libspatialit
2b80: 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 74 6f 70 6f  e/wiki?name=topo
2b90: 2d 69 6e 74 65 72 6d 65 64 69 61 74 65 22 3e 6e  -intermediate">n
2ba0: 65 78 74 20 70 61 67 65 3c 2f 61 3e 3c 2f 74 64  ext page</a></td
2bb0: 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e  >..</tr></table>
2bc0: 0a 5a 20 35 36 35 35 66 30 36 34 39 32 37 62 39  .Z 5655f064927b9
2bd0: 33 37 38 34 30 65 62 65 63 38 32 63 33 30 64 36  37840ebec82c30d6
2be0: 31 31 33 0a                                      113.