Hex Artifact Content
Not logged in

Artifact c0b3a1ee6c19eab3e34ed0ad30f6fe6e4c60373c:

Wiki page [topo-advanced] by sandro 2015-11-19 13:04:17.
0000: 44 20 32 30 31 35 2d 31 31 2d 31 39 54 31 33 3a  D 2015-11-19T13:
0010: 30 34 3a 31 37 2e 36 32 36 0a 4c 20 74 6f 70 6f  04:17.626.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 63 35 62 66  -advanced.P c5bf
0030: 62 65 35 63 66 31 36 31 38 31 61 39 38 39 32 65  be5cf16181a9892e
0040: 34 36 66 32 34 31 30 35 64 37 33 66 31 62 33 61  46f24105d73f1b3a
0050: 61 65 62 31 0a 55 20 73 61 6e 64 72 6f 0a 57 20  aeb1.U sandro.W 
0060: 33 33 31 35 32 0a 3c 74 61 62 6c 65 20 63 65 6c  33152.<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 54 6f 70 6f 6c 6f 67 79  ">..<h1>Topology
00f0: 2d 47 65 6f 6d 65 74 72 79 3a 20 61 6e 20 61 64  -Geometry: an ad
0100: 76 61 6e 63 65 64 20 74 75 74 6f 72 69 61 6c 3c  vanced tutorial<
0110: 2f 68 31 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e  /h1>..</td></tr>
0120: 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 74 61 62 6c 65  </table>..<table
0130: 20 77 69 64 74 68 3d 22 31 30 30 25 22 3e 3c 74   width="100%"><t
0140: 72 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33  r>..<td width="3
0150: 33 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22  3%" align="left"
0160: 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a  ><a href="https:
0170: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
0180: 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74  t/fossil/libspat
0190: 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65  ialite/wiki?name
01a0: 3d 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 69 61  =topo-intermedia
01b0: 74 65 22 3e 70 72 65 76 69 6f 75 73 20 70 61 67  te">previous pag
01c0: 65 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20  e</a></td>..<td 
01d0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c  align="center"><
01e0: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f  a href="https://
01f0: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f  www.gaia-gis.it/
0200: 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61  fossil/libspatia
0210: 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 6d  lite/wiki?name=m
0220: 69 73 63 2d 64 6f 63 73 22 3e 62 61 63 6b 20 74  isc-docs">back t
0230: 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f 74 64 3e  o index</a></td>
0240: 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 25  ..<td width="33%
0250: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  " align="right">
0260: 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 61  </td>..</tr></ta
0270: 62 6c 65 3e 0d 0a 3c 68 33 3e 54 6f 70 6f 4c 61  ble>..<h3>TopoLa
0280: 79 65 72 73 20 61 6e 64 20 54 6f 70 6f 46 65 61  yers and TopoFea
0290: 74 75 72 65 73 3c 2f 68 33 3e 0d 0a 49 6e 20 74  tures</h3>..In t
02a0: 68 65 20 70 72 65 76 69 6f 75 73 20 74 75 74 6f  he previous tuto
02b0: 72 69 61 6c 20 77 65 27 76 65 20 65 78 61 6d 69  rial we've exami
02c0: 6e 65 64 20 61 20 66 69 72 73 74 20 63 6f 75 70  ned a first coup
02d0: 6c 65 20 6f 66 20 53 51 4c 20 66 75 6e 63 74 69  le of SQL functi
02e0: 6f 6e 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20  ons intended to 
02f0: 65 78 70 6f 72 74 20 61 20 47 65 6f 54 61 62 6c  export a GeoTabl
0300: 65 20 6f 75 74 20 66 72 6f 6d 20 61 6e 20 65 78  e out from an ex
0310: 69 73 74 69 6e 67 20 54 6f 70 6f 6c 6f 67 79 3a  isting Topology:
0320: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 54 6f 47 65   <b>TopoGeo_ToGe
0330: 6f 54 61 62 6c 65 28 29 3c 2f 62 3e 20 61 6e 64  oTable()</b> and
0340: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 54 6f 47 65   <b>TopoGeo_ToGe
0350: 6f 54 61 62 6c 65 47 65 6e 65 72 61 6c 69 7a 65  oTableGeneralize
0360: 28 29 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 41 6e 79  ()</b>.<br>..Any
0370: 77 61 79 20 53 70 61 74 69 61 4c 69 74 65 20 73  way SpatiaLite s
0380: 75 70 70 6f 72 74 73 20 61 6e 20 6d 6f 72 65 20  upports an more 
0390: 73 6f 70 68 69 73 74 69 63 61 74 65 64 20 28 61  sophisticated (a
03a0: 6e 64 20 63 6f 6d 70 6c 65 78 29 20 61 70 70 72  nd complex) appr
03b0: 6f 61 63 68 20 62 61 73 65 64 20 6f 6e 20 3c 62  oach based on <b
03c0: 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e 20  >TopoLayers</b> 
03d0: 61 6e 64 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75  and <b>TopoFeatu
03e0: 72 65 73 3c 2f 62 3e 20 73 70 65 63 69 66 69 63  res</b> specific
03f0: 61 6c 6c 79 20 69 6e 74 65 6e 64 65 64 20 74 6f  ally intended to
0400: 20 73 75 70 70 6f 72 74 20 61 20 76 65 72 79 20   support a very 
0410: 66 6c 65 78 69 62 6c 65 20 6d 65 63 68 61 6e 69  flexible mechani
0420: 73 6d 20 66 6f 72 20 65 78 70 6f 72 74 69 6e 67  sm for exporting
0430: 20 61 20 66 75 6c 6c 20 73 65 74 20 6f 66 20 47   a full set of G
0440: 65 6f 54 61 62 6c 65 28 73 29 20 64 69 72 65 63  eoTable(s) direc
0450: 74 6c 79 20 64 65 72 69 76 69 6e 67 20 66 72 6f  tly deriving fro
0460: 6d 20 61 20 54 6f 70 6f 6c 6f 67 79 2e 0d 0a 3c  m a Topology...<
0470: 68 34 3e 61 20 63 6f 6e 63 65 70 74 75 61 6c 20  h4>a conceptual 
0480: 72 65 66 65 72 65 6e 63 65 20 66 72 61 6d 65 77  reference framew
0490: 6f 72 6b 3c 2f 68 34 3e 0d 0a 3c 75 6c 3e 0d 0a  ork</h4>..<ul>..
04a0: 3c 6c 69 3e 61 6e 20 49 53 4f 20 54 6f 70 6f 6c  <li>an ISO Topol
04b0: 6f 67 79 20 69 73 20 6a 75 73 74 20 69 6e 74 65  ogy is just inte
04c0: 6e 64 65 64 20 74 6f 20 73 75 70 70 6f 72 74 20  nded to support 
04d0: 61 20 63 6f 6e 73 69 73 74 65 6e 74 20 73 65 74  a consistent set
04e0: 20 6f 66 20 3c 62 3e 4e 6f 64 65 73 3c 2f 62 3e   of <b>Nodes</b>
04f0: 2c 20 3c 62 3e 45 64 67 65 73 3c 2f 62 3e 20 61  , <b>Edges</b> a
0500: 6e 64 20 3c 62 3e 46 61 63 65 73 3c 2f 62 3e 20  nd <b>Faces</b> 
0510: 70 72 69 6d 69 74 69 76 65 73 20 66 75 6c 6c 79  primitives fully
0520: 20 63 6f 76 65 72 69 6e 67 20 74 68 65 20 70 6c   covering the pl
0530: 61 6e 65 2e 0d 0a 54 6f 70 6f 6c 6f 67 79 20 70  ane...Topology p
0540: 72 69 6d 69 74 69 76 65 73 20 63 6f 72 72 65 73  rimitives corres
0550: 70 6f 6e 64 20 74 6f 20 70 75 72 65 20 67 65 6f  pond to pure geo
0560: 6d 65 74 72 69 65 73 2c 20 61 6e 64 20 63 61 6e  metries, and can
0570: 20 6e 65 76 65 72 20 62 65 20 64 69 72 65 63 74   never be direct
0580: 6c 79 20 20 61 73 73 6f 63 69 61 74 65 64 20 74  ly  associated t
0590: 6f 20 61 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  o a correspondin
05a0: 67 20 73 65 74 20 6f 66 20 69 6e 66 6f 72 6d 61  g set of informa
05b0: 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 2e  tion attributes.
05c0: 0d 0a 42 6f 74 68 20 4e 6f 64 65 20 61 6e 64 20  ..Both Node and 
05d0: 45 64 67 65 20 70 72 69 6d 69 74 69 76 65 73 20  Edge primitives 
05e0: 64 69 72 65 63 74 6c 79 20 63 6f 72 72 65 73 70  directly corresp
05f0: 6f 6e 64 20 74 6f 20 61 20 3c 75 3e 3c 69 3e 72  ond to a <u><i>r
0600: 65 61 6c 20 67 65 6f 6d 65 74 72 79 3c 2f 69 3e  eal geometry</i>
0610: 3c 2f 75 3e 2c 20 62 75 74 20 46 61 63 65 20 70  </u>, but Face p
0620: 72 69 6d 69 74 69 76 65 73 20 73 69 6d 70 6c 79  rimitives simply
0630: 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 6f 20 61   correspond to a
0640: 20 3c 75 3e 3c 69 3e 76 69 72 74 75 61 6c 20 67   <u><i>virtual g
0650: 65 6f 6d 65 74 72 79 3c 2f 69 3e 3c 2f 75 3e 20  eometry</i></u> 
0660: 74 68 75 73 20 6e 65 63 65 73 73 61 72 69 6c 79  thus necessarily
0670: 20 72 65 71 75 69 72 69 6e 67 20 74 6f 20 62 65   requiring to be
0680: 20 64 79 6e 61 6d 69 63 61 6c 6c 79 20 72 65 63   dynamically rec
0690: 6f 6e 73 74 72 75 63 74 65 64 20 65 76 65 72 79  onstructed every
06a0: 20 74 69 6d 65 20 74 68 61 74 20 74 68 65 79 20   time that they 
06b0: 61 72 65 20 72 65 66 65 72 65 6e 63 65 64 20 28  are referenced (
06c0: 61 6e 64 20 74 68 69 73 20 63 6f 75 6c 64 20 65  and this could e
06d0: 61 73 69 6c 79 20 62 65 63 6f 6d 65 20 61 20 72  asily become a r
06e0: 65 61 6c 20 62 6f 74 74 6c 65 6e 65 63 6b 29 2e  eal bottleneck).
06f0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6f 6e 20 74 68  </li>..<li>on th
0700: 65 20 6f 74 68 65 72 20 68 61 6e 64 20 61 20 47  e other hand a G
0710: 65 6f 54 61 62 6c 65 20 28 61 6b 61 20 3c 75 3e  eoTable (aka <u>
0720: 3c 69 3e 6c 61 79 65 72 3c 2f 69 3e 3c 2f 75 3e  <i>layer</i></u>
0730: 2c 20 61 73 20 69 6e 20 74 68 65 20 63 6f 6d 6d  , as in the comm
0740: 6f 6e 20 47 49 53 20 70 61 72 6c 61 6e 63 65 29  on GIS parlance)
0750: 20 69 73 20 61 6c 77 61 79 73 20 62 61 73 65 64   is always based
0760: 20 6f 6e 20 6d 61 6e 79 20 64 69 73 74 69 6e 63   on many distinc
0770: 74 20 66 65 61 74 75 72 65 73 2c 20 61 6e 64 20  t features, and 
0780: 66 6f 72 20 65 61 63 68 20 66 65 61 74 75 72 65  for each feature
0790: 20 61 20 47 65 6f 6d 65 74 72 79 20 61 6e 64 20   a Geometry and 
07a0: 61 6e 20 61 73 73 6f 63 69 61 74 65 64 20 73 65  an associated se
07b0: 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  t of information
07c0: 20 61 74 74 72 69 62 75 74 65 73 20 61 72 65 20   attributes are 
07d0: 65 78 70 65 63 74 65 64 20 74 6f 20 62 65 20 64  expected to be d
07e0: 65 63 6c 61 72 65 64 2e 3c 2f 6c 69 3e 0d 0a 3c  eclared.</li>..<
07f0: 6c 69 3e 74 68 65 72 65 20 69 73 20 66 75 72 74  li>there is furt
0800: 68 65 72 20 64 69 66 66 65 72 65 6e 63 65 20 74  her difference t
0810: 6f 20 62 65 20 74 61 6b 65 6e 20 69 6e 20 70 72  o be taken in pr
0820: 6f 70 65 72 20 61 63 63 6f 75 6e 74 3a 20 54 6f  oper account: To
0830: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
0840: 73 20 6e 65 63 65 73 73 61 72 69 6c 79 20 61 72  s necessarily ar
0850: 65 20 65 6c 65 6d 65 6e 74 61 72 79 2e 20 46 65  e elementary. Fe
0860: 61 74 75 72 65 20 47 65 6f 6d 65 74 72 69 65 73  ature Geometries
0870: 20 63 61 6e 20 75 73 75 61 6c 6c 79 20 72 65 70   can usually rep
0880: 72 65 73 65 6e 74 20 73 6f 6d 65 20 63 6f 6d 70  resent some comp
0890: 6c 65 78 20 74 79 70 65 3a 20 4d 55 4c 54 49 50  lex type: MULTIP
08a0: 4f 49 4e 54 2c 20 4d 55 4c 54 49 4c 49 4e 45 53  OINT, MULTILINES
08b0: 54 52 49 4e 47 2c 20 4d 55 4c 54 49 50 4f 4c 59  TRING, MULTIPOLY
08c0: 47 4f 4e 20 61 6e 64 2c 20 6d 61 79 20 62 65 2c  GON and, may be,
08d0: 20 47 45 4f 4d 45 54 52 59 43 4f 4c 4c 45 43 54   GEOMETRYCOLLECT
08e0: 49 4f 4e 2e 20 53 6f 20 69 74 20 73 68 6f 75 6c  ION. So it shoul
08f0: 64 20 62 65 20 61 62 73 6f 6c 75 74 65 6c 79 20  d be absolutely 
0900: 63 6c 65 61 72 20 74 68 61 74 20 61 20 46 65 61  clear that a Fea
0910: 74 75 72 65 20 47 65 6f 6d 65 74 72 79 20 64 6f  ture Geometry do
0920: 65 73 20 6e 6f 74 20 6e 65 63 65 73 73 61 72 69  es not necessari
0930: 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74  ly corresponds t
0940: 6f 20 61 20 73 69 6e 67 6c 65 20 54 6f 70 6f 6c  o a single Topol
0950: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 20 3b 20  ogy primitive ; 
0960: 61 20 46 65 61 74 75 72 65 20 47 65 6f 6d 65 74  a Feature Geomet
0970: 72 79 20 63 6f 75 6c 64 20 65 61 73 69 6c 79 20  ry could easily 
0980: 62 65 20 64 65 72 69 76 65 64 20 66 72 6f 6d 20  be derived from 
0990: 61 67 67 72 65 67 61 74 69 6e 67 20 6d 61 6e 79  aggregating many
09a0: 20 64 69 66 66 65 72 65 6e 74 20 54 6f 70 6f 6c   different Topol
09b0: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 2e 3c  ogy primitives.<
09c0: 2f 6c 69 3e 20 0d 0a 3c 6c 69 3e 74 68 61 74 27  /li> ..<li>that'
09d0: 73 20 6e 6f 74 20 61 6c 6c 3a 20 6d 61 6e 79 20  s not all: many 
09e0: 64 69 66 66 65 72 65 6e 74 20 47 65 6f 54 61 62  different GeoTab
09f0: 6c 65 73 20 63 6f 75 6c 64 20 65 76 65 6e 74 75  les could eventu
0a00: 61 6c 6c 79 20 62 65 20 64 65 72 69 76 65 64 20  ally be derived 
0a10: 66 72 6f 6d 20 61 20 73 69 6e 67 6c 65 20 54 6f  from a single To
0a20: 70 6f 6c 6f 67 79 3b 20 61 6e 64 20 74 68 65 20  pology; and the 
0a30: 73 61 6d 65 20 54 6f 70 6f 6c 6f 67 79 20 70 72  same Topology pr
0a40: 69 6d 69 74 69 76 65 20 63 6f 75 6c 64 20 70 6c  imitive could pl
0a50: 61 79 20 61 20 76 65 72 79 20 64 69 66 66 65 72  ay a very differ
0a60: 65 6e 74 20 72 6f 6c 65 20 69 6e 20 65 76 65 72  ent role in ever
0a70: 79 6f 6e 65 20 6f 66 20 74 68 65 73 65 20 47 65  yone of these Ge
0a80: 6f 54 61 62 6c 65 73 2e 3c 62 72 3e 0d 0a 4a 75  oTables.<br>..Ju
0a90: 73 74 20 61 20 62 61 73 69 63 61 6c 6c 79 20 73  st a basically s
0aa0: 69 6d 70 6c 65 20 65 78 61 6d 70 6c 65 3a 20 69  imple example: i
0ab0: 6d 61 67 69 6e 65 20 61 20 54 6f 70 6f 6c 6f 67  magine a Topolog
0ac0: 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20  y corresponding 
0ad0: 74 6f 20 73 6f 6d 65 20 6c 61 6e 64 20 72 65 67  to some land reg
0ae0: 69 73 74 72 79 20 6d 61 70 2e 20 57 65 27 6c 6c  istry map. We'll
0af0: 20 73 75 72 65 6c 79 20 68 61 76 65 20 6d 61 6e   surely have man
0b00: 79 20 70 6f 74 65 6e 74 69 61 6c 20 6c 61 79 65  y potential laye
0b10: 72 73 3a 20 62 75 69 6c 64 69 6e 67 73 2c 20 61  rs: buildings, a
0b20: 67 72 69 63 75 6c 74 75 72 61 6c 20 6c 61 6e 64  gricultural land
0b30: 2c 20 70 6f 70 75 6c 61 74 65 64 20 70 6c 61 63  , populated plac
0b40: 65 73 2c 20 61 64 6d 69 6e 69 73 74 72 61 74 69  es, administrati
0b50: 76 65 20 62 6f 75 6e 64 61 72 69 65 73 2c 20 72  ve boundaries, r
0b60: 6f 61 64 73 2c 20 70 6f 6e 64 73 2c 20 72 69 76  oads, ponds, riv
0b70: 65 72 73 2c 20 66 65 6e 63 65 73 20 61 6e 64 20  ers, fences and 
0b80: 73 6f 20 6f 6e 2e 3c 62 72 3e 0d 0a 49 6e 20 73  so on.<br>..In s
0b90: 75 63 68 20 61 20 63 6f 6e 74 65 78 74 20 61 20  uch a context a 
0ba0: 66 65 6e 63 65 20 63 6f 75 6c 64 20 65 61 73 69  fence could easi
0bb0: 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 6f  ly correspond to
0bc0: 20 61 20 46 65 61 74 75 72 65 20 77 69 74 68 69   a Feature withi
0bd0: 6e 20 74 68 65 20 22 3c 69 3e 3c 62 3e 66 65 6e  n the "<i><b>fen
0be0: 63 65 73 3c 2f 62 3e 3c 2f 69 3e 22 20 6c 61 79  ces</b></i>" lay
0bf0: 65 72 2c 20 63 6f 75 6c 64 20 70 72 6f 62 61 62  er, could probab
0c00: 6c 79 20 64 65 6c 69 6d 69 74 20 74 77 6f 20 61  ly delimit two a
0c10: 64 6a 61 63 65 6e 74 20 61 67 72 69 63 75 6c 74  djacent agricult
0c20: 75 72 61 6c 20 61 72 65 61 73 20 61 6e 64 20 63  ural areas and c
0c30: 6f 75 6c 64 20 65 76 65 6e 74 75 61 6c 6c 79 20  ould eventually 
0c40: 62 65 20 70 61 72 74 20 6f 66 20 73 6f 6d 65 20  be part of some 
0c50: 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20 62  administrative b
0c60: 6f 75 6e 64 61 72 79 2e 3c 2f 6c 69 3e 0d 0a 3c  oundary.</li>..<
0c70: 6c 69 3e 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73  li><b>TopoLayers
0c80: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 54 6f 70 6f  </b> and <b>Topo
0c90: 46 65 61 74 75 72 65 73 3c 2f 62 3e 20 72 65 70  Features</b> rep
0ca0: 72 65 73 65 6e 74 20 61 20 63 6f 6d 70 6c 65 78  resent a complex
0cb0: 20 61 6e 64 20 66 6c 65 78 69 62 6c 65 20 73 74   and flexible st
0cc0: 72 75 63 74 75 72 65 20 69 6e 74 65 6e 64 65 64  ructure intended
0cd0: 20 74 6f 20 65 73 74 61 62 6c 69 73 68 20 70 65   to establish pe
0ce0: 72 6d 61 6e 65 6e 74 20 65 78 70 6c 69 63 69 74  rmanent explicit
0cf0: 20 63 6f 72 72 65 73 70 6f 6e 64 65 6e 63 65 73   correspondences
0d00: 20 62 65 74 77 65 65 6e 20 54 6f 70 6f 6c 6f 67   between Topolog
0d10: 79 20 50 72 69 6d 69 74 69 76 65 73 20 61 6e 64  y Primitives and
0d20: 20 47 65 6f 54 61 62 6c 65 20 46 65 61 74 75 72   GeoTable Featur
0d30: 65 73 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 65  es...<ul>..<li>e
0d40: 61 63 68 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72  ach <b>TopoLayer
0d50: 3c 2f 62 3e 20 69 73 20 75 6e 69 71 75 65 6c 79  </b> is uniquely
0d60: 20 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 69   identified by i
0d70: 74 73 20 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 20 61  ts <b>name</b> a
0d80: 6e 64 20 64 69 72 65 63 74 6c 79 20 63 6f 72 72  nd directly corr
0d90: 65 73 70 6f 6e 64 73 20 74 6f 20 61 20 73 69 6e  esponds to a sin
0da0: 67 6c 65 20 47 65 6f 54 61 62 6c 65 20 74 6f 20  gle GeoTable to 
0db0: 62 65 20 65 78 70 6f 72 74 65 64 20 66 72 6f 6d  be exported from
0dc0: 20 74 68 65 20 54 6f 70 6f 6c 6f 67 79 3c 62 72   the Topology<br
0dd0: 3e 0d 0a 41 6e 20 61 72 62 69 74 72 61 72 79 20  >..An arbitrary 
0de0: 6e 75 6d 62 65 72 20 6f 66 20 54 6f 70 6f 4c 61  number of TopoLa
0df0: 79 65 72 73 20 63 61 6e 20 62 65 20 63 72 65 61  yers can be crea
0e00: 74 65 64 20 6f 6e 20 74 68 65 20 73 61 6d 65 20  ted on the same 
0e10: 54 6f 70 6f 6c 6f 67 79 2c 20 61 6e 64 20 65 61  Topology, and ea
0e20: 63 68 20 6f 6e 65 20 6f 66 20 74 68 65 6d 20 77  ch one of them w
0e30: 69 6c 6c 20 61 63 74 20 61 73 20 61 20 73 65 70  ill act as a sep
0e40: 61 72 61 74 65 20 63 6f 6e 74 61 69 6e 65 72 2e  arate container.
0e50: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 65 61 63 68 20  </li>..<li>each 
0e60: 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 3c 2f  <b>TopoFeature</
0e70: 62 3e 20 69 73 20 75 6e 69 71 75 65 6c 79 20 69  b> is uniquely i
0e80: 64 65 6e 74 69 66 69 65 64 20 62 79 20 69 74 73  dentified by its
0e90: 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 28 3c 69 3e   <b>fid</b> (<i>
0ea0: 66 65 61 74 75 72 65 2d 69 64 3c 2f 69 3e 29 20  feature-id</i>) 
0eb0: 61 6e 64 20 63 6f 72 72 65 73 70 6f 6e 64 73 20  and corresponds 
0ec0: 74 6f 20 61 20 73 69 6e 67 6c 65 20 46 65 61 74  to a single Feat
0ed0: 75 72 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61  ure containing a
0ee0: 6e 20 69 6e 64 69 76 69 64 75 61 6c 20 73 65 74  n individual set
0ef0: 20 6f 66 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20   of information 
0f00: 61 74 74 72 69 62 75 74 65 73 2e 3c 62 72 3e 0d  attributes.<br>.
0f10: 0a 54 68 65 20 47 65 6f 6d 65 74 72 79 20 66 6f  .The Geometry fo
0f20: 72 20 65 61 63 68 20 54 6f 70 6f 46 65 61 74 75  r each TopoFeatu
0f30: 72 65 20 69 73 20 61 6c 77 61 79 73 20 69 6e 64  re is always ind
0f40: 69 72 65 63 74 6c 79 20 64 65 66 69 6e 65 64 20  irectly defined 
0f50: 62 79 20 73 70 65 63 69 66 79 69 6e 67 20 61 20  by specifying a 
0f60: 6c 69 73 74 20 6f 66 20 54 6f 70 6f 6c 6f 67 79  list of Topology
0f70: 20 70 72 69 6d 69 74 69 76 65 73 20 69 6e 64 69   primitives indi
0f80: 76 69 64 75 61 6c 6c 79 20 72 65 66 65 72 65 6e  vidually referen
0f90: 63 65 64 20 62 79 20 74 68 65 69 72 20 49 44 73  ced by their IDs
0fa0: 2e 3c 62 72 3e 0d 0a 53 75 63 68 20 61 20 67 65  .<br>..Such a ge
0fb0: 6f 6d 65 74 72 79 20 6f 62 76 69 6f 75 73 6c 79  ometry obviously
0fc0: 20 69 73 20 61 20 3c 75 3e 3c 69 3e 76 69 72 74   is a <u><i>virt
0fd0: 75 61 6c 3c 2f 69 3e 3c 2f 75 3e 20 6f 6e 65 2c  ual</i></u> one,
0fe0: 20 61 6e 64 20 77 69 6c 6c 20 62 65 20 61 63 74   and will be act
0ff0: 75 61 6c 6c 79 20 6d 61 74 65 72 69 61 6c 69 7a  ually materializ
1000: 65 64 20 28 62 79 20 61 67 67 72 65 67 61 74 69  ed (by aggregati
1010: 6e 67 20 61 6c 6c 20 72 65 66 65 72 65 6e 63 65  ng all reference
1020: 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69  d Topology primi
1030: 74 69 76 65 73 29 20 6f 6e 6c 79 20 77 68 65 6e  tives) only when
1040: 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20 64   exporting the d
1050: 65 73 74 69 6e 61 74 69 6f 6e 20 47 65 6f 54 61  estination GeoTa
1060: 62 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e  ble.</li>..</ul>
1070: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 54 68 65 20 54  </li>..<li>The T
1080: 6f 70 6f 4c 61 79 65 72 73 20 2f 20 54 6f 70 6f  opoLayers / Topo
1090: 46 65 61 74 75 72 65 73 20 73 74 72 75 63 74 75  Features structu
10a0: 72 65 20 69 73 20 70 72 61 63 74 69 63 61 6c 6c  re is practicall
10b0: 79 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 61 73  y implemented as
10c0: 20 61 20 73 65 74 20 6f 66 20 73 65 76 65 72 61   a set of severa
10d0: 6c 20 63 6c 6f 73 65 6c 79 20 72 65 6c 61 74 65  l closely relate
10e0: 64 20 44 42 2d 74 61 62 6c 65 73 20 29 77 65 27  d DB-tables )we'
10f0: 6c 6c 20 65 78 61 6d 69 6e 65 20 6c 61 74 65 72  ll examine later
1100: 20 74 68 65 69 72 20 72 65 73 70 65 63 74 69 76   their respectiv
1110: 65 20 6c 61 79 6f 75 74 73 20 69 6e 20 66 75 6c  e layouts in ful
1120: 6c 20 64 65 74 61 69 6c 29 3a 0d 0a 3c 75 6c 3e  l detail):..<ul>
1130: 0d 0a 3c 6c 69 3e 3c 62 3e 3c 3c 69 3e 74 6f 70  ..<li><b><<i>top
1140: 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f  o-prefix</i>>_to
1150: 70 6f 6c 61 79 65 72 73 3c 2f 62 3e 3a 20 74 68  polayers</b>: th
1160: 69 73 20 66 69 72 73 74 20 74 61 62 6c 65 20 73  is first table s
1170: 69 6d 70 6c 79 20 69 73 20 61 20 63 61 74 61 6c  imply is a catal
1180: 6f 67 20 6f 66 20 61 6c 6c 20 54 6f 70 6f 4c 61  og of all TopoLa
1190: 79 65 72 73 20 73 75 70 70 6f 72 74 69 6e 67 20  yers supporting 
11a0: 74 68 65 20 73 61 6d 65 20 54 6f 70 6f 6c 6f 67  the same Topolog
11b0: 79 2e 3c 62 72 3e 0d 0a 45 61 63 68 20 54 6f 70  y.<br>..Each Top
11c0: 6f 4c 61 79 65 72 20 69 73 20 69 64 65 6e 74 69  oLayer is identi
11d0: 66 69 65 64 20 62 79 20 69 74 73 20 3c 62 3e 6e  fied by its <b>n
11e0: 61 6d 65 3c 2f 62 3e 20 61 6e 64 20 62 79 20 69  ame</b> and by i
11f0: 74 73 20 3c 62 3e 49 44 3c 2f 62 3e 3b 20 62 6f  ts <b>ID</b>; bo
1200: 74 68 20 69 64 65 6e 74 69 66 69 65 72 73 20 61  th identifiers a
1210: 72 65 20 67 72 61 6e 74 65 64 20 74 6f 20 62 65  re granted to be
1220: 20 3c 69 3e 3c 75 3e 75 6e 69 71 75 65 3c 2f 75   <i><u>unique</u
1230: 3e 3c 2f 69 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  ></i>.</li>..<li
1240: 3e 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65  ><b><<i>topo-pre
1250: 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 66 65 61  fix</i>>_topofea
1260: 74 75 72 65 73 3c 2f 62 3e 3a 20 74 68 69 73 20  tures</b>: this 
1270: 73 65 63 6f 6e 64 20 74 61 62 6c 65 20 69 73 20  second table is 
1280: 69 6e 74 65 6e 64 65 64 20 74 6f 20 70 65 72 6d  intended to perm
1290: 61 6e 65 6e 74 6c 79 20 73 74 6f 72 65 20 61 6c  anently store al
12a0: 6c 20 63 72 6f 73 73 2d 72 65 66 65 72 65 6e 63  l cross-referenc
12b0: 65 73 20 65 78 69 73 74 69 6e 67 20 62 65 74 77  es existing betw
12c0: 65 65 6e 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69  een Topology pri
12d0: 6d 69 74 69 76 65 73 20 61 6e 64 20 54 6f 70 6f  mitives and Topo
12e0: 46 65 61 74 75 72 65 73 2e 3c 2f 6c 69 3e 0d 0a  Features.</li>..
12f0: 3c 6c 69 3e 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d  <li><b><<i>topo-
1300: 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f  prefix</i>>_topo
1310: 66 65 61 74 75 72 65 73 5f 3c 3c 69 3e 74 6f 70  features_<<i>top
1320: 6f 6c 61 79 65 72 2d 69 64 3c 2f 69 3e 3e 3c 2f  olayer-id</i>></
1330: 62 3e 3a 20 66 6f 72 20 65 61 63 68 20 73 69 6e  b>: for each sin
1340: 67 6c 65 20 54 6f 70 6f 4c 61 79 65 72 20 61 20  gle TopoLayer a 
1350: 73 65 70 61 72 61 74 65 20 74 61 62 6c 65 20 69  separate table i
1360: 73 20 72 65 71 75 69 72 65 64 2e 20 54 68 65 20  s required. The 
1370: 61 63 74 75 61 6c 20 63 6f 72 72 65 73 70 6f 6e  actual correspon
1380: 64 65 6e 63 65 20 69 73 20 65 73 74 61 62 6c 69  dence is establi
1390: 73 68 65 64 20 76 69 61 20 74 68 65 20 3c 62 3e  shed via the <b>
13a0: 54 6f 70 6f 4c 61 79 65 72 2d 49 44 3c 2f 62 3e  TopoLayer-ID</b>
13b0: 20 73 75 66 66 69 78 2e 3c 62 72 3e 0d 0a 41 6c   suffix.<br>..Al
13c0: 6c 20 74 68 65 73 65 20 74 61 62 6c 65 73 20 61  l these tables a
13d0: 72 65 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 70  re intended to p
13e0: 65 72 6d 61 6e 65 6e 74 6c 79 20 73 74 6f 72 65  ermanently store
13f0: 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e   the information
1400: 20 61 74 74 72 69 62 75 74 65 73 20 66 6f 72 20   attributes for 
1410: 65 61 63 68 20 54 6f 70 6f 46 65 61 74 75 72 65  each TopoFeature
1420: 20 69 6e 20 74 68 65 20 73 61 6d 65 20 54 6f 70   in the same Top
1430: 6f 4c 61 79 65 72 2e 0d 0a 44 69 66 66 65 72 65  oLayer...Differe
1440: 6e 74 20 54 6f 70 6f 4c 61 79 65 72 73 20 77 69  nt TopoLayers wi
1450: 6c 6c 20 6f 62 76 69 6f 75 73 6c 79 20 73 75 70  ll obviously sup
1460: 70 6f 72 74 20 61 20 64 69 66 66 65 72 65 6e 74  port a different
1470: 20 73 65 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74   set of informat
1480: 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 20 74  ion attributes t
1490: 68 75 73 20 72 65 71 75 69 72 69 6e 67 20 61 6e  hus requiring an
14a0: 20 69 6e 64 69 76 69 64 75 61 6c 20 74 61 62 6c   individual tabl
14b0: 65 20 6c 61 79 6f 75 74 2e 3c 62 72 3e 0d 0a 41  e layout.<br>..A
14c0: 6e 79 77 61 79 20 61 6c 6c 20 74 68 65 73 65 20  nyway all these 
14d0: 74 61 62 6c 65 73 20 61 72 65 20 61 6c 77 61 79  tables are alway
14e0: 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 64 65  s expected to de
14f0: 63 6c 61 72 65 20 61 20 3c 62 3e 50 72 69 6d 61  clare a <b>Prima
1500: 72 79 20 4b 65 79 3c 2f 62 3e 20 6f 66 20 74 68  ry Key</b> of th
1510: 65 20 3c 62 3e 49 4e 54 45 47 45 52 3c 2f 62 3e  e <b>INTEGER</b>
1520: 20 74 79 70 65 20 6e 61 6d 65 64 20 3c 62 3e 66   type named <b>f
1530: 69 64 3c 2f 62 3e 20 61 6e 64 20 69 6e 74 65 6e  id</b> and inten
1540: 64 65 64 20 74 6f 20 62 65 20 61 6e 20 75 6e 69  ded to be an uni
1550: 71 75 65 20 69 64 65 6e 74 69 66 69 65 72 20 66  que identifier f
1560: 6f 72 20 65 61 63 68 20 54 6f 70 6f 46 65 61 74  or each TopoFeat
1570: 75 72 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e  ure.</li>..</ul>
1580: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 53 65 76 65 72  </li>..<li>Sever
1590: 61 6c 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 73  al SQL functions
15a0: 20 61 72 65 20 73 70 65 63 69 66 69 63 61 6c 6c   are specificall
15b0: 79 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 73 75  y intended to su
15c0: 70 70 6f 72 74 20 70 72 6f 63 65 73 73 69 6e 67  pport processing
15d0: 20 6f 70 65 72 61 74 69 6f 6e 73 20 62 61 73 65   operations base
15e0: 64 20 6f 6e 20 54 6f 70 6f 4c 61 79 65 72 73 20  d on TopoLayers 
15f0: 61 6e 64 20 54 6f 70 6f 46 65 61 74 75 72 65 73  and TopoFeatures
1600: 3b 20 77 65 27 6c 6c 20 65 78 61 6d 69 6e 65 20  ; we'll examine 
1610: 6c 61 74 65 72 20 61 6c 6c 20 74 68 65 6d 20 69  later all them i
1620: 6e 20 66 75 6c 6c 20 64 65 74 61 69 6c 2e 3c 2f  n full detail.</
1630: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 3c 62  li>..</ul><br><b
1640: 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 32 3e 61 20  r>..<hr>..<h2>a 
1650: 71 75 69 63 6b 20 70 72 61 63 74 69 63 61 6c 20  quick practical 
1660: 65 78 65 72 63 69 73 65 3c 2f 68 32 3e 0d 0a 50  exercise</h2>..P
1670: 72 65 72 65 71 75 69 73 69 74 65 73 3a 0d 0a 3c  rerequisites:..<
1680: 6f 6c 3e 0d 0a 3c 6c 69 3e 64 6f 77 6e 6c 6f 61  ol>..<li>downloa
1690: 64 20 74 68 65 20 73 61 6d 70 6c 65 20 44 42 2d  d the sample DB-
16a0: 66 69 6c 65 20 66 72 6f 6d 20 3c 61 20 68 72 65  file from <a hre
16b0: 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67  f="https://www.g
16c0: 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d  aia-gis.it/gaia-
16d0: 73 69 6e 73 2f 74 6f 70 6f 73 61 6d 70 6c 65 73  sins/toposamples
16e0: 2f 74 75 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d  /tuscany-census-
16f0: 32 30 31 31 2e 37 7a 22 3e 68 65 72 65 3c 2f 61  2011.7z">here</a
1700: 3e 3c 62 72 3e 0d 0a 49 74 20 63 6f 6e 74 61 69  ><br>..It contai
1710: 6e 73 20 43 65 6e 73 75 73 20 64 61 74 61 20 28  ns Census data (
1720: 32 30 31 31 29 20 6b 69 6e 64 6c 79 20 72 65 6c  2011) kindly rel
1730: 65 61 73 65 64 20 62 79 20 49 53 54 41 54 20 75  eased by ISTAT u
1740: 6e 64 65 72 20 3c 62 3e 43 43 2d 42 59 3c 2f 62  nder <b>CC-BY</b
1750: 3e 20 6c 69 63 65 6e 73 65 20 74 65 72 6d 73 2e  > license terms.
1760: 3c 62 72 3e 0d 0a 54 68 65 20 6f 72 69 67 69 6e  <br>..The origin
1770: 61 6c 20 64 61 74 61 73 65 74 73 20 68 61 76 65  al datasets have
1780: 20 62 65 65 6e 20 73 6c 69 67 68 74 6c 79 20 72   been slightly r
1790: 65 61 72 72 61 6e 67 65 64 20 69 6e 20 61 20 6d  earranged in a m
17a0: 6f 72 65 20 63 6f 6e 76 65 6e 69 65 6e 74 20 66  ore convenient f
17b0: 6f 72 6d 2e 0d 0a 41 6c 6c 20 67 65 6f 6d 65 74  orm...All geomet
17c0: 72 69 65 73 20 61 72 65 20 69 6e 20 74 68 65 20  ries are in the 
17d0: 3c 62 3e 53 52 49 44 20 33 32 36 33 32 3c 2f 62  <b>SRID 32632</b
17e0: 3e 20 28 3c 69 3e 57 47 53 20 38 34 20 2f 20 55  > (<i>WGS 84 / U
17f0: 54 4d 20 7a 6f 6e 65 20 33 32 4e 3c 2f 69 3e 29  TM zone 32N</i>)
1800: 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e  :..<ul>..<li><b>
1810: 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e 3a  census_2011</b>:
1820: 20 61 6c 6c 20 43 65 6e 73 75 73 20 41 72 65 61   all Census Area
1830: 73 20 28 32 30 31 31 29 20 63 6f 76 65 72 69 6e  s (2011) coverin
1840: 67 20 54 75 73 63 61 6e 79 2e 3c 62 72 3e 0d 0a  g Tuscany.<br>..
1850: 3c 75 3e 4e 6f 74 65 3a 3c 2f 75 3e 20 73 65 76  <u>Note:</u> sev
1860: 65 72 61 6c 20 43 65 6e 73 75 73 20 41 72 65 61  eral Census Area
1870: 73 20 61 72 65 20 63 6f 6d 70 6c 65 74 65 6c 79  s are completely
1880: 20 75 6e 69 6e 68 61 62 69 74 65 64 20 28 6c 61   uninhabited (la
1890: 6b 65 73 2c 20 6d 61 72 73 68 6c 61 6e 64 73 2c  kes, marshlands,
18a0: 20 68 69 67 68 20 6d 6f 75 6e 74 61 69 6e 73 20   high mountains 
18b0: 61 6e 64 20 61 6c 69 6b 65 29 2e 3c 2f 6c 69 3e  and alike).</li>
18c0: 0d 0a 3c 6c 69 3e 3c 62 3e 70 70 6c 5f 32 30 31  ..<li><b>ppl_201
18d0: 31 3c 2f 62 3e 3a 20 50 6f 70 75 6c 61 74 65 64  1</b>: Populated
18e0: 20 50 6c 61 63 65 73 20 28 64 65 66 69 6e 65 64   Places (defined
18f0: 20 61 73 20 61 6e 20 61 67 67 72 65 67 61 74 69   as an aggregati
1900: 6f 6e 20 6f 66 20 43 65 6e 73 75 73 20 41 72 65  on of Census Are
1910: 61 73 29 2e 3c 62 72 3e 0d 0a 3c 75 3e 4e 6f 74  as).<br>..<u>Not
1920: 65 3c 2f 75 3e 3a 20 6e 6f 74 20 61 6c 6c 20 43  e</u>: not all C
1930: 65 6e 73 75 73 20 41 72 65 61 73 20 62 65 6c 6f  ensus Areas belo
1940: 6e 67 20 74 6f 20 61 20 50 6f 70 75 6c 61 74 65  ng to a Populate
1950: 64 20 50 6c 61 63 65 3a 20 74 68 65 72 65 20 61  d Place: there a
1960: 72 65 20 6d 61 6e 79 20 73 65 6c 66 2d 73 74 61  re many self-sta
1970: 6e 64 69 6e 67 20 64 69 73 70 65 72 73 65 64 20  nding dispersed 
1980: 72 75 72 61 6c 20 61 72 65 61 73 2e 3c 2f 6c 69  rural areas.</li
1990: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 6f 6d 5f 32 30  >..<li><b>com_20
19a0: 31 31 3c 2f 62 3e 3a 20 54 75 73 63 61 6e 79 20  11</b>: Tuscany 
19b0: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20 2f  Municipalities /
19c0: 20 4c 6f 63 61 6c 20 43 6f 75 6e 63 69 6c 73 20   Local Councils 
19d0: 32 30 31 31 20 28 64 65 66 69 6e 65 64 20 61 73  2011 (defined as
19e0: 20 61 6e 20 61 67 67 72 65 67 61 74 69 6f 6e 73   an aggregations
19f0: 20 6f 66 20 43 65 6e 73 75 73 20 41 72 65 61 73   of Census Areas
1a00: 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e  ).</li>..<li><b>
1a10: 63 6f 6d 5f 32 30 31 34 5f 31 35 3c 2f 62 3e 3a  com_2014_15</b>:
1a20: 20 66 65 77 20 6e 65 77 20 4d 75 6e 69 63 69 70   few new Municip
1a30: 61 6c 69 74 69 65 73 20 63 72 65 61 74 65 64 20  alities created 
1a40: 64 75 72 69 6e 67 20 79 65 61 72 73 20 32 30 31  during years 201
1a50: 34 2f 31 35 20 62 79 20 6d 65 72 67 69 6e 67 20  4/15 by merging 
1a60: 70 72 65 2d 65 78 69 73 74 69 6e 67 20 73 6d 61  pre-existing sma
1a70: 6c 6c 65 72 20 4d 75 6e 69 63 69 70 61 6c 69 74  ller Municipalit
1a80: 69 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c  ies.</li>..<li><
1a90: 62 3e 70 72 6f 76 5f 32 30 31 31 3c 2f 62 3e 3a  b>prov_2011</b>:
1aa0: 20 54 75 73 63 61 6e 79 20 50 72 6f 76 69 6e 63   Tuscany Provinc
1ab0: 65 73 20 2f 20 43 6f 75 6e 74 69 65 73 20 28 64  es / Counties (d
1ac0: 65 66 69 6e 65 64 20 61 73 20 61 6e 20 61 67 67  efined as an agg
1ad0: 72 65 67 61 74 69 6f 6e 20 6f 66 20 4d 75 6e 69  regation of Muni
1ae0: 63 69 70 61 6c 69 74 69 65 73 29 2e 3c 2f 6c 69  cipalities).</li
1af0: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 72 65 67 5f 32 30  >..<li><b>reg_20
1b00: 31 31 3c 2f 62 3e 3a 20 54 75 73 63 61 6e 79 20  11</b>: Tuscany 
1b10: 52 65 67 69 6f 6e 20 28 64 65 66 69 6e 65 64 20  Region (defined 
1b20: 61 73 20 61 6e 20 61 67 67 72 65 67 61 74 69 6f  as an aggregatio
1b30: 6e 20 6f 66 20 50 72 6f 76 69 6e 63 65 73 29 2e  n of Provinces).
1b40: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6a 75 73 74 20  </li>..<li>just 
1b50: 3c 62 3e 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f  <b>census_2011</
1b60: 62 3e 20 61 6c 6f 6e 65 20 73 75 70 70 6f 72 74  b> alone support
1b70: 73 20 67 65 6f 6d 65 74 72 69 65 73 3b 20 61 6e  s geometries; an
1b80: 79 20 6f 74 68 65 72 20 61 64 6d 69 6e 69 73 74  y other administ
1b90: 72 61 74 69 76 65 20 6c 65 76 65 6c 20 69 73 20  rative level is 
1ba0: 73 69 6d 70 6c 79 20 64 65 66 69 6e 65 64 20 62  simply defined b
1bb0: 79 20 72 65 6c 61 74 69 6f 6e 61 6c 20 63 6f 64  y relational cod
1bc0: 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c  es.</li>..</ul><
1bd0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 75 6e 63 6f 6d 70  /li>..<li>uncomp
1be0: 72 65 73 73 20 74 68 65 20 64 6f 77 6e 6c 6f 61  ress the downloa
1bf0: 64 65 64 20 64 62 2d 66 69 6c 65 20 28 3c 62 3e  ded db-file (<b>
1c00: 3c 69 3e 74 75 73 63 61 6e 79 2d 63 65 6e 73 75  <i>tuscany-censu
1c10: 73 2d 32 30 31 31 2e 73 71 6c 69 74 65 3c 2f 69  s-2011.sqlite</i
1c20: 3e 3c 2f 62 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c  ></b>).</li>..<l
1c30: 69 3e 6e 6f 77 20 79 6f 75 20 63 61 6e 20 66 69  i>now you can fi
1c40: 6e 61 6c 6c 79 20 73 74 61 72 74 20 61 20 53 70  nally start a Sp
1c50: 61 74 69 61 4c 69 74 65 20 73 65 73 73 69 6f 6e  atiaLite session
1c60: 20 75 73 69 6e 67 20 79 6f 75 72 20 70 72 65 66   using your pref
1c70: 65 72 72 65 64 20 53 70 61 74 69 61 4c 69 74 65  erred SpatiaLite
1c80: 20 66 72 6f 6e 74 20 65 6e 64 20 74 6f 6f 6c 3a   front end tool:
1c90: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 75 3e 41  ..<ul>..<li><u>A
1ca0: 74 74 65 6e 74 69 6f 6e 3c 2f 75 3e 3a 20 79 6f  ttention</u>: yo
1cb0: 75 20 6d 75 73 74 20 6e 6f 74 20 64 69 72 65 63  u must not direc
1cc0: 74 6c 79 20 63 6f 6e 6e 65 63 74 20 74 6f 20 3c  tly connect to <
1cd0: 62 3e 3c 69 3e 74 75 73 63 61 6e 79 2d 63 65 6e  b><i>tuscany-cen
1ce0: 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 74 65 3c  sus-2011.sqlite<
1cf0: 2f 69 3e 3c 2f 62 3e 3b 20 79 6f 75 20 61 72 65  /i></b>; you are
1d00: 20 65 78 70 65 63 74 65 64 20 69 6e 73 74 65 61   expected instea
1d10: 64 20 74 6f 20 63 6f 6e 6e 65 63 74 20 61 20 6e  d to connect a n
1d20: 65 77 20 28 65 6d 70 74 79 29 20 44 42 2d 66 69  ew (empty) DB-fi
1d30: 6c 65 20 6e 61 6d 65 64 20 3c 62 3e 74 75 73 63  le named <b>tusc
1d40: 61 6e 79 2d 74 6f 70 6f 2d 32 30 31 31 2e 73 71  any-topo-2011.sq
1d50: 6c 69 74 65 3c 2f 62 3e 3c 2f 6c 69 3e 0d 0a 3c  lite</b></li>..<
1d60: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e  /ul></li>..</ol>
1d70: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45  ..<verbatim>..SE
1d80: 4c 45 43 54 20 43 72 65 61 74 65 54 6f 70 6f 6c  LECT CreateTopol
1d90: 6f 67 79 28 27 63 65 6e 73 75 73 32 30 31 31 27  ogy('census2011'
1da0: 2c 20 33 32 36 33 32 2c 20 30 2c 20 30 29 3b 0d  , 32632, 0, 0);.
1db0: 0a 31 0d 0a 0d 0a 41 54 54 41 43 48 20 44 41 54  .1....ATTACH DAT
1dc0: 41 42 41 53 45 20 22 2e 2f 74 75 73 63 61 6e 79  ABASE "./tuscany
1dd0: 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c  -census-2011.sql
1de0: 69 74 65 22 20 41 53 20 69 73 74 61 74 3b 0d 0a  ite" AS istat;..
1df0: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f  ..SELECT TopoGeo
1e00: 5f 46 72 6f 6d 47 65 6f 54 61 62 6c 65 28 27 63  _FromGeoTable('c
1e10: 65 6e 73 75 73 32 30 31 31 27 2c 20 27 69 73 74  ensus2011', 'ist
1e20: 61 74 27 2c 20 27 63 65 6e 73 75 73 5f 32 30 31  at', 'census_201
1e30: 31 27 2c 20 4e 55 4c 4c 2c 20 30 2c 20 35 31 32  1', NULL, 0, 512
1e40: 2c 20 2d 31 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c  , -1);..1....SEL
1e50: 45 43 54 20 53 54 5f 56 61 6c 69 64 61 74 65 54  ECT ST_ValidateT
1e60: 6f 70 6f 47 65 6f 28 27 63 65 6e 73 75 73 32 30  opoGeo('census20
1e70: 31 31 27 29 3b 0d 0a 4e 55 4c 4c 0d 0a 0d 0a 53  11');..NULL....S
1e80: 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 54 45 4d  ELECT * FROM TEM
1e90: 50 2e 63 65 6e 73 75 73 32 30 31 31 5f 76 61 6c  P.census2011_val
1ea0: 69 64 61 74 65 5f 74 6f 70 6f 67 65 6f 3b 0d 0a  idate_topogeo;..
1eb0: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f  ..SELECT TopoGeo
1ec0: 5f 43 72 65 61 74 65 54 6f 70 6f 4c 61 79 65 72  _CreateTopoLayer
1ed0: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27  ('census2011', '
1ee0: 69 73 74 61 74 27 2c 20 27 63 65 6e 73 75 73 5f  istat', 'census_
1ef0: 32 30 31 31 27 2c 20 4e 55 4c 4c 2c 20 27 63 65  2011', NULL, 'ce
1f00: 6e 73 75 73 5f 61 72 65 61 73 27 29 3b 0d 0a 31  nsus_areas');..1
1f10: 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47  ....SELECT TopoG
1f20: 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72  eo_InitTopoLayer
1f30: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27  ('census2011', '
1f40: 69 73 74 61 74 27 2c 20 27 70 6f 70 5f 70 70 6c  istat', 'pop_ppl
1f50: 5f 32 30 31 31 27 2c 20 27 70 70 6c 27 29 3b 0d  _2011', 'ppl');.
1f60: 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70  .1....SELECT Top
1f70: 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79  oGeo_InitTopoLay
1f80: 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c  er('census2011',
1f90: 20 27 69 73 74 61 74 27 2c 20 27 70 6f 70 5f 63   'istat', 'pop_c
1fa0: 6f 6d 5f 32 30 31 31 27 2c 20 27 63 6f 6d 27 29  om_2011', 'com')
1fb0: 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 54  ;..1....SELECT T
1fc0: 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c  opoGeo_InitTopoL
1fd0: 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31  ayer('census2011
1fe0: 27 2c 20 27 69 73 74 61 74 27 2c 20 27 70 6f 70  ', 'istat', 'pop
1ff0: 5f 70 72 6f 76 5f 32 30 31 31 27 2c 20 27 70 72  _prov_2011', 'pr
2000: 6f 76 27 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45  ov');..1....SELE
2010: 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54  CT TopoGeo_InitT
2020: 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73  opoLayer('census
2030: 32 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c 20  2011', 'istat', 
2040: 27 70 6f 70 5f 72 65 67 5f 32 30 31 31 27 2c 20  'pop_reg_2011', 
2050: 27 72 65 67 27 29 3b 0d 0a 31 0d 0a 0d 0a 44 45  'reg');..1....DE
2060: 54 41 43 48 20 44 41 54 41 42 41 53 45 20 69 73  TACH DATABASE is
2070: 74 61 74 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d  tat;..</verbatim
2080: 3e 0d 0a 57 65 27 6c 6c 20 73 74 61 72 74 20 74  >..We'll start t
2090: 68 69 73 20 70 72 61 63 74 69 63 61 6c 20 74 75  his practical tu
20a0: 74 6f 72 69 61 6c 20 62 79 20 64 75 6c 79 20 72  torial by duly r
20b0: 65 70 6c 69 63 61 74 69 6e 67 20 74 68 65 20 73  eplicating the s
20c0: 61 6d 65 20 73 74 65 70 73 20 77 65 27 76 65 20  ame steps we've 
20d0: 61 6c 72 65 61 64 79 20 65 78 61 6d 69 6e 65 64  already examined
20e0: 20 69 6e 20 74 68 65 20 69 6e 74 65 72 6d 65 64   in the intermed
20f0: 69 61 74 65 20 74 75 74 6f 72 69 61 6c 3a 0d 0a  iate tutorial:..
2100: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 77 65 27 6c 6c 20  <ul>..<li>we'll 
2110: 63 72 65 61 74 65 20 61 20 6e 65 77 20 32 44 20  create a new 2D 
2120: 54 6f 70 6f 6c 6f 67 79 20 6e 61 6d 65 64 20 3c  Topology named <
2130: 62 3e 63 65 6e 73 75 73 32 30 31 31 3c 2f 62 3e  b>census2011</b>
2140: 20 61 6e 64 20 6c 6f 63 61 74 65 64 20 69 6e 74   and located int
2150: 6f 20 3c 62 3e 53 52 49 44 20 33 32 36 33 32 3c  o <b>SRID 32632<
2160: 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74  /b>.</li>..<li>t
2170: 68 65 6e 20 77 65 27 6c 6c 20 3c 69 3e 61 74 74  hen we'll <i>att
2180: 61 63 68 3c 2f 69 3e 20 74 68 65 20 3c 62 3e 74  ach</i> the <b>t
2190: 75 73 63 61 6e 79 2d 74 6f 70 6f 2d 32 30 31 31  uscany-topo-2011
21a0: 2e 73 71 6c 69 74 65 3c 2f 62 3e 20 65 78 74 65  .sqlite</b> exte
21b0: 72 6e 61 6c 20 44 42 2d 66 69 6c 65 2e 3c 2f 6c  rnal DB-file.</l
21c0: 69 3e 0d 0a 3c 6c 69 3e 6e 6f 77 20 77 65 27 6c  i>..<li>now we'l
21d0: 6c 20 70 6f 70 75 6c 61 74 65 20 74 68 65 20 3c  l populate the <
21e0: 62 3e 63 65 6e 73 75 73 32 30 31 31 3c 2f 62 3e  b>census2011</b>
21f0: 20 54 6f 70 6f 6c 6f 67 79 20 62 79 20 69 6d 70   Topology by imp
2200: 6f 72 74 69 6e 67 20 74 68 65 20 3c 62 3e 69 73  orting the <b>is
2210: 74 61 74 2e 63 65 6e 73 75 73 5f 32 30 31 31 3c  tat.census_2011<
2220: 2f 62 3e 20 47 65 6f 54 61 62 6c 65 2c 20 61 6e  /b> GeoTable, an
2230: 64 20 74 68 65 6e 20 77 65 27 6c 6c 20 69 6d 6d  d then we'll imm
2240: 65 64 69 61 74 65 6c 79 20 63 68 65 63 6b 20 69  ediately check i
2250: 66 20 74 68 69 73 20 54 6f 70 6f 6c 6f 67 79 20  f this Topology 
2260: 69 73 20 66 75 6c 6c 79 20 76 61 6c 69 64 2e 3c  is fully valid.<
2270: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d  /li>..</ul><br>.
2280: 0a 4e 6f 77 20 77 65 20 61 72 65 20 66 69 6e 61  .Now we are fina
2290: 6c 6c 79 20 72 65 61 64 79 20 74 6f 20 73 74 61  lly ready to sta
22a0: 72 74 20 64 65 66 69 6e 69 6e 67 20 61 6c 6c 20  rt defining all 
22b0: 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62  <b>TopoLayers</b
22c0: 3e 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 3c  > based on the <
22d0: 62 3e 63 65 6e 73 75 73 32 30 31 31 3c 2f 62 3e  b>census2011</b>
22e0: 20 54 6f 70 6f 6c 6f 67 79 3b 20 65 61 63 68 20   Topology; each 
22f0: 73 69 6e 67 6c 65 20 54 6f 70 6f 4c 61 79 65 72  single TopoLayer
2300: 20 77 69 6c 6c 20 70 72 65 63 69 73 65 6c 79 20   will precisely 
2310: 72 65 70 72 65 73 65 6e 74 20 73 6f 6d 65 20 61  represent some a
2320: 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20 6c 65  dministrative le
2330: 76 65 6c 2c 20 61 6e 64 20 61 6c 6c 20 54 6f 70  vel, and all Top
2340: 6f 4c 61 79 65 72 73 20 61 6c 74 6f 67 65 74 68  oLayers altogeth
2350: 65 72 20 77 69 6c 6c 20 63 6f 6d 70 6c 65 74 65  er will complete
2360: 6c 79 20 72 65 70 72 65 73 65 6e 74 20 74 68 65  ly represent the
2370: 20 77 68 6f 6c 65 20 54 75 73 63 61 6e 20 61 64   whole Tuscan ad
2380: 6d 69 6e 69 73 74 72 61 74 69 76 65 20 68 69 65  ministrative hie
2390: 72 61 72 63 68 79 2e 0d 0a 3c 6f 6c 3e 0d 0a 3c  rarchy...<ol>..<
23a0: 6c 69 3e 73 6f 20 77 65 27 6c 6c 20 64 75 6c 79  li>so we'll duly
23b0: 20 69 6e 76 6f 6b 65 20 3c 62 3e 54 6f 70 6f 47   invoke <b>TopoG
23c0: 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f 4c 61 79  eo_CreateTopoLay
23d0: 65 72 28 29 3c 2f 62 3e 20 69 6e 20 6f 72 64 65  er()</b> in orde
23e0: 72 20 74 6f 20 63 6f 6d 70 6c 65 74 65 6c 79 20  r to completely 
23f0: 64 65 66 69 6e 65 20 61 20 66 69 72 73 74 20 54  define a first T
2400: 6f 70 6f 4c 61 79 65 72 20 72 65 70 72 65 73 65  opoLayer represe
2410: 6e 74 69 6e 67 20 3c 62 3e 43 65 6e 73 75 73 20  nting <b>Census 
2420: 41 72 65 61 73 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a  Areas</b>.<br>..
2430: 3c 75 3e 52 65 63 61 6c 6c 3c 2f 75 3e 3a 20 74  <u>Recall</u>: t
2440: 68 65 20 3c 62 3e 69 73 74 61 74 2e 63 65 6e 73  he <b>istat.cens
2450: 75 73 5f 32 30 31 31 3c 2f 62 3e 20 69 73 20 74  us_2011</b> is t
2460: 68 65 20 75 6e 69 71 75 65 20 72 65 61 6c 20 47  he unique real G
2470: 65 6f 54 61 62 6c 65 20 77 65 20 68 61 76 65 20  eoTable we have 
2480: 69 6e 20 6f 75 72 20 69 6e 69 74 69 61 6c 20 64  in our initial d
2490: 61 74 61 73 65 74 2c 20 62 65 63 61 75 73 65 20  ataset, because 
24a0: 69 74 20 63 6f 6e 74 61 69 6e 73 20 62 6f 74 68  it contains both
24b0: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74   information att
24c0: 72 69 62 75 74 65 73 20 61 6e 64 20 67 65 6f 6d  ributes and geom
24d0: 65 74 72 69 65 73 3b 20 61 6e 64 20 65 61 63 68  etries; and each
24e0: 20 43 65 6e 73 75 73 20 41 72 65 61 20 69 73 20   Census Area is 
24f0: 65 78 70 65 63 74 65 64 20 74 6f 20 64 69 72 65  expected to dire
2500: 63 74 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 20  ctly correspond 
2510: 74 6f 20 61 20 73 69 6e 67 6c 65 20 54 6f 70 6f  to a single Topo
2520: 6c 6f 67 79 20 46 61 63 65 2e 20 28 3c 69 3e 77  logy Face. (<i>w
2530: 65 27 6c 6c 20 65 78 61 6d 69 6e 65 20 6c 61 74  e'll examine lat
2540: 65 72 20 69 6e 20 6d 6f 72 65 20 64 65 70 74 68  er in more depth
2550: 20 68 6f 77 20 54 6f 70 6f 4c 61 79 65 72 20 2f   how TopoLayer /
2560: 20 54 6f 70 6f 46 65 61 74 75 72 65 20 72 65 6c   TopoFeature rel
2570: 61 74 69 6f 6e 73 68 69 70 73 20 68 61 76 65 20  ationships have 
2580: 62 65 65 6e 20 61 63 74 75 61 6c 6c 79 20 64 65  been actually de
2590: 66 69 6e 65 64 3c 2f 69 3e 29 2e 3c 2f 6c 69 3e  fined</i>).</li>
25a0: 0d 0a 3c 6c 69 3e 74 68 65 6e 20 77 65 27 6c 6c  ..<li>then we'll
25b0: 20 63 6f 6e 74 69 6e 75 65 20 62 79 20 64 65 66   continue by def
25c0: 69 6e 69 6e 67 20 73 65 76 65 72 61 6c 20 66 75  ining several fu
25d0: 72 74 68 65 72 20 54 6f 70 6f 4c 61 79 65 72 73  rther TopoLayers
25e0: 20 72 65 73 70 65 63 74 69 76 65 6c 79 20 63 6f   respectively co
25f0: 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c  rresponding to <
2600: 62 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63  b>Populated Plac
2610: 65 73 3c 2f 62 3e 2c 20 3c 62 3e 4d 75 6e 69 63  es</b>, <b>Munic
2620: 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2c 20 3c  ipalities</b>, <
2630: 62 3e 50 72 6f 76 69 6e 63 65 73 3c 2f 62 3e 20  b>Provinces</b> 
2640: 61 6e 64 20 3c 62 3e 52 65 67 69 6f 6e 3c 2f 62  and <b>Region</b
2650: 3e 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65  > administrative
2660: 20 6c 65 76 65 6c 73 2e 3c 62 72 3e 0d 0a 3c 75   levels.<br>..<u
2670: 3e 52 65 63 61 6c 6c 3c 2f 75 3e 3a 20 61 6c 6c  >Recall</u>: all
2680: 20 74 68 65 73 65 20 61 64 6d 69 6e 69 73 74 72   these administr
2690: 61 74 69 76 65 20 6c 65 76 65 6c 73 20 69 6e 20  ative levels in 
26a0: 74 68 65 20 69 6e 69 74 69 61 6c 20 64 61 74 61  the initial data
26b0: 73 65 74 20 61 72 65 20 73 69 6d 70 6c 79 20 64  set are simply d
26c0: 65 66 69 6e 65 64 20 62 79 20 72 65 6c 61 74 69  efined by relati
26d0: 6f 6e 61 6c 20 63 6f 64 65 73 20 69 6e 74 65 6e  onal codes inten
26e0: 64 65 64 20 74 6f 20 61 67 67 72 65 67 61 74 65  ded to aggregate
26f0: 20 6c 6f 77 65 72 20 6c 65 76 65 6c 20 65 6e 74   lower level ent
2700: 69 74 69 65 73 3b 20 69 6e 20 74 68 69 73 20 63  ities; in this c
2710: 61 73 65 20 74 68 65 72 65 20 61 72 65 20 6e 6f  ase there are no
2720: 20 65 78 70 6c 69 63 69 74 20 67 65 6f 6d 65 74   explicit geomet
2730: 72 69 65 73 20 61 74 20 61 6c 6c 2e 20 53 6f 20  ries at all. So 
2740: 61 72 65 20 61 72 65 20 6e 6f 74 20 64 69 72 65  are are not dire
2750: 63 74 6c 79 20 61 6c 6c 6f 77 65 64 20 74 6f 20  ctly allowed to 
2760: 63 72 65 61 74 65 20 61 20 66 75 6c 6c 79 20 64  create a fully d
2770: 65 66 69 6e 65 64 20 54 6f 70 6f 4c 61 79 65 72  efined TopoLayer
2780: 2c 20 61 6e 64 20 63 61 6c 6c 69 6e 67 20 3c 62  , and calling <b
2790: 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54  >TopoGeo_CreateT
27a0: 6f 70 6f 6c 61 79 65 72 28 29 3c 2f 62 3e 20 69  opolayer()</b> i
27b0: 73 20 6a 75 73 74 20 69 6d 70 6f 73 73 69 62 6c  s just impossibl
27c0: 65 20 62 65 63 61 75 73 65 20 77 65 20 6c 61 63  e because we lac
27d0: 6b 20 61 6e 79 20 61 70 70 72 6f 70 72 69 61 74  k any appropriat
27e0: 65 20 47 65 6f 6d 65 74 72 79 20 63 6f 6c 75 6d  e Geometry colum
27f0: 6e 2e 3c 62 72 3e 0d 0a 41 6e 79 77 61 79 20 77  n.<br>..Anyway w
2800: 65 20 63 61 6e 20 69 6e 76 6f 6b 65 20 3c 62 3e  e can invoke <b>
2810: 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f  TopoGeo_InitTopo
2820: 4c 61 79 65 72 28 29 3c 2f 62 3e 3b 20 74 68 69  Layer()</b>; thi
2830: 73 20 77 69 6c 6c 20 69 6e 69 74 69 61 6c 69 7a  s will initializ
2840: 65 20 61 6e 20 6f 6e 6c 79 20 70 61 72 74 69 61  e an only partia
2850: 6c 6c 79 20 64 65 66 69 6e 65 64 20 54 6f 70 6f  lly defined Topo
2860: 4c 61 79 65 72 2c 20 62 75 74 20 77 65 20 63 61  Layer, but we ca
2870: 6e 20 65 61 73 69 6c 79 20 63 6f 6d 70 6c 65 74  n easily complet
2880: 65 20 69 6e 20 61 20 73 65 63 6f 6e 64 20 74 69  e in a second ti
2890: 6d 65 20 61 6e 79 20 6d 69 73 73 69 6e 67 20 69  me any missing i
28a0: 6e 66 6f 72 6d 61 74 69 6f 6e 20 73 6f 20 74 6f  nformation so to
28b0: 20 67 65 74 20 61 20 70 72 6f 70 65 72 6c 79 20   get a properly 
28c0: 77 6f 72 6b 69 6e 67 20 54 6f 70 6f 4c 61 79 65  working TopoLaye
28d0: 72 20 28 3c 69 3e 61 73 20 77 65 27 6c 6c 20 73  r (<i>as we'll s
28e0: 65 65 20 6c 61 74 65 72 20 69 6e 20 66 75 6c 6c  ee later in full
28f0: 20 64 65 74 61 69 6c 29 2e 3c 2f 6c 69 3e 0d 0a   detail).</li>..
2900: 3c 6c 69 3e 66 69 6e 61 6c 6c 79 20 77 65 27 6c  <li>finally we'l
2910: 6c 20 3c 69 3e 64 65 74 61 63 68 3c 2f 69 3e 20  l <i>detach</i> 
2920: 74 68 65 20 6e 6f 77 20 75 73 65 6c 65 73 73 20  the now useless 
2930: 65 78 74 65 72 6e 61 6c 20 64 62 2d 66 69 6c 65  external db-file
2940: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c  .</li>..</ol>..<
2950: 68 72 3e 0d 0a 3c 68 33 3e 54 6f 70 6f 4c 61 79  hr>..<h3>TopoLay
2960: 65 72 73 20 2f 20 54 6f 70 6f 46 65 61 74 75 72  ers / TopoFeatur
2970: 65 73 3a 20 6c 61 79 6f 75 74 20 6f 66 20 44 42  es: layout of DB
2980: 20 54 61 62 6c 65 73 20 61 6e 64 20 63 6f 72 72   Tables and corr
2990: 65 73 70 6f 6e 64 69 6e 67 20 72 65 6c 61 74 69  esponding relati
29a0: 6f 6e 73 68 69 70 73 3c 2f 68 33 3e 0d 0a 3c 74  onships</h3>..<t
29b0: 61 62 6c 65 20 63 65 6c 6c 70 61 64 64 69 6e 67  able cellpadding
29c0: 3d 22 36 22 20 63 65 6c 6c 73 70 61 63 69 6e 67  ="6" cellspacing
29d0: 3d 22 38 22 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d  ="8">..<tr><td>.
29e0: 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65  .<b><<i>topo-pre
29f0: 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 6c 61 79  fix</i>>_topolay
2a00: 65 72 73 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74  ers</b>..<verbat
2a10: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52  im>..SELECT * FR
2a20: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  OM census2011_to
2a30: 70 6f 6c 61 79 65 72 73 3b 0d 0a 3c 2f 76 65 72  polayers;..</ver
2a40: 62 61 74 69 6d 3e 0d 0a 54 68 65 20 3c 62 3e 54  batim>..The <b>T
2a50: 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 74 61  opoLayers</b> ta
2a60: 62 6c 65 20 63 6f 6e 74 61 69 6e 73 20 61 20 64  ble contains a d
2a70: 69 73 74 69 6e 63 74 20 72 6f 77 20 66 6f 72 20  istinct row for 
2a80: 65 76 65 72 79 20 54 6f 70 6f 4c 61 79 65 72 20  every TopoLayer 
2a90: 64 65 66 69 6e 65 64 20 6f 6e 20 74 68 65 20 63  defined on the c
2aa0: 75 72 72 65 6e 74 20 54 6f 70 6f 6c 6f 67 79 2e  urrent Topology.
2ab0: 3c 62 72 3e 3c 62 72 3e 0d 0a 45 61 63 68 20 54  <br><br>..Each T
2ac0: 6f 70 6f 4c 61 79 65 72 20 69 73 20 69 64 65 6e  opoLayer is iden
2ad0: 74 69 66 69 65 64 20 62 79 20 61 6e 20 3c 62 3e  tified by an <b>
2ae0: 69 64 3c 2f 62 3e 20 61 6e 64 20 62 79 20 61 20  id</b> and by a 
2af0: 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3b 20 62 6f 74  <b>name</b>; bot
2b00: 68 20 61 72 65 20 72 65 71 75 69 72 65 64 20 74  h are required t
2b10: 6f 20 62 65 20 75 6e 69 71 75 65 20 76 61 6c 75  o be unique valu
2b20: 65 73 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a  es...</td><td>..
2b30: 22 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f 74  "<i>census2011_t
2b40: 6f 70 6f 6c 61 79 65 72 73 3c 2f 69 3e 22 0d 0a  opolayers</i>"..
2b50: 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d  <table cellspan=
2b60: 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d  "4" cellpadding=
2b70: 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  "6" bgcolor="#f8
2b80: 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22  f8f0" border="1"
2b90: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f 6c  >..<tr><td bgcol
2ba0: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e  or="#f0f0f8"><b>
2bb0: 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 3e  topolayer_id</b>
2bc0: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c  </td>..<td bgcol
2bd0: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e  or="#f0f0f8"><b>
2be0: 74 6f 70 6f 6c 61 79 65 72 5f 6e 61 6d 65 3c 2f  topolayer_name</
2bf0: 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74  b></td></tr>..<t
2c00: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  r><td align="rig
2c10: 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 63 65  ht">1</td><td>ce
2c20: 6e 73 75 73 5f 61 72 65 61 73 3c 2f 74 64 3e 3c  nsus_areas</td><
2c30: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c  /tr>..<tr><td al
2c40: 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74  ign="right">2</t
2c50: 64 3e 3c 74 64 3e 70 70 6c 3c 2f 74 64 3e 3c 2f  d><td>ppl</td></
2c60: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69  tr>..<tr><td ali
2c70: 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 64  gn="right">3</td
2c80: 3e 3c 74 64 3e 63 6f 6d 3c 2f 74 64 3e 3c 2f 74  ><td>com</td></t
2c90: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67  r>..<tr><td alig
2ca0: 6e 3d 22 72 69 67 68 74 22 3e 34 3c 2f 74 64 3e  n="right">4</td>
2cb0: 3c 74 64 3e 70 72 6f 76 3c 2f 74 64 3e 3c 2f 74  <td>prov</td></t
2cc0: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67  r>..<tr><td alig
2cd0: 6e 3d 22 72 69 67 68 74 22 3e 35 3c 2f 74 64 3e  n="right">5</td>
2ce0: 3c 74 64 3e 72 65 67 3c 2f 74 64 3e 3c 2f 74 72  <td>reg</td></tr
2cf0: 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74  >..</table>..</t
2d00: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
2d10: 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70  >..<b><<i>topo-p
2d20: 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 66  refix</i>>_topof
2d30: 65 61 74 75 72 65 73 5f 3c 3c 69 3e 74 6f 70 6f  eatures_<<i>topo
2d40: 6c 61 79 65 72 2d 69 64 3c 2f 69 3e 3e 3c 2f 62  layer-id</i>></b
2d50: 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53  >..<verbatim>..S
2d60: 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 63 65 6e  ELECT * FROM cen
2d70: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
2d80: 75 72 65 73 5f 32 3b 0d 0a 0d 0a 53 45 4c 45 43  ures_2;....SELEC
2d90: 54 20 2a 20 46 52 4f 4d 20 63 65 6e 73 75 73 32  T * FROM census2
2da0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
2db0: 5f 34 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  _4;..</verbatim>
2dc0: 0d 0a 54 68 65 20 73 61 6d 65 20 54 6f 70 6f 6c  ..The same Topol
2dd0: 6f 67 79 20 63 61 6e 20 63 6f 6e 74 61 69 6e 20  ogy can contain 
2de0: 6d 6f 72 65 20 74 68 61 6e 20 61 20 73 69 6e 67  more than a sing
2df0: 6c 65 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72  le <b>TopoFeatur
2e00: 65 73 3c 2f 62 3e 20 74 61 62 6c 65 2c 20 61 6e  es</b> table, an
2e10: 64 20 65 61 63 68 20 54 6f 70 6f 46 65 61 74 75  d each TopoFeatu
2e20: 72 65 73 20 74 61 62 6c 65 20 63 6f 72 72 65 73  res table corres
2e30: 70 6f 6e 64 73 20 74 6f 20 61 20 73 69 6e 67 6c  ponds to a singl
2e40: 65 20 54 6f 70 6f 4c 61 79 65 72 2e 3c 62 72 3e  e TopoLayer.<br>
2e50: 0d 0a 45 76 65 72 79 20 74 61 62 6c 65 20 63 61  ..Every table ca
2e60: 6e 20 68 61 76 65 20 61 20 73 70 65 63 69 66 69  n have a specifi
2e70: 63 20 6c 61 79 6f 75 74 20 6f 6e 20 69 74 73 20  c layout on its 
2e80: 6f 77 6e 20 28 73 74 72 69 63 74 6c 79 20 72 65  own (strictly re
2e90: 66 6c 65 63 74 69 6e 67 20 74 68 65 20 69 6e 66  flecting the inf
2ea0: 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75  ormation attribu
2eb0: 74 65 73 20 66 6f 72 20 65 61 63 68 20 6c 61 79  tes for each lay
2ec0: 65 72 29 2c 20 61 6e 79 77 61 79 20 61 6c 6c 20  er), anyway all 
2ed0: 74 68 65 6d 20 77 69 6c 6c 20 68 61 76 65 20 61  them will have a
2ee0: 20 3c 62 3e 75 6e 69 71 75 65 20 54 6f 70 6f 46   <b>unique TopoF
2ef0: 65 61 74 75 72 65 20 69 64 65 6e 74 69 66 69 65  eature identifie
2f00: 72 3c 2f 62 3e 20 28 3c 62 3e 3c 69 3e 66 69 64  r</b> (<b><i>fid
2f10: 3c 2f 69 3e 3c 2f 62 3e 29 20 61 63 74 69 6e 67  </i></b>) acting
2f20: 20 69 6e 20 74 68 65 20 50 72 69 6d 61 72 79 20   in the Primary 
2f30: 4b 65 79 20 72 6f 6c 65 2e 3c 62 72 3e 0d 0a 54  Key role.<br>..T
2f40: 68 65 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 20  he relationship 
2f50: 62 65 74 77 65 65 6e 20 74 61 62 6c 65 20 6e 61  between table na
2f60: 6d 65 73 20 61 6e 64 20 54 6f 70 6f 4c 61 79 65  mes and TopoLaye
2f70: 72 73 20 69 73 20 65 73 74 61 62 6c 69 73 68 65  rs is establishe
2f80: 64 20 62 79 20 61 70 70 65 6e 64 69 6e 67 20 61  d by appending a
2f90: 20 6e 75 6d 65 72 69 63 20 73 75 66 66 69 78 20   numeric suffix 
2fa0: 74 6f 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 6e 61  to the common na
2fb0: 6d 65 20 74 68 61 74 20 6d 75 73 74 20 65 78 61  me that must exa
2fc0: 63 74 6c 79 20 6d 61 74 63 68 20 74 68 65 20 3c  ctly match the <
2fd0: 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f  b>topolayer_id</
2fe0: 62 3e 20 76 61 6c 75 65 20 64 65 63 6c 61 72 65  b> value declare
2ff0: 64 20 69 6e 20 74 68 65 20 3c 62 3e 54 6f 70 6f  d in the <b>Topo
3000: 4c 61 79 65 72 73 3c 2f 62 3e 20 6d 61 69 6e 20  Layers</b> main 
3010: 74 61 62 6c 65 2e 3c 62 72 3e 3c 62 72 3e 0d 0a  table.<br><br>..
3020: 41 73 20 69 73 20 73 68 6f 77 6e 20 69 6e 20 74  As is shown in t
3030: 68 69 73 20 65 78 61 6d 70 6c 65 20 74 68 65 20  his example the 
3040: 66 69 72 73 74 20 74 61 62 6c 65 20 3c 62 3e 63  first table <b>c
3050: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
3060: 61 74 75 72 65 73 5f 32 3c 2f 62 3e 20 28 3c 69  atures_2</b> (<i
3070: 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 69  >topolayer_id</i
3080: 3e 3d 3c 69 3e 32 3c 2f 69 3e 29 20 63 6f 6e 74  >=<i>2</i>) cont
3090: 61 69 6e 73 20 61 6c 6c 20 54 6f 70 6f 46 65 61  ains all TopoFea
30a0: 74 75 72 65 73 20 61 73 73 6f 63 69 61 74 65 64  tures associated
30b0: 20 74 6f 20 74 68 65 20 54 6f 70 6f 4c 61 79 65   to the TopoLaye
30c0: 72 20 3c 62 3e 70 70 6c 3c 2f 62 3e 20 28 3c 69  r <b>ppl</b> (<i
30d0: 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65  >Populated Place
30e0: 73 3c 2f 69 3e 29 2e 3c 62 72 3e 3c 62 72 3e 0d  s</i>).<br><br>.
30f0: 0a 54 68 65 20 73 65 63 6f 6e 64 20 74 61 62 6c  .The second tabl
3100: 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 5f  e <b>census2011_
3110: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 3c 2f  topofeatures_4</
3120: 62 3e 20 28 3c 69 3e 74 6f 70 6f 6c 61 79 65 72  b> (<i>topolayer
3130: 5f 69 64 3c 2f 69 3e 3d 3c 69 3e 34 3c 2f 69 3e  _id</i>=<i>4</i>
3140: 29 20 63 6f 6e 74 61 69 6e 73 20 61 6c 6c 20 54  ) contains all T
3150: 6f 70 6f 46 65 61 74 75 72 65 73 20 61 73 73 6f  opoFeatures asso
3160: 63 69 61 74 65 64 20 74 6f 20 74 68 65 20 54 6f  ciated to the To
3170: 70 6f 4c 61 79 65 72 20 3c 62 3e 70 72 6f 76 3c  poLayer <b>prov<
3180: 2f 62 3e 20 28 3c 69 3e 50 72 6f 76 69 6e 63 65  /b> (<i>Province
3190: 73 3c 2f 69 3e 29 2e 0d 0a 3c 2f 74 64 3e 3c 74  s</i>)...</td><t
31a0: 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30  d>.."<i>census20
31b0: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f  11_topofeatures_
31c0: 32 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63  2</i>"..<table c
31d0: 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c  ellspan="4" cell
31e0: 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f  padding="6" bgco
31f0: 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f  lor="#f8f8f0" bo
3200: 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c  rder="1">..<tr><
3210: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
3220: 30 66 38 22 3e 3c 62 3e 66 69 64 3c 2f 62 3e 3c  0f8"><b>fid</b><
3230: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
3240: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 63  r="#f0f0f8"><b>c
3250: 6f 64 5f 70 70 6c 3c 2f 62 3e 3c 2f 74 64 3e 0d  od_ppl</b></td>.
3260: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  .<td bgcolor="#f
3270: 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 63 6f  0f0f8"><b>cod_co
3280: 6d 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20  m</b></td>..<td 
3290: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38  bgcolor="#f0f0f8
32a0: 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74  "><b>name</b></t
32b0: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  d>..<td bgcolor=
32c0: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 70 6f 70  "#f0f0f8"><b>pop
32d0: 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a  _2011</b></td>..
32e0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
32f0: 66 30 66 38 22 3e 3c 62 3e 6d 5f 32 30 31 31 3c  f0f8"><b>m_2011<
3300: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
3310: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
3320: 3c 62 3e 66 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74  <b>f_2011</b></t
3330: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
3340: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31   align="right">1
3350: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3360: 72 69 67 68 74 22 3e 32 30 35 31 34 32 37 30 35  right">205142705
3370: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3380: 72 69 67 68 74 22 3e 34 35 30 30 31 3c 2f 74 64  right">45001</td
3390: 3e 3c 74 64 3e 41 6c 62 69 61 6e 6f 20 4d 61 67  ><td>Albiano Mag
33a0: 72 61 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  ra</td><td align
33b0: 3d 22 72 69 67 68 74 22 3e 31 39 30 37 3c 2f 74  ="right">1907</t
33c0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
33d0: 68 74 22 3e 39 31 39 3c 2f 74 64 3e 3c 74 64 20  ht">919</td><td 
33e0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 38  align="right">98
33f0: 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  8</td></tr>..<tr
3400: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3410: 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  t">2</td><td ali
3420: 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 35 31 34  gn="right">20514
3430: 32 37 30 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  2706</td><td ali
3440: 67 6e 3d 22 72 69 67 68 74 22 3e 34 35 30 30 31  gn="right">45001
3450: 3c 2f 74 64 3e 3c 74 64 3e 41 75 6c 6c 61 3c 2f  </td><td>Aulla</
3460: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
3470: 67 68 74 22 3e 34 33 32 31 3c 2f 74 64 3e 3c 74  ght">4321</td><t
3480: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3490: 32 30 34 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  2046</td><td ali
34a0: 67 6e 3d 22 72 69 67 68 74 22 3e 32 32 37 35 3c  gn="right">2275<
34b0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c  /td></tr>..<tr><
34c0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
34d0: 3e 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  >3</td><td align
34e0: 3d 22 72 69 67 68 74 22 3e 32 30 35 31 34 32 37  ="right">2051427
34f0: 31 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  10</td><td align
3500: 3d 22 72 69 67 68 74 22 3e 34 35 30 30 31 3c 2f  ="right">45001</
3510: 74 64 3e 3c 74 64 3e 43 61 70 72 69 67 6c 69 6f  td><td>Capriglio
3520: 6c 61 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  la</td><td align
3530: 3d 22 72 69 67 68 74 22 3e 34 38 32 3c 2f 74 64  ="right">482</td
3540: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3550: 74 22 3e 32 32 36 3c 2f 74 64 3e 3c 74 64 20 61  t">226</td><td a
3560: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 35 36  lign="right">256
3570: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
3580: 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 37 22 20  <td colspan="7" 
3590: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c  align="center"><
35a0: 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  hr></td></tr>..<
35b0: 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  tr><td align="ri
35c0: 67 68 74 22 3e 31 30 31 38 3c 2f 74 64 3e 3c 74  ght">1018</td><t
35d0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
35e0: 31 34 31 30 37 37 35 34 31 35 3c 2f 74 64 3e 3c  1410775415</td><
35f0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3600: 3e 31 30 30 30 30 37 3c 2f 74 64 3e 3c 74 64 3e  >100007</td><td>
3610: 53 61 73 73 65 74 61 3c 2f 74 64 3e 3c 74 64 20  Sasseta</td><td 
3620: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38  align="right">28
3630: 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  5</td><td align=
3640: 22 72 69 67 68 74 22 3e 31 33 37 3c 2f 74 64 3e  "right">137</td>
3650: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3660: 22 3e 31 34 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  ">148</td></tr>.
3670: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
3680: 72 69 67 68 74 22 3e 31 30 31 39 3c 2f 74 64 3e  right">1019</td>
3690: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
36a0: 22 3e 31 34 31 30 37 38 35 34 31 35 3c 2f 74 64  ">1410785415</td
36b0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
36c0: 74 22 3e 31 30 30 30 30 37 3c 2f 74 64 3e 3c 74  t">100007</td><t
36d0: 64 3e 54 65 72 72 69 67 6f 6c 69 3c 2f 74 64 3e  d>Terrigoli</td>
36e0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
36f0: 22 3e 35 33 37 3c 2f 74 64 3e 3c 74 64 20 61 6c  ">537</td><td al
3700: 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 36 34 3c  ign="right">264<
3710: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3720: 69 67 68 74 22 3e 32 37 33 3c 2f 74 64 3e 3c 2f  ight">273</td></
3730: 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c  tr>..</table>..<
3740: 62 72 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75 73 32  br>.."<i>census2
3750: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
3760: 5f 34 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 20  _4</i>"..<table 
3770: 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c  cellspan="4" cel
3780: 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63  lpadding="6" bgc
3790: 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62  olor="#f8f8f0" b
37a0: 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e  order="1">..<tr>
37b0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
37c0: 66 30 66 38 22 3e 3c 62 3e 66 69 64 3c 2f 62 3e  f0f8"><b>fid</b>
37d0: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c  </td>..<td bgcol
37e0: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e  or="#f0f0f8"><b>
37f0: 63 6f 64 5f 70 72 6f 76 3c 2f 62 3e 3c 2f 74 64  cod_prov</b></td
3800: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  >..<td bgcolor="
3810: 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f  #f0f0f8"><b>cod_
3820: 72 65 67 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74  reg</b></td>..<t
3830: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30  d bgcolor="#f0f0
3840: 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c  f8"><b>name</b><
3850: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
3860: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 61  r="#f0f0f8"><b>a
3870: 62 62 72 65 76 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a  bbrev</b></td>..
3880: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
3890: 66 30 66 38 22 3e 3c 62 3e 70 6f 70 5f 32 30 31  f0f8"><b>pop_201
38a0: 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20  1</b></td>..<td 
38b0: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38  bgcolor="#f0f0f8
38c0: 22 3e 3c 62 3e 6d 5f 32 30 31 31 3c 2f 62 3e 3c  "><b>m_2011</b><
38d0: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
38e0: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 66  r="#f0f0f8"><b>f
38f0: 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f  _2011</b></td></
3900: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69  tr>..<tr><td ali
3910: 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64  gn="right">1</td
3920: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3930: 74 22 3e 34 35 3c 2f 74 64 3e 3c 74 64 20 61 6c  t">45</td><td al
3940: 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74  ign="right">9</t
3950: 64 3e 3c 74 64 3e 4d 61 73 73 61 26 6e 62 73 70  d><td>Massa&nbsp
3960: 3b 43 61 72 72 61 72 61 3c 2f 74 64 3e 3c 74 64  ;Carrara</td><td
3970: 3e 4d 53 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  >MS</td><td alig
3980: 6e 3d 22 72 69 67 68 74 22 3e 31 39 39 36 35 30  n="right">199650
3990: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
39a0: 72 69 67 68 74 22 3e 39 35 37 35 34 3c 2f 74 64  right">95754</td
39b0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
39c0: 74 22 3e 31 30 33 38 39 36 3c 2f 74 64 3e 3c 2f  t">103896</td></
39d0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69  tr>..<tr><td ali
39e0: 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64  gn="right">2</td
39f0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3a00: 74 22 3e 34 36 3c 2f 74 64 3e 3c 74 64 20 61 6c  t">46</td><td al
3a10: 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74  ign="right">9</t
3a20: 64 3e 3c 74 64 3e 4c 75 63 63 61 3c 2f 74 64 3e  d><td>Lucca</td>
3a30: 3c 74 64 3e 4c 55 3c 2f 74 64 3e 3c 74 64 20 61  <td>LU</td><td a
3a40: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 38 38  lign="right">388
3a50: 33 32 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  327</td><td alig
3a60: 6e 3d 22 72 69 67 68 74 22 3e 31 38 36 31 38 33  n="right">186183
3a70: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3a80: 72 69 67 68 74 22 3e 32 30 32 31 34 34 3c 2f 74  right">202144</t
3a90: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
3aa0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33   align="right">3
3ab0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3ac0: 72 69 67 68 74 22 3e 34 37 3c 2f 74 64 3e 3c 74  right">47</td><t
3ad0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3ae0: 39 3c 2f 74 64 3e 3c 74 64 3e 50 69 73 74 6f 69  9</td><td>Pistoi
3af0: 61 3c 2f 74 64 3e 3c 74 64 3e 50 54 3c 2f 74 64  a</td><td>PT</td
3b00: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3b10: 74 22 3e 32 38 37 38 36 36 3c 2f 74 64 3e 3c 74  t">287866</td><t
3b20: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3b30: 31 33 38 30 35 34 3c 2f 74 64 3e 3c 74 64 20 61  138054</td><td a
3b40: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 34 39  lign="right">149
3b50: 38 31 32 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  812</td></tr>..<
3b60: 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22  tr><td colspan="
3b70: 38 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72  8" align="center
3b80: 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e  "><hr></td></tr>
3b90: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d  ..<tr><td align=
3ba0: 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74  "right">9</td><t
3bb0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3bc0: 35 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  53</td><td align
3bd0: 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c  ="right">9</td><
3be0: 74 64 3e 47 72 6f 73 73 65 74 6f 3c 2f 74 64 3e  td>Grosseto</td>
3bf0: 3c 74 64 3e 47 52 3c 2f 74 64 3e 3c 74 64 20 61  <td>GR</td><td a
3c00: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 32 30  lign="right">220
3c10: 35 36 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  564</td><td alig
3c20: 6e 3d 22 72 69 67 68 74 22 3e 31 30 35 35 38 35  n="right">105585
3c30: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3c40: 72 69 67 68 74 22 3e 31 31 34 39 37 39 3c 2f 74  right">114979</t
3c50: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
3c60: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31   align="right">1
3c70: 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  0</td><td align=
3c80: 22 72 69 67 68 74 22 3e 31 30 30 3c 2f 74 64 3e  "right">100</td>
3c90: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3ca0: 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 50 72 61 74  ">9</td><td>Prat
3cb0: 6f 3c 2f 74 64 3e 3c 74 64 3e 50 4f 3c 2f 74 64  o</td><td>PO</td
3cc0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3cd0: 74 22 3e 32 34 35 39 31 36 3c 2f 74 64 3e 3c 74  t">245916</td><t
3ce0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3cf0: 31 31 39 30 38 38 3c 2f 74 64 3e 3c 74 64 20 61  119088</td><td a
3d00: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 32 36  lign="right">126
3d10: 38 32 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  828</td></tr>..<
3d20: 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f  /table>..</td></
3d30: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c  tr>..<tr><td>..<
3d40: 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69  b><<i>topo-prefi
3d50: 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 66 65 61 74 75  x</i>>_topofeatu
3d60: 72 65 73 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74  res</b>..<verbat
3d70: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52  im>..SELECT * FR
3d80: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  OM census2011_to
3d90: 70 6f 66 65 61 74 75 72 65 73 3b 0d 0a 3c 2f 76  pofeatures;..</v
3da0: 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 20 3c 62  erbatim>..The <b
3db0: 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 2d 67 65  >TopoFeatures-ge
3dc0: 6f 6d 65 74 72 69 65 73 3c 2f 62 3e 20 74 61 62  ometries</b> tab
3dd0: 6c 65 20 69 73 20 69 6e 74 65 6e 64 65 64 20 74  le is intended t
3de0: 6f 20 70 65 72 6d 61 6e 65 6e 74 6c 79 20 73 74  o permanently st
3df0: 6f 72 65 20 61 6c 6c 20 72 65 6c 61 74 69 6f 6e  ore all relation
3e00: 73 20 62 65 74 77 65 65 6e 20 54 6f 70 6f 46 65  s between TopoFe
3e10: 61 74 75 72 65 73 20 61 6e 64 20 54 6f 70 6f 6c  atures and Topol
3e20: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 72  ogy primitives r
3e30: 65 71 75 69 72 65 64 20 69 6e 20 6f 72 64 65 72  equired in order
3e40: 20 74 6f 20 63 6f 72 72 65 63 74 6c 79 20 62 75   to correctly bu
3e50: 69 6c 64 20 74 68 65 20 65 78 70 65 63 74 65 64  ild the expected
3e60: 20 6f 75 74 70 75 74 20 47 65 6f 6d 65 74 72 79   output Geometry
3e70: 20 66 6f 72 20 65 61 63 68 20 54 6f 70 6f 46 65   for each TopoFe
3e80: 61 74 75 72 65 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c  ature...<ul>..<l
3e90: 69 3e 3c 62 3e 75 69 64 3c 2f 62 3e 20 69 73 20  i><b>uid</b> is 
3ea0: 74 68 65 20 50 72 69 6d 61 72 79 20 4b 65 79 2c  the Primary Key,
3eb0: 20 61 6e 64 20 69 73 20 73 69 6d 70 6c 79 20 69   and is simply i
3ec0: 6e 74 65 6e 64 65 64 20 74 6f 20 62 65 20 61 6e  ntended to be an
3ed0: 20 75 6e 69 71 75 65 20 69 64 65 6e 74 69 66 69   unique identifi
3ee0: 65 72 20 66 6f 72 20 65 61 63 68 20 72 6f 77 20  er for each row 
3ef0: 62 75 74 20 64 6f 65 73 6e 27 74 20 69 6e 74 65  but doesn't inte
3f00: 6e 64 20 74 6f 20 68 61 76 65 20 61 6e 79 20 73  nd to have any s
3f10: 70 65 63 69 61 6c 20 6d 65 61 6e 69 6e 67 2e 3c  pecial meaning.<
3f20: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 6e 6f 64  /li>..<li><b>nod
3f30: 65 5f 69 64 3c 2f 62 3e 2c 20 3c 62 3e 65 64 67  e_id</b>, <b>edg
3f40: 65 5f 69 64 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e  e_id</b> and <b>
3f50: 66 61 63 65 5f 69 64 3c 2f 62 3e 20 61 72 65 20  face_id</b> are 
3f60: 46 6f 72 65 69 67 6e 20 4b 65 79 73 20 64 69 72  Foreign Keys dir
3f70: 65 63 74 6c 79 20 72 65 66 65 72 65 6e 63 69 6e  ectly referencin
3f80: 67 20 61 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69  g a Topology pri
3f90: 6d 69 74 69 76 65 3b 20 74 77 6f 20 6f 66 20 74  mitive; two of t
3fa0: 68 65 73 65 20 76 61 6c 75 65 73 20 61 72 65 20  hese values are 
3fb0: 61 6c 77 61 79 73 20 65 78 70 65 63 74 65 64 20  always expected 
3fc0: 74 6f 20 62 65 20 4e 55 4c 4c 2c 20 61 6e 64 20  to be NULL, and 
3fd0: 6f 6e 6c 79 20 6f 6e 65 20 69 73 20 65 78 70 65  only one is expe
3fe0: 63 74 65 64 20 74 6f 20 65 66 66 65 63 74 69 76  cted to effectiv
3ff0: 65 6c 79 20 72 65 66 65 72 65 6e 63 65 20 61 20  ely reference a 
4000: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69  Topology primiti
4010: 76 65 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20  ve depending on 
4020: 69 74 73 20 74 79 70 65 2e 3c 2f 6c 69 3e 0d 0a  its type.</li>..
4030: 3c 6c 69 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 72  <li><b>topolayer
4040: 5f 69 64 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 66  _id</b> and <b>f
4050: 69 64 3c 2f 62 3e 20 74 6f 67 65 74 68 65 72 20  id</b> together 
4060: 61 72 65 20 69 6e 74 65 6e 64 65 64 20 74 6f 20  are intended to 
4070: 65 73 74 61 62 6c 69 73 68 20 61 20 72 65 6c 61  establish a rela
4080: 74 69 6f 6e 61 6c 20 72 65 66 65 72 65 6e 63 65  tional reference
4090: 20 74 6f 20 73 6f 6d 65 20 73 70 65 63 69 66 69   to some specifi
40a0: 63 20 54 6f 70 6f 46 65 61 74 75 72 65 2e 3c 2f  c TopoFeature.</
40b0: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e  li>..</ul>..<br>
40c0: 0d 0a 3c 75 3e 45 78 61 6d 70 6c 65 20 23 31 3c  ..<u>Example #1<
40d0: 2f 75 3e 3a 20 61 6c 6c 20 54 6f 70 6f 6c 6f 67  /u>: all Topolog
40e0: 79 20 70 72 69 6d 69 74 69 76 65 73 20 64 69 72  y primitives dir
40f0: 65 63 74 6c 79 20 72 65 66 65 72 65 6e 63 65 64  ectly referenced
4100: 20 62 79 20 72 6f 77 73 20 64 65 63 6c 61 72 69   by rows declari
4110: 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f  ng <b>topolayer_
4120: 69 64 3d 32 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e  id=2</b> and <b>
4130: 66 69 64 3d 33 3c 2f 62 3e 20 6d 75 73 74 20 62  fid=3</b> must b
4140: 65 20 61 67 67 72 65 67 61 74 65 64 20 69 6e 20  e aggregated in 
4150: 6f 72 64 65 72 20 74 6f 20 62 75 69 6c 64 20 74  order to build t
4160: 68 65 20 6f 75 74 70 75 74 20 47 65 6f 6d 65 74  he output Geomet
4170: 72 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67  ry corresponding
4180: 20 74 6f 20 74 68 65 20 50 6f 70 75 6c 61 74 65   to the Populate
4190: 64 20 50 6c 61 63 65 20 6f 66 20 3c 62 3e 43 61  d Place of <b>Ca
41a0: 70 72 69 67 6c 69 6f 6c 61 3c 2f 62 3e 2e 3c 62  prigliola</b>.<b
41b0: 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70 6c 65 20 23  r>..<u>Example #
41c0: 32 3c 2f 75 3e 3a 20 61 6c 6c 20 70 72 69 6d 69  2</u>: all primi
41d0: 74 69 76 65 73 20 72 65 66 65 72 65 6e 63 65 64  tives referenced
41e0: 20 62 79 20 72 6f 77 73 20 64 65 63 6c 61 72 69   by rows declari
41f0: 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f  ng <b>topolayer_
4200: 69 64 3d 34 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e  id=4</b> and <b>
4210: 66 69 64 3d 39 3c 2f 62 3e 20 6d 75 73 74 20 62  fid=9</b> must b
4220: 65 20 61 67 67 72 65 67 61 74 65 64 20 69 6e 20  e aggregated in 
4230: 6f 72 64 65 72 20 74 6f 20 62 75 69 6c 64 20 74  order to build t
4240: 68 65 20 6f 75 74 70 75 74 20 47 65 6f 6d 65 74  he output Geomet
4250: 72 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67  ry corresponding
4260: 20 74 6f 20 74 68 65 20 50 72 6f 76 69 6e 63 65   to the Province
4270: 20 6f 66 20 3c 62 3e 47 72 6f 73 73 65 74 6f 3c   of <b>Grosseto<
4280: 2f 62 3e 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d  /b>...</td><td>.
4290: 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f  ."<i>census2011_
42a0: 74 6f 70 6f 66 65 61 74 75 72 65 73 3c 2f 69 3e  topofeatures</i>
42b0: 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70  "..<table cellsp
42c0: 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69  an="4" cellpaddi
42d0: 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22  ng="6" bgcolor="
42e0: 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d  #f8f8f0" border=
42f0: 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67  "1">..<tr><td bg
4300: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
4310: 3c 62 3e 75 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d  <b>uid</b></td>.
4320: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  .<td bgcolor="#f
4330: 30 66 30 66 38 22 3e 3c 62 3e 6e 6f 64 65 5f 69  0f0f8"><b>node_i
4340: 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20  d</b></td>..<td 
4350: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38  bgcolor="#f0f0f8
4360: 22 3e 3c 62 3e 65 64 67 65 5f 69 64 3c 2f 62 3e  "><b>edge_id</b>
4370: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c  </td>..<td bgcol
4380: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e  or="#f0f0f8"><b>
4390: 66 61 63 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e  face_id</b></td>
43a0: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  ..<td bgcolor="#
43b0: 66 30 66 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c  f0f0f8"><b>topol
43c0: 61 79 65 72 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e  ayer_id</b></td>
43d0: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  ..<td bgcolor="#
43e0: 66 30 66 30 66 38 22 3e 3c 62 3e 66 69 64 3c 2f  f0f0f8"><b>fid</
43f0: 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74  b></td></tr>..<t
4400: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  r><td align="rig
4410: 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 4e 55  ht">1</td><td>NU
4420: 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c  LL</td><td>NULL<
4430: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
4440: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20  ight">1</td><td 
4450: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c  align="right">1<
4460: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
4470: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 2f 74 72  ight">1</td></tr
4480: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e  >..<tr><td align
4490: 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c  ="right">2</td><
44a0: 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e  td>NULL</td><td>
44b0: 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  NULL</td><td ali
44c0: 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64  gn="right">2</td
44d0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
44e0: 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  t">1</td><td ali
44f0: 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64  gn="right">2</td
4500: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
4510: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c  align="right">3<
4520: 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64  /td><td>NULL</td
4530: 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74  ><td>NULL</td><t
4540: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
4550: 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  3</td><td align=
4560: 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74  "right">1</td><t
4570: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
4580: 33 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  3</td></tr>..<tr
4590: 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 36 22  ><td colspan="6"
45a0: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e   align="center">
45b0: 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  <hr></td></tr>..
45c0: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  <tr><td align="r
45d0: 69 67 68 74 22 3e 32 38 38 37 30 3c 2f 74 64 3e  ight">28870</td>
45e0: 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64  <td>NULL</td><td
45f0: 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c  >NULL</td><td al
4600: 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 36  ign="right">2886
4610: 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  4</td><td align=
4620: 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74  "right">1</td><t
4630: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
4640: 32 38 38 36 37 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  28867</td></tr>.
4650: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
4660: 72 69 67 68 74 22 3e 32 38 38 37 31 3c 2f 74 64  right">28871</td
4670: 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74  ><td>NULL</td><t
4680: 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61  d>NULL</td><td a
4690: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38  lign="right">288
46a0: 36 38 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  68</td><td align
46b0: 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c  ="right">1</td><
46c0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
46d0: 3e 32 38 38 36 38 3c 2f 74 64 3e 3c 2f 74 72 3e  >28868</td></tr>
46e0: 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74 64  ..</table>..</td
46f0: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
4700: 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 70 61 64  ..<table cellpad
4710: 64 69 6e 67 3d 22 38 22 20 62 67 63 6f 6c 6f 72  ding="8" bgcolor
4720: 3d 22 23 64 30 66 66 62 30 22 3e 0d 0a 3c 74 72  ="#d0ffb0">..<tr
4730: 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 46 69 6e 61 6c  ><td>..<h3>Final
4740: 20 72 65 6d 61 72 6b 73 3c 2f 68 33 3e 0d 0a 3c   remarks</h3>..<
4750: 6f 6c 3e 0d 0a 3c 6c 69 3e 62 6f 74 68 20 3c 62  ol>..<li>both <b
4760: 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54  >TopoGeo_CreateT
4770: 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 61  opoLayer()</b> a
4780: 6e 64 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e  nd <b>TopoGeo_In
4790: 69 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62  itTopoLayer()</b
47a0: 3e 20 77 69 6c 6c 20 72 65 67 69 73 74 65 72 20  > will register 
47b0: 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20 69 6e  the TopoLayer in
47c0: 74 6f 20 74 68 65 20 3c 62 3e 54 6f 70 6f 4c 61  to the <b>TopoLa
47d0: 79 65 72 73 3c 2f 62 3e 20 74 61 62 6c 65 2c 20  yers</b> table, 
47e0: 61 6e 64 20 77 69 6c 6c 20 63 72 65 61 74 65 20  and will create 
47f0: 61 6e 64 20 70 6f 70 75 6c 61 74 65 20 74 68 65  and populate the
4800: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 3c   corresponding <
4810: 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 3c 2f  b>TopoFeatures</
4820: 62 3e 20 74 61 62 6c 65 20 62 79 20 69 6d 70 6f  b> table by impo
4830: 72 74 69 6e 67 20 61 6c 6c 20 69 6e 66 6f 72 6d  rting all inform
4840: 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73  ation attributes
4850: 20 66 6f 72 20 65 61 63 68 20 46 65 61 74 75 72   for each Featur
4860: 65 20 64 65 66 69 6e 65 64 20 62 79 20 74 68 65  e defined by the
4870: 20 72 65 66 65 72 65 6e 63 65 20 74 61 62 6c 65   reference table
4880: 20 28 6f 72 20 72 65 66 65 72 65 6e 63 65 20 76   (or reference v
4890: 69 65 77 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  iew).</li>..<li>
48a0: 6f 6e 6c 79 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f  only <b>TopoGeo_
48b0: 43 72 65 61 74 65 54 6f 70 6f 4c 61 79 65 72 28  CreateTopoLayer(
48c0: 29 3c 2f 62 3e 20 77 69 6c 6c 20 61 75 74 6f 6d  )</b> will autom
48d0: 61 74 69 63 61 6c 6c 79 20 70 6f 70 75 6c 61 74  atically populat
48e0: 65 20 74 68 65 20 3c 62 3e 54 6f 70 6f 46 65 61  e the <b>TopoFea
48f0: 74 75 72 65 73 2d 67 65 6f 6d 65 74 72 79 3c 2f  tures-geometry</
4900: 62 3e 20 74 61 62 6c 65 2c 20 61 6e 64 20 77 68  b> table, and wh
4910: 69 6c 65 20 64 6f 69 6e 67 20 73 6f 2c 20 69 64  ile doing so, id
4920: 65 6e 74 69 66 79 20 61 6c 6c 20 72 65 6c 61 74  entify all relat
4930: 69 6f 6e 73 68 69 70 73 20 65 78 69 73 74 69 6e  ionships existin
4940: 67 20 62 65 74 77 65 65 6e 20 74 68 65 20 47 65  g between the Ge
4950: 6f 6d 65 74 72 69 65 73 20 66 6f 75 6e 64 20 69  ometries found i
4960: 6e 74 6f 20 74 68 65 20 72 65 66 65 72 65 6e 63  nto the referenc
4970: 65 20 74 61 62 6c 65 20 6f 72 20 76 69 65 77 20  e table or view 
4980: 61 6e 64 20 74 68 65 20 54 6f 70 6f 6c 6f 67 79  and the Topology
4990: 20 70 72 69 6d 69 74 69 76 65 73 20 62 61 73 65   primitives base
49a0: 64 20 6f 6e 20 74 68 65 20 76 61 6c 75 65 73 20  d on the values 
49b0: 6f 66 20 74 68 65 20 3c 62 3e 54 6f 70 6f 53 65  of the <b>TopoSe
49c0: 65 64 73 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c  eds</b>.</li>..<
49d0: 6c 69 3e 61 73 20 61 70 70 6f 73 65 64 20 74 6f  li>as apposed to
49e0: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 74   <b>TopoGeo_Init
49f0: 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 2c  TopoLayer()</b>,
4a00: 20 77 68 69 63 68 20 77 69 6c 6c 20 6e 65 76 65   which will neve
4a10: 72 20 61 74 74 65 6d 70 74 20 74 6f 20 69 64 65  r attempt to ide
4a20: 6e 74 69 66 79 20 74 68 65 20 72 65 6c 61 74 69  ntify the relati
4a30: 6f 6e 73 68 69 70 73 20 69 6e 74 65 72 63 75 72  onships intercur
4a40: 72 69 6e 67 20 62 65 74 77 65 65 6e 20 6f 75 74  ring between out
4a50: 70 75 74 20 47 65 6f 6d 65 74 72 69 65 73 20 61  put Geometries a
4a60: 6e 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d  nd Topology prim
4a70: 69 74 69 76 65 73 2e 20 54 68 69 73 20 74 61 73  itives. This tas
4a80: 6b 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 62 65  k will always be
4a90: 20 64 65 66 65 72 72 65 64 20 66 6f 72 20 74 68   deferred for th
4aa0: 65 20 75 73 65 72 20 74 6f 20 64 65 61 6c 20 77  e user to deal w
4ab0: 69 74 68 20 6c 61 74 65 72 2e 3c 62 72 3e 0d 0a  ith later.<br>..
4ac0: 59 6f 75 20 63 6f 75 6c 64 2c 20 66 6f 72 20 65  You could, for e
4ad0: 78 61 6d 70 6c 65 2c 20 6d 61 6e 75 61 6c 6c 79  xample, manually
4ae0: 20 73 65 6c 65 63 74 20 61 6c 6c 20 54 6f 70 6f   select all Topo
4af0: 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20  logy primitives 
4b00: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f  corresponding to
4b10: 20 61 20 73 69 6e 67 6c 65 20 54 6f 70 6f 46 65   a single TopoFe
4b20: 61 74 75 72 65 3b 20 6f 72 20 6d 6f 72 65 20 70  ature; or more p
4b30: 72 6f 62 61 62 6c 79 20 79 6f 75 20 63 6f 75 6c  robably you coul
4b40: 64 20 70 65 72 66 6f 72 6d 20 74 68 69 73 20 74  d perform this t
4b50: 61 73 6b 20 69 6e 20 61 20 73 65 63 6f 6e 64 20  ask in a second 
4b60: 72 6f 75 6e 64 20 62 79 20 65 78 65 63 75 74 69  round by executi
4b70: 6e 67 20 73 6f 6d 65 20 61 70 70 72 6f 70 72 69  ng some appropri
4b80: 61 74 65 20 53 51 4c 20 73 74 61 74 65 6d 65 6e  ate SQL statemen
4b90: 74 20 28 3c 69 3e 61 73 20 77 65 27 6c 6c 20 73  t (<i>as we'll s
4ba0: 65 65 6e 20 73 6f 6f 6e 20 69 6e 20 74 68 65 20  een soon in the 
4bb0: 6e 65 78 74 20 65 78 61 6d 70 6c 65 3c 2f 69 3e  next example</i>
4bc0: 29 2e 20 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c 2f 74 64  ). ..</ol>..</td
4bd0: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
4be0: 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 3e  <br>..<hr>..<h3>
4bf0: 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f  TopoGeo_ExportTo
4c00: 70 6f 4c 61 79 65 72 3a 20 65 78 70 6f 72 74 69  poLayer: exporti
4c10: 6e 67 20 61 20 66 75 6c 6c 20 54 6f 70 6f 4c 61  ng a full TopoLa
4c20: 79 65 72 20 69 6e 74 6f 20 61 20 47 65 6f 54 61  yer into a GeoTa
4c30: 62 6c 65 3c 2f 68 33 3e 0d 0a 3c 74 61 62 6c 65  ble</h3>..<table
4c40: 20 77 69 64 74 68 3d 22 31 30 30 25 22 20 20 63   width="100%"  c
4c50: 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c  ellspan="4" cell
4c60: 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f  padding="6" bgco
4c70: 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f  lor="#f8f8f0" bo
4c80: 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c  rder="1">..<tr><
4c90: 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22 20 61  td colspan="2" a
4ca0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62  lign="center"><b
4cb0: 3e 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20 43  >exporting the C
4cc0: 65 6e 73 75 73 20 41 72 65 61 73 20 54 6f 70 6f  ensus Areas Topo
4cd0: 4c 61 79 65 72 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f  Layer</b></td></
4ce0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 57  tr>..<tr><td>..W
4cf0: 65 27 6c 6c 20 73 74 61 72 74 20 62 79 20 65 78  e'll start by ex
4d00: 70 6f 72 74 69 6e 67 20 66 69 72 73 74 20 74 68  porting first th
4d10: 65 20 6f 6e 6c 79 20 63 6f 6d 70 6c 65 74 65 6c  e only completel
4d20: 79 20 64 65 66 69 6e 65 64 20 54 6f 70 6f 4c 61  y defined TopoLa
4d30: 79 65 72 20 77 65 20 68 61 76 65 20 61 74 20 74  yer we have at t
4d40: 68 69 73 20 70 6f 69 6e 74 20 69 6e 20 74 68 65  his point in the
4d50: 20 74 65 73 74 20 44 42 2d 66 69 6c 65 2c 20 69   test DB-file, i
4d60: 2e 65 2e 20 3c 62 3e 63 65 6e 73 75 73 5f 61 72  .e. <b>census_ar
4d70: 65 61 73 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74  eas</b>..<verbat
4d80: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f  im>..SELECT Topo
4d90: 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61  Geo_ExportTopoLa
4da0: 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27  yer('census2011'
4db0: 2c 20 27 63 65 6e 73 75 73 5f 61 72 65 61 73 27  , 'census_areas'
4dc0: 2c 20 27 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30  , 'out_census_20
4dd0: 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62  11', 1);..</verb
4de0: 61 74 69 6d 3e 0d 0a 41 73 20 79 6f 75 20 63 61  atim>..As you ca
4df0: 6e 20 65 61 73 69 6c 79 20 63 68 65 63 6b 20 62  n easily check b
4e00: 79 20 79 6f 75 72 73 65 6c 66 20 61 20 6e 65 77  y yourself a new
4e10: 20 47 65 6f 54 61 62 6c 65 20 6e 61 6d 65 64 20   GeoTable named 
4e20: 3c 62 3e 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30  <b>out_census_20
4e30: 31 31 3c 2f 62 3e 20 68 61 73 20 62 65 65 6e 20  11</b> has been 
4e40: 63 72 65 61 74 65 64 20 62 79 20 3c 62 3e 54 6f  created by <b>To
4e50: 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f  poGeo_ExportTopo
4e60: 4c 61 79 65 72 28 29 3c 2f 62 3e 3a 0d 0a 3c 75  Layer()</b>:..<u
4e70: 6c 3e 0d 0a 3c 6c 69 3e 74 68 69 73 20 47 65 6f  l>..<li>this Geo
4e80: 54 61 62 6c 65 20 63 6f 6e 74 61 69 6e 73 20 61  Table contains a
4e90: 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20  ll TopoFeatures 
4ea0: 64 65 66 69 6e 65 64 20 69 6e 74 6f 20 74 68 65  defined into the
4eb0: 20 54 6f 70 6f 4c 61 79 65 72 2e 3c 2f 6c 69 3e   TopoLayer.</li>
4ec0: 0d 0a 3c 6c 69 3e 65 61 63 68 20 54 6f 70 6f 46  ..<li>each TopoF
4ed0: 65 61 74 75 72 65 20 66 61 69 74 68 66 75 6c 6c  eature faithfull
4ee0: 79 20 70 72 65 73 65 72 76 65 73 20 69 74 73 20  y preserves its 
4ef0: 69 6e 69 74 69 61 6c 20 69 6e 66 6f 72 6d 61 74  initial informat
4f00: 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 2e 3c  ion attributes.<
4f10: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6c 6c 20 47 65  /li>..<li>all Ge
4f20: 6f 6d 65 74 72 69 65 73 20 61 72 65 20 70 72 65  ometries are pre
4f30: 63 69 73 65 6c 79 20 62 75 69 6c 74 20 62 79 20  cisely built by 
4f40: 61 67 67 72 65 67 61 74 69 6e 67 20 74 68 65 20  aggregating the 
4f50: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 54 6f  corresponding To
4f60: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
4f70: 73 20 61 73 20 73 70 65 63 69 66 69 65 64 20 62  s as specified b
4f80: 79 20 54 6f 70 6f 4c 61 79 65 72 20 2f 20 54 6f  y TopoLayer / To
4f90: 70 6f 46 65 61 74 75 72 65 73 20 72 65 6c 61 74  poFeatures relat
4fa0: 69 6f 6e 73 68 69 70 73 2e 3c 2f 6c 69 3e 0d 0a  ionships.</li>..
4fb0: 3c 2f 75 6c 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 54  </ul><br><br>..T
4fc0: 68 65 20 69 6d 61 67 65 20 65 78 61 6d 70 6c 69  he image exampli
4fd0: 66 69 65 73 20 61 20 63 68 6f 72 6f 70 6c 65 74  fies a choroplet
4fe0: 68 20 63 65 6e 74 65 72 65 64 20 61 72 6f 75 6e  h centered aroun
4ff0: 64 20 74 68 65 20 49 73 6c 61 6e 64 20 6f 66 20  d the Island of 
5000: 45 6c 62 61 20 61 6e 64 20 62 61 73 65 64 20 6f  Elba and based o
5010: 6e 20 74 68 65 20 3c 62 3e 6f 75 74 5f 63 65 6e  n the <b>out_cen
5020: 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20 47 65 6f  sus_2011</b> Geo
5030: 54 61 62 6c 65 3a 20 61 6c 6c 20 43 65 6e 73 75  Table: all Censu
5040: 73 20 41 72 65 61 73 20 61 72 65 20 64 69 73 70  s Areas are disp
5050: 6c 61 79 65 64 20 62 79 20 61 64 6f 70 74 69 6e  layed by adoptin
5060: 67 20 61 20 63 6f 6c 6f 75 72 20 64 69 72 65 63  g a colour direc
5070: 74 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  tly correspondin
5080: 67 20 74 6f 20 74 68 65 69 72 20 70 6f 70 75 6c  g to their popul
5090: 61 74 69 6f 6e 20 64 65 6e 73 69 74 79 2e 0d 0a  ation density...
50a0: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20  </td><td>..<img 
50b0: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77  src="https://www
50c0: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69  .gaia-gis.it/gai
50d0: 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f  a-sins/topofigs/
50e0: 65 6c 62 61 2d 63 68 6f 72 6f 70 6c 65 74 68 2e  elba-choropleth.
50f0: 70 6e 67 22 20 61 6c 74 3d 22 65 6c 62 61 2d 63  png" alt="elba-c
5100: 68 6f 72 6f 70 6c 65 74 68 22 3e 0d 0a 3c 2f 74  horopleth">..</t
5110: 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65  d></tr>..</table
5120: 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33  ><br>..<hr>..<h3
5130: 3e 42 75 69 6c 64 69 6e 67 20 61 20 66 75 6c 6c  >Building a full
5140: 20 68 69 65 72 61 72 63 68 79 20 6f 66 20 41 64   hierarchy of Ad
5150: 6d 69 6e 69 73 74 72 61 74 69 76 65 20 4c 65 76  ministrative Lev
5160: 65 6c 73 20 62 79 20 53 51 4c 20 73 74 61 74 65  els by SQL state
5170: 6d 65 6e 74 73 3c 2f 68 33 3e 0d 0a 41 73 20 77  ments</h3>..As w
5180: 65 27 76 65 20 61 6c 72 65 61 64 79 20 73 65 65  e've already see
5190: 6e 20 62 65 66 6f 72 65 20 77 65 20 61 72 65 20  n before we are 
51a0: 6e 6f 77 20 65 78 70 65 63 74 65 64 20 74 6f 20  now expected to 
51b0: 63 6f 6d 70 6c 65 74 65 20 73 6f 6d 65 77 61 79  complete someway
51c0: 20 74 68 65 20 54 6f 70 6f 46 65 61 74 75 72 65   the TopoFeature
51d0: 73 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 73 75  s definitions su
51e0: 70 70 6f 72 74 69 6e 67 20 74 68 65 20 3c 62 3e  pporting the <b>
51f0: 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73  Populated Places
5200: 3c 2f 62 3e 2c 20 3c 62 3e 4d 75 6e 69 63 69 70  </b>, <b>Municip
5210: 61 6c 69 74 69 65 73 3c 2f 62 3e 2c 20 3c 62 3e  alities</b>, <b>
5220: 50 72 6f 76 69 6e 63 65 73 3c 2f 62 3e 20 61 6e  Provinces</b> an
5230: 64 20 3c 62 3e 52 65 67 69 6f 6e 3c 2f 62 3e 20  d <b>Region</b> 
5240: 54 6f 70 6f 4c 61 79 65 72 73 20 77 65 27 76 65  TopoLayers we've
5250: 20 70 72 65 76 69 6f 75 73 6c 79 20 63 72 65 61   previously crea
5260: 74 65 64 20 62 79 20 63 61 6c 6c 69 6e 67 20 3c  ted by calling <
5270: 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f  b>TopoGeo_InitTo
5280: 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 2e 3c 62  poLayer()</b>.<b
5290: 72 3e 3c 62 72 3e 0d 0a 48 61 70 70 69 6c 79 20  r><br>..Happily 
52a0: 65 6e 6f 75 67 68 20 61 6c 6c 20 74 68 65 73 65  enough all these
52b0: 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20   administrative 
52c0: 6c 65 76 65 6c 73 20 61 72 65 20 73 69 6d 70 6c  levels are simpl
52d0: 79 20 62 61 73 65 64 20 6f 6e 20 64 69 72 65 63  y based on direc
52e0: 74 20 61 67 67 72 65 67 61 74 69 6f 6e 73 20 6f  t aggregations o
52f0: 66 20 3c 62 3e 43 65 6e 73 75 73 20 41 72 65 61  f <b>Census Area
5300: 73 3c 2f 62 3e 2c 20 73 6f 20 77 65 20 6a 75 73  s</b>, so we jus
5310: 74 20 68 61 76 65 20 74 6f 20 65 78 65 63 75 74  t have to execut
5320: 65 20 66 65 77 20 61 70 70 72 6f 70 72 69 61 74  e few appropriat
5330: 65 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 73  e SQL statements
5340: 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49  ...<verbatim>..I
5350: 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 75  NSERT INTO censu
5360: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
5370: 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c  es..SELECT NULL,
5380: 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64   c.node_id, c.ed
5390: 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 64  ge_id, c.face_id
53a0: 2c 20 32 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d  , 2, a.fid..FROM
53b0: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f   census2011_topo
53c0: 66 65 61 74 75 72 65 73 5f 32 20 41 53 20 61 0d  features_2 AS a.
53d0: 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31  .JOIN census2011
53e0: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 31 20  _topofeatures_1 
53f0: 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 70  AS b ON (b.cod_p
5400: 70 6c 20 3d 20 61 2e 63 6f 64 5f 70 70 6c 29 0d  pl = a.cod_ppl).
5410: 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31  .JOIN census2011
5420: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 53  _topofeatures AS
5430: 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 61 79   c ON (c.topolay
5440: 65 72 5f 69 64 20 3d 20 31 20 41 4e 44 20 63 2e  er_id = 1 AND c.
5450: 66 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c  fid = b.fid);..<
5460: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 75 6c 3e  /verbatim>..<ul>
5470: 0d 0a 3c 6c 69 3e 3c 62 3e 63 65 6e 73 75 73 32  ..<li><b>census2
5480: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
5490: 5f 31 3c 2f 62 3e 20 69 73 20 74 68 65 20 54 6f  _1</b> is the To
54a0: 70 6f 46 65 61 74 75 72 65 73 20 74 61 62 6c 65  poFeatures table
54b0: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74   corresponding t
54c0: 6f 20 3c 62 3e 43 65 6e 73 75 73 20 41 72 65 61  o <b>Census Area
54d0: 73 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  s</b>.</li>..<li
54e0: 3e 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 5f 74  ><b>census2011_t
54f0: 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 3c 2f 62  opofeatures_2</b
5500: 3e 20 69 73 20 74 68 65 20 63 6f 72 72 65 73 70  > is the corresp
5510: 6f 6e 64 73 20 74 6f 20 3c 62 3e 50 6f 70 75 6c  onds to <b>Popul
5520: 61 74 65 64 20 50 6c 61 63 65 73 3c 2f 62 3e 3b  ated Places</b>;
5530: 20 74 68 65 20 63 6c 61 75 73 65 20 3c 62 3e 62   the clause <b>b
5540: 2e 63 6f 64 5f 70 70 6c 20 3d 20 61 2e 63 6f 64  .cod_ppl = a.cod
5550: 5f 70 70 6c 3c 2f 62 3e 20 77 69 6c 6c 20 72 65  _ppl</b> will re
5560: 6c 61 74 69 6f 6e 61 6c 6c 79 20 6a 6f 69 6e 20  lationally join 
5570: 65 61 63 68 20 50 6f 70 75 6c 61 74 65 64 20 50  each Populated P
5580: 6c 61 63 65 20 74 6f 20 69 74 73 20 75 6e 64 65  lace to its unde
5590: 72 6c 61 79 69 6e 67 20 43 65 6e 73 75 73 20 41  rlaying Census A
55a0: 72 65 61 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  reas.</li>..<li>
55b0: 73 6f 20 77 65 20 63 61 6e 20 64 75 6c 79 20 69  so we can duly i
55c0: 6e 73 65 72 74 20 69 6e 74 6f 20 74 68 65 20 3c  nsert into the <
55d0: 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 2d 67  b>TopoFeatures-g
55e0: 65 6f 6d 65 74 72 79 3c 2f 62 3e 20 74 61 62 6c  eometry</b> tabl
55f0: 65 20 28 69 2e 65 2e 20 3c 69 3e 63 65 6e 73 75  e (i.e. <i>censu
5600: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
5610: 65 73 3c 2f 69 3e 29 20 61 20 6e 65 77 20 6c 65  es</i>) a new le
5620: 76 65 6c 20 6f 66 20 72 65 66 65 72 65 6e 63 65  vel of reference
5630: 73 20 74 6f 20 54 6f 70 6f 6c 6f 67 79 20 70 72  s to Topology pr
5640: 69 6d 69 74 69 76 65 73 20 62 79 20 73 69 6d 70  imitives by simp
5650: 6c 79 20 63 6f 70 79 69 6e 67 20 61 6c 6c 20 64  ly copying all d
5660: 65 66 69 6e 69 74 69 6f 6e 73 20 61 6c 72 65 61  efinitions alrea
5670: 64 79 20 73 74 6f 72 65 64 20 69 6e 74 6f 20 74  dy stored into t
5680: 68 65 20 70 72 65 76 69 6f 75 73 20 68 69 65 72  he previous hier
5690: 61 72 63 68 69 63 61 6c 20 6c 65 76 65 6c 2e 3c  archical level.<
56a0: 62 72 3e 0d 0a 41 6e 64 20 74 6f 20 64 6f 20 73  br>..And to do s
56b0: 75 63 68 20 61 20 74 68 69 6e 67 20 77 65 20 73  uch a thing we s
56c0: 69 6d 70 6c 79 20 68 61 76 65 20 74 6f 20 72 65  imply have to re
56d0: 61 64 20 66 72 6f 6d 20 3c 62 3e 74 6f 70 6f 6c  ad from <b>topol
56e0: 61 79 65 72 3d 31 3c 2f 62 3e 20 74 68 65 6e 20  ayer=1</b> then 
56f0: 69 6e 73 65 72 74 69 6e 67 20 69 6e 74 6f 20 3c  inserting into <
5700: 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 32 3c 2f 62  b>topolayer=2</b
5710: 3e 20 61 66 74 65 72 20 73 65 74 74 69 6e 67 20  > after setting 
5720: 74 68 65 20 61 70 70 72 6f 70 72 69 61 74 65 20  the appropriate 
5730: 3c 62 3e 66 69 64 3c 2f 62 3e 20 76 61 6c 75 65  <b>fid</b> value
5740: 73 2e 3c 62 72 3e 0d 0a 52 65 61 6c 6c 79 20 6e  s.<br>..Really n
5750: 6f 74 20 61 20 64 69 66 66 69 63 75 6c 74 20 74  ot a difficult t
5760: 61 73 6b 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e  ask.</li>..</ul>
5770: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49 4e  ..<verbatim>..IN
5780: 53 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 75 73  SERT INTO census
5790: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
57a0: 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20  s..SELECT NULL, 
57b0: 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64 67  c.node_id, c.edg
57c0: 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 64 2c  e_id, c.face_id,
57d0: 20 33 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20   3, a.fid..FROM 
57e0: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66  census2011_topof
57f0: 65 61 74 75 72 65 73 5f 33 20 41 53 20 61 0d 0a  eatures_3 AS a..
5800: 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f  JOIN census2011_
5810: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 31 20 41  topofeatures_1 A
5820: 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 63 6f  S b ON (b.cod_co
5830: 6d 20 3d 20 61 2e 63 6f 64 5f 63 6f 6d 29 0d 0a  m = a.cod_com)..
5840: 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f  JOIN census2011_
5850: 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 53 20  topofeatures AS 
5860: 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 61 79 65  c ON (c.topolaye
5870: 72 5f 69 64 20 3d 20 31 20 41 4e 44 20 63 2e 66  r_id = 1 AND c.f
5880: 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f  id = b.fid);..</
5890: 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65 20 63 61  verbatim>..We ca
58a0: 6e 20 61 64 6f 70 74 20 65 78 61 63 74 6c 79 20  n adopt exactly 
58b0: 74 68 65 20 73 61 6d 65 20 69 64 65 6e 74 69 63  the same identic
58c0: 61 6c 20 61 70 70 72 6f 61 63 68 20 69 6e 20 6f  al approach in o
58d0: 72 64 65 72 20 74 6f 20 63 6f 6d 70 6c 65 74 65  rder to complete
58e0: 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 33 3c   <b>topolayer=3<
58f0: 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  /b> correspondin
5900: 67 20 74 6f 20 3c 62 3e 4d 75 6e 69 63 69 70 61  g to <b>Municipa
5910: 6c 69 74 69 65 73 3c 2f 62 3e 2e 0d 0a 3c 76 65  lities</b>...<ve
5920: 72 62 61 74 69 6d 3e 0d 0a 49 4e 53 45 52 54 20  rbatim>..INSERT 
5930: 49 4e 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f  INTO census2011_
5940: 74 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45  topofeatures..SE
5950: 4c 45 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64  LECT NULL, c.nod
5960: 65 5f 69 64 2c 20 63 2e 65 64 67 65 5f 69 64 2c  e_id, c.edge_id,
5970: 20 63 2e 66 61 63 65 5f 69 64 2c 20 34 2c 20 61   c.face_id, 4, a
5980: 2e 66 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75  .fid..FROM censu
5990: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
59a0: 65 73 5f 34 20 41 53 20 61 0d 0a 4a 4f 49 4e 20  es_4 AS a..JOIN 
59b0: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66  census2011_topof
59c0: 65 61 74 75 72 65 73 5f 33 20 41 53 20 62 20 4f  eatures_3 AS b O
59d0: 4e 20 28 62 2e 63 6f 64 5f 70 72 6f 76 20 3d 20  N (b.cod_prov = 
59e0: 61 2e 63 6f 64 5f 70 72 6f 76 29 0d 0a 4a 4f 49  a.cod_prov)..JOI
59f0: 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70  N census2011_top
5a00: 6f 66 65 61 74 75 72 65 73 20 41 53 20 63 20 4f  ofeatures AS c O
5a10: 4e 20 28 63 2e 74 6f 70 6f 6c 61 79 65 72 5f 69  N (c.topolayer_i
5a20: 64 20 3d 20 33 20 41 4e 44 20 63 2e 66 69 64 20  d = 3 AND c.fid 
5a30: 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 72  = b.fid);..</ver
5a40: 62 61 74 69 6d 3e 0d 0a 4d 6f 72 65 20 6f 72 20  batim>..More or 
5a50: 6c 65 73 73 20 74 68 65 20 73 61 6d 65 20 69 73  less the same is
5a60: 20 66 6f 72 20 64 65 72 69 76 69 6e 67 20 3c 62   for deriving <b
5a70: 3e 74 6f 70 6f 6c 61 79 65 72 3d 34 3c 2f 62 3e  >topolayer=4</b>
5a80: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74   corresponding t
5a90: 6f 20 3c 62 3e 50 72 6f 76 69 6e 63 65 73 3c 2f  o <b>Provinces</
5aa0: 62 3e 3b 20 74 68 69 73 20 74 69 6d 65 20 77 65  b>; this time we
5ab0: 27 6c 6c 20 73 69 6d 70 6c 79 20 61 67 67 72 65  'll simply aggre
5ac0: 67 61 74 65 20 74 68 65 20 75 6e 64 65 72 6c 79  gate the underly
5ad0: 69 6e 67 20 4d 75 6e 69 63 69 70 61 6c 69 74 69  ing Municipaliti
5ae0: 65 73 20 66 72 6f 6d 20 3c 62 3e 74 6f 70 6f 6c  es from <b>topol
5af0: 61 79 65 72 3d 33 3c 2f 62 3e 2e 0d 0a 3c 2f 76  ayer=3</b>...</v
5b00: 65 72 62 61 74 69 6d 3e 0d 0a 57 65 20 63 61 6e  erbatim>..We can
5b10: 20 61 64 6f 70 74 20 65 78 61 63 74 6c 79 20 74   adopt exactly t
5b20: 68 65 20 73 61 6d 65 20 69 64 65 6e 74 69 63 61  he same identica
5b30: 6c 20 61 70 70 72 6f 61 63 68 20 69 6e 20 6f 72  l approach in or
5b40: 64 65 72 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20  der to complete 
5b50: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 33 3c 2f  <b>topolayer=3</
5b60: 62 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67  b> corresponding
5b70: 20 74 6f 20 3c 62 3e 4d 75 6e 69 63 69 70 61 6c   to <b>Municipal
5b80: 69 74 69 65 73 3c 2f 62 3e 2e 0d 0a 3c 76 65 72  ities</b>...<ver
5b90: 62 61 74 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49  batim>..INSERT I
5ba0: 4e 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74  NTO census2011_t
5bb0: 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c  opofeatures..SEL
5bc0: 45 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65  ECT NULL, c.node
5bd0: 5f 69 64 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20  _id, c.edge_id, 
5be0: 63 2e 66 61 63 65 5f 69 64 2c 20 35 2c 20 61 2e  c.face_id, 5, a.
5bf0: 66 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73  fid..FROM census
5c00: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
5c10: 73 5f 35 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63  s_5 AS a..JOIN c
5c20: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
5c30: 61 74 75 72 65 73 5f 34 20 41 53 20 62 20 4f 4e  atures_4 AS b ON
5c40: 20 28 62 2e 63 6f 64 5f 72 65 67 20 3d 20 61 2e   (b.cod_reg = a.
5c50: 63 6f 64 5f 72 65 67 29 0d 0a 4a 4f 49 4e 20 63  cod_reg)..JOIN c
5c60: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
5c70: 61 74 75 72 65 73 20 41 53 20 63 20 4f 4e 20 28  atures AS c ON (
5c80: 63 2e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d  c.topolayer_id =
5c90: 20 34 20 41 4e 44 20 63 2e 66 69 64 20 3d 20 62   4 AND c.fid = b
5ca0: 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74  .fid);..</verbat
5cb0: 69 6d 3e 0d 0a 41 6e 64 20 66 69 6e 61 6c 6c 79  im>..And finally
5cc0: 20 77 65 20 63 61 6e 20 64 65 72 69 76 65 20 3c   we can derive <
5cd0: 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 35 3c 2f 62  b>topolayer=5</b
5ce0: 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20  > corresponding 
5cf0: 74 6f 20 3c 62 3e 52 65 67 69 6f 6e 73 3c 2f 62  to <b>Regions</b
5d00: 3e 20 62 79 20 64 69 72 65 63 74 6c 79 20 61 67  > by directly ag
5d10: 67 72 65 67 61 74 69 6e 67 20 74 68 65 20 75 6e  gregating the un
5d20: 64 65 72 6c 79 69 6e 67 20 50 72 6f 76 69 6e 63  derlying Provinc
5d30: 65 73 20 66 72 6f 6d 20 3c 62 3e 74 6f 70 6f 6c  es from <b>topol
5d40: 61 79 65 72 3d 34 3c 2f 62 3e 2e 0d 0a 3c 62 72  ayer=4</b>...<br
5d50: 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65 20 77 69  ><br>..<table wi
5d60: 64 74 68 3d 22 31 30 30 25 22 20 20 63 65 6c 6c  dth="100%"  cell
5d70: 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64  span="4" cellpad
5d80: 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72  ding="6" bgcolor
5d90: 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65  ="#f8f8f0" borde
5da0: 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 3e  r="1">..<tr><td>
5db0: 0d 0a 3c 62 3e 73 74 65 70 20 23 31 3a 20 65 78  ..<b>step #1: ex
5dc0: 70 6f 72 74 69 6e 67 20 74 68 65 20 52 65 67 69  porting the Regi
5dd0: 6f 6e 20 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e  on TopoLayer</b>
5de0: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45  ..<verbatim>..SE
5df0: 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70  LECT TopoGeo_Exp
5e00: 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65  ortTopoLayer('ce
5e10: 6e 73 75 73 32 30 31 31 27 2c 20 27 72 65 67 27  nsus2011', 'reg'
5e20: 2c 20 27 6f 75 74 5f 72 65 67 5f 32 30 31 31 27  , 'out_reg_2011'
5e30: 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69  , 1);..</verbati
5e40: 6d 3e 0d 0a 57 65 20 61 72 65 20 6e 6f 77 20 64  m>..We are now d
5e50: 65 66 69 6e 69 74 65 6c 79 20 72 65 61 64 79 20  efinitely ready 
5e60: 74 6f 20 65 78 70 6f 72 74 20 61 6e 79 20 6f 74  to export any ot
5e70: 68 65 72 20 41 64 6d 69 6e 69 73 74 72 61 74 69  her Administrati
5e80: 76 65 20 4c 65 76 65 6c 2e 3c 62 72 3e 0d 0a 46  ve Level.<br>..F
5e90: 6f 72 20 74 68 65 20 73 61 6b 65 20 6f 66 20 63  or the sake of c
5ea0: 6c 61 72 69 74 79 20 77 65 27 6c 6c 20 66 6f 6c  larity we'll fol
5eb0: 6c 6f 77 20 61 20 74 6f 70 2d 62 6f 74 74 6f 6d  low a top-bottom
5ec0: 20 6f 72 64 65 72 2c 20 73 6f 20 77 65 27 6c 6c   order, so we'll
5ed0: 20 73 74 61 72 74 20 62 79 20 65 78 70 6f 72 74   start by export
5ee0: 69 6e 67 20 66 69 72 73 74 20 74 68 65 20 77 68  ing first the wh
5ef0: 6f 6c 65 20 54 75 73 63 61 6e 79 2e 0d 0a 3c 2f  ole Tuscany...</
5f00: 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72  td><td>..<img sr
5f10: 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67  c="https://www.g
5f20: 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d  aia-gis.it/gaia-
5f30: 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f  sins/topofigs/to
5f40: 70 6f 6c 61 79 65 72 2d 72 65 67 69 6f 6e 2e 70  polayer-region.p
5f50: 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79  ng" alt="topolay
5f60: 65 72 2d 72 65 67 69 6f 6e 22 3e 0d 0a 3c 2f 74  er-region">..</t
5f70: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
5f80: 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 32 3a 20 65  >..<b>step #2: e
5f90: 78 70 6f 72 74 69 6e 67 20 74 68 65 20 50 72 6f  xporting the Pro
5fa0: 76 69 6e 63 65 73 20 54 6f 70 6f 4c 61 79 65 72  vinces TopoLayer
5fb0: 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  </b>..<verbatim>
5fc0: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f  ..SELECT TopoGeo
5fd0: 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72  _ExportTopoLayer
5fe0: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27  ('census2011', '
5ff0: 70 72 6f 76 27 2c 20 27 6f 75 74 5f 70 72 6f 76  prov', 'out_prov
6000: 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76  _2011', 1);..</v
6010: 65 72 62 61 74 69 6d 3e 0d 0a 57 65 27 6c 6c 20  erbatim>..We'll 
6020: 63 6f 6e 74 69 6e 75 65 20 62 79 20 65 78 70 6f  continue by expo
6030: 72 74 69 6e 67 20 61 6c 6c 20 74 68 65 20 54 75  rting all the Tu
6040: 73 63 61 6e 79 20 50 72 6f 76 69 6e 63 65 73 2e  scany Provinces.
6050: 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d  ..</td><td>..<im
6060: 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77  g src="https://w
6070: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67  ww.gaia-gis.it/g
6080: 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67  aia-sins/topofig
6090: 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 70 72 6f 76  s/topolayer-prov
60a0: 69 6e 63 65 73 2e 70 6e 67 22 20 61 6c 74 3d 22  inces.png" alt="
60b0: 74 6f 70 6f 6c 61 79 65 72 2d 70 72 6f 76 69 6e  topolayer-provin
60c0: 63 65 73 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72  ces">..</td></tr
60d0: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e  >..<tr><td>..<b>
60e0: 73 74 65 70 20 23 33 3a 20 65 78 70 6f 72 74 69  step #3: exporti
60f0: 6e 67 20 74 68 65 20 4d 75 6e 69 63 69 70 61 6c  ng the Municipal
6100: 69 74 69 65 73 20 54 6f 70 6f 4c 61 79 65 72 3c  ities TopoLayer<
6110: 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d  /b>..<verbatim>.
6120: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f  .SELECT TopoGeo_
6130: 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28  ExportTopoLayer(
6140: 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 63  'census2011', 'c
6150: 6f 6d 27 2c 20 27 6f 75 74 5f 63 6f 6d 5f 32 30  om', 'out_com_20
6160: 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62  11', 1);..</verb
6170: 61 74 69 6d 3e 0d 0a 54 68 65 6e 20 77 65 27 6c  atim>..Then we'l
6180: 6c 20 65 78 70 6f 72 74 20 61 6c 6c 20 74 68 65  l export all the
6190: 20 54 75 73 63 61 6e 79 20 4d 75 6e 69 63 69 70   Tuscany Municip
61a0: 61 6c 69 74 69 65 73 2e 3c 62 72 3e 0d 0a 46 6f  alities.<br>..Fo
61b0: 72 20 62 65 74 74 65 72 20 63 6c 61 72 69 74 79  r better clarity
61c0: 20 74 68 65 20 66 69 67 75 72 65 20 73 68 6f 77   the figure show
61d0: 73 20 61 20 6d 61 67 6e 69 66 69 65 64 20 64 65  s a magnified de
61e0: 74 61 69 6c 20 63 65 6e 74 65 72 65 64 20 61 72  tail centered ar
61f0: 6f 75 6e 64 20 74 68 65 20 49 73 6c 61 6e 64 20  ound the Island 
6200: 6f 66 20 45 6c 62 61 2e 0d 0a 3c 2f 74 64 3e 3c  of Elba...</td><
6210: 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68  td>..<img src="h
6220: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  ttps://www.gaia-
6230: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73  gis.it/gaia-sins
6240: 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 6c 61  /topofigs/topola
6250: 79 65 72 2d 6d 75 6e 69 63 69 70 61 6c 69 74 69  yer-municipaliti
6260: 65 73 2e 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70  es.png" alt="top
6270: 6f 6c 61 79 65 72 2d 6d 75 6e 69 63 69 70 61 6c  olayer-municipal
6280: 69 74 69 65 73 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f  ities">..</td></
6290: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c  tr>..<tr><td>..<
62a0: 62 3e 73 74 65 70 20 23 34 3a 20 65 78 70 6f 72  b>step #4: expor
62b0: 74 69 6e 67 20 74 68 65 20 50 6f 70 75 6c 61 74  ting the Populat
62c0: 65 64 20 50 6c 61 63 65 73 20 54 6f 70 6f 4c 61  ed Places TopoLa
62d0: 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74  yer</b>..<verbat
62e0: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f  im>..SELECT Topo
62f0: 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61  Geo_ExportTopoLa
6300: 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27  yer('census2011'
6310: 2c 20 27 70 70 6c 27 2c 20 27 6f 75 74 5f 70 70  , 'ppl', 'out_pp
6320: 6c 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f  l_2011', 1);..</
6330: 76 65 72 62 61 74 69 6d 3e 0d 0a 41 6e 64 20 77  verbatim>..And w
6340: 65 27 6c 6c 20 66 69 6e 61 6c 6c 79 20 65 78 70  e'll finally exp
6350: 6f 72 74 20 61 6c 6c 20 50 6f 70 75 6c 61 74 65  ort all Populate
6360: 64 20 50 6c 61 63 65 73 2e 3c 62 72 3e 3c 62 72  d Places.<br><br
6370: 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 75 3e 43 6f  ><br><br>..<u>Co
6380: 6e 63 6c 75 73 69 6f 6e 3c 2f 75 3e 3a 20 77 65  nclusion</u>: we
6390: 20 73 74 61 72 74 65 64 20 74 68 69 73 20 61 64   started this ad
63a0: 76 61 6e 63 65 64 20 74 75 74 6f 72 69 61 6c 20  vanced tutorial 
63b0: 62 79 20 69 6d 70 6f 72 74 69 6e 67 20 69 6e 74  by importing int
63c0: 6f 20 61 20 54 6f 70 6f 6c 6f 67 79 20 6a 75 73  o a Topology jus
63d0: 74 20 61 20 73 69 6e 67 6c 65 20 6c 61 79 65 72  t a single layer
63e0: 20 28 43 65 6e 73 75 73 20 41 72 65 61 73 29 20   (Census Areas) 
63f0: 61 6e 64 20 6e 6f 77 20 77 65 27 76 65 20 66 69  and now we've fi
6400: 6e 69 73 68 65 64 20 62 79 20 70 72 6f 64 75 63  nished by produc
6410: 69 6e 67 20 61 20 63 6f 6d 70 6c 65 74 65 20 73  ing a complete s
6420: 65 74 20 6f 66 20 61 64 6d 69 6e 69 73 74 72 61  et of administra
6430: 74 69 76 65 20 62 6f 75 6e 64 61 72 69 65 73 20  tive boundaries 
6440: 61 74 20 64 69 66 66 65 72 65 6e 74 20 68 69 65  at different hie
6450: 72 61 72 63 68 69 63 61 6c 20 6c 65 76 65 6c 73  rarchical levels
6460: 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 50 6f 70  :..<ul>..<li>Pop
6470: 75 6c 61 74 65 64 20 50 6c 61 63 65 73 3c 2f 6c  ulated Places</l
6480: 69 3e 0d 0a 3c 6c 69 3e 4d 75 6e 69 63 69 70 61  i>..<li>Municipa
6490: 6c 69 74 69 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69  lities</li>..<li
64a0: 3e 50 72 6f 76 69 6e 63 65 73 3c 2f 6c 69 3e 0d  >Provinces</li>.
64b0: 0a 3c 6c 69 3e 52 65 67 69 6f 6e 3c 2f 6c 69 3e  .<li>Region</li>
64c0: 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 3c 74  ..</ul>..</td><t
64d0: 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74  d>..<img src="ht
64e0: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67  tps://www.gaia-g
64f0: 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f  is.it/gaia-sins/
6500: 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 79  topofigs/topolay
6510: 65 72 2d 70 6f 70 75 6c 61 74 65 64 2d 70 6c 61  er-populated-pla
6520: 63 65 73 2e 70 6e 67 22 20 61 6c 74 3d 22 74 6f  ces.png" alt="to
6530: 70 6f 6c 61 79 65 72 2d 70 6f 70 75 6c 61 74 65  polayer-populate
6540: 64 2d 70 6c 61 63 65 73 22 3e 0d 0a 3c 2f 74 64  d-places">..</td
6550: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
6560: 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 3e  <br>..<hr>..<h3>
6570: 52 65 63 65 6e 74 20 63 68 61 6e 67 65 73 3a 20  Recent changes: 
6580: 6f 6c 64 20 4d 75 6e 69 63 69 70 61 6c 69 74 69  old Municipaliti
6590: 65 73 20 6d 65 72 67 69 6e 67 20 69 6e 74 6f 20  es merging into 
65a0: 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74 69  new Municipaliti
65b0: 65 73 3c 2f 68 33 3e 0d 0a 49 66 20 79 6f 75 20  es</h3>..If you 
65c0: 72 65 6d 65 6d 62 65 72 20 74 68 65 20 69 6e 69  remember the ini
65d0: 74 69 61 6c 20 3c 62 3e 74 75 73 63 61 6e 79 2d  tial <b>tuscany-
65e0: 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c 69  census-2011.sqli
65f0: 74 65 3c 2f 62 3e 20 44 42 2d 66 69 6c 65 20 63  te</b> DB-file c
6600: 6f 6e 74 61 69 6e 73 20 61 20 3c 62 3e 63 6f 6d  ontains a <b>com
6610: 5f 32 30 31 34 5f 31 35 3c 2f 62 3e 20 54 61 62  _2014_15</b> Tab
6620: 6c 65 3b 20 64 75 72 69 6e 67 20 79 65 61 72 73  le; during years
6630: 20 32 30 31 34 20 61 6e 64 20 32 30 31 35 20 66   2014 and 2015 f
6640: 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65  ew Municipalitie
6650: 73 20 6d 65 72 67 65 64 20 74 77 6f 20 62 79 20  s merged two by 
6660: 74 77 6f 20 74 68 75 73 20 67 69 76 69 6e 67 20  two thus giving 
6670: 62 69 72 74 68 20 74 6f 20 6e 65 77 20 4d 75 6e  birth to new Mun
6680: 69 63 69 70 61 6c 69 74 69 65 73 2e 20 54 68 69  icipalities. Thi
6690: 73 20 69 73 20 74 68 65 20 66 75 6c 6c 20 6c 69  s is the full li
66a0: 73 74 3a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61  st:<br><br>..<ta
66b0: 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22  ble cellspan="4"
66c0: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22   cellpadding="6"
66d0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66   bgcolor="#f8f8f
66e0: 30 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a  0" border="1">..
66f0: 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d  <tr><td colspan=
6700: 22 33 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65  "3" align="cente
6710: 72 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  r" bgcolor="#f0f
6720: 30 66 38 22 3e 3c 62 3e 4e 65 77 20 4d 75 6e 69  0f8"><b>New Muni
6730: 63 69 70 61 6c 69 74 79 20 28 32 30 31 34 2f 31  cipality (2014/1
6740: 35 29 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 63  5)</b></td><td c
6750: 6f 6c 73 70 61 6e 3d 22 32 22 20 61 6c 69 67 6e  olspan="2" align
6760: 3d 22 63 65 6e 74 65 72 22 20 20 62 67 63 6f 6c  ="center"  bgcol
6770: 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 3c 62 3e  or="#f0f8f8"><b>
6780: 73 75 70 70 72 65 73 73 65 64 20 23 31 3c 2f 62  suppressed #1</b
6790: 3e 3c 2f 74 64 3e 3c 74 64 20 63 6f 6c 73 70 61  ></td><td colspa
67a0: 6e 3d 22 32 22 20 61 6c 69 67 6e 3d 22 63 65 6e  n="2" align="cen
67b0: 74 65 72 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ter" bgcolor="#f
67c0: 38 66 30 66 38 22 3e 3c 62 3e 73 75 70 70 72 65  8f0f8"><b>suppre
67d0: 73 73 65 64 20 23 32 3c 2f 62 3e 3c 2f 74 64 3e  ssed #2</b></td>
67e0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62  </tr>..<tr><td b
67f0: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22  gcolor="#f0f0f8"
6800: 3e 3c 62 3e 63 6f 64 5f 70 72 6f 76 3c 2f 62 3e  ><b>cod_prov</b>
6810: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6820: 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f  ="#f0f0f8"><b>co
6830: 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e 3c 74  d_com</b></td><t
6840: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30  d bgcolor="#f0f0
6850: 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c  f8"><b>name</b><
6860: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
6870: 22 23 66 30 66 38 66 38 22 3e 3c 62 3e 63 6f 64  "#f0f8f8"><b>cod
6880: 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64  _com</b></td><td
6890: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66   bgcolor="#f0f8f
68a0: 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f  8"><b>name</b></
68b0: 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  td><td bgcolor="
68c0: 23 66 38 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f  #f8f0f8"><b>cod_
68d0: 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20  com</b></td><td 
68e0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38  bgcolor="#f8f0f8
68f0: 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74  "><b>name</b></t
6900: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
6910: 3e 41 52 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  >AR</td><td alig
6920: 6e 3d 22 72 69 67 68 74 22 3e 35 31 30 34 30 3c  n="right">51040<
6930: 2f 74 64 3e 3c 74 64 3e 43 61 73 74 65 6c 66 72  /td><td>Castelfr
6940: 61 6e 63 6f 20 50 69 61 6e 64 69 73 63 c3 b2 3c  anco Piandisc..<
6950: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
6960: 22 23 66 30 66 38 66 38 22 20 61 6c 69 67 6e 3d  "#f0f8f8" align=
6970: 22 72 69 67 68 74 22 3e 35 31 30 30 39 3c 2f 74  "right">51009</t
6980: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38  d bgcolor="#f0f8
6990: 66 38 22 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  f8"><td bgcolor=
69a0: 22 23 66 30 66 38 66 38 22 3e 43 61 73 74 65 6c  "#f0f8f8">Castel
69b0: 66 72 61 6e 63 6f 20 64 69 20 53 6f 70 72 61 3c  franco di Sopra<
69c0: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
69d0: 22 23 66 38 66 30 66 38 22 20 61 6c 69 67 6e 3d  "#f8f0f8" align=
69e0: 22 72 69 67 68 74 22 3e 35 31 30 32 39 3c 2f 74  "right">51029</t
69f0: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  d><td bgcolor="#
6a00: 66 38 66 30 66 38 22 3e 50 69 61 6e 20 64 69 20  f8f0f8">Pian di 
6a10: 53 63 6f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  Sco</td></tr>..<
6a20: 74 72 3e 3c 74 64 3e 41 52 3c 2f 74 64 3e 3c 74  tr><td>AR</td><t
6a30: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
6a40: 35 31 30 34 31 3c 2f 74 64 3e 3c 74 64 3e 50 72  51041</td><td>Pr
6a50: 61 74 6f 76 65 63 63 68 69 6f 20 53 74 69 61 3c  atovecchio Stia<
6a60: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
6a70: 22 23 66 30 66 38 66 38 22 20 61 6c 69 67 6e 3d  "#f0f8f8" align=
6a80: 22 72 69 67 68 74 22 3e 35 31 30 33 32 3c 2f 74  "right">51032</t
6a90: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  d><td bgcolor="#
6aa0: 66 30 66 38 66 38 22 3e 50 72 61 74 6f 76 65 63  f0f8f8">Pratovec
6ab0: 63 68 69 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63  chio</td><td bgc
6ac0: 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 20 61  olor="#f8f0f8" a
6ad0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30  lign="right">510
6ae0: 33 36 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  36</td><td bgcol
6af0: 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 53 74 69  or="#f8f0f8">Sti
6b00: 61 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  a</td></tr>..<tr
6b10: 3e 3c 74 64 3e 46 49 3c 2f 74 64 3e 3c 74 64 20  ><td>FI</td><td 
6b20: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 38  align="right">48
6b30: 30 35 32 3c 2f 74 64 3e 3c 74 64 3e 46 69 67 6c  052</td><td>Figl
6b40: 69 6e 65 20 65 20 49 6e 63 69 73 61 20 56 61 6c  ine e Incisa Val
6b50: 64 61 72 6e 6f 3c 2f 74 64 3e 3c 74 64 20 62 67  darno</td><td bg
6b60: 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 20  color="#f0f8f8" 
6b70: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 38  align="right">48
6b80: 30 31 36 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  016</td><td bgco
6b90: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 46 69  lor="#f0f8f8">Fi
6ba0: 67 6c 69 6e 65 20 56 61 6c 64 61 72 6e 6f 3c 2f  gline Valdarno</
6bb0: 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  td><td bgcolor="
6bc0: 23 66 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22  #f8f0f8" align="
6bd0: 72 69 67 68 74 22 3e 34 38 30 32 33 3c 2f 74 64  right">48023</td
6be0: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6bf0: 38 66 30 66 38 22 3e 49 6e 63 69 73 61 20 69 6e  8f0f8">Incisa in
6c00: 20 56 61 6c 20 64 27 41 72 6e 6f 3c 2f 74 64 3e   Val d'Arno</td>
6c10: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 46  </tr>..<tr><td>F
6c20: 49 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  I</td><td align=
6c30: 22 72 69 67 68 74 22 3e 34 38 30 35 33 3c 2f 74  "right">48053</t
6c40: 64 3e 3c 74 64 3e 53 63 61 72 70 65 72 69 61 20  d><td>Scarperia 
6c50: 65 20 53 61 6e 20 50 69 65 72 6f 3c 2f 74 64 3e  e San Piero</td>
6c60: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
6c70: 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67  f8f8" align="rig
6c80: 68 74 22 3e 34 38 30 34 32 3c 2f 74 64 3e 3c 74  ht">48042</td><t
6c90: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38  d bgcolor="#f0f8
6ca0: 66 38 22 3e 53 63 61 72 70 65 72 69 61 3c 2f 74  f8">Scarperia</t
6cb0: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  d><td bgcolor="#
6cc0: 66 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22 72  f8f0f8" align="r
6cd0: 69 67 68 74 22 3e 34 38 30 34 30 3c 2f 74 64 3e  ight">48040</td>
6ce0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  <td bgcolor="#f8
6cf0: 66 30 66 38 22 3e 53 61 6e 20 50 69 65 72 6f 20  f0f8">San Piero 
6d00: 61 20 53 69 65 76 65 3c 2f 74 64 3e 3c 2f 74 72  a Sieve</td></tr
6d10: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 4c 55 3c 2f 74  >..<tr><td>LU</t
6d20: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
6d30: 68 74 22 3e 34 36 30 33 36 3c 2f 74 64 3e 3c 74  ht">46036</td><t
6d40: 64 3e 46 61 62 62 72 69 63 68 65 20 64 69 20 56  d>Fabbriche di V
6d50: 65 72 67 65 6d 6f 6c 69 3c 2f 74 64 3e 3c 74 64  ergemoli</td><td
6d60: 20 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38    bgcolor="#f0f8
6d70: 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  f8" align="right
6d80: 22 3e 34 36 30 31 32 3c 2f 74 64 3e 3c 74 64 20  ">46012</td><td 
6d90: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38  bgcolor="#f0f8f8
6da0: 22 3e 46 61 62 62 72 69 63 68 65 20 64 69 20 56  ">Fabbriche di V
6db0: 61 6c 6c 69 63 6f 3c 2f 74 64 3e 3c 74 64 20 62  allico</td><td b
6dc0: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22  gcolor="#f8f0f8"
6dd0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34   align="right">4
6de0: 36 30 33 32 3c 2f 74 64 3e 3c 74 64 20 62 67 63  6032</td><td bgc
6df0: 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 56  olor="#f8f0f8">V
6e00: 65 72 67 65 6d 6f 6c 69 3c 2f 74 64 3e 3c 2f 74  ergemoli</td></t
6e10: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 4c 55 3c 2f  r>..<tr><td>LU</
6e20: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
6e30: 67 68 74 22 3e 34 36 30 33 37 3c 2f 74 64 3e 3c  ght">46037</td><
6e40: 74 64 3e 53 69 6c 6c 61 6e 6f 20 47 69 75 6e 63  td>Sillano Giunc
6e50: 75 67 6e 61 6e 6f 3c 2f 74 64 3e 3c 74 64 20 62  ugnano</td><td b
6e60: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22  gcolor="#f0f8f8"
6e70: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 36  align="right">46
6e80: 30 32 39 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  029</td><td bgco
6e90: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 53 69  lor="#f0f8f8">Si
6ea0: 6c 6c 61 6e 6f 3c 2f 74 64 3e 3c 74 64 20 62 67  llano</td><td bg
6eb0: 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 20  color="#f8f0f8" 
6ec0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 36  align="right">46
6ed0: 30 31 36 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  016</td><td bgco
6ee0: 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 47 69  lor="#f8f0f8">Gi
6ef0: 75 6e 63 75 67 6e 61 6e 6f 3c 2f 74 64 3e 3c 2f  uncugnano</td></
6f00: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 50 49 3c  tr>..<tr><td>PI<
6f10: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
6f20: 69 67 68 74 22 3e 35 30 30 35 30 3c 2f 74 64 3e  ight">50050</td>
6f30: 3c 74 64 3e 43 61 73 63 69 61 6e 61 20 54 65 72  <td>Casciana Ter
6f40: 6d 65 20 4c 61 72 69 3c 2f 74 64 3e 3c 74 64 20  me Lari</td><td 
6f50: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38  bgcolor="#f0f8f8
6f60: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  " align="right">
6f70: 35 30 30 30 37 3c 2f 74 64 3e 3c 74 64 20 62 67  50007</td><td bg
6f80: 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e  color="#f0f8f8">
6f90: 43 61 73 63 69 61 6e 61 20 54 65 72 6d 65 3c 2f  Casciana Terme</
6fa0: 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  td><td bgcolor="
6fb0: 23 66 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22  #f8f0f8" align="
6fc0: 72 69 67 68 74 22 3e 35 30 30 31 37 3c 2f 74 64  right">50017</td
6fd0: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6fe0: 38 66 30 66 38 22 3e 4c 61 72 69 3c 2f 74 64 3e  8f0f8">Lari</td>
6ff0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 50  </tr>..<tr><td>P
7000: 49 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  I</td><td align=
7010: 22 72 69 67 68 74 22 3e 35 30 30 34 31 3c 2f 74  "right">50041</t
7020: 64 3e 3c 74 64 3e 43 72 65 73 70 69 6e 61 20 4c  d><td>Crespina L
7030: 6f 72 65 6e 7a 61 6e 61 3c 2f 74 64 3e 3c 74 64  orenzana</td><td
7040: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66   bgcolor="#f0f8f
7050: 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  8" align="right"
7060: 3e 35 30 30 31 33 3c 2f 74 64 3e 3c 74 64 20 62  >50013</td><td b
7070: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22  gcolor="#f0f8f8"
7080: 3e 43 72 65 73 70 69 6e 61 3c 2f 74 64 3e 3c 74  >Crespina</td><t
7090: 64 20 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66  d  bgcolor="#f8f
70a0: 30 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68  0f8" align="righ
70b0: 74 22 3e 35 30 30 31 38 3c 2f 74 64 3e 3c 74 64  t">50018</td><td
70c0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66   bgcolor="#f8f0f
70d0: 38 22 3e 4c 6f 72 65 6e 7a 61 6e 61 3c 2f 74 64  8">Lorenzana</td
70e0: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
70f0: 0d 0a 3c 62 72 3e 0d 0a 53 75 63 68 20 63 68 61  ..<br>..Such cha
7100: 6e 67 65 73 20 73 69 6d 70 6c 79 20 61 66 66 65  nges simply affe
7110: 63 74 73 20 4d 75 6e 69 63 69 70 61 6c 69 74 69  cts Municipaliti
7120: 65 73 3b 20 50 72 6f 76 69 6e 63 65 73 20 61 72  es; Provinces ar
7130: 65 20 75 6e 61 66 66 65 63 74 65 64 20 62 79 20  e unaffected by 
7140: 74 68 69 73 20 70 72 6f 63 65 73 73 3b 20 73 6f  this process; so
7150: 20 77 65 20 63 61 6e 20 6e 6f 77 20 64 75 6c 79   we can now duly
7160: 20 67 65 6e 65 72 61 74 65 20 61 20 66 75 72 74   generate a furt
7170: 68 65 72 20 6c 61 79 65 72 20 63 6f 72 72 65 73  her layer corres
7180: 70 6f 6e 64 69 6e 67 20 74 6f 20 32 30 31 35 20  ponding to 2015 
7190: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2c 20  Municipalities, 
71a0: 61 6e 64 20 77 65 20 73 69 6d 70 6c 79 20 68 61  and we simply ha
71b0: 76 65 20 74 6f 20 73 6c 69 67 68 74 6c 79 20 72  ve to slightly r
71c0: 65 61 72 72 61 6e 67 65 20 74 68 65 20 54 6f 70  earrange the Top
71d0: 6f 4c 61 79 65 72 73 2f 54 6f 70 6f 46 65 61 74  oLayers/TopoFeat
71e0: 75 72 65 73 20 64 65 66 69 6e 69 74 69 6f 6e 73  ures definitions
71f0: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 61 63 68   in order to ach
7200: 69 65 76 65 20 74 68 69 73 20 66 75 72 74 68 65  ieve this furthe
7210: 72 20 67 6f 61 6c 2e 0d 0a 3c 76 65 72 62 61 74  r goal...<verbat
7220: 69 6d 3e 0d 0a 41 54 54 41 43 48 20 44 41 54 41  im>..ATTACH DATA
7230: 42 41 53 45 20 22 2e 2f 74 75 73 63 61 6e 79 2d  BASE "./tuscany-
7240: 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c 69  census-2011.sqli
7250: 74 65 22 20 41 53 20 69 73 74 61 74 3b 0d 0a 0d  te" AS istat;...
7260: 0a 43 52 45 41 54 45 20 54 41 42 4c 45 20 63 6f  .CREATE TABLE co
7270: 6d 32 30 31 35 20 41 53 0d 0a 53 45 4c 45 43 54  m2015 AS..SELECT
7280: 20 2a 20 46 52 4f 4d 20 69 73 74 61 74 2e 70 6f   * FROM istat.po
7290: 70 5f 63 6f 6d 5f 32 30 31 31 3b 0d 0a 0d 0a 49  p_com_2011;....I
72a0: 4e 53 45 52 54 20 49 4e 54 4f 20 63 6f 6d 32 30  NSERT INTO com20
72b0: 31 35 0d 0a 53 45 4c 45 43 54 20 61 2e 63 6f 64  15..SELECT a.cod
72c0: 5f 63 6f 6d 2c 20 61 2e 63 6f 64 5f 70 72 6f 76  _com, a.cod_prov
72d0: 2c 20 61 2e 63 6f 64 5f 69 73 74 61 74 2c 20 61  , a.cod_istat, a
72e0: 2e 63 6f 64 5f 63 61 64 61 73 74 72 65 2c 20 61  .cod_cadastre, a
72f0: 2e 6e 61 6d 65 2c 20 61 2e 74 6f 77 6e 68 61 6c  .name, a.townhal
7300: 6c 5f 61 64 64 72 2c 0d 0a 20 20 20 20 53 75 6d  l_addr,..    Sum
7310: 28 62 2e 70 6f 70 5f 32 30 31 31 29 2c 20 53 75  (b.pop_2011), Su
7320: 6d 28 62 2e 6d 5f 32 30 31 31 29 2c 20 53 75 6d  m(b.m_2011), Sum
7330: 28 62 2e 66 5f 32 30 31 31 29 0d 0a 46 52 4f 4d  (b.f_2011)..FROM
7340: 20 69 73 74 61 74 2e 63 6f 6d 5f 32 30 31 34 5f   istat.com_2014_
7350: 31 35 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 69 73  15 AS a..JOIN is
7360: 74 61 74 2e 70 6f 70 5f 63 6f 6d 5f 32 30 31 31  tat.pop_com_2011
7370: 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f   AS b ON (b.cod_
7380: 63 6f 6d 20 49 4e 20 28 61 2e 6f 6c 64 5f 63 6f  com IN (a.old_co
7390: 64 5f 63 6f 6d 5f 31 2c 20 61 2e 6f 6c 64 5f 63  d_com_1, a.old_c
73a0: 6f 64 5f 63 6f 6d 5f 32 29 29 0d 0a 47 52 4f 55  od_com_2))..GROU
73b0: 50 20 42 59 20 61 2e 63 6f 64 5f 63 6f 6d 3b 0d  P BY a.cod_com;.
73c0: 0a 0d 0a 44 45 54 41 43 48 20 44 41 54 41 42 41  ...DETACH DATABA
73d0: 53 45 20 69 73 74 61 74 3b 0d 0a 3c 2f 76 65 72  SE istat;..</ver
73e0: 62 61 74 69 6d 3e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c  batim>..<ol>..<l
73f0: 69 3e 77 65 27 6c 6c 20 3c 69 3e 61 74 74 61 63  i>we'll <i>attac
7400: 68 3c 2f 69 3e 20 79 65 74 20 61 6e 6f 74 68 65  h</i> yet anothe
7410: 72 20 74 69 6d 65 20 74 68 65 20 69 6e 69 74 69  r time the initi
7420: 61 6c 20 3c 62 3e 74 75 73 63 61 6e 79 2d 63 65  al <b>tuscany-ce
7430: 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 74 65  nsus-2011.sqlite
7440: 3c 2f 62 3e 20 44 42 2d 66 69 6c 65 2e 3c 2f 6c  </b> DB-file.</l
7450: 69 3e 0d 0a 3c 6c 69 3e 77 65 27 6c 6c 20 63 72  i>..<li>we'll cr
7460: 65 61 74 65 20 61 20 6e 65 77 20 3c 62 3e 63 6f  eate a new <b>co
7470: 6d 32 30 31 35 3c 2f 62 3e 20 74 61 62 6c 65 20  m2015</b> table 
7480: 62 79 20 6a 75 73 74 20 6a 75 73 74 20 63 6f 70  by just just cop
7490: 79 69 6e 67 20 74 68 65 20 3c 62 3e 69 73 74 61  ying the <b>ista
74a0: 74 2e 70 6f 70 5f 63 6f 6d 5f 32 30 31 31 3c 2f  t.pop_com_2011</
74b0: 62 3e 20 56 69 65 77 2e 3c 2f 6c 69 3e 0d 0a 3c  b> View.</li>..<
74c0: 6c 69 3e 61 6e 64 20 66 69 6e 61 6c 6c 79 20 77  li>and finally w
74d0: 65 27 6c 6c 20 61 70 70 65 6e 64 20 74 6f 20 74  e'll append to t
74e0: 68 65 20 73 61 6d 65 20 74 61 62 6c 65 20 74 68  he same table th
74f0: 65 20 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69  e new Municipali
7500: 74 69 65 73 20 66 72 6f 6d 20 74 68 65 20 3c 62  ties from the <b
7510: 3e 69 73 74 61 74 2e 63 6f 6d 5f 32 30 31 34 5f  >istat.com_2014_
7520: 31 35 3c 2f 62 3e 20 74 61 62 6c 65 3b 20 64 75  15</b> table; du
7530: 72 69 6e 67 20 74 68 69 73 20 73 74 65 70 20 77  ring this step w
7540: 65 27 6c 6c 20 63 6f 6d 70 75 74 65 20 74 68 65  e'll compute the
7550: 20 50 6f 70 75 6c 61 74 69 6f 6e 20 32 30 31 31   Population 2011
7560: 20 63 65 6e 73 75 73 20 76 61 6c 75 65 73 2e 3c   census values.<
7570: 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c 2f 75 3e  br>..<u>Note</u>
7580: 3a 20 61 66 74 65 72 20 63 6f 6d 70 6c 65 74 69  : after completi
7590: 6e 67 20 74 68 65 20 61 62 6f 76 65 20 73 74 65  ng the above ste
75a0: 70 73 20 6e 6f 77 20 74 68 65 20 3c 62 3e 63 6f  ps now the <b>co
75b0: 6d 32 30 31 35 3c 2f 62 3e 20 74 61 62 6c 65 20  m2015</b> table 
75c0: 63 6f 6e 74 61 69 6e 73 20 62 6f 74 68 20 73 75  contains both su
75d0: 70 70 72 65 73 73 65 64 20 61 6e 64 20 6e 65 77  ppressed and new
75e0: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c   Municipalities<
75f0: 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c 76 65  /li>..</ol>..<ve
7600: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
7610: 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f  TopoGeo_InitTopo
7620: 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31  Layer('census201
7630: 31 27 2c 20 4e 55 4c 4c 2c 20 27 63 6f 6d 32 30  1', NULL, 'com20
7640: 31 35 27 2c 20 27 63 6f 6d 32 30 31 35 27 29 3b  15', 'com2015');
7650: 0d 0a 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20  ....INSERT INTO 
7660: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66  census2011_topof
7670: 65 61 74 75 72 65 73 0d 0a 53 45 4c 45 43 54 20  eatures..SELECT 
7680: 4e 55 4c 4c 2c 20 61 2e 6e 6f 64 65 5f 69 64 2c  NULL, a.node_id,
7690: 20 61 2e 65 64 67 65 5f 69 64 2c 20 61 2e 66 61   a.edge_id, a.fa
76a0: 63 65 5f 69 64 2c 20 36 2c 20 61 2e 66 69 64 0d  ce_id, 6, a.fid.
76b0: 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31  .FROM census2011
76c0: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 53  _topofeatures AS
76d0: 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32   a..JOIN census2
76e0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
76f0: 5f 33 20 41 53 20 62 20 4f 4e 20 28 61 2e 74 6f  _3 AS b ON (a.to
7700: 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 33 20 41  polayer_id = 3 A
7710: 4e 44 20 61 2e 66 69 64 20 3d 20 62 2e 66 69 64  ND a.fid = b.fid
7720: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d  );..</verbatim>.
7730: 0a 4e 6f 74 68 69 6e 67 20 72 65 61 6c 6c 79 20  .Nothing really 
7740: 69 6e 74 65 72 65 73 74 69 6e 67 20 69 6e 20 74  interesting in t
7750: 68 69 73 2c 20 62 65 63 61 75 73 65 20 77 65 20  his, because we 
7760: 61 6c 72 65 61 64 79 20 70 65 72 66 6f 72 6d 65  already performe
7770: 64 20 74 68 69 73 20 73 74 65 70 20 64 75 72 69  d this step duri
7780: 6e 67 20 74 68 65 20 70 72 65 76 69 6f 75 73 20  ng the previous 
7790: 65 78 65 72 63 69 73 65 2e 20 57 65 27 76 65 20  exercise. We've 
77a0: 73 69 6d 70 6c 79 20 69 6e 69 74 69 61 6c 69 7a  simply initializ
77b0: 65 64 20 79 65 74 20 61 6e 6f 74 68 65 72 20 54  ed yet another T
77c0: 6f 70 6f 4c 61 79 65 72 73 2c 20 61 6e 64 20 77  opoLayers, and w
77d0: 65 27 76 65 20 63 6f 70 69 65 64 20 69 6e 74 6f  e've copied into
77e0: 20 69 74 20 74 68 65 20 73 61 6d 65 20 54 6f 70   it the same Top
77f0: 6f 46 65 61 74 75 72 65 73 20 64 65 66 69 6e 69  oFeatures defini
7800: 74 69 6f 6e 73 20 61 6c 72 65 61 64 79 20 73 75  tions already su
7810: 70 70 6f 72 74 69 6e 67 20 32 30 31 31 20 4d 75  pporting 2011 Mu
7820: 6e 69 63 69 70 61 6c 69 74 69 65 73 2e 0d 0a 3c  nicipalities...<
7830: 76 65 72 62 61 74 69 6d 3e 0d 0a 55 50 44 41 54  verbatim>..UPDAT
7840: 45 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70  E census2011_top
7850: 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 54 20 66  ofeatures..SET f
7860: 69 64 20 3d 20 28 53 45 4c 45 43 54 20 66 69 64  id = (SELECT fid
7870: 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31   FROM census2011
7880: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 36 20  _topofeatures_6 
7890: 57 48 45 52 45 20 63 6f 64 5f 63 6f 6d 20 3d 20  WHERE cod_com = 
78a0: 35 31 30 34 30 29 0d 0a 57 48 45 52 45 20 74 6f  51040)..WHERE to
78b0: 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 36 20 41  polayer_id = 6 A
78c0: 4e 44 20 66 69 64 20 49 4e 20 28 53 45 4c 45 43  ND fid IN (SELEC
78d0: 54 20 66 69 64 20 46 52 4f 4d 20 63 65 6e 73 75  T fid FROM censu
78e0: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
78f0: 65 73 5f 36 20 57 48 45 52 45 20 63 6f 64 5f 63  es_6 WHERE cod_c
7900: 6f 6d 20 69 6e 20 28 35 31 30 30 39 2c 20 35 31  om in (51009, 51
7910: 30 32 39 29 29 3b 0d 0a 0d 0a 55 50 44 41 54 45  029));....UPDATE
7920: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f   census2011_topo
7930: 66 65 61 74 75 72 65 73 0d 0a 53 45 54 20 66 69  features..SET fi
7940: 64 20 3d 20 28 53 45 4c 45 43 54 20 66 69 64 20  d = (SELECT fid 
7950: 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f  FROM census2011_
7960: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 36 20 57  topofeatures_6 W
7970: 48 45 52 45 20 63 6f 64 5f 63 6f 6d 20 3d 20 35  HERE cod_com = 5
7980: 31 30 34 31 29 0d 0a 57 48 45 52 45 20 74 6f 70  1041)..WHERE top
7990: 6f 6c 61 79 65 72 5f 69 64 20 3d 20 36 20 41 4e  olayer_id = 6 AN
79a0: 44 20 66 69 64 20 49 4e 20 28 53 45 4c 45 43 54  D fid IN (SELECT
79b0: 20 66 69 64 20 46 52 4f 4d 20 63 65 6e 73 75 73   fid FROM census
79c0: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
79d0: 73 5f 36 20 57 48 45 52 45 20 63 6f 64 5f 63 6f  s_6 WHERE cod_co
79e0: 6d 20 69 6e 20 28 35 31 30 33 32 2c 20 35 31 30  m in (51032, 510
79f0: 33 36 29 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69  36));..</verbati
7a00: 6d 3e 0d 0a 4e 6f 77 20 77 65 27 76 65 20 73 69  m>..Now we've si
7a10: 6d 70 6c 79 20 75 70 64 61 74 65 64 20 61 6c 6c  mply updated all
7a20: 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 20 62   relationships b
7a30: 65 74 77 65 65 6e 20 54 6f 70 6f 6c 6f 67 79 20  etween Topology 
7a40: 46 61 63 65 73 20 61 6e 64 20 54 6f 70 6f 46 65  Faces and TopoFe
7a50: 61 74 75 72 65 73 20 62 79 20 74 72 61 6e 73 66  atures by transf
7a60: 65 72 72 69 6e 67 20 74 68 65 6d 20 66 72 6f 6d  erring them from
7a70: 20 3c 62 3e 35 31 30 30 39 20 3c 69 3e 43 61 73   <b>51009 <i>Cas
7a80: 74 65 6c 66 72 61 6e 63 6f 20 64 69 20 53 6f 70  telfranco di Sop
7a90: 72 61 3c 2f 69 3e 3c 2f 62 3e 20 61 6e 64 20 3c  ra</i></b> and <
7aa0: 62 3e 35 31 30 32 39 20 3c 69 3e 50 69 61 6e 20  b>51029 <i>Pian 
7ab0: 64 69 20 53 63 6f 3c 2f 69 3e 3c 2f 62 3e 20 74  di Sco</i></b> t
7ac0: 6f 20 3c 62 3e 35 31 30 34 35 20 3c 69 3e 43 61  o <b>51045 <i>Ca
7ad0: 73 74 65 6c 66 72 61 6e 63 6f 20 50 69 61 6e 64  stelfranco Piand
7ae0: 69 73 63 c3 b2 3c 2f 69 3e 3c 2f 62 3e 2e 20 54  isc..</i></b>. T
7af0: 68 65 6e 20 77 65 27 76 65 20 72 65 70 6c 69 65  hen we've replie
7b00: 64 20 74 68 65 20 73 61 6d 65 20 61 63 74 69 6f  d the same actio
7b10: 6e 2e 66 72 6f 6d 20 3c 62 3e 35 31 30 33 32 20  n.from <b>51032 
7b20: 3c 69 3e 50 72 61 74 6f 76 65 63 63 68 69 6f 3c  <i>Pratovecchio<
7b30: 2f 69 3e 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 35  /i></b> and <b>5
7b40: 31 30 34 31 20 3c 69 3e 53 74 69 61 3c 2f 69 3e  1041 <i>Stia</i>
7b50: 3c 2f 62 3e 20 74 6f 20 3c 62 3e 35 31 30 34 31  </b> to <b>51041
7b60: 20 3c 69 3e 50 72 61 74 6f 76 65 63 63 68 69 6f   <i>Pratovecchio
7b70: 20 53 74 69 61 3c 2f 69 3e 3c 2f 62 3e 20 73 6f   Stia</i></b> so
7b80: 20 74 6f 20 63 6f 72 72 65 63 74 6c 79 20 75 70   to correctly up
7b90: 64 61 74 65 20 61 6c 6c 20 6e 65 77 20 4d 75 6e  date all new Mun
7ba0: 69 63 69 70 61 6c 69 74 69 65 73 20 69 6e 74 65  icipalities inte
7bb0: 72 65 73 74 69 6e 67 20 74 68 65 20 50 72 6f 76  resting the Prov
7bc0: 69 6e 63 65 20 6f 66 20 41 72 65 7a 7a 6f 2e 3c  ince of Arezzo.<
7bd0: 62 72 3e 0d 0a 59 6f 75 20 63 6f 75 6c 64 20 65  br>..You could e
7be0: 76 65 6e 74 75 61 6c 6c 79 20 63 6f 6e 74 69 6e  ventually contin
7bf0: 75 65 20 62 79 20 79 6f 75 72 73 65 6c 66 20 73  ue by yourself s
7c00: 6f 20 74 6f 20 75 70 64 61 74 65 20 61 6c 6c 20  o to update all 
7c10: 50 72 6f 76 69 6e 63 65 73 2e 20 0d 0a 3c 76 65  Provinces. ..<ve
7c20: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
7c30: 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f  TopoGeo_ExportTo
7c40: 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32  poLayer('census2
7c50: 30 31 31 27 2c 20 27 63 6f 6d 32 30 31 35 27 2c  011', 'com2015',
7c60: 20 27 6f 75 74 5f 63 6f 6d 5f 61 72 5f 32 30 31   'out_com_ar_201
7c70: 35 27 2c 20 31 2c 20 31 29 3b 0d 0a 0d 0a 53 45  5', 1, 1);....SE
7c80: 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 73  LECT TopoGeo_Ins
7c90: 65 72 74 46 65 61 74 75 72 65 46 72 6f 6d 54 6f  ertFeatureFromTo
7ca0: 70 6f 4c 61 79 65 72 20 28 27 63 65 6e 73 75 73  poLayer ('census
7cb0: 32 30 31 31 27 2c 20 27 63 6f 6d 32 30 31 35 27  2011', 'com2015'
7cc0: 2c 20 27 6f 75 74 5f 63 6f 6d 5f 61 72 5f 32 30  , 'out_com_ar_20
7cd0: 31 35 27 2c 20 66 69 64 29 0d 0a 46 52 4f 4d 20  15', fid)..FROM 
7ce0: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66  census2011_topof
7cf0: 65 61 74 75 72 65 73 5f 36 0d 0a 57 48 45 52 45  eatures_6..WHERE
7d00: 20 63 6f 64 5f 70 72 6f 76 20 3d 20 35 31 20 41   cod_prov = 51 A
7d10: 4e 44 20 63 6f 64 5f 63 6f 6d 20 4e 4f 54 20 49  ND cod_com NOT I
7d20: 4e 20 28 35 31 30 30 39 2c 20 35 31 30 32 39 2c  N (51009, 51029,
7d30: 20 35 31 30 33 32 2c 20 35 31 30 33 36 29 3b 0d   51032, 51036);.
7d40: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 46 69  .</verbatim>..Fi
7d50: 6e 61 6c 6c 79 20 77 65 27 6c 6c 20 65 78 70 6f  nally we'll expo
7d60: 72 74 20 61 20 6e 65 77 20 6c 61 79 65 72 20 72  rt a new layer r
7d70: 65 70 72 65 73 65 6e 74 69 6e 67 20 74 68 65 20  epresenting the 
7d80: 75 70 64 61 74 65 64 20 32 30 31 35 20 50 72 6f  updated 2015 Pro
7d90: 76 69 6e 63 65 20 6f 66 20 41 72 65 7a 7a 6f 2e  vince of Arezzo.
7da0: 3c 62 72 3e 0d 0a 54 68 69 73 20 74 69 6d 65 20  <br>..This time 
7db0: 77 65 27 6c 6c 20 69 6e 76 6f 6b 65 20 3c 62 3e  we'll invoke <b>
7dc0: 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f  TopoGeo_ExportTo
7dd0: 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 62 79  poLayer()</b> by
7de0: 20 73 70 65 63 69 66 79 69 6e 67 20 74 68 65 20   specifying the 
7df0: 3c 62 3e 3c 69 3e 63 72 65 61 74 65 2d 6f 6e 6c  <b><i>create-onl
7e00: 79 3c 2f 69 3e 3c 2f 62 3e 20 73 70 65 63 69 61  y</i></b> specia
7e10: 6c 20 6f 70 74 69 6f 6e 2c 20 61 6e 64 20 74 68  l option, and th
7e20: 65 6e 20 77 65 27 6c 6c 20 75 73 65 20 74 68 65  en we'll use the
7e30: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 73 65   <b>TopoGeo_Inse
7e40: 72 74 46 65 61 74 75 72 65 46 72 6f 6d 54 6f 70  rtFeatureFromTop
7e50: 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 53 51 4c  oLayer()</b> SQL
7e60: 20 66 75 6e 63 74 69 6f 6e 20 69 6e 20 6f 72 64   function in ord
7e70: 65 72 20 74 6f 20 73 65 6c 65 63 74 69 76 65 6c  er to selectivel
7e80: 79 20 65 78 70 6f 72 74 20 6f 6e 6c 79 20 61 20  y export only a 
7e90: 6c 69 6d 69 74 65 64 20 73 75 62 73 65 74 20 66  limited subset f
7ea0: 72 6f 6d 20 74 68 65 20 6f 76 65 72 61 6c 6c 20  rom the overall 
7eb0: 54 6f 70 6f 46 65 61 74 75 72 65 73 2e 3c 62 72  TopoFeatures.<br
7ec0: 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65 20 63 65  ><br>..<table ce
7ed0: 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70  llspan="4" cellp
7ee0: 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c  adding="6" bgcol
7ef0: 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72  or="#f8f8f0" bor
7f00: 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74  der="1">..<tr><t
7f10: 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74  d>..<img src="ht
7f20: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67  tps://www.gaia-g
7f30: 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f  is.it/gaia-sins/
7f40: 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 2d 61 72  topofigs/topo-ar
7f50: 2d 32 30 31 31 2e 70 6e 67 22 20 61 6c 74 3d 22  -2011.png" alt="
7f60: 74 6f 70 6f 2d 61 72 2d 32 30 31 31 22 3e 0d 0a  topo-ar-2011">..
7f70: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20  </td><td>..<img 
7f80: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77  src="https://www
7f90: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69  .gaia-gis.it/gai
7fa0: 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f  a-sins/topofigs/
7fb0: 74 6f 70 6f 2d 61 72 2d 32 30 31 35 2e 70 6e 67  topo-ar-2015.png
7fc0: 22 20 61 6c 74 3d 22 74 6f 70 6f 2d 61 72 2d 32  " alt="topo-ar-2
7fd0: 30 31 35 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72  015">..</td></tr
7fe0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e  >..<tr><td align
7ff0: 3d 22 63 65 6e 74 65 72 22 3e 4d 75 6e 69 63 69  ="center">Munici
8000: 70 61 6c 69 74 69 65 73 20 69 6e 20 74 68 65 20  palities in the 
8010: 50 72 6f 76 69 6e 63 65 20 6f 66 20 41 72 65 7a  Province of Arez
8020: 7a 6f 3a 20 3c 62 3e 32 30 31 31 3c 2f 62 3e 3c  zo: <b>2011</b><
8030: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63  /td><td align="c
8040: 65 6e 74 65 72 22 3e 4d 75 6e 69 63 69 70 61 6c  enter">Municipal
8050: 69 74 69 65 73 20 69 6e 20 74 68 65 20 50 72 6f  ities in the Pro
8060: 76 69 6e 63 65 20 6f 66 20 41 72 65 7a 7a 6f 3a  vince of Arezzo:
8070: 20 3c 62 3e 32 30 31 35 3c 2f 62 3e 3c 2f 74 64   <b>2015</b></td
8080: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
8090: 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 74 61 62  <br>..<hr>..<tab
80a0: 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 22 3e  le width="100%">
80b0: 3c 74 72 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d  <tr>..<td width=
80c0: 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66  "33%" align="lef
80d0: 74 22 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70  t"><a href="http
80e0: 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73  s://www.gaia-gis
80f0: 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70  .it/fossil/libsp
8100: 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61  atialite/wiki?na
8110: 6d 65 3d 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64  me=topo-intermed
8120: 69 61 74 65 22 3e 70 72 65 76 69 6f 75 73 20 70  iate">previous p
8130: 61 67 65 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74  age</a></td>..<t
8140: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22  d align="center"
8150: 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a  ><a href="https:
8160: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
8170: 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74  t/fossil/libspat
8180: 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65  ialite/wiki?name
8190: 3d 6d 69 73 63 2d 64 6f 63 73 22 3e 62 61 63 6b  =misc-docs">back
81a0: 20 74 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f 74   to index</a></t
81b0: 64 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33  d>..<td width="3
81c0: 33 25 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  3%" align="right
81d0: 22 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f  "></td>..</tr></
81e0: 74 61 62 6c 65 3e 0a 5a 20 34 36 39 39 66 33 62  table>.Z 4699f3b
81f0: 65 31 35 39 35 30 39 32 37 36 63 37 31 66 64 38  e159509276c71fd8
8200: 38 31 34 61 33 62 65 37 63 0a                    814a3be7c.