Hex Artifact Content
Not logged in

Artifact 89bee219680b21ac64f6942c1a379f982ed0a23e:

Wiki page [topo-advanced] by sandro 2017-07-08 10:49:23.
0000: 44 20 32 30 31 37 2d 30 37 2d 30 38 54 31 30 3a  D 2017-07-08T10:
0010: 34 39 3a 32 33 2e 31 38 31 0a 4c 20 74 6f 70 6f  49:23.181.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 32 36 36 36  -advanced.P 2666
0030: 32 63 34 32 63 34 39 39 32 38 37 31 66 62 38 66  2c42c4992871fb8f
0040: 39 61 38 31 62 36 34 66 32 30 39 39 63 61 65 32  9a81b64f2099cae2
0050: 63 34 35 39 0a 55 20 73 61 6e 64 72 6f 0a 57 20  c459.U sandro.W 
0060: 33 33 34 33 32 0a 3c 74 61 62 6c 65 20 63 65 6c  33432.<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 49  lite/wiki?name=I
0220: 53 4f 2b 54 6f 70 6f 6c 6f 67 79 22 3e 62 61 63  SO+Topology">bac
0230: 6b 20 74 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f  k to index</a></
0240: 74 64 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22  td>..<td width="
0250: 33 33 25 22 20 61 6c 69 67 6e 3d 22 72 69 67 68  33%" align="righ
0260: 74 22 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c  t"></td>..</tr><
0270: 2f 74 61 62 6c 65 3e 0d 0a 3c 64 69 76 20 77 69  /table>..<div wi
0280: 64 74 68 3d 39 30 25 3e 0d 0a 3c 68 33 3e 54 6f  dth=90%>..<h3>To
0290: 70 6f 4c 61 79 65 72 73 20 61 6e 64 20 54 6f 70  poLayers and Top
02a0: 6f 46 65 61 74 75 72 65 73 3c 2f 68 33 3e 0d 0a  oFeatures</h3>..
02b0: 49 6e 20 74 68 65 20 70 72 65 76 69 6f 75 73 20  In the previous 
02c0: 74 75 74 6f 72 69 61 6c 20 77 65 27 76 65 20 65  tutorial we've e
02d0: 78 61 6d 69 6e 65 64 20 61 20 66 69 72 73 74 20  xamined a first 
02e0: 63 6f 75 70 6c 65 20 6f 66 20 53 51 4c 20 66 75  couple of SQL fu
02f0: 6e 63 74 69 6f 6e 73 20 69 6e 74 65 6e 64 65 64  nctions intended
0300: 20 74 6f 20 65 78 70 6f 72 74 20 61 20 47 65 6f   to export a Geo
0310: 54 61 62 6c 65 20 6f 75 74 20 66 72 6f 6d 20 61  Table out from a
0320: 6e 20 65 78 69 73 74 69 6e 67 20 54 6f 70 6f 6c  n existing Topol
0330: 6f 67 79 3a 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f  ogy: <b>TopoGeo_
0340: 54 6f 47 65 6f 54 61 62 6c 65 28 29 3c 2f 62 3e  ToGeoTable()</b>
0350: 20 61 6e 64 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f   and <b>TopoGeo_
0360: 54 6f 47 65 6f 54 61 62 6c 65 47 65 6e 65 72 61  ToGeoTableGenera
0370: 6c 69 7a 65 28 29 3c 2f 62 3e 2e 3c 62 72 3e 0d  lize()</b>.<br>.
0380: 0a 53 70 61 74 69 61 4c 69 74 65 20 73 75 70 70  .SpatiaLite supp
0390: 6f 72 74 73 20 61 20 6d 6f 72 65 20 73 6f 70 68  orts a more soph
03a0: 69 73 74 69 63 61 74 65 64 20 28 61 6e 64 20 63  isticated (and c
03b0: 6f 6d 70 6c 65 78 29 20 61 70 70 72 6f 61 63 68  omplex) approach
03c0: 20 62 61 73 65 64 20 6f 6e 20 3c 62 3e 54 6f 70   based on <b>Top
03d0: 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 61 6e 64 20  oLayers</b> and 
03e0: 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 3c  <b>TopoFeatures<
03f0: 2f 62 3e 20 73 70 65 63 69 66 69 63 61 6c 6c 79  /b> specifically
0400: 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 73 75 70   intended to sup
0410: 70 6f 72 74 20 61 20 76 65 72 79 20 66 6c 65 78  port a very flex
0420: 69 62 6c 65 20 6d 65 63 68 61 6e 69 73 6d 20 66  ible mechanism f
0430: 6f 72 20 65 78 70 6f 72 74 69 6e 67 20 61 20 66  or exporting a f
0440: 75 6c 6c 20 73 65 74 20 6f 66 20 47 65 6f 54 61  ull set of GeoTa
0450: 62 6c 65 28 73 29 20 64 69 72 65 63 74 6c 79 20  ble(s) directly 
0460: 64 65 72 69 76 69 6e 67 20 66 72 6f 6d 20 61 20  deriving from a 
0470: 54 6f 70 6f 6c 6f 67 79 2e 0d 0a 3c 68 34 3e 61  Topology...<h4>a
0480: 20 63 6f 6e 63 65 70 74 75 61 6c 20 72 65 66 65   conceptual refe
0490: 72 65 6e 63 65 20 66 72 61 6d 65 77 6f 72 6b 3c  rence framework<
04a0: 2f 68 34 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e  /h4>..<ul>..<li>
04b0: 61 6e 20 49 53 4f 20 54 6f 70 6f 6c 6f 67 79 20  an ISO Topology 
04c0: 69 73 20 6a 75 73 74 20 69 6e 74 65 6e 64 65 64  is just intended
04d0: 20 74 6f 20 73 75 70 70 6f 72 74 20 61 20 63 6f   to support a co
04e0: 6e 73 69 73 74 65 6e 74 20 73 65 74 20 6f 66 20  nsistent set of 
04f0: 3c 62 3e 4e 6f 64 65 73 3c 2f 62 3e 2c 20 3c 62  <b>Nodes</b>, <b
0500: 3e 45 64 67 65 73 3c 2f 62 3e 20 61 6e 64 20 3c  >Edges</b> and <
0510: 62 3e 46 61 63 65 73 3c 2f 62 3e 20 70 72 69 6d  b>Faces</b> prim
0520: 69 74 69 76 65 73 20 66 75 6c 6c 79 20 63 6f 76  itives fully cov
0530: 65 72 69 6e 67 20 74 68 65 20 70 6c 61 6e 65 2e  ering the plane.
0540: 0d 0a 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69  ..Topology primi
0550: 74 69 76 65 73 20 63 6f 72 72 65 73 70 6f 6e 64  tives correspond
0560: 20 74 6f 20 70 75 72 65 20 67 65 6f 6d 65 74 72   to pure geometr
0570: 69 65 73 2c 20 61 6e 64 20 63 61 6e 20 3c 62 3e  ies, and can <b>
0580: 6e 65 76 65 72 3c 2f 62 3e 20 62 65 20 64 69 72  never</b> be dir
0590: 65 63 74 6c 79 20 61 73 73 6f 63 69 61 74 65 64  ectly associated
05a0: 20 74 6f 20 61 20 63 6f 72 72 65 73 70 6f 6e 64   to a correspond
05b0: 69 6e 67 20 73 65 74 20 6f 66 20 69 6e 66 6f 72  ing set of infor
05c0: 6d 61 74 69 6f 6e 61 6c 20 61 74 74 72 69 62 75  mational attribu
05d0: 74 65 73 2e 0d 0a 42 6f 74 68 20 4e 6f 64 65 20  tes...Both Node 
05e0: 61 6e 64 20 45 64 67 65 20 70 72 69 6d 69 74 69  and Edge primiti
05f0: 76 65 73 20 64 69 72 65 63 74 6c 79 20 63 6f 72  ves directly cor
0600: 72 65 73 70 6f 6e 64 20 74 6f 20 61 20 3c 75 3e  respond to a <u>
0610: 3c 69 3e 72 65 61 6c 20 67 65 6f 6d 65 74 72 79  <i>real geometry
0620: 3c 2f 69 3e 3c 2f 75 3e 2c 20 62 75 74 20 46 61  </i></u>, but Fa
0630: 63 65 20 70 72 69 6d 69 74 69 76 65 73 20 73 69  ce primitives si
0640: 6d 70 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 20  mply correspond 
0650: 74 6f 20 61 20 3c 75 3e 3c 69 3e 76 69 72 74 75  to a <u><i>virtu
0660: 61 6c 20 67 65 6f 6d 65 74 72 79 3c 2f 69 3e 3c  al geometry</i><
0670: 2f 75 3e 20 74 68 75 73 20 6e 65 63 65 73 73 61  /u> thus necessa
0680: 72 69 6c 79 20 72 65 71 75 69 72 69 6e 67 20 74  rily requiring t
0690: 6f 20 62 65 20 64 79 6e 61 6d 69 63 61 6c 6c 79  o be dynamically
06a0: 20 72 65 63 6f 6e 73 74 72 75 63 74 65 64 20 65   reconstructed e
06b0: 76 65 72 79 20 74 69 6d 65 20 74 68 61 74 20 74  very time that t
06c0: 68 65 79 20 61 72 65 20 72 65 66 65 72 65 6e 63  hey are referenc
06d0: 65 64 20 28 61 6e 64 20 74 68 69 73 20 63 6f 75  ed (and this cou
06e0: 6c 64 20 65 61 73 69 6c 79 20 62 65 63 6f 6d 65  ld easily become
06f0: 20 61 20 72 65 61 6c 20 62 6f 74 74 6c 65 6e 65   a real bottlene
0700: 63 6b 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 41  ck).</li>..<li>A
0710: 20 47 65 6f 54 61 62 6c 65 20 28 61 6c 69 61 73   GeoTable (alias
0720: 20 3c 75 3e 3c 69 3e 6c 61 79 65 72 3c 2f 69 3e   <u><i>layer</i>
0730: 3c 2f 75 3e 2c 20 74 6f 20 75 73 65 20 74 68 65  </u>, to use the
0740: 20 63 6f 6d 6d 6f 6e 20 47 49 53 20 74 65 72 6d   common GIS term
0750: 69 6e 6f 6c 6f 67 79 29 20 6f 6e 20 74 68 65 20  inology) on the 
0760: 6f 74 68 65 72 20 68 61 6e 64 2c 20 69 73 20 61  other hand, is a
0770: 6c 77 61 79 73 20 62 61 73 65 64 20 6f 6e 20 6d  lways based on m
0780: 61 6e 79 20 64 69 73 74 69 6e 63 74 20 66 65 61  any distinct fea
0790: 74 75 72 65 73 2c 20 61 6e 64 20 66 6f 72 20 65  tures, and for e
07a0: 61 63 68 20 66 65 61 74 75 72 65 20 61 20 47 65  ach feature a Ge
07b0: 6f 6d 65 74 72 79 20 3c 62 3e 77 69 74 68 3c 2f  ometry <b>with</
07c0: 62 3e 20 61 73 73 6f 63 69 61 74 65 64 20 73 65  b> associated se
07d0: 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  t of information
07e0: 20 61 74 74 72 69 62 75 74 65 73 2e 3c 2f 6c 69   attributes.</li
07f0: 3e 0d 0a 3c 6c 69 3e 74 68 65 72 65 20 69 73 20  >..<li>there is 
0800: 61 20 66 75 72 74 68 65 72 20 64 69 66 66 65 72  a further differ
0810: 65 6e 63 65 20 74 6f 20 62 65 20 74 61 6b 65 6e  ence to be taken
0820: 20 69 6e 74 6f 20 61 63 63 6f 75 6e 74 3a 20 54   into account: T
0830: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76  opology primitiv
0840: 65 73 20 6e 65 63 65 73 73 61 72 69 6c 79 20 61  es necessarily a
0850: 72 65 20 65 6c 65 6d 65 6e 74 61 72 79 2e 20 46  re elementary. F
0860: 65 61 74 75 72 65 20 47 65 6f 6d 65 74 72 69 65  eature Geometrie
0870: 73 20 63 61 6e 20 75 73 75 61 6c 6c 79 20 72 65  s can usually re
0880: 70 72 65 73 65 6e 74 20 73 6f 6d 65 20 63 6f 6d  present some com
0890: 70 6c 65 78 20 74 79 70 65 3a 20 4d 55 4c 54 49  plex type: MULTI
08a0: 50 4f 49 4e 54 2c 20 4d 55 4c 54 49 4c 49 4e 45  POINT, MULTILINE
08b0: 53 54 52 49 4e 47 2c 20 4d 55 4c 54 49 50 4f 4c  STRING, MULTIPOL
08c0: 59 47 4f 4e 20 61 6e 64 20 70 6f 73 73 69 62 6c  YGON and possibl
08d0: 79 20 61 20 47 45 4f 4d 45 54 52 59 43 4f 4c 4c  y a GEOMETRYCOLL
08e0: 45 43 54 49 4f 4e 2e 20 53 6f 20 69 74 20 69 73  ECTION. So it is
08f0: 20 70 6f 73 73 69 62 6c 65 20 74 68 61 74 20 61   possible that a
0900: 20 46 65 61 74 75 72 65 20 47 65 6f 6d 65 74 72   Feature Geometr
0910: 79 20 64 6f 65 73 20 6e 6f 74 20 6e 65 63 65 73  y does not neces
0920: 73 61 72 69 6c 79 20 63 6f 72 72 65 73 70 6f 6e  sarily correspon
0930: 64 73 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 54  ds to a single T
0940: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76  opology primitiv
0950: 65 20 3b 20 61 20 46 65 61 74 75 72 65 20 47 65  e ; a Feature Ge
0960: 6f 6d 65 74 72 79 20 63 6f 75 6c 64 20 65 61 73  ometry could eas
0970: 69 6c 79 20 62 65 20 64 65 72 69 76 65 64 20 66  ily be derived f
0980: 72 6f 6d 20 74 68 65 20 63 6f 6c 6c 65 63 74 69  rom the collecti
0990: 6f 6e 20 6f 66 20 6d 61 6e 79 20 64 69 66 66 65  on of many diffe
09a0: 72 65 6e 74 20 54 6f 70 6f 6c 6f 67 79 20 70 72  rent Topology pr
09b0: 69 6d 69 74 69 76 65 73 2e 3c 2f 6c 69 3e 20 0d  imitives.</li> .
09c0: 0a 3c 6c 69 3e 74 68 61 74 27 73 20 6e 6f 74 20  .<li>that's not 
09d0: 61 6c 6c 3a 20 6d 61 6e 79 20 64 69 66 66 65 72  all: many differ
09e0: 65 6e 74 20 47 65 6f 54 61 62 6c 65 73 20 63 6f  ent GeoTables co
09f0: 75 6c 64 20 65 76 65 6e 74 75 61 6c 6c 79 20 62  uld eventually b
0a00: 65 20 64 65 72 69 76 65 64 20 66 72 6f 6d 20 61  e derived from a
0a10: 20 73 69 6e 67 6c 65 20 54 6f 70 6f 6c 6f 67 79   single Topology
0a20: 3b 20 61 6e 64 20 74 68 65 20 73 61 6d 65 20 54  ; and the same T
0a30: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76  opology primitiv
0a40: 65 20 63 6f 75 6c 64 20 70 6c 61 79 20 61 20 20  e could play a  
0a50: 3c 62 3e 63 6f 6d 70 6c 65 74 65 6c 79 20 64 69  <b>completely di
0a60: 66 66 65 72 65 6e 74 3c 2f 62 3e 20 72 6f 6c 65  fferent</b> role
0a70: 20 69 6e 20 65 61 63 68 20 47 65 6f 54 61 62 6c   in each GeoTabl
0a80: 65 2e 3c 62 72 3e 0d 0a 41 20 73 69 6d 70 6c 65  e.<br>..A simple
0a90: 20 73 61 6d 70 6c 65 3a 20 69 6d 61 67 69 6e 65   sample: imagine
0aa0: 20 61 20 54 6f 70 6f 6c 6f 67 79 20 63 6f 72 72   a Topology corr
0ab0: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 6f 6d  esponding to som
0ac0: 65 20 6c 61 6e 64 20 72 65 67 69 73 74 72 79 20  e land registry 
0ad0: 6d 61 70 20 77 68 65 72 65 20 6d 61 6e 79 20 70  map where many p
0ae0: 6f 74 65 6e 74 69 61 6c 20 6c 61 79 65 72 73 20  otential layers 
0af0: 73 75 63 68 20 61 73 3a 20 62 75 69 6c 64 69 6e  such as: buildin
0b00: 67 73 2c 20 61 67 72 69 63 75 6c 74 75 72 61 6c  gs, agricultural
0b10: 20 6c 61 6e 64 2c 20 70 6f 70 75 6c 61 74 65 64   land, populated
0b20: 20 70 6c 61 63 65 73 2c 20 61 64 6d 69 6e 69 73   places, adminis
0b30: 74 72 61 74 69 76 65 20 62 6f 75 6e 64 61 72 69  trative boundari
0b40: 65 73 2c 20 72 6f 61 64 73 2c 20 70 6f 6e 64 73  es, roads, ponds
0b50: 2c 20 72 69 76 65 72 73 2c 20 66 65 6e 63 65 73  , rivers, fences
0b60: 20 77 69 6c 6c 20 65 78 69 73 74 2e 3c 62 72 3e   will exist.<br>
0b70: 0d 0a 49 6e 20 73 75 63 68 20 61 20 63 6f 6e 74  ..In such a cont
0b80: 65 78 74 20 61 20 66 65 6e 63 65 20 63 6f 75 6c  ext a fence coul
0b90: 64 20 65 61 73 69 6c 79 20 63 6f 72 72 65 73 70  d easily corresp
0ba0: 6f 6e 64 20 74 6f 20 61 20 46 65 61 74 75 72 65  ond to a Feature
0bb0: 20 77 69 74 68 69 6e 20 74 68 65 20 22 3c 69 3e   within the "<i>
0bc0: 3c 62 3e 66 65 6e 63 65 73 3c 2f 62 3e 3c 2f 69  <b>fences</b></i
0bd0: 3e 22 20 6c 61 79 65 72 2c 20 63 6f 75 6c 64 2c  >" layer, could,
0be0: 20 3c 62 3e 6e 6f 74 20 6f 6e 6c 79 2c 20 73 65   <b>not only, se
0bf0: 70 61 72 61 74 65 3c 2f 62 3e 20 74 77 6f 20 61  parate</b> two a
0c00: 64 6a 61 63 65 6e 74 20 61 67 72 69 63 75 6c 74  djacent agricult
0c10: 75 72 61 6c 20 61 72 65 61 73 2c 20 3c 62 3e 62  ural areas, <b>b
0c20: 75 74 20 61 6c 73 6f 3c 2f 62 3e 2c 20 62 65 20  ut also</b>, be 
0c30: 70 61 72 74 20 6f 66 20 73 6f 6d 65 20 61 64 6d  part of some adm
0c40: 69 6e 69 73 74 72 61 74 69 76 65 20 62 6f 75 6e  inistrative boun
0c50: 64 61 72 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  dary.</li>..<li>
0c60: 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62  <b>TopoLayers</b
0c70: 3e 20 61 6e 64 20 3c 62 3e 54 6f 70 6f 46 65 61  > and <b>TopoFea
0c80: 74 75 72 65 73 3c 2f 62 3e 20 72 65 70 72 65 73  tures</b> repres
0c90: 65 6e 74 20 61 20 63 6f 6d 70 6c 65 78 20 61 6e  ent a complex an
0ca0: 64 20 66 6c 65 78 69 62 6c 65 20 73 74 72 75 63  d flexible struc
0cb0: 74 75 72 65 20 69 6e 74 65 6e 64 65 64 20 74 6f  ture intended to
0cc0: 20 65 73 74 61 62 6c 69 73 68 20 61 20 70 65 72   establish a per
0cd0: 6d 61 6e 65 6e 74 20 72 65 6c 61 74 69 6f 6e 73  manent relations
0ce0: 68 69 70 20 62 65 74 77 65 65 6e 20 54 6f 70 6f  hip between Topo
0cf0: 6c 6f 67 79 20 20 50 72 69 6d 69 74 69 76 65 73  logy  Primitives
0d00: 20 61 6e 64 20 47 65 6f 54 61 62 6c 65 20 46 65   and GeoTable Fe
0d10: 61 74 75 72 65 73 2e 0d 0a 3c 75 6c 3e 0d 0a 3c  atures...<ul>..<
0d20: 6c 69 3e 65 61 63 68 20 3c 62 3e 54 6f 70 6f 4c  li>each <b>TopoL
0d30: 61 79 65 72 3c 2f 62 3e 20 69 73 20 75 6e 69 71  ayer</b> is uniq
0d40: 75 65 6c 79 20 69 64 65 6e 74 69 66 69 65 64 20  uely identified 
0d50: 62 79 20 69 74 73 20 3c 62 3e 6e 61 6d 65 3c 2f  by its <b>name</
0d60: 62 3e 20 61 6e 64 20 64 69 72 65 63 74 6c 79 20  b> and directly 
0d70: 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61  corresponds to a
0d80: 20 73 69 6e 67 6c 65 20 47 65 6f 54 61 62 6c 65   single GeoTable
0d90: 20 74 6f 20 62 65 20 65 78 70 6f 72 74 65 64 20   to be exported 
0da0: 66 72 6f 6d 20 74 68 65 20 54 6f 70 6f 6c 6f 67  from the Topolog
0db0: 79 3c 62 72 3e 0d 0a 41 6e 20 61 72 62 69 74 72  y<br>..An arbitr
0dc0: 61 72 79 20 6e 75 6d 62 65 72 20 6f 66 20 54 6f  ary number of To
0dd0: 70 6f 4c 61 79 65 72 73 20 63 61 6e 20 62 65 20  poLayers can be 
0de0: 63 72 65 61 74 65 64 20 6f 6e 20 74 68 65 20 73  created on the s
0df0: 61 6d 65 20 54 6f 70 6f 6c 6f 67 79 2c 20 61 6e  ame Topology, an
0e00: 64 20 65 61 63 68 20 6f 6e 65 20 6f 66 20 74 68  d each one of th
0e10: 65 6d 20 77 69 6c 6c 20 61 63 74 20 61 73 20 61  em will act as a
0e20: 20 73 65 70 61 72 61 74 65 20 63 6f 6e 74 61 69   separate contai
0e30: 6e 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 65  ner.</li>..<li>e
0e40: 61 63 68 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75  ach <b>TopoFeatu
0e50: 72 65 3c 2f 62 3e 20 69 73 20 75 6e 69 71 75 65  re</b> is unique
0e60: 6c 79 20 69 64 65 6e 74 69 66 69 65 64 20 62 79  ly identified by
0e70: 20 69 74 73 20 3c 62 3e 66 69 64 3c 2f 62 3e 20   its <b>fid</b> 
0e80: 28 3c 69 3e 66 65 61 74 75 72 65 2d 69 64 3c 2f  (<i>feature-id</
0e90: 69 3e 29 20 61 6e 64 20 63 6f 72 72 65 73 70 6f  i>) and correspo
0ea0: 6e 64 73 20 74 6f 20 61 20 73 69 6e 67 6c 65 20  nds to a single 
0eb0: 46 65 61 74 75 72 65 20 63 6f 6e 74 61 69 6e 69  Feature containi
0ec0: 6e 67 20 61 6e 20 69 6e 64 69 76 69 64 75 61 6c  ng an individual
0ed0: 20 73 65 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74   set of informat
0ee0: 69 6f 6e 61 6c 20 61 74 74 72 69 62 75 74 65 73  ional attributes
0ef0: 2e 3c 62 72 3e 0d 0a 54 68 65 20 47 65 6f 6d 65  .<br>..The Geome
0f00: 74 72 79 20 66 6f 72 20 65 61 63 68 20 54 6f 70  try for each Top
0f10: 6f 46 65 61 74 75 72 65 20 69 73 20 61 6c 77 61  oFeature is alwa
0f20: 79 73 20 69 6e 64 69 72 65 63 74 6c 79 20 64 65  ys indirectly de
0f30: 66 69 6e 65 64 20 62 79 20 73 70 65 63 69 66 79  fined by specify
0f40: 69 6e 67 20 61 20 6c 69 73 74 20 6f 66 20 54 6f  ing a list of To
0f50: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
0f60: 73 20 69 6e 64 69 76 69 64 75 61 6c 6c 79 20 72  s individually r
0f70: 65 66 65 72 65 6e 63 65 64 20 62 79 20 74 68 65  eferenced by the
0f80: 69 72 20 49 44 73 2e 3c 62 72 3e 0d 0a 53 75 63  ir IDs.<br>..Suc
0f90: 68 20 61 20 67 65 6f 6d 65 74 72 79 20 69 73 20  h a geometry is 
0fa0: 63 6f 6e 73 69 64 65 72 65 64 20 74 6f 20 62 65  considered to be
0fb0: 20 3c 62 3e 3c 69 3e 76 69 72 74 75 61 6c 3c 2f   <b><i>virtual</
0fc0: 69 3e 3c 2f 62 3e 2c 20 6d 65 61 6e 69 6e 67 20  i></b>, meaning 
0fd0: 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20  that it will be 
0fe0: 63 72 65 61 74 65 64 20 74 68 72 6f 75 67 68 20  created through 
0ff0: 74 68 65 20 3c 62 3e 63 6f 6c 6c 65 63 74 69 6f  the <b>collectio
1000: 6e 2f 61 67 67 72 65 67 61 74 69 6f 6e 3c 2f 62  n/aggregation</b
1010: 3e 20 6f 66 20 61 6c 6c 20 72 65 66 65 72 65 6e  > of all referen
1020: 63 65 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69  ced Topology pri
1030: 6d 69 74 69 76 65 73 2c 20 77 68 65 6e 20 65 78  mitives, when ex
1040: 70 6f 72 74 65 64 20 74 6f 20 74 68 65 20 64 65  ported to the de
1050: 73 74 69 6e 61 74 69 6f 6e 20 47 65 6f 54 61 62  stination GeoTab
1060: 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c  le.</li>..</ul><
1070: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 54 68 65 20 54 6f  /li>..<li>The To
1080: 70 6f 4c 61 79 65 72 73 20 2f 20 54 6f 70 6f 46  poLayers / TopoF
1090: 65 61 74 75 72 65 73 20 73 74 72 75 63 74 75 72  eatures structur
10a0: 65 20 69 73 20 70 72 61 63 74 69 63 61 6c 6c 79  e is practically
10b0: 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 61 73 20   implemented as 
10c0: 61 20 73 65 74 20 6f 66 20 73 65 76 65 72 61 6c  a set of several
10d0: 20 63 6c 6f 73 65 6c 79 20 72 65 6c 61 74 65 64   closely related
10e0: 20 44 42 2d 74 61 62 6c 65 73 20 20 28 74 68 65   DB-tables  (the
10f0: 20 72 65 73 70 65 63 74 69 76 65 20 6c 61 79 6f   respective layo
1100: 75 74 73 20 6f 66 20 77 68 69 63 68 20 77 65 27  uts of which we'
1110: 6c 6c 20 65 78 61 6d 69 6e 65 20 6c 61 74 65 72  ll examine later
1120: 20 69 6e 20 66 75 6c 6c 20 64 65 74 61 69 6c 29   in full detail)
1130: 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e  :..<ul>..<li><b>
1140: 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c  <<i>topo-prefix<
1150: 2f 69 3e 3e 5f 74 6f 70 6f 6c 61 79 65 72 73 3c  /i>>_topolayers<
1160: 2f 62 3e 3a 20 74 68 69 73 20 66 69 72 73 74 20  /b>: this first 
1170: 74 61 62 6c 65 20 73 69 6d 70 6c 79 20 69 73 20  table simply is 
1180: 61 20 63 61 74 61 6c 6f 67 20 6f 66 20 61 6c 6c  a catalog of all
1190: 20 54 6f 70 6f 4c 61 79 65 72 73 20 73 75 70 70   TopoLayers supp
11a0: 6f 72 74 69 6e 67 20 74 68 65 20 73 61 6d 65 20  orting the same 
11b0: 54 6f 70 6f 6c 6f 67 79 2e 3c 62 72 3e 0d 0a 45  Topology.<br>..E
11c0: 61 63 68 20 54 6f 70 6f 4c 61 79 65 72 20 69 73  ach TopoLayer is
11d0: 20 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 69   identified by i
11e0: 74 73 20 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 20 61  ts <b>name</b> a
11f0: 6e 64 20 62 79 20 69 74 73 20 3c 62 3e 49 44 3c  nd by its <b>ID<
1200: 2f 62 3e 3b 20 62 6f 74 68 20 6f 66 20 77 68 69  /b>; both of whi
1210: 63 68 20 6d 75 73 74 20 62 65 20 3c 69 3e 3c 75  ch must be <i><u
1220: 3e 75 6e 69 71 75 65 3c 2f 75 3e 3c 2f 69 3e 2e  >unique</u></i>.
1230: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c 3c  </li>..<li><b><<
1240: 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69  i>topo-prefix</i
1250: 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 3c  >>_topofeatures<
1260: 2f 62 3e 3a 20 74 68 69 73 20 73 65 63 6f 6e 64  /b>: this second
1270: 20 74 61 62 6c 65 20 69 73 20 69 6e 74 65 6e 64   table is intend
1280: 65 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74 6c  ed to permanentl
1290: 79 20 73 74 6f 72 65 20 61 6c 6c 20 63 72 6f 73  y store all cros
12a0: 73 2d 72 65 66 65 72 65 6e 63 65 73 20 65 78 69  s-references exi
12b0: 73 74 69 6e 67 20 62 65 74 77 65 65 6e 20 54 6f  sting between To
12c0: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
12d0: 73 20 61 6e 64 20 54 6f 70 6f 46 65 61 74 75 72  s and TopoFeatur
12e0: 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62  es.</li>..<li><b
12f0: 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78  ><<i>topo-prefix
1300: 3c 2f 69 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72  </i>>_topofeatur
1310: 65 73 5f 3c 3c 69 3e 74 6f 70 6f 6c 61 79 65 72  es_<<i>topolayer
1320: 2d 69 64 3c 2f 69 3e 3e 3c 2f 62 3e 3a 20 66 6f  -id</i>></b>: fo
1330: 72 20 65 61 63 68 20 73 69 6e 67 6c 65 20 54 6f  r each single To
1340: 70 6f 4c 61 79 65 72 20 61 20 73 65 70 61 72 61  poLayer a separa
1350: 74 65 20 74 61 62 6c 65 20 69 73 20 72 65 71 75  te table is requ
1360: 69 72 65 64 2e 20 54 68 65 20 61 63 74 75 61 6c  ired. The actual
1370: 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 20 69 73   relationship is
1380: 20 65 73 74 61 62 6c 69 73 68 65 64 20 76 69 61   established via
1390: 20 74 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 79 65   the <b>TopoLaye
13a0: 72 2d 49 44 3c 2f 62 3e 20 73 75 66 66 69 78 2e  r-ID</b> suffix.
13b0: 3c 62 72 3e 0d 0a 41 6c 6c 20 74 68 65 73 65 20  <br>..All these 
13c0: 74 61 62 6c 65 73 20 61 72 65 20 69 6e 74 65 6e  tables are inten
13d0: 64 65 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74  ded to permanent
13e0: 6c 79 20 73 74 6f 72 65 20 74 68 65 20 69 6e 66  ly store the inf
13f0: 6f 72 6d 61 74 69 6f 6e 61 6c 20 61 74 74 72 69  ormational attri
1400: 62 75 74 65 73 20 66 6f 72 20 65 61 63 68 20 54  butes for each T
1410: 6f 70 6f 46 65 61 74 75 72 65 20 6f 6e 20 74 68  opoFeature on th
1420: 65 20 73 61 6d 65 20 54 6f 70 6f 4c 61 79 65 72  e same TopoLayer
1430: 2e 0d 0a 44 69 66 66 65 72 65 6e 74 20 54 6f 70  ...Different Top
1440: 6f 4c 61 79 65 72 73 20 77 69 6c 6c 20 6f 62 76  oLayers will obv
1450: 69 6f 75 73 6c 79 20 73 75 70 70 6f 72 74 20 61  iously support a
1460: 20 64 69 66 66 65 72 65 6e 74 20 73 65 74 20 6f   different set o
1470: 66 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 61 6c 20  f informational 
1480: 61 74 74 72 69 62 75 74 65 73 20 74 68 75 73 20  attributes thus 
1490: 72 65 71 75 69 72 69 6e 67 20 61 6e 20 69 6e 64  requiring an ind
14a0: 69 76 69 64 75 61 6c 20 74 61 62 6c 65 20 6c 61  ividual table la
14b0: 79 6f 75 74 2e 3c 62 72 3e 0d 0a 41 20 3c 62 3e  yout.<br>..A <b>
14c0: 50 72 69 6d 61 72 79 20 4b 65 79 3c 2f 62 3e 20  Primary Key</b> 
14d0: 6f 66 20 74 68 65 20 3c 62 3e 49 4e 54 45 47 45  of the <b>INTEGE
14e0: 52 3c 2f 62 3e 20 74 79 70 65 20 6e 61 6d 65 64  R</b> type named
14f0: 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 69 73 20 61   <b>fid</b> is a
1500: 6c 77 61 79 73 20 65 78 70 65 63 74 65 64 20 74  lways expected t
1510: 6f 20 64 65 63 6c 61 72 65 64 20 61 6e 64 20 69  o declared and i
1520: 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 62 65  s intended to be
1530: 20 61 6e 20 75 6e 69 71 75 65 20 69 64 65 6e 74   an unique ident
1540: 69 66 69 65 72 20 66 6f 72 20 65 61 63 68 20 54  ifier for each T
1550: 6f 70 6f 46 65 61 74 75 72 65 2e 3c 2f 6c 69 3e  opoFeature.</li>
1560: 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c  ..</ul></li>..<l
1570: 69 3e 53 65 76 65 72 61 6c 20 53 51 4c 20 66 75  i>Several SQL fu
1580: 6e 63 74 69 6f 6e 73 20 61 72 65 20 73 70 65 63  nctions are spec
1590: 69 66 69 63 61 6c 6c 79 20 69 6e 74 65 6e 64 65  ifically intende
15a0: 64 20 74 6f 20 73 75 70 70 6f 72 74 20 70 72 6f  d to support pro
15b0: 63 65 73 73 69 6e 67 20 6f 70 65 72 61 74 69 6f  cessing operatio
15c0: 6e 73 20 62 61 73 65 64 20 6f 6e 20 54 6f 70 6f  ns based on Topo
15d0: 4c 61 79 65 72 73 20 61 6e 64 20 54 6f 70 6f 46  Layers and TopoF
15e0: 65 61 74 75 72 65 73 3b 20 20 77 65 27 6c 6c 20  eatures;  we'll 
15f0: 65 78 61 6d 69 6e 65 20 74 68 65 6d 20 6c 61 74  examine them lat
1600: 65 72 20 69 6e 20 66 75 6c 6c 20 64 65 74 61 69  er in full detai
1610: 6c 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62  l.</li>..</ul><b
1620: 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 61  r><br>..<hr>..<a
1630: 20 6e 61 6d 65 3d 22 65 78 65 72 63 69 73 65 22   name="exercise"
1640: 3e 0d 0a 3c 68 32 3e 61 20 71 75 69 63 6b 2c 20  >..<h2>a quick, 
1650: 70 72 61 63 74 69 63 61 6c 20 65 78 65 72 63 69  practical exerci
1660: 73 65 3c 2f 68 32 3e 3c 2f 61 3e 0d 0a 52 65 71  se</h2></a>..Req
1670: 75 69 72 65 6d 65 6e 74 73 3a 0d 0a 3c 6f 6c 3e  uirements:..<ol>
1680: 0d 0a 3c 6c 69 3e 64 6f 77 6e 6c 6f 61 64 20 74  ..<li>download t
1690: 68 65 20 73 61 6d 70 6c 65 20 44 42 2d 66 69 6c  he sample DB-fil
16a0: 65 20 66 72 6f 6d 20 3c 61 20 68 72 65 66 3d 22  e from <a href="
16b0: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61  https://www.gaia
16c0: 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e  -gis.it/gaia-sin
16d0: 73 2f 74 6f 70 6f 73 61 6d 70 6c 65 73 2f 74 75  s/toposamples/tu
16e0: 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31  scany-census-201
16f0: 31 2e 37 7a 22 3e 68 65 72 65 3c 2f 61 3e 3c 62  1.7z">here</a><b
1700: 72 3e 0d 0a 49 74 20 63 6f 6e 74 61 69 6e 73 20  r>..It contains 
1710: 43 65 6e 73 75 73 20 64 61 74 61 20 28 32 30 31  Census data (201
1720: 31 29 20 6b 69 6e 64 6c 79 20 72 65 6c 65 61 73  1) kindly releas
1730: 65 64 20 62 79 20 49 53 54 41 54 20 75 6e 64 65  ed by ISTAT unde
1740: 72 20 3c 62 3e 43 43 2d 42 59 3c 2f 62 3e 20 6c  r <b>CC-BY</b> l
1750: 69 63 65 6e 73 65 20 74 65 72 6d 73 2e 3c 62 72  icense terms.<br
1760: 3e 0d 0a 54 68 65 20 6f 72 69 67 69 6e 61 6c 20  >..The original 
1770: 64 61 74 61 73 65 74 73 20 68 61 76 65 20 62 65  datasets have be
1780: 65 6e 20 73 6c 69 67 68 74 6c 79 20 72 65 61 72  en slightly rear
1790: 72 61 6e 67 65 64 20 69 6e 20 61 20 6d 6f 72 65  ranged in a more
17a0: 20 63 6f 6e 76 65 6e 69 65 6e 74 20 66 6f 72 6d   convenient form
17b0: 2e 0d 0a 41 6c 6c 20 67 65 6f 6d 65 74 72 69 65  ...All geometrie
17c0: 73 20 61 72 65 20 69 6e 20 74 68 65 20 3c 62 3e  s are in the <b>
17d0: 53 52 49 44 20 33 32 36 33 32 3c 2f 62 3e 20 28  SRID 32632</b> (
17e0: 3c 69 3e 57 47 53 20 38 34 20 2f 20 55 54 4d 20  <i>WGS 84 / UTM 
17f0: 7a 6f 6e 65 20 33 32 4e 3c 2f 69 3e 29 3a 0d 0a  zone 32N</i>):..
1800: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 65 6e  <ul>..<li><b>cen
1810: 73 75 73 5f 32 30 31 31 3c 2f 62 3e 3a 20 61 6c  sus_2011</b>: al
1820: 6c 20 43 65 6e 73 75 73 20 41 72 65 61 73 20 28  l Census Areas (
1830: 32 30 31 31 29 20 63 6f 76 65 72 69 6e 67 20 54  2011) covering T
1840: 75 73 63 61 6e 79 2e 3c 62 72 3e 0d 0a 3c 75 3e  uscany.<br>..<u>
1850: 4e 6f 74 65 3a 3c 2f 75 3e 20 73 65 76 65 72 61  Note:</u> severa
1860: 6c 20 43 65 6e 73 75 73 20 41 72 65 61 73 20 61  l Census Areas a
1870: 72 65 20 63 6f 6d 70 6c 65 74 65 6c 79 20 75 6e  re completely un
1880: 69 6e 68 61 62 69 74 65 64 20 28 6c 61 6b 65 73  inhabited (lakes
1890: 2c 20 6d 61 72 73 68 6c 61 6e 64 73 2c 20 68 69  , marshlands, hi
18a0: 67 68 20 6d 6f 75 6e 74 61 69 6e 73 20 61 6e 64  gh mountains and
18b0: 20 61 6c 69 6b 65 29 2e 3c 2f 6c 69 3e 0d 0a 3c   alike).</li>..<
18c0: 6c 69 3e 3c 62 3e 70 70 6c 5f 32 30 31 31 3c 2f  li><b>ppl_2011</
18d0: 62 3e 3a 20 50 6f 70 75 6c 61 74 65 64 20 50 6c  b>: Populated Pl
18e0: 61 63 65 73 20 28 64 65 66 69 6e 65 64 20 61 73  aces (defined as
18f0: 20 61 6e 20 61 67 67 72 65 67 61 74 69 6f 6e 20   an aggregation 
1900: 6f 66 20 43 65 6e 73 75 73 20 41 72 65 61 73 29  of Census Areas)
1910: 2e 3c 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c 2f  .<br>..<u>Note</
1920: 75 3e 3a 20 6e 6f 74 20 61 6c 6c 20 43 65 6e 73  u>: not all Cens
1930: 75 73 20 41 72 65 61 73 20 62 65 6c 6f 6e 67 20  us Areas belong 
1940: 74 6f 20 61 20 50 6f 70 75 6c 61 74 65 64 20 50  to a Populated P
1950: 6c 61 63 65 3a 20 74 68 65 72 65 20 61 72 65 20  lace: there are 
1960: 6d 61 6e 79 20 73 65 6c 66 2d 73 74 61 6e 64 69  many self-standi
1970: 6e 67 20 64 69 73 70 65 72 73 65 64 20 72 75 72  ng dispersed rur
1980: 61 6c 20 61 72 65 61 73 2e 3c 2f 6c 69 3e 0d 0a  al areas.</li>..
1990: 3c 6c 69 3e 3c 62 3e 63 6f 6d 5f 32 30 31 31 3c  <li><b>com_2011<
19a0: 2f 62 3e 3a 20 54 75 73 63 61 6e 79 20 4d 75 6e  /b>: Tuscany Mun
19b0: 69 63 69 70 61 6c 69 74 69 65 73 20 2f 20 4c 6f  icipalities / Lo
19c0: 63 61 6c 20 43 6f 75 6e 63 69 6c 73 20 32 30 31  cal Councils 201
19d0: 31 20 28 64 65 66 69 6e 65 64 20 61 73 20 61 6e  1 (defined as an
19e0: 20 61 67 67 72 65 67 61 74 69 6f 6e 73 20 6f 66   aggregations of
19f0: 20 43 65 6e 73 75 73 20 41 72 65 61 73 29 2e 3c   Census Areas).<
1a00: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 6f 6d  /li>..<li><b>com
1a10: 5f 32 30 31 34 5f 31 35 3c 2f 62 3e 3a 20 66 65  _2014_15</b>: fe
1a20: 77 20 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69  w new Municipali
1a30: 74 69 65 73 20 63 72 65 61 74 65 64 20 64 75 72  ties created dur
1a40: 69 6e 67 20 74 68 65 20 79 65 61 72 73 20 32 30  ing the years 20
1a50: 31 34 2f 31 35 2c 20 74 68 72 6f 75 67 68 20 74  14/15, through t
1a60: 68 65 20 6d 65 72 67 69 6e 67 20 6f 66 20 70 72  he merging of pr
1a70: 65 2d 65 78 69 73 74 69 6e 67 20 73 6d 61 6c 6c  e-existing small
1a80: 65 72 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65  er Municipalitie
1a90: 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e  s.</li>..<li><b>
1aa0: 70 72 6f 76 5f 32 30 31 31 3c 2f 62 3e 3a 20 54  prov_2011</b>: T
1ab0: 75 73 63 61 6e 79 20 50 72 6f 76 69 6e 63 65 73  uscany Provinces
1ac0: 20 2f 20 43 6f 75 6e 74 69 65 73 20 28 64 65 66   / Counties (def
1ad0: 69 6e 65 64 20 61 73 20 61 6e 20 61 67 67 72 65  ined as an aggre
1ae0: 67 61 74 69 6f 6e 20 6f 66 20 4d 75 6e 69 63 69  gation of Munici
1af0: 70 61 6c 69 74 69 65 73 29 2e 3c 2f 6c 69 3e 0d  palities).</li>.
1b00: 0a 3c 6c 69 3e 3c 62 3e 72 65 67 5f 32 30 31 31  .<li><b>reg_2011
1b10: 3c 2f 62 3e 3a 20 54 75 73 63 61 6e 79 20 52 65  </b>: Tuscany Re
1b20: 67 69 6f 6e 20 28 64 65 66 69 6e 65 64 20 61 73  gion (defined as
1b30: 20 61 6e 20 61 67 67 72 65 67 61 74 69 6f 6e 20   an aggregation 
1b40: 6f 66 20 50 72 6f 76 69 6e 63 65 73 29 2e 3c 2f  of Provinces).</
1b50: 6c 69 3e 0d 0a 3c 6c 69 3e 6f 6e 6c 79 20 74 68  li>..<li>only th
1b60: 65 20 74 61 62 6c 65 20 3c 62 3e 63 65 6e 73 75  e table <b>censu
1b70: 73 5f 32 30 31 31 3c 2f 62 3e 20 68 61 73 20 67  s_2011</b> has g
1b80: 65 6f 6d 65 74 72 69 65 73 3b 20 6f 74 68 65 72  eometries; other
1b90: 20 61 64 6d 69 6e 69 73 74 72 61 74 69 6f 6e 20   administration 
1ba0: 6c 65 76 65 6c 73 20 61 72 65 20 64 65 66 69 6e  levels are defin
1bb0: 65 64 20 62 79 20 72 65 6c 61 74 69 6f 6e 20 63  ed by relation c
1bc0: 6f 64 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  odes.</li>..<li>
1bd0: 3c 75 3e 41 74 74 65 6e 74 69 6f 6e 3c 2f 75 3e  <u>Attention</u>
1be0: 3a 20 64 75 72 69 6e 67 20 74 68 69 73 20 73 61  : during this sa
1bf0: 6d 70 6c 65 20 28 61 73 20 69 6e 20 6f 74 68 65  mple (as in othe
1c00: 72 73 29 2c 20 77 65 20 77 69 6c 6c 20 3c 62 3e  rs), we will <b>
1c10: 6e 65 76 65 72 3c 2f 62 3e 20 64 69 72 65 63 74  never</b> direct
1c20: 6c 79 20 6f 70 65 6e 20 74 68 69 73 20 64 61 74  ly open this dat
1c30: 61 62 61 73 65 2c 20 62 75 74 20 6f 6e 6c 79 20  abase, but only 
1c40: 61 74 74 61 63 68 20 69 74 20 74 6f 20 74 68 65  attach it to the
1c50: 20 64 61 74 61 62 61 73 65 20 77 65 20 61 72 65   database we are
1c60: 20 63 72 65 61 74 69 6e 67 2e 3c 2f 6c 69 3e 0d   creating.</li>.
1c70: 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  .</ul></li>..<li
1c80: 3e 75 6e 63 6f 6d 70 72 65 73 73 20 74 68 65 20  >uncompress the 
1c90: 64 6f 77 6e 6c 6f 61 64 65 64 20 64 62 2d 66 69  downloaded db-fi
1ca0: 6c 65 20 28 3c 62 3e 3c 69 3e 74 75 73 63 61 6e  le (<b><i>tuscan
1cb0: 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71  y-census-2011.sq
1cc0: 6c 69 74 65 3c 2f 69 3e 3c 2f 62 3e 29 2e 3c 2f  lite</i></b>).</
1cd0: 6c 69 3e 0d 0a 3c 6c 69 3e 6e 6f 77 20 73 74 61  li>..<li>now sta
1ce0: 72 74 20 61 20 53 70 61 74 69 61 4c 69 74 65 20  rt a SpatiaLite 
1cf0: 73 65 73 73 69 6f 6e 20 75 73 69 6e 67 20 79 6f  session using yo
1d00: 75 72 20 70 72 65 66 65 72 72 65 64 20 53 70 61  ur preferred Spa
1d10: 74 69 61 4c 69 74 65 20 66 72 6f 6e 74 20 65 6e  tiaLite front en
1d20: 64 20 74 6f 6f 6c 3a 0d 0a 3c 75 6c 3e 0d 0a 3c  d tool:..<ul>..<
1d30: 6c 69 3e 43 6f 6e 6e 65 63 74 20 74 6f 20 61 20  li>Connect to a 
1d40: 6e 65 77 20 28 65 6d 70 74 79 29 20 44 42 2d 66  new (empty) DB-f
1d50: 69 6c 65 20 6e 61 6d 65 64 20 3c 62 3e 3c 69 3e  ile named <b><i>
1d60: 74 75 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32  tuscany-census-2
1d70: 30 31 31 2e 73 71 6c 69 74 65 3c 2f 69 3e 3c 2f  011.sqlite</i></
1d80: 62 3e 2c 20 74 6f 20 77 68 69 63 68 20 3c 62 3e  b>, to which <b>
1d90: 74 75 73 63 61 6e 79 2d 74 6f 70 6f 2d 32 30 31  tuscany-topo-201
1da0: 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 20 77 69 6c  1.sqlite</b> wil
1db0: 6c 20 62 65 20 61 74 74 61 63 68 65 64 20 74 6f  l be attached to
1dc0: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c  .</li>..</ul></l
1dd0: 69 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c 76 65 72 62  i>..</ol>..<verb
1de0: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 43 72  atim>..SELECT Cr
1df0: 65 61 74 65 54 6f 70 6f 6c 6f 67 79 28 27 63 65  eateTopology('ce
1e00: 6e 73 75 73 32 30 31 31 27 2c 20 33 32 36 33 32  nsus2011', 32632
1e10: 2c 20 30 2c 20 30 29 3b 0d 0a 31 0d 0a 0d 0a 41  , 0, 0);..1....A
1e20: 54 54 41 43 48 20 44 41 54 41 42 41 53 45 20 22  TTACH DATABASE "
1e30: 2e 2f 74 75 73 63 61 6e 79 2d 63 65 6e 73 75 73  ./tuscany-census
1e40: 2d 32 30 31 31 2e 73 71 6c 69 74 65 22 20 41 53  -2011.sqlite" AS
1e50: 20 69 73 74 61 74 3b 0d 0a 0d 0a 53 45 4c 45 43   istat;....SELEC
1e60: 54 20 54 6f 70 6f 47 65 6f 5f 46 72 6f 6d 47 65  T TopoGeo_FromGe
1e70: 6f 54 61 62 6c 65 28 27 63 65 6e 73 75 73 32 30  oTable('census20
1e80: 31 31 27 2c 20 27 69 73 74 61 74 27 2c 20 27 63  11', 'istat', 'c
1e90: 65 6e 73 75 73 5f 32 30 31 31 27 2c 20 4e 55 4c  ensus_2011', NUL
1ea0: 4c 2c 20 30 2c 20 35 31 32 2c 20 2d 31 29 3b 0d  L, 0, 512, -1);.
1eb0: 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 53 54 5f  .1....SELECT ST_
1ec0: 56 61 6c 69 64 61 74 65 54 6f 70 6f 47 65 6f 28  ValidateTopoGeo(
1ed0: 27 63 65 6e 73 75 73 32 30 31 31 27 29 3b 0d 0a  'census2011');..
1ee0: 4e 55 4c 4c 0d 0a 0d 0a 53 45 4c 45 43 54 20 2a  NULL....SELECT *
1ef0: 20 46 52 4f 4d 20 54 45 4d 50 2e 63 65 6e 73 75   FROM TEMP.censu
1f00: 73 32 30 31 31 5f 76 61 6c 69 64 61 74 65 5f 74  s2011_validate_t
1f10: 6f 70 6f 67 65 6f 3b 0d 0a 0d 0a 53 45 4c 45 43  opogeo;....SELEC
1f20: 54 20 54 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65  T TopoGeo_Create
1f30: 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75  TopoLayer('censu
1f40: 73 32 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c  s2011', 'istat',
1f50: 20 27 63 65 6e 73 75 73 5f 32 30 31 31 27 2c 20   'census_2011', 
1f60: 4e 55 4c 4c 2c 20 27 63 65 6e 73 75 73 5f 61 72  NULL, 'census_ar
1f70: 65 61 73 27 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c  eas');..1....SEL
1f80: 45 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74  ECT TopoGeo_Init
1f90: 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75  TopoLayer('censu
1fa0: 73 32 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c  s2011', 'istat',
1fb0: 20 27 70 6f 70 5f 70 70 6c 5f 32 30 31 31 27 2c   'pop_ppl_2011',
1fc0: 20 27 70 70 6c 27 29 3b 0d 0a 31 0d 0a 0d 0a 53   'ppl');..1....S
1fd0: 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e  ELECT TopoGeo_In
1fe0: 69 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e  itTopoLayer('cen
1ff0: 73 75 73 32 30 31 31 27 2c 20 27 69 73 74 61 74  sus2011', 'istat
2000: 27 2c 20 27 70 6f 70 5f 63 6f 6d 5f 32 30 31 31  ', 'pop_com_2011
2010: 27 2c 20 27 63 6f 6d 27 29 3b 0d 0a 31 0d 0a 0d  ', 'com');..1...
2020: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f  .SELECT TopoGeo_
2030: 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 27 63  InitTopoLayer('c
2040: 65 6e 73 75 73 32 30 31 31 27 2c 20 27 69 73 74  ensus2011', 'ist
2050: 61 74 27 2c 20 27 70 6f 70 5f 70 72 6f 76 5f 32  at', 'pop_prov_2
2060: 30 31 31 27 2c 20 27 70 72 6f 76 27 29 3b 0d 0a  011', 'prov');..
2070: 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f  1....SELECT Topo
2080: 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65  Geo_InitTopoLaye
2090: 72 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20  r('census2011', 
20a0: 27 69 73 74 61 74 27 2c 20 27 70 6f 70 5f 72 65  'istat', 'pop_re
20b0: 67 5f 32 30 31 31 27 2c 20 27 72 65 67 27 29 3b  g_2011', 'reg');
20c0: 0d 0a 31 0d 0a 0d 0a 44 45 54 41 43 48 20 44 41  ..1....DETACH DA
20d0: 54 41 42 41 53 45 20 69 73 74 61 74 3b 0d 0a 3c  TABASE istat;..<
20e0: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65 27 6c  /verbatim>..We'l
20f0: 6c 20 73 74 61 72 74 20 74 68 69 73 20 70 72 61  l start this pra
2100: 63 74 69 63 61 6c 20 74 75 74 6f 72 69 61 6c 20  ctical tutorial 
2110: 62 79 20 64 75 6c 79 20 72 65 70 6c 69 63 61 74  by duly replicat
2120: 69 6e 67 20 74 68 65 20 73 61 6d 65 20 73 74 65  ing the same ste
2130: 70 73 20 77 65 27 76 65 20 61 6c 72 65 61 64 79  ps we've already
2140: 20 65 78 61 6d 69 6e 65 64 20 69 6e 20 74 68 65   examined in the
2150: 20 70 72 65 76 69 6f 75 73 20 74 75 74 6f 72 69   previous tutori
2160: 61 6c 20 69 6e 20 3c 62 3e 74 6f 70 6f 2d 69 6e  al in <b>topo-in
2170: 74 65 72 6d 65 64 69 61 74 65 3c 2f 62 3e 3a 0d  termediate</b>:.
2180: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 77 65 27 6c 6c  .<ul>..<li>we'll
2190: 20 63 72 65 61 74 65 20 61 20 6e 65 77 20 32 44   create a new 2D
21a0: 20 54 6f 70 6f 6c 6f 67 79 20 6e 61 6d 65 64 20   Topology named 
21b0: 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 3c 2f 62  <b>census2011</b
21c0: 3e 20 61 6e 64 20 6c 6f 63 61 74 65 64 20 69 6e  > and located in
21d0: 74 6f 20 3c 62 3e 53 52 49 44 20 33 32 36 33 32  to <b>SRID 32632
21e0: 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  </b>.</li>..<li>
21f0: 74 68 65 6e 20 77 65 27 6c 6c 20 3c 69 3e 61 74  then we'll <i>at
2200: 74 61 63 68 3c 2f 69 3e 20 74 68 65 20 3c 62 3e  tach</i> the <b>
2210: 74 75 73 63 61 6e 79 2d 74 6f 70 6f 2d 32 30 31  tuscany-topo-201
2220: 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 20 65 78 74  1.sqlite</b> ext
2230: 65 72 6e 61 6c 20 44 42 2d 66 69 6c 65 2e 3c 2f  ernal DB-file.</
2240: 6c 69 3e 0d 0a 3c 6c 69 3e 61 66 74 65 72 2d 77  li>..<li>after-w
2250: 68 69 63 68 20 77 65 27 6c 6c 20 70 6f 70 75 6c  hich we'll popul
2260: 61 74 65 20 74 68 65 20 3c 62 3e 63 65 6e 73 75  ate the <b>censu
2270: 73 32 30 31 31 3c 2f 62 3e 20 54 6f 70 6f 6c 6f  s2011</b> Topolo
2280: 67 79 20 62 79 20 69 6d 70 6f 72 74 69 6e 67 20  gy by importing 
2290: 74 68 65 20 3c 62 3e 69 73 74 61 74 2e 63 65 6e  the <b>istat.cen
22a0: 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20 47 65 6f  sus_2011</b> Geo
22b0: 54 61 62 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  Table.</li>..<li
22c0: 3e 41 73 20 66 69 6e 61 6c 20 74 61 73 6b 20 77  >As final task w
22d0: 65 27 6c 6c 20 63 68 65 63 6b 20 69 66 20 74 68  e'll check if th
22e0: 69 73 20 54 6f 70 6f 6c 6f 67 79 20 69 73 20 66  is Topology is f
22f0: 75 6c 6c 79 20 76 61 6c 69 64 2e 3c 2f 6c 69 3e  ully valid.</li>
2300: 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 41 66 74  ..</ul><br>..Aft
2310: 65 72 20 74 68 65 73 65 20 70 72 65 70 61 72 61  er these prepara
2320: 74 69 6f 6e 73 20 68 61 76 65 20 62 65 65 6e 20  tions have been 
2330: 63 6f 6d 70 6c 65 74 65 64 2c 20 77 65 20 61 72  completed, we ar
2340: 65 20 72 65 61 64 79 20 74 6f 20 73 74 61 72 74  e ready to start
2350: 20 64 65 66 69 6e 69 6e 67 20 61 6c 6c 20 3c 62   defining all <b
2360: 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e 20  >TopoLayers</b> 
2370: 62 61 73 65 64 20 6f 6e 20 74 68 65 20 3c 62 3e  based on the <b>
2380: 63 65 6e 73 75 73 32 30 31 31 3c 2f 62 3e 20 54  census2011</b> T
2390: 6f 70 6f 6c 6f 67 79 3b 20 65 61 63 68 20 73 69  opology; each si
23a0: 6e 67 6c 65 20 54 6f 70 6f 4c 61 79 65 72 20 77  ngle TopoLayer w
23b0: 69 6c 6c 20 70 72 65 63 69 73 65 6c 79 20 72 65  ill precisely re
23c0: 70 72 65 73 65 6e 74 20 73 6f 6d 65 20 61 64 6d  present some adm
23d0: 69 6e 69 73 74 72 61 74 69 76 65 20 6c 65 76 65  inistrative leve
23e0: 6c 2c 20 61 6e 64 20 61 6c 6c 20 54 6f 70 6f 4c  l, and all TopoL
23f0: 61 79 65 72 73 20 61 6c 74 6f 67 65 74 68 65 72  ayers altogether
2400: 20 77 69 6c 6c 20 63 6f 6d 70 6c 65 74 65 6c 79   will completely
2410: 20 72 65 70 72 65 73 65 6e 74 20 74 68 65 20 77   represent the w
2420: 68 6f 6c 65 20 54 75 73 63 61 6e 20 61 64 6d 69  hole Tuscan admi
2430: 6e 69 73 74 72 61 74 69 76 65 20 68 69 65 72 61  nistrative hiera
2440: 72 63 68 79 2e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69  rchy...<ol>..<li
2450: 3e 46 69 72 73 74 20 69 6e 76 6f 6b 65 20 3c 62  >First invoke <b
2460: 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54  >TopoGeo_CreateT
2470: 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 69  opoLayer()</b> i
2480: 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f 6d 70 6c  n order to compl
2490: 65 74 65 6c 79 20 64 65 66 69 6e 65 20 61 20 66  etely define a f
24a0: 69 72 73 74 20 54 6f 70 6f 4c 61 79 65 72 20 72  irst TopoLayer r
24b0: 65 70 72 65 73 65 6e 74 69 6e 67 20 3c 62 3e 43  epresenting <b>C
24c0: 65 6e 73 75 73 20 41 72 65 61 73 3c 2f 62 3e 2e  ensus Areas</b>.
24d0: 3c 62 72 3e 0d 0a 3c 75 3e 52 65 63 61 6c 6c 3c  <br>..<u>Recall<
24e0: 2f 75 3e 3a 20 74 68 65 20 3c 62 3e 69 73 74 61  /u>: the <b>ista
24f0: 74 2e 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62  t.census_2011</b
2500: 3e 20 69 73 20 61 6e 20 65 78 69 73 74 69 6e 67  > is an existing
2510: 20 27 3c 62 3e 47 65 6f 54 61 62 6c 65 3c 2f 62   '<b>GeoTable</b
2520: 3e 27 2c 20 62 65 69 6e 67 20 75 73 65 64 20 61  >', being used a
2530: 73 20 6f 75 72 20 69 6e 69 74 69 61 6c 20 64 61  s our initial da
2540: 74 61 73 65 74 2c 20 73 69 6e 63 65 20 69 74 20  taset, since it 
2550: 61 6c 72 65 61 64 79 20 63 6f 6e 74 61 69 6e 73  already contains
2560: 20 62 6f 74 68 20 74 68 65 20 69 6e 66 6f 72 6d   both the inform
2570: 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73  ation attributes
2580: 20 61 6e 64 20 67 65 6f 6d 65 74 72 69 65 73 20   and geometries 
2590: 6e 65 65 64 65 64 2c 20 66 6f 72 20 77 68 69 63  needed, for whic
25a0: 68 20 3c 62 3e 65 61 63 68 3c 2f 62 3e 20 27 43  h <b>each</b> 'C
25b0: 65 6e 73 75 73 20 41 72 65 61 27 20 69 73 20 65  ensus Area' is e
25c0: 78 70 65 63 74 65 64 20 74 6f 20 63 6f 72 72 65  xpected to corre
25d0: 73 70 6f 6e 64 20 74 6f 20 61 20 3c 62 3e 73 69  spond to a <b>si
25e0: 6e 67 6c 65 3c 2f 62 3e 20 54 6f 70 6f 6c 6f 67  ngle</b> Topolog
25f0: 79 20 46 61 63 65 2e 20 28 6c 61 74 65 72 20 77  y Face. (later w
2600: 65 27 6c 6c 20 65 78 61 6d 69 6e 65 20 69 6e 20  e'll examine in 
2610: 6d 6f 72 65 20 64 65 70 74 68 2c 20 68 6f 77 20  more depth, how 
2620: 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20 2f 20  the TopoLayer / 
2630: 54 6f 70 6f 46 65 61 74 75 72 65 20 72 65 6c 61  TopoFeature rela
2640: 74 69 6f 6e 73 68 69 70 73 20 68 61 76 65 20 61  tionships have a
2650: 63 74 75 61 6c 6c 79 20 62 65 65 6e 20 64 65 66  ctually been def
2660: 69 6e 65 64 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  ined).</li>..<li
2670: 3e 74 68 65 6e 20 77 65 27 6c 6c 20 63 6f 6e 74  >then we'll cont
2680: 69 6e 75 65 20 62 79 20 64 65 66 69 6e 69 6e 67  inue by defining
2690: 20 73 65 76 65 72 61 6c 20 66 75 72 74 68 65 72   several further
26a0: 20 54 6f 70 6f 4c 61 79 65 72 73 20 63 6f 72 72   TopoLayers corr
26b0: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65  esponding to the
26c0: 20 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c   <b>Populated Pl
26d0: 61 63 65 73 3c 2f 62 3e 2c 20 3c 62 3e 4d 75 6e  aces</b>, <b>Mun
26e0: 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2c  icipalities</b>,
26f0: 20 3c 62 3e 50 72 6f 76 69 6e 63 65 73 3c 2f 62   <b>Provinces</b
2700: 3e 20 61 6e 64 20 3c 62 3e 52 65 67 69 6f 6e 3c  > and <b>Region<
2710: 2f 62 3e 20 61 64 6d 69 6e 69 73 74 72 61 74 69  /b> administrati
2720: 6f 6e 20 6c 65 76 65 6c 73 2e 3c 62 72 3e 0d 0a  on levels.<br>..
2730: 3c 75 3e 52 65 63 61 6c 6c 3c 2f 75 3e 3a 20 61  <u>Recall</u>: a
2740: 6c 6c 20 74 68 65 73 65 20 61 64 6d 69 6e 69 73  ll these adminis
2750: 74 72 61 74 69 6f 6e 20 6c 65 76 65 6c 73 20 69  tration levels i
2760: 6e 20 74 68 65 20 69 6e 69 74 69 61 6c 20 64 61  n the initial da
2770: 74 61 73 65 74 20 61 72 65 20 73 69 6d 70 6c 79  taset are simply
2780: 20 64 65 66 69 6e 65 64 20 62 79 20 72 65 6c 61   defined by rela
2790: 74 69 6f 6e 20 63 6f 64 65 73 20 69 6e 74 65 6e  tion codes inten
27a0: 64 65 64 20 74 6f 20 63 6f 6c 6c 65 63 74 2f 61  ded to collect/a
27b0: 67 67 72 65 67 61 74 65 20 74 68 65 20 6c 6f 77  ggregate the low
27c0: 65 72 20 6c 65 76 65 6c 20 65 6e 74 69 74 69 65  er level entitie
27d0: 73 20 77 68 65 72 65 2c 20 69 6e 20 74 68 69 73  s where, in this
27e0: 20 63 61 73 65 2c 20 68 61 76 65 20 6e 6f 20 67   case, have no g
27f0: 65 6f 6d 65 74 72 69 65 73 20 61 74 20 61 6c 6c  eometries at all
2800: 2e 20 42 65 69 6e 67 20 73 6f 2c 20 77 65 20 63  . Being so, we c
2810: 61 6e 6e 6f 74 20 63 72 65 61 74 65 20 61 20 66  annot create a f
2820: 75 6c 6c 79 20 64 65 66 69 6e 65 64 20 54 6f 70  ully defined Top
2830: 6f 4c 61 79 65 72 20 62 79 20 63 61 6c 6c 69 6e  oLayer by callin
2840: 67 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 72 65  g <b>TopoGeo_Cre
2850: 61 74 65 54 6f 70 6f 6c 61 79 65 72 28 29 3c 2f  ateTopolayer()</
2860: 62 3e 2e 3c 62 72 3e 0d 0a 42 79 20 69 6e 76 6f  b>.<br>..By invo
2870: 6b 69 6e 67 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f  king <b>TopoGeo_
2880: 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c  InitTopoLayer()<
2890: 2f 62 3e 20 6f 6e 6c 79 20 61 20 70 61 72 74 69  /b> only a parti
28a0: 61 6c 6c 79 20 64 65 66 69 6e 65 64 20 54 6f 70  ally defined Top
28b0: 6f 4c 61 79 65 72 20 77 69 6c 6c 20 69 6e 69 74  oLayer will init
28c0: 69 61 6c 69 7a 65 64 2c 20 62 75 74 20 77 68 69  ialized, but whi
28d0: 63 68 20 77 69 6c 6c 20 62 65 20 63 6f 6d 70 6c  ch will be compl
28e0: 65 6d 65 6e 74 20 6c 61 74 65 72 20 61 6e 79 20  ement later any 
28f0: 6d 69 73 73 69 6e 67 20 69 6e 66 6f 72 6d 61 74  missing informat
2900: 69 6f 6e 20 2d 20 74 68 75 73 20 61 63 68 69 65  ion - thus achie
2910: 76 69 6e 67 2c 20 77 69 74 68 20 61 20 73 65 63  ving, with a sec
2920: 6f 6e 64 20 73 74 65 70 20 2d 20 61 20 70 72 6f  ond step - a pro
2930: 70 65 72 6c 79 20 77 6f 72 6b 69 6e 67 20 54 6f  perly working To
2940: 70 6f 4c 61 79 65 72 20 28 61 73 20 77 65 27 6c  poLayer (as we'l
2950: 6c 20 73 65 65 20 6c 61 74 65 72 20 69 6e 20 66  l see later in f
2960: 75 6c 6c 20 64 65 74 61 69 6c 29 2e 3c 2f 6c 69  ull detail).</li
2970: 3e 0d 0a 3c 6c 69 3e 66 69 6e 61 6c 6c 79 20 77  >..<li>finally w
2980: 65 27 6c 6c 20 64 65 74 61 63 68 20 74 68 65 20  e'll detach the 
2990: 6e 6f 20 6c 6f 6e 67 65 72 20 6e 65 65 64 65 64  no longer needed
29a0: 20 65 78 74 65 72 6e 61 6c 20 64 62 2d 66 69 6c   external db-fil
29b0: 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a  e.</li>..</ol>..
29c0: 3c 68 72 3e 0d 0a 3c 61 20 6e 61 6d 65 3d 22 6c  <hr>..<a name="l
29d0: 61 79 6f 75 74 22 3e 0d 0a 3c 68 33 3e 54 6f 70  ayout">..<h3>Top
29e0: 6f 4c 61 79 65 72 73 20 2f 20 54 6f 70 6f 46 65  oLayers / TopoFe
29f0: 61 74 75 72 65 73 3a 20 6c 61 79 6f 75 74 20 6f  atures: layout o
2a00: 66 20 44 42 20 54 61 62 6c 65 73 20 61 6e 64 20  f DB Tables and 
2a10: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 72 65  corresponding re
2a20: 6c 61 74 69 6f 6e 73 68 69 70 73 3c 2f 68 33 3e  lationships</h3>
2a30: 3c 2f 61 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c  </a>..<table cel
2a40: 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 63 65 6c  lpadding="6" cel
2a50: 6c 73 70 61 63 69 6e 67 3d 22 38 22 3e 0d 0a 3c  lspacing="8">..<
2a60: 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e  tr><td>..<b><<i>
2a70: 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e  topo-prefix</i>>
2a80: 5f 74 6f 70 6f 6c 61 79 65 72 73 3c 2f 62 3e 0d  _topolayers</b>.
2a90: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c  .<verbatim>..SEL
2aa0: 45 43 54 20 2a 20 46 52 4f 4d 20 63 65 6e 73 75  ECT * FROM censu
2ab0: 73 32 30 31 31 5f 74 6f 70 6f 6c 61 79 65 72 73  s2011_topolayers
2ac0: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  ;..</verbatim>..
2ad0: 54 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72  The <b>TopoLayer
2ae0: 73 3c 2f 62 3e 20 74 61 62 6c 65 20 63 6f 6e 74  s</b> table cont
2af0: 61 69 6e 73 20 61 20 64 69 73 74 69 6e 63 74 20  ains a distinct 
2b00: 72 6f 77 20 66 6f 72 20 65 76 65 72 79 20 54 6f  row for every To
2b10: 70 6f 4c 61 79 65 72 20 64 65 66 69 6e 65 64 20  poLayer defined 
2b20: 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 20 54  on the current T
2b30: 6f 70 6f 6c 6f 67 79 2e 3c 62 72 3e 3c 62 72 3e  opology.<br><br>
2b40: 0d 0a 45 61 63 68 20 54 6f 70 6f 4c 61 79 65 72  ..Each TopoLayer
2b50: 20 69 73 20 69 64 65 6e 74 69 66 69 65 64 20 62   is identified b
2b60: 79 20 61 6e 20 3c 62 3e 69 64 3c 2f 62 3e 20 61  y an <b>id</b> a
2b70: 6e 64 20 62 79 20 61 20 3c 62 3e 6e 61 6d 65 3c  nd by a <b>name<
2b80: 2f 62 3e 3b 20 62 6f 74 68 20 61 72 65 20 72 65  /b>; both are re
2b90: 71 75 69 72 65 64 20 74 6f 20 62 65 20 75 6e 69  quired to be uni
2ba0: 71 75 65 20 76 61 6c 75 65 73 2e 0d 0a 3c 2f 74  que values...</t
2bb0: 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73  d><td>.."<i>cens
2bc0: 75 73 32 30 31 31 5f 74 6f 70 6f 6c 61 79 65 72  us2011_topolayer
2bd0: 73 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63  s</i>"..<table c
2be0: 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c  ellspan="4" cell
2bf0: 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f  padding="6" bgco
2c00: 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f  lor="#f8f8f0" bo
2c10: 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c  rder="1">..<tr><
2c20: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
2c30: 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65  0f8"><b>topolaye
2c40: 72 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c  r_id</b></td>..<
2c50: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
2c60: 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65  0f8"><b>topolaye
2c70: 72 5f 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 3c  r_name</b></td><
2c80: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c  /tr>..<tr><td al
2c90: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74  ign="right">1</t
2ca0: 64 3e 3c 74 64 3e 63 65 6e 73 75 73 5f 61 72 65  d><td>census_are
2cb0: 61 73 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74  as</td></tr>..<t
2cc0: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  r><td align="rig
2cd0: 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 3e 70 70  ht">2</td><td>pp
2ce0: 6c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  l</td></tr>..<tr
2cf0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
2d00: 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 3e 63 6f 6d  t">3</td><td>com
2d10: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
2d20: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
2d30: 22 3e 34 3c 2f 74 64 3e 3c 74 64 3e 70 72 6f 76  ">4</td><td>prov
2d40: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
2d50: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
2d60: 22 3e 35 3c 2f 74 64 3e 3c 74 64 3e 72 65 67 3c  ">5</td><td>reg<
2d70: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62  /td></tr>..</tab
2d80: 6c 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  le>..</td></tr>.
2d90: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c  .<tr><td>..<b><<
2da0: 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69  i>topo-prefix</i
2db0: 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f  >>_topofeatures_
2dc0: 3c 3c 69 3e 74 6f 70 6f 6c 61 79 65 72 2d 69 64  <<i>topolayer-id
2dd0: 3c 2f 69 3e 3e 3c 2f 62 3e 0d 0a 3c 76 65 72 62  </i>></b>..<verb
2de0: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 2a 20  atim>..SELECT * 
2df0: 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f  FROM census2011_
2e00: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 3b 0d  topofeatures_2;.
2e10: 0a 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d  ...SELECT * FROM
2e20: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f   census2011_topo
2e30: 66 65 61 74 75 72 65 73 5f 34 3b 0d 0a 3c 2f 76  features_4;..</v
2e40: 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 20 73 61  erbatim>..The sa
2e50: 6d 65 20 54 6f 70 6f 6c 6f 67 79 20 63 61 6e 20  me Topology can 
2e60: 63 6f 6e 74 61 69 6e 20 6d 6f 72 65 20 74 68 61  contain more tha
2e70: 6e 20 61 20 73 69 6e 67 6c 65 20 3c 62 3e 54 6f  n a single <b>To
2e80: 70 6f 46 65 61 74 75 72 65 73 3c 2f 62 3e 20 74  poFeatures</b> t
2e90: 61 62 6c 65 2c 20 61 6e 64 20 65 61 63 68 20 54  able, and each T
2ea0: 6f 70 6f 46 65 61 74 75 72 65 73 20 74 61 62 6c  opoFeatures tabl
2eb0: 65 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f  e corresponds to
2ec0: 20 61 20 73 69 6e 67 6c 65 20 54 6f 70 6f 4c 61   a single TopoLa
2ed0: 79 65 72 2e 3c 62 72 3e 0d 0a 45 76 65 72 79 20  yer.<br>..Every 
2ee0: 74 61 62 6c 65 20 63 61 6e 20 68 61 76 65 20 61  table can have a
2ef0: 20 73 70 65 63 69 66 69 63 20 6c 61 79 6f 75 74   specific layout
2f00: 20 6f 6e 20 69 74 73 20 6f 77 6e 20 28 73 74 72   on its own (str
2f10: 69 63 74 6c 79 20 72 65 66 6c 65 63 74 69 6e 67  ictly reflecting
2f20: 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e   the information
2f30: 20 61 74 74 72 69 62 75 74 65 73 20 66 6f 72 20   attributes for 
2f40: 65 61 63 68 20 6c 61 79 65 72 29 2c 20 61 6e 79  each layer), any
2f50: 77 61 79 20 61 6c 6c 20 74 68 65 6d 20 77 69 6c  way all them wil
2f60: 6c 20 68 61 76 65 20 61 20 3c 62 3e 75 6e 69 71  l have a <b>uniq
2f70: 75 65 20 54 6f 70 6f 46 65 61 74 75 72 65 20 69  ue TopoFeature i
2f80: 64 65 6e 74 69 66 69 65 72 3c 2f 62 3e 20 28 3c  dentifier</b> (<
2f90: 62 3e 3c 69 3e 66 69 64 3c 2f 69 3e 3c 2f 62 3e  b><i>fid</i></b>
2fa0: 29 20 61 63 74 69 6e 67 20 69 6e 20 74 68 65 20  ) acting in the 
2fb0: 50 72 69 6d 61 72 79 20 4b 65 79 20 72 6f 6c 65  Primary Key role
2fc0: 2e 3c 62 72 3e 0d 0a 54 68 65 20 72 65 6c 61 74  .<br>..The relat
2fd0: 69 6f 6e 73 68 69 70 20 62 65 74 77 65 65 6e 20  ionship between 
2fe0: 74 61 62 6c 65 20 6e 61 6d 65 73 20 61 6e 64 20  table names and 
2ff0: 54 6f 70 6f 4c 61 79 65 72 73 20 69 73 20 65 73  TopoLayers is es
3000: 74 61 62 6c 69 73 68 65 64 20 62 79 20 61 70 70  tablished by app
3010: 65 6e 64 69 6e 67 20 61 20 6e 75 6d 65 72 69 63  ending a numeric
3020: 20 73 75 66 66 69 78 20 74 6f 20 74 68 65 20 63   suffix to the c
3030: 6f 6d 6d 6f 6e 20 6e 61 6d 65 20 74 68 61 74 20  ommon name that 
3040: 6d 75 73 74 20 65 78 61 63 74 6c 79 20 6d 61 74  must exactly mat
3050: 63 68 20 74 68 65 20 3c 62 3e 74 6f 70 6f 6c 61  ch the <b>topola
3060: 79 65 72 5f 69 64 3c 2f 62 3e 20 76 61 6c 75 65  yer_id</b> value
3070: 20 64 65 63 6c 61 72 65 64 20 69 6e 20 74 68 65   declared in the
3080: 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f   <b>TopoLayers</
3090: 62 3e 20 6d 61 69 6e 20 74 61 62 6c 65 2e 3c 62  b> main table.<b
30a0: 72 3e 3c 62 72 3e 0d 0a 41 73 20 69 73 20 73 68  r><br>..As is sh
30b0: 6f 77 6e 20 69 6e 20 74 68 69 73 20 65 78 61 6d  own in this exam
30c0: 70 6c 65 20 74 68 65 20 66 69 72 73 74 20 74 61  ple the first ta
30d0: 62 6c 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31  ble <b>census201
30e0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32  1_topofeatures_2
30f0: 3c 2f 62 3e 20 28 3c 69 3e 74 6f 70 6f 6c 61 79  </b> (<i>topolay
3100: 65 72 5f 69 64 3c 2f 69 3e 3d 3c 69 3e 32 3c 2f  er_id</i>=<i>2</
3110: 69 3e 29 20 63 6f 6e 74 61 69 6e 73 20 61 6c 6c  i>) contains all
3120: 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 61 73   TopoFeatures as
3130: 73 6f 63 69 61 74 65 64 20 74 6f 20 74 68 65 20  sociated to the 
3140: 54 6f 70 6f 4c 61 79 65 72 20 3c 62 3e 70 70 6c  TopoLayer <b>ppl
3150: 3c 2f 62 3e 20 28 3c 69 3e 50 6f 70 75 6c 61 74  </b> (<i>Populat
3160: 65 64 20 50 6c 61 63 65 73 3c 2f 69 3e 29 2e 3c  ed Places</i>).<
3170: 62 72 3e 3c 62 72 3e 0d 0a 54 68 65 20 73 65 63  br><br>..The sec
3180: 6f 6e 64 20 74 61 62 6c 65 20 3c 62 3e 63 65 6e  ond table <b>cen
3190: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
31a0: 75 72 65 73 5f 34 3c 2f 62 3e 20 28 3c 69 3e 74  ures_4</b> (<i>t
31b0: 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 69 3e 3d  opolayer_id</i>=
31c0: 3c 69 3e 34 3c 2f 69 3e 29 20 63 6f 6e 74 61 69  <i>4</i>) contai
31d0: 6e 73 20 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75  ns all TopoFeatu
31e0: 72 65 73 20 61 73 73 6f 63 69 61 74 65 64 20 74  res associated t
31f0: 6f 20 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20  o the TopoLayer 
3200: 3c 62 3e 70 72 6f 76 3c 2f 62 3e 20 28 3c 69 3e  <b>prov</b> (<i>
3210: 50 72 6f 76 69 6e 63 65 73 3c 2f 69 3e 29 2e 0d  Provinces</i>)..
3220: 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e  .</td><td>.."<i>
3230: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66  census2011_topof
3240: 65 61 74 75 72 65 73 5f 32 3c 2f 69 3e 22 0d 0a  eatures_2</i>"..
3250: 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d  <table cellspan=
3260: 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d  "4" cellpadding=
3270: 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  "6" bgcolor="#f8
3280: 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22  f8f0" border="1"
3290: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f 6c  >..<tr><td bgcol
32a0: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e  or="#f0f0f8"><b>
32b0: 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74  fid</b></td>..<t
32c0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30  d bgcolor="#f0f0
32d0: 66 38 22 3e 3c 62 3e 63 6f 64 5f 70 70 6c 3c 2f  f8"><b>cod_ppl</
32e0: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63  b></td>..<td bgc
32f0: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c  olor="#f0f0f8"><
3300: 62 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74  b>cod_com</b></t
3310: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  d>..<td bgcolor=
3320: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e 61 6d  "#f0f0f8"><b>nam
3330: 65 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20  e</b></td>..<td 
3340: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38  bgcolor="#f0f0f8
3350: 22 3e 3c 62 3e 70 6f 70 5f 32 30 31 31 3c 2f 62  "><b>pop_2011</b
3360: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f  ></td>..<td bgco
3370: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62  lor="#f0f0f8"><b
3380: 3e 6d 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e  >m_2011</b></td>
3390: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  ..<td bgcolor="#
33a0: 66 30 66 30 66 38 22 3e 3c 62 3e 66 5f 32 30 31  f0f0f8"><b>f_201
33b0: 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  1</b></td></tr>.
33c0: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
33d0: 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64  right">1</td><td
33e0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
33f0: 30 35 31 34 32 37 30 35 3c 2f 74 64 3e 3c 74 64  05142705</td><td
3400: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34   align="right">4
3410: 35 30 30 31 3c 2f 74 64 3e 3c 74 64 3e 41 6c 62  5001</td><td>Alb
3420: 69 61 6e 6f 20 4d 61 67 72 61 3c 2f 74 64 3e 3c  iano Magra</td><
3430: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3440: 3e 31 39 30 37 3c 2f 74 64 3e 3c 74 64 20 61 6c  >1907</td><td al
3450: 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 31 39 3c  ign="right">919<
3460: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3470: 69 67 68 74 22 3e 39 38 38 3c 2f 74 64 3e 3c 2f  ight">988</td></
3480: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69  tr>..<tr><td ali
3490: 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64  gn="right">2</td
34a0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
34b0: 74 22 3e 32 30 35 31 34 32 37 30 36 3c 2f 74 64  t">205142706</td
34c0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
34d0: 74 22 3e 34 35 30 30 31 3c 2f 74 64 3e 3c 74 64  t">45001</td><td
34e0: 3e 41 75 6c 6c 61 3c 2f 74 64 3e 3c 74 64 20 61  >Aulla</td><td a
34f0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 33 32  lign="right">432
3500: 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  1</td><td align=
3510: 22 72 69 67 68 74 22 3e 32 30 34 36 3c 2f 74 64  "right">2046</td
3520: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3530: 74 22 3e 32 32 37 35 3c 2f 74 64 3e 3c 2f 74 72  t">2275</td></tr
3540: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e  >..<tr><td align
3550: 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c  ="right">3</td><
3560: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3570: 3e 32 30 35 31 34 32 37 31 30 3c 2f 74 64 3e 3c  >205142710</td><
3580: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3590: 3e 34 35 30 30 31 3c 2f 74 64 3e 3c 74 64 3e 43  >45001</td><td>C
35a0: 61 70 72 69 67 6c 69 6f 6c 61 3c 2f 74 64 3e 3c  aprigliola</td><
35b0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
35c0: 3e 34 38 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  >482</td><td ali
35d0: 67 6e 3d 22 72 69 67 68 74 22 3e 32 32 36 3c 2f  gn="right">226</
35e0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
35f0: 67 68 74 22 3e 32 35 36 3c 2f 74 64 3e 3c 2f 74  ght">256</td></t
3600: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73  r>..<tr><td cols
3610: 70 61 6e 3d 22 37 22 20 61 6c 69 67 6e 3d 22 63  pan="7" align="c
3620: 65 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e  enter"><hr></td>
3630: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61  </tr>..<tr><td a
3640: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 31  lign="right">101
3650: 38 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  8</td><td align=
3660: 22 72 69 67 68 74 22 3e 31 34 31 30 37 37 35 34  "right">14107754
3670: 31 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  15</td><td align
3680: 3d 22 72 69 67 68 74 22 3e 31 30 30 30 30 37 3c  ="right">100007<
3690: 2f 74 64 3e 3c 74 64 3e 53 61 73 73 65 74 61 3c  /td><td>Sasseta<
36a0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
36b0: 69 67 68 74 22 3e 32 38 35 3c 2f 74 64 3e 3c 74  ight">285</td><t
36c0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
36d0: 31 33 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  137</td><td alig
36e0: 6e 3d 22 72 69 67 68 74 22 3e 31 34 38 3c 2f 74  n="right">148</t
36f0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
3700: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31   align="right">1
3710: 30 31 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  019</td><td alig
3720: 6e 3d 22 72 69 67 68 74 22 3e 31 34 31 30 37 38  n="right">141078
3730: 35 34 31 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  5415</td><td ali
3740: 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 30 30 30  gn="right">10000
3750: 37 3c 2f 74 64 3e 3c 74 64 3e 54 65 72 72 69 67  7</td><td>Terrig
3760: 6f 6c 69 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  oli</td><td alig
3770: 6e 3d 22 72 69 67 68 74 22 3e 35 33 37 3c 2f 74  n="right">537</t
3780: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
3790: 68 74 22 3e 32 36 34 3c 2f 74 64 3e 3c 74 64 20  ht">264</td><td 
37a0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 37  align="right">27
37b0: 33 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74  3</td></tr>..</t
37c0: 61 62 6c 65 3e 0d 0a 3c 62 72 3e 0d 0a 22 3c 69  able>..<br>.."<i
37d0: 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f  >census2011_topo
37e0: 66 65 61 74 75 72 65 73 5f 34 3c 2f 69 3e 22 0d  features_4</i>".
37f0: 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e  .<table cellspan
3800: 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67  ="4" cellpadding
3810: 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ="6" bgcolor="#f
3820: 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31  8f8f0" border="1
3830: 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f  ">..<tr><td bgco
3840: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62  lor="#f0f0f8"><b
3850: 3e 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c  >fid</b></td>..<
3860: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
3870: 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 70 72 6f 76  0f8"><b>cod_prov
3880: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62  </b></td>..<td b
3890: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22  gcolor="#f0f0f8"
38a0: 3e 3c 62 3e 63 6f 64 5f 72 65 67 3c 2f 62 3e 3c  ><b>cod_reg</b><
38b0: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
38c0: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e  r="#f0f0f8"><b>n
38d0: 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74  ame</b></td>..<t
38e0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30  d bgcolor="#f0f0
38f0: 66 38 22 3e 3c 62 3e 61 62 62 72 65 76 3c 2f 62  f8"><b>abbrev</b
3900: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f  ></td>..<td bgco
3910: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62  lor="#f0f0f8"><b
3920: 3e 70 6f 70 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74  >pop_2011</b></t
3930: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  d>..<td bgcolor=
3940: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6d 5f 32  "#f0f0f8"><b>m_2
3950: 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74  011</b></td>..<t
3960: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30  d bgcolor="#f0f0
3970: 66 38 22 3e 3c 62 3e 66 5f 32 30 31 31 3c 2f 62  f8"><b>f_2011</b
3980: 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  ></td></tr>..<tr
3990: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
39a0: 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  t">1</td><td ali
39b0: 67 6e 3d 22 72 69 67 68 74 22 3e 34 35 3c 2f 74  gn="right">45</t
39c0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
39d0: 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 4d 61  ht">9</td><td>Ma
39e0: 73 73 61 26 6e 62 73 70 3b 43 61 72 72 61 72 61  ssa&nbsp;Carrara
39f0: 3c 2f 74 64 3e 3c 74 64 3e 4d 53 3c 2f 74 64 3e  </td><td>MS</td>
3a00: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3a10: 22 3e 31 39 39 36 35 30 3c 2f 74 64 3e 3c 74 64  ">199650</td><td
3a20: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39   align="right">9
3a30: 35 37 35 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  5754</td><td ali
3a40: 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 33 38 39  gn="right">10389
3a50: 36 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  6</td></tr>..<tr
3a60: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3a70: 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  t">2</td><td ali
3a80: 67 6e 3d 22 72 69 67 68 74 22 3e 34 36 3c 2f 74  gn="right">46</t
3a90: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
3aa0: 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 4c 75  ht">9</td><td>Lu
3ab0: 63 63 61 3c 2f 74 64 3e 3c 74 64 3e 4c 55 3c 2f  cca</td><td>LU</
3ac0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
3ad0: 67 68 74 22 3e 33 38 38 33 32 37 3c 2f 74 64 3e  ght">388327</td>
3ae0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3af0: 22 3e 31 38 36 31 38 33 3c 2f 74 64 3e 3c 74 64  ">186183</td><td
3b00: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
3b10: 30 32 31 34 34 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  02144</td></tr>.
3b20: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
3b30: 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64  right">3</td><td
3b40: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34   align="right">4
3b50: 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  7</td><td align=
3b60: 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74  "right">9</td><t
3b70: 64 3e 50 69 73 74 6f 69 61 3c 2f 74 64 3e 3c 74  d>Pistoia</td><t
3b80: 64 3e 50 54 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  d>PT</td><td ali
3b90: 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 37 38 36  gn="right">28786
3ba0: 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  6</td><td align=
3bb0: 22 72 69 67 68 74 22 3e 31 33 38 30 35 34 3c 2f  "right">138054</
3bc0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
3bd0: 67 68 74 22 3e 31 34 39 38 31 32 3c 2f 74 64 3e  ght">149812</td>
3be0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63  </tr>..<tr><td c
3bf0: 6f 6c 73 70 61 6e 3d 22 38 22 20 61 6c 69 67 6e  olspan="8" align
3c00: 3d 22 63 65 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f  ="center"><hr></
3c10: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74  td></tr>..<tr><t
3c20: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3c30: 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  9</td><td align=
3c40: 22 72 69 67 68 74 22 3e 35 33 3c 2f 74 64 3e 3c  "right">53</td><
3c50: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3c60: 3e 39 3c 2f 74 64 3e 3c 74 64 3e 47 72 6f 73 73  >9</td><td>Gross
3c70: 65 74 6f 3c 2f 74 64 3e 3c 74 64 3e 47 52 3c 2f  eto</td><td>GR</
3c80: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
3c90: 67 68 74 22 3e 32 32 30 35 36 34 3c 2f 74 64 3e  ght">220564</td>
3ca0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3cb0: 22 3e 31 30 35 35 38 35 3c 2f 74 64 3e 3c 74 64  ">105585</td><td
3cc0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31   align="right">1
3cd0: 31 34 39 37 39 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  14979</td></tr>.
3ce0: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
3cf0: 72 69 67 68 74 22 3e 31 30 3c 2f 74 64 3e 3c 74  right">10</td><t
3d00: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3d10: 31 30 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  100</td><td alig
3d20: 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e  n="right">9</td>
3d30: 3c 74 64 3e 50 72 61 74 6f 3c 2f 74 64 3e 3c 74  <td>Prato</td><t
3d40: 64 3e 50 4f 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  d>PO</td><td ali
3d50: 67 6e 3d 22 72 69 67 68 74 22 3e 32 34 35 39 31  gn="right">24591
3d60: 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  6</td><td align=
3d70: 22 72 69 67 68 74 22 3e 31 31 39 30 38 38 3c 2f  "right">119088</
3d80: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
3d90: 67 68 74 22 3e 31 32 36 38 32 38 3c 2f 74 64 3e  ght">126828</td>
3da0: 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d  </tr>..</table>.
3db0: 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  .</td></tr>..<tr
3dc0: 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f  ><td>..<b><<i>to
3dd0: 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74  po-prefix</i>>_t
3de0: 6f 70 6f 66 65 61 74 75 72 65 73 3c 2f 62 3e 0d  opofeatures</b>.
3df0: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c  .<verbatim>..SEL
3e00: 45 43 54 20 2a 20 46 52 4f 4d 20 63 65 6e 73 75  ECT * FROM censu
3e10: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
3e20: 65 73 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  es;..</verbatim>
3e30: 0d 0a 54 68 65 20 3c 62 3e 54 6f 70 6f 46 65 61  ..The <b>TopoFea
3e40: 74 75 72 65 73 2d 67 65 6f 6d 65 74 72 69 65 73  tures-geometries
3e50: 3c 2f 62 3e 20 74 61 62 6c 65 20 69 73 20 69 6e  </b> table is in
3e60: 74 65 6e 64 65 64 20 74 6f 20 70 65 72 6d 61 6e  tended to perman
3e70: 65 6e 74 6c 79 20 73 74 6f 72 65 20 61 6c 6c 20  ently store all 
3e80: 72 65 6c 61 74 69 6f 6e 73 20 62 65 74 77 65 65  relations betwee
3e90: 6e 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 61  n TopoFeatures a
3ea0: 6e 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d  nd Topology prim
3eb0: 69 74 69 76 65 73 20 72 65 71 75 69 72 65 64 20  itives required 
3ec0: 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f 72 72  in order to corr
3ed0: 65 63 74 6c 79 20 62 75 69 6c 64 20 74 68 65 20  ectly build the 
3ee0: 65 78 70 65 63 74 65 64 20 6f 75 74 70 75 74 20  expected output 
3ef0: 47 65 6f 6d 65 74 72 79 20 66 6f 72 20 65 61 63  Geometry for eac
3f00: 68 20 54 6f 70 6f 46 65 61 74 75 72 65 2e 0d 0a  h TopoFeature...
3f10: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 75 69 64  <ul>..<li><b>uid
3f20: 3c 2f 62 3e 20 69 73 20 74 68 65 20 50 72 69 6d  </b> is the Prim
3f30: 61 72 79 20 4b 65 79 2c 20 61 6e 64 20 69 73 20  ary Key, and is 
3f40: 73 69 6d 70 6c 79 20 69 6e 74 65 6e 64 65 64 20  simply intended 
3f50: 74 6f 20 62 65 20 61 6e 20 75 6e 69 71 75 65 20  to be an unique 
3f60: 69 64 65 6e 74 69 66 69 65 72 20 66 6f 72 20 65  identifier for e
3f70: 61 63 68 20 72 6f 77 20 62 75 74 20 64 6f 65 73  ach row but does
3f80: 6e 27 74 20 69 6e 74 65 6e 64 20 74 6f 20 68 61  n't intend to ha
3f90: 76 65 20 61 6e 79 20 73 70 65 63 69 61 6c 20 6d  ve any special m
3fa0: 65 61 6e 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c 6c  eaning.</li>..<l
3fb0: 69 3e 3c 62 3e 6e 6f 64 65 5f 69 64 3c 2f 62 3e  i><b>node_id</b>
3fc0: 2c 20 3c 62 3e 65 64 67 65 5f 69 64 3c 2f 62 3e  , <b>edge_id</b>
3fd0: 20 61 6e 64 20 3c 62 3e 66 61 63 65 5f 69 64 3c   and <b>face_id<
3fe0: 2f 62 3e 20 61 72 65 20 46 6f 72 65 69 67 6e 20  /b> are Foreign 
3ff0: 4b 65 79 73 20 64 69 72 65 63 74 6c 79 20 72 65  Keys directly re
4000: 66 65 72 65 6e 63 69 6e 67 20 61 20 54 6f 70 6f  ferencing a Topo
4010: 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 3b 20  logy primitive; 
4020: 74 77 6f 20 6f 66 20 74 68 65 73 65 20 76 61 6c  two of these val
4030: 75 65 73 20 61 72 65 20 61 6c 77 61 79 73 20 65  ues are always e
4040: 78 70 65 63 74 65 64 20 74 6f 20 62 65 20 4e 55  xpected to be NU
4050: 4c 4c 2c 20 61 6e 64 20 6f 6e 6c 79 20 6f 6e 65  LL, and only one
4060: 20 69 73 20 65 78 70 65 63 74 65 64 20 74 6f 20   is expected to 
4070: 65 66 66 65 63 74 69 76 65 6c 79 20 72 65 66 65  effectively refe
4080: 72 65 6e 63 65 20 61 20 54 6f 70 6f 6c 6f 67 79  rence a Topology
4090: 20 70 72 69 6d 69 74 69 76 65 20 64 65 70 65 6e   primitive depen
40a0: 64 69 6e 67 20 6f 6e 20 69 74 73 20 74 79 70 65  ding on its type
40b0: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 74  .</li>..<li><b>t
40c0: 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 3e 20  opolayer_id</b> 
40d0: 61 6e 64 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 74  and <b>fid</b> t
40e0: 6f 67 65 74 68 65 72 20 61 72 65 20 69 6e 74 65  ogether are inte
40f0: 6e 64 65 64 20 74 6f 20 65 73 74 61 62 6c 69 73  nded to establis
4100: 68 20 61 20 72 65 6c 61 74 69 6f 6e 61 6c 20 72  h a relational r
4110: 65 66 65 72 65 6e 63 65 20 74 6f 20 73 6f 6d 65  eference to some
4120: 20 73 70 65 63 69 66 69 63 20 54 6f 70 6f 46 65   specific TopoFe
4130: 61 74 75 72 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75  ature.</li>..</u
4140: 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61  l>..<br>..<u>Exa
4150: 6d 70 6c 65 20 23 31 3c 2f 75 3e 3a 20 61 6c 6c  mple #1</u>: all
4160: 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74   Topology primit
4170: 69 76 65 73 20 64 69 72 65 63 74 6c 79 20 72 65  ives directly re
4180: 66 65 72 65 6e 63 65 64 20 62 79 20 72 6f 77 73  ferenced by rows
4190: 20 64 65 63 6c 61 72 69 6e 67 20 3c 62 3e 74 6f   declaring <b>to
41a0: 70 6f 6c 61 79 65 72 5f 69 64 3d 32 3c 2f 62 3e  polayer_id=2</b>
41b0: 20 61 6e 64 20 3c 62 3e 66 69 64 3d 33 3c 2f 62   and <b>fid=3</b
41c0: 3e 20 6d 75 73 74 20 62 65 20 61 67 67 72 65 67  > must be aggreg
41d0: 61 74 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f  ated in order to
41e0: 20 62 75 69 6c 64 20 74 68 65 20 6f 75 74 70 75   build the outpu
41f0: 74 20 47 65 6f 6d 65 74 72 79 20 63 6f 72 72 65  t Geometry corre
4200: 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20  sponding to the 
4210: 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 20  Populated Place 
4220: 6f 66 20 3c 62 3e 43 61 70 72 69 67 6c 69 6f 6c  of <b>Caprigliol
4230: 61 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 45  a</b>.<br>..<u>E
4240: 78 61 6d 70 6c 65 20 23 32 3c 2f 75 3e 3a 20 61  xample #2</u>: a
4250: 6c 6c 20 70 72 69 6d 69 74 69 76 65 73 20 72 65  ll primitives re
4260: 66 65 72 65 6e 63 65 64 20 62 79 20 72 6f 77 73  ferenced by rows
4270: 20 64 65 63 6c 61 72 69 6e 67 20 3c 62 3e 74 6f   declaring <b>to
4280: 70 6f 6c 61 79 65 72 5f 69 64 3d 34 3c 2f 62 3e  polayer_id=4</b>
4290: 20 61 6e 64 20 3c 62 3e 66 69 64 3d 39 3c 2f 62   and <b>fid=9</b
42a0: 3e 20 6d 75 73 74 20 62 65 20 61 67 67 72 65 67  > must be aggreg
42b0: 61 74 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f  ated in order to
42c0: 20 62 75 69 6c 64 20 74 68 65 20 6f 75 74 70 75   build the outpu
42d0: 74 20 47 65 6f 6d 65 74 72 79 20 63 6f 72 72 65  t Geometry corre
42e0: 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20  sponding to the 
42f0: 50 72 6f 76 69 6e 63 65 20 6f 66 20 3c 62 3e 47  Province of <b>G
4300: 72 6f 73 73 65 74 6f 3c 2f 62 3e 2e 0d 0a 3c 2f  rosseto</b>...</
4310: 74 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e  td><td>.."<i>cen
4320: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
4330: 75 72 65 73 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c  ures</i>"..<tabl
4340: 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63  e cellspan="4" c
4350: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62  ellpadding="6" b
4360: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22  gcolor="#f8f8f0"
4370: 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74   border="1">..<t
4380: 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  r><td bgcolor="#
4390: 66 30 66 30 66 38 22 3e 3c 62 3e 75 69 64 3c 2f  f0f0f8"><b>uid</
43a0: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63  b></td>..<td bgc
43b0: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c  olor="#f0f0f8"><
43c0: 62 3e 6e 6f 64 65 5f 69 64 3c 2f 62 3e 3c 2f 74  b>node_id</b></t
43d0: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  d>..<td bgcolor=
43e0: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 65 64 67  "#f0f0f8"><b>edg
43f0: 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c  e_id</b></td>..<
4400: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
4410: 30 66 38 22 3e 3c 62 3e 66 61 63 65 5f 69 64 3c  0f8"><b>face_id<
4420: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
4430: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
4440: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c  <b>topolayer_id<
4450: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
4460: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
4470: 3c 62 3e 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e 3c  <b>fid</b></td><
4480: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c  /tr>..<tr><td al
4490: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74  ign="right">1</t
44a0: 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c  d><td>NULL</td><
44b0: 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20  td>NULL</td><td 
44c0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c  align="right">1<
44d0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
44e0: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20  ight">1</td><td 
44f0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c  align="right">1<
4500: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c  /td></tr>..<tr><
4510: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
4520: 3e 32 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c  >2</td><td>NULL<
4530: 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64  /td><td>NULL</td
4540: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
4550: 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  t">2</td><td ali
4560: 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64  gn="right">1</td
4570: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
4580: 74 22 3e 32 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  t">2</td></tr>..
4590: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  <tr><td align="r
45a0: 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 3e  ight">3</td><td>
45b0: 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c  NULL</td><td>NUL
45c0: 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  L</td><td align=
45d0: 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74  "right">3</td><t
45e0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
45f0: 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  1</td><td align=
4600: 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 2f  "right">3</td></
4610: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c  tr>..<tr><td col
4620: 73 70 61 6e 3d 22 36 22 20 61 6c 69 67 6e 3d 22  span="6" align="
4630: 63 65 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 64  center"><hr></td
4640: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
4650: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38  align="right">28
4660: 38 37 30 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c  870</td><td>NULL
4670: 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74  </td><td>NULL</t
4680: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
4690: 68 74 22 3e 32 38 38 36 34 3c 2f 74 64 3e 3c 74  ht">28864</td><t
46a0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
46b0: 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  1</td><td align=
46c0: 22 72 69 67 68 74 22 3e 32 38 38 36 37 3c 2f 74  "right">28867</t
46d0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
46e0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
46f0: 38 38 37 31 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c  8871</td><td>NUL
4700: 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f  L</td><td>NULL</
4710: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
4720: 67 68 74 22 3e 32 38 38 36 38 3c 2f 74 64 3e 3c  ght">28868</td><
4730: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
4740: 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  >1</td><td align
4750: 3d 22 72 69 67 68 74 22 3e 32 38 38 36 38 3c 2f  ="right">28868</
4760: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c  td></tr>..</tabl
4770: 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  e>..</td></tr>..
4780: 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 74 61 62 6c 65  </table>..<table
4790: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 38 22   cellpadding="8"
47a0: 20 62 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 62   bgcolor="#d0ffb
47b0: 30 22 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c  0">..<tr><td>..<
47c0: 61 20 6e 61 6d 65 3d 22 72 65 6d 61 72 6b 73 22  a name="remarks"
47d0: 3e 0d 0a 3c 68 33 3e 46 69 6e 61 6c 20 72 65 6d  >..<h3>Final rem
47e0: 61 72 6b 73 3c 2f 68 33 3e 3c 2f 61 3e 0d 0a 3c  arks</h3></a>..<
47f0: 6f 6c 3e 0d 0a 3c 6c 69 3e 62 6f 74 68 20 3c 62  ol>..<li>both <b
4800: 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54  >TopoGeo_CreateT
4810: 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 61  opoLayer()</b> a
4820: 6e 64 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e  nd <b>TopoGeo_In
4830: 69 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62  itTopoLayer()</b
4840: 3e 20 77 69 6c 6c 20 72 65 67 69 73 74 65 72 20  > will register 
4850: 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20 69 6e  the TopoLayer in
4860: 74 6f 20 74 68 65 20 3c 62 3e 54 6f 70 6f 4c 61  to the <b>TopoLa
4870: 79 65 72 73 3c 2f 62 3e 20 74 61 62 6c 65 2c 20  yers</b> table, 
4880: 61 6e 64 20 77 69 6c 6c 20 63 72 65 61 74 65 20  and will create 
4890: 61 6e 64 20 70 6f 70 75 6c 61 74 65 20 74 68 65  and populate the
48a0: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 3c   corresponding <
48b0: 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 3c 2f  b>TopoFeatures</
48c0: 62 3e 20 74 61 62 6c 65 20 62 79 20 69 6d 70 6f  b> table by impo
48d0: 72 74 69 6e 67 20 61 6c 6c 20 69 6e 66 6f 72 6d  rting all inform
48e0: 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73  ation attributes
48f0: 20 66 6f 72 20 65 61 63 68 20 46 65 61 74 75 72   for each Featur
4900: 65 20 64 65 66 69 6e 65 64 20 62 79 20 74 68 65  e defined by the
4910: 20 72 65 66 65 72 65 6e 63 65 20 74 61 62 6c 65   reference table
4920: 20 28 6f 72 20 72 65 66 65 72 65 6e 63 65 20 76   (or reference v
4930: 69 65 77 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  iew).</li>..<li>
4940: 6f 6e 6c 79 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f  only <b>TopoGeo_
4950: 43 72 65 61 74 65 54 6f 70 6f 4c 61 79 65 72 28  CreateTopoLayer(
4960: 29 3c 2f 62 3e 20 77 69 6c 6c 20 61 75 74 6f 6d  )</b> will autom
4970: 61 74 69 63 61 6c 6c 79 20 70 6f 70 75 6c 61 74  atically populat
4980: 65 20 74 68 65 20 3c 62 3e 54 6f 70 6f 46 65 61  e the <b>TopoFea
4990: 74 75 72 65 73 2d 67 65 6f 6d 65 74 72 79 3c 2f  tures-geometry</
49a0: 62 3e 20 74 61 62 6c 65 2c 20 61 6e 64 20 77 68  b> table, and wh
49b0: 69 6c 65 20 64 6f 69 6e 67 20 73 6f 2c 20 69 64  ile doing so, id
49c0: 65 6e 74 69 66 79 20 61 6c 6c 20 72 65 6c 61 74  entify all relat
49d0: 69 6f 6e 73 68 69 70 73 20 65 78 69 73 74 69 6e  ionships existin
49e0: 67 20 62 65 74 77 65 65 6e 20 74 68 65 20 47 65  g between the Ge
49f0: 6f 6d 65 74 72 69 65 73 20 66 6f 75 6e 64 20 69  ometries found i
4a00: 6e 74 6f 20 74 68 65 20 72 65 66 65 72 65 6e 63  nto the referenc
4a10: 65 20 74 61 62 6c 65 20 6f 72 20 76 69 65 77 20  e table or view 
4a20: 61 6e 64 20 74 68 65 20 54 6f 70 6f 6c 6f 67 79  and the Topology
4a30: 20 70 72 69 6d 69 74 69 76 65 73 20 62 61 73 65   primitives base
4a40: 64 20 6f 6e 20 74 68 65 20 76 61 6c 75 65 73 20  d on the values 
4a50: 6f 66 20 74 68 65 20 3c 62 3e 54 6f 70 6f 53 65  of the <b>TopoSe
4a60: 65 64 73 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c  eds</b>.</li>..<
4a70: 6c 69 3e 61 73 20 61 70 70 6f 73 65 64 20 74 6f  li>as apposed to
4a80: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 74   <b>TopoGeo_Init
4a90: 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 2c  TopoLayer()</b>,
4aa0: 20 77 68 69 63 68 20 77 69 6c 6c 20 6e 65 76 65   which will neve
4ab0: 72 20 61 74 74 65 6d 70 74 20 74 6f 20 69 64 65  r attempt to ide
4ac0: 6e 74 69 66 79 20 74 68 65 20 72 65 6c 61 74 69  ntify the relati
4ad0: 6f 6e 73 68 69 70 73 20 69 6e 74 65 72 63 75 72  onships intercur
4ae0: 72 69 6e 67 20 62 65 74 77 65 65 6e 20 6f 75 74  ring between out
4af0: 70 75 74 20 47 65 6f 6d 65 74 72 69 65 73 20 61  put Geometries a
4b00: 6e 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d  nd Topology prim
4b10: 69 74 69 76 65 73 2e 20 54 68 69 73 20 74 61 73  itives. This tas
4b20: 6b 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 62 65  k will always be
4b30: 20 64 65 66 65 72 72 65 64 20 66 6f 72 20 74 68   deferred for th
4b40: 65 20 75 73 65 72 20 74 6f 20 64 65 61 6c 20 77  e user to deal w
4b50: 69 74 68 20 6c 61 74 65 72 2e 3c 62 72 3e 0d 0a  ith later.<br>..
4b60: 59 6f 75 20 63 6f 75 6c 64 2c 20 66 6f 72 20 65  You could, for e
4b70: 78 61 6d 70 6c 65 2c 20 6d 61 6e 75 61 6c 6c 79  xample, manually
4b80: 20 73 65 6c 65 63 74 20 61 6c 6c 20 54 6f 70 6f   select all Topo
4b90: 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20  logy primitives 
4ba0: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f  corresponding to
4bb0: 20 61 20 73 69 6e 67 6c 65 20 54 6f 70 6f 46 65   a single TopoFe
4bc0: 61 74 75 72 65 3b 20 6f 72 20 6d 6f 72 65 20 70  ature; or more p
4bd0: 72 6f 62 61 62 6c 79 20 79 6f 75 20 63 6f 75 6c  robably you coul
4be0: 64 20 70 65 72 66 6f 72 6d 20 74 68 69 73 20 74  d perform this t
4bf0: 61 73 6b 20 69 6e 20 61 20 73 65 63 6f 6e 64 20  ask in a second 
4c00: 72 6f 75 6e 64 20 62 79 20 65 78 65 63 75 74 69  round by executi
4c10: 6e 67 20 73 6f 6d 65 20 61 70 70 72 6f 70 72 69  ng some appropri
4c20: 61 74 65 20 53 51 4c 20 73 74 61 74 65 6d 65 6e  ate SQL statemen
4c30: 74 20 28 3c 69 3e 61 73 20 77 65 27 6c 6c 20 73  t (<i>as we'll s
4c40: 65 65 6e 20 73 6f 6f 6e 20 69 6e 20 74 68 65 20  een soon in the 
4c50: 6e 65 78 74 20 65 78 61 6d 70 6c 65 3c 2f 69 3e  next example</i>
4c60: 29 2e 20 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c 2f 74 64  ). ..</ol>..</td
4c70: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
4c80: 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 61 20 6e  <br>..<hr>..<a n
4c90: 61 6d 65 3d 22 45 78 70 6f 72 74 54 6f 70 6f 4c  ame="ExportTopoL
4ca0: 61 79 65 72 22 3e 0d 0a 3c 68 33 3e 54 6f 70 6f  ayer">..<h3>Topo
4cb0: 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61  Geo_ExportTopoLa
4cc0: 79 65 72 3a 20 65 78 70 6f 72 74 69 6e 67 20 61  yer: exporting a
4cd0: 20 66 75 6c 6c 20 54 6f 70 6f 4c 61 79 65 72 20   full TopoLayer 
4ce0: 69 6e 74 6f 20 61 20 47 65 6f 54 61 62 6c 65 3c  into a GeoTable<
4cf0: 2f 68 33 3e 3c 2f 61 3e 0d 0a 3c 74 61 62 6c 65  /h3></a>..<table
4d00: 20 77 69 64 74 68 3d 22 31 30 30 25 22 20 20 63   width="100%"  c
4d10: 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c  ellspan="4" cell
4d20: 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f  padding="6" bgco
4d30: 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f  lor="#f8f8f0" bo
4d40: 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c  rder="1">..<tr><
4d50: 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22 20 61  td colspan="2" a
4d60: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62  lign="center"><b
4d70: 3e 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20 43  >exporting the C
4d80: 65 6e 73 75 73 20 41 72 65 61 73 20 54 6f 70 6f  ensus Areas Topo
4d90: 4c 61 79 65 72 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f  Layer</b></td></
4da0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 57  tr>..<tr><td>..W
4db0: 65 27 6c 6c 20 73 74 61 72 74 20 62 79 20 65 78  e'll start by ex
4dc0: 70 6f 72 74 69 6e 67 20 66 69 72 73 74 20 74 68  porting first th
4dd0: 65 20 6f 6e 6c 79 20 63 6f 6d 70 6c 65 74 65 6c  e only completel
4de0: 79 20 64 65 66 69 6e 65 64 20 54 6f 70 6f 4c 61  y defined TopoLa
4df0: 79 65 72 20 77 65 20 68 61 76 65 20 61 74 20 74  yer we have at t
4e00: 68 69 73 20 70 6f 69 6e 74 20 69 6e 20 74 68 65  his point in the
4e10: 20 74 65 73 74 20 44 42 2d 66 69 6c 65 2c 20 69   test DB-file, i
4e20: 2e 65 2e 20 3c 62 3e 63 65 6e 73 75 73 5f 61 72  .e. <b>census_ar
4e30: 65 61 73 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74  eas</b>..<verbat
4e40: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f  im>..SELECT Topo
4e50: 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61  Geo_ExportTopoLa
4e60: 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27  yer('census2011'
4e70: 2c 20 27 63 65 6e 73 75 73 5f 61 72 65 61 73 27  , 'census_areas'
4e80: 2c 20 27 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30  , 'out_census_20
4e90: 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62  11', 1);..</verb
4ea0: 61 74 69 6d 3e 0d 0a 41 73 20 79 6f 75 20 63 61  atim>..As you ca
4eb0: 6e 20 65 61 73 69 6c 79 20 63 68 65 63 6b 20 62  n easily check b
4ec0: 79 20 79 6f 75 72 73 65 6c 66 20 61 20 6e 65 77  y yourself a new
4ed0: 20 47 65 6f 54 61 62 6c 65 20 6e 61 6d 65 64 20   GeoTable named 
4ee0: 3c 62 3e 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30  <b>out_census_20
4ef0: 31 31 3c 2f 62 3e 20 68 61 73 20 62 65 65 6e 20  11</b> has been 
4f00: 63 72 65 61 74 65 64 20 62 79 20 3c 62 3e 54 6f  created by <b>To
4f10: 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f  poGeo_ExportTopo
4f20: 4c 61 79 65 72 28 29 3c 2f 62 3e 3a 0d 0a 3c 75  Layer()</b>:..<u
4f30: 6c 3e 0d 0a 3c 6c 69 3e 74 68 69 73 20 47 65 6f  l>..<li>this Geo
4f40: 54 61 62 6c 65 20 63 6f 6e 74 61 69 6e 73 20 61  Table contains a
4f50: 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20  ll TopoFeatures 
4f60: 64 65 66 69 6e 65 64 20 69 6e 74 6f 20 74 68 65  defined into the
4f70: 20 54 6f 70 6f 4c 61 79 65 72 2e 3c 2f 6c 69 3e   TopoLayer.</li>
4f80: 0d 0a 3c 6c 69 3e 65 61 63 68 20 54 6f 70 6f 46  ..<li>each TopoF
4f90: 65 61 74 75 72 65 20 66 61 69 74 68 66 75 6c 6c  eature faithfull
4fa0: 79 20 70 72 65 73 65 72 76 65 73 20 69 74 73 20  y preserves its 
4fb0: 69 6e 69 74 69 61 6c 20 69 6e 66 6f 72 6d 61 74  initial informat
4fc0: 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 2e 3c  ion attributes.<
4fd0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6c 6c 20 47 65  /li>..<li>all Ge
4fe0: 6f 6d 65 74 72 69 65 73 20 61 72 65 20 70 72 65  ometries are pre
4ff0: 63 69 73 65 6c 79 20 62 75 69 6c 74 20 62 79 20  cisely built by 
5000: 61 67 67 72 65 67 61 74 69 6e 67 20 74 68 65 20  aggregating the 
5010: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 54 6f  corresponding To
5020: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
5030: 73 20 61 73 20 73 70 65 63 69 66 69 65 64 20 62  s as specified b
5040: 79 20 54 6f 70 6f 4c 61 79 65 72 20 2f 20 54 6f  y TopoLayer / To
5050: 70 6f 46 65 61 74 75 72 65 73 20 72 65 6c 61 74  poFeatures relat
5060: 69 6f 6e 73 68 69 70 73 2e 3c 2f 6c 69 3e 0d 0a  ionships.</li>..
5070: 3c 2f 75 6c 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 54  </ul><br><br>..T
5080: 68 65 20 69 6d 61 67 65 20 65 78 61 6d 70 6c 69  he image exampli
5090: 66 69 65 73 20 61 20 63 68 6f 72 6f 70 6c 65 74  fies a choroplet
50a0: 68 20 63 65 6e 74 65 72 65 64 20 61 72 6f 75 6e  h centered aroun
50b0: 64 20 74 68 65 20 49 73 6c 61 6e 64 20 6f 66 20  d the Island of 
50c0: 45 6c 62 61 20 61 6e 64 20 62 61 73 65 64 20 6f  Elba and based o
50d0: 6e 20 74 68 65 20 3c 62 3e 6f 75 74 5f 63 65 6e  n the <b>out_cen
50e0: 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20 47 65 6f  sus_2011</b> Geo
50f0: 54 61 62 6c 65 3a 20 61 6c 6c 20 43 65 6e 73 75  Table: all Censu
5100: 73 20 41 72 65 61 73 20 61 72 65 20 64 69 73 70  s Areas are disp
5110: 6c 61 79 65 64 20 62 79 20 61 64 6f 70 74 69 6e  layed by adoptin
5120: 67 20 61 20 63 6f 6c 6f 75 72 20 64 69 72 65 63  g a colour direc
5130: 74 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  tly correspondin
5140: 67 20 74 6f 20 74 68 65 69 72 20 70 6f 70 75 6c  g to their popul
5150: 61 74 69 6f 6e 20 64 65 6e 73 69 74 79 2e 0d 0a  ation density...
5160: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20  </td><td>..<img 
5170: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77  src="https://www
5180: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69  .gaia-gis.it/gai
5190: 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f  a-sins/topofigs/
51a0: 65 6c 62 61 2d 63 68 6f 72 6f 70 6c 65 74 68 2e  elba-choropleth.
51b0: 70 6e 67 22 20 61 6c 74 3d 22 65 6c 62 61 2d 63  png" alt="elba-c
51c0: 68 6f 72 6f 70 6c 65 74 68 22 3e 0d 0a 3c 2f 74  horopleth">..</t
51d0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65  d></tr>..</table
51e0: 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 61 20  ><br>..<hr>..<a 
51f0: 6e 61 6d 65 3d 22 41 64 6d 69 6e 69 73 74 72 61  name="Administra
5200: 74 69 76 65 2d 4c 65 76 65 6c 73 22 3e 0d 0a 3c  tive-Levels">..<
5210: 68 33 3e 42 75 69 6c 64 69 6e 67 20 61 20 66 75  h3>Building a fu
5220: 6c 6c 20 68 69 65 72 61 72 63 68 79 20 6f 66 20  ll hierarchy of 
5230: 41 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20 4c  Administrative L
5240: 65 76 65 6c 73 20 62 79 20 53 51 4c 20 73 74 61  evels by SQL sta
5250: 74 65 6d 65 6e 74 73 3c 2f 68 33 3e 3c 2f 61 3e  tements</h3></a>
5260: 0d 0a 41 73 20 77 65 27 76 65 20 61 6c 72 65 61  ..As we've alrea
5270: 64 79 20 73 65 65 6e 20 62 65 66 6f 72 65 20 77  dy seen before w
5280: 65 20 61 72 65 20 6e 6f 77 20 65 78 70 65 63 74  e are now expect
5290: 65 64 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20 73  ed to complete s
52a0: 6f 6d 65 77 61 79 20 74 68 65 20 54 6f 70 6f 46  omeway the TopoF
52b0: 65 61 74 75 72 65 73 20 64 65 66 69 6e 69 74 69  eatures definiti
52c0: 6f 6e 73 20 73 75 70 70 6f 72 74 69 6e 67 20 74  ons supporting t
52d0: 68 65 20 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20  he <b>Populated 
52e0: 50 6c 61 63 65 73 3c 2f 62 3e 2c 20 3c 62 3e 4d  Places</b>, <b>M
52f0: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62  unicipalities</b
5300: 3e 2c 20 3c 62 3e 50 72 6f 76 69 6e 63 65 73 3c  >, <b>Provinces<
5310: 2f 62 3e 20 61 6e 64 20 3c 62 3e 52 65 67 69 6f  /b> and <b>Regio
5320: 6e 3c 2f 62 3e 20 54 6f 70 6f 4c 61 79 65 72 73  n</b> TopoLayers
5330: 20 77 65 27 76 65 20 70 72 65 76 69 6f 75 73 6c   we've previousl
5340: 79 20 63 72 65 61 74 65 64 20 62 79 20 63 61 6c  y created by cal
5350: 6c 69 6e 67 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f  ling <b>TopoGeo_
5360: 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c  InitTopoLayer()<
5370: 2f 62 3e 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 48 61  /b>.<br><br>..Ha
5380: 70 70 69 6c 79 20 65 6e 6f 75 67 68 20 61 6c 6c  ppily enough all
5390: 20 74 68 65 73 65 20 61 64 6d 69 6e 69 73 74 72   these administr
53a0: 61 74 69 76 65 20 6c 65 76 65 6c 73 20 61 72 65  ative levels are
53b0: 20 73 69 6d 70 6c 79 20 62 61 73 65 64 20 6f 6e   simply based on
53c0: 20 64 69 72 65 63 74 20 61 67 67 72 65 67 61 74   direct aggregat
53d0: 69 6f 6e 73 20 6f 66 20 3c 62 3e 43 65 6e 73 75  ions of <b>Censu
53e0: 73 20 41 72 65 61 73 3c 2f 62 3e 2c 20 73 6f 20  s Areas</b>, so 
53f0: 77 65 20 6a 75 73 74 20 68 61 76 65 20 74 6f 20  we just have to 
5400: 65 78 65 63 75 74 65 20 66 65 77 20 61 70 70 72  execute few appr
5410: 6f 70 72 69 61 74 65 20 53 51 4c 20 73 74 61 74  opriate SQL stat
5420: 65 6d 65 6e 74 73 2e 0d 0a 3c 76 65 72 62 61 74  ements...<verbat
5430: 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f  im>..INSERT INTO
5440: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f   census2011_topo
5450: 66 65 61 74 75 72 65 73 0d 0a 53 45 4c 45 43 54  features..SELECT
5460: 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64   NULL, c.node_id
5470: 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20 63 2e 66  , c.edge_id, c.f
5480: 61 63 65 5f 69 64 2c 20 32 2c 20 61 2e 66 69 64  ace_id, 2, a.fid
5490: 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31  ..FROM census201
54a0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32  1_topofeatures_2
54b0: 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73   AS a..JOIN cens
54c0: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75  us2011_topofeatu
54d0: 72 65 73 5f 31 20 41 53 20 62 20 4f 4e 20 28 62  res_1 AS b ON (b
54e0: 2e 63 6f 64 5f 70 70 6c 20 3d 20 61 2e 63 6f 64  .cod_ppl = a.cod
54f0: 5f 70 70 6c 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73  _ppl)..JOIN cens
5500: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75  us2011_topofeatu
5510: 72 65 73 20 41 53 20 63 20 4f 4e 20 28 63 2e 74  res AS c ON (c.t
5520: 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 31 20  opolayer_id = 1 
5530: 41 4e 44 20 63 2e 66 69 64 20 3d 20 62 2e 66 69  AND c.fid = b.fi
5540: 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  d);..</verbatim>
5550: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63  ..<ul>..<li><b>c
5560: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
5570: 61 74 75 72 65 73 5f 31 3c 2f 62 3e 20 69 73 20  atures_1</b> is 
5580: 74 68 65 20 54 6f 70 6f 46 65 61 74 75 72 65 73  the TopoFeatures
5590: 20 74 61 62 6c 65 20 63 6f 72 72 65 73 70 6f 6e   table correspon
55a0: 64 69 6e 67 20 74 6f 20 3c 62 3e 43 65 6e 73 75  ding to <b>Censu
55b0: 73 20 41 72 65 61 73 3c 2f 62 3e 2e 3c 2f 6c 69  s Areas</b>.</li
55c0: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 65 6e 73 75 73  >..<li><b>census
55d0: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
55e0: 73 5f 32 3c 2f 62 3e 20 69 73 20 74 68 65 20 63  s_2</b> is the c
55f0: 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 3c 62  orresponds to <b
5600: 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65  >Populated Place
5610: 73 3c 2f 62 3e 3b 20 74 68 65 20 63 6c 61 75 73  s</b>; the claus
5620: 65 20 3c 62 3e 62 2e 63 6f 64 5f 70 70 6c 20 3d  e <b>b.cod_ppl =
5630: 20 61 2e 63 6f 64 5f 70 70 6c 3c 2f 62 3e 20 77   a.cod_ppl</b> w
5640: 69 6c 6c 20 72 65 6c 61 74 69 6f 6e 61 6c 6c 79  ill relationally
5650: 20 6a 6f 69 6e 20 65 61 63 68 20 50 6f 70 75 6c   join each Popul
5660: 61 74 65 64 20 50 6c 61 63 65 20 74 6f 20 69 74  ated Place to it
5670: 73 20 75 6e 64 65 72 6c 61 79 69 6e 67 20 43 65  s underlaying Ce
5680: 6e 73 75 73 20 41 72 65 61 73 2e 3c 2f 6c 69 3e  nsus Areas.</li>
5690: 0d 0a 3c 6c 69 3e 73 6f 20 77 65 20 63 61 6e 20  ..<li>so we can 
56a0: 64 75 6c 79 20 69 6e 73 65 72 74 20 69 6e 74 6f  duly insert into
56b0: 20 74 68 65 20 3c 62 3e 54 6f 70 6f 46 65 61 74   the <b>TopoFeat
56c0: 75 72 65 73 2d 67 65 6f 6d 65 74 72 79 3c 2f 62  ures-geometry</b
56d0: 3e 20 74 61 62 6c 65 20 28 69 2e 65 2e 20 3c 69  > table (i.e. <i
56e0: 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f  >census2011_topo
56f0: 66 65 61 74 75 72 65 73 3c 2f 69 3e 29 20 61 20  features</i>) a 
5700: 6e 65 77 20 6c 65 76 65 6c 20 6f 66 20 72 65 66  new level of ref
5710: 65 72 65 6e 63 65 73 20 74 6f 20 54 6f 70 6f 6c  erences to Topol
5720: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 62  ogy primitives b
5730: 79 20 73 69 6d 70 6c 79 20 63 6f 70 79 69 6e 67  y simply copying
5740: 20 61 6c 6c 20 64 65 66 69 6e 69 74 69 6f 6e 73   all definitions
5750: 20 61 6c 72 65 61 64 79 20 73 74 6f 72 65 64 20   already stored 
5760: 69 6e 74 6f 20 74 68 65 20 70 72 65 76 69 6f 75  into the previou
5770: 73 20 68 69 65 72 61 72 63 68 69 63 61 6c 20 6c  s hierarchical l
5780: 65 76 65 6c 2e 3c 62 72 3e 0d 0a 41 6e 64 20 74  evel.<br>..And t
5790: 6f 20 64 6f 20 73 75 63 68 20 61 20 74 68 69 6e  o do such a thin
57a0: 67 20 77 65 20 73 69 6d 70 6c 79 20 68 61 76 65  g we simply have
57b0: 20 74 6f 20 72 65 61 64 20 66 72 6f 6d 20 3c 62   to read from <b
57c0: 3e 74 6f 70 6f 6c 61 79 65 72 3d 31 3c 2f 62 3e  >topolayer=1</b>
57d0: 20 74 68 65 6e 20 69 6e 73 65 72 74 69 6e 67 20   then inserting 
57e0: 69 6e 74 6f 20 3c 62 3e 74 6f 70 6f 6c 61 79 65  into <b>topolaye
57f0: 72 3d 32 3c 2f 62 3e 20 61 66 74 65 72 20 73 65  r=2</b> after se
5800: 74 74 69 6e 67 20 74 68 65 20 61 70 70 72 6f 70  tting the approp
5810: 72 69 61 74 65 20 3c 62 3e 66 69 64 3c 2f 62 3e  riate <b>fid</b>
5820: 20 76 61 6c 75 65 73 2e 3c 62 72 3e 0d 0a 52 65   values.<br>..Re
5830: 61 6c 6c 79 20 6e 6f 74 20 61 20 64 69 66 66 69  ally not a diffi
5840: 63 75 6c 74 20 74 61 73 6b 2e 3c 2f 6c 69 3e 0d  cult task.</li>.
5850: 0a 3c 2f 75 6c 3e 0d 0a 3c 76 65 72 62 61 74 69  .</ul>..<verbati
5860: 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20  m>..INSERT INTO 
5870: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66  census2011_topof
5880: 65 61 74 75 72 65 73 0d 0a 53 45 4c 45 43 54 20  eatures..SELECT 
5890: 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c  NULL, c.node_id,
58a0: 20 63 2e 65 64 67 65 5f 69 64 2c 20 63 2e 66 61   c.edge_id, c.fa
58b0: 63 65 5f 69 64 2c 20 33 2c 20 61 2e 66 69 64 0d  ce_id, 3, a.fid.
58c0: 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31  .FROM census2011
58d0: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 33 20  _topofeatures_3 
58e0: 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75  AS a..JOIN censu
58f0: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
5900: 65 73 5f 31 20 41 53 20 62 20 4f 4e 20 28 62 2e  es_1 AS b ON (b.
5910: 63 6f 64 5f 63 6f 6d 20 3d 20 61 2e 63 6f 64 5f  cod_com = a.cod_
5920: 63 6f 6d 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75  com)..JOIN censu
5930: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
5940: 65 73 20 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f  es AS c ON (c.to
5950: 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 31 20 41  polayer_id = 1 A
5960: 4e 44 20 63 2e 66 69 64 20 3d 20 62 2e 66 69 64  ND c.fid = b.fid
5970: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d  );..</verbatim>.
5980: 0a 57 65 20 63 61 6e 20 61 64 6f 70 74 20 65 78  .We can adopt ex
5990: 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 20 69  actly the same i
59a0: 64 65 6e 74 69 63 61 6c 20 61 70 70 72 6f 61 63  dentical approac
59b0: 68 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f  h in order to co
59c0: 6d 70 6c 65 74 65 20 3c 62 3e 74 6f 70 6f 6c 61  mplete <b>topola
59d0: 79 65 72 3d 33 3c 2f 62 3e 20 63 6f 72 72 65 73  yer=3</b> corres
59e0: 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 4d 75  ponding to <b>Mu
59f0: 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e  nicipalities</b>
5a00: 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49  ...<verbatim>..I
5a10: 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 75  NSERT INTO censu
5a20: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
5a30: 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c  es..SELECT NULL,
5a40: 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64   c.node_id, c.ed
5a50: 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 64  ge_id, c.face_id
5a60: 2c 20 34 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d  , 4, a.fid..FROM
5a70: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f   census2011_topo
5a80: 66 65 61 74 75 72 65 73 5f 34 20 41 53 20 61 0d  features_4 AS a.
5a90: 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31  .JOIN census2011
5aa0: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 33 20  _topofeatures_3 
5ab0: 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 70  AS b ON (b.cod_p
5ac0: 72 6f 76 20 3d 20 61 2e 63 6f 64 5f 70 72 6f 76  rov = a.cod_prov
5ad0: 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30  )..JOIN census20
5ae0: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20  11_topofeatures 
5af0: 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c  AS c ON (c.topol
5b00: 61 79 65 72 5f 69 64 20 3d 20 33 20 41 4e 44 20  ayer_id = 3 AND 
5b10: 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d  c.fid = b.fid);.
5b20: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 4d 6f  .</verbatim>..Mo
5b30: 72 65 20 6f 72 20 6c 65 73 73 20 74 68 65 20 73  re or less the s
5b40: 61 6d 65 20 69 73 20 66 6f 72 20 64 65 72 69 76  ame is for deriv
5b50: 69 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72  ing <b>topolayer
5b60: 3d 34 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e  =4</b> correspon
5b70: 64 69 6e 67 20 74 6f 20 3c 62 3e 50 72 6f 76 69  ding to <b>Provi
5b80: 6e 63 65 73 3c 2f 62 3e 3b 20 74 68 69 73 20 74  nces</b>; this t
5b90: 69 6d 65 20 77 65 27 6c 6c 20 73 69 6d 70 6c 79  ime we'll simply
5ba0: 20 61 67 67 72 65 67 61 74 65 20 74 68 65 20 75   aggregate the u
5bb0: 6e 64 65 72 6c 79 69 6e 67 20 4d 75 6e 69 63 69  nderlying Munici
5bc0: 70 61 6c 69 74 69 65 73 20 66 72 6f 6d 20 3c 62  palities from <b
5bd0: 3e 74 6f 70 6f 6c 61 79 65 72 3d 33 3c 2f 62 3e  >topolayer=3</b>
5be0: 2e 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  ...</verbatim>..
5bf0: 57 65 20 63 61 6e 20 61 64 6f 70 74 20 65 78 61  We can adopt exa
5c00: 63 74 6c 79 20 74 68 65 20 73 61 6d 65 20 69 64  ctly the same id
5c10: 65 6e 74 69 63 61 6c 20 61 70 70 72 6f 61 63 68  entical approach
5c20: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f 6d   in order to com
5c30: 70 6c 65 74 65 20 3c 62 3e 74 6f 70 6f 6c 61 79  plete <b>topolay
5c40: 65 72 3d 33 3c 2f 62 3e 20 63 6f 72 72 65 73 70  er=3</b> corresp
5c50: 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 4d 75 6e  onding to <b>Mun
5c60: 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2e  icipalities</b>.
5c70: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49 4e  ..<verbatim>..IN
5c80: 53 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 75 73  SERT INTO census
5c90: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
5ca0: 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20  s..SELECT NULL, 
5cb0: 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64 67  c.node_id, c.edg
5cc0: 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 64 2c  e_id, c.face_id,
5cd0: 20 35 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20   5, a.fid..FROM 
5ce0: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66  census2011_topof
5cf0: 65 61 74 75 72 65 73 5f 35 20 41 53 20 61 0d 0a  eatures_5 AS a..
5d00: 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f  JOIN census2011_
5d10: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 20 41  topofeatures_4 A
5d20: 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 72 65  S b ON (b.cod_re
5d30: 67 20 3d 20 61 2e 63 6f 64 5f 72 65 67 29 0d 0a  g = a.cod_reg)..
5d40: 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f  JOIN census2011_
5d50: 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 53 20  topofeatures AS 
5d60: 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 61 79 65  c ON (c.topolaye
5d70: 72 5f 69 64 20 3d 20 34 20 41 4e 44 20 63 2e 66  r_id = 4 AND c.f
5d80: 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f  id = b.fid);..</
5d90: 76 65 72 62 61 74 69 6d 3e 0d 0a 41 6e 64 20 66  verbatim>..And f
5da0: 69 6e 61 6c 6c 79 20 77 65 20 63 61 6e 20 64 65  inally we can de
5db0: 72 69 76 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65  rive <b>topolaye
5dc0: 72 3d 35 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f  r=5</b> correspo
5dd0: 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 52 65 67 69  nding to <b>Regi
5de0: 6f 6e 73 3c 2f 62 3e 20 62 79 20 64 69 72 65 63  ons</b> by direc
5df0: 74 6c 79 20 61 67 67 72 65 67 61 74 69 6e 67 20  tly aggregating 
5e00: 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 50  the underlying P
5e10: 72 6f 76 69 6e 63 65 73 20 66 72 6f 6d 20 3c 62  rovinces from <b
5e20: 3e 74 6f 70 6f 6c 61 79 65 72 3d 34 3c 2f 62 3e  >topolayer=4</b>
5e30: 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61  ...<br><br>..<ta
5e40: 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 22  ble width="100%"
5e50: 20 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63    cellspan="4" c
5e60: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62  ellpadding="6" b
5e70: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22  gcolor="#f8f8f0"
5e80: 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74   border="1">..<t
5e90: 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20  r><td>..<b>step 
5ea0: 23 31 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 68  #1: exporting th
5eb0: 65 20 52 65 67 69 6f 6e 20 54 6f 70 6f 4c 61 79  e Region TopoLay
5ec0: 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69  er</b>..<verbati
5ed0: 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47  m>..SELECT TopoG
5ee0: 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79  eo_ExportTopoLay
5ef0: 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c  er('census2011',
5f00: 20 27 72 65 67 27 2c 20 27 6f 75 74 5f 72 65 67   'reg', 'out_reg
5f10: 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76  _2011', 1);..</v
5f20: 65 72 62 61 74 69 6d 3e 0d 0a 57 65 20 61 72 65  erbatim>..We are
5f30: 20 6e 6f 77 20 64 65 66 69 6e 69 74 65 6c 79 20   now definitely 
5f40: 72 65 61 64 79 20 74 6f 20 65 78 70 6f 72 74 20  ready to export 
5f50: 61 6e 79 20 6f 74 68 65 72 20 41 64 6d 69 6e 69  any other Admini
5f60: 73 74 72 61 74 69 76 65 20 4c 65 76 65 6c 2e 3c  strative Level.<
5f70: 62 72 3e 0d 0a 46 6f 72 20 74 68 65 20 73 61 6b  br>..For the sak
5f80: 65 20 6f 66 20 63 6c 61 72 69 74 79 20 77 65 27  e of clarity we'
5f90: 6c 6c 20 66 6f 6c 6c 6f 77 20 61 20 74 6f 70 2d  ll follow a top-
5fa0: 62 6f 74 74 6f 6d 20 6f 72 64 65 72 2c 20 73 6f  bottom order, so
5fb0: 20 77 65 27 6c 6c 20 73 74 61 72 74 20 62 79 20   we'll start by 
5fc0: 65 78 70 6f 72 74 69 6e 67 20 66 69 72 73 74 20  exporting first 
5fd0: 74 68 65 20 77 68 6f 6c 65 20 54 75 73 63 61 6e  the whole Tuscan
5fe0: 79 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c  y...</td><td>..<
5ff0: 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f  img src="https:/
6000: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74  /www.gaia-gis.it
6010: 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66  /gaia-sins/topof
6020: 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 72 65  igs/topolayer-re
6030: 67 69 6f 6e 2e 70 6e 67 22 20 61 6c 74 3d 22 74  gion.png" alt="t
6040: 6f 70 6f 6c 61 79 65 72 2d 72 65 67 69 6f 6e 22  opolayer-region"
6050: 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  >..</td></tr>..<
6060: 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70  tr><td>..<b>step
6070: 20 23 32 3a 20 65 78 70 6f 72 74 69 6e 67 20 74   #2: exporting t
6080: 68 65 20 50 72 6f 76 69 6e 63 65 73 20 54 6f 70  he Provinces Top
6090: 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72  oLayer</b>..<ver
60a0: 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54  batim>..SELECT T
60b0: 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70  opoGeo_ExportTop
60c0: 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30  oLayer('census20
60d0: 31 31 27 2c 20 27 70 72 6f 76 27 2c 20 27 6f 75  11', 'prov', 'ou
60e0: 74 5f 70 72 6f 76 5f 32 30 31 31 27 2c 20 31 29  t_prov_2011', 1)
60f0: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  ;..</verbatim>..
6100: 57 65 27 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 62  We'll continue b
6110: 79 20 65 78 70 6f 72 74 69 6e 67 20 61 6c 6c 20  y exporting all 
6120: 74 68 65 20 54 75 73 63 61 6e 79 20 50 72 6f 76  the Tuscany Prov
6130: 69 6e 63 65 73 2e 0d 0a 3c 2f 74 64 3e 3c 74 64  inces...</td><td
6140: 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74  >..<img src="htt
6150: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69  ps://www.gaia-gi
6160: 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74  s.it/gaia-sins/t
6170: 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65  opofigs/topolaye
6180: 72 2d 70 72 6f 76 69 6e 63 65 73 2e 70 6e 67 22  r-provinces.png"
6190: 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d   alt="topolayer-
61a0: 70 72 6f 76 69 6e 63 65 73 22 3e 0d 0a 3c 2f 74  provinces">..</t
61b0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
61c0: 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 33 3a 20 65  >..<b>step #3: e
61d0: 78 70 6f 72 74 69 6e 67 20 74 68 65 20 4d 75 6e  xporting the Mun
61e0: 69 63 69 70 61 6c 69 74 69 65 73 20 54 6f 70 6f  icipalities Topo
61f0: 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62  Layer</b>..<verb
6200: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f  atim>..SELECT To
6210: 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f  poGeo_ExportTopo
6220: 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31  Layer('census201
6230: 31 27 2c 20 27 63 6f 6d 27 2c 20 27 6f 75 74 5f  1', 'com', 'out_
6240: 63 6f 6d 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a  com_2011', 1);..
6250: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65  </verbatim>..The
6260: 6e 20 77 65 27 6c 6c 20 65 78 70 6f 72 74 20 61  n we'll export a
6270: 6c 6c 20 74 68 65 20 54 75 73 63 61 6e 79 20 4d  ll the Tuscany M
6280: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2e 3c 62  unicipalities.<b
6290: 72 3e 0d 0a 46 6f 72 20 62 65 74 74 65 72 20 63  r>..For better c
62a0: 6c 61 72 69 74 79 20 74 68 65 20 66 69 67 75 72  larity the figur
62b0: 65 20 73 68 6f 77 73 20 61 20 6d 61 67 6e 69 66  e shows a magnif
62c0: 69 65 64 20 64 65 74 61 69 6c 20 63 65 6e 74 65  ied detail cente
62d0: 72 65 64 20 61 72 6f 75 6e 64 20 74 68 65 20 49  red around the I
62e0: 73 6c 61 6e 64 20 6f 66 20 45 6c 62 61 2e 0d 0a  sland of Elba...
62f0: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20  </td><td>..<img 
6300: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77  src="https://www
6310: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69  .gaia-gis.it/gai
6320: 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f  a-sins/topofigs/
6330: 74 6f 70 6f 6c 61 79 65 72 2d 6d 75 6e 69 63 69  topolayer-munici
6340: 70 61 6c 69 74 69 65 73 2e 70 6e 67 22 20 61 6c  palities.png" al
6350: 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d 6d 75 6e  t="topolayer-mun
6360: 69 63 69 70 61 6c 69 74 69 65 73 22 3e 0d 0a 3c  icipalities">..<
6370: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c  /td></tr>..<tr><
6380: 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 34 3a  td>..<b>step #4:
6390: 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20 50   exporting the P
63a0: 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73 20  opulated Places 
63b0: 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c  TopoLayer</b>..<
63c0: 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43  verbatim>..SELEC
63d0: 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74  T TopoGeo_Export
63e0: 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75  TopoLayer('censu
63f0: 73 32 30 31 31 27 2c 20 27 70 70 6c 27 2c 20 27  s2011', 'ppl', '
6400: 6f 75 74 5f 70 70 6c 5f 32 30 31 31 27 2c 20 31  out_ppl_2011', 1
6410: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d  );..</verbatim>.
6420: 0a 41 6e 64 20 77 65 27 6c 6c 20 66 69 6e 61 6c  .And we'll final
6430: 6c 79 20 65 78 70 6f 72 74 20 61 6c 6c 20 50 6f  ly export all Po
6440: 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73 2e 3c  pulated Places.<
6450: 62 72 3e 3c 62 72 3e 3c 62 72 3e 3c 62 72 3e 0d  br><br><br><br>.
6460: 0a 3c 75 3e 43 6f 6e 63 6c 75 73 69 6f 6e 3c 2f  .<u>Conclusion</
6470: 75 3e 3a 20 77 65 20 73 74 61 72 74 65 64 20 74  u>: we started t
6480: 68 69 73 20 61 64 76 61 6e 63 65 64 20 74 75 74  his advanced tut
6490: 6f 72 69 61 6c 20 62 79 20 69 6d 70 6f 72 74 69  orial by importi
64a0: 6e 67 20 69 6e 74 6f 20 61 20 54 6f 70 6f 6c 6f  ng into a Topolo
64b0: 67 79 20 6a 75 73 74 20 61 20 73 69 6e 67 6c 65  gy just a single
64c0: 20 6c 61 79 65 72 20 28 43 65 6e 73 75 73 20 41   layer (Census A
64d0: 72 65 61 73 29 20 61 6e 64 20 6e 6f 77 20 77 65  reas) and now we
64e0: 27 76 65 20 66 69 6e 69 73 68 65 64 20 62 79 20  've finished by 
64f0: 70 72 6f 64 75 63 69 6e 67 20 61 20 63 6f 6d 70  producing a comp
6500: 6c 65 74 65 20 73 65 74 20 6f 66 20 61 64 6d 69  lete set of admi
6510: 6e 69 73 74 72 61 74 69 76 65 20 62 6f 75 6e 64  nistrative bound
6520: 61 72 69 65 73 20 61 74 20 64 69 66 66 65 72 65  aries at differe
6530: 6e 74 20 68 69 65 72 61 72 63 68 69 63 61 6c 20  nt hierarchical 
6540: 6c 65 76 65 6c 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c  levels:..<ul>..<
6550: 6c 69 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c 61  li>Populated Pla
6560: 63 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 4d 75  ces</li>..<li>Mu
6570: 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 6c 69  nicipalities</li
6580: 3e 0d 0a 3c 6c 69 3e 50 72 6f 76 69 6e 63 65 73  >..<li>Provinces
6590: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 52 65 67 69 6f  </li>..<li>Regio
65a0: 6e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c  n</li>..</ul>..<
65b0: 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73  /td><td>..<img s
65c0: 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e  rc="https://www.
65d0: 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61  gaia-gis.it/gaia
65e0: 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74  -sins/topofigs/t
65f0: 6f 70 6f 6c 61 79 65 72 2d 70 6f 70 75 6c 61 74  opolayer-populat
6600: 65 64 2d 70 6c 61 63 65 73 2e 70 6e 67 22 20 61  ed-places.png" a
6610: 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d 70 6f  lt="topolayer-po
6620: 70 75 6c 61 74 65 64 2d 70 6c 61 63 65 73 22 3e  pulated-places">
6630: 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f  ..</td></tr>..</
6640: 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e  table><br>..<hr>
6650: 0d 0a 3c 61 20 6e 61 6d 65 3d 22 6f 6c 64 2d 6e  ..<a name="old-n
6660: 65 77 2d 4d 75 6e 69 63 69 70 61 6c 69 74 69 65  ew-Municipalitie
6670: 73 22 3e 0d 0a 3c 68 33 3e 52 65 63 65 6e 74 20  s">..<h3>Recent 
6680: 63 68 61 6e 67 65 73 3a 20 6f 6c 64 20 4d 75 6e  changes: old Mun
6690: 69 63 69 70 61 6c 69 74 69 65 73 20 6d 65 72 67  icipalities merg
66a0: 69 6e 67 20 69 6e 74 6f 20 6e 65 77 20 4d 75 6e  ing into new Mun
66b0: 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 68 33 3e  icipalities</h3>
66c0: 3c 2f 61 3e 0d 0a 49 66 20 79 6f 75 20 72 65 6d  </a>..If you rem
66d0: 65 6d 62 65 72 20 74 68 65 20 69 6e 69 74 69 61  ember the initia
66e0: 6c 20 3c 62 3e 74 75 73 63 61 6e 79 2d 63 65 6e  l <b>tuscany-cen
66f0: 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 74 65 3c  sus-2011.sqlite<
6700: 2f 62 3e 20 44 42 2d 66 69 6c 65 20 63 6f 6e 74  /b> DB-file cont
6710: 61 69 6e 73 20 61 20 3c 62 3e 63 6f 6d 5f 32 30  ains a <b>com_20
6720: 31 34 5f 31 35 3c 2f 62 3e 20 54 61 62 6c 65 3b  14_15</b> Table;
6730: 20 64 75 72 69 6e 67 20 79 65 61 72 73 20 32 30   during years 20
6740: 31 34 20 61 6e 64 20 32 30 31 35 20 66 65 77 20  14 and 2015 few 
6750: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20 6d  Municipalities m
6760: 65 72 67 65 64 20 74 77 6f 20 62 79 20 74 77 6f  erged two by two
6770: 20 74 68 75 73 20 67 69 76 69 6e 67 20 62 69 72   thus giving bir
6780: 74 68 20 74 6f 20 6e 65 77 20 4d 75 6e 69 63 69  th to new Munici
6790: 70 61 6c 69 74 69 65 73 2e 20 54 68 69 73 20 69  palities. This i
67a0: 73 20 74 68 65 20 66 75 6c 6c 20 6c 69 73 74 3a  s the full list:
67b0: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65  <br><br>..<table
67c0: 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65   cellspan="4" ce
67d0: 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67  llpadding="6" bg
67e0: 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20  color="#f8f8f0" 
67f0: 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72  border="1">..<tr
6800: 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 33 22  ><td colspan="3"
6810: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 20   align="center" 
6820: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38  bgcolor="#f0f0f8
6830: 22 3e 3c 62 3e 4e 65 77 20 4d 75 6e 69 63 69 70  "><b>New Municip
6840: 61 6c 69 74 79 20 28 32 30 31 34 2f 31 35 29 3c  ality (2014/15)<
6850: 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 63 6f 6c 73  /b></td><td cols
6860: 70 61 6e 3d 22 32 22 20 61 6c 69 67 6e 3d 22 63  pan="2" align="c
6870: 65 6e 74 65 72 22 20 20 62 67 63 6f 6c 6f 72 3d  enter"  bgcolor=
6880: 22 23 66 30 66 38 66 38 22 3e 3c 62 3e 73 75 70  "#f0f8f8"><b>sup
6890: 70 72 65 73 73 65 64 20 23 31 3c 2f 62 3e 3c 2f  pressed #1</b></
68a0: 74 64 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22  td><td colspan="
68b0: 32 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72  2" align="center
68c0: 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30  " bgcolor="#f8f0
68d0: 66 38 22 3e 3c 62 3e 73 75 70 70 72 65 73 73 65  f8"><b>suppresse
68e0: 64 20 23 32 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74  d #2</b></td></t
68f0: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f  r>..<tr><td bgco
6900: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62  lor="#f0f0f8"><b
6910: 3e 63 6f 64 5f 70 72 6f 76 3c 2f 62 3e 3c 2f 74  >cod_prov</b></t
6920: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  d><td bgcolor="#
6930: 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 63  f0f0f8"><b>cod_c
6940: 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62  om</b></td><td b
6950: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22  gcolor="#f0f0f8"
6960: 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64  ><b>name</b></td
6970: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6980: 30 66 38 66 38 22 3e 3c 62 3e 63 6f 64 5f 63 6f  0f8f8"><b>cod_co
6990: 6d 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 67  m</b></td><td bg
69a0: 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e  color="#f0f8f8">
69b0: 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e  <b>name</b></td>
69c0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  <td bgcolor="#f8
69d0: 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 63 6f 6d  f0f8"><b>cod_com
69e0: 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63  </b></td><td bgc
69f0: 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 3c  olor="#f8f0f8"><
6a00: 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 3c  b>name</b></td><
6a10: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 41 52  /tr>..<tr><td>AR
6a20: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
6a30: 72 69 67 68 74 22 3e 35 31 30 34 30 3c 2f 74 64  right">51040</td
6a40: 3e 3c 74 64 3e 43 61 73 74 65 6c 66 72 61 6e 63  ><td>Castelfranc
6a50: 6f 20 50 69 61 6e 64 69 73 63 c3 b2 3c 2f 74 64  o Piandisc..</td
6a60: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6a70: 30 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 69  0f8f8" align="ri
6a80: 67 68 74 22 3e 35 31 30 30 39 3c 2f 74 64 20 62  ght">51009</td b
6a90: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22  gcolor="#f0f8f8"
6aa0: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6ab0: 30 66 38 66 38 22 3e 43 61 73 74 65 6c 66 72 61  0f8f8">Castelfra
6ac0: 6e 63 6f 20 64 69 20 53 6f 70 72 61 3c 2f 74 64  nco di Sopra</td
6ad0: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6ae0: 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22 72 69  8f0f8" align="ri
6af0: 67 68 74 22 3e 35 31 30 32 39 3c 2f 74 64 3e 3c  ght">51029</td><
6b00: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66  td bgcolor="#f8f
6b10: 30 66 38 22 3e 50 69 61 6e 20 64 69 20 53 63 6f  0f8">Pian di Sco
6b20: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
6b30: 3c 74 64 3e 41 52 3c 2f 74 64 3e 3c 74 64 20 61  <td>AR</td><td a
6b40: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30  lign="right">510
6b50: 34 31 3c 2f 74 64 3e 3c 74 64 3e 50 72 61 74 6f  41</td><td>Prato
6b60: 76 65 63 63 68 69 6f 20 53 74 69 61 3c 2f 74 64  vecchio Stia</td
6b70: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6b80: 30 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 69  0f8f8" align="ri
6b90: 67 68 74 22 3e 35 31 30 33 32 3c 2f 74 64 3e 3c  ght">51032</td><
6ba0: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
6bb0: 38 66 38 22 3e 50 72 61 74 6f 76 65 63 63 68 69  8f8">Pratovecchi
6bc0: 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f  o</td><td bgcolo
6bd0: 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69 67  r="#f8f0f8" alig
6be0: 6e 3d 22 72 69 67 68 74 22 3e 35 31 30 33 36 3c  n="right">51036<
6bf0: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
6c00: 22 23 66 38 66 30 66 38 22 3e 53 74 69 61 3c 2f  "#f8f0f8">Stia</
6c10: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74  td></tr>..<tr><t
6c20: 64 3e 46 49 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  d>FI</td><td ali
6c30: 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 30 35 32  gn="right">48052
6c40: 3c 2f 74 64 3e 3c 74 64 3e 46 69 67 6c 69 6e 65  </td><td>Figline
6c50: 20 65 20 49 6e 63 69 73 61 20 56 61 6c 64 61 72   e Incisa Valdar
6c60: 6e 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  no</td><td bgcol
6c70: 6f 72 3d 22 23 66 30 66 38 66 38 22 20 61 6c 69  or="#f0f8f8" ali
6c80: 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 30 31 36  gn="right">48016
6c90: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6ca0: 3d 22 23 66 30 66 38 66 38 22 3e 46 69 67 6c 69  ="#f0f8f8">Figli
6cb0: 6e 65 20 56 61 6c 64 61 72 6e 6f 3c 2f 74 64 3e  ne Valdarno</td>
6cc0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  <td bgcolor="#f8
6cd0: 66 30 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67  f0f8" align="rig
6ce0: 68 74 22 3e 34 38 30 32 33 3c 2f 74 64 3e 3c 74  ht">48023</td><t
6cf0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30  d bgcolor="#f8f0
6d00: 66 38 22 3e 49 6e 63 69 73 61 20 69 6e 20 56 61  f8">Incisa in Va
6d10: 6c 20 64 27 41 72 6e 6f 3c 2f 74 64 3e 3c 2f 74  l d'Arno</td></t
6d20: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 46 49 3c 2f  r>..<tr><td>FI</
6d30: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
6d40: 67 68 74 22 3e 34 38 30 35 33 3c 2f 74 64 3e 3c  ght">48053</td><
6d50: 74 64 3e 53 63 61 72 70 65 72 69 61 20 65 20 53  td>Scarperia e S
6d60: 61 6e 20 50 69 65 72 6f 3c 2f 74 64 3e 3c 74 64  an Piero</td><td
6d70: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66   bgcolor="#f0f8f
6d80: 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  8" align="right"
6d90: 3e 34 38 30 34 32 3c 2f 74 64 3e 3c 74 64 20 62  >48042</td><td b
6da0: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22  gcolor="#f0f8f8"
6db0: 3e 53 63 61 72 70 65 72 69 61 3c 2f 74 64 3e 3c  >Scarperia</td><
6dc0: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66  td bgcolor="#f8f
6dd0: 30 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68  0f8" align="righ
6de0: 74 22 3e 34 38 30 34 30 3c 2f 74 64 3e 3c 74 64  t">48040</td><td
6df0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66   bgcolor="#f8f0f
6e00: 38 22 3e 53 61 6e 20 50 69 65 72 6f 20 61 20 53  8">San Piero a S
6e10: 69 65 76 65 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  ieve</td></tr>..
6e20: 3c 74 72 3e 3c 74 64 3e 4c 55 3c 2f 74 64 3e 3c  <tr><td>LU</td><
6e30: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
6e40: 3e 34 36 30 33 36 3c 2f 74 64 3e 3c 74 64 3e 46  >46036</td><td>F
6e50: 61 62 62 72 69 63 68 65 20 64 69 20 56 65 72 67  abbriche di Verg
6e60: 65 6d 6f 6c 69 3c 2f 74 64 3e 3c 74 64 20 20 62  emoli</td><td  b
6e70: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22  gcolor="#f0f8f8"
6e80: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34   align="right">4
6e90: 36 30 31 32 3c 2f 74 64 3e 3c 74 64 20 62 67 63  6012</td><td bgc
6ea0: 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 46  olor="#f0f8f8">F
6eb0: 61 62 62 72 69 63 68 65 20 64 69 20 56 61 6c 6c  abbriche di Vall
6ec0: 69 63 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  ico</td><td bgco
6ed0: 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c  lor="#f8f0f8" al
6ee0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 36 30 33  ign="right">4603
6ef0: 32 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f  2</td><td bgcolo
6f00: 72 3d 22 23 66 38 66 30 66 38 22 3e 56 65 72 67  r="#f8f0f8">Verg
6f10: 65 6d 6f 6c 69 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  emoli</td></tr>.
6f20: 0a 3c 74 72 3e 3c 74 64 3e 4c 55 3c 2f 74 64 3e  .<tr><td>LU</td>
6f30: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
6f40: 22 3e 34 36 30 33 37 3c 2f 74 64 3e 3c 74 64 3e  ">46037</td><td>
6f50: 53 69 6c 6c 61 6e 6f 20 47 69 75 6e 63 75 67 6e  Sillano Giuncugn
6f60: 61 6e 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  ano</td><td bgco
6f70: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 61 6c 69  lor="#f0f8f8"ali
6f80: 67 6e 3d 22 72 69 67 68 74 22 3e 34 36 30 32 39  gn="right">46029
6f90: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6fa0: 3d 22 23 66 30 66 38 66 38 22 3e 53 69 6c 6c 61  ="#f0f8f8">Silla
6fb0: 6e 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  no</td><td bgcol
6fc0: 6f 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69  or="#f8f0f8" ali
6fd0: 67 6e 3d 22 72 69 67 68 74 22 3e 34 36 30 31 36  gn="right">46016
6fe0: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6ff0: 3d 22 23 66 38 66 30 66 38 22 3e 47 69 75 6e 63  ="#f8f0f8">Giunc
7000: 75 67 6e 61 6e 6f 3c 2f 74 64 3e 3c 2f 74 72 3e  ugnano</td></tr>
7010: 0d 0a 3c 74 72 3e 3c 74 64 3e 50 49 3c 2f 74 64  ..<tr><td>PI</td
7020: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
7030: 74 22 3e 35 30 30 35 30 3c 2f 74 64 3e 3c 74 64  t">50050</td><td
7040: 3e 43 61 73 63 69 61 6e 61 20 54 65 72 6d 65 20  >Casciana Terme 
7050: 4c 61 72 69 3c 2f 74 64 3e 3c 74 64 20 62 67 63  Lari</td><td bgc
7060: 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 20 61  olor="#f0f8f8" a
7070: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 30 30  lign="right">500
7080: 30 37 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  07</td><td bgcol
7090: 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 43 61 73  or="#f0f8f8">Cas
70a0: 63 69 61 6e 61 20 54 65 72 6d 65 3c 2f 74 64 3e  ciana Terme</td>
70b0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  <td bgcolor="#f8
70c0: 66 30 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67  f0f8" align="rig
70d0: 68 74 22 3e 35 30 30 31 37 3c 2f 74 64 3e 3c 74  ht">50017</td><t
70e0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30  d bgcolor="#f8f0
70f0: 66 38 22 3e 4c 61 72 69 3c 2f 74 64 3e 3c 2f 74  f8">Lari</td></t
7100: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 50 49 3c 2f  r>..<tr><td>PI</
7110: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
7120: 67 68 74 22 3e 35 30 30 34 31 3c 2f 74 64 3e 3c  ght">50041</td><
7130: 74 64 3e 43 72 65 73 70 69 6e 61 20 4c 6f 72 65  td>Crespina Lore
7140: 6e 7a 61 6e 61 3c 2f 74 64 3e 3c 74 64 20 62 67  nzana</td><td bg
7150: 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 20  color="#f0f8f8" 
7160: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 30  align="right">50
7170: 30 31 33 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  013</td><td bgco
7180: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 43 72  lor="#f0f8f8">Cr
7190: 65 73 70 69 6e 61 3c 2f 74 64 3e 3c 74 64 20 20  espina</td><td  
71a0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38  bgcolor="#f8f0f8
71b0: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  " align="right">
71c0: 35 30 30 31 38 3c 2f 74 64 3e 3c 74 64 20 62 67  50018</td><td bg
71d0: 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e  color="#f8f0f8">
71e0: 4c 6f 72 65 6e 7a 61 6e 61 3c 2f 74 64 3e 3c 2f  Lorenzana</td></
71f0: 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c  tr>..</table>..<
7200: 62 72 3e 0d 0a 53 75 63 68 20 63 68 61 6e 67 65  br>..Such change
7210: 73 20 73 69 6d 70 6c 79 20 61 66 66 65 63 74 73  s simply affects
7220: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3b   Municipalities;
7230: 20 50 72 6f 76 69 6e 63 65 73 20 61 72 65 20 75   Provinces are u
7240: 6e 61 66 66 65 63 74 65 64 20 62 79 20 74 68 69  naffected by thi
7250: 73 20 70 72 6f 63 65 73 73 3b 20 73 6f 20 77 65  s process; so we
7260: 20 63 61 6e 20 6e 6f 77 20 64 75 6c 79 20 67 65   can now duly ge
7270: 6e 65 72 61 74 65 20 61 20 66 75 72 74 68 65 72  nerate a further
7280: 20 6c 61 79 65 72 20 63 6f 72 72 65 73 70 6f 6e   layer correspon
7290: 64 69 6e 67 20 74 6f 20 32 30 31 35 20 4d 75 6e  ding to 2015 Mun
72a0: 69 63 69 70 61 6c 69 74 69 65 73 2c 20 61 6e 64  icipalities, and
72b0: 20 77 65 20 73 69 6d 70 6c 79 20 68 61 76 65 20   we simply have 
72c0: 74 6f 20 73 6c 69 67 68 74 6c 79 20 72 65 61 72  to slightly rear
72d0: 72 61 6e 67 65 20 74 68 65 20 54 6f 70 6f 4c 61  range the TopoLa
72e0: 79 65 72 73 2f 54 6f 70 6f 46 65 61 74 75 72 65  yers/TopoFeature
72f0: 73 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 69 6e  s definitions in
7300: 20 6f 72 64 65 72 20 74 6f 20 61 63 68 69 65 76   order to achiev
7310: 65 20 74 68 69 73 20 66 75 72 74 68 65 72 20 67  e this further g
7320: 6f 61 6c 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  oal...<verbatim>
7330: 0d 0a 41 54 54 41 43 48 20 44 41 54 41 42 41 53  ..ATTACH DATABAS
7340: 45 20 22 2e 2f 74 75 73 63 61 6e 79 2d 63 65 6e  E "./tuscany-cen
7350: 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 74 65 22  sus-2011.sqlite"
7360: 20 41 53 20 69 73 74 61 74 3b 0d 0a 0d 0a 43 52   AS istat;....CR
7370: 45 41 54 45 20 54 41 42 4c 45 20 63 6f 6d 32 30  EATE TABLE com20
7380: 31 35 20 41 53 0d 0a 53 45 4c 45 43 54 20 2a 20  15 AS..SELECT * 
7390: 46 52 4f 4d 20 69 73 74 61 74 2e 70 6f 70 5f 63  FROM istat.pop_c
73a0: 6f 6d 5f 32 30 31 31 3b 0d 0a 0d 0a 49 4e 53 45  om_2011;....INSE
73b0: 52 54 20 49 4e 54 4f 20 63 6f 6d 32 30 31 35 0d  RT INTO com2015.
73c0: 0a 53 45 4c 45 43 54 20 61 2e 63 6f 64 5f 63 6f  .SELECT a.cod_co
73d0: 6d 2c 20 61 2e 63 6f 64 5f 70 72 6f 76 2c 20 61  m, a.cod_prov, a
73e0: 2e 63 6f 64 5f 69 73 74 61 74 2c 20 61 2e 63 6f  .cod_istat, a.co
73f0: 64 5f 63 61 64 61 73 74 72 65 2c 20 61 2e 6e 61  d_cadastre, a.na
7400: 6d 65 2c 20 61 2e 74 6f 77 6e 68 61 6c 6c 5f 61  me, a.townhall_a
7410: 64 64 72 2c 0d 0a 20 20 20 20 53 75 6d 28 62 2e  ddr,..    Sum(b.
7420: 70 6f 70 5f 32 30 31 31 29 2c 20 53 75 6d 28 62  pop_2011), Sum(b
7430: 2e 6d 5f 32 30 31 31 29 2c 20 53 75 6d 28 62 2e  .m_2011), Sum(b.
7440: 66 5f 32 30 31 31 29 0d 0a 46 52 4f 4d 20 69 73  f_2011)..FROM is
7450: 74 61 74 2e 63 6f 6d 5f 32 30 31 34 5f 31 35 20  tat.com_2014_15 
7460: 41 53 20 61 0d 0a 4a 4f 49 4e 20 69 73 74 61 74  AS a..JOIN istat
7470: 2e 70 6f 70 5f 63 6f 6d 5f 32 30 31 31 20 41 53  .pop_com_2011 AS
7480: 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 63 6f 6d   b ON (b.cod_com
7490: 20 49 4e 20 28 61 2e 6f 6c 64 5f 63 6f 64 5f 63   IN (a.old_cod_c
74a0: 6f 6d 5f 31 2c 20 61 2e 6f 6c 64 5f 63 6f 64 5f  om_1, a.old_cod_
74b0: 63 6f 6d 5f 32 29 29 0d 0a 47 52 4f 55 50 20 42  com_2))..GROUP B
74c0: 59 20 61 2e 63 6f 64 5f 63 6f 6d 3b 0d 0a 0d 0a  Y a.cod_com;....
74d0: 44 45 54 41 43 48 20 44 41 54 41 42 41 53 45 20  DETACH DATABASE 
74e0: 69 73 74 61 74 3b 0d 0a 3c 2f 76 65 72 62 61 74  istat;..</verbat
74f0: 69 6d 3e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 77  im>..<ol>..<li>w
7500: 65 27 6c 6c 20 3c 69 3e 61 74 74 61 63 68 3c 2f  e'll <i>attach</
7510: 69 3e 20 79 65 74 20 61 6e 6f 74 68 65 72 20 74  i> yet another t
7520: 69 6d 65 20 74 68 65 20 69 6e 69 74 69 61 6c 20  ime the initial 
7530: 3c 62 3e 74 75 73 63 61 6e 79 2d 63 65 6e 73 75  <b>tuscany-censu
7540: 73 2d 32 30 31 31 2e 73 71 6c 69 74 65 3c 2f 62  s-2011.sqlite</b
7550: 3e 20 44 42 2d 66 69 6c 65 2e 3c 2f 6c 69 3e 0d  > DB-file.</li>.
7560: 0a 3c 6c 69 3e 77 65 27 6c 6c 20 63 72 65 61 74  .<li>we'll creat
7570: 65 20 61 20 6e 65 77 20 3c 62 3e 63 6f 6d 32 30  e a new <b>com20
7580: 31 35 3c 2f 62 3e 20 74 61 62 6c 65 20 62 79 20  15</b> table by 
7590: 6a 75 73 74 20 6a 75 73 74 20 63 6f 70 79 69 6e  just just copyin
75a0: 67 20 74 68 65 20 3c 62 3e 69 73 74 61 74 2e 70  g the <b>istat.p
75b0: 6f 70 5f 63 6f 6d 5f 32 30 31 31 3c 2f 62 3e 20  op_com_2011</b> 
75c0: 56 69 65 77 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  View.</li>..<li>
75d0: 61 6e 64 20 66 69 6e 61 6c 6c 79 20 77 65 27 6c  and finally we'l
75e0: 6c 20 61 70 70 65 6e 64 20 74 6f 20 74 68 65 20  l append to the 
75f0: 73 61 6d 65 20 74 61 62 6c 65 20 74 68 65 20 6e  same table the n
7600: 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65  ew Municipalitie
7610: 73 20 66 72 6f 6d 20 74 68 65 20 3c 62 3e 69 73  s from the <b>is
7620: 74 61 74 2e 63 6f 6d 5f 32 30 31 34 5f 31 35 3c  tat.com_2014_15<
7630: 2f 62 3e 20 74 61 62 6c 65 3b 20 64 75 72 69 6e  /b> table; durin
7640: 67 20 74 68 69 73 20 73 74 65 70 20 77 65 27 6c  g this step we'l
7650: 6c 20 63 6f 6d 70 75 74 65 20 74 68 65 20 50 6f  l compute the Po
7660: 70 75 6c 61 74 69 6f 6e 20 32 30 31 31 20 63 65  pulation 2011 ce
7670: 6e 73 75 73 20 76 61 6c 75 65 73 2e 3c 62 72 3e  nsus values.<br>
7680: 0d 0a 3c 75 3e 4e 6f 74 65 3c 2f 75 3e 3a 20 61  ..<u>Note</u>: a
7690: 66 74 65 72 20 63 6f 6d 70 6c 65 74 69 6e 67 20  fter completing 
76a0: 74 68 65 20 61 62 6f 76 65 20 73 74 65 70 73 20  the above steps 
76b0: 6e 6f 77 20 74 68 65 20 3c 62 3e 63 6f 6d 32 30  now the <b>com20
76c0: 31 35 3c 2f 62 3e 20 74 61 62 6c 65 20 63 6f 6e  15</b> table con
76d0: 74 61 69 6e 73 20 62 6f 74 68 20 73 75 70 70 72  tains both suppr
76e0: 65 73 73 65 64 20 61 6e 64 20 6e 65 77 20 4d 75  essed and new Mu
76f0: 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 6c 69  nicipalities</li
7700: 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c 76 65 72 62 61  >..</ol>..<verba
7710: 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70  tim>..SELECT Top
7720: 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79  oGeo_InitTopoLay
7730: 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c  er('census2011',
7740: 20 4e 55 4c 4c 2c 20 27 63 6f 6d 32 30 31 35 27   NULL, 'com2015'
7750: 2c 20 27 63 6f 6d 32 30 31 35 27 29 3b 0d 0a 0d  , 'com2015');...
7760: 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e  .INSERT INTO cen
7770: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
7780: 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c  ures..SELECT NUL
7790: 4c 2c 20 61 2e 6e 6f 64 65 5f 69 64 2c 20 61 2e  L, a.node_id, a.
77a0: 65 64 67 65 5f 69 64 2c 20 61 2e 66 61 63 65 5f  edge_id, a.face_
77b0: 69 64 2c 20 36 2c 20 61 2e 66 69 64 0d 0a 46 52  id, 6, a.fid..FR
77c0: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  OM census2011_to
77d0: 70 6f 66 65 61 74 75 72 65 73 20 41 53 20 61 0d  pofeatures AS a.
77e0: 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31  .JOIN census2011
77f0: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 33 20  _topofeatures_3 
7800: 41 53 20 62 20 4f 4e 20 28 61 2e 74 6f 70 6f 6c  AS b ON (a.topol
7810: 61 79 65 72 5f 69 64 20 3d 20 33 20 41 4e 44 20  ayer_id = 3 AND 
7820: 61 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d  a.fid = b.fid);.
7830: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 4e 6f  .</verbatim>..No
7840: 74 68 69 6e 67 20 72 65 61 6c 6c 79 20 69 6e 74  thing really int
7850: 65 72 65 73 74 69 6e 67 20 69 6e 20 74 68 69 73  eresting in this
7860: 2c 20 62 65 63 61 75 73 65 20 77 65 20 61 6c 72  , because we alr
7870: 65 61 64 79 20 70 65 72 66 6f 72 6d 65 64 20 74  eady performed t
7880: 68 69 73 20 73 74 65 70 20 64 75 72 69 6e 67 20  his step during 
7890: 74 68 65 20 70 72 65 76 69 6f 75 73 20 65 78 65  the previous exe
78a0: 72 63 69 73 65 2e 20 57 65 27 76 65 20 73 69 6d  rcise. We've sim
78b0: 70 6c 79 20 69 6e 69 74 69 61 6c 69 7a 65 64 20  ply initialized 
78c0: 79 65 74 20 61 6e 6f 74 68 65 72 20 54 6f 70 6f  yet another Topo
78d0: 4c 61 79 65 72 73 2c 20 61 6e 64 20 77 65 27 76  Layers, and we'v
78e0: 65 20 63 6f 70 69 65 64 20 69 6e 74 6f 20 69 74  e copied into it
78f0: 20 74 68 65 20 73 61 6d 65 20 54 6f 70 6f 46 65   the same TopoFe
7900: 61 74 75 72 65 73 20 64 65 66 69 6e 69 74 69 6f  atures definitio
7910: 6e 73 20 61 6c 72 65 61 64 79 20 73 75 70 70 6f  ns already suppo
7920: 72 74 69 6e 67 20 32 30 31 31 20 4d 75 6e 69 63  rting 2011 Munic
7930: 69 70 61 6c 69 74 69 65 73 2e 0d 0a 3c 76 65 72  ipalities...<ver
7940: 62 61 74 69 6d 3e 0d 0a 55 50 44 41 54 45 20 63  batim>..UPDATE c
7950: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
7960: 61 74 75 72 65 73 0d 0a 53 45 54 20 66 69 64 20  atures..SET fid 
7970: 3d 20 28 53 45 4c 45 43 54 20 66 69 64 20 46 52  = (SELECT fid FR
7980: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  OM census2011_to
7990: 70 6f 66 65 61 74 75 72 65 73 5f 36 20 57 48 45  pofeatures_6 WHE
79a0: 52 45 20 63 6f 64 5f 63 6f 6d 20 3d 20 35 31 30  RE cod_com = 510
79b0: 34 30 29 0d 0a 57 48 45 52 45 20 74 6f 70 6f 6c  40)..WHERE topol
79c0: 61 79 65 72 5f 69 64 20 3d 20 36 20 41 4e 44 20  ayer_id = 6 AND 
79d0: 66 69 64 20 49 4e 20 28 53 45 4c 45 43 54 20 66  fid IN (SELECT f
79e0: 69 64 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30  id FROM census20
79f0: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f  11_topofeatures_
7a00: 36 20 57 48 45 52 45 20 63 6f 64 5f 63 6f 6d 20  6 WHERE cod_com 
7a10: 69 6e 20 28 35 31 30 30 39 2c 20 35 31 30 32 39  in (51009, 51029
7a20: 29 29 3b 0d 0a 0d 0a 55 50 44 41 54 45 20 63 65  ));....UPDATE ce
7a30: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61  nsus2011_topofea
7a40: 74 75 72 65 73 0d 0a 53 45 54 20 66 69 64 20 3d  tures..SET fid =
7a50: 20 28 53 45 4c 45 43 54 20 66 69 64 20 46 52 4f   (SELECT fid FRO
7a60: 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70  M census2011_top
7a70: 6f 66 65 61 74 75 72 65 73 5f 36 20 57 48 45 52  ofeatures_6 WHER
7a80: 45 20 63 6f 64 5f 63 6f 6d 20 3d 20 35 31 30 34  E cod_com = 5104
7a90: 31 29 0d 0a 57 48 45 52 45 20 74 6f 70 6f 6c 61  1)..WHERE topola
7aa0: 79 65 72 5f 69 64 20 3d 20 36 20 41 4e 44 20 66  yer_id = 6 AND f
7ab0: 69 64 20 49 4e 20 28 53 45 4c 45 43 54 20 66 69  id IN (SELECT fi
7ac0: 64 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31  d FROM census201
7ad0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 36  1_topofeatures_6
7ae0: 20 57 48 45 52 45 20 63 6f 64 5f 63 6f 6d 20 69   WHERE cod_com i
7af0: 6e 20 28 35 31 30 33 32 2c 20 35 31 30 33 36 29  n (51032, 51036)
7b00: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d  );..</verbatim>.
7b10: 0a 4e 6f 77 20 77 65 27 76 65 20 73 69 6d 70 6c  .Now we've simpl
7b20: 79 20 75 70 64 61 74 65 64 20 61 6c 6c 20 72 65  y updated all re
7b30: 6c 61 74 69 6f 6e 73 68 69 70 73 20 62 65 74 77  lationships betw
7b40: 65 65 6e 20 54 6f 70 6f 6c 6f 67 79 20 46 61 63  een Topology Fac
7b50: 65 73 20 61 6e 64 20 54 6f 70 6f 46 65 61 74 75  es and TopoFeatu
7b60: 72 65 73 20 62 79 20 74 72 61 6e 73 66 65 72 72  res by transferr
7b70: 69 6e 67 20 74 68 65 6d 20 66 72 6f 6d 20 3c 62  ing them from <b
7b80: 3e 35 31 30 30 39 20 3c 69 3e 43 61 73 74 65 6c  >51009 <i>Castel
7b90: 66 72 61 6e 63 6f 20 64 69 20 53 6f 70 72 61 3c  franco di Sopra<
7ba0: 2f 69 3e 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 35  /i></b> and <b>5
7bb0: 31 30 32 39 20 3c 69 3e 50 69 61 6e 20 64 69 20  1029 <i>Pian di 
7bc0: 53 63 6f 3c 2f 69 3e 3c 2f 62 3e 20 74 6f 20 3c  Sco</i></b> to <
7bd0: 62 3e 35 31 30 34 35 20 3c 69 3e 43 61 73 74 65  b>51045 <i>Caste
7be0: 6c 66 72 61 6e 63 6f 20 50 69 61 6e 64 69 73 63  lfranco Piandisc
7bf0: c3 b2 3c 2f 69 3e 3c 2f 62 3e 2e 20 54 68 65 6e  ..</i></b>. Then
7c00: 20 77 65 27 76 65 20 72 65 70 6c 69 65 64 20 74   we've replied t
7c10: 68 65 20 73 61 6d 65 20 61 63 74 69 6f 6e 2e 66  he same action.f
7c20: 72 6f 6d 20 3c 62 3e 35 31 30 33 32 20 3c 69 3e  rom <b>51032 <i>
7c30: 50 72 61 74 6f 76 65 63 63 68 69 6f 3c 2f 69 3e  Pratovecchio</i>
7c40: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 35 31 30 34  </b> and <b>5104
7c50: 31 20 3c 69 3e 53 74 69 61 3c 2f 69 3e 3c 2f 62  1 <i>Stia</i></b
7c60: 3e 20 74 6f 20 3c 62 3e 35 31 30 34 31 20 3c 69  > to <b>51041 <i
7c70: 3e 50 72 61 74 6f 76 65 63 63 68 69 6f 20 53 74  >Pratovecchio St
7c80: 69 61 3c 2f 69 3e 3c 2f 62 3e 20 73 6f 20 74 6f  ia</i></b> so to
7c90: 20 63 6f 72 72 65 63 74 6c 79 20 75 70 64 61 74   correctly updat
7ca0: 65 20 61 6c 6c 20 6e 65 77 20 4d 75 6e 69 63 69  e all new Munici
7cb0: 70 61 6c 69 74 69 65 73 20 69 6e 74 65 72 65 73  palities interes
7cc0: 74 69 6e 67 20 74 68 65 20 50 72 6f 76 69 6e 63  ting the Provinc
7cd0: 65 20 6f 66 20 41 72 65 7a 7a 6f 2e 3c 62 72 3e  e of Arezzo.<br>
7ce0: 0d 0a 59 6f 75 20 63 6f 75 6c 64 20 65 76 65 6e  ..You could even
7cf0: 74 75 61 6c 6c 79 20 63 6f 6e 74 69 6e 75 65 20  tually continue 
7d00: 62 79 20 79 6f 75 72 73 65 6c 66 20 73 6f 20 74  by yourself so t
7d10: 6f 20 75 70 64 61 74 65 20 61 6c 6c 20 50 72 6f  o update all Pro
7d20: 76 69 6e 63 65 73 2e 20 0d 0a 3c 76 65 72 62 61  vinces. ..<verba
7d30: 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70  tim>..SELECT Top
7d40: 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c  oGeo_ExportTopoL
7d50: 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31  ayer('census2011
7d60: 27 2c 20 27 63 6f 6d 32 30 31 35 27 2c 20 27 6f  ', 'com2015', 'o
7d70: 75 74 5f 63 6f 6d 5f 61 72 5f 32 30 31 35 27 2c  ut_com_ar_2015',
7d80: 20 31 2c 20 31 29 3b 0d 0a 0d 0a 53 45 4c 45 43   1, 1);....SELEC
7d90: 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 73 65 72 74  T TopoGeo_Insert
7da0: 46 65 61 74 75 72 65 46 72 6f 6d 54 6f 70 6f 4c  FeatureFromTopoL
7db0: 61 79 65 72 20 28 27 63 65 6e 73 75 73 32 30 31  ayer ('census201
7dc0: 31 27 2c 20 27 63 6f 6d 32 30 31 35 27 2c 20 27  1', 'com2015', '
7dd0: 6f 75 74 5f 63 6f 6d 5f 61 72 5f 32 30 31 35 27  out_com_ar_2015'
7de0: 2c 20 66 69 64 29 0d 0a 46 52 4f 4d 20 63 65 6e  , fid)..FROM cen
7df0: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
7e00: 75 72 65 73 5f 36 0d 0a 57 48 45 52 45 20 63 6f  ures_6..WHERE co
7e10: 64 5f 70 72 6f 76 20 3d 20 35 31 20 41 4e 44 20  d_prov = 51 AND 
7e20: 63 6f 64 5f 63 6f 6d 20 4e 4f 54 20 49 4e 20 28  cod_com NOT IN (
7e30: 35 31 30 30 39 2c 20 35 31 30 32 39 2c 20 35 31  51009, 51029, 51
7e40: 30 33 32 2c 20 35 31 30 33 36 29 3b 0d 0a 3c 2f  032, 51036);..</
7e50: 76 65 72 62 61 74 69 6d 3e 0d 0a 46 69 6e 61 6c  verbatim>..Final
7e60: 6c 79 20 77 65 27 6c 6c 20 65 78 70 6f 72 74 20  ly we'll export 
7e70: 61 20 6e 65 77 20 6c 61 79 65 72 20 72 65 70 72  a new layer repr
7e80: 65 73 65 6e 74 69 6e 67 20 74 68 65 20 75 70 64  esenting the upd
7e90: 61 74 65 64 20 32 30 31 35 20 50 72 6f 76 69 6e  ated 2015 Provin
7ea0: 63 65 20 6f 66 20 41 72 65 7a 7a 6f 2e 3c 62 72  ce of Arezzo.<br
7eb0: 3e 0d 0a 54 68 69 73 20 74 69 6d 65 20 77 65 27  >..This time we'
7ec0: 6c 6c 20 69 6e 76 6f 6b 65 20 3c 62 3e 54 6f 70  ll invoke <b>Top
7ed0: 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c  oGeo_ExportTopoL
7ee0: 61 79 65 72 28 29 3c 2f 62 3e 20 62 79 20 73 70  ayer()</b> by sp
7ef0: 65 63 69 66 79 69 6e 67 20 74 68 65 20 3c 62 3e  ecifying the <b>
7f00: 3c 69 3e 63 72 65 61 74 65 2d 6f 6e 6c 79 3c 2f  <i>create-only</
7f10: 69 3e 3c 2f 62 3e 20 73 70 65 63 69 61 6c 20 6f  i></b> special o
7f20: 70 74 69 6f 6e 2c 20 61 6e 64 20 74 68 65 6e 20  ption, and then 
7f30: 77 65 27 6c 6c 20 75 73 65 20 74 68 65 20 3c 62  we'll use the <b
7f40: 3e 54 6f 70 6f 47 65 6f 5f 49 6e 73 65 72 74 46  >TopoGeo_InsertF
7f50: 65 61 74 75 72 65 46 72 6f 6d 54 6f 70 6f 4c 61  eatureFromTopoLa
7f60: 79 65 72 28 29 3c 2f 62 3e 20 53 51 4c 20 66 75  yer()</b> SQL fu
7f70: 6e 63 74 69 6f 6e 20 69 6e 20 6f 72 64 65 72 20  nction in order 
7f80: 74 6f 20 73 65 6c 65 63 74 69 76 65 6c 79 20 65  to selectively e
7f90: 78 70 6f 72 74 20 6f 6e 6c 79 20 61 20 6c 69 6d  xport only a lim
7fa0: 69 74 65 64 20 73 75 62 73 65 74 20 66 72 6f 6d  ited subset from
7fb0: 20 74 68 65 20 6f 76 65 72 61 6c 6c 20 54 6f 70   the overall Top
7fc0: 6f 46 65 61 74 75 72 65 73 2e 3c 62 72 3e 3c 62  oFeatures.<br><b
7fd0: 72 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73  r>..<table cells
7fe0: 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 64  pan="4" cellpadd
7ff0: 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d  ing="6" bgcolor=
8000: 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 72  "#f8f8f0" border
8010: 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d  ="1">..<tr><td>.
8020: 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73  .<img src="https
8030: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e  ://www.gaia-gis.
8040: 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70  it/gaia-sins/top
8050: 6f 66 69 67 73 2f 74 6f 70 6f 2d 61 72 2d 32 30  ofigs/topo-ar-20
8060: 31 31 2e 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70  11.png" alt="top
8070: 6f 2d 61 72 2d 32 30 31 31 22 3e 0d 0a 3c 2f 74  o-ar-2011">..</t
8080: 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63  d><td>..<img src
8090: 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61  ="https://www.ga
80a0: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
80b0: 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70  ins/topofigs/top
80c0: 6f 2d 61 72 2d 32 30 31 35 2e 70 6e 67 22 20 61  o-ar-2015.png" a
80d0: 6c 74 3d 22 74 6f 70 6f 2d 61 72 2d 32 30 31 35  lt="topo-ar-2015
80e0: 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  ">..</td></tr>..
80f0: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63  <tr><td align="c
8100: 65 6e 74 65 72 22 3e 4d 75 6e 69 63 69 70 61 6c  enter">Municipal
8110: 69 74 69 65 73 20 69 6e 20 74 68 65 20 50 72 6f  ities in the Pro
8120: 76 69 6e 63 65 20 6f 66 20 41 72 65 7a 7a 6f 3a  vince of Arezzo:
8130: 20 3c 62 3e 32 30 31 31 3c 2f 62 3e 3c 2f 74 64   <b>2011</b></td
8140: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74  ><td align="cent
8150: 65 72 22 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69  er">Municipaliti
8160: 65 73 20 69 6e 20 74 68 65 20 50 72 6f 76 69 6e  es in the Provin
8170: 63 65 20 6f 66 20 41 72 65 7a 7a 6f 3a 20 3c 62  ce of Arezzo: <b
8180: 3e 32 30 31 35 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f  >2015</b></td></
8190: 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72  tr>..</table><br
81a0: 3e 0d 0a 3c 68 72 3e 0d 0a 3c 2f 64 69 76 3e 0d  >..<hr>..</div>.
81b0: 0a 3c 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31  .<table width="1
81c0: 30 30 25 22 3e 3c 74 72 3e 0d 0a 3c 74 64 20 77  00%"><tr>..<td w
81d0: 69 64 74 68 3d 22 33 33 25 22 20 61 6c 69 67 6e  idth="33%" align
81e0: 3d 22 6c 65 66 74 22 3e 3c 61 20 68 72 65 66 3d  ="left"><a href=
81f0: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69  "https://www.gai
8200: 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f  a-gis.it/fossil/
8210: 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69  libspatialite/wi
8220: 6b 69 3f 6e 61 6d 65 3d 74 6f 70 6f 2d 69 6e 74  ki?name=topo-int
8230: 65 72 6d 65 64 69 61 74 65 22 3e 70 72 65 76 69  ermediate">previ
8240: 6f 75 73 20 70 61 67 65 3c 2f 61 3e 3c 2f 74 64  ous page</a></td
8250: 3e 0d 0a 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65  >..<td align="ce
8260: 6e 74 65 72 22 3e 3c 61 20 68 72 65 66 3d 22 68  nter"><a href="h
8270: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  ttps://www.gaia-
8280: 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69  gis.it/fossil/li
8290: 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69  bspatialite/wiki
82a0: 3f 6e 61 6d 65 3d 49 53 4f 2b 54 6f 70 6f 6c 6f  ?name=ISO+Topolo
82b0: 67 79 22 3e 62 61 63 6b 20 74 6f 20 69 6e 64 65  gy">back to inde
82c0: 78 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20  x</a></td>..<td 
82d0: 77 69 64 74 68 3d 22 33 33 25 22 20 61 6c 69 67  width="33%" alig
82e0: 6e 3d 22 72 69 67 68 74 22 3e 3c 2f 74 64 3e 0d  n="right"></td>.
82f0: 0a 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 0a 5a  .</tr></table>.Z
8300: 20 62 62 31 62 36 36 32 36 31 36 32 62 37 30 64   bb1b6626162b70d
8310: 66 30 62 63 36 61 31 66 65 32 34 39 63 32 64 64  f0bc6a1fe249c2dd
8320: 36 0a                                            6.