Hex Artifact Content
Not logged in

Artifact 57994dc4612cbe5f26e7a4d284ccea40a45d324a:

Wiki page [topo-advanced] by sandro 2015-12-15 12:31:38.
0000: 44 20 32 30 31 35 2d 31 32 2d 31 35 54 31 32 3a  D 2015-12-15T12:
0010: 33 31 3a 33 38 2e 30 33 31 0a 4c 20 74 6f 70 6f  31:38.031.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 65 63 65 31  -advanced.P ece1
0030: 64 62 31 62 33 37 39 66 35 65 62 37 61 36 35 30  db1b379f5eb7a650
0040: 35 66 62 65 63 62 39 63 35 66 36 39 64 66 36 65  5fbecb9c5f69df6e
0050: 36 38 38 36 0a 55 20 73 61 6e 64 72 6f 0a 57 20  6886.U sandro.W 
0060: 33 33 31 35 38 0a 3c 74 61 62 6c 65 20 63 65 6c  33158.<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 68 33 3e 54 6f 70  /table>..<h3>Top
0280: 6f 4c 61 79 65 72 73 20 61 6e 64 20 54 6f 70 6f  oLayers and Topo
0290: 46 65 61 74 75 72 65 73 3c 2f 68 33 3e 0d 0a 49  Features</h3>..I
02a0: 6e 20 74 68 65 20 70 72 65 76 69 6f 75 73 20 74  n the previous t
02b0: 75 74 6f 72 69 61 6c 20 77 65 27 76 65 20 65 78  utorial we've ex
02c0: 61 6d 69 6e 65 64 20 61 20 66 69 72 73 74 20 63  amined a first c
02d0: 6f 75 70 6c 65 20 6f 66 20 53 51 4c 20 66 75 6e  ouple of SQL fun
02e0: 63 74 69 6f 6e 73 20 69 6e 74 65 6e 64 65 64 20  ctions intended 
02f0: 74 6f 20 65 78 70 6f 72 74 20 61 20 47 65 6f 54  to export a GeoT
0300: 61 62 6c 65 20 6f 75 74 20 66 72 6f 6d 20 61 6e  able out from an
0310: 20 65 78 69 73 74 69 6e 67 20 54 6f 70 6f 6c 6f   existing Topolo
0320: 67 79 3a 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 54  gy: <b>TopoGeo_T
0330: 6f 47 65 6f 54 61 62 6c 65 28 29 3c 2f 62 3e 20  oGeoTable()</b> 
0340: 61 6e 64 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 54  and <b>TopoGeo_T
0350: 6f 47 65 6f 54 61 62 6c 65 47 65 6e 65 72 61 6c  oGeoTableGeneral
0360: 69 7a 65 28 29 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a  ize()</b>.<br>..
0370: 41 6e 79 77 61 79 20 53 70 61 74 69 61 4c 69 74  Anyway SpatiaLit
0380: 65 20 73 75 70 70 6f 72 74 73 20 61 6e 20 6d 6f  e supports an mo
0390: 72 65 20 73 6f 70 68 69 73 74 69 63 61 74 65 64  re sophisticated
03a0: 20 28 61 6e 64 20 63 6f 6d 70 6c 65 78 29 20 61   (and complex) a
03b0: 70 70 72 6f 61 63 68 20 62 61 73 65 64 20 6f 6e  pproach based on
03c0: 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f   <b>TopoLayers</
03d0: 62 3e 20 61 6e 64 20 3c 62 3e 54 6f 70 6f 46 65  b> and <b>TopoFe
03e0: 61 74 75 72 65 73 3c 2f 62 3e 20 73 70 65 63 69  atures</b> speci
03f0: 66 69 63 61 6c 6c 79 20 69 6e 74 65 6e 64 65 64  fically intended
0400: 20 74 6f 20 73 75 70 70 6f 72 74 20 61 20 76 65   to support a ve
0410: 72 79 20 66 6c 65 78 69 62 6c 65 20 6d 65 63 68  ry flexible mech
0420: 61 6e 69 73 6d 20 66 6f 72 20 65 78 70 6f 72 74  anism for export
0430: 69 6e 67 20 61 20 66 75 6c 6c 20 73 65 74 20 6f  ing a full set o
0440: 66 20 47 65 6f 54 61 62 6c 65 28 73 29 20 64 69  f GeoTable(s) di
0450: 72 65 63 74 6c 79 20 64 65 72 69 76 69 6e 67 20  rectly deriving 
0460: 66 72 6f 6d 20 61 20 54 6f 70 6f 6c 6f 67 79 2e  from a Topology.
0470: 0d 0a 3c 68 34 3e 61 20 63 6f 6e 63 65 70 74 75  ..<h4>a conceptu
0480: 61 6c 20 72 65 66 65 72 65 6e 63 65 20 66 72 61  al reference fra
0490: 6d 65 77 6f 72 6b 3c 2f 68 34 3e 0d 0a 3c 75 6c  mework</h4>..<ul
04a0: 3e 0d 0a 3c 6c 69 3e 61 6e 20 49 53 4f 20 54 6f  >..<li>an ISO To
04b0: 70 6f 6c 6f 67 79 20 69 73 20 6a 75 73 74 20 69  pology is just i
04c0: 6e 74 65 6e 64 65 64 20 74 6f 20 73 75 70 70 6f  ntended to suppo
04d0: 72 74 20 61 20 63 6f 6e 73 69 73 74 65 6e 74 20  rt a consistent 
04e0: 73 65 74 20 6f 66 20 3c 62 3e 4e 6f 64 65 73 3c  set of <b>Nodes<
04f0: 2f 62 3e 2c 20 3c 62 3e 45 64 67 65 73 3c 2f 62  /b>, <b>Edges</b
0500: 3e 20 61 6e 64 20 3c 62 3e 46 61 63 65 73 3c 2f  > and <b>Faces</
0510: 62 3e 20 70 72 69 6d 69 74 69 76 65 73 20 66 75  b> primitives fu
0520: 6c 6c 79 20 63 6f 76 65 72 69 6e 67 20 74 68 65  lly covering the
0530: 20 70 6c 61 6e 65 2e 0d 0a 54 6f 70 6f 6c 6f 67   plane...Topolog
0540: 79 20 70 72 69 6d 69 74 69 76 65 73 20 63 6f 72  y primitives cor
0550: 72 65 73 70 6f 6e 64 20 74 6f 20 70 75 72 65 20  respond to pure 
0560: 67 65 6f 6d 65 74 72 69 65 73 2c 20 61 6e 64 20  geometries, and 
0570: 63 61 6e 20 6e 65 76 65 72 20 62 65 20 64 69 72  can never be dir
0580: 65 63 74 6c 79 20 20 61 73 73 6f 63 69 61 74 65  ectly  associate
0590: 64 20 74 6f 20 61 20 63 6f 72 72 65 73 70 6f 6e  d to a correspon
05a0: 64 69 6e 67 20 73 65 74 20 6f 66 20 69 6e 66 6f  ding set of info
05b0: 72 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74  rmation attribut
05c0: 65 73 2e 0d 0a 42 6f 74 68 20 4e 6f 64 65 20 61  es...Both Node a
05d0: 6e 64 20 45 64 67 65 20 70 72 69 6d 69 74 69 76  nd Edge primitiv
05e0: 65 73 20 64 69 72 65 63 74 6c 79 20 63 6f 72 72  es directly corr
05f0: 65 73 70 6f 6e 64 20 74 6f 20 61 20 3c 75 3e 3c  espond to a <u><
0600: 69 3e 72 65 61 6c 20 67 65 6f 6d 65 74 72 79 3c  i>real geometry<
0610: 2f 69 3e 3c 2f 75 3e 2c 20 62 75 74 20 46 61 63  /i></u>, but Fac
0620: 65 20 70 72 69 6d 69 74 69 76 65 73 20 73 69 6d  e primitives sim
0630: 70 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 20 74  ply correspond t
0640: 6f 20 61 20 3c 75 3e 3c 69 3e 76 69 72 74 75 61  o a <u><i>virtua
0650: 6c 20 67 65 6f 6d 65 74 72 79 3c 2f 69 3e 3c 2f  l geometry</i></
0660: 75 3e 20 74 68 75 73 20 6e 65 63 65 73 73 61 72  u> thus necessar
0670: 69 6c 79 20 72 65 71 75 69 72 69 6e 67 20 74 6f  ily requiring to
0680: 20 62 65 20 64 79 6e 61 6d 69 63 61 6c 6c 79 20   be dynamically 
0690: 72 65 63 6f 6e 73 74 72 75 63 74 65 64 20 65 76  reconstructed ev
06a0: 65 72 79 20 74 69 6d 65 20 74 68 61 74 20 74 68  ery time that th
06b0: 65 79 20 61 72 65 20 72 65 66 65 72 65 6e 63 65  ey are reference
06c0: 64 20 28 61 6e 64 20 74 68 69 73 20 63 6f 75 6c  d (and this coul
06d0: 64 20 65 61 73 69 6c 79 20 62 65 63 6f 6d 65 20  d easily become 
06e0: 61 20 72 65 61 6c 20 62 6f 74 74 6c 65 6e 65 63  a real bottlenec
06f0: 6b 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6f 6e  k).</li>..<li>on
0700: 20 74 68 65 20 6f 74 68 65 72 20 68 61 6e 64 20   the other hand 
0710: 61 20 47 65 6f 54 61 62 6c 65 20 28 61 6b 61 20  a GeoTable (aka 
0720: 3c 75 3e 3c 69 3e 6c 61 79 65 72 3c 2f 69 3e 3c  <u><i>layer</i><
0730: 2f 75 3e 2c 20 61 73 20 69 6e 20 74 68 65 20 63  /u>, as in the c
0740: 6f 6d 6d 6f 6e 20 47 49 53 20 70 61 72 6c 61 6e  ommon GIS parlan
0750: 63 65 29 20 69 73 20 61 6c 77 61 79 73 20 62 61  ce) is always ba
0760: 73 65 64 20 6f 6e 20 6d 61 6e 79 20 64 69 73 74  sed on many dist
0770: 69 6e 63 74 20 66 65 61 74 75 72 65 73 2c 20 61  inct features, a
0780: 6e 64 20 66 6f 72 20 65 61 63 68 20 66 65 61 74  nd for each feat
0790: 75 72 65 20 61 20 47 65 6f 6d 65 74 72 79 20 61  ure a Geometry a
07a0: 6e 64 20 61 6e 20 61 73 73 6f 63 69 61 74 65 64  nd an associated
07b0: 20 73 65 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74   set of informat
07c0: 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 20 61  ion attributes a
07d0: 72 65 20 65 78 70 65 63 74 65 64 20 74 6f 20 62  re expected to b
07e0: 65 20 64 65 63 6c 61 72 65 64 2e 3c 2f 6c 69 3e  e declared.</li>
07f0: 0d 0a 3c 6c 69 3e 74 68 65 72 65 20 69 73 20 66  ..<li>there is f
0800: 75 72 74 68 65 72 20 64 69 66 66 65 72 65 6e 63  urther differenc
0810: 65 20 74 6f 20 62 65 20 74 61 6b 65 6e 20 69 6e  e to be taken in
0820: 20 70 72 6f 70 65 72 20 61 63 63 6f 75 6e 74 3a   proper account:
0830: 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74   Topology primit
0840: 69 76 65 73 20 6e 65 63 65 73 73 61 72 69 6c 79  ives necessarily
0850: 20 61 72 65 20 65 6c 65 6d 65 6e 74 61 72 79 2e   are elementary.
0860: 20 46 65 61 74 75 72 65 20 47 65 6f 6d 65 74 72   Feature Geometr
0870: 69 65 73 20 63 61 6e 20 75 73 75 61 6c 6c 79 20  ies can usually 
0880: 72 65 70 72 65 73 65 6e 74 20 73 6f 6d 65 20 63  represent some c
0890: 6f 6d 70 6c 65 78 20 74 79 70 65 3a 20 4d 55 4c  omplex type: MUL
08a0: 54 49 50 4f 49 4e 54 2c 20 4d 55 4c 54 49 4c 49  TIPOINT, MULTILI
08b0: 4e 45 53 54 52 49 4e 47 2c 20 4d 55 4c 54 49 50  NESTRING, MULTIP
08c0: 4f 4c 59 47 4f 4e 20 61 6e 64 2c 20 6d 61 79 20  OLYGON and, may 
08d0: 62 65 2c 20 47 45 4f 4d 45 54 52 59 43 4f 4c 4c  be, GEOMETRYCOLL
08e0: 45 43 54 49 4f 4e 2e 20 53 6f 20 69 74 20 73 68  ECTION. So it sh
08f0: 6f 75 6c 64 20 62 65 20 61 62 73 6f 6c 75 74 65  ould be absolute
0900: 6c 79 20 63 6c 65 61 72 20 74 68 61 74 20 61 20  ly clear that a 
0910: 46 65 61 74 75 72 65 20 47 65 6f 6d 65 74 72 79  Feature Geometry
0920: 20 64 6f 65 73 20 6e 6f 74 20 6e 65 63 65 73 73   does not necess
0930: 61 72 69 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64  arily correspond
0940: 73 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 54 6f  s to a single To
0950: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
0960: 20 3b 20 61 20 46 65 61 74 75 72 65 20 47 65 6f   ; a Feature Geo
0970: 6d 65 74 72 79 20 63 6f 75 6c 64 20 65 61 73 69  metry could easi
0980: 6c 79 20 62 65 20 64 65 72 69 76 65 64 20 66 72  ly be derived fr
0990: 6f 6d 20 61 67 67 72 65 67 61 74 69 6e 67 20 6d  om aggregating m
09a0: 61 6e 79 20 64 69 66 66 65 72 65 6e 74 20 54 6f  any different To
09b0: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
09c0: 73 2e 3c 2f 6c 69 3e 20 0d 0a 3c 6c 69 3e 74 68  s.</li> ..<li>th
09d0: 61 74 27 73 20 6e 6f 74 20 61 6c 6c 3a 20 6d 61  at's not all: ma
09e0: 6e 79 20 64 69 66 66 65 72 65 6e 74 20 47 65 6f  ny different Geo
09f0: 54 61 62 6c 65 73 20 63 6f 75 6c 64 20 65 76 65  Tables could eve
0a00: 6e 74 75 61 6c 6c 79 20 62 65 20 64 65 72 69 76  ntually be deriv
0a10: 65 64 20 66 72 6f 6d 20 61 20 73 69 6e 67 6c 65  ed from a single
0a20: 20 54 6f 70 6f 6c 6f 67 79 3b 20 61 6e 64 20 74   Topology; and t
0a30: 68 65 20 73 61 6d 65 20 54 6f 70 6f 6c 6f 67 79  he same Topology
0a40: 20 70 72 69 6d 69 74 69 76 65 20 63 6f 75 6c 64   primitive could
0a50: 20 70 6c 61 79 20 61 20 76 65 72 79 20 64 69 66   play a very dif
0a60: 66 65 72 65 6e 74 20 72 6f 6c 65 20 69 6e 20 65  ferent role in e
0a70: 76 65 72 79 6f 6e 65 20 6f 66 20 74 68 65 73 65  veryone of these
0a80: 20 47 65 6f 54 61 62 6c 65 73 2e 3c 62 72 3e 0d   GeoTables.<br>.
0a90: 0a 4a 75 73 74 20 61 20 62 61 73 69 63 61 6c 6c  .Just a basicall
0aa0: 79 20 73 69 6d 70 6c 65 20 65 78 61 6d 70 6c 65  y simple example
0ab0: 3a 20 69 6d 61 67 69 6e 65 20 61 20 54 6f 70 6f  : imagine a Topo
0ac0: 6c 6f 67 79 20 63 6f 72 72 65 73 70 6f 6e 64 69  logy correspondi
0ad0: 6e 67 20 74 6f 20 73 6f 6d 65 20 6c 61 6e 64 20  ng to some land 
0ae0: 72 65 67 69 73 74 72 79 20 6d 61 70 2e 20 57 65  registry map. We
0af0: 27 6c 6c 20 73 75 72 65 6c 79 20 68 61 76 65 20  'll surely have 
0b00: 6d 61 6e 79 20 70 6f 74 65 6e 74 69 61 6c 20 6c  many potential l
0b10: 61 79 65 72 73 3a 20 62 75 69 6c 64 69 6e 67 73  ayers: buildings
0b20: 2c 20 61 67 72 69 63 75 6c 74 75 72 61 6c 20 6c  , agricultural l
0b30: 61 6e 64 2c 20 70 6f 70 75 6c 61 74 65 64 20 70  and, populated p
0b40: 6c 61 63 65 73 2c 20 61 64 6d 69 6e 69 73 74 72  laces, administr
0b50: 61 74 69 76 65 20 62 6f 75 6e 64 61 72 69 65 73  ative boundaries
0b60: 2c 20 72 6f 61 64 73 2c 20 70 6f 6e 64 73 2c 20  , roads, ponds, 
0b70: 72 69 76 65 72 73 2c 20 66 65 6e 63 65 73 20 61  rivers, fences a
0b80: 6e 64 20 73 6f 20 6f 6e 2e 3c 62 72 3e 0d 0a 49  nd so on.<br>..I
0b90: 6e 20 73 75 63 68 20 61 20 63 6f 6e 74 65 78 74  n such a context
0ba0: 20 61 20 66 65 6e 63 65 20 63 6f 75 6c 64 20 65   a fence could e
0bb0: 61 73 69 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64  asily correspond
0bc0: 20 74 6f 20 61 20 46 65 61 74 75 72 65 20 77 69   to a Feature wi
0bd0: 74 68 69 6e 20 74 68 65 20 22 3c 69 3e 3c 62 3e  thin the "<i><b>
0be0: 66 65 6e 63 65 73 3c 2f 62 3e 3c 2f 69 3e 22 20  fences</b></i>" 
0bf0: 6c 61 79 65 72 2c 20 63 6f 75 6c 64 20 70 72 6f  layer, could pro
0c00: 62 61 62 6c 79 20 64 65 6c 69 6d 69 74 20 74 77  bably delimit tw
0c10: 6f 20 61 64 6a 61 63 65 6e 74 20 61 67 72 69 63  o adjacent agric
0c20: 75 6c 74 75 72 61 6c 20 61 72 65 61 73 20 61 6e  ultural areas an
0c30: 64 20 63 6f 75 6c 64 20 65 76 65 6e 74 75 61 6c  d could eventual
0c40: 6c 79 20 62 65 20 70 61 72 74 20 6f 66 20 73 6f  ly be part of so
0c50: 6d 65 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76  me administrativ
0c60: 65 20 62 6f 75 6e 64 61 72 79 2e 3c 2f 6c 69 3e  e boundary.</li>
0c70: 0d 0a 3c 6c 69 3e 3c 62 3e 54 6f 70 6f 4c 61 79  ..<li><b>TopoLay
0c80: 65 72 73 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 54  ers</b> and <b>T
0c90: 6f 70 6f 46 65 61 74 75 72 65 73 3c 2f 62 3e 20  opoFeatures</b> 
0ca0: 72 65 70 72 65 73 65 6e 74 20 61 20 63 6f 6d 70  represent a comp
0cb0: 6c 65 78 20 61 6e 64 20 66 6c 65 78 69 62 6c 65  lex and flexible
0cc0: 20 73 74 72 75 63 74 75 72 65 20 69 6e 74 65 6e   structure inten
0cd0: 64 65 64 20 74 6f 20 65 73 74 61 62 6c 69 73 68  ded to establish
0ce0: 20 70 65 72 6d 61 6e 65 6e 74 20 65 78 70 6c 69   permanent expli
0cf0: 63 69 74 20 63 6f 72 72 65 73 70 6f 6e 64 65 6e  cit corresponden
0d00: 63 65 73 20 62 65 74 77 65 65 6e 20 54 6f 70 6f  ces between Topo
0d10: 6c 6f 67 79 20 50 72 69 6d 69 74 69 76 65 73 20  logy Primitives 
0d20: 61 6e 64 20 47 65 6f 54 61 62 6c 65 20 46 65 61  and GeoTable Fea
0d30: 74 75 72 65 73 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c  tures...<ul>..<l
0d40: 69 3e 65 61 63 68 20 3c 62 3e 54 6f 70 6f 4c 61  i>each <b>TopoLa
0d50: 79 65 72 3c 2f 62 3e 20 69 73 20 75 6e 69 71 75  yer</b> is uniqu
0d60: 65 6c 79 20 69 64 65 6e 74 69 66 69 65 64 20 62  ely identified b
0d70: 79 20 69 74 73 20 3c 62 3e 6e 61 6d 65 3c 2f 62  y its <b>name</b
0d80: 3e 20 61 6e 64 20 64 69 72 65 63 74 6c 79 20 63  > and directly c
0d90: 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 20  orresponds to a 
0da0: 73 69 6e 67 6c 65 20 47 65 6f 54 61 62 6c 65 20  single GeoTable 
0db0: 74 6f 20 62 65 20 65 78 70 6f 72 74 65 64 20 66  to be exported f
0dc0: 72 6f 6d 20 74 68 65 20 54 6f 70 6f 6c 6f 67 79  rom the Topology
0dd0: 3c 62 72 3e 0d 0a 41 6e 20 61 72 62 69 74 72 61  <br>..An arbitra
0de0: 72 79 20 6e 75 6d 62 65 72 20 6f 66 20 54 6f 70  ry number of Top
0df0: 6f 4c 61 79 65 72 73 20 63 61 6e 20 62 65 20 63  oLayers can be c
0e00: 72 65 61 74 65 64 20 6f 6e 20 74 68 65 20 73 61  reated on the sa
0e10: 6d 65 20 54 6f 70 6f 6c 6f 67 79 2c 20 61 6e 64  me Topology, and
0e20: 20 65 61 63 68 20 6f 6e 65 20 6f 66 20 74 68 65   each one of the
0e30: 6d 20 77 69 6c 6c 20 61 63 74 20 61 73 20 61 20  m will act as a 
0e40: 73 65 70 61 72 61 74 65 20 63 6f 6e 74 61 69 6e  separate contain
0e50: 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 65 61  er.</li>..<li>ea
0e60: 63 68 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72  ch <b>TopoFeatur
0e70: 65 3c 2f 62 3e 20 69 73 20 75 6e 69 71 75 65 6c  e</b> is uniquel
0e80: 79 20 69 64 65 6e 74 69 66 69 65 64 20 62 79 20  y identified by 
0e90: 69 74 73 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 28  its <b>fid</b> (
0ea0: 3c 69 3e 66 65 61 74 75 72 65 2d 69 64 3c 2f 69  <i>feature-id</i
0eb0: 3e 29 20 61 6e 64 20 63 6f 72 72 65 73 70 6f 6e  >) and correspon
0ec0: 64 73 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 46  ds to a single F
0ed0: 65 61 74 75 72 65 20 63 6f 6e 74 61 69 6e 69 6e  eature containin
0ee0: 67 20 61 6e 20 69 6e 64 69 76 69 64 75 61 6c 20  g an individual 
0ef0: 73 65 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74 69  set of informati
0f00: 6f 6e 20 61 74 74 72 69 62 75 74 65 73 2e 3c 62  on attributes.<b
0f10: 72 3e 0d 0a 54 68 65 20 47 65 6f 6d 65 74 72 79  r>..The Geometry
0f20: 20 66 6f 72 20 65 61 63 68 20 54 6f 70 6f 46 65   for each TopoFe
0f30: 61 74 75 72 65 20 69 73 20 61 6c 77 61 79 73 20  ature is always 
0f40: 69 6e 64 69 72 65 63 74 6c 79 20 64 65 66 69 6e  indirectly defin
0f50: 65 64 20 62 79 20 73 70 65 63 69 66 79 69 6e 67  ed by specifying
0f60: 20 61 20 6c 69 73 74 20 6f 66 20 54 6f 70 6f 6c   a list of Topol
0f70: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 69  ogy primitives i
0f80: 6e 64 69 76 69 64 75 61 6c 6c 79 20 72 65 66 65  ndividually refe
0f90: 72 65 6e 63 65 64 20 62 79 20 74 68 65 69 72 20  renced by their 
0fa0: 49 44 73 2e 3c 62 72 3e 0d 0a 53 75 63 68 20 61  IDs.<br>..Such a
0fb0: 20 67 65 6f 6d 65 74 72 79 20 6f 62 76 69 6f 75   geometry obviou
0fc0: 73 6c 79 20 69 73 20 61 20 3c 75 3e 3c 69 3e 76  sly is a <u><i>v
0fd0: 69 72 74 75 61 6c 3c 2f 69 3e 3c 2f 75 3e 20 6f  irtual</i></u> o
0fe0: 6e 65 2c 20 61 6e 64 20 77 69 6c 6c 20 62 65 20  ne, and will be 
0ff0: 61 63 74 75 61 6c 6c 79 20 6d 61 74 65 72 69 61  actually materia
1000: 6c 69 7a 65 64 20 28 62 79 20 61 67 67 72 65 67  lized (by aggreg
1010: 61 74 69 6e 67 20 61 6c 6c 20 72 65 66 65 72 65  ating all refere
1020: 6e 63 65 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72  nced Topology pr
1030: 69 6d 69 74 69 76 65 73 29 20 6f 6e 6c 79 20 77  imitives) only w
1040: 68 65 6e 20 65 78 70 6f 72 74 69 6e 67 20 74 68  hen exporting th
1050: 65 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 47 65  e destination Ge
1060: 6f 54 61 62 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f  oTable.</li>..</
1070: 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 54 68  ul></li>..<li>Th
1080: 65 20 54 6f 70 6f 4c 61 79 65 72 73 20 2f 20 54  e TopoLayers / T
1090: 6f 70 6f 46 65 61 74 75 72 65 73 20 73 74 72 75  opoFeatures stru
10a0: 63 74 75 72 65 20 69 73 20 70 72 61 63 74 69 63  cture is practic
10b0: 61 6c 6c 79 20 69 6d 70 6c 65 6d 65 6e 74 65 64  ally implemented
10c0: 20 61 73 20 61 20 73 65 74 20 6f 66 20 73 65 76   as a set of sev
10d0: 65 72 61 6c 20 63 6c 6f 73 65 6c 79 20 72 65 6c  eral closely rel
10e0: 61 74 65 64 20 44 42 2d 74 61 62 6c 65 73 20 29  ated DB-tables )
10f0: 77 65 27 6c 6c 20 65 78 61 6d 69 6e 65 20 6c 61  we'll examine la
1100: 74 65 72 20 74 68 65 69 72 20 72 65 73 70 65 63  ter their respec
1110: 74 69 76 65 20 6c 61 79 6f 75 74 73 20 69 6e 20  tive layouts in 
1120: 66 75 6c 6c 20 64 65 74 61 69 6c 29 3a 0d 0a 3c  full detail):..<
1130: 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c 3c 69 3e  ul>..<li><b><<i>
1140: 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e  topo-prefix</i>>
1150: 5f 74 6f 70 6f 6c 61 79 65 72 73 3c 2f 62 3e 3a  _topolayers</b>:
1160: 20 74 68 69 73 20 66 69 72 73 74 20 74 61 62 6c   this first tabl
1170: 65 20 73 69 6d 70 6c 79 20 69 73 20 61 20 63 61  e simply is a ca
1180: 74 61 6c 6f 67 20 6f 66 20 61 6c 6c 20 54 6f 70  talog of all Top
1190: 6f 4c 61 79 65 72 73 20 73 75 70 70 6f 72 74 69  oLayers supporti
11a0: 6e 67 20 74 68 65 20 73 61 6d 65 20 54 6f 70 6f  ng the same Topo
11b0: 6c 6f 67 79 2e 3c 62 72 3e 0d 0a 45 61 63 68 20  logy.<br>..Each 
11c0: 54 6f 70 6f 4c 61 79 65 72 20 69 73 20 69 64 65  TopoLayer is ide
11d0: 6e 74 69 66 69 65 64 20 62 79 20 69 74 73 20 3c  ntified by its <
11e0: 62 3e 6e 61 6d 65 3c 2f 62 3e 20 61 6e 64 20 62  b>name</b> and b
11f0: 79 20 69 74 73 20 3c 62 3e 49 44 3c 2f 62 3e 3b  y its <b>ID</b>;
1200: 20 62 6f 74 68 20 69 64 65 6e 74 69 66 69 65 72   both identifier
1210: 73 20 61 72 65 20 67 72 61 6e 74 65 64 20 74 6f  s are granted to
1220: 20 62 65 20 3c 69 3e 3c 75 3e 75 6e 69 71 75 65   be <i><u>unique
1230: 3c 2f 75 3e 3c 2f 69 3e 2e 3c 2f 6c 69 3e 0d 0a  </u></i>.</li>..
1240: 3c 6c 69 3e 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d  <li><b><<i>topo-
1250: 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f  prefix</i>>_topo
1260: 66 65 61 74 75 72 65 73 3c 2f 62 3e 3a 20 74 68  features</b>: th
1270: 69 73 20 73 65 63 6f 6e 64 20 74 61 62 6c 65 20  is second table 
1280: 69 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 70  is intended to p
1290: 65 72 6d 61 6e 65 6e 74 6c 79 20 73 74 6f 72 65  ermanently store
12a0: 20 61 6c 6c 20 63 72 6f 73 73 2d 72 65 66 65 72   all cross-refer
12b0: 65 6e 63 65 73 20 65 78 69 73 74 69 6e 67 20 62  ences existing b
12c0: 65 74 77 65 65 6e 20 54 6f 70 6f 6c 6f 67 79 20  etween Topology 
12d0: 70 72 69 6d 69 74 69 76 65 73 20 61 6e 64 20 54  primitives and T
12e0: 6f 70 6f 46 65 61 74 75 72 65 73 2e 3c 2f 6c 69  opoFeatures.</li
12f0: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c 3c 69 3e 74 6f  >..<li><b><<i>to
1300: 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74  po-prefix</i>>_t
1310: 6f 70 6f 66 65 61 74 75 72 65 73 5f 3c 3c 69 3e  opofeatures_<<i>
1320: 74 6f 70 6f 6c 61 79 65 72 2d 69 64 3c 2f 69 3e  topolayer-id</i>
1330: 3e 3c 2f 62 3e 3a 20 66 6f 72 20 65 61 63 68 20  ></b>: for each 
1340: 73 69 6e 67 6c 65 20 54 6f 70 6f 4c 61 79 65 72  single TopoLayer
1350: 20 61 20 73 65 70 61 72 61 74 65 20 74 61 62 6c   a separate tabl
1360: 65 20 69 73 20 72 65 71 75 69 72 65 64 2e 20 54  e is required. T
1370: 68 65 20 61 63 74 75 61 6c 20 63 6f 72 72 65 73  he actual corres
1380: 70 6f 6e 64 65 6e 63 65 20 69 73 20 65 73 74 61  pondence is esta
1390: 62 6c 69 73 68 65 64 20 76 69 61 20 74 68 65 20  blished via the 
13a0: 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 2d 49 44 3c  <b>TopoLayer-ID<
13b0: 2f 62 3e 20 73 75 66 66 69 78 2e 3c 62 72 3e 0d  /b> suffix.<br>.
13c0: 0a 41 6c 6c 20 74 68 65 73 65 20 74 61 62 6c 65  .All these table
13d0: 73 20 61 72 65 20 69 6e 74 65 6e 64 65 64 20 74  s are intended t
13e0: 6f 20 70 65 72 6d 61 6e 65 6e 74 6c 79 20 73 74  o permanently st
13f0: 6f 72 65 20 74 68 65 20 69 6e 66 6f 72 6d 61 74  ore the informat
1400: 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 20 66  ion attributes f
1410: 6f 72 20 65 61 63 68 20 54 6f 70 6f 46 65 61 74  or each TopoFeat
1420: 75 72 65 20 69 6e 20 74 68 65 20 73 61 6d 65 20  ure in the same 
1430: 54 6f 70 6f 4c 61 79 65 72 2e 0d 0a 44 69 66 66  TopoLayer...Diff
1440: 65 72 65 6e 74 20 54 6f 70 6f 4c 61 79 65 72 73  erent TopoLayers
1450: 20 77 69 6c 6c 20 6f 62 76 69 6f 75 73 6c 79 20   will obviously 
1460: 73 75 70 70 6f 72 74 20 61 20 64 69 66 66 65 72  support a differ
1470: 65 6e 74 20 73 65 74 20 6f 66 20 69 6e 66 6f 72  ent set of infor
1480: 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65  mation attribute
1490: 73 20 74 68 75 73 20 72 65 71 75 69 72 69 6e 67  s thus requiring
14a0: 20 61 6e 20 69 6e 64 69 76 69 64 75 61 6c 20 74   an individual t
14b0: 61 62 6c 65 20 6c 61 79 6f 75 74 2e 3c 62 72 3e  able layout.<br>
14c0: 0d 0a 41 6e 79 77 61 79 20 61 6c 6c 20 74 68 65  ..Anyway all the
14d0: 73 65 20 74 61 62 6c 65 73 20 61 72 65 20 61 6c  se tables are al
14e0: 77 61 79 73 20 65 78 70 65 63 74 65 64 20 74 6f  ways expected to
14f0: 20 64 65 63 6c 61 72 65 20 61 20 3c 62 3e 50 72   declare a <b>Pr
1500: 69 6d 61 72 79 20 4b 65 79 3c 2f 62 3e 20 6f 66  imary Key</b> of
1510: 20 74 68 65 20 3c 62 3e 49 4e 54 45 47 45 52 3c   the <b>INTEGER<
1520: 2f 62 3e 20 74 79 70 65 20 6e 61 6d 65 64 20 3c  /b> type named <
1530: 62 3e 66 69 64 3c 2f 62 3e 20 61 6e 64 20 69 6e  b>fid</b> and in
1540: 74 65 6e 64 65 64 20 74 6f 20 62 65 20 61 6e 20  tended to be an 
1550: 75 6e 69 71 75 65 20 69 64 65 6e 74 69 66 69 65  unique identifie
1560: 72 20 66 6f 72 20 65 61 63 68 20 54 6f 70 6f 46  r for each TopoF
1570: 65 61 74 75 72 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f  eature.</li>..</
1580: 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 53 65  ul></li>..<li>Se
1590: 76 65 72 61 6c 20 53 51 4c 20 66 75 6e 63 74 69  veral SQL functi
15a0: 6f 6e 73 20 61 72 65 20 73 70 65 63 69 66 69 63  ons are specific
15b0: 61 6c 6c 79 20 69 6e 74 65 6e 64 65 64 20 74 6f  ally intended to
15c0: 20 73 75 70 70 6f 72 74 20 70 72 6f 63 65 73 73   support process
15d0: 69 6e 67 20 6f 70 65 72 61 74 69 6f 6e 73 20 62  ing operations b
15e0: 61 73 65 64 20 6f 6e 20 54 6f 70 6f 4c 61 79 65  ased on TopoLaye
15f0: 72 73 20 61 6e 64 20 54 6f 70 6f 46 65 61 74 75  rs and TopoFeatu
1600: 72 65 73 3b 20 77 65 27 6c 6c 20 65 78 61 6d 69  res; we'll exami
1610: 6e 65 20 6c 61 74 65 72 20 61 6c 6c 20 74 68 65  ne later all the
1620: 6d 20 69 6e 20 66 75 6c 6c 20 64 65 74 61 69 6c  m in full detail
1630: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72  .</li>..</ul><br
1640: 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 32  ><br>..<hr>..<h2
1650: 3e 61 20 71 75 69 63 6b 20 70 72 61 63 74 69 63  >a quick practic
1660: 61 6c 20 65 78 65 72 63 69 73 65 3c 2f 68 32 3e  al exercise</h2>
1670: 0d 0a 50 72 65 72 65 71 75 69 73 69 74 65 73 3a  ..Prerequisites:
1680: 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 64 6f 77 6e  ..<ol>..<li>down
1690: 6c 6f 61 64 20 74 68 65 20 73 61 6d 70 6c 65 20  load the sample 
16a0: 44 42 2d 66 69 6c 65 20 66 72 6f 6d 20 3c 61 20  DB-file from <a 
16b0: 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77  href="https://ww
16c0: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61  w.gaia-gis.it/ga
16d0: 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 73 61 6d 70  ia-sins/toposamp
16e0: 6c 65 73 2f 74 75 73 63 61 6e 79 2d 63 65 6e 73  les/tuscany-cens
16f0: 75 73 2d 32 30 31 31 2e 37 7a 22 3e 68 65 72 65  us-2011.7z">here
1700: 3c 2f 61 3e 3c 62 72 3e 0d 0a 49 74 20 63 6f 6e  </a><br>..It con
1710: 74 61 69 6e 73 20 43 65 6e 73 75 73 20 64 61 74  tains Census dat
1720: 61 20 28 32 30 31 31 29 20 6b 69 6e 64 6c 79 20  a (2011) kindly 
1730: 72 65 6c 65 61 73 65 64 20 62 79 20 49 53 54 41  released by ISTA
1740: 54 20 75 6e 64 65 72 20 3c 62 3e 43 43 2d 42 59  T under <b>CC-BY
1750: 3c 2f 62 3e 20 6c 69 63 65 6e 73 65 20 74 65 72  </b> license ter
1760: 6d 73 2e 3c 62 72 3e 0d 0a 54 68 65 20 6f 72 69  ms.<br>..The ori
1770: 67 69 6e 61 6c 20 64 61 74 61 73 65 74 73 20 68  ginal datasets h
1780: 61 76 65 20 62 65 65 6e 20 73 6c 69 67 68 74 6c  ave been slightl
1790: 79 20 72 65 61 72 72 61 6e 67 65 64 20 69 6e 20  y rearranged in 
17a0: 61 20 6d 6f 72 65 20 63 6f 6e 76 65 6e 69 65 6e  a more convenien
17b0: 74 20 66 6f 72 6d 2e 0d 0a 41 6c 6c 20 67 65 6f  t form...All geo
17c0: 6d 65 74 72 69 65 73 20 61 72 65 20 69 6e 20 74  metries are in t
17d0: 68 65 20 3c 62 3e 53 52 49 44 20 33 32 36 33 32  he <b>SRID 32632
17e0: 3c 2f 62 3e 20 28 3c 69 3e 57 47 53 20 38 34 20  </b> (<i>WGS 84 
17f0: 2f 20 55 54 4d 20 7a 6f 6e 65 20 33 32 4e 3c 2f  / UTM zone 32N</
1800: 69 3e 29 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e  i>):..<ul>..<li>
1810: 3c 62 3e 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f  <b>census_2011</
1820: 62 3e 3a 20 61 6c 6c 20 43 65 6e 73 75 73 20 41  b>: all Census A
1830: 72 65 61 73 20 28 32 30 31 31 29 20 63 6f 76 65  reas (2011) cove
1840: 72 69 6e 67 20 54 75 73 63 61 6e 79 2e 3c 62 72  ring Tuscany.<br
1850: 3e 0d 0a 3c 75 3e 4e 6f 74 65 3a 3c 2f 75 3e 20  >..<u>Note:</u> 
1860: 73 65 76 65 72 61 6c 20 43 65 6e 73 75 73 20 41  several Census A
1870: 72 65 61 73 20 61 72 65 20 63 6f 6d 70 6c 65 74  reas are complet
1880: 65 6c 79 20 75 6e 69 6e 68 61 62 69 74 65 64 20  ely uninhabited 
1890: 28 6c 61 6b 65 73 2c 20 6d 61 72 73 68 6c 61 6e  (lakes, marshlan
18a0: 64 73 2c 20 68 69 67 68 20 6d 6f 75 6e 74 61 69  ds, high mountai
18b0: 6e 73 20 61 6e 64 20 61 6c 69 6b 65 29 2e 3c 2f  ns and alike).</
18c0: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 70 70 6c 5f  li>..<li><b>ppl_
18d0: 32 30 31 31 3c 2f 62 3e 3a 20 50 6f 70 75 6c 61  2011</b>: Popula
18e0: 74 65 64 20 50 6c 61 63 65 73 20 28 64 65 66 69  ted Places (defi
18f0: 6e 65 64 20 61 73 20 61 6e 20 61 67 67 72 65 67  ned as an aggreg
1900: 61 74 69 6f 6e 20 6f 66 20 43 65 6e 73 75 73 20  ation of Census 
1910: 41 72 65 61 73 29 2e 3c 62 72 3e 0d 0a 3c 75 3e  Areas).<br>..<u>
1920: 4e 6f 74 65 3c 2f 75 3e 3a 20 6e 6f 74 20 61 6c  Note</u>: not al
1930: 6c 20 43 65 6e 73 75 73 20 41 72 65 61 73 20 62  l Census Areas b
1940: 65 6c 6f 6e 67 20 74 6f 20 61 20 50 6f 70 75 6c  elong to a Popul
1950: 61 74 65 64 20 50 6c 61 63 65 3a 20 74 68 65 72  ated Place: ther
1960: 65 20 61 72 65 20 6d 61 6e 79 20 73 65 6c 66 2d  e are many self-
1970: 73 74 61 6e 64 69 6e 67 20 64 69 73 70 65 72 73  standing dispers
1980: 65 64 20 72 75 72 61 6c 20 61 72 65 61 73 2e 3c  ed rural areas.<
1990: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 6f 6d  /li>..<li><b>com
19a0: 5f 32 30 31 31 3c 2f 62 3e 3a 20 54 75 73 63 61  _2011</b>: Tusca
19b0: 6e 79 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65  ny Municipalitie
19c0: 73 20 2f 20 4c 6f 63 61 6c 20 43 6f 75 6e 63 69  s / Local Counci
19d0: 6c 73 20 32 30 31 31 20 28 64 65 66 69 6e 65 64  ls 2011 (defined
19e0: 20 61 73 20 61 6e 20 61 67 67 72 65 67 61 74 69   as an aggregati
19f0: 6f 6e 73 20 6f 66 20 43 65 6e 73 75 73 20 41 72  ons of Census Ar
1a00: 65 61 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  eas).</li>..<li>
1a10: 3c 62 3e 63 6f 6d 5f 32 30 31 34 5f 31 35 3c 2f  <b>com_2014_15</
1a20: 62 3e 3a 20 66 65 77 20 6e 65 77 20 4d 75 6e 69  b>: few new Muni
1a30: 63 69 70 61 6c 69 74 69 65 73 20 63 72 65 61 74  cipalities creat
1a40: 65 64 20 64 75 72 69 6e 67 20 79 65 61 72 73 20  ed during years 
1a50: 32 30 31 34 2f 31 35 20 62 79 20 6d 65 72 67 69  2014/15 by mergi
1a60: 6e 67 20 70 72 65 2d 65 78 69 73 74 69 6e 67 20  ng pre-existing 
1a70: 73 6d 61 6c 6c 65 72 20 4d 75 6e 69 63 69 70 61  smaller Municipa
1a80: 6c 69 74 69 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c  lities.</li>..<l
1a90: 69 3e 3c 62 3e 70 72 6f 76 5f 32 30 31 31 3c 2f  i><b>prov_2011</
1aa0: 62 3e 3a 20 54 75 73 63 61 6e 79 20 50 72 6f 76  b>: Tuscany Prov
1ab0: 69 6e 63 65 73 20 2f 20 43 6f 75 6e 74 69 65 73  inces / Counties
1ac0: 20 28 64 65 66 69 6e 65 64 20 61 73 20 61 6e 20   (defined as an 
1ad0: 61 67 67 72 65 67 61 74 69 6f 6e 20 6f 66 20 4d  aggregation of M
1ae0: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 29 2e 3c  unicipalities).<
1af0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 72 65 67  /li>..<li><b>reg
1b00: 5f 32 30 31 31 3c 2f 62 3e 3a 20 54 75 73 63 61  _2011</b>: Tusca
1b10: 6e 79 20 52 65 67 69 6f 6e 20 28 64 65 66 69 6e  ny Region (defin
1b20: 65 64 20 61 73 20 61 6e 20 61 67 67 72 65 67 61  ed as an aggrega
1b30: 74 69 6f 6e 20 6f 66 20 50 72 6f 76 69 6e 63 65  tion of Province
1b40: 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6a 75  s).</li>..<li>ju
1b50: 73 74 20 3c 62 3e 63 65 6e 73 75 73 5f 32 30 31  st <b>census_201
1b60: 31 3c 2f 62 3e 20 61 6c 6f 6e 65 20 73 75 70 70  1</b> alone supp
1b70: 6f 72 74 73 20 67 65 6f 6d 65 74 72 69 65 73 3b  orts geometries;
1b80: 20 61 6e 79 20 6f 74 68 65 72 20 61 64 6d 69 6e   any other admin
1b90: 69 73 74 72 61 74 69 76 65 20 6c 65 76 65 6c 20  istrative level 
1ba0: 69 73 20 73 69 6d 70 6c 79 20 64 65 66 69 6e 65  is simply define
1bb0: 64 20 62 79 20 72 65 6c 61 74 69 6f 6e 61 6c 20  d by relational 
1bc0: 63 6f 64 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75  codes.</li>..</u
1bd0: 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 75 6e 63  l></li>..<li>unc
1be0: 6f 6d 70 72 65 73 73 20 74 68 65 20 64 6f 77 6e  ompress the down
1bf0: 6c 6f 61 64 65 64 20 64 62 2d 66 69 6c 65 20 28  loaded db-file (
1c00: 3c 62 3e 3c 69 3e 74 75 73 63 61 6e 79 2d 63 65  <b><i>tuscany-ce
1c10: 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 74 65  nsus-2011.sqlite
1c20: 3c 2f 69 3e 3c 2f 62 3e 29 2e 3c 2f 6c 69 3e 0d  </i></b>).</li>.
1c30: 0a 3c 6c 69 3e 6e 6f 77 20 79 6f 75 20 63 61 6e  .<li>now you can
1c40: 20 66 69 6e 61 6c 6c 79 20 73 74 61 72 74 20 61   finally start a
1c50: 20 53 70 61 74 69 61 4c 69 74 65 20 73 65 73 73   SpatiaLite sess
1c60: 69 6f 6e 20 75 73 69 6e 67 20 79 6f 75 72 20 70  ion using your p
1c70: 72 65 66 65 72 72 65 64 20 53 70 61 74 69 61 4c  referred SpatiaL
1c80: 69 74 65 20 66 72 6f 6e 74 20 65 6e 64 20 74 6f  ite front end to
1c90: 6f 6c 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c  ol:..<ul>..<li><
1ca0: 75 3e 41 74 74 65 6e 74 69 6f 6e 3c 2f 75 3e 3a  u>Attention</u>:
1cb0: 20 79 6f 75 20 6d 75 73 74 20 6e 6f 74 20 64 69   you must not di
1cc0: 72 65 63 74 6c 79 20 63 6f 6e 6e 65 63 74 20 74  rectly connect t
1cd0: 6f 20 3c 62 3e 3c 69 3e 74 75 73 63 61 6e 79 2d  o <b><i>tuscany-
1ce0: 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c 69  census-2011.sqli
1cf0: 74 65 3c 2f 69 3e 3c 2f 62 3e 3b 20 79 6f 75 20  te</i></b>; you 
1d00: 61 72 65 20 65 78 70 65 63 74 65 64 20 69 6e 73  are expected ins
1d10: 74 65 61 64 20 74 6f 20 63 6f 6e 6e 65 63 74 20  tead to connect 
1d20: 61 20 6e 65 77 20 28 65 6d 70 74 79 29 20 44 42  a new (empty) DB
1d30: 2d 66 69 6c 65 20 6e 61 6d 65 64 20 3c 62 3e 74  -file named <b>t
1d40: 75 73 63 61 6e 79 2d 74 6f 70 6f 2d 32 30 31 31  uscany-topo-2011
1d50: 2e 73 71 6c 69 74 65 3c 2f 62 3e 3c 2f 6c 69 3e  .sqlite</b></li>
1d60: 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 2f  ..</ul></li>..</
1d70: 6f 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d  ol>..<verbatim>.
1d80: 0a 53 45 4c 45 43 54 20 43 72 65 61 74 65 54 6f  .SELECT CreateTo
1d90: 70 6f 6c 6f 67 79 28 27 63 65 6e 73 75 73 32 30  pology('census20
1da0: 31 31 27 2c 20 33 32 36 33 32 2c 20 30 2c 20 30  11', 32632, 0, 0
1db0: 29 3b 0d 0a 31 0d 0a 0d 0a 41 54 54 41 43 48 20  );..1....ATTACH 
1dc0: 44 41 54 41 42 41 53 45 20 22 2e 2f 74 75 73 63  DATABASE "./tusc
1dd0: 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e  any-census-2011.
1de0: 73 71 6c 69 74 65 22 20 41 53 20 69 73 74 61 74  sqlite" AS istat
1df0: 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f  ;....SELECT Topo
1e00: 47 65 6f 5f 46 72 6f 6d 47 65 6f 54 61 62 6c 65  Geo_FromGeoTable
1e10: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27  ('census2011', '
1e20: 69 73 74 61 74 27 2c 20 27 63 65 6e 73 75 73 5f  istat', 'census_
1e30: 32 30 31 31 27 2c 20 4e 55 4c 4c 2c 20 30 2c 20  2011', NULL, 0, 
1e40: 35 31 32 2c 20 2d 31 29 3b 0d 0a 31 0d 0a 0d 0a  512, -1);..1....
1e50: 53 45 4c 45 43 54 20 53 54 5f 56 61 6c 69 64 61  SELECT ST_Valida
1e60: 74 65 54 6f 70 6f 47 65 6f 28 27 63 65 6e 73 75  teTopoGeo('censu
1e70: 73 32 30 31 31 27 29 3b 0d 0a 4e 55 4c 4c 0d 0a  s2011');..NULL..
1e80: 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20  ..SELECT * FROM 
1e90: 54 45 4d 50 2e 63 65 6e 73 75 73 32 30 31 31 5f  TEMP.census2011_
1ea0: 76 61 6c 69 64 61 74 65 5f 74 6f 70 6f 67 65 6f  validate_topogeo
1eb0: 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f  ;....SELECT Topo
1ec0: 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f 4c 61  Geo_CreateTopoLa
1ed0: 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27  yer('census2011'
1ee0: 2c 20 27 69 73 74 61 74 27 2c 20 27 63 65 6e 73  , 'istat', 'cens
1ef0: 75 73 5f 32 30 31 31 27 2c 20 4e 55 4c 4c 2c 20  us_2011', NULL, 
1f00: 27 63 65 6e 73 75 73 5f 61 72 65 61 73 27 29 3b  'census_areas');
1f10: 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f  ..1....SELECT To
1f20: 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61  poGeo_InitTopoLa
1f30: 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27  yer('census2011'
1f40: 2c 20 27 69 73 74 61 74 27 2c 20 27 70 6f 70 5f  , 'istat', 'pop_
1f50: 70 70 6c 5f 32 30 31 31 27 2c 20 27 70 70 6c 27  ppl_2011', 'ppl'
1f60: 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20  );..1....SELECT 
1f70: 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f  TopoGeo_InitTopo
1f80: 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31  Layer('census201
1f90: 31 27 2c 20 27 69 73 74 61 74 27 2c 20 27 70 6f  1', 'istat', 'po
1fa0: 70 5f 63 6f 6d 5f 32 30 31 31 27 2c 20 27 63 6f  p_com_2011', 'co
1fb0: 6d 27 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43  m');..1....SELEC
1fc0: 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f  T TopoGeo_InitTo
1fd0: 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32  poLayer('census2
1fe0: 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c 20 27  011', 'istat', '
1ff0: 70 6f 70 5f 70 72 6f 76 5f 32 30 31 31 27 2c 20  pop_prov_2011', 
2000: 27 70 72 6f 76 27 29 3b 0d 0a 31 0d 0a 0d 0a 53  'prov');..1....S
2010: 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e  ELECT TopoGeo_In
2020: 69 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e  itTopoLayer('cen
2030: 73 75 73 32 30 31 31 27 2c 20 27 69 73 74 61 74  sus2011', 'istat
2040: 27 2c 20 27 70 6f 70 5f 72 65 67 5f 32 30 31 31  ', 'pop_reg_2011
2050: 27 2c 20 27 72 65 67 27 29 3b 0d 0a 31 0d 0a 0d  ', 'reg');..1...
2060: 0a 44 45 54 41 43 48 20 44 41 54 41 42 41 53 45  .DETACH DATABASE
2070: 20 69 73 74 61 74 3b 0d 0a 3c 2f 76 65 72 62 61   istat;..</verba
2080: 74 69 6d 3e 0d 0a 57 65 27 6c 6c 20 73 74 61 72  tim>..We'll star
2090: 74 20 74 68 69 73 20 70 72 61 63 74 69 63 61 6c  t this practical
20a0: 20 74 75 74 6f 72 69 61 6c 20 62 79 20 64 75 6c   tutorial by dul
20b0: 79 20 72 65 70 6c 69 63 61 74 69 6e 67 20 74 68  y replicating th
20c0: 65 20 73 61 6d 65 20 73 74 65 70 73 20 77 65 27  e same steps we'
20d0: 76 65 20 61 6c 72 65 61 64 79 20 65 78 61 6d 69  ve already exami
20e0: 6e 65 64 20 69 6e 20 74 68 65 20 69 6e 74 65 72  ned in the inter
20f0: 6d 65 64 69 61 74 65 20 74 75 74 6f 72 69 61 6c  mediate tutorial
2100: 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 77 65 27  :..<ul>..<li>we'
2110: 6c 6c 20 63 72 65 61 74 65 20 61 20 6e 65 77 20  ll create a new 
2120: 32 44 20 54 6f 70 6f 6c 6f 67 79 20 6e 61 6d 65  2D Topology name
2130: 64 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 3c  d <b>census2011<
2140: 2f 62 3e 20 61 6e 64 20 6c 6f 63 61 74 65 64 20  /b> and located 
2150: 69 6e 74 6f 20 3c 62 3e 53 52 49 44 20 33 32 36  into <b>SRID 326
2160: 33 32 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c  32</b>.</li>..<l
2170: 69 3e 74 68 65 6e 20 77 65 27 6c 6c 20 3c 69 3e  i>then we'll <i>
2180: 61 74 74 61 63 68 3c 2f 69 3e 20 74 68 65 20 3c  attach</i> the <
2190: 62 3e 74 75 73 63 61 6e 79 2d 74 6f 70 6f 2d 32  b>tuscany-topo-2
21a0: 30 31 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 20 65  011.sqlite</b> e
21b0: 78 74 65 72 6e 61 6c 20 44 42 2d 66 69 6c 65 2e  xternal DB-file.
21c0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6e 6f 77 20 77  </li>..<li>now w
21d0: 65 27 6c 6c 20 70 6f 70 75 6c 61 74 65 20 74 68  e'll populate th
21e0: 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 3c  e <b>census2011<
21f0: 2f 62 3e 20 54 6f 70 6f 6c 6f 67 79 20 62 79 20  /b> Topology by 
2200: 69 6d 70 6f 72 74 69 6e 67 20 74 68 65 20 3c 62  importing the <b
2210: 3e 69 73 74 61 74 2e 63 65 6e 73 75 73 5f 32 30  >istat.census_20
2220: 31 31 3c 2f 62 3e 20 47 65 6f 54 61 62 6c 65 2c  11</b> GeoTable,
2230: 20 61 6e 64 20 74 68 65 6e 20 77 65 27 6c 6c 20   and then we'll 
2240: 69 6d 6d 65 64 69 61 74 65 6c 79 20 63 68 65 63  immediately chec
2250: 6b 20 69 66 20 74 68 69 73 20 54 6f 70 6f 6c 6f  k if this Topolo
2260: 67 79 20 69 73 20 66 75 6c 6c 79 20 76 61 6c 69  gy is fully vali
2270: 64 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62  d.</li>..</ul><b
2280: 72 3e 0d 0a 4e 6f 77 20 77 65 20 61 72 65 20 66  r>..Now we are f
2290: 69 6e 61 6c 6c 79 20 72 65 61 64 79 20 74 6f 20  inally ready to 
22a0: 73 74 61 72 74 20 64 65 66 69 6e 69 6e 67 20 61  start defining a
22b0: 6c 6c 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73  ll <b>TopoLayers
22c0: 3c 2f 62 3e 20 62 61 73 65 64 20 6f 6e 20 74 68  </b> based on th
22d0: 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 3c  e <b>census2011<
22e0: 2f 62 3e 20 54 6f 70 6f 6c 6f 67 79 3b 20 65 61  /b> Topology; ea
22f0: 63 68 20 73 69 6e 67 6c 65 20 54 6f 70 6f 4c 61  ch single TopoLa
2300: 79 65 72 20 77 69 6c 6c 20 70 72 65 63 69 73 65  yer will precise
2310: 6c 79 20 72 65 70 72 65 73 65 6e 74 20 73 6f 6d  ly represent som
2320: 65 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65  e administrative
2330: 20 6c 65 76 65 6c 2c 20 61 6e 64 20 61 6c 6c 20   level, and all 
2340: 54 6f 70 6f 4c 61 79 65 72 73 20 61 6c 74 6f 67  TopoLayers altog
2350: 65 74 68 65 72 20 77 69 6c 6c 20 63 6f 6d 70 6c  ether will compl
2360: 65 74 65 6c 79 20 72 65 70 72 65 73 65 6e 74 20  etely represent 
2370: 74 68 65 20 77 68 6f 6c 65 20 54 75 73 63 61 6e  the whole Tuscan
2380: 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20   administrative 
2390: 68 69 65 72 61 72 63 68 79 2e 0d 0a 3c 6f 6c 3e  hierarchy...<ol>
23a0: 0d 0a 3c 6c 69 3e 73 6f 20 77 65 27 6c 6c 20 64  ..<li>so we'll d
23b0: 75 6c 79 20 69 6e 76 6f 6b 65 20 3c 62 3e 54 6f  uly invoke <b>To
23c0: 70 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f  poGeo_CreateTopo
23d0: 4c 61 79 65 72 28 29 3c 2f 62 3e 20 69 6e 20 6f  Layer()</b> in o
23e0: 72 64 65 72 20 74 6f 20 63 6f 6d 70 6c 65 74 65  rder to complete
23f0: 6c 79 20 64 65 66 69 6e 65 20 61 20 66 69 72 73  ly define a firs
2400: 74 20 54 6f 70 6f 4c 61 79 65 72 20 72 65 70 72  t TopoLayer repr
2410: 65 73 65 6e 74 69 6e 67 20 3c 62 3e 43 65 6e 73  esenting <b>Cens
2420: 75 73 20 41 72 65 61 73 3c 2f 62 3e 2e 3c 62 72  us Areas</b>.<br
2430: 3e 0d 0a 3c 75 3e 52 65 63 61 6c 6c 3c 2f 75 3e  >..<u>Recall</u>
2440: 3a 20 74 68 65 20 3c 62 3e 69 73 74 61 74 2e 63  : the <b>istat.c
2450: 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20 69  ensus_2011</b> i
2460: 73 20 74 68 65 20 75 6e 69 71 75 65 20 72 65 61  s the unique rea
2470: 6c 20 47 65 6f 54 61 62 6c 65 20 77 65 20 68 61  l GeoTable we ha
2480: 76 65 20 69 6e 20 6f 75 72 20 69 6e 69 74 69 61  ve in our initia
2490: 6c 20 64 61 74 61 73 65 74 2c 20 62 65 63 61 75  l dataset, becau
24a0: 73 65 20 69 74 20 63 6f 6e 74 61 69 6e 73 20 62  se it contains b
24b0: 6f 74 68 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20  oth information 
24c0: 61 74 74 72 69 62 75 74 65 73 20 61 6e 64 20 67  attributes and g
24d0: 65 6f 6d 65 74 72 69 65 73 3b 20 61 6e 64 20 65  eometries; and e
24e0: 61 63 68 20 43 65 6e 73 75 73 20 41 72 65 61 20  ach Census Area 
24f0: 69 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 64  is expected to d
2500: 69 72 65 63 74 6c 79 20 63 6f 72 72 65 73 70 6f  irectly correspo
2510: 6e 64 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 54  nd to a single T
2520: 6f 70 6f 6c 6f 67 79 20 46 61 63 65 2e 20 28 3c  opology Face. (<
2530: 69 3e 77 65 27 6c 6c 20 65 78 61 6d 69 6e 65 20  i>we'll examine 
2540: 6c 61 74 65 72 20 69 6e 20 6d 6f 72 65 20 64 65  later in more de
2550: 70 74 68 20 68 6f 77 20 54 6f 70 6f 4c 61 79 65  pth how TopoLaye
2560: 72 20 2f 20 54 6f 70 6f 46 65 61 74 75 72 65 20  r / TopoFeature 
2570: 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 20 68 61  relationships ha
2580: 76 65 20 62 65 65 6e 20 61 63 74 75 61 6c 6c 79  ve been actually
2590: 20 64 65 66 69 6e 65 64 3c 2f 69 3e 29 2e 3c 2f   defined</i>).</
25a0: 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 6e 20 77 65  li>..<li>then we
25b0: 27 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 62 79 20  'll continue by 
25c0: 64 65 66 69 6e 69 6e 67 20 73 65 76 65 72 61 6c  defining several
25d0: 20 66 75 72 74 68 65 72 20 54 6f 70 6f 4c 61 79   further TopoLay
25e0: 65 72 73 20 72 65 73 70 65 63 74 69 76 65 6c 79  ers respectively
25f0: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74   corresponding t
2600: 6f 20 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20 50  o <b>Populated P
2610: 6c 61 63 65 73 3c 2f 62 3e 2c 20 3c 62 3e 4d 75  laces</b>, <b>Mu
2620: 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e  nicipalities</b>
2630: 2c 20 3c 62 3e 50 72 6f 76 69 6e 63 65 73 3c 2f  , <b>Provinces</
2640: 62 3e 20 61 6e 64 20 3c 62 3e 52 65 67 69 6f 6e  b> and <b>Region
2650: 3c 2f 62 3e 20 61 64 6d 69 6e 69 73 74 72 61 74  </b> administrat
2660: 69 76 65 20 6c 65 76 65 6c 73 2e 3c 62 72 3e 0d  ive levels.<br>.
2670: 0a 3c 75 3e 52 65 63 61 6c 6c 3c 2f 75 3e 3a 20  .<u>Recall</u>: 
2680: 61 6c 6c 20 74 68 65 73 65 20 61 64 6d 69 6e 69  all these admini
2690: 73 74 72 61 74 69 76 65 20 6c 65 76 65 6c 73 20  strative levels 
26a0: 69 6e 20 74 68 65 20 69 6e 69 74 69 61 6c 20 64  in the initial d
26b0: 61 74 61 73 65 74 20 61 72 65 20 73 69 6d 70 6c  ataset are simpl
26c0: 79 20 64 65 66 69 6e 65 64 20 62 79 20 72 65 6c  y defined by rel
26d0: 61 74 69 6f 6e 61 6c 20 63 6f 64 65 73 20 69 6e  ational codes in
26e0: 74 65 6e 64 65 64 20 74 6f 20 61 67 67 72 65 67  tended to aggreg
26f0: 61 74 65 20 6c 6f 77 65 72 20 6c 65 76 65 6c 20  ate lower level 
2700: 65 6e 74 69 74 69 65 73 3b 20 69 6e 20 74 68 69  entities; in thi
2710: 73 20 63 61 73 65 20 74 68 65 72 65 20 61 72 65  s case there are
2720: 20 6e 6f 20 65 78 70 6c 69 63 69 74 20 67 65 6f   no explicit geo
2730: 6d 65 74 72 69 65 73 20 61 74 20 61 6c 6c 2e 20  metries at all. 
2740: 53 6f 20 61 72 65 20 61 72 65 20 6e 6f 74 20 64  So are are not d
2750: 69 72 65 63 74 6c 79 20 61 6c 6c 6f 77 65 64 20  irectly allowed 
2760: 74 6f 20 63 72 65 61 74 65 20 61 20 66 75 6c 6c  to create a full
2770: 79 20 64 65 66 69 6e 65 64 20 54 6f 70 6f 4c 61  y defined TopoLa
2780: 79 65 72 2c 20 61 6e 64 20 63 61 6c 6c 69 6e 67  yer, and calling
2790: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 61   <b>TopoGeo_Crea
27a0: 74 65 54 6f 70 6f 6c 61 79 65 72 28 29 3c 2f 62  teTopolayer()</b
27b0: 3e 20 69 73 20 6a 75 73 74 20 69 6d 70 6f 73 73  > is just imposs
27c0: 69 62 6c 65 20 62 65 63 61 75 73 65 20 77 65 20  ible because we 
27d0: 6c 61 63 6b 20 61 6e 79 20 61 70 70 72 6f 70 72  lack any appropr
27e0: 69 61 74 65 20 47 65 6f 6d 65 74 72 79 20 63 6f  iate Geometry co
27f0: 6c 75 6d 6e 2e 3c 62 72 3e 0d 0a 41 6e 79 77 61  lumn.<br>..Anywa
2800: 79 20 77 65 20 63 61 6e 20 69 6e 76 6f 6b 65 20  y we can invoke 
2810: 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54  <b>TopoGeo_InitT
2820: 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 3b 20  opoLayer()</b>; 
2830: 74 68 69 73 20 77 69 6c 6c 20 69 6e 69 74 69 61  this will initia
2840: 6c 69 7a 65 20 61 6e 20 6f 6e 6c 79 20 70 61 72  lize an only par
2850: 74 69 61 6c 6c 79 20 64 65 66 69 6e 65 64 20 54  tially defined T
2860: 6f 70 6f 4c 61 79 65 72 2c 20 62 75 74 20 77 65  opoLayer, but we
2870: 20 63 61 6e 20 65 61 73 69 6c 79 20 63 6f 6d 70   can easily comp
2880: 6c 65 74 65 20 69 6e 20 61 20 73 65 63 6f 6e 64  lete in a second
2890: 20 74 69 6d 65 20 61 6e 79 20 6d 69 73 73 69 6e   time any missin
28a0: 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 73 6f  g information so
28b0: 20 74 6f 20 67 65 74 20 61 20 70 72 6f 70 65 72   to get a proper
28c0: 6c 79 20 77 6f 72 6b 69 6e 67 20 54 6f 70 6f 4c  ly working TopoL
28d0: 61 79 65 72 20 28 3c 69 3e 61 73 20 77 65 27 6c  ayer (<i>as we'l
28e0: 6c 20 73 65 65 20 6c 61 74 65 72 20 69 6e 20 66  l see later in f
28f0: 75 6c 6c 20 64 65 74 61 69 6c 29 2e 3c 2f 6c 69  ull detail).</li
2900: 3e 0d 0a 3c 6c 69 3e 66 69 6e 61 6c 6c 79 20 77  >..<li>finally w
2910: 65 27 6c 6c 20 3c 69 3e 64 65 74 61 63 68 3c 2f  e'll <i>detach</
2920: 69 3e 20 74 68 65 20 6e 6f 77 20 75 73 65 6c 65  i> the now usele
2930: 73 73 20 65 78 74 65 72 6e 61 6c 20 64 62 2d 66  ss external db-f
2940: 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e  ile.</li>..</ol>
2950: 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 3e 54 6f 70 6f  ..<hr>..<h3>Topo
2960: 4c 61 79 65 72 73 20 2f 20 54 6f 70 6f 46 65 61  Layers / TopoFea
2970: 74 75 72 65 73 3a 20 6c 61 79 6f 75 74 20 6f 66  tures: layout of
2980: 20 44 42 20 54 61 62 6c 65 73 20 61 6e 64 20 63   DB Tables and c
2990: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 72 65 6c  orresponding rel
29a0: 61 74 69 6f 6e 73 68 69 70 73 3c 2f 68 33 3e 0d  ationships</h3>.
29b0: 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 70 61 64 64  .<table cellpadd
29c0: 69 6e 67 3d 22 36 22 20 63 65 6c 6c 73 70 61 63  ing="6" cellspac
29d0: 69 6e 67 3d 22 38 22 3e 0d 0a 3c 74 72 3e 3c 74  ing="8">..<tr><t
29e0: 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d  d>..<b><<i>topo-
29f0: 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f  prefix</i>>_topo
2a00: 6c 61 79 65 72 73 3c 2f 62 3e 0d 0a 3c 76 65 72  layers</b>..<ver
2a10: 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 2a  batim>..SELECT *
2a20: 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31   FROM census2011
2a30: 5f 74 6f 70 6f 6c 61 79 65 72 73 3b 0d 0a 3c 2f  _topolayers;..</
2a40: 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 20 3c  verbatim>..The <
2a50: 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e  b>TopoLayers</b>
2a60: 20 74 61 62 6c 65 20 63 6f 6e 74 61 69 6e 73 20   table contains 
2a70: 61 20 64 69 73 74 69 6e 63 74 20 72 6f 77 20 66  a distinct row f
2a80: 6f 72 20 65 76 65 72 79 20 54 6f 70 6f 4c 61 79  or every TopoLay
2a90: 65 72 20 64 65 66 69 6e 65 64 20 6f 6e 20 74 68  er defined on th
2aa0: 65 20 63 75 72 72 65 6e 74 20 54 6f 70 6f 6c 6f  e current Topolo
2ab0: 67 79 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 45 61 63  gy.<br><br>..Eac
2ac0: 68 20 54 6f 70 6f 4c 61 79 65 72 20 69 73 20 69  h TopoLayer is i
2ad0: 64 65 6e 74 69 66 69 65 64 20 62 79 20 61 6e 20  dentified by an 
2ae0: 3c 62 3e 69 64 3c 2f 62 3e 20 61 6e 64 20 62 79  <b>id</b> and by
2af0: 20 61 20 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3b 20   a <b>name</b>; 
2b00: 62 6f 74 68 20 61 72 65 20 72 65 71 75 69 72 65  both are require
2b10: 64 20 74 6f 20 62 65 20 75 6e 69 71 75 65 20 76  d to be unique v
2b20: 61 6c 75 65 73 2e 0d 0a 3c 2f 74 64 3e 3c 74 64  alues...</td><td
2b30: 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30 31  >.."<i>census201
2b40: 31 5f 74 6f 70 6f 6c 61 79 65 72 73 3c 2f 69 3e  1_topolayers</i>
2b50: 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70  "..<table cellsp
2b60: 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69  an="4" cellpaddi
2b70: 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22  ng="6" bgcolor="
2b80: 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d  #f8f8f0" border=
2b90: 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67  "1">..<tr><td bg
2ba0: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
2bb0: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c  <b>topolayer_id<
2bc0: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
2bd0: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
2be0: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 6e 61 6d  <b>topolayer_nam
2bf0: 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  e</b></td></tr>.
2c00: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
2c10: 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64  right">1</td><td
2c20: 3e 63 65 6e 73 75 73 5f 61 72 65 61 73 3c 2f 74  >census_areas</t
2c30: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
2c40: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
2c50: 3c 2f 74 64 3e 3c 74 64 3e 70 70 6c 3c 2f 74 64  </td><td>ppl</td
2c60: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
2c70: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c  align="right">3<
2c80: 2f 74 64 3e 3c 74 64 3e 63 6f 6d 3c 2f 74 64 3e  /td><td>com</td>
2c90: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61  </tr>..<tr><td a
2ca0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 3c 2f  lign="right">4</
2cb0: 74 64 3e 3c 74 64 3e 70 72 6f 76 3c 2f 74 64 3e  td><td>prov</td>
2cc0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61  </tr>..<tr><td a
2cd0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 3c 2f  lign="right">5</
2ce0: 74 64 3e 3c 74 64 3e 72 65 67 3c 2f 74 64 3e 3c  td><td>reg</td><
2cf0: 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a  /tr>..</table>..
2d00: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
2d10: 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70  <td>..<b><<i>top
2d20: 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f  o-prefix</i>>_to
2d30: 70 6f 66 65 61 74 75 72 65 73 5f 3c 3c 69 3e 74  pofeatures_<<i>t
2d40: 6f 70 6f 6c 61 79 65 72 2d 69 64 3c 2f 69 3e 3e  opolayer-id</i>>
2d50: 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  </b>..<verbatim>
2d60: 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20  ..SELECT * FROM 
2d70: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66  census2011_topof
2d80: 65 61 74 75 72 65 73 5f 32 3b 0d 0a 0d 0a 53 45  eatures_2;....SE
2d90: 4c 45 43 54 20 2a 20 46 52 4f 4d 20 63 65 6e 73  LECT * FROM cens
2da0: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75  us2011_topofeatu
2db0: 72 65 73 5f 34 3b 0d 0a 3c 2f 76 65 72 62 61 74  res_4;..</verbat
2dc0: 69 6d 3e 0d 0a 54 68 65 20 73 61 6d 65 20 54 6f  im>..The same To
2dd0: 70 6f 6c 6f 67 79 20 63 61 6e 20 63 6f 6e 74 61  pology can conta
2de0: 69 6e 20 6d 6f 72 65 20 74 68 61 6e 20 61 20 73  in more than a s
2df0: 69 6e 67 6c 65 20 3c 62 3e 54 6f 70 6f 46 65 61  ingle <b>TopoFea
2e00: 74 75 72 65 73 3c 2f 62 3e 20 74 61 62 6c 65 2c  tures</b> table,
2e10: 20 61 6e 64 20 65 61 63 68 20 54 6f 70 6f 46 65   and each TopoFe
2e20: 61 74 75 72 65 73 20 74 61 62 6c 65 20 63 6f 72  atures table cor
2e30: 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 20 73 69  responds to a si
2e40: 6e 67 6c 65 20 54 6f 70 6f 4c 61 79 65 72 2e 3c  ngle TopoLayer.<
2e50: 62 72 3e 0d 0a 45 76 65 72 79 20 74 61 62 6c 65  br>..Every table
2e60: 20 63 61 6e 20 68 61 76 65 20 61 20 73 70 65 63   can have a spec
2e70: 69 66 69 63 20 6c 61 79 6f 75 74 20 6f 6e 20 69  ific layout on i
2e80: 74 73 20 6f 77 6e 20 28 73 74 72 69 63 74 6c 79  ts own (strictly
2e90: 20 72 65 66 6c 65 63 74 69 6e 67 20 74 68 65 20   reflecting the 
2ea0: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72  information attr
2eb0: 69 62 75 74 65 73 20 66 6f 72 20 65 61 63 68 20  ibutes for each 
2ec0: 6c 61 79 65 72 29 2c 20 61 6e 79 77 61 79 20 61  layer), anyway a
2ed0: 6c 6c 20 74 68 65 6d 20 77 69 6c 6c 20 68 61 76  ll them will hav
2ee0: 65 20 61 20 3c 62 3e 75 6e 69 71 75 65 20 54 6f  e a <b>unique To
2ef0: 70 6f 46 65 61 74 75 72 65 20 69 64 65 6e 74 69  poFeature identi
2f00: 66 69 65 72 3c 2f 62 3e 20 28 3c 62 3e 3c 69 3e  fier</b> (<b><i>
2f10: 66 69 64 3c 2f 69 3e 3c 2f 62 3e 29 20 61 63 74  fid</i></b>) act
2f20: 69 6e 67 20 69 6e 20 74 68 65 20 50 72 69 6d 61  ing in the Prima
2f30: 72 79 20 4b 65 79 20 72 6f 6c 65 2e 3c 62 72 3e  ry Key role.<br>
2f40: 0d 0a 54 68 65 20 72 65 6c 61 74 69 6f 6e 73 68  ..The relationsh
2f50: 69 70 20 62 65 74 77 65 65 6e 20 74 61 62 6c 65  ip between table
2f60: 20 6e 61 6d 65 73 20 61 6e 64 20 54 6f 70 6f 4c   names and TopoL
2f70: 61 79 65 72 73 20 69 73 20 65 73 74 61 62 6c 69  ayers is establi
2f80: 73 68 65 64 20 62 79 20 61 70 70 65 6e 64 69 6e  shed by appendin
2f90: 67 20 61 20 6e 75 6d 65 72 69 63 20 73 75 66 66  g a numeric suff
2fa0: 69 78 20 74 6f 20 74 68 65 20 63 6f 6d 6d 6f 6e  ix to the common
2fb0: 20 6e 61 6d 65 20 74 68 61 74 20 6d 75 73 74 20   name that must 
2fc0: 65 78 61 63 74 6c 79 20 6d 61 74 63 68 20 74 68  exactly match th
2fd0: 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69  e <b>topolayer_i
2fe0: 64 3c 2f 62 3e 20 76 61 6c 75 65 20 64 65 63 6c  d</b> value decl
2ff0: 61 72 65 64 20 69 6e 20 74 68 65 20 3c 62 3e 54  ared in the <b>T
3000: 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 6d 61  opoLayers</b> ma
3010: 69 6e 20 74 61 62 6c 65 2e 3c 62 72 3e 3c 62 72  in table.<br><br
3020: 3e 0d 0a 41 73 20 69 73 20 73 68 6f 77 6e 20 69  >..As is shown i
3030: 6e 20 74 68 69 73 20 65 78 61 6d 70 6c 65 20 74  n this example t
3040: 68 65 20 66 69 72 73 74 20 74 61 62 6c 65 20 3c  he first table <
3050: 62 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70  b>census2011_top
3060: 6f 66 65 61 74 75 72 65 73 5f 32 3c 2f 62 3e 20  ofeatures_2</b> 
3070: 28 3c 69 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64  (<i>topolayer_id
3080: 3c 2f 69 3e 3d 3c 69 3e 32 3c 2f 69 3e 29 20 63  </i>=<i>2</i>) c
3090: 6f 6e 74 61 69 6e 73 20 61 6c 6c 20 54 6f 70 6f  ontains all Topo
30a0: 46 65 61 74 75 72 65 73 20 61 73 73 6f 63 69 61  Features associa
30b0: 74 65 64 20 74 6f 20 74 68 65 20 54 6f 70 6f 4c  ted to the TopoL
30c0: 61 79 65 72 20 3c 62 3e 70 70 6c 3c 2f 62 3e 20  ayer <b>ppl</b> 
30d0: 28 3c 69 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c  (<i>Populated Pl
30e0: 61 63 65 73 3c 2f 69 3e 29 2e 3c 62 72 3e 3c 62  aces</i>).<br><b
30f0: 72 3e 0d 0a 54 68 65 20 73 65 63 6f 6e 64 20 74  r>..The second t
3100: 61 62 6c 65 20 3c 62 3e 63 65 6e 73 75 73 32 30  able <b>census20
3110: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f  11_topofeatures_
3120: 34 3c 2f 62 3e 20 28 3c 69 3e 74 6f 70 6f 6c 61  4</b> (<i>topola
3130: 79 65 72 5f 69 64 3c 2f 69 3e 3d 3c 69 3e 34 3c  yer_id</i>=<i>4<
3140: 2f 69 3e 29 20 63 6f 6e 74 61 69 6e 73 20 61 6c  /i>) contains al
3150: 6c 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 61  l TopoFeatures a
3160: 73 73 6f 63 69 61 74 65 64 20 74 6f 20 74 68 65  ssociated to the
3170: 20 54 6f 70 6f 4c 61 79 65 72 20 3c 62 3e 70 72   TopoLayer <b>pr
3180: 6f 76 3c 2f 62 3e 20 28 3c 69 3e 50 72 6f 76 69  ov</b> (<i>Provi
3190: 6e 63 65 73 3c 2f 69 3e 29 2e 0d 0a 3c 2f 74 64  nces</i>)...</td
31a0: 3e 3c 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75  ><td>.."<i>censu
31b0: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72  s2011_topofeatur
31c0: 65 73 5f 32 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c  es_2</i>"..<tabl
31d0: 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63  e cellspan="4" c
31e0: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62  ellpadding="6" b
31f0: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22  gcolor="#f8f8f0"
3200: 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74   border="1">..<t
3210: 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  r><td bgcolor="#
3220: 66 30 66 30 66 38 22 3e 3c 62 3e 66 69 64 3c 2f  f0f0f8"><b>fid</
3230: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63  b></td>..<td bgc
3240: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c  olor="#f0f0f8"><
3250: 62 3e 63 6f 64 5f 70 70 6c 3c 2f 62 3e 3c 2f 74  b>cod_ppl</b></t
3260: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  d>..<td bgcolor=
3270: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64  "#f0f0f8"><b>cod
3280: 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c  _com</b></td>..<
3290: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
32a0: 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e  0f8"><b>name</b>
32b0: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c  </td>..<td bgcol
32c0: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e  or="#f0f0f8"><b>
32d0: 70 6f 70 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64  pop_2011</b></td
32e0: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  >..<td bgcolor="
32f0: 23 66 30 66 30 66 38 22 3e 3c 62 3e 6d 5f 32 30  #f0f0f8"><b>m_20
3300: 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64  11</b></td>..<td
3310: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66   bgcolor="#f0f0f
3320: 38 22 3e 3c 62 3e 66 5f 32 30 31 31 3c 2f 62 3e  8"><b>f_2011</b>
3330: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
3340: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3350: 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  ">1</td><td alig
3360: 6e 3d 22 72 69 67 68 74 22 3e 32 30 35 31 34 32  n="right">205142
3370: 37 30 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  705</td><td alig
3380: 6e 3d 22 72 69 67 68 74 22 3e 34 35 30 30 31 3c  n="right">45001<
3390: 2f 74 64 3e 3c 74 64 3e 41 6c 62 69 61 6e 6f 20  /td><td>Albiano 
33a0: 4d 61 67 72 61 3c 2f 74 64 3e 3c 74 64 20 61 6c  Magra</td><td al
33b0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 39 30 37  ign="right">1907
33c0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
33d0: 72 69 67 68 74 22 3e 39 31 39 3c 2f 74 64 3e 3c  right">919</td><
33e0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
33f0: 3e 39 38 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  >988</td></tr>..
3400: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  <tr><td align="r
3410: 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 20  ight">2</td><td 
3420: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 30  align="right">20
3430: 35 31 34 32 37 30 36 3c 2f 74 64 3e 3c 74 64 20  5142706</td><td 
3440: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 35  align="right">45
3450: 30 30 31 3c 2f 74 64 3e 3c 74 64 3e 41 75 6c 6c  001</td><td>Aull
3460: 61 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  a</td><td align=
3470: 22 72 69 67 68 74 22 3e 34 33 32 31 3c 2f 74 64  "right">4321</td
3480: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3490: 74 22 3e 32 30 34 36 3c 2f 74 64 3e 3c 74 64 20  t">2046</td><td 
34a0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 32  align="right">22
34b0: 37 35 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74  75</td></tr>..<t
34c0: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  r><td align="rig
34d0: 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 20 61 6c  ht">3</td><td al
34e0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 35 31  ign="right">2051
34f0: 34 32 37 31 30 3c 2f 74 64 3e 3c 74 64 20 61 6c  42710</td><td al
3500: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 35 30 30  ign="right">4500
3510: 31 3c 2f 74 64 3e 3c 74 64 3e 43 61 70 72 69 67  1</td><td>Caprig
3520: 6c 69 6f 6c 61 3c 2f 74 64 3e 3c 74 64 20 61 6c  liola</td><td al
3530: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 32 3c  ign="right">482<
3540: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3550: 69 67 68 74 22 3e 32 32 36 3c 2f 74 64 3e 3c 74  ight">226</td><t
3560: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3570: 32 35 36 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  256</td></tr>..<
3580: 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22  tr><td colspan="
3590: 37 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72  7" align="center
35a0: 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e  "><hr></td></tr>
35b0: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d  ..<tr><td align=
35c0: 22 72 69 67 68 74 22 3e 31 30 31 38 3c 2f 74 64  "right">1018</td
35d0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
35e0: 74 22 3e 31 34 31 30 37 37 35 34 31 35 3c 2f 74  t">1410775415</t
35f0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
3600: 68 74 22 3e 31 30 30 30 30 37 3c 2f 74 64 3e 3c  ht">100007</td><
3610: 74 64 3e 53 61 73 73 65 74 61 3c 2f 74 64 3e 3c  td>Sasseta</td><
3620: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3630: 3e 32 38 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  >285</td><td ali
3640: 67 6e 3d 22 72 69 67 68 74 22 3e 31 33 37 3c 2f  gn="right">137</
3650: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
3660: 67 68 74 22 3e 31 34 38 3c 2f 74 64 3e 3c 2f 74  ght">148</td></t
3670: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67  r>..<tr><td alig
3680: 6e 3d 22 72 69 67 68 74 22 3e 31 30 31 39 3c 2f  n="right">1019</
3690: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
36a0: 67 68 74 22 3e 31 34 31 30 37 38 35 34 31 35 3c  ght">1410785415<
36b0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
36c0: 69 67 68 74 22 3e 31 30 30 30 30 37 3c 2f 74 64  ight">100007</td
36d0: 3e 3c 74 64 3e 54 65 72 72 69 67 6f 6c 69 3c 2f  ><td>Terrigoli</
36e0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
36f0: 67 68 74 22 3e 35 33 37 3c 2f 74 64 3e 3c 74 64  ght">537</td><td
3700: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
3710: 36 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  64</td><td align
3720: 3d 22 72 69 67 68 74 22 3e 32 37 33 3c 2f 74 64  ="right">273</td
3730: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
3740: 0d 0a 3c 62 72 3e 0d 0a 22 3c 69 3e 63 65 6e 73  ..<br>.."<i>cens
3750: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75  us2011_topofeatu
3760: 72 65 73 5f 34 3c 2f 69 3e 22 0d 0a 3c 74 61 62  res_4</i>"..<tab
3770: 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20  le cellspan="4" 
3780: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20  cellpadding="6" 
3790: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30  bgcolor="#f8f8f0
37a0: 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c  " border="1">..<
37b0: 74 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  tr><td bgcolor="
37c0: 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 69 64 3c  #f0f0f8"><b>fid<
37d0: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
37e0: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
37f0: 3c 62 3e 63 6f 64 5f 70 72 6f 76 3c 2f 62 3e 3c  <b>cod_prov</b><
3800: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
3810: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 63  r="#f0f0f8"><b>c
3820: 6f 64 5f 72 65 67 3c 2f 62 3e 3c 2f 74 64 3e 0d  od_reg</b></td>.
3830: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  .<td bgcolor="#f
3840: 30 66 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f  0f0f8"><b>name</
3850: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63  b></td>..<td bgc
3860: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c  olor="#f0f0f8"><
3870: 62 3e 61 62 62 72 65 76 3c 2f 62 3e 3c 2f 74 64  b>abbrev</b></td
3880: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  >..<td bgcolor="
3890: 23 66 30 66 30 66 38 22 3e 3c 62 3e 70 6f 70 5f  #f0f0f8"><b>pop_
38a0: 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c  2011</b></td>..<
38b0: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
38c0: 30 66 38 22 3e 3c 62 3e 6d 5f 32 30 31 31 3c 2f  0f8"><b>m_2011</
38d0: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63  b></td>..<td bgc
38e0: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c  olor="#f0f0f8"><
38f0: 62 3e 66 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64  b>f_2011</b></td
3900: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
3910: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c  align="right">1<
3920: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3930: 69 67 68 74 22 3e 34 35 3c 2f 74 64 3e 3c 74 64  ight">45</td><td
3940: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39   align="right">9
3950: 3c 2f 74 64 3e 3c 74 64 3e 4d 61 73 73 61 26 6e  </td><td>Massa&n
3960: 62 73 70 3b 43 61 72 72 61 72 61 3c 2f 74 64 3e  bsp;Carrara</td>
3970: 3c 74 64 3e 4d 53 3c 2f 74 64 3e 3c 74 64 20 61  <td>MS</td><td a
3980: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 39 39  lign="right">199
3990: 36 35 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  650</td><td alig
39a0: 6e 3d 22 72 69 67 68 74 22 3e 39 35 37 35 34 3c  n="right">95754<
39b0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
39c0: 69 67 68 74 22 3e 31 30 33 38 39 36 3c 2f 74 64  ight">103896</td
39d0: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
39e0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c  align="right">2<
39f0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3a00: 69 67 68 74 22 3e 34 36 3c 2f 74 64 3e 3c 74 64  ight">46</td><td
3a10: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39   align="right">9
3a20: 3c 2f 74 64 3e 3c 74 64 3e 4c 75 63 63 61 3c 2f  </td><td>Lucca</
3a30: 74 64 3e 3c 74 64 3e 4c 55 3c 2f 74 64 3e 3c 74  td><td>LU</td><t
3a40: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3a50: 33 38 38 33 32 37 3c 2f 74 64 3e 3c 74 64 20 61  388327</td><td a
3a60: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 38 36  lign="right">186
3a70: 31 38 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  183</td><td alig
3a80: 6e 3d 22 72 69 67 68 74 22 3e 32 30 32 31 34 34  n="right">202144
3a90: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
3aa0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3ab0: 22 3e 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  ">3</td><td alig
3ac0: 6e 3d 22 72 69 67 68 74 22 3e 34 37 3c 2f 74 64  n="right">47</td
3ad0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3ae0: 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 50 69 73  t">9</td><td>Pis
3af0: 74 6f 69 61 3c 2f 74 64 3e 3c 74 64 3e 50 54 3c  toia</td><td>PT<
3b00: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3b10: 69 67 68 74 22 3e 32 38 37 38 36 36 3c 2f 74 64  ight">287866</td
3b20: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3b30: 74 22 3e 31 33 38 30 35 34 3c 2f 74 64 3e 3c 74  t">138054</td><t
3b40: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3b50: 31 34 39 38 31 32 3c 2f 74 64 3e 3c 2f 74 72 3e  149812</td></tr>
3b60: 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61  ..<tr><td colspa
3b70: 6e 3d 22 38 22 20 61 6c 69 67 6e 3d 22 63 65 6e  n="8" align="cen
3b80: 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f  ter"><hr></td></
3b90: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69  tr>..<tr><td ali
3ba0: 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74 64  gn="right">9</td
3bb0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3bc0: 74 22 3e 35 33 3c 2f 74 64 3e 3c 74 64 20 61 6c  t">53</td><td al
3bd0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74  ign="right">9</t
3be0: 64 3e 3c 74 64 3e 47 72 6f 73 73 65 74 6f 3c 2f  d><td>Grosseto</
3bf0: 74 64 3e 3c 74 64 3e 47 52 3c 2f 74 64 3e 3c 74  td><td>GR</td><t
3c00: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3c10: 32 32 30 35 36 34 3c 2f 74 64 3e 3c 74 64 20 61  220564</td><td a
3c20: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 35  lign="right">105
3c30: 35 38 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  585</td><td alig
3c40: 6e 3d 22 72 69 67 68 74 22 3e 31 31 34 39 37 39  n="right">114979
3c50: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
3c60: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3c70: 22 3e 31 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  ">10</td><td ali
3c80: 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 30 3c 2f  gn="right">100</
3c90: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
3ca0: 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 50  ght">9</td><td>P
3cb0: 72 61 74 6f 3c 2f 74 64 3e 3c 74 64 3e 50 4f 3c  rato</td><td>PO<
3cc0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3cd0: 69 67 68 74 22 3e 32 34 35 39 31 36 3c 2f 74 64  ight">245916</td
3ce0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3cf0: 74 22 3e 31 31 39 30 38 38 3c 2f 74 64 3e 3c 74  t">119088</td><t
3d00: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3d10: 31 32 36 38 32 38 3c 2f 74 64 3e 3c 2f 74 72 3e  126828</td></tr>
3d20: 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74 64  ..</table>..</td
3d30: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e  ></tr>..<tr><td>
3d40: 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72  ..<b><<i>topo-pr
3d50: 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 66 65  efix</i>>_topofe
3d60: 61 74 75 72 65 73 3c 2f 62 3e 0d 0a 3c 76 65 72  atures</b>..<ver
3d70: 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 2a  batim>..SELECT *
3d80: 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31   FROM census2011
3d90: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 3b 0d 0a  _topofeatures;..
3da0: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65  </verbatim>..The
3db0: 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73   <b>TopoFeatures
3dc0: 2d 67 65 6f 6d 65 74 72 69 65 73 3c 2f 62 3e 20  -geometries</b> 
3dd0: 74 61 62 6c 65 20 69 73 20 69 6e 74 65 6e 64 65  table is intende
3de0: 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74 6c 79  d to permanently
3df0: 20 73 74 6f 72 65 20 61 6c 6c 20 72 65 6c 61 74   store all relat
3e00: 69 6f 6e 73 20 62 65 74 77 65 65 6e 20 54 6f 70  ions between Top
3e10: 6f 46 65 61 74 75 72 65 73 20 61 6e 64 20 54 6f  oFeatures and To
3e20: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
3e30: 73 20 72 65 71 75 69 72 65 64 20 69 6e 20 6f 72  s required in or
3e40: 64 65 72 20 74 6f 20 63 6f 72 72 65 63 74 6c 79  der to correctly
3e50: 20 62 75 69 6c 64 20 74 68 65 20 65 78 70 65 63   build the expec
3e60: 74 65 64 20 6f 75 74 70 75 74 20 47 65 6f 6d 65  ted output Geome
3e70: 74 72 79 20 66 6f 72 20 65 61 63 68 20 54 6f 70  try for each Top
3e80: 6f 46 65 61 74 75 72 65 2e 0d 0a 3c 75 6c 3e 0d  oFeature...<ul>.
3e90: 0a 3c 6c 69 3e 3c 62 3e 75 69 64 3c 2f 62 3e 20  .<li><b>uid</b> 
3ea0: 69 73 20 74 68 65 20 50 72 69 6d 61 72 79 20 4b  is the Primary K
3eb0: 65 79 2c 20 61 6e 64 20 69 73 20 73 69 6d 70 6c  ey, and is simpl
3ec0: 79 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 62 65  y intended to be
3ed0: 20 61 6e 20 75 6e 69 71 75 65 20 69 64 65 6e 74   an unique ident
3ee0: 69 66 69 65 72 20 66 6f 72 20 65 61 63 68 20 72  ifier for each r
3ef0: 6f 77 20 62 75 74 20 64 6f 65 73 6e 27 74 20 69  ow but doesn't i
3f00: 6e 74 65 6e 64 20 74 6f 20 68 61 76 65 20 61 6e  ntend to have an
3f10: 79 20 73 70 65 63 69 61 6c 20 6d 65 61 6e 69 6e  y special meanin
3f20: 67 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e  g.</li>..<li><b>
3f30: 6e 6f 64 65 5f 69 64 3c 2f 62 3e 2c 20 3c 62 3e  node_id</b>, <b>
3f40: 65 64 67 65 5f 69 64 3c 2f 62 3e 20 61 6e 64 20  edge_id</b> and 
3f50: 3c 62 3e 66 61 63 65 5f 69 64 3c 2f 62 3e 20 61  <b>face_id</b> a
3f60: 72 65 20 46 6f 72 65 69 67 6e 20 4b 65 79 73 20  re Foreign Keys 
3f70: 64 69 72 65 63 74 6c 79 20 72 65 66 65 72 65 6e  directly referen
3f80: 63 69 6e 67 20 61 20 54 6f 70 6f 6c 6f 67 79 20  cing a Topology 
3f90: 70 72 69 6d 69 74 69 76 65 3b 20 74 77 6f 20 6f  primitive; two o
3fa0: 66 20 74 68 65 73 65 20 76 61 6c 75 65 73 20 61  f these values a
3fb0: 72 65 20 61 6c 77 61 79 73 20 65 78 70 65 63 74  re always expect
3fc0: 65 64 20 74 6f 20 62 65 20 4e 55 4c 4c 2c 20 61  ed to be NULL, a
3fd0: 6e 64 20 6f 6e 6c 79 20 6f 6e 65 20 69 73 20 65  nd only one is e
3fe0: 78 70 65 63 74 65 64 20 74 6f 20 65 66 66 65 63  xpected to effec
3ff0: 74 69 76 65 6c 79 20 72 65 66 65 72 65 6e 63 65  tively reference
4000: 20 61 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d   a Topology prim
4010: 69 74 69 76 65 20 64 65 70 65 6e 64 69 6e 67 20  itive depending 
4020: 6f 6e 20 69 74 73 20 74 79 70 65 2e 3c 2f 6c 69  on its type.</li
4030: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 74 6f 70 6f 6c 61  >..<li><b>topola
4040: 79 65 72 5f 69 64 3c 2f 62 3e 20 61 6e 64 20 3c  yer_id</b> and <
4050: 62 3e 66 69 64 3c 2f 62 3e 20 74 6f 67 65 74 68  b>fid</b> togeth
4060: 65 72 20 61 72 65 20 69 6e 74 65 6e 64 65 64 20  er are intended 
4070: 74 6f 20 65 73 74 61 62 6c 69 73 68 20 61 20 72  to establish a r
4080: 65 6c 61 74 69 6f 6e 61 6c 20 72 65 66 65 72 65  elational refere
4090: 6e 63 65 20 74 6f 20 73 6f 6d 65 20 73 70 65 63  nce to some spec
40a0: 69 66 69 63 20 54 6f 70 6f 46 65 61 74 75 72 65  ific TopoFeature
40b0: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c  .</li>..</ul>..<
40c0: 62 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70 6c 65 20  br>..<u>Example 
40d0: 23 31 3c 2f 75 3e 3a 20 61 6c 6c 20 54 6f 70 6f  #1</u>: all Topo
40e0: 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20  logy primitives 
40f0: 64 69 72 65 63 74 6c 79 20 72 65 66 65 72 65 6e  directly referen
4100: 63 65 64 20 62 79 20 72 6f 77 73 20 64 65 63 6c  ced by rows decl
4110: 61 72 69 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79  aring <b>topolay
4120: 65 72 5f 69 64 3d 32 3c 2f 62 3e 20 61 6e 64 20  er_id=2</b> and 
4130: 3c 62 3e 66 69 64 3d 33 3c 2f 62 3e 20 6d 75 73  <b>fid=3</b> mus
4140: 74 20 62 65 20 61 67 67 72 65 67 61 74 65 64 20  t be aggregated 
4150: 69 6e 20 6f 72 64 65 72 20 74 6f 20 62 75 69 6c  in order to buil
4160: 64 20 74 68 65 20 6f 75 74 70 75 74 20 47 65 6f  d the output Geo
4170: 6d 65 74 72 79 20 63 6f 72 72 65 73 70 6f 6e 64  metry correspond
4180: 69 6e 67 20 74 6f 20 74 68 65 20 50 6f 70 75 6c  ing to the Popul
4190: 61 74 65 64 20 50 6c 61 63 65 20 6f 66 20 3c 62  ated Place of <b
41a0: 3e 43 61 70 72 69 67 6c 69 6f 6c 61 3c 2f 62 3e  >Caprigliola</b>
41b0: 2e 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70 6c  .<br>..<u>Exampl
41c0: 65 20 23 32 3c 2f 75 3e 3a 20 61 6c 6c 20 70 72  e #2</u>: all pr
41d0: 69 6d 69 74 69 76 65 73 20 72 65 66 65 72 65 6e  imitives referen
41e0: 63 65 64 20 62 79 20 72 6f 77 73 20 64 65 63 6c  ced by rows decl
41f0: 61 72 69 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79  aring <b>topolay
4200: 65 72 5f 69 64 3d 34 3c 2f 62 3e 20 61 6e 64 20  er_id=4</b> and 
4210: 3c 62 3e 66 69 64 3d 39 3c 2f 62 3e 20 6d 75 73  <b>fid=9</b> mus
4220: 74 20 62 65 20 61 67 67 72 65 67 61 74 65 64 20  t be aggregated 
4230: 69 6e 20 6f 72 64 65 72 20 74 6f 20 62 75 69 6c  in order to buil
4240: 64 20 74 68 65 20 6f 75 74 70 75 74 20 47 65 6f  d the output Geo
4250: 6d 65 74 72 79 20 63 6f 72 72 65 73 70 6f 6e 64  metry correspond
4260: 69 6e 67 20 74 6f 20 74 68 65 20 50 72 6f 76 69  ing to the Provi
4270: 6e 63 65 20 6f 66 20 3c 62 3e 47 72 6f 73 73 65  nce of <b>Grosse
4280: 74 6f 3c 2f 62 3e 2e 0d 0a 3c 2f 74 64 3e 3c 74  to</b>...</td><t
4290: 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30  d>.."<i>census20
42a0: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 3c  11_topofeatures<
42b0: 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c  /i>"..<table cel
42c0: 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61  lspan="4" cellpa
42d0: 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f  dding="6" bgcolo
42e0: 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72 64  r="#f8f8f0" bord
42f0: 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64  er="1">..<tr><td
4300: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66   bgcolor="#f0f0f
4310: 38 22 3e 3c 62 3e 75 69 64 3c 2f 62 3e 3c 2f 74  8"><b>uid</b></t
4320: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  d>..<td bgcolor=
4330: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e 6f 64  "#f0f0f8"><b>nod
4340: 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c  e_id</b></td>..<
4350: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
4360: 30 66 38 22 3e 3c 62 3e 65 64 67 65 5f 69 64 3c  0f8"><b>edge_id<
4370: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
4380: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
4390: 3c 62 3e 66 61 63 65 5f 69 64 3c 2f 62 3e 3c 2f  <b>face_id</b></
43a0: 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72  td>..<td bgcolor
43b0: 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 74 6f  ="#f0f0f8"><b>to
43c0: 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 3e 3c 2f  polayer_id</b></
43d0: 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72  td>..<td bgcolor
43e0: 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 69  ="#f0f0f8"><b>fi
43f0: 64 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  d</b></td></tr>.
4400: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
4410: 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64  right">1</td><td
4420: 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55  >NULL</td><td>NU
4430: 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  LL</td><td align
4440: 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c  ="right">1</td><
4450: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
4460: 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  >1</td><td align
4470: 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c  ="right">1</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 32 3c 2f 74  ign="right">2</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 32 3c  align="right">2<
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 32 3c  align="right">2<
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 33 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c  >3</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 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  t">3</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 33 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  t">3</td></tr>..
4590: 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d  <tr><td colspan=
45a0: 22 36 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65  "6" align="cente
45b0: 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72  r"><hr></td></tr
45c0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e  >..<tr><td align
45d0: 3d 22 72 69 67 68 74 22 3e 32 38 38 37 30 3c 2f  ="right">28870</
45e0: 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e  td><td>NULL</td>
45f0: 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64  <td>NULL</td><td
4600: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
4610: 38 38 36 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  8864</td><td ali
4620: 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64  gn="right">1</td
4630: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
4640: 74 22 3e 32 38 38 36 37 3c 2f 74 64 3e 3c 2f 74  t">28867</td></t
4650: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67  r>..<tr><td alig
4660: 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 37 31 3c  n="right">28871<
4670: 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64  /td><td>NULL</td
4680: 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74  ><td>NULL</td><t
4690: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
46a0: 32 38 38 36 38 3c 2f 74 64 3e 3c 74 64 20 61 6c  28868</td><td al
46b0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74  ign="right">1</t
46c0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
46d0: 68 74 22 3e 32 38 38 36 38 3c 2f 74 64 3e 3c 2f  ht">28868</td></
46e0: 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c  tr>..</table>..<
46f0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62  /td></tr>..</tab
4700: 6c 65 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c  le>..<table cell
4710: 70 61 64 64 69 6e 67 3d 22 38 22 20 62 67 63 6f  padding="8" bgco
4720: 6c 6f 72 3d 22 23 64 30 66 66 62 30 22 3e 0d 0a  lor="#d0ffb0">..
4730: 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 46 69  <tr><td>..<h3>Fi
4740: 6e 61 6c 20 72 65 6d 61 72 6b 73 3c 2f 68 33 3e  nal remarks</h3>
4750: 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 62 6f 74 68  ..<ol>..<li>both
4760: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 61   <b>TopoGeo_Crea
4770: 74 65 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62  teTopoLayer()</b
4780: 3e 20 61 6e 64 20 3c 62 3e 54 6f 70 6f 47 65 6f  > and <b>TopoGeo
4790: 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 29  _InitTopoLayer()
47a0: 3c 2f 62 3e 20 77 69 6c 6c 20 72 65 67 69 73 74  </b> will regist
47b0: 65 72 20 74 68 65 20 54 6f 70 6f 4c 61 79 65 72  er the TopoLayer
47c0: 20 69 6e 74 6f 20 74 68 65 20 3c 62 3e 54 6f 70   into the <b>Top
47d0: 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 74 61 62 6c  oLayers</b> tabl
47e0: 65 2c 20 61 6e 64 20 77 69 6c 6c 20 63 72 65 61  e, and will crea
47f0: 74 65 20 61 6e 64 20 70 6f 70 75 6c 61 74 65 20  te and populate 
4800: 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  the correspondin
4810: 67 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65  g <b>TopoFeature
4820: 73 3c 2f 62 3e 20 74 61 62 6c 65 20 62 79 20 69  s</b> table by i
4830: 6d 70 6f 72 74 69 6e 67 20 61 6c 6c 20 69 6e 66  mporting all inf
4840: 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75  ormation attribu
4850: 74 65 73 20 66 6f 72 20 65 61 63 68 20 46 65 61  tes for each Fea
4860: 74 75 72 65 20 64 65 66 69 6e 65 64 20 62 79 20  ture defined by 
4870: 74 68 65 20 72 65 66 65 72 65 6e 63 65 20 74 61  the reference ta
4880: 62 6c 65 20 28 6f 72 20 72 65 66 65 72 65 6e 63  ble (or referenc
4890: 65 20 76 69 65 77 29 2e 3c 2f 6c 69 3e 0d 0a 3c  e view).</li>..<
48a0: 6c 69 3e 6f 6e 6c 79 20 3c 62 3e 54 6f 70 6f 47  li>only <b>TopoG
48b0: 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f 4c 61 79  eo_CreateTopoLay
48c0: 65 72 28 29 3c 2f 62 3e 20 77 69 6c 6c 20 61 75  er()</b> will au
48d0: 74 6f 6d 61 74 69 63 61 6c 6c 79 20 70 6f 70 75  tomatically popu
48e0: 6c 61 74 65 20 74 68 65 20 3c 62 3e 54 6f 70 6f  late the <b>Topo
48f0: 46 65 61 74 75 72 65 73 2d 67 65 6f 6d 65 74 72  Features-geometr
4900: 79 3c 2f 62 3e 20 74 61 62 6c 65 2c 20 61 6e 64  y</b> table, and
4910: 20 77 68 69 6c 65 20 64 6f 69 6e 67 20 73 6f 2c   while doing so,
4920: 20 69 64 65 6e 74 69 66 79 20 61 6c 6c 20 72 65   identify all re
4930: 6c 61 74 69 6f 6e 73 68 69 70 73 20 65 78 69 73  lationships exis
4940: 74 69 6e 67 20 62 65 74 77 65 65 6e 20 74 68 65  ting between the
4950: 20 47 65 6f 6d 65 74 72 69 65 73 20 66 6f 75 6e   Geometries foun
4960: 64 20 69 6e 74 6f 20 74 68 65 20 72 65 66 65 72  d into the refer
4970: 65 6e 63 65 20 74 61 62 6c 65 20 6f 72 20 76 69  ence table or vi
4980: 65 77 20 61 6e 64 20 74 68 65 20 54 6f 70 6f 6c  ew and the Topol
4990: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 62  ogy primitives b
49a0: 61 73 65 64 20 6f 6e 20 74 68 65 20 76 61 6c 75  ased on the valu
49b0: 65 73 20 6f 66 20 74 68 65 20 3c 62 3e 54 6f 70  es of the <b>Top
49c0: 6f 53 65 65 64 73 3c 2f 62 3e 2e 3c 2f 6c 69 3e  oSeeds</b>.</li>
49d0: 0d 0a 3c 6c 69 3e 61 73 20 61 70 70 6f 73 65 64  ..<li>as apposed
49e0: 20 74 6f 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49   to <b>TopoGeo_I
49f0: 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f  nitTopoLayer()</
4a00: 62 3e 2c 20 77 68 69 63 68 20 77 69 6c 6c 20 6e  b>, which will n
4a10: 65 76 65 72 20 61 74 74 65 6d 70 74 20 74 6f 20  ever attempt to 
4a20: 69 64 65 6e 74 69 66 79 20 74 68 65 20 72 65 6c  identify the rel
4a30: 61 74 69 6f 6e 73 68 69 70 73 20 69 6e 74 65 72  ationships inter
4a40: 63 75 72 72 69 6e 67 20 62 65 74 77 65 65 6e 20  curring between 
4a50: 6f 75 74 70 75 74 20 47 65 6f 6d 65 74 72 69 65  output Geometrie
4a60: 73 20 61 6e 64 20 54 6f 70 6f 6c 6f 67 79 20 70  s and Topology p
4a70: 72 69 6d 69 74 69 76 65 73 2e 20 54 68 69 73 20  rimitives. This 
4a80: 74 61 73 6b 20 77 69 6c 6c 20 61 6c 77 61 79 73  task will always
4a90: 20 62 65 20 64 65 66 65 72 72 65 64 20 66 6f 72   be deferred for
4aa0: 20 74 68 65 20 75 73 65 72 20 74 6f 20 64 65 61   the user to dea
4ab0: 6c 20 77 69 74 68 20 6c 61 74 65 72 2e 3c 62 72  l with later.<br
4ac0: 3e 0d 0a 59 6f 75 20 63 6f 75 6c 64 2c 20 66 6f  >..You could, fo
4ad0: 72 20 65 78 61 6d 70 6c 65 2c 20 6d 61 6e 75 61  r example, manua
4ae0: 6c 6c 79 20 73 65 6c 65 63 74 20 61 6c 6c 20 54  lly select all T
4af0: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76  opology primitiv
4b00: 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67  es corresponding
4b10: 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 54 6f 70   to a single Top
4b20: 6f 46 65 61 74 75 72 65 3b 20 6f 72 20 6d 6f 72  oFeature; or mor
4b30: 65 20 70 72 6f 62 61 62 6c 79 20 79 6f 75 20 63  e probably you c
4b40: 6f 75 6c 64 20 70 65 72 66 6f 72 6d 20 74 68 69  ould perform thi
4b50: 73 20 74 61 73 6b 20 69 6e 20 61 20 73 65 63 6f  s task in a seco
4b60: 6e 64 20 72 6f 75 6e 64 20 62 79 20 65 78 65 63  nd round by exec
4b70: 75 74 69 6e 67 20 73 6f 6d 65 20 61 70 70 72 6f  uting some appro
4b80: 70 72 69 61 74 65 20 53 51 4c 20 73 74 61 74 65  priate SQL state
4b90: 6d 65 6e 74 20 28 3c 69 3e 61 73 20 77 65 27 6c  ment (<i>as we'l
4ba0: 6c 20 73 65 65 6e 20 73 6f 6f 6e 20 69 6e 20 74  l seen soon in t
4bb0: 68 65 20 6e 65 78 74 20 65 78 61 6d 70 6c 65 3c  he next example<
4bc0: 2f 69 3e 29 2e 20 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c  /i>). ..</ol>..<
4bd0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62  /td></tr>..</tab
4be0: 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c  le><br>..<hr>..<
4bf0: 68 33 3e 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72  h3>TopoGeo_Expor
4c00: 74 54 6f 70 6f 4c 61 79 65 72 3a 20 65 78 70 6f  tTopoLayer: expo
4c10: 72 74 69 6e 67 20 61 20 66 75 6c 6c 20 54 6f 70  rting a full Top
4c20: 6f 4c 61 79 65 72 20 69 6e 74 6f 20 61 20 47 65  oLayer into a Ge
4c30: 6f 54 61 62 6c 65 3c 2f 68 33 3e 0d 0a 3c 74 61  oTable</h3>..<ta
4c40: 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 22  ble width="100%"
4c50: 20 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63    cellspan="4" c
4c60: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62  ellpadding="6" b
4c70: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22  gcolor="#f8f8f0"
4c80: 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74   border="1">..<t
4c90: 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32  r><td colspan="2
4ca0: 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22  " align="center"
4cb0: 3e 3c 62 3e 65 78 70 6f 72 74 69 6e 67 20 74 68  ><b>exporting th
4cc0: 65 20 43 65 6e 73 75 73 20 41 72 65 61 73 20 54  e Census Areas T
4cd0: 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 3c 2f 74 64  opoLayer</b></td
4ce0: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e  ></tr>..<tr><td>
4cf0: 0d 0a 57 65 27 6c 6c 20 73 74 61 72 74 20 62 79  ..We'll start by
4d00: 20 65 78 70 6f 72 74 69 6e 67 20 66 69 72 73 74   exporting first
4d10: 20 74 68 65 20 6f 6e 6c 79 20 63 6f 6d 70 6c 65   the only comple
4d20: 74 65 6c 79 20 64 65 66 69 6e 65 64 20 54 6f 70  tely defined Top
4d30: 6f 4c 61 79 65 72 20 77 65 20 68 61 76 65 20 61  oLayer we have a
4d40: 74 20 74 68 69 73 20 70 6f 69 6e 74 20 69 6e 20  t this point in 
4d50: 74 68 65 20 74 65 73 74 20 44 42 2d 66 69 6c 65  the test DB-file
4d60: 2c 20 69 2e 65 2e 20 3c 62 3e 63 65 6e 73 75 73  , i.e. <b>census
4d70: 5f 61 72 65 61 73 3c 2f 62 3e 0d 0a 3c 76 65 72  _areas</b>..<ver
4d80: 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54  batim>..SELECT T
4d90: 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70  opoGeo_ExportTop
4da0: 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30  oLayer('census20
4db0: 31 31 27 2c 20 27 63 65 6e 73 75 73 5f 61 72 65  11', 'census_are
4dc0: 61 73 27 2c 20 27 6f 75 74 5f 63 65 6e 73 75 73  as', 'out_census
4dd0: 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76  _2011', 1);..</v
4de0: 65 72 62 61 74 69 6d 3e 0d 0a 41 73 20 79 6f 75  erbatim>..As you
4df0: 20 63 61 6e 20 65 61 73 69 6c 79 20 63 68 65 63   can easily chec
4e00: 6b 20 62 79 20 79 6f 75 72 73 65 6c 66 20 61 20  k by yourself a 
4e10: 6e 65 77 20 47 65 6f 54 61 62 6c 65 20 6e 61 6d  new GeoTable nam
4e20: 65 64 20 3c 62 3e 6f 75 74 5f 63 65 6e 73 75 73  ed <b>out_census
4e30: 5f 32 30 31 31 3c 2f 62 3e 20 68 61 73 20 62 65  _2011</b> has be
4e40: 65 6e 20 63 72 65 61 74 65 64 20 62 79 20 3c 62  en created by <b
4e50: 3e 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54  >TopoGeo_ExportT
4e60: 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 3a 0d  opoLayer()</b>:.
4e70: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 69 73 20  .<ul>..<li>this 
4e80: 47 65 6f 54 61 62 6c 65 20 63 6f 6e 74 61 69 6e  GeoTable contain
4e90: 73 20 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72  s all TopoFeatur
4ea0: 65 73 20 64 65 66 69 6e 65 64 20 69 6e 74 6f 20  es defined into 
4eb0: 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 2e 3c 2f  the TopoLayer.</
4ec0: 6c 69 3e 0d 0a 3c 6c 69 3e 65 61 63 68 20 54 6f  li>..<li>each To
4ed0: 70 6f 46 65 61 74 75 72 65 20 66 61 69 74 68 66  poFeature faithf
4ee0: 75 6c 6c 79 20 70 72 65 73 65 72 76 65 73 20 69  ully preserves i
4ef0: 74 73 20 69 6e 69 74 69 61 6c 20 69 6e 66 6f 72  ts initial infor
4f00: 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65  mation attribute
4f10: 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6c 6c  s.</li>..<li>all
4f20: 20 47 65 6f 6d 65 74 72 69 65 73 20 61 72 65 20   Geometries are 
4f30: 70 72 65 63 69 73 65 6c 79 20 62 75 69 6c 74 20  precisely built 
4f40: 62 79 20 61 67 67 72 65 67 61 74 69 6e 67 20 74  by aggregating t
4f50: 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67  he corresponding
4f60: 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74   Topology primit
4f70: 69 76 65 73 20 61 73 20 73 70 65 63 69 66 69 65  ives as specifie
4f80: 64 20 62 79 20 54 6f 70 6f 4c 61 79 65 72 20 2f  d by TopoLayer /
4f90: 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 72 65   TopoFeatures re
4fa0: 6c 61 74 69 6f 6e 73 68 69 70 73 2e 3c 2f 6c 69  lationships.</li
4fb0: 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 3c 62 72 3e  >..</ul><br><br>
4fc0: 0d 0a 54 68 65 20 69 6d 61 67 65 20 65 78 61 6d  ..The image exam
4fd0: 70 6c 69 66 69 65 73 20 61 20 63 68 6f 72 6f 70  plifies a chorop
4fe0: 6c 65 74 68 20 63 65 6e 74 65 72 65 64 20 61 72  leth centered ar
4ff0: 6f 75 6e 64 20 74 68 65 20 49 73 6c 61 6e 64 20  ound the Island 
5000: 6f 66 20 45 6c 62 61 20 61 6e 64 20 62 61 73 65  of Elba and base
5010: 64 20 6f 6e 20 74 68 65 20 3c 62 3e 6f 75 74 5f  d on the <b>out_
5020: 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20  census_2011</b> 
5030: 47 65 6f 54 61 62 6c 65 3a 20 61 6c 6c 20 43 65  GeoTable: all Ce
5040: 6e 73 75 73 20 41 72 65 61 73 20 61 72 65 20 64  nsus Areas are d
5050: 69 73 70 6c 61 79 65 64 20 62 79 20 61 64 6f 70  isplayed by adop
5060: 74 69 6e 67 20 61 20 63 6f 6c 6f 75 72 20 64 69  ting a colour di
5070: 72 65 63 74 6c 79 20 63 6f 72 72 65 73 70 6f 6e  rectly correspon
5080: 64 69 6e 67 20 74 6f 20 74 68 65 69 72 20 70 6f  ding to their po
5090: 70 75 6c 61 74 69 6f 6e 20 64 65 6e 73 69 74 79  pulation density
50a0: 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69  ...</td><td>..<i
50b0: 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f  mg src="https://
50c0: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f  www.gaia-gis.it/
50d0: 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69  gaia-sins/topofi
50e0: 67 73 2f 65 6c 62 61 2d 63 68 6f 72 6f 70 6c 65  gs/elba-chorople
50f0: 74 68 2e 70 6e 67 22 20 61 6c 74 3d 22 65 6c 62  th.png" alt="elb
5100: 61 2d 63 68 6f 72 6f 70 6c 65 74 68 22 3e 0d 0a  a-choropleth">..
5110: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61  </td></tr>..</ta
5120: 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a  ble><br>..<hr>..
5130: 3c 68 33 3e 42 75 69 6c 64 69 6e 67 20 61 20 66  <h3>Building a f
5140: 75 6c 6c 20 68 69 65 72 61 72 63 68 79 20 6f 66  ull hierarchy of
5150: 20 41 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20   Administrative 
5160: 4c 65 76 65 6c 73 20 62 79 20 53 51 4c 20 73 74  Levels by SQL st
5170: 61 74 65 6d 65 6e 74 73 3c 2f 68 33 3e 0d 0a 41  atements</h3>..A
5180: 73 20 77 65 27 76 65 20 61 6c 72 65 61 64 79 20  s we've already 
5190: 73 65 65 6e 20 62 65 66 6f 72 65 20 77 65 20 61  seen before we a
51a0: 72 65 20 6e 6f 77 20 65 78 70 65 63 74 65 64 20  re now expected 
51b0: 74 6f 20 63 6f 6d 70 6c 65 74 65 20 73 6f 6d 65  to complete some
51c0: 77 61 79 20 74 68 65 20 54 6f 70 6f 46 65 61 74  way the TopoFeat
51d0: 75 72 65 73 20 64 65 66 69 6e 69 74 69 6f 6e 73  ures definitions
51e0: 20 73 75 70 70 6f 72 74 69 6e 67 20 74 68 65 20   supporting the 
51f0: 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c 61  <b>Populated Pla
5200: 63 65 73 3c 2f 62 3e 2c 20 3c 62 3e 4d 75 6e 69  ces</b>, <b>Muni
5210: 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2c 20  cipalities</b>, 
5220: 3c 62 3e 50 72 6f 76 69 6e 63 65 73 3c 2f 62 3e  <b>Provinces</b>
5230: 20 61 6e 64 20 3c 62 3e 52 65 67 69 6f 6e 3c 2f   and <b>Region</
5240: 62 3e 20 54 6f 70 6f 4c 61 79 65 72 73 20 77 65  b> TopoLayers we
5250: 27 76 65 20 70 72 65 76 69 6f 75 73 6c 79 20 63  've previously c
5260: 72 65 61 74 65 64 20 62 79 20 63 61 6c 6c 69 6e  reated by callin
5270: 67 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69  g <b>TopoGeo_Ini
5280: 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e  tTopoLayer()</b>
5290: 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 48 61 70 70 69  .<br><br>..Happi
52a0: 6c 79 20 65 6e 6f 75 67 68 20 61 6c 6c 20 74 68  ly enough all th
52b0: 65 73 65 20 61 64 6d 69 6e 69 73 74 72 61 74 69  ese administrati
52c0: 76 65 20 6c 65 76 65 6c 73 20 61 72 65 20 73 69  ve levels are si
52d0: 6d 70 6c 79 20 62 61 73 65 64 20 6f 6e 20 64 69  mply based on di
52e0: 72 65 63 74 20 61 67 67 72 65 67 61 74 69 6f 6e  rect aggregation
52f0: 73 20 6f 66 20 3c 62 3e 43 65 6e 73 75 73 20 41  s of <b>Census A
5300: 72 65 61 73 3c 2f 62 3e 2c 20 73 6f 20 77 65 20  reas</b>, so we 
5310: 6a 75 73 74 20 68 61 76 65 20 74 6f 20 65 78 65  just have to exe
5320: 63 75 74 65 20 66 65 77 20 61 70 70 72 6f 70 72  cute few appropr
5330: 69 61 74 65 20 53 51 4c 20 73 74 61 74 65 6d 65  iate SQL stateme
5340: 6e 74 73 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  nts...<verbatim>
5350: 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65  ..INSERT INTO ce
5360: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61  nsus2011_topofea
5370: 74 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55  tures..SELECT NU
5380: 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63  LL, c.node_id, c
5390: 2e 65 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65  .edge_id, c.face
53a0: 5f 69 64 2c 20 32 2c 20 61 2e 66 69 64 0d 0a 46  _id, 2, a.fid..F
53b0: 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74  ROM census2011_t
53c0: 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 20 41 53  opofeatures_2 AS
53d0: 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32   a..JOIN census2
53e0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
53f0: 5f 31 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f  _1 AS b ON (b.co
5400: 64 5f 70 70 6c 20 3d 20 61 2e 63 6f 64 5f 70 70  d_ppl = a.cod_pp
5410: 6c 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32  l)..JOIN census2
5420: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
5430: 20 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f   AS c ON (c.topo
5440: 6c 61 79 65 72 5f 69 64 20 3d 20 31 20 41 4e 44  layer_id = 1 AND
5450: 20 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 3b   c.fid = b.fid);
5460: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c  ..</verbatim>..<
5470: 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 65 6e 73  ul>..<li><b>cens
5480: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75  us2011_topofeatu
5490: 72 65 73 5f 31 3c 2f 62 3e 20 69 73 20 74 68 65  res_1</b> is the
54a0: 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 74 61   TopoFeatures ta
54b0: 62 6c 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  ble correspondin
54c0: 67 20 74 6f 20 3c 62 3e 43 65 6e 73 75 73 20 41  g to <b>Census A
54d0: 72 65 61 73 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a  reas</b>.</li>..
54e0: 3c 6c 69 3e 3c 62 3e 63 65 6e 73 75 73 32 30 31  <li><b>census201
54f0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32  1_topofeatures_2
5500: 3c 2f 62 3e 20 69 73 20 74 68 65 20 63 6f 72 72  </b> is the corr
5510: 65 73 70 6f 6e 64 73 20 74 6f 20 3c 62 3e 50 6f  esponds to <b>Po
5520: 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73 3c 2f  pulated Places</
5530: 62 3e 3b 20 74 68 65 20 63 6c 61 75 73 65 20 3c  b>; the clause <
5540: 62 3e 62 2e 63 6f 64 5f 70 70 6c 20 3d 20 61 2e  b>b.cod_ppl = a.
5550: 63 6f 64 5f 70 70 6c 3c 2f 62 3e 20 77 69 6c 6c  cod_ppl</b> will
5560: 20 72 65 6c 61 74 69 6f 6e 61 6c 6c 79 20 6a 6f   relationally jo
5570: 69 6e 20 65 61 63 68 20 50 6f 70 75 6c 61 74 65  in each Populate
5580: 64 20 50 6c 61 63 65 20 74 6f 20 69 74 73 20 75  d Place to its u
5590: 6e 64 65 72 6c 61 79 69 6e 67 20 43 65 6e 73 75  nderlaying Censu
55a0: 73 20 41 72 65 61 73 2e 3c 2f 6c 69 3e 0d 0a 3c  s Areas.</li>..<
55b0: 6c 69 3e 73 6f 20 77 65 20 63 61 6e 20 64 75 6c  li>so we can dul
55c0: 79 20 69 6e 73 65 72 74 20 69 6e 74 6f 20 74 68  y insert into th
55d0: 65 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65  e <b>TopoFeature
55e0: 73 2d 67 65 6f 6d 65 74 72 79 3c 2f 62 3e 20 74  s-geometry</b> t
55f0: 61 62 6c 65 20 28 69 2e 65 2e 20 3c 69 3e 63 65  able (i.e. <i>ce
5600: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61  nsus2011_topofea
5610: 74 75 72 65 73 3c 2f 69 3e 29 20 61 20 6e 65 77  tures</i>) a new
5620: 20 6c 65 76 65 6c 20 6f 66 20 72 65 66 65 72 65   level of refere
5630: 6e 63 65 73 20 74 6f 20 54 6f 70 6f 6c 6f 67 79  nces to Topology
5640: 20 70 72 69 6d 69 74 69 76 65 73 20 62 79 20 73   primitives by s
5650: 69 6d 70 6c 79 20 63 6f 70 79 69 6e 67 20 61 6c  imply copying al
5660: 6c 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 61 6c  l definitions al
5670: 72 65 61 64 79 20 73 74 6f 72 65 64 20 69 6e 74  ready stored int
5680: 6f 20 74 68 65 20 70 72 65 76 69 6f 75 73 20 68  o the previous h
5690: 69 65 72 61 72 63 68 69 63 61 6c 20 6c 65 76 65  ierarchical leve
56a0: 6c 2e 3c 62 72 3e 0d 0a 41 6e 64 20 74 6f 20 64  l.<br>..And to d
56b0: 6f 20 73 75 63 68 20 61 20 74 68 69 6e 67 20 77  o such a thing w
56c0: 65 20 73 69 6d 70 6c 79 20 68 61 76 65 20 74 6f  e simply have to
56d0: 20 72 65 61 64 20 66 72 6f 6d 20 3c 62 3e 74 6f   read from <b>to
56e0: 70 6f 6c 61 79 65 72 3d 31 3c 2f 62 3e 20 74 68  polayer=1</b> th
56f0: 65 6e 20 69 6e 73 65 72 74 69 6e 67 20 69 6e 74  en inserting int
5700: 6f 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 32  o <b>topolayer=2
5710: 3c 2f 62 3e 20 61 66 74 65 72 20 73 65 74 74 69  </b> after setti
5720: 6e 67 20 74 68 65 20 61 70 70 72 6f 70 72 69 61  ng the appropria
5730: 74 65 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 76 61  te <b>fid</b> va
5740: 6c 75 65 73 2e 3c 62 72 3e 0d 0a 52 65 61 6c 6c  lues.<br>..Reall
5750: 79 20 6e 6f 74 20 61 20 64 69 66 66 69 63 75 6c  y not a difficul
5760: 74 20 74 61 73 6b 2e 3c 2f 6c 69 3e 0d 0a 3c 2f  t task.</li>..</
5770: 75 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d  ul>..<verbatim>.
5780: 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e  .INSERT INTO cen
5790: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
57a0: 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c  ures..SELECT NUL
57b0: 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e  L, c.node_id, c.
57c0: 65 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f  edge_id, c.face_
57d0: 69 64 2c 20 33 2c 20 61 2e 66 69 64 0d 0a 46 52  id, 3, a.fid..FR
57e0: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  OM census2011_to
57f0: 70 6f 66 65 61 74 75 72 65 73 5f 33 20 41 53 20  pofeatures_3 AS 
5800: 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30  a..JOIN census20
5810: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f  11_topofeatures_
5820: 31 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64  1 AS b ON (b.cod
5830: 5f 63 6f 6d 20 3d 20 61 2e 63 6f 64 5f 63 6f 6d  _com = a.cod_com
5840: 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30  )..JOIN census20
5850: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20  11_topofeatures 
5860: 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c  AS c ON (c.topol
5870: 61 79 65 72 5f 69 64 20 3d 20 31 20 41 4e 44 20  ayer_id = 1 AND 
5880: 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d  c.fid = b.fid);.
5890: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65  .</verbatim>..We
58a0: 20 63 61 6e 20 61 64 6f 70 74 20 65 78 61 63 74   can adopt exact
58b0: 6c 79 20 74 68 65 20 73 61 6d 65 20 69 64 65 6e  ly the same iden
58c0: 74 69 63 61 6c 20 61 70 70 72 6f 61 63 68 20 69  tical approach i
58d0: 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f 6d 70 6c  n order to compl
58e0: 65 74 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72  ete <b>topolayer
58f0: 3d 33 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e  =3</b> correspon
5900: 64 69 6e 67 20 74 6f 20 3c 62 3e 4d 75 6e 69 63  ding to <b>Munic
5910: 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2e 0d 0a  ipalities</b>...
5920: 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49 4e 53 45  <verbatim>..INSE
5930: 52 54 20 49 4e 54 4f 20 63 65 6e 73 75 73 32 30  RT INTO census20
5940: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 0d  11_topofeatures.
5950: 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 63 2e  .SELECT NULL, c.
5960: 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64 67 65 5f  node_id, c.edge_
5970: 69 64 2c 20 63 2e 66 61 63 65 5f 69 64 2c 20 34  id, c.face_id, 4
5980: 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20 63 65  , a.fid..FROM ce
5990: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61  nsus2011_topofea
59a0: 74 75 72 65 73 5f 34 20 41 53 20 61 0d 0a 4a 4f  tures_4 AS a..JO
59b0: 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  IN census2011_to
59c0: 70 6f 66 65 61 74 75 72 65 73 5f 33 20 41 53 20  pofeatures_3 AS 
59d0: 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 70 72 6f 76  b ON (b.cod_prov
59e0: 20 3d 20 61 2e 63 6f 64 5f 70 72 6f 76 29 0d 0a   = a.cod_prov)..
59f0: 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f  JOIN census2011_
5a00: 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 53 20  topofeatures AS 
5a10: 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 61 79 65  c ON (c.topolaye
5a20: 72 5f 69 64 20 3d 20 33 20 41 4e 44 20 63 2e 66  r_id = 3 AND c.f
5a30: 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f  id = b.fid);..</
5a40: 76 65 72 62 61 74 69 6d 3e 0d 0a 4d 6f 72 65 20  verbatim>..More 
5a50: 6f 72 20 6c 65 73 73 20 74 68 65 20 73 61 6d 65  or less the same
5a60: 20 69 73 20 66 6f 72 20 64 65 72 69 76 69 6e 67   is for deriving
5a70: 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 34 3c   <b>topolayer=4<
5a80: 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  /b> correspondin
5a90: 67 20 74 6f 20 3c 62 3e 50 72 6f 76 69 6e 63 65  g to <b>Province
5aa0: 73 3c 2f 62 3e 3b 20 74 68 69 73 20 74 69 6d 65  s</b>; this time
5ab0: 20 77 65 27 6c 6c 20 73 69 6d 70 6c 79 20 61 67   we'll simply ag
5ac0: 67 72 65 67 61 74 65 20 74 68 65 20 75 6e 64 65  gregate the unde
5ad0: 72 6c 79 69 6e 67 20 4d 75 6e 69 63 69 70 61 6c  rlying Municipal
5ae0: 69 74 69 65 73 20 66 72 6f 6d 20 3c 62 3e 74 6f  ities from <b>to
5af0: 70 6f 6c 61 79 65 72 3d 33 3c 2f 62 3e 2e 0d 0a  polayer=3</b>...
5b00: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65 20  </verbatim>..We 
5b10: 63 61 6e 20 61 64 6f 70 74 20 65 78 61 63 74 6c  can adopt exactl
5b20: 79 20 74 68 65 20 73 61 6d 65 20 69 64 65 6e 74  y the same ident
5b30: 69 63 61 6c 20 61 70 70 72 6f 61 63 68 20 69 6e  ical approach in
5b40: 20 6f 72 64 65 72 20 74 6f 20 63 6f 6d 70 6c 65   order to comple
5b50: 74 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d  te <b>topolayer=
5b60: 33 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e 64  3</b> correspond
5b70: 69 6e 67 20 74 6f 20 3c 62 3e 4d 75 6e 69 63 69  ing to <b>Munici
5b80: 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2e 0d 0a 3c  palities</b>...<
5b90: 76 65 72 62 61 74 69 6d 3e 0d 0a 49 4e 53 45 52  verbatim>..INSER
5ba0: 54 20 49 4e 54 4f 20 63 65 6e 73 75 73 32 30 31  T INTO census201
5bb0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a  1_topofeatures..
5bc0: 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e  SELECT NULL, c.n
5bd0: 6f 64 65 5f 69 64 2c 20 63 2e 65 64 67 65 5f 69  ode_id, c.edge_i
5be0: 64 2c 20 63 2e 66 61 63 65 5f 69 64 2c 20 35 2c  d, c.face_id, 5,
5bf0: 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20 63 65 6e   a.fid..FROM cen
5c00: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
5c10: 75 72 65 73 5f 35 20 41 53 20 61 0d 0a 4a 4f 49  ures_5 AS a..JOI
5c20: 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70  N census2011_top
5c30: 6f 66 65 61 74 75 72 65 73 5f 34 20 41 53 20 62  ofeatures_4 AS b
5c40: 20 4f 4e 20 28 62 2e 63 6f 64 5f 72 65 67 20 3d   ON (b.cod_reg =
5c50: 20 61 2e 63 6f 64 5f 72 65 67 29 0d 0a 4a 4f 49   a.cod_reg)..JOI
5c60: 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70  N census2011_top
5c70: 6f 66 65 61 74 75 72 65 73 20 41 53 20 63 20 4f  ofeatures AS c O
5c80: 4e 20 28 63 2e 74 6f 70 6f 6c 61 79 65 72 5f 69  N (c.topolayer_i
5c90: 64 20 3d 20 34 20 41 4e 44 20 63 2e 66 69 64 20  d = 4 AND c.fid 
5ca0: 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 72  = b.fid);..</ver
5cb0: 62 61 74 69 6d 3e 0d 0a 41 6e 64 20 66 69 6e 61  batim>..And fina
5cc0: 6c 6c 79 20 77 65 20 63 61 6e 20 64 65 72 69 76  lly we can deriv
5cd0: 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 35  e <b>topolayer=5
5ce0: 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69  </b> correspondi
5cf0: 6e 67 20 74 6f 20 3c 62 3e 52 65 67 69 6f 6e 73  ng to <b>Regions
5d00: 3c 2f 62 3e 20 62 79 20 64 69 72 65 63 74 6c 79  </b> by directly
5d10: 20 61 67 67 72 65 67 61 74 69 6e 67 20 74 68 65   aggregating the
5d20: 20 75 6e 64 65 72 6c 79 69 6e 67 20 50 72 6f 76   underlying Prov
5d30: 69 6e 63 65 73 20 66 72 6f 6d 20 3c 62 3e 74 6f  inces from <b>to
5d40: 70 6f 6c 61 79 65 72 3d 34 3c 2f 62 3e 2e 0d 0a  polayer=4</b>...
5d50: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65  <br><br>..<table
5d60: 20 77 69 64 74 68 3d 22 31 30 30 25 22 20 20 63   width="100%"  c
5d70: 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c  ellspan="4" cell
5d80: 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f  padding="6" bgco
5d90: 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f  lor="#f8f8f0" bo
5da0: 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c  rder="1">..<tr><
5db0: 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 31 3a  td>..<b>step #1:
5dc0: 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20 52   exporting the R
5dd0: 65 67 69 6f 6e 20 54 6f 70 6f 4c 61 79 65 72 3c  egion TopoLayer<
5de0: 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d  /b>..<verbatim>.
5df0: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f  .SELECT TopoGeo_
5e00: 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28  ExportTopoLayer(
5e10: 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 72  'census2011', 'r
5e20: 65 67 27 2c 20 27 6f 75 74 5f 72 65 67 5f 32 30  eg', 'out_reg_20
5e30: 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62  11', 1);..</verb
5e40: 61 74 69 6d 3e 0d 0a 57 65 20 61 72 65 20 6e 6f  atim>..We are no
5e50: 77 20 64 65 66 69 6e 69 74 65 6c 79 20 72 65 61  w definitely rea
5e60: 64 79 20 74 6f 20 65 78 70 6f 72 74 20 61 6e 79  dy to export any
5e70: 20 6f 74 68 65 72 20 41 64 6d 69 6e 69 73 74 72   other Administr
5e80: 61 74 69 76 65 20 4c 65 76 65 6c 2e 3c 62 72 3e  ative Level.<br>
5e90: 0d 0a 46 6f 72 20 74 68 65 20 73 61 6b 65 20 6f  ..For the sake o
5ea0: 66 20 63 6c 61 72 69 74 79 20 77 65 27 6c 6c 20  f clarity we'll 
5eb0: 66 6f 6c 6c 6f 77 20 61 20 74 6f 70 2d 62 6f 74  follow a top-bot
5ec0: 74 6f 6d 20 6f 72 64 65 72 2c 20 73 6f 20 77 65  tom order, so we
5ed0: 27 6c 6c 20 73 74 61 72 74 20 62 79 20 65 78 70  'll start by exp
5ee0: 6f 72 74 69 6e 67 20 66 69 72 73 74 20 74 68 65  orting first the
5ef0: 20 77 68 6f 6c 65 20 54 75 73 63 61 6e 79 2e 0d   whole Tuscany..
5f00: 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67  .</td><td>..<img
5f10: 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77   src="https://ww
5f20: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61  w.gaia-gis.it/ga
5f30: 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73  ia-sins/topofigs
5f40: 2f 74 6f 70 6f 6c 61 79 65 72 2d 72 65 67 69 6f  /topolayer-regio
5f50: 6e 2e 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f  n.png" alt="topo
5f60: 6c 61 79 65 72 2d 72 65 67 69 6f 6e 22 3e 0d 0a  layer-region">..
5f70: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
5f80: 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 32  <td>..<b>step #2
5f90: 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20  : exporting the 
5fa0: 50 72 6f 76 69 6e 63 65 73 20 54 6f 70 6f 4c 61  Provinces TopoLa
5fb0: 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74  yer</b>..<verbat
5fc0: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f  im>..SELECT Topo
5fd0: 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61  Geo_ExportTopoLa
5fe0: 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27  yer('census2011'
5ff0: 2c 20 27 70 72 6f 76 27 2c 20 27 6f 75 74 5f 70  , 'prov', 'out_p
6000: 72 6f 76 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a  rov_2011', 1);..
6010: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65 27  </verbatim>..We'
6020: 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 62 79 20 65  ll continue by e
6030: 78 70 6f 72 74 69 6e 67 20 61 6c 6c 20 74 68 65  xporting all the
6040: 20 54 75 73 63 61 6e 79 20 50 72 6f 76 69 6e 63   Tuscany Provinc
6050: 65 73 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a  es...</td><td>..
6060: 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a  <img src="https:
6070: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
6080: 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f  t/gaia-sins/topo
6090: 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 70  figs/topolayer-p
60a0: 72 6f 76 69 6e 63 65 73 2e 70 6e 67 22 20 61 6c  rovinces.png" al
60b0: 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d 70 72 6f  t="topolayer-pro
60c0: 76 69 6e 63 65 73 22 3e 0d 0a 3c 2f 74 64 3e 3c  vinces">..</td><
60d0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a  /tr>..<tr><td>..
60e0: 3c 62 3e 73 74 65 70 20 23 33 3a 20 65 78 70 6f  <b>step #3: expo
60f0: 72 74 69 6e 67 20 74 68 65 20 4d 75 6e 69 63 69  rting the Munici
6100: 70 61 6c 69 74 69 65 73 20 54 6f 70 6f 4c 61 79  palities TopoLay
6110: 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69  er</b>..<verbati
6120: 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47  m>..SELECT TopoG
6130: 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79  eo_ExportTopoLay
6140: 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c  er('census2011',
6150: 20 27 63 6f 6d 27 2c 20 27 6f 75 74 5f 63 6f 6d   'com', 'out_com
6160: 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76  _2011', 1);..</v
6170: 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 6e 20 77  erbatim>..Then w
6180: 65 27 6c 6c 20 65 78 70 6f 72 74 20 61 6c 6c 20  e'll export all 
6190: 74 68 65 20 54 75 73 63 61 6e 79 20 4d 75 6e 69  the Tuscany Muni
61a0: 63 69 70 61 6c 69 74 69 65 73 2e 3c 62 72 3e 0d  cipalities.<br>.
61b0: 0a 46 6f 72 20 62 65 74 74 65 72 20 63 6c 61 72  .For better clar
61c0: 69 74 79 20 74 68 65 20 66 69 67 75 72 65 20 73  ity the figure s
61d0: 68 6f 77 73 20 61 20 6d 61 67 6e 69 66 69 65 64  hows a magnified
61e0: 20 64 65 74 61 69 6c 20 63 65 6e 74 65 72 65 64   detail centered
61f0: 20 61 72 6f 75 6e 64 20 74 68 65 20 49 73 6c 61   around the Isla
6200: 6e 64 20 6f 66 20 45 6c 62 61 2e 0d 0a 3c 2f 74  nd of Elba...</t
6210: 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63  d><td>..<img src
6220: 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61  ="https://www.ga
6230: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
6240: 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70  ins/topofigs/top
6250: 6f 6c 61 79 65 72 2d 6d 75 6e 69 63 69 70 61 6c  olayer-municipal
6260: 69 74 69 65 73 2e 70 6e 67 22 20 61 6c 74 3d 22  ities.png" alt="
6270: 74 6f 70 6f 6c 61 79 65 72 2d 6d 75 6e 69 63 69  topolayer-munici
6280: 70 61 6c 69 74 69 65 73 22 3e 0d 0a 3c 2f 74 64  palities">..</td
6290: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e  ></tr>..<tr><td>
62a0: 0d 0a 3c 62 3e 73 74 65 70 20 23 34 3a 20 65 78  ..<b>step #4: ex
62b0: 70 6f 72 74 69 6e 67 20 74 68 65 20 50 6f 70 75  porting the Popu
62c0: 6c 61 74 65 64 20 50 6c 61 63 65 73 20 54 6f 70  lated Places Top
62d0: 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72  oLayer</b>..<ver
62e0: 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54  batim>..SELECT T
62f0: 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70  opoGeo_ExportTop
6300: 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30  oLayer('census20
6310: 31 31 27 2c 20 27 70 70 6c 27 2c 20 27 6f 75 74  11', 'ppl', 'out
6320: 5f 70 70 6c 5f 32 30 31 31 27 2c 20 31 29 3b 0d  _ppl_2011', 1);.
6330: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41 6e  .</verbatim>..An
6340: 64 20 77 65 27 6c 6c 20 66 69 6e 61 6c 6c 79 20  d we'll finally 
6350: 65 78 70 6f 72 74 20 61 6c 6c 20 50 6f 70 75 6c  export all Popul
6360: 61 74 65 64 20 50 6c 61 63 65 73 2e 3c 62 72 3e  ated Places.<br>
6370: 3c 62 72 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 75  <br><br><br>..<u
6380: 3e 43 6f 6e 63 6c 75 73 69 6f 6e 3c 2f 75 3e 3a  >Conclusion</u>:
6390: 20 77 65 20 73 74 61 72 74 65 64 20 74 68 69 73   we started this
63a0: 20 61 64 76 61 6e 63 65 64 20 74 75 74 6f 72 69   advanced tutori
63b0: 61 6c 20 62 79 20 69 6d 70 6f 72 74 69 6e 67 20  al by importing 
63c0: 69 6e 74 6f 20 61 20 54 6f 70 6f 6c 6f 67 79 20  into a Topology 
63d0: 6a 75 73 74 20 61 20 73 69 6e 67 6c 65 20 6c 61  just a single la
63e0: 79 65 72 20 28 43 65 6e 73 75 73 20 41 72 65 61  yer (Census Area
63f0: 73 29 20 61 6e 64 20 6e 6f 77 20 77 65 27 76 65  s) and now we've
6400: 20 66 69 6e 69 73 68 65 64 20 62 79 20 70 72 6f   finished by pro
6410: 64 75 63 69 6e 67 20 61 20 63 6f 6d 70 6c 65 74  ducing a complet
6420: 65 20 73 65 74 20 6f 66 20 61 64 6d 69 6e 69 73  e set of adminis
6430: 74 72 61 74 69 76 65 20 62 6f 75 6e 64 61 72 69  trative boundari
6440: 65 73 20 61 74 20 64 69 66 66 65 72 65 6e 74 20  es at different 
6450: 68 69 65 72 61 72 63 68 69 63 61 6c 20 6c 65 76  hierarchical lev
6460: 65 6c 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e  els:..<ul>..<li>
6470: 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73  Populated Places
6480: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 4d 75 6e 69 63  </li>..<li>Munic
6490: 69 70 61 6c 69 74 69 65 73 3c 2f 6c 69 3e 0d 0a  ipalities</li>..
64a0: 3c 6c 69 3e 50 72 6f 76 69 6e 63 65 73 3c 2f 6c  <li>Provinces</l
64b0: 69 3e 0d 0a 3c 6c 69 3e 52 65 67 69 6f 6e 3c 2f  i>..<li>Region</
64c0: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64  li>..</ul>..</td
64d0: 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d  ><td>..<img src=
64e0: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69  "https://www.gai
64f0: 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69  a-gis.it/gaia-si
6500: 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f  ns/topofigs/topo
6510: 6c 61 79 65 72 2d 70 6f 70 75 6c 61 74 65 64 2d  layer-populated-
6520: 70 6c 61 63 65 73 2e 70 6e 67 22 20 61 6c 74 3d  places.png" alt=
6530: 22 74 6f 70 6f 6c 61 79 65 72 2d 70 6f 70 75 6c  "topolayer-popul
6540: 61 74 65 64 2d 70 6c 61 63 65 73 22 3e 0d 0a 3c  ated-places">..<
6550: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62  /td></tr>..</tab
6560: 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c  le><br>..<hr>..<
6570: 68 33 3e 52 65 63 65 6e 74 20 63 68 61 6e 67 65  h3>Recent change
6580: 73 3a 20 6f 6c 64 20 4d 75 6e 69 63 69 70 61 6c  s: old Municipal
6590: 69 74 69 65 73 20 6d 65 72 67 69 6e 67 20 69 6e  ities merging in
65a0: 74 6f 20 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c  to new Municipal
65b0: 69 74 69 65 73 3c 2f 68 33 3e 0d 0a 49 66 20 79  ities</h3>..If y
65c0: 6f 75 20 72 65 6d 65 6d 62 65 72 20 74 68 65 20  ou remember the 
65d0: 69 6e 69 74 69 61 6c 20 3c 62 3e 74 75 73 63 61  initial <b>tusca
65e0: 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73  ny-census-2011.s
65f0: 71 6c 69 74 65 3c 2f 62 3e 20 44 42 2d 66 69 6c  qlite</b> DB-fil
6600: 65 20 63 6f 6e 74 61 69 6e 73 20 61 20 3c 62 3e  e contains a <b>
6610: 63 6f 6d 5f 32 30 31 34 5f 31 35 3c 2f 62 3e 20  com_2014_15</b> 
6620: 54 61 62 6c 65 3b 20 64 75 72 69 6e 67 20 79 65  Table; during ye
6630: 61 72 73 20 32 30 31 34 20 61 6e 64 20 32 30 31  ars 2014 and 201
6640: 35 20 66 65 77 20 4d 75 6e 69 63 69 70 61 6c 69  5 few Municipali
6650: 74 69 65 73 20 6d 65 72 67 65 64 20 74 77 6f 20  ties merged two 
6660: 62 79 20 74 77 6f 20 74 68 75 73 20 67 69 76 69  by two thus givi
6670: 6e 67 20 62 69 72 74 68 20 74 6f 20 6e 65 77 20  ng birth to new 
6680: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2e 20  Municipalities. 
6690: 54 68 69 73 20 69 73 20 74 68 65 20 66 75 6c 6c  This is the full
66a0: 20 6c 69 73 74 3a 3c 62 72 3e 3c 62 72 3e 0d 0a   list:<br><br>..
66b0: 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d  <table cellspan=
66c0: 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d  "4" cellpadding=
66d0: 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  "6" bgcolor="#f8
66e0: 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22  f8f0" border="1"
66f0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70  >..<tr><td colsp
6700: 61 6e 3d 22 33 22 20 61 6c 69 67 6e 3d 22 63 65  an="3" align="ce
6710: 6e 74 65 72 22 20 62 67 63 6f 6c 6f 72 3d 22 23  nter" bgcolor="#
6720: 66 30 66 30 66 38 22 3e 3c 62 3e 4e 65 77 20 4d  f0f0f8"><b>New M
6730: 75 6e 69 63 69 70 61 6c 69 74 79 20 28 32 30 31  unicipality (201
6740: 34 2f 31 35 29 3c 2f 62 3e 3c 2f 74 64 3e 3c 74  4/15)</b></td><t
6750: 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22 20 61 6c  d colspan="2" al
6760: 69 67 6e 3d 22 63 65 6e 74 65 72 22 20 20 62 67  ign="center"  bg
6770: 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e  color="#f0f8f8">
6780: 3c 62 3e 73 75 70 70 72 65 73 73 65 64 20 23 31  <b>suppressed #1
6790: 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 63 6f 6c  </b></td><td col
67a0: 73 70 61 6e 3d 22 32 22 20 61 6c 69 67 6e 3d 22  span="2" align="
67b0: 63 65 6e 74 65 72 22 20 62 67 63 6f 6c 6f 72 3d  center" bgcolor=
67c0: 22 23 66 38 66 30 66 38 22 3e 3c 62 3e 73 75 70  "#f8f0f8"><b>sup
67d0: 70 72 65 73 73 65 64 20 23 32 3c 2f 62 3e 3c 2f  pressed #2</b></
67e0: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74  td></tr>..<tr><t
67f0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30  d bgcolor="#f0f0
6800: 66 38 22 3e 3c 62 3e 63 6f 64 5f 70 72 6f 76 3c  f8"><b>cod_prov<
6810: 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  /b></td><td bgco
6820: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62  lor="#f0f0f8"><b
6830: 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64  >cod_com</b></td
6840: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6850: 30 66 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f  0f0f8"><b>name</
6860: 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  b></td><td bgcol
6870: 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 3c 62 3e  or="#f0f8f8"><b>
6880: 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e  cod_com</b></td>
6890: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
68a0: 66 38 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62  f8f8"><b>name</b
68b0: 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f  ></td><td bgcolo
68c0: 72 3d 22 23 66 38 66 30 66 38 22 3e 3c 62 3e 63  r="#f8f0f8"><b>c
68d0: 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e 3c  od_com</b></td><
68e0: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66  td bgcolor="#f8f
68f0: 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e  0f8"><b>name</b>
6900: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
6910: 3c 74 64 3e 41 52 3c 2f 74 64 3e 3c 74 64 20 61  <td>AR</td><td a
6920: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30  lign="right">510
6930: 34 30 3c 2f 74 64 3e 3c 74 64 3e 43 61 73 74 65  40</td><td>Caste
6940: 6c 66 72 61 6e 63 6f 20 50 69 61 6e 64 69 73 63  lfranco Piandisc
6950: c3 b2 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  ..</td><td bgcol
6960: 6f 72 3d 22 23 66 30 66 38 66 38 22 20 61 6c 69  or="#f0f8f8" ali
6970: 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30 30 39  gn="right">51009
6980: 3c 2f 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  </td bgcolor="#f
6990: 30 66 38 66 38 22 3e 3c 74 64 20 62 67 63 6f 6c  0f8f8"><td bgcol
69a0: 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 43 61 73  or="#f0f8f8">Cas
69b0: 74 65 6c 66 72 61 6e 63 6f 20 64 69 20 53 6f 70  telfranco di Sop
69c0: 72 61 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  ra</td><td bgcol
69d0: 6f 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69  or="#f8f0f8" ali
69e0: 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30 32 39  gn="right">51029
69f0: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6a00: 3d 22 23 66 38 66 30 66 38 22 3e 50 69 61 6e 20  ="#f8f0f8">Pian 
6a10: 64 69 20 53 63 6f 3c 2f 74 64 3e 3c 2f 74 72 3e  di Sco</td></tr>
6a20: 0d 0a 3c 74 72 3e 3c 74 64 3e 41 52 3c 2f 74 64  ..<tr><td>AR</td
6a30: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
6a40: 74 22 3e 35 31 30 34 31 3c 2f 74 64 3e 3c 74 64  t">51041</td><td
6a50: 3e 50 72 61 74 6f 76 65 63 63 68 69 6f 20 53 74  >Pratovecchio St
6a60: 69 61 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  ia</td><td bgcol
6a70: 6f 72 3d 22 23 66 30 66 38 66 38 22 20 61 6c 69  or="#f0f8f8" ali
6a80: 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30 33 32  gn="right">51032
6a90: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6aa0: 3d 22 23 66 30 66 38 66 38 22 3e 50 72 61 74 6f  ="#f0f8f8">Prato
6ab0: 76 65 63 63 68 69 6f 3c 2f 74 64 3e 3c 74 64 20  vecchio</td><td 
6ac0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38  bgcolor="#f8f0f8
6ad0: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  " align="right">
6ae0: 35 31 30 33 36 3c 2f 74 64 3e 3c 74 64 20 62 67  51036</td><td bg
6af0: 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e  color="#f8f0f8">
6b00: 53 74 69 61 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  Stia</td></tr>..
6b10: 3c 74 72 3e 3c 74 64 3e 46 49 3c 2f 74 64 3e 3c  <tr><td>FI</td><
6b20: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
6b30: 3e 34 38 30 35 32 3c 2f 74 64 3e 3c 74 64 3e 46  >48052</td><td>F
6b40: 69 67 6c 69 6e 65 20 65 20 49 6e 63 69 73 61 20  igline e Incisa 
6b50: 56 61 6c 64 61 72 6e 6f 3c 2f 74 64 3e 3c 74 64  Valdarno</td><td
6b60: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66   bgcolor="#f0f8f
6b70: 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  8" align="right"
6b80: 3e 34 38 30 31 36 3c 2f 74 64 3e 3c 74 64 20 62  >48016</td><td b
6b90: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22  gcolor="#f0f8f8"
6ba0: 3e 46 69 67 6c 69 6e 65 20 56 61 6c 64 61 72 6e  >Figline Valdarn
6bb0: 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f  o</td><td bgcolo
6bc0: 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69 67  r="#f8f0f8" alig
6bd0: 6e 3d 22 72 69 67 68 74 22 3e 34 38 30 32 33 3c  n="right">48023<
6be0: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
6bf0: 22 23 66 38 66 30 66 38 22 3e 49 6e 63 69 73 61  "#f8f0f8">Incisa
6c00: 20 69 6e 20 56 61 6c 20 64 27 41 72 6e 6f 3c 2f   in Val d'Arno</
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 33  gn="right">48053
6c40: 3c 2f 74 64 3e 3c 74 64 3e 53 63 61 72 70 65 72  </td><td>Scarper
6c50: 69 61 20 65 20 53 61 6e 20 50 69 65 72 6f 3c 2f  ia e San Piero</
6c60: 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  td><td bgcolor="
6c70: 23 66 30 66 38 66 38 22 20 61 6c 69 67 6e 3d 22  #f0f8f8" align="
6c80: 72 69 67 68 74 22 3e 34 38 30 34 32 3c 2f 74 64  right">48042</td
6c90: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6ca0: 30 66 38 66 38 22 3e 53 63 61 72 70 65 72 69 61  0f8f8">Scarperia
6cb0: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6cc0: 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69 67 6e  ="#f8f0f8" align
6cd0: 3d 22 72 69 67 68 74 22 3e 34 38 30 34 30 3c 2f  ="right">48040</
6ce0: 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  td><td bgcolor="
6cf0: 23 66 38 66 30 66 38 22 3e 53 61 6e 20 50 69 65  #f8f0f8">San Pie
6d00: 72 6f 20 61 20 53 69 65 76 65 3c 2f 74 64 3e 3c  ro a Sieve</td><
6d10: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 4c 55  /tr>..<tr><td>LU
6d20: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
6d30: 72 69 67 68 74 22 3e 34 36 30 33 36 3c 2f 74 64  right">46036</td
6d40: 3e 3c 74 64 3e 46 61 62 62 72 69 63 68 65 20 64  ><td>Fabbriche d
6d50: 69 20 56 65 72 67 65 6d 6f 6c 69 3c 2f 74 64 3e  i Vergemoli</td>
6d60: 3c 74 64 20 20 62 67 63 6f 6c 6f 72 3d 22 23 66  <td  bgcolor="#f
6d70: 30 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 69  0f8f8" align="ri
6d80: 67 68 74 22 3e 34 36 30 31 32 3c 2f 74 64 3e 3c  ght">46012</td><
6d90: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
6da0: 38 66 38 22 3e 46 61 62 62 72 69 63 68 65 20 64  8f8">Fabbriche d
6db0: 69 20 56 61 6c 6c 69 63 6f 3c 2f 74 64 3e 3c 74  i Vallico</td><t
6dc0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30  d bgcolor="#f8f0
6dd0: 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  f8" align="right
6de0: 22 3e 34 36 30 33 32 3c 2f 74 64 3e 3c 74 64 20  ">46032</td><td 
6df0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38  bgcolor="#f8f0f8
6e00: 22 3e 56 65 72 67 65 6d 6f 6c 69 3c 2f 74 64 3e  ">Vergemoli</td>
6e10: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 4c  </tr>..<tr><td>L
6e20: 55 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  U</td><td align=
6e30: 22 72 69 67 68 74 22 3e 34 36 30 33 37 3c 2f 74  "right">46037</t
6e40: 64 3e 3c 74 64 3e 53 69 6c 6c 61 6e 6f 20 47 69  d><td>Sillano Gi
6e50: 75 6e 63 75 67 6e 61 6e 6f 3c 2f 74 64 3e 3c 74  uncugnano</td><t
6e60: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38  d bgcolor="#f0f8
6e70: 66 38 22 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  f8"align="right"
6e80: 3e 34 36 30 32 39 3c 2f 74 64 3e 3c 74 64 20 62  >46029</td><td b
6e90: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22  gcolor="#f0f8f8"
6ea0: 3e 53 69 6c 6c 61 6e 6f 3c 2f 74 64 3e 3c 74 64  >Sillano</td><td
6eb0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66   bgcolor="#f8f0f
6ec0: 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  8" align="right"
6ed0: 3e 34 36 30 31 36 3c 2f 74 64 3e 3c 74 64 20 62  >46016</td><td b
6ee0: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22  gcolor="#f8f0f8"
6ef0: 3e 47 69 75 6e 63 75 67 6e 61 6e 6f 3c 2f 74 64  >Giuncugnano</td
6f00: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e  ></tr>..<tr><td>
6f10: 50 49 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  PI</td><td align
6f20: 3d 22 72 69 67 68 74 22 3e 35 30 30 35 30 3c 2f  ="right">50050</
6f30: 74 64 3e 3c 74 64 3e 43 61 73 63 69 61 6e 61 20  td><td>Casciana 
6f40: 54 65 72 6d 65 20 4c 61 72 69 3c 2f 74 64 3e 3c  Terme Lari</td><
6f50: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
6f60: 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68  8f8" align="righ
6f70: 74 22 3e 35 30 30 30 37 3c 2f 74 64 3e 3c 74 64  t">50007</td><td
6f80: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66   bgcolor="#f0f8f
6f90: 38 22 3e 43 61 73 63 69 61 6e 61 20 54 65 72 6d  8">Casciana Term
6fa0: 65 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f  e</td><td bgcolo
6fb0: 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69 67  r="#f8f0f8" alig
6fc0: 6e 3d 22 72 69 67 68 74 22 3e 35 30 30 31 37 3c  n="right">50017<
6fd0: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
6fe0: 22 23 66 38 66 30 66 38 22 3e 4c 61 72 69 3c 2f  "#f8f0f8">Lari</
6ff0: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74  td></tr>..<tr><t
7000: 64 3e 50 49 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  d>PI</td><td ali
7010: 67 6e 3d 22 72 69 67 68 74 22 3e 35 30 30 34 31  gn="right">50041
7020: 3c 2f 74 64 3e 3c 74 64 3e 43 72 65 73 70 69 6e  </td><td>Crespin
7030: 61 20 4c 6f 72 65 6e 7a 61 6e 61 3c 2f 74 64 3e  a Lorenzana</td>
7040: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
7050: 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67  f8f8" align="rig
7060: 68 74 22 3e 35 30 30 31 33 3c 2f 74 64 3e 3c 74  ht">50013</td><t
7070: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38  d bgcolor="#f0f8
7080: 66 38 22 3e 43 72 65 73 70 69 6e 61 3c 2f 74 64  f8">Crespina</td
7090: 3e 3c 74 64 20 20 62 67 63 6f 6c 6f 72 3d 22 23  ><td  bgcolor="#
70a0: 66 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22 72  f8f0f8" align="r
70b0: 69 67 68 74 22 3e 35 30 30 31 38 3c 2f 74 64 3e  ight">50018</td>
70c0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  <td bgcolor="#f8
70d0: 66 30 66 38 22 3e 4c 6f 72 65 6e 7a 61 6e 61 3c  f0f8">Lorenzana<
70e0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62  /td></tr>..</tab
70f0: 6c 65 3e 0d 0a 3c 62 72 3e 0d 0a 53 75 63 68 20  le>..<br>..Such 
7100: 63 68 61 6e 67 65 73 20 73 69 6d 70 6c 79 20 61  changes simply a
7110: 66 66 65 63 74 73 20 4d 75 6e 69 63 69 70 61 6c  ffects Municipal
7120: 69 74 69 65 73 3b 20 50 72 6f 76 69 6e 63 65 73  ities; Provinces
7130: 20 61 72 65 20 75 6e 61 66 66 65 63 74 65 64 20   are unaffected 
7140: 62 79 20 74 68 69 73 20 70 72 6f 63 65 73 73 3b  by this process;
7150: 20 73 6f 20 77 65 20 63 61 6e 20 6e 6f 77 20 64   so we can now d
7160: 75 6c 79 20 67 65 6e 65 72 61 74 65 20 61 20 66  uly generate a f
7170: 75 72 74 68 65 72 20 6c 61 79 65 72 20 63 6f 72  urther layer cor
7180: 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 32 30  responding to 20
7190: 31 35 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65  15 Municipalitie
71a0: 73 2c 20 61 6e 64 20 77 65 20 73 69 6d 70 6c 79  s, and we simply
71b0: 20 68 61 76 65 20 74 6f 20 73 6c 69 67 68 74 6c   have to slightl
71c0: 79 20 72 65 61 72 72 61 6e 67 65 20 74 68 65 20  y rearrange the 
71d0: 54 6f 70 6f 4c 61 79 65 72 73 2f 54 6f 70 6f 46  TopoLayers/TopoF
71e0: 65 61 74 75 72 65 73 20 64 65 66 69 6e 69 74 69  eatures definiti
71f0: 6f 6e 73 20 69 6e 20 6f 72 64 65 72 20 74 6f 20  ons in order to 
7200: 61 63 68 69 65 76 65 20 74 68 69 73 20 66 75 72  achieve this fur
7210: 74 68 65 72 20 67 6f 61 6c 2e 0d 0a 3c 76 65 72  ther goal...<ver
7220: 62 61 74 69 6d 3e 0d 0a 41 54 54 41 43 48 20 44  batim>..ATTACH D
7230: 41 54 41 42 41 53 45 20 22 2e 2f 74 75 73 63 61  ATABASE "./tusca
7240: 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73  ny-census-2011.s
7250: 71 6c 69 74 65 22 20 41 53 20 69 73 74 61 74 3b  qlite" AS istat;
7260: 0d 0a 0d 0a 43 52 45 41 54 45 20 54 41 42 4c 45  ....CREATE TABLE
7270: 20 63 6f 6d 32 30 31 35 20 41 53 0d 0a 53 45 4c   com2015 AS..SEL
7280: 45 43 54 20 2a 20 46 52 4f 4d 20 69 73 74 61 74  ECT * FROM istat
7290: 2e 70 6f 70 5f 63 6f 6d 5f 32 30 31 31 3b 0d 0a  .pop_com_2011;..
72a0: 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 6f  ..INSERT INTO co
72b0: 6d 32 30 31 35 0d 0a 53 45 4c 45 43 54 20 61 2e  m2015..SELECT a.
72c0: 63 6f 64 5f 63 6f 6d 2c 20 61 2e 63 6f 64 5f 70  cod_com, a.cod_p
72d0: 72 6f 76 2c 20 61 2e 63 6f 64 5f 69 73 74 61 74  rov, a.cod_istat
72e0: 2c 20 61 2e 63 6f 64 5f 63 61 64 61 73 74 72 65  , a.cod_cadastre
72f0: 2c 20 61 2e 6e 61 6d 65 2c 20 61 2e 74 6f 77 6e  , a.name, a.town
7300: 68 61 6c 6c 5f 61 64 64 72 2c 0d 0a 20 20 20 20  hall_addr,..    
7310: 53 75 6d 28 62 2e 70 6f 70 5f 32 30 31 31 29 2c  Sum(b.pop_2011),
7320: 20 53 75 6d 28 62 2e 6d 5f 32 30 31 31 29 2c 20   Sum(b.m_2011), 
7330: 53 75 6d 28 62 2e 66 5f 32 30 31 31 29 0d 0a 46  Sum(b.f_2011)..F
7340: 52 4f 4d 20 69 73 74 61 74 2e 63 6f 6d 5f 32 30  ROM istat.com_20
7350: 31 34 5f 31 35 20 41 53 20 61 0d 0a 4a 4f 49 4e  14_15 AS a..JOIN
7360: 20 69 73 74 61 74 2e 70 6f 70 5f 63 6f 6d 5f 32   istat.pop_com_2
7370: 30 31 31 20 41 53 20 62 20 4f 4e 20 28 62 2e 63  011 AS b ON (b.c
7380: 6f 64 5f 63 6f 6d 20 49 4e 20 28 61 2e 6f 6c 64  od_com IN (a.old
7390: 5f 63 6f 64 5f 63 6f 6d 5f 31 2c 20 61 2e 6f 6c  _cod_com_1, a.ol
73a0: 64 5f 63 6f 64 5f 63 6f 6d 5f 32 29 29 0d 0a 47  d_cod_com_2))..G
73b0: 52 4f 55 50 20 42 59 20 61 2e 63 6f 64 5f 63 6f  ROUP BY a.cod_co
73c0: 6d 3b 0d 0a 0d 0a 44 45 54 41 43 48 20 44 41 54  m;....DETACH DAT
73d0: 41 42 41 53 45 20 69 73 74 61 74 3b 0d 0a 3c 2f  ABASE istat;..</
73e0: 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 6f 6c 3e 0d  verbatim>..<ol>.
73f0: 0a 3c 6c 69 3e 77 65 27 6c 6c 20 3c 69 3e 61 74  .<li>we'll <i>at
7400: 74 61 63 68 3c 2f 69 3e 20 79 65 74 20 61 6e 6f  tach</i> yet ano
7410: 74 68 65 72 20 74 69 6d 65 20 74 68 65 20 69 6e  ther time the in
7420: 69 74 69 61 6c 20 3c 62 3e 74 75 73 63 61 6e 79  itial <b>tuscany
7430: 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c  -census-2011.sql
7440: 69 74 65 3c 2f 62 3e 20 44 42 2d 66 69 6c 65 2e  ite</b> DB-file.
7450: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 77 65 27 6c 6c  </li>..<li>we'll
7460: 20 63 72 65 61 74 65 20 61 20 6e 65 77 20 3c 62   create a new <b
7470: 3e 63 6f 6d 32 30 31 35 3c 2f 62 3e 20 74 61 62  >com2015</b> tab
7480: 6c 65 20 62 79 20 6a 75 73 74 20 6a 75 73 74 20  le by just just 
7490: 63 6f 70 79 69 6e 67 20 74 68 65 20 3c 62 3e 69  copying the <b>i
74a0: 73 74 61 74 2e 70 6f 70 5f 63 6f 6d 5f 32 30 31  stat.pop_com_201
74b0: 31 3c 2f 62 3e 20 56 69 65 77 2e 3c 2f 6c 69 3e  1</b> View.</li>
74c0: 0d 0a 3c 6c 69 3e 61 6e 64 20 66 69 6e 61 6c 6c  ..<li>and finall
74d0: 79 20 77 65 27 6c 6c 20 61 70 70 65 6e 64 20 74  y we'll append t
74e0: 6f 20 74 68 65 20 73 61 6d 65 20 74 61 62 6c 65  o the same table
74f0: 20 74 68 65 20 6e 65 77 20 4d 75 6e 69 63 69 70   the new Municip
7500: 61 6c 69 74 69 65 73 20 66 72 6f 6d 20 74 68 65  alities from the
7510: 20 3c 62 3e 69 73 74 61 74 2e 63 6f 6d 5f 32 30   <b>istat.com_20
7520: 31 34 5f 31 35 3c 2f 62 3e 20 74 61 62 6c 65 3b  14_15</b> table;
7530: 20 64 75 72 69 6e 67 20 74 68 69 73 20 73 74 65   during this ste
7540: 70 20 77 65 27 6c 6c 20 63 6f 6d 70 75 74 65 20  p we'll compute 
7550: 74 68 65 20 50 6f 70 75 6c 61 74 69 6f 6e 20 32  the Population 2
7560: 30 31 31 20 63 65 6e 73 75 73 20 76 61 6c 75 65  011 census value
7570: 73 2e 3c 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c  s.<br>..<u>Note<
7580: 2f 75 3e 3a 20 61 66 74 65 72 20 63 6f 6d 70 6c  /u>: after compl
7590: 65 74 69 6e 67 20 74 68 65 20 61 62 6f 76 65 20  eting the above 
75a0: 73 74 65 70 73 20 6e 6f 77 20 74 68 65 20 3c 62  steps now the <b
75b0: 3e 63 6f 6d 32 30 31 35 3c 2f 62 3e 20 74 61 62  >com2015</b> tab
75c0: 6c 65 20 63 6f 6e 74 61 69 6e 73 20 62 6f 74 68  le contains both
75d0: 20 73 75 70 70 72 65 73 73 65 64 20 61 6e 64 20   suppressed and 
75e0: 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74 69  new Municipaliti
75f0: 65 73 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a  es</li>..</ol>..
7600: 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45  <verbatim>..SELE
7610: 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54  CT TopoGeo_InitT
7620: 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73  opoLayer('census
7630: 32 30 31 31 27 2c 20 4e 55 4c 4c 2c 20 27 63 6f  2011', NULL, 'co
7640: 6d 32 30 31 35 27 2c 20 27 63 6f 6d 32 30 31 35  m2015', 'com2015
7650: 27 29 3b 0d 0a 0d 0a 49 4e 53 45 52 54 20 49 4e  ');....INSERT IN
7660: 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  TO census2011_to
7670: 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c 45  pofeatures..SELE
7680: 43 54 20 4e 55 4c 4c 2c 20 61 2e 6e 6f 64 65 5f  CT NULL, a.node_
7690: 69 64 2c 20 61 2e 65 64 67 65 5f 69 64 2c 20 61  id, a.edge_id, a
76a0: 2e 66 61 63 65 5f 69 64 2c 20 36 2c 20 61 2e 66  .face_id, 6, a.f
76b0: 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32  id..FROM census2
76c0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
76d0: 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73   AS a..JOIN cens
76e0: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75  us2011_topofeatu
76f0: 72 65 73 5f 33 20 41 53 20 62 20 4f 4e 20 28 61  res_3 AS b ON (a
7700: 2e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20  .topolayer_id = 
7710: 33 20 41 4e 44 20 61 2e 66 69 64 20 3d 20 62 2e  3 AND a.fid = b.
7720: 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69  fid);..</verbati
7730: 6d 3e 0d 0a 4e 6f 74 68 69 6e 67 20 72 65 61 6c  m>..Nothing real
7740: 6c 79 20 69 6e 74 65 72 65 73 74 69 6e 67 20 69  ly interesting i
7750: 6e 20 74 68 69 73 2c 20 62 65 63 61 75 73 65 20  n this, because 
7760: 77 65 20 61 6c 72 65 61 64 79 20 70 65 72 66 6f  we already perfo
7770: 72 6d 65 64 20 74 68 69 73 20 73 74 65 70 20 64  rmed this step d
7780: 75 72 69 6e 67 20 74 68 65 20 70 72 65 76 69 6f  uring the previo
7790: 75 73 20 65 78 65 72 63 69 73 65 2e 20 57 65 27  us exercise. We'
77a0: 76 65 20 73 69 6d 70 6c 79 20 69 6e 69 74 69 61  ve simply initia
77b0: 6c 69 7a 65 64 20 79 65 74 20 61 6e 6f 74 68 65  lized yet anothe
77c0: 72 20 54 6f 70 6f 4c 61 79 65 72 73 2c 20 61 6e  r TopoLayers, an
77d0: 64 20 77 65 27 76 65 20 63 6f 70 69 65 64 20 69  d we've copied i
77e0: 6e 74 6f 20 69 74 20 74 68 65 20 73 61 6d 65 20  nto it the same 
77f0: 54 6f 70 6f 46 65 61 74 75 72 65 73 20 64 65 66  TopoFeatures def
7800: 69 6e 69 74 69 6f 6e 73 20 61 6c 72 65 61 64 79  initions already
7810: 20 73 75 70 70 6f 72 74 69 6e 67 20 32 30 31 31   supporting 2011
7820: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2e   Municipalities.
7830: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 55 50  ..<verbatim>..UP
7840: 44 41 54 45 20 63 65 6e 73 75 73 32 30 31 31 5f  DATE census2011_
7850: 74 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45  topofeatures..SE
7860: 54 20 66 69 64 20 3d 20 28 53 45 4c 45 43 54 20  T fid = (SELECT 
7870: 66 69 64 20 46 52 4f 4d 20 63 65 6e 73 75 73 32  fid FROM census2
7880: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
7890: 5f 36 20 57 48 45 52 45 20 63 6f 64 5f 63 6f 6d  _6 WHERE cod_com
78a0: 20 3d 20 35 31 30 34 30 29 0d 0a 57 48 45 52 45   = 51040)..WHERE
78b0: 20 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20   topolayer_id = 
78c0: 36 20 41 4e 44 20 66 69 64 20 49 4e 20 28 53 45  6 AND fid IN (SE
78d0: 4c 45 43 54 20 66 69 64 20 46 52 4f 4d 20 63 65  LECT fid FROM ce
78e0: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61  nsus2011_topofea
78f0: 74 75 72 65 73 5f 36 20 57 48 45 52 45 20 63 6f  tures_6 WHERE co
7900: 64 5f 63 6f 6d 20 69 6e 20 28 35 31 30 30 39 2c  d_com in (51009,
7910: 20 35 31 30 32 39 29 29 3b 0d 0a 0d 0a 55 50 44   51029));....UPD
7920: 41 54 45 20 63 65 6e 73 75 73 32 30 31 31 5f 74  ATE census2011_t
7930: 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 54  opofeatures..SET
7940: 20 66 69 64 20 3d 20 28 53 45 4c 45 43 54 20 66   fid = (SELECT f
7950: 69 64 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30  id FROM census20
7960: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f  11_topofeatures_
7970: 36 20 57 48 45 52 45 20 63 6f 64 5f 63 6f 6d 20  6 WHERE cod_com 
7980: 3d 20 35 31 30 34 31 29 0d 0a 57 48 45 52 45 20  = 51041)..WHERE 
7990: 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 36  topolayer_id = 6
79a0: 20 41 4e 44 20 66 69 64 20 49 4e 20 28 53 45 4c   AND fid IN (SEL
79b0: 45 43 54 20 66 69 64 20 46 52 4f 4d 20 63 65 6e  ECT fid FROM cen
79c0: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
79d0: 75 72 65 73 5f 36 20 57 48 45 52 45 20 63 6f 64  ures_6 WHERE cod
79e0: 5f 63 6f 6d 20 69 6e 20 28 35 31 30 33 32 2c 20  _com in (51032, 
79f0: 35 31 30 33 36 29 29 3b 0d 0a 3c 2f 76 65 72 62  51036));..</verb
7a00: 61 74 69 6d 3e 0d 0a 4e 6f 77 20 77 65 27 76 65  atim>..Now we've
7a10: 20 73 69 6d 70 6c 79 20 75 70 64 61 74 65 64 20   simply updated 
7a20: 61 6c 6c 20 72 65 6c 61 74 69 6f 6e 73 68 69 70  all relationship
7a30: 73 20 62 65 74 77 65 65 6e 20 54 6f 70 6f 6c 6f  s between Topolo
7a40: 67 79 20 46 61 63 65 73 20 61 6e 64 20 54 6f 70  gy Faces and Top
7a50: 6f 46 65 61 74 75 72 65 73 20 62 79 20 74 72 61  oFeatures by tra
7a60: 6e 73 66 65 72 72 69 6e 67 20 74 68 65 6d 20 66  nsferring them f
7a70: 72 6f 6d 20 3c 62 3e 35 31 30 30 39 20 3c 69 3e  rom <b>51009 <i>
7a80: 43 61 73 74 65 6c 66 72 61 6e 63 6f 20 64 69 20  Castelfranco di 
7a90: 53 6f 70 72 61 3c 2f 69 3e 3c 2f 62 3e 20 61 6e  Sopra</i></b> an
7aa0: 64 20 3c 62 3e 35 31 30 32 39 20 3c 69 3e 50 69  d <b>51029 <i>Pi
7ab0: 61 6e 20 64 69 20 53 63 6f 3c 2f 69 3e 3c 2f 62  an di Sco</i></b
7ac0: 3e 20 74 6f 20 3c 62 3e 35 31 30 34 35 20 3c 69  > to <b>51045 <i
7ad0: 3e 43 61 73 74 65 6c 66 72 61 6e 63 6f 20 50 69  >Castelfranco Pi
7ae0: 61 6e 64 69 73 63 c3 b2 3c 2f 69 3e 3c 2f 62 3e  andisc..</i></b>
7af0: 2e 20 54 68 65 6e 20 77 65 27 76 65 20 72 65 70  . Then we've rep
7b00: 6c 69 65 64 20 74 68 65 20 73 61 6d 65 20 61 63  lied the same ac
7b10: 74 69 6f 6e 2e 66 72 6f 6d 20 3c 62 3e 35 31 30  tion.from <b>510
7b20: 33 32 20 3c 69 3e 50 72 61 74 6f 76 65 63 63 68  32 <i>Pratovecch
7b30: 69 6f 3c 2f 69 3e 3c 2f 62 3e 20 61 6e 64 20 3c  io</i></b> and <
7b40: 62 3e 35 31 30 34 31 20 3c 69 3e 53 74 69 61 3c  b>51041 <i>Stia<
7b50: 2f 69 3e 3c 2f 62 3e 20 74 6f 20 3c 62 3e 35 31  /i></b> to <b>51
7b60: 30 34 31 20 3c 69 3e 50 72 61 74 6f 76 65 63 63  041 <i>Pratovecc
7b70: 68 69 6f 20 53 74 69 61 3c 2f 69 3e 3c 2f 62 3e  hio Stia</i></b>
7b80: 20 73 6f 20 74 6f 20 63 6f 72 72 65 63 74 6c 79   so to correctly
7b90: 20 75 70 64 61 74 65 20 61 6c 6c 20 6e 65 77 20   update all new 
7ba0: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20 69  Municipalities i
7bb0: 6e 74 65 72 65 73 74 69 6e 67 20 74 68 65 20 50  nteresting the P
7bc0: 72 6f 76 69 6e 63 65 20 6f 66 20 41 72 65 7a 7a  rovince of Arezz
7bd0: 6f 2e 3c 62 72 3e 0d 0a 59 6f 75 20 63 6f 75 6c  o.<br>..You coul
7be0: 64 20 65 76 65 6e 74 75 61 6c 6c 79 20 63 6f 6e  d eventually con
7bf0: 74 69 6e 75 65 20 62 79 20 79 6f 75 72 73 65 6c  tinue by yoursel
7c00: 66 20 73 6f 20 74 6f 20 75 70 64 61 74 65 20 61  f so to update a
7c10: 6c 6c 20 50 72 6f 76 69 6e 63 65 73 2e 20 0d 0a  ll Provinces. ..
7c20: 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45  <verbatim>..SELE
7c30: 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72  CT TopoGeo_Expor
7c40: 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73  tTopoLayer('cens
7c50: 75 73 32 30 31 31 27 2c 20 27 63 6f 6d 32 30 31  us2011', 'com201
7c60: 35 27 2c 20 27 6f 75 74 5f 63 6f 6d 5f 61 72 5f  5', 'out_com_ar_
7c70: 32 30 31 35 27 2c 20 31 2c 20 31 29 3b 0d 0a 0d  2015', 1, 1);...
7c80: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f  .SELECT TopoGeo_
7c90: 49 6e 73 65 72 74 46 65 61 74 75 72 65 46 72 6f  InsertFeatureFro
7ca0: 6d 54 6f 70 6f 4c 61 79 65 72 20 28 27 63 65 6e  mTopoLayer ('cen
7cb0: 73 75 73 32 30 31 31 27 2c 20 27 63 6f 6d 32 30  sus2011', 'com20
7cc0: 31 35 27 2c 20 27 6f 75 74 5f 63 6f 6d 5f 61 72  15', 'out_com_ar
7cd0: 5f 32 30 31 35 27 2c 20 66 69 64 29 0d 0a 46 52  _2015', fid)..FR
7ce0: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  OM census2011_to
7cf0: 70 6f 66 65 61 74 75 72 65 73 5f 36 0d 0a 57 48  pofeatures_6..WH
7d00: 45 52 45 20 63 6f 64 5f 70 72 6f 76 20 3d 20 35  ERE cod_prov = 5
7d10: 31 20 41 4e 44 20 63 6f 64 5f 63 6f 6d 20 4e 4f  1 AND cod_com NO
7d20: 54 20 49 4e 20 28 35 31 30 30 39 2c 20 35 31 30  T IN (51009, 510
7d30: 32 39 2c 20 35 31 30 33 32 2c 20 35 31 30 33 36  29, 51032, 51036
7d40: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d  );..</verbatim>.
7d50: 0a 46 69 6e 61 6c 6c 79 20 77 65 27 6c 6c 20 65  .Finally we'll e
7d60: 78 70 6f 72 74 20 61 20 6e 65 77 20 6c 61 79 65  xport a new laye
7d70: 72 20 72 65 70 72 65 73 65 6e 74 69 6e 67 20 74  r representing t
7d80: 68 65 20 75 70 64 61 74 65 64 20 32 30 31 35 20  he updated 2015 
7d90: 50 72 6f 76 69 6e 63 65 20 6f 66 20 41 72 65 7a  Province of Arez
7da0: 7a 6f 2e 3c 62 72 3e 0d 0a 54 68 69 73 20 74 69  zo.<br>..This ti
7db0: 6d 65 20 77 65 27 6c 6c 20 69 6e 76 6f 6b 65 20  me we'll invoke 
7dc0: 3c 62 3e 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72  <b>TopoGeo_Expor
7dd0: 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e  tTopoLayer()</b>
7de0: 20 62 79 20 73 70 65 63 69 66 79 69 6e 67 20 74   by specifying t
7df0: 68 65 20 3c 62 3e 3c 69 3e 63 72 65 61 74 65 2d  he <b><i>create-
7e00: 6f 6e 6c 79 3c 2f 69 3e 3c 2f 62 3e 20 73 70 65  only</i></b> spe
7e10: 63 69 61 6c 20 6f 70 74 69 6f 6e 2c 20 61 6e 64  cial option, and
7e20: 20 74 68 65 6e 20 77 65 27 6c 6c 20 75 73 65 20   then we'll use 
7e30: 74 68 65 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49  the <b>TopoGeo_I
7e40: 6e 73 65 72 74 46 65 61 74 75 72 65 46 72 6f 6d  nsertFeatureFrom
7e50: 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20  TopoLayer()</b> 
7e60: 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 69 6e 20  SQL function in 
7e70: 6f 72 64 65 72 20 74 6f 20 73 65 6c 65 63 74 69  order to selecti
7e80: 76 65 6c 79 20 65 78 70 6f 72 74 20 6f 6e 6c 79  vely export only
7e90: 20 61 20 6c 69 6d 69 74 65 64 20 73 75 62 73 65   a limited subse
7ea0: 74 20 66 72 6f 6d 20 74 68 65 20 6f 76 65 72 61  t from the overa
7eb0: 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 65 73 2e  ll TopoFeatures.
7ec0: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65  <br><br>..<table
7ed0: 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65   cellspan="4" ce
7ee0: 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67  llpadding="6" bg
7ef0: 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20  color="#f8f8f0" 
7f00: 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72  border="1">..<tr
7f10: 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d  ><td>..<img src=
7f20: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69  "https://www.gai
7f30: 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69  a-gis.it/gaia-si
7f40: 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f  ns/topofigs/topo
7f50: 2d 61 72 2d 32 30 31 31 2e 70 6e 67 22 20 61 6c  -ar-2011.png" al
7f60: 74 3d 22 74 6f 70 6f 2d 61 72 2d 32 30 31 31 22  t="topo-ar-2011"
7f70: 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69  >..</td><td>..<i
7f80: 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f  mg src="https://
7f90: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f  www.gaia-gis.it/
7fa0: 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69  gaia-sins/topofi
7fb0: 67 73 2f 74 6f 70 6f 2d 61 72 2d 32 30 31 35 2e  gs/topo-ar-2015.
7fc0: 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f 2d 61  png" alt="topo-a
7fd0: 72 2d 32 30 31 35 22 3e 0d 0a 3c 2f 74 64 3e 3c  r-2015">..</td><
7fe0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c  /tr>..<tr><td al
7ff0: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 4d 75 6e  ign="center">Mun
8000: 69 63 69 70 61 6c 69 74 69 65 73 20 69 6e 20 74  icipalities in t
8010: 68 65 20 50 72 6f 76 69 6e 63 65 20 6f 66 20 41  he Province of A
8020: 72 65 7a 7a 6f 3a 20 3c 62 3e 32 30 31 31 3c 2f  rezzo: <b>2011</
8030: 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  b></td><td align
8040: 3d 22 63 65 6e 74 65 72 22 3e 4d 75 6e 69 63 69  ="center">Munici
8050: 70 61 6c 69 74 69 65 73 20 69 6e 20 74 68 65 20  palities in the 
8060: 50 72 6f 76 69 6e 63 65 20 6f 66 20 41 72 65 7a  Province of Arez
8070: 7a 6f 3a 20 3c 62 3e 32 30 31 35 3c 2f 62 3e 3c  zo: <b>2015</b><
8080: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62  /td></tr>..</tab
8090: 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c  le><br>..<hr>..<
80a0: 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30  table width="100
80b0: 25 22 3e 3c 74 72 3e 0d 0a 3c 74 64 20 77 69 64  %"><tr>..<td wid
80c0: 74 68 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d 22  th="33%" align="
80d0: 6c 65 66 74 22 3e 3c 61 20 68 72 65 66 3d 22 68  left"><a href="h
80e0: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  ttps://www.gaia-
80f0: 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69  gis.it/fossil/li
8100: 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69  bspatialite/wiki
8110: 3f 6e 61 6d 65 3d 74 6f 70 6f 2d 69 6e 74 65 72  ?name=topo-inter
8120: 6d 65 64 69 61 74 65 22 3e 70 72 65 76 69 6f 75  mediate">previou
8130: 73 20 70 61 67 65 3c 2f 61 3e 3c 2f 74 64 3e 0d  s page</a></td>.
8140: 0a 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74  .<td align="cent
8150: 65 72 22 3e 3c 61 20 68 72 65 66 3d 22 68 74 74  er"><a href="htt
8160: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69  ps://www.gaia-gi
8170: 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73  s.it/fossil/libs
8180: 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e  patialite/wiki?n
8190: 61 6d 65 3d 49 53 4f 2b 54 6f 70 6f 6c 6f 67 79  ame=ISO+Topology
81a0: 22 3e 62 61 63 6b 20 74 6f 20 69 6e 64 65 78 3c  ">back to index<
81b0: 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 77 69  /a></td>..<td wi
81c0: 64 74 68 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d  dth="33%" align=
81d0: 22 72 69 67 68 74 22 3e 3c 2f 74 64 3e 0d 0a 3c  "right"></td>..<
81e0: 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 0a 5a 20 34  /tr></table>.Z 4
81f0: 62 31 66 62 61 37 65 65 31 65 65 35 35 39 63 35  b1fba7ee1ee559c5
8200: 32 35 65 32 63 65 34 31 37 30 35 39 63 64 62 0a  25e2ce417059cdb.