Hex Artifact Content
Not logged in

Artifact 96b98c9e96fd829359e2e81aff8fc731076bb01f:

Wiki page [topo-advanced] by sandro 2015-12-16 22:31:34.
0000: 44 20 32 30 31 35 2d 31 32 2d 31 36 54 32 32 3a  D 2015-12-16T22:
0010: 33 31 3a 33 34 2e 37 35 31 0a 4c 20 74 6f 70 6f  31:34.751.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 35 37 39 39  -advanced.P 5799
0030: 34 64 63 34 36 31 32 63 62 65 35 66 32 36 65 37  4dc4612cbe5f26e7
0040: 61 34 64 32 38 34 63 63 65 61 34 30 61 34 35 64  a4d284ccea40a45d
0050: 33 32 34 61 0a 55 20 73 61 6e 64 72 6f 0a 57 20  324a.U sandro.W 
0060: 33 33 31 33 35 0a 3c 74 61 62 6c 65 20 63 65 6c  33135.<table cel
0070: 6c 73 70 61 63 69 6e 67 3d 22 31 32 22 20 77 69  lspacing="12" wi
0080: 64 74 68 3d 22 31 30 30 25 22 3e 0d 0a 3c 74 72  dth="100%">..<tr
0090: 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22  ><td colspan="2"
00a0: 3e 0d 0a 3c 74 61 62 6c 65 20 77 69 64 74 68 3d  >..<table width=
00b0: 22 31 30 30 25 22 20 62 67 63 6f 6c 6f 72 3d 22  "100%" bgcolor="
00c0: 23 66 30 66 30 66 38 22 3e 0d 0a 3c 74 72 3e 3c  #f0f0f8">..<tr><
00d0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72  td align="center
00e0: 22 3e 0d 0a 3c 68 31 3e 54 6f 70 6f 6c 6f 67 79  ">..<h1>Topology
00f0: 2d 47 65 6f 6d 65 74 72 79 3a 20 61 6e 20 61 64  -Geometry: an ad
0100: 76 61 6e 63 65 64 20 74 75 74 6f 72 69 61 6c 3c  vanced tutorial<
0110: 2f 68 31 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e  /h1>..</td></tr>
0120: 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 74 61 62 6c 65  </table>..<table
0130: 20 77 69 64 74 68 3d 22 31 30 30 25 22 3e 3c 74   width="100%"><t
0140: 72 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33  r>..<td width="3
0150: 33 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22  3%" align="left"
0160: 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a  ><a href="https:
0170: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
0180: 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74  t/fossil/libspat
0190: 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65  ialite/wiki?name
01a0: 3d 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 69 61  =topo-intermedia
01b0: 74 65 22 3e 70 72 65 76 69 6f 75 73 20 70 61 67  te">previous pag
01c0: 65 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20  e</a></td>..<td 
01d0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c  align="center"><
01e0: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f  a href="https://
01f0: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f  www.gaia-gis.it/
0200: 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61  fossil/libspatia
0210: 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 49  lite/wiki?name=I
0220: 53 4f 2b 54 6f 70 6f 6c 6f 67 79 22 3e 62 61 63  SO+Topology">bac
0230: 6b 20 74 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f  k to index</a></
0240: 74 64 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22  td>..<td width="
0250: 33 33 25 22 20 61 6c 69 67 6e 3d 22 72 69 67 68  33%" align="righ
0260: 74 22 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c  t"></td>..</tr><
0270: 2f 74 61 62 6c 65 3e 0d 0a 3c 64 69 76 20 77 69  /table>..<div wi
0280: 64 74 68 3d 39 30 25 3e 0d 0a 3c 68 33 3e 54 6f  dth=90%>..<h3>To
0290: 70 6f 4c 61 79 65 72 73 20 61 6e 64 20 54 6f 70  poLayers and Top
02a0: 6f 46 65 61 74 75 72 65 73 3c 2f 68 33 3e 0d 0a  oFeatures</h3>..
02b0: 49 6e 20 74 68 65 20 70 72 65 76 69 6f 75 73 20  In the previous 
02c0: 74 75 74 6f 72 69 61 6c 20 77 65 27 76 65 20 65  tutorial we've e
02d0: 78 61 6d 69 6e 65 64 20 61 20 66 69 72 73 74 20  xamined a first 
02e0: 63 6f 75 70 6c 65 20 6f 66 20 53 51 4c 20 66 75  couple of SQL fu
02f0: 6e 63 74 69 6f 6e 73 20 69 6e 74 65 6e 64 65 64  nctions intended
0300: 20 74 6f 20 65 78 70 6f 72 74 20 61 20 47 65 6f   to export a Geo
0310: 54 61 62 6c 65 20 6f 75 74 20 66 72 6f 6d 20 61  Table out from a
0320: 6e 20 65 78 69 73 74 69 6e 67 20 54 6f 70 6f 6c  n existing Topol
0330: 6f 67 79 3a 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f  ogy: <b>TopoGeo_
0340: 54 6f 47 65 6f 54 61 62 6c 65 28 29 3c 2f 62 3e  ToGeoTable()</b>
0350: 20 61 6e 64 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f   and <b>TopoGeo_
0360: 54 6f 47 65 6f 54 61 62 6c 65 47 65 6e 65 72 61  ToGeoTableGenera
0370: 6c 69 7a 65 28 29 3c 2f 62 3e 2e 3c 62 72 3e 0d  lize()</b>.<br>.
0380: 0a 53 70 61 74 69 61 4c 69 74 65 20 73 75 70 70  .SpatiaLite supp
0390: 6f 72 74 73 20 61 20 6d 6f 72 65 20 73 6f 70 68  orts a more soph
03a0: 69 73 74 69 63 61 74 65 64 20 28 61 6e 64 20 63  isticated (and c
03b0: 6f 6d 70 6c 65 78 29 20 61 70 70 72 6f 61 63 68  omplex) approach
03c0: 20 62 61 73 65 64 20 6f 6e 20 3c 62 3e 54 6f 70   based on <b>Top
03d0: 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 61 6e 64 20  oLayers</b> and 
03e0: 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 3c  <b>TopoFeatures<
03f0: 2f 62 3e 20 73 70 65 63 69 66 69 63 61 6c 6c 79  /b> specifically
0400: 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 73 75 70   intended to sup
0410: 70 6f 72 74 20 61 20 76 65 72 79 20 66 6c 65 78  port a very flex
0420: 69 62 6c 65 20 6d 65 63 68 61 6e 69 73 6d 20 66  ible mechanism f
0430: 6f 72 20 65 78 70 6f 72 74 69 6e 67 20 61 20 66  or exporting a f
0440: 75 6c 6c 20 73 65 74 20 6f 66 20 47 65 6f 54 61  ull set of GeoTa
0450: 62 6c 65 28 73 29 20 64 69 72 65 63 74 6c 79 20  ble(s) directly 
0460: 64 65 72 69 76 69 6e 67 20 66 72 6f 6d 20 61 20  deriving from a 
0470: 54 6f 70 6f 6c 6f 67 79 2e 0d 0a 3c 68 34 3e 61  Topology...<h4>a
0480: 20 63 6f 6e 63 65 70 74 75 61 6c 20 72 65 66 65   conceptual refe
0490: 72 65 6e 63 65 20 66 72 61 6d 65 77 6f 72 6b 3c  rence framework<
04a0: 2f 68 34 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e  /h4>..<ul>..<li>
04b0: 61 6e 20 49 53 4f 20 54 6f 70 6f 6c 6f 67 79 20  an ISO Topology 
04c0: 69 73 20 6a 75 73 74 20 69 6e 74 65 6e 64 65 64  is just intended
04d0: 20 74 6f 20 73 75 70 70 6f 72 74 20 61 20 63 6f   to support a co
04e0: 6e 73 69 73 74 65 6e 74 20 73 65 74 20 6f 66 20  nsistent set of 
04f0: 3c 62 3e 4e 6f 64 65 73 3c 2f 62 3e 2c 20 3c 62  <b>Nodes</b>, <b
0500: 3e 45 64 67 65 73 3c 2f 62 3e 20 61 6e 64 20 3c  >Edges</b> and <
0510: 62 3e 46 61 63 65 73 3c 2f 62 3e 20 70 72 69 6d  b>Faces</b> prim
0520: 69 74 69 76 65 73 20 66 75 6c 6c 79 20 63 6f 76  itives fully cov
0530: 65 72 69 6e 67 20 74 68 65 20 70 6c 61 6e 65 2e  ering the plane.
0540: 0d 0a 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69  ..Topology primi
0550: 74 69 76 65 73 20 63 6f 72 72 65 73 70 6f 6e 64  tives correspond
0560: 20 74 6f 20 70 75 72 65 20 67 65 6f 6d 65 74 72   to pure geometr
0570: 69 65 73 2c 20 61 6e 64 20 63 61 6e 20 3c 62 3e  ies, and can <b>
0580: 6e 65 76 65 72 3c 2f 62 3e 20 62 65 20 64 69 72  never</b> be dir
0590: 65 63 74 6c 79 20 61 73 73 6f 63 69 61 74 65 64  ectly associated
05a0: 20 74 6f 20 61 20 63 6f 72 72 65 73 70 6f 6e 64   to a correspond
05b0: 69 6e 67 20 73 65 74 20 6f 66 20 69 6e 66 6f 72  ing set of infor
05c0: 6d 61 74 69 6f 6e 61 6c 20 61 74 74 72 69 62 75  mational attribu
05d0: 74 65 73 2e 0d 0a 42 6f 74 68 20 4e 6f 64 65 20  tes...Both Node 
05e0: 61 6e 64 20 45 64 67 65 20 70 72 69 6d 69 74 69  and Edge primiti
05f0: 76 65 73 20 64 69 72 65 63 74 6c 79 20 63 6f 72  ves directly cor
0600: 72 65 73 70 6f 6e 64 20 74 6f 20 61 20 3c 75 3e  respond to a <u>
0610: 3c 69 3e 72 65 61 6c 20 67 65 6f 6d 65 74 72 79  <i>real geometry
0620: 3c 2f 69 3e 3c 2f 75 3e 2c 20 62 75 74 20 46 61  </i></u>, but Fa
0630: 63 65 20 70 72 69 6d 69 74 69 76 65 73 20 73 69  ce primitives si
0640: 6d 70 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 20  mply correspond 
0650: 74 6f 20 61 20 3c 75 3e 3c 69 3e 76 69 72 74 75  to a <u><i>virtu
0660: 61 6c 20 67 65 6f 6d 65 74 72 79 3c 2f 69 3e 3c  al geometry</i><
0670: 2f 75 3e 20 74 68 75 73 20 6e 65 63 65 73 73 61  /u> thus necessa
0680: 72 69 6c 79 20 72 65 71 75 69 72 69 6e 67 20 74  rily requiring t
0690: 6f 20 62 65 20 64 79 6e 61 6d 69 63 61 6c 6c 79  o be dynamically
06a0: 20 72 65 63 6f 6e 73 74 72 75 63 74 65 64 20 65   reconstructed e
06b0: 76 65 72 79 20 74 69 6d 65 20 74 68 61 74 20 74  very time that t
06c0: 68 65 79 20 61 72 65 20 72 65 66 65 72 65 6e 63  hey are referenc
06d0: 65 64 20 28 61 6e 64 20 74 68 69 73 20 63 6f 75  ed (and this cou
06e0: 6c 64 20 65 61 73 69 6c 79 20 62 65 63 6f 6d 65  ld easily become
06f0: 20 61 20 72 65 61 6c 20 62 6f 74 74 6c 65 6e 65   a real bottlene
0700: 63 6b 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 41  ck).</li>..<li>A
0710: 20 47 65 6f 54 61 62 6c 65 20 28 61 6c 69 61 73   GeoTable (alias
0720: 20 3c 75 3e 3c 69 3e 6c 61 79 65 72 3c 2f 69 3e   <u><i>layer</i>
0730: 3c 2f 75 3e 2c 20 74 6f 20 75 73 65 20 74 68 65  </u>, to use the
0740: 20 63 6f 6d 6d 6f 6e 20 47 49 53 20 74 65 72 6d   common GIS term
0750: 69 6e 6f 6c 6f 67 79 29 20 6f 6e 20 74 68 65 20  inology) on the 
0760: 6f 74 68 65 72 20 68 61 6e 64 2c 20 69 73 20 61  other hand, is a
0770: 6c 77 61 79 73 20 62 61 73 65 64 20 6f 6e 20 6d  lways based on m
0780: 61 6e 79 20 64 69 73 74 69 6e 63 74 20 66 65 61  any distinct fea
0790: 74 75 72 65 73 2c 20 61 6e 64 20 66 6f 72 20 65  tures, and for e
07a0: 61 63 68 20 66 65 61 74 75 72 65 20 61 20 47 65  ach feature a Ge
07b0: 6f 6d 65 74 72 79 20 3c 62 3e 77 69 74 68 3c 2f  ometry <b>with</
07c0: 62 3e 20 61 73 73 6f 63 69 61 74 65 64 20 73 65  b> associated se
07d0: 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  t of information
07e0: 20 61 74 74 72 69 62 75 74 65 73 2e 3c 2f 6c 69   attributes.</li
07f0: 3e 0d 0a 3c 6c 69 3e 74 68 65 72 65 20 69 73 20  >..<li>there is 
0800: 61 20 66 75 72 74 68 65 72 20 64 69 66 66 65 72  a further differ
0810: 65 6e 63 65 20 74 6f 20 62 65 20 74 61 6b 65 6e  ence to be taken
0820: 20 69 6e 74 6f 20 61 63 63 6f 75 6e 74 3a 20 54   into account: T
0830: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76  opology primitiv
0840: 65 73 20 6e 65 63 65 73 73 61 72 69 6c 79 20 61  es necessarily a
0850: 72 65 20 65 6c 65 6d 65 6e 74 61 72 79 2e 20 46  re elementary. F
0860: 65 61 74 75 72 65 20 47 65 6f 6d 65 74 72 69 65  eature Geometrie
0870: 73 20 63 61 6e 20 75 73 75 61 6c 6c 79 20 72 65  s can usually re
0880: 70 72 65 73 65 6e 74 20 73 6f 6d 65 20 63 6f 6d  present some com
0890: 70 6c 65 78 20 74 79 70 65 3a 20 4d 55 4c 54 49  plex type: MULTI
08a0: 50 4f 49 4e 54 2c 20 4d 55 4c 54 49 4c 49 4e 45  POINT, MULTILINE
08b0: 53 54 52 49 4e 47 2c 20 4d 55 4c 54 49 50 4f 4c  STRING, MULTIPOL
08c0: 59 47 4f 4e 20 61 6e 64 20 70 6f 73 73 69 62 6c  YGON and possibl
08d0: 79 20 61 20 47 45 4f 4d 45 54 52 59 43 4f 4c 4c  y a GEOMETRYCOLL
08e0: 45 43 54 49 4f 4e 2e 20 53 6f 20 69 74 20 69 73  ECTION. So it is
08f0: 20 70 6f 73 73 69 62 6c 65 20 74 68 61 74 20 61   possible that a
0900: 20 46 65 61 74 75 72 65 20 47 65 6f 6d 65 74 72   Feature Geometr
0910: 79 20 64 6f 65 73 20 6e 6f 74 20 6e 65 63 65 73  y does not neces
0920: 73 61 72 69 6c 79 20 63 6f 72 72 65 73 70 6f 6e  sarily correspon
0930: 64 73 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 54  ds to a single T
0940: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76  opology primitiv
0950: 65 20 3b 20 61 20 46 65 61 74 75 72 65 20 47 65  e ; a Feature Ge
0960: 6f 6d 65 74 72 79 20 63 6f 75 6c 64 20 65 61 73  ometry could eas
0970: 69 6c 79 20 62 65 20 64 65 72 69 76 65 64 20 66  ily be derived f
0980: 72 6f 6d 20 74 68 65 20 63 6f 6c 6c 65 63 74 69  rom the collecti
0990: 6f 6e 20 6f 66 20 6d 61 6e 79 20 64 69 66 66 65  on of many diffe
09a0: 72 65 6e 74 20 54 6f 70 6f 6c 6f 67 79 20 70 72  rent Topology pr
09b0: 69 6d 69 74 69 76 65 73 2e 3c 2f 6c 69 3e 20 0d  imitives.</li> .
09c0: 0a 3c 6c 69 3e 74 68 61 74 27 73 20 6e 6f 74 20  .<li>that's not 
09d0: 61 6c 6c 3a 20 6d 61 6e 79 20 64 69 66 66 65 72  all: many differ
09e0: 65 6e 74 20 47 65 6f 54 61 62 6c 65 73 20 63 6f  ent GeoTables co
09f0: 75 6c 64 20 65 76 65 6e 74 75 61 6c 6c 79 20 62  uld eventually b
0a00: 65 20 64 65 72 69 76 65 64 20 66 72 6f 6d 20 61  e derived from a
0a10: 20 73 69 6e 67 6c 65 20 54 6f 70 6f 6c 6f 67 79   single Topology
0a20: 3b 20 61 6e 64 20 74 68 65 20 73 61 6d 65 20 54  ; and the same T
0a30: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76  opology primitiv
0a40: 65 20 63 6f 75 6c 64 20 70 6c 61 79 20 61 20 20  e could play a  
0a50: 3c 62 3e 63 6f 6d 70 6c 65 74 65 6c 79 20 64 69  <b>completely di
0a60: 66 66 65 72 65 6e 74 3c 2f 62 3e 20 72 6f 6c 65  fferent</b> role
0a70: 20 69 6e 20 65 61 63 68 20 47 65 6f 54 61 62 6c   in each GeoTabl
0a80: 65 2e 3c 62 72 3e 0d 0a 41 20 73 69 6d 70 6c 65  e.<br>..A simple
0a90: 20 73 61 6d 70 6c 65 3a 20 69 6d 61 67 69 6e 65   sample: imagine
0aa0: 20 61 20 54 6f 70 6f 6c 6f 67 79 20 63 6f 72 72   a Topology corr
0ab0: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 6f 6d  esponding to som
0ac0: 65 20 6c 61 6e 64 20 72 65 67 69 73 74 72 79 20  e land registry 
0ad0: 6d 61 70 20 77 68 65 72 65 20 6d 61 6e 79 20 70  map where many p
0ae0: 6f 74 65 6e 74 69 61 6c 20 6c 61 79 65 72 73 20  otential layers 
0af0: 73 75 63 68 20 61 73 3a 20 62 75 69 6c 64 69 6e  such as: buildin
0b00: 67 73 2c 20 61 67 72 69 63 75 6c 74 75 72 61 6c  gs, agricultural
0b10: 20 6c 61 6e 64 2c 20 70 6f 70 75 6c 61 74 65 64   land, populated
0b20: 20 70 6c 61 63 65 73 2c 20 61 64 6d 69 6e 69 73   places, adminis
0b30: 74 72 61 74 69 76 65 20 62 6f 75 6e 64 61 72 69  trative boundari
0b40: 65 73 2c 20 72 6f 61 64 73 2c 20 70 6f 6e 64 73  es, roads, ponds
0b50: 2c 20 72 69 76 65 72 73 2c 20 66 65 6e 63 65 73  , rivers, fences
0b60: 20 77 69 6c 6c 20 65 78 69 73 74 2e 3c 62 72 3e   will exist.<br>
0b70: 0d 0a 49 6e 20 73 75 63 68 20 61 20 63 6f 6e 74  ..In such a cont
0b80: 65 78 74 20 61 20 66 65 6e 63 65 20 63 6f 75 6c  ext a fence coul
0b90: 64 20 65 61 73 69 6c 79 20 63 6f 72 72 65 73 70  d easily corresp
0ba0: 6f 6e 64 20 74 6f 20 61 20 46 65 61 74 75 72 65  ond to a Feature
0bb0: 20 77 69 74 68 69 6e 20 74 68 65 20 22 3c 69 3e   within the "<i>
0bc0: 3c 62 3e 66 65 6e 63 65 73 3c 2f 62 3e 3c 2f 69  <b>fences</b></i
0bd0: 3e 22 20 6c 61 79 65 72 2c 20 63 6f 75 6c 64 2c  >" layer, could,
0be0: 20 3c 62 3e 6e 6f 74 20 6f 6e 6c 79 2c 20 73 65   <b>not only, se
0bf0: 70 61 72 61 74 65 3c 2f 62 3e 20 74 77 6f 20 61  parate</b> two a
0c00: 64 6a 61 63 65 6e 74 20 61 67 72 69 63 75 6c 74  djacent agricult
0c10: 75 72 61 6c 20 61 72 65 61 73 2c 20 3c 62 3e 62  ural areas, <b>b
0c20: 75 74 20 61 6c 73 6f 3c 2f 62 3e 2c 20 62 65 20  ut also</b>, be 
0c30: 70 61 72 74 20 6f 66 20 73 6f 6d 65 20 61 64 6d  part of some adm
0c40: 69 6e 69 73 74 72 61 74 69 76 65 20 62 6f 75 6e  inistrative boun
0c50: 64 61 72 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  dary.</li>..<li>
0c60: 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62  <b>TopoLayers</b
0c70: 3e 20 61 6e 64 20 3c 62 3e 54 6f 70 6f 46 65 61  > and <b>TopoFea
0c80: 74 75 72 65 73 3c 2f 62 3e 20 72 65 70 72 65 73  tures</b> repres
0c90: 65 6e 74 20 61 20 63 6f 6d 70 6c 65 78 20 61 6e  ent a complex an
0ca0: 64 20 66 6c 65 78 69 62 6c 65 20 73 74 72 75 63  d flexible struc
0cb0: 74 75 72 65 20 69 6e 74 65 6e 64 65 64 20 74 6f  ture intended to
0cc0: 20 65 73 74 61 62 6c 69 73 68 20 61 20 70 65 72   establish a per
0cd0: 6d 61 6e 65 6e 74 20 72 65 6c 61 74 69 6f 6e 73  manent relations
0ce0: 68 69 70 20 62 65 74 77 65 65 6e 20 54 6f 70 6f  hip between Topo
0cf0: 6c 6f 67 79 20 20 50 72 69 6d 69 74 69 76 65 73  logy  Primitives
0d00: 20 61 6e 64 20 47 65 6f 54 61 62 6c 65 20 46 65   and GeoTable Fe
0d10: 61 74 75 72 65 73 2e 0d 0a 3c 75 6c 3e 0d 0a 3c  atures...<ul>..<
0d20: 6c 69 3e 65 61 63 68 20 3c 62 3e 54 6f 70 6f 4c  li>each <b>TopoL
0d30: 61 79 65 72 3c 2f 62 3e 20 69 73 20 75 6e 69 71  ayer</b> is uniq
0d40: 75 65 6c 79 20 69 64 65 6e 74 69 66 69 65 64 20  uely identified 
0d50: 62 79 20 69 74 73 20 3c 62 3e 6e 61 6d 65 3c 2f  by its <b>name</
0d60: 62 3e 20 61 6e 64 20 64 69 72 65 63 74 6c 79 20  b> and directly 
0d70: 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61  corresponds to a
0d80: 20 73 69 6e 67 6c 65 20 47 65 6f 54 61 62 6c 65   single GeoTable
0d90: 20 74 6f 20 62 65 20 65 78 70 6f 72 74 65 64 20   to be exported 
0da0: 66 72 6f 6d 20 74 68 65 20 54 6f 70 6f 6c 6f 67  from the Topolog
0db0: 79 3c 62 72 3e 0d 0a 41 6e 20 61 72 62 69 74 72  y<br>..An arbitr
0dc0: 61 72 79 20 6e 75 6d 62 65 72 20 6f 66 20 54 6f  ary number of To
0dd0: 70 6f 4c 61 79 65 72 73 20 63 61 6e 20 62 65 20  poLayers can be 
0de0: 63 72 65 61 74 65 64 20 6f 6e 20 74 68 65 20 73  created on the s
0df0: 61 6d 65 20 54 6f 70 6f 6c 6f 67 79 2c 20 61 6e  ame Topology, an
0e00: 64 20 65 61 63 68 20 6f 6e 65 20 6f 66 20 74 68  d each one of th
0e10: 65 6d 20 77 69 6c 6c 20 61 63 74 20 61 73 20 61  em will act as a
0e20: 20 73 65 70 61 72 61 74 65 20 63 6f 6e 74 61 69   separate contai
0e30: 6e 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 65  ner.</li>..<li>e
0e40: 61 63 68 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75  ach <b>TopoFeatu
0e50: 72 65 3c 2f 62 3e 20 69 73 20 75 6e 69 71 75 65  re</b> is unique
0e60: 6c 79 20 69 64 65 6e 74 69 66 69 65 64 20 62 79  ly identified by
0e70: 20 69 74 73 20 3c 62 3e 66 69 64 3c 2f 62 3e 20   its <b>fid</b> 
0e80: 28 3c 69 3e 66 65 61 74 75 72 65 2d 69 64 3c 2f  (<i>feature-id</
0e90: 69 3e 29 20 61 6e 64 20 63 6f 72 72 65 73 70 6f  i>) and correspo
0ea0: 6e 64 73 20 74 6f 20 61 20 73 69 6e 67 6c 65 20  nds to a single 
0eb0: 46 65 61 74 75 72 65 20 63 6f 6e 74 61 69 6e 69  Feature containi
0ec0: 6e 67 20 61 6e 20 69 6e 64 69 76 69 64 75 61 6c  ng an individual
0ed0: 20 73 65 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74   set of informat
0ee0: 69 6f 6e 61 6c 20 61 74 74 72 69 62 75 74 65 73  ional attributes
0ef0: 2e 3c 62 72 3e 0d 0a 54 68 65 20 47 65 6f 6d 65  .<br>..The Geome
0f00: 74 72 79 20 66 6f 72 20 65 61 63 68 20 54 6f 70  try for each Top
0f10: 6f 46 65 61 74 75 72 65 20 69 73 20 61 6c 77 61  oFeature is alwa
0f20: 79 73 20 69 6e 64 69 72 65 63 74 6c 79 20 64 65  ys indirectly de
0f30: 66 69 6e 65 64 20 62 79 20 73 70 65 63 69 66 79  fined by specify
0f40: 69 6e 67 20 61 20 6c 69 73 74 20 6f 66 20 54 6f  ing a list of To
0f50: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
0f60: 73 20 69 6e 64 69 76 69 64 75 61 6c 6c 79 20 72  s individually r
0f70: 65 66 65 72 65 6e 63 65 64 20 62 79 20 74 68 65  eferenced by the
0f80: 69 72 20 49 44 73 2e 3c 62 72 3e 0d 0a 53 75 63  ir IDs.<br>..Suc
0f90: 68 20 61 20 67 65 6f 6d 65 74 72 79 20 69 73 20  h a geometry is 
0fa0: 63 6f 6e 73 69 64 65 72 65 64 20 74 6f 20 62 65  considered to be
0fb0: 20 3c 62 3e 3c 69 3e 76 69 72 74 75 61 6c 3c 2f   <b><i>virtual</
0fc0: 69 3e 3c 2f 62 3e 2c 20 6d 65 61 6e 69 6e 67 20  i></b>, meaning 
0fd0: 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20  that it will be 
0fe0: 63 72 65 61 74 65 64 20 74 68 72 6f 75 67 68 20  created through 
0ff0: 74 68 65 20 3c 62 3e 63 6f 6c 6c 65 63 74 69 6f  the <b>collectio
1000: 6e 2f 61 67 67 72 65 67 61 74 69 6f 6e 3c 2f 62  n/aggregation</b
1010: 3e 20 6f 66 20 61 6c 6c 20 72 65 66 65 72 65 6e  > of all referen
1020: 63 65 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69  ced Topology pri
1030: 6d 69 74 69 76 65 73 2c 20 77 68 65 6e 20 65 78  mitives, when ex
1040: 70 6f 72 74 65 64 20 74 6f 20 74 68 65 20 64 65  ported to the de
1050: 73 74 69 6e 61 74 69 6f 6e 20 47 65 6f 54 61 62  stination GeoTab
1060: 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c  le.</li>..</ul><
1070: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 54 68 65 20 54 6f  /li>..<li>The To
1080: 70 6f 4c 61 79 65 72 73 20 2f 20 54 6f 70 6f 46  poLayers / TopoF
1090: 65 61 74 75 72 65 73 20 73 74 72 75 63 74 75 72  eatures structur
10a0: 65 20 69 73 20 70 72 61 63 74 69 63 61 6c 6c 79  e is practically
10b0: 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 61 73 20   implemented as 
10c0: 61 20 73 65 74 20 6f 66 20 73 65 76 65 72 61 6c  a set of several
10d0: 20 63 6c 6f 73 65 6c 79 20 72 65 6c 61 74 65 64   closely related
10e0: 20 44 42 2d 74 61 62 6c 65 73 20 20 28 74 68 65   DB-tables  (the
10f0: 20 72 65 73 70 65 63 74 69 76 65 20 6c 61 79 6f   respective layo
1100: 75 74 73 20 6f 66 20 77 68 69 63 68 20 77 65 27  uts of which we'
1110: 6c 6c 20 65 78 61 6d 69 6e 65 20 6c 61 74 65 72  ll examine later
1120: 20 69 6e 20 66 75 6c 6c 20 64 65 74 61 69 6c 29   in full detail)
1130: 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e  :..<ul>..<li><b>
1140: 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c  <<i>topo-prefix<
1150: 2f 69 3e 3e 5f 74 6f 70 6f 6c 61 79 65 72 73 3c  /i>>_topolayers<
1160: 2f 62 3e 3a 20 74 68 69 73 20 66 69 72 73 74 20  /b>: this first 
1170: 74 61 62 6c 65 20 73 69 6d 70 6c 79 20 69 73 20  table simply is 
1180: 61 20 63 61 74 61 6c 6f 67 20 6f 66 20 61 6c 6c  a catalog of all
1190: 20 54 6f 70 6f 4c 61 79 65 72 73 20 73 75 70 70   TopoLayers supp
11a0: 6f 72 74 69 6e 67 20 74 68 65 20 73 61 6d 65 20  orting the same 
11b0: 54 6f 70 6f 6c 6f 67 79 2e 3c 62 72 3e 0d 0a 45  Topology.<br>..E
11c0: 61 63 68 20 54 6f 70 6f 4c 61 79 65 72 20 69 73  ach TopoLayer is
11d0: 20 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 69   identified by i
11e0: 74 73 20 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 20 61  ts <b>name</b> a
11f0: 6e 64 20 62 79 20 69 74 73 20 3c 62 3e 49 44 3c  nd by its <b>ID<
1200: 2f 62 3e 3b 20 62 6f 74 68 20 6f 66 20 77 68 69  /b>; both of whi
1210: 63 68 20 6d 75 73 74 20 62 65 20 3c 69 3e 3c 75  ch must be <i><u
1220: 3e 75 6e 69 71 75 65 3c 2f 75 3e 3c 2f 69 3e 2e  >unique</u></i>.
1230: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c 3c  </li>..<li><b><<
1240: 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69  i>topo-prefix</i
1250: 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 3c  >>_topofeatures<
1260: 2f 62 3e 3a 20 74 68 69 73 20 73 65 63 6f 6e 64  /b>: this second
1270: 20 74 61 62 6c 65 20 69 73 20 69 6e 74 65 6e 64   table is intend
1280: 65 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74 6c  ed to permanentl
1290: 79 20 73 74 6f 72 65 20 61 6c 6c 20 63 72 6f 73  y store all cros
12a0: 73 2d 72 65 66 65 72 65 6e 63 65 73 20 65 78 69  s-references exi
12b0: 73 74 69 6e 67 20 62 65 74 77 65 65 6e 20 54 6f  sting between To
12c0: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65  pology primitive
12d0: 73 20 61 6e 64 20 54 6f 70 6f 46 65 61 74 75 72  s and TopoFeatur
12e0: 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62  es.</li>..<li><b
12f0: 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78  ><<i>topo-prefix
1300: 3c 2f 69 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72  </i>>_topofeatur
1310: 65 73 5f 3c 3c 69 3e 74 6f 70 6f 6c 61 79 65 72  es_<<i>topolayer
1320: 2d 69 64 3c 2f 69 3e 3e 3c 2f 62 3e 3a 20 66 6f  -id</i>></b>: fo
1330: 72 20 65 61 63 68 20 73 69 6e 67 6c 65 20 54 6f  r each single To
1340: 70 6f 4c 61 79 65 72 20 61 20 73 65 70 61 72 61  poLayer a separa
1350: 74 65 20 74 61 62 6c 65 20 69 73 20 72 65 71 75  te table is requ
1360: 69 72 65 64 2e 20 54 68 65 20 61 63 74 75 61 6c  ired. The actual
1370: 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 20 69 73   relationship is
1380: 20 65 73 74 61 62 6c 69 73 68 65 64 20 76 69 61   established via
1390: 20 74 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 79 65   the <b>TopoLaye
13a0: 72 2d 49 44 3c 2f 62 3e 20 73 75 66 66 69 78 2e  r-ID</b> suffix.
13b0: 3c 62 72 3e 0d 0a 41 6c 6c 20 74 68 65 73 65 20  <br>..All these 
13c0: 74 61 62 6c 65 73 20 61 72 65 20 69 6e 74 65 6e  tables are inten
13d0: 64 65 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74  ded to permanent
13e0: 6c 79 20 73 74 6f 72 65 20 74 68 65 20 69 6e 66  ly store the inf
13f0: 6f 72 6d 61 74 69 6f 6e 61 6c 20 61 74 74 72 69  ormational attri
1400: 62 75 74 65 73 20 66 6f 72 20 65 61 63 68 20 54  butes for each T
1410: 6f 70 6f 46 65 61 74 75 72 65 20 6f 6e 20 74 68  opoFeature on th
1420: 65 20 73 61 6d 65 20 54 6f 70 6f 4c 61 79 65 72  e same TopoLayer
1430: 2e 0d 0a 44 69 66 66 65 72 65 6e 74 20 54 6f 70  ...Different Top
1440: 6f 4c 61 79 65 72 73 20 77 69 6c 6c 20 6f 62 76  oLayers will obv
1450: 69 6f 75 73 6c 79 20 73 75 70 70 6f 72 74 20 61  iously support a
1460: 20 64 69 66 66 65 72 65 6e 74 20 73 65 74 20 6f   different set o
1470: 66 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 61 6c 20  f informational 
1480: 61 74 74 72 69 62 75 74 65 73 20 74 68 75 73 20  attributes thus 
1490: 72 65 71 75 69 72 69 6e 67 20 61 6e 20 69 6e 64  requiring an ind
14a0: 69 76 69 64 75 61 6c 20 74 61 62 6c 65 20 6c 61  ividual table la
14b0: 79 6f 75 74 2e 3c 62 72 3e 0d 0a 41 20 3c 62 3e  yout.<br>..A <b>
14c0: 50 72 69 6d 61 72 79 20 4b 65 79 3c 2f 62 3e 20  Primary Key</b> 
14d0: 6f 66 20 74 68 65 20 3c 62 3e 49 4e 54 45 47 45  of the <b>INTEGE
14e0: 52 3c 2f 62 3e 20 74 79 70 65 20 6e 61 6d 65 64  R</b> type named
14f0: 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 69 73 20 61   <b>fid</b> is a
1500: 6c 77 61 79 73 20 65 78 70 65 63 74 65 64 20 74  lways expected t
1510: 6f 20 64 65 63 6c 61 72 65 64 20 61 6e 64 20 69  o declared and i
1520: 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 62 65  s intended to be
1530: 20 61 6e 20 75 6e 69 71 75 65 20 69 64 65 6e 74   an unique ident
1540: 69 66 69 65 72 20 66 6f 72 20 65 61 63 68 20 54  ifier for each T
1550: 6f 70 6f 46 65 61 74 75 72 65 2e 3c 2f 6c 69 3e  opoFeature.</li>
1560: 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c  ..</ul></li>..<l
1570: 69 3e 53 65 76 65 72 61 6c 20 53 51 4c 20 66 75  i>Several SQL fu
1580: 6e 63 74 69 6f 6e 73 20 61 72 65 20 73 70 65 63  nctions are spec
1590: 69 66 69 63 61 6c 6c 79 20 69 6e 74 65 6e 64 65  ifically intende
15a0: 64 20 74 6f 20 73 75 70 70 6f 72 74 20 70 72 6f  d to support pro
15b0: 63 65 73 73 69 6e 67 20 6f 70 65 72 61 74 69 6f  cessing operatio
15c0: 6e 73 20 62 61 73 65 64 20 6f 6e 20 54 6f 70 6f  ns based on Topo
15d0: 4c 61 79 65 72 73 20 61 6e 64 20 54 6f 70 6f 46  Layers and TopoF
15e0: 65 61 74 75 72 65 73 3b 20 20 77 65 27 6c 6c 20  eatures;  we'll 
15f0: 65 78 61 6d 69 6e 65 20 74 68 65 6d 20 6c 61 74  examine them lat
1600: 65 72 20 69 6e 20 66 75 6c 6c 20 64 65 74 61 69  er in full detai
1610: 6c 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62  l.</li>..</ul><b
1620: 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68  r><br>..<hr>..<h
1630: 32 3e 61 20 71 75 69 63 6b 20 70 72 61 63 74 69  2>a quick practi
1640: 63 61 6c 20 65 78 65 72 63 69 73 65 3c 2f 68 32  cal exercise</h2
1650: 3e 0d 0a 50 72 65 72 65 71 75 69 73 69 74 65 73  >..Prerequisites
1660: 3a 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 64 6f 77  :..<ol>..<li>dow
1670: 6e 6c 6f 61 64 20 74 68 65 20 73 61 6d 70 6c 65  nload the sample
1680: 20 44 42 2d 66 69 6c 65 20 66 72 6f 6d 20 3c 61   DB-file from <a
1690: 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77   href="https://w
16a0: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67  ww.gaia-gis.it/g
16b0: 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 73 61 6d  aia-sins/toposam
16c0: 70 6c 65 73 2f 74 75 73 63 61 6e 79 2d 63 65 6e  ples/tuscany-cen
16d0: 73 75 73 2d 32 30 31 31 2e 37 7a 22 3e 68 65 72  sus-2011.7z">her
16e0: 65 3c 2f 61 3e 3c 62 72 3e 0d 0a 49 74 20 63 6f  e</a><br>..It co
16f0: 6e 74 61 69 6e 73 20 43 65 6e 73 75 73 20 64 61  ntains Census da
1700: 74 61 20 28 32 30 31 31 29 20 6b 69 6e 64 6c 79  ta (2011) kindly
1710: 20 72 65 6c 65 61 73 65 64 20 62 79 20 49 53 54   released by IST
1720: 41 54 20 75 6e 64 65 72 20 3c 62 3e 43 43 2d 42  AT under <b>CC-B
1730: 59 3c 2f 62 3e 20 6c 69 63 65 6e 73 65 20 74 65  Y</b> license te
1740: 72 6d 73 2e 3c 62 72 3e 0d 0a 54 68 65 20 6f 72  rms.<br>..The or
1750: 69 67 69 6e 61 6c 20 64 61 74 61 73 65 74 73 20  iginal datasets 
1760: 68 61 76 65 20 62 65 65 6e 20 73 6c 69 67 68 74  have been slight
1770: 6c 79 20 72 65 61 72 72 61 6e 67 65 64 20 69 6e  ly rearranged in
1780: 20 61 20 6d 6f 72 65 20 63 6f 6e 76 65 6e 69 65   a more convenie
1790: 6e 74 20 66 6f 72 6d 2e 0d 0a 41 6c 6c 20 67 65  nt form...All ge
17a0: 6f 6d 65 74 72 69 65 73 20 61 72 65 20 69 6e 20  ometries are in 
17b0: 74 68 65 20 3c 62 3e 53 52 49 44 20 33 32 36 33  the <b>SRID 3263
17c0: 32 3c 2f 62 3e 20 28 3c 69 3e 57 47 53 20 38 34  2</b> (<i>WGS 84
17d0: 20 2f 20 55 54 4d 20 7a 6f 6e 65 20 33 32 4e 3c   / UTM zone 32N<
17e0: 2f 69 3e 29 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69  /i>):..<ul>..<li
17f0: 3e 3c 62 3e 63 65 6e 73 75 73 5f 32 30 31 31 3c  ><b>census_2011<
1800: 2f 62 3e 3a 20 61 6c 6c 20 43 65 6e 73 75 73 20  /b>: all Census 
1810: 41 72 65 61 73 20 28 32 30 31 31 29 20 63 6f 76  Areas (2011) cov
1820: 65 72 69 6e 67 20 54 75 73 63 61 6e 79 2e 3c 62  ering Tuscany.<b
1830: 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3a 3c 2f 75 3e  r>..<u>Note:</u>
1840: 20 73 65 76 65 72 61 6c 20 43 65 6e 73 75 73 20   several Census 
1850: 41 72 65 61 73 20 61 72 65 20 63 6f 6d 70 6c 65  Areas are comple
1860: 74 65 6c 79 20 75 6e 69 6e 68 61 62 69 74 65 64  tely uninhabited
1870: 20 28 6c 61 6b 65 73 2c 20 6d 61 72 73 68 6c 61   (lakes, marshla
1880: 6e 64 73 2c 20 68 69 67 68 20 6d 6f 75 6e 74 61  nds, high mounta
1890: 69 6e 73 20 61 6e 64 20 61 6c 69 6b 65 29 2e 3c  ins and alike).<
18a0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 70 70 6c  /li>..<li><b>ppl
18b0: 5f 32 30 31 31 3c 2f 62 3e 3a 20 50 6f 70 75 6c  _2011</b>: Popul
18c0: 61 74 65 64 20 50 6c 61 63 65 73 20 28 64 65 66  ated Places (def
18d0: 69 6e 65 64 20 61 73 20 61 6e 20 61 67 67 72 65  ined as an aggre
18e0: 67 61 74 69 6f 6e 20 6f 66 20 43 65 6e 73 75 73  gation of Census
18f0: 20 41 72 65 61 73 29 2e 3c 62 72 3e 0d 0a 3c 75   Areas).<br>..<u
1900: 3e 4e 6f 74 65 3c 2f 75 3e 3a 20 6e 6f 74 20 61  >Note</u>: not a
1910: 6c 6c 20 43 65 6e 73 75 73 20 41 72 65 61 73 20  ll Census Areas 
1920: 62 65 6c 6f 6e 67 20 74 6f 20 61 20 50 6f 70 75  belong to a Popu
1930: 6c 61 74 65 64 20 50 6c 61 63 65 3a 20 74 68 65  lated Place: the
1940: 72 65 20 61 72 65 20 6d 61 6e 79 20 73 65 6c 66  re are many self
1950: 2d 73 74 61 6e 64 69 6e 67 20 64 69 73 70 65 72  -standing disper
1960: 73 65 64 20 72 75 72 61 6c 20 61 72 65 61 73 2e  sed rural areas.
1970: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 6f  </li>..<li><b>co
1980: 6d 5f 32 30 31 31 3c 2f 62 3e 3a 20 54 75 73 63  m_2011</b>: Tusc
1990: 61 6e 79 20 4d 75 6e 69 63 69 70 61 6c 69 74 69  any Municipaliti
19a0: 65 73 20 2f 20 4c 6f 63 61 6c 20 43 6f 75 6e 63  es / Local Counc
19b0: 69 6c 73 20 32 30 31 31 20 28 64 65 66 69 6e 65  ils 2011 (define
19c0: 64 20 61 73 20 61 6e 20 61 67 67 72 65 67 61 74  d as an aggregat
19d0: 69 6f 6e 73 20 6f 66 20 43 65 6e 73 75 73 20 41  ions of Census A
19e0: 72 65 61 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  reas).</li>..<li
19f0: 3e 3c 62 3e 63 6f 6d 5f 32 30 31 34 5f 31 35 3c  ><b>com_2014_15<
1a00: 2f 62 3e 3a 20 66 65 77 20 6e 65 77 20 4d 75 6e  /b>: few new Mun
1a10: 69 63 69 70 61 6c 69 74 69 65 73 20 63 72 65 61  icipalities crea
1a20: 74 65 64 20 64 75 72 69 6e 67 20 79 65 61 72 73  ted during years
1a30: 20 32 30 31 34 2f 31 35 20 62 79 20 6d 65 72 67   2014/15 by merg
1a40: 69 6e 67 20 70 72 65 2d 65 78 69 73 74 69 6e 67  ing pre-existing
1a50: 20 73 6d 61 6c 6c 65 72 20 4d 75 6e 69 63 69 70   smaller Municip
1a60: 61 6c 69 74 69 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c  alities.</li>..<
1a70: 6c 69 3e 3c 62 3e 70 72 6f 76 5f 32 30 31 31 3c  li><b>prov_2011<
1a80: 2f 62 3e 3a 20 54 75 73 63 61 6e 79 20 50 72 6f  /b>: Tuscany Pro
1a90: 76 69 6e 63 65 73 20 2f 20 43 6f 75 6e 74 69 65  vinces / Countie
1aa0: 73 20 28 64 65 66 69 6e 65 64 20 61 73 20 61 6e  s (defined as an
1ab0: 20 61 67 67 72 65 67 61 74 69 6f 6e 20 6f 66 20   aggregation of 
1ac0: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 29 2e  Municipalities).
1ad0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 72 65  </li>..<li><b>re
1ae0: 67 5f 32 30 31 31 3c 2f 62 3e 3a 20 54 75 73 63  g_2011</b>: Tusc
1af0: 61 6e 79 20 52 65 67 69 6f 6e 20 28 64 65 66 69  any Region (defi
1b00: 6e 65 64 20 61 73 20 61 6e 20 61 67 67 72 65 67  ned as an aggreg
1b10: 61 74 69 6f 6e 20 6f 66 20 50 72 6f 76 69 6e 63  ation of Provinc
1b20: 65 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6a  es).</li>..<li>j
1b30: 75 73 74 20 3c 62 3e 63 65 6e 73 75 73 5f 32 30  ust <b>census_20
1b40: 31 31 3c 2f 62 3e 20 61 6c 6f 6e 65 20 73 75 70  11</b> alone sup
1b50: 70 6f 72 74 73 20 67 65 6f 6d 65 74 72 69 65 73  ports geometries
1b60: 3b 20 61 6e 79 20 6f 74 68 65 72 20 61 64 6d 69  ; any other admi
1b70: 6e 69 73 74 72 61 74 69 76 65 20 6c 65 76 65 6c  nistrative level
1b80: 20 69 73 20 73 69 6d 70 6c 79 20 64 65 66 69 6e   is simply defin
1b90: 65 64 20 62 79 20 72 65 6c 61 74 69 6f 6e 61 6c  ed by relational
1ba0: 20 63 6f 64 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 2f   codes.</li>..</
1bb0: 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 75 6e  ul></li>..<li>un
1bc0: 63 6f 6d 70 72 65 73 73 20 74 68 65 20 64 6f 77  compress the dow
1bd0: 6e 6c 6f 61 64 65 64 20 64 62 2d 66 69 6c 65 20  nloaded db-file 
1be0: 28 3c 62 3e 3c 69 3e 74 75 73 63 61 6e 79 2d 63  (<b><i>tuscany-c
1bf0: 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 74  ensus-2011.sqlit
1c00: 65 3c 2f 69 3e 3c 2f 62 3e 29 2e 3c 2f 6c 69 3e  e</i></b>).</li>
1c10: 0d 0a 3c 6c 69 3e 6e 6f 77 20 79 6f 75 20 63 61  ..<li>now you ca
1c20: 6e 20 66 69 6e 61 6c 6c 79 20 73 74 61 72 74 20  n finally start 
1c30: 61 20 53 70 61 74 69 61 4c 69 74 65 20 73 65 73  a SpatiaLite ses
1c40: 73 69 6f 6e 20 75 73 69 6e 67 20 79 6f 75 72 20  sion using your 
1c50: 70 72 65 66 65 72 72 65 64 20 53 70 61 74 69 61  preferred Spatia
1c60: 4c 69 74 65 20 66 72 6f 6e 74 20 65 6e 64 20 74  Lite front end t
1c70: 6f 6f 6c 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e  ool:..<ul>..<li>
1c80: 3c 75 3e 41 74 74 65 6e 74 69 6f 6e 3c 2f 75 3e  <u>Attention</u>
1c90: 3a 20 79 6f 75 20 6d 75 73 74 20 6e 6f 74 20 64  : you must not d
1ca0: 69 72 65 63 74 6c 79 20 63 6f 6e 6e 65 63 74 20  irectly connect 
1cb0: 74 6f 20 3c 62 3e 3c 69 3e 74 75 73 63 61 6e 79  to <b><i>tuscany
1cc0: 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c  -census-2011.sql
1cd0: 69 74 65 3c 2f 69 3e 3c 2f 62 3e 3b 20 79 6f 75  ite</i></b>; you
1ce0: 20 61 72 65 20 65 78 70 65 63 74 65 64 20 69 6e   are expected in
1cf0: 73 74 65 61 64 20 74 6f 20 63 6f 6e 6e 65 63 74  stead to connect
1d00: 20 61 20 6e 65 77 20 28 65 6d 70 74 79 29 20 44   a new (empty) D
1d10: 42 2d 66 69 6c 65 20 6e 61 6d 65 64 20 3c 62 3e  B-file named <b>
1d20: 74 75 73 63 61 6e 79 2d 74 6f 70 6f 2d 32 30 31  tuscany-topo-201
1d30: 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 3c 2f 6c 69  1.sqlite</b></li
1d40: 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c  >..</ul></li>..<
1d50: 2f 6f 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  /ol>..<verbatim>
1d60: 0d 0a 53 45 4c 45 43 54 20 43 72 65 61 74 65 54  ..SELECT CreateT
1d70: 6f 70 6f 6c 6f 67 79 28 27 63 65 6e 73 75 73 32  opology('census2
1d80: 30 31 31 27 2c 20 33 32 36 33 32 2c 20 30 2c 20  011', 32632, 0, 
1d90: 30 29 3b 0d 0a 31 0d 0a 0d 0a 41 54 54 41 43 48  0);..1....ATTACH
1da0: 20 44 41 54 41 42 41 53 45 20 22 2e 2f 74 75 73   DATABASE "./tus
1db0: 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 31  cany-census-2011
1dc0: 2e 73 71 6c 69 74 65 22 20 41 53 20 69 73 74 61  .sqlite" AS ista
1dd0: 74 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70  t;....SELECT Top
1de0: 6f 47 65 6f 5f 46 72 6f 6d 47 65 6f 54 61 62 6c  oGeo_FromGeoTabl
1df0: 65 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20  e('census2011', 
1e00: 27 69 73 74 61 74 27 2c 20 27 63 65 6e 73 75 73  'istat', 'census
1e10: 5f 32 30 31 31 27 2c 20 4e 55 4c 4c 2c 20 30 2c  _2011', NULL, 0,
1e20: 20 35 31 32 2c 20 2d 31 29 3b 0d 0a 31 0d 0a 0d   512, -1);..1...
1e30: 0a 53 45 4c 45 43 54 20 53 54 5f 56 61 6c 69 64  .SELECT ST_Valid
1e40: 61 74 65 54 6f 70 6f 47 65 6f 28 27 63 65 6e 73  ateTopoGeo('cens
1e50: 75 73 32 30 31 31 27 29 3b 0d 0a 4e 55 4c 4c 0d  us2011');..NULL.
1e60: 0a 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d  ...SELECT * FROM
1e70: 20 54 45 4d 50 2e 63 65 6e 73 75 73 32 30 31 31   TEMP.census2011
1e80: 5f 76 61 6c 69 64 61 74 65 5f 74 6f 70 6f 67 65  _validate_topoge
1e90: 6f 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70  o;....SELECT Top
1ea0: 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f 4c  oGeo_CreateTopoL
1eb0: 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31  ayer('census2011
1ec0: 27 2c 20 27 69 73 74 61 74 27 2c 20 27 63 65 6e  ', 'istat', 'cen
1ed0: 73 75 73 5f 32 30 31 31 27 2c 20 4e 55 4c 4c 2c  sus_2011', NULL,
1ee0: 20 27 63 65 6e 73 75 73 5f 61 72 65 61 73 27 29   'census_areas')
1ef0: 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 54  ;..1....SELECT T
1f00: 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c  opoGeo_InitTopoL
1f10: 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31  ayer('census2011
1f20: 27 2c 20 27 69 73 74 61 74 27 2c 20 27 70 6f 70  ', 'istat', 'pop
1f30: 5f 70 70 6c 5f 32 30 31 31 27 2c 20 27 70 70 6c  _ppl_2011', 'ppl
1f40: 27 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54  ');..1....SELECT
1f50: 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70   TopoGeo_InitTop
1f60: 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30  oLayer('census20
1f70: 31 31 27 2c 20 27 69 73 74 61 74 27 2c 20 27 70  11', 'istat', 'p
1f80: 6f 70 5f 63 6f 6d 5f 32 30 31 31 27 2c 20 27 63  op_com_2011', 'c
1f90: 6f 6d 27 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45  om');..1....SELE
1fa0: 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54  CT TopoGeo_InitT
1fb0: 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73  opoLayer('census
1fc0: 32 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c 20  2011', 'istat', 
1fd0: 27 70 6f 70 5f 70 72 6f 76 5f 32 30 31 31 27 2c  'pop_prov_2011',
1fe0: 20 27 70 72 6f 76 27 29 3b 0d 0a 31 0d 0a 0d 0a   'prov');..1....
1ff0: 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 49  SELECT TopoGeo_I
2000: 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65  nitTopoLayer('ce
2010: 6e 73 75 73 32 30 31 31 27 2c 20 27 69 73 74 61  nsus2011', 'ista
2020: 74 27 2c 20 27 70 6f 70 5f 72 65 67 5f 32 30 31  t', 'pop_reg_201
2030: 31 27 2c 20 27 72 65 67 27 29 3b 0d 0a 31 0d 0a  1', 'reg');..1..
2040: 0d 0a 44 45 54 41 43 48 20 44 41 54 41 42 41 53  ..DETACH DATABAS
2050: 45 20 69 73 74 61 74 3b 0d 0a 3c 2f 76 65 72 62  E istat;..</verb
2060: 61 74 69 6d 3e 0d 0a 57 65 27 6c 6c 20 73 74 61  atim>..We'll sta
2070: 72 74 20 74 68 69 73 20 70 72 61 63 74 69 63 61  rt this practica
2080: 6c 20 74 75 74 6f 72 69 61 6c 20 62 79 20 64 75  l tutorial by du
2090: 6c 79 20 72 65 70 6c 69 63 61 74 69 6e 67 20 74  ly replicating t
20a0: 68 65 20 73 61 6d 65 20 73 74 65 70 73 20 77 65  he same steps we
20b0: 27 76 65 20 61 6c 72 65 61 64 79 20 65 78 61 6d  've already exam
20c0: 69 6e 65 64 20 69 6e 20 74 68 65 20 69 6e 74 65  ined in the inte
20d0: 72 6d 65 64 69 61 74 65 20 74 75 74 6f 72 69 61  rmediate tutoria
20e0: 6c 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 77 65  l:..<ul>..<li>we
20f0: 27 6c 6c 20 63 72 65 61 74 65 20 61 20 6e 65 77  'll create a new
2100: 20 32 44 20 54 6f 70 6f 6c 6f 67 79 20 6e 61 6d   2D Topology nam
2110: 65 64 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31  ed <b>census2011
2120: 3c 2f 62 3e 20 61 6e 64 20 6c 6f 63 61 74 65 64  </b> and located
2130: 20 69 6e 74 6f 20 3c 62 3e 53 52 49 44 20 33 32   into <b>SRID 32
2140: 36 33 32 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c  632</b>.</li>..<
2150: 6c 69 3e 74 68 65 6e 20 77 65 27 6c 6c 20 3c 69  li>then we'll <i
2160: 3e 61 74 74 61 63 68 3c 2f 69 3e 20 74 68 65 20  >attach</i> the 
2170: 3c 62 3e 74 75 73 63 61 6e 79 2d 74 6f 70 6f 2d  <b>tuscany-topo-
2180: 32 30 31 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 20  2011.sqlite</b> 
2190: 65 78 74 65 72 6e 61 6c 20 44 42 2d 66 69 6c 65  external DB-file
21a0: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6e 6f 77 20  .</li>..<li>now 
21b0: 77 65 27 6c 6c 20 70 6f 70 75 6c 61 74 65 20 74  we'll populate t
21c0: 68 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31  he <b>census2011
21d0: 3c 2f 62 3e 20 54 6f 70 6f 6c 6f 67 79 20 62 79  </b> Topology by
21e0: 20 69 6d 70 6f 72 74 69 6e 67 20 74 68 65 20 3c   importing the <
21f0: 62 3e 69 73 74 61 74 2e 63 65 6e 73 75 73 5f 32  b>istat.census_2
2200: 30 31 31 3c 2f 62 3e 20 47 65 6f 54 61 62 6c 65  011</b> GeoTable
2210: 2c 20 61 6e 64 20 74 68 65 6e 20 77 65 27 6c 6c  , and then we'll
2220: 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 63 68 65   immediately che
2230: 63 6b 20 69 66 20 74 68 69 73 20 54 6f 70 6f 6c  ck if this Topol
2240: 6f 67 79 20 69 73 20 66 75 6c 6c 79 20 76 61 6c  ogy is fully val
2250: 69 64 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c  id.</li>..</ul><
2260: 62 72 3e 0d 0a 4e 6f 77 20 77 65 20 61 72 65 20  br>..Now we are 
2270: 66 69 6e 61 6c 6c 79 20 72 65 61 64 79 20 74 6f  finally ready to
2280: 20 73 74 61 72 74 20 64 65 66 69 6e 69 6e 67 20   start defining 
2290: 61 6c 6c 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72  all <b>TopoLayer
22a0: 73 3c 2f 62 3e 20 62 61 73 65 64 20 6f 6e 20 74  s</b> based on t
22b0: 68 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31  he <b>census2011
22c0: 3c 2f 62 3e 20 54 6f 70 6f 6c 6f 67 79 3b 20 65  </b> Topology; e
22d0: 61 63 68 20 73 69 6e 67 6c 65 20 54 6f 70 6f 4c  ach single TopoL
22e0: 61 79 65 72 20 77 69 6c 6c 20 70 72 65 63 69 73  ayer will precis
22f0: 65 6c 79 20 72 65 70 72 65 73 65 6e 74 20 73 6f  ely represent so
2300: 6d 65 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76  me administrativ
2310: 65 20 6c 65 76 65 6c 2c 20 61 6e 64 20 61 6c 6c  e level, and all
2320: 20 54 6f 70 6f 4c 61 79 65 72 73 20 61 6c 74 6f   TopoLayers alto
2330: 67 65 74 68 65 72 20 77 69 6c 6c 20 63 6f 6d 70  gether will comp
2340: 6c 65 74 65 6c 79 20 72 65 70 72 65 73 65 6e 74  letely represent
2350: 20 74 68 65 20 77 68 6f 6c 65 20 54 75 73 63 61   the whole Tusca
2360: 6e 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65  n administrative
2370: 20 68 69 65 72 61 72 63 68 79 2e 0d 0a 3c 6f 6c   hierarchy...<ol
2380: 3e 0d 0a 3c 6c 69 3e 73 6f 20 77 65 27 6c 6c 20  >..<li>so we'll 
2390: 64 75 6c 79 20 69 6e 76 6f 6b 65 20 3c 62 3e 54  duly invoke <b>T
23a0: 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f 70  opoGeo_CreateTop
23b0: 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 69 6e 20  oLayer()</b> in 
23c0: 6f 72 64 65 72 20 74 6f 20 63 6f 6d 70 6c 65 74  order to complet
23d0: 65 6c 79 20 64 65 66 69 6e 65 20 61 20 66 69 72  ely define a fir
23e0: 73 74 20 54 6f 70 6f 4c 61 79 65 72 20 72 65 70  st TopoLayer rep
23f0: 72 65 73 65 6e 74 69 6e 67 20 3c 62 3e 43 65 6e  resenting <b>Cen
2400: 73 75 73 20 41 72 65 61 73 3c 2f 62 3e 2e 3c 62  sus Areas</b>.<b
2410: 72 3e 0d 0a 3c 75 3e 52 65 63 61 6c 6c 3c 2f 75  r>..<u>Recall</u
2420: 3e 3a 20 74 68 65 20 3c 62 3e 69 73 74 61 74 2e  >: the <b>istat.
2430: 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20  census_2011</b> 
2440: 69 73 20 74 68 65 20 75 6e 69 71 75 65 20 72 65  is the unique re
2450: 61 6c 20 47 65 6f 54 61 62 6c 65 20 77 65 20 68  al GeoTable we h
2460: 61 76 65 20 69 6e 20 6f 75 72 20 69 6e 69 74 69  ave in our initi
2470: 61 6c 20 64 61 74 61 73 65 74 2c 20 62 65 63 61  al dataset, beca
2480: 75 73 65 20 69 74 20 63 6f 6e 74 61 69 6e 73 20  use it contains 
2490: 62 6f 74 68 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  both information
24a0: 20 61 74 74 72 69 62 75 74 65 73 20 61 6e 64 20   attributes and 
24b0: 67 65 6f 6d 65 74 72 69 65 73 3b 20 61 6e 64 20  geometries; and 
24c0: 65 61 63 68 20 43 65 6e 73 75 73 20 41 72 65 61  each Census Area
24d0: 20 69 73 20 65 78 70 65 63 74 65 64 20 74 6f 20   is expected to 
24e0: 64 69 72 65 63 74 6c 79 20 63 6f 72 72 65 73 70  directly corresp
24f0: 6f 6e 64 20 74 6f 20 61 20 73 69 6e 67 6c 65 20  ond to a single 
2500: 54 6f 70 6f 6c 6f 67 79 20 46 61 63 65 2e 20 28  Topology Face. (
2510: 3c 69 3e 77 65 27 6c 6c 20 65 78 61 6d 69 6e 65  <i>we'll examine
2520: 20 6c 61 74 65 72 20 69 6e 20 6d 6f 72 65 20 64   later in more d
2530: 65 70 74 68 20 68 6f 77 20 54 6f 70 6f 4c 61 79  epth how TopoLay
2540: 65 72 20 2f 20 54 6f 70 6f 46 65 61 74 75 72 65  er / TopoFeature
2550: 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 20 68   relationships h
2560: 61 76 65 20 62 65 65 6e 20 61 63 74 75 61 6c 6c  ave been actuall
2570: 79 20 64 65 66 69 6e 65 64 3c 2f 69 3e 29 2e 3c  y defined</i>).<
2580: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 6e 20 77  /li>..<li>then w
2590: 65 27 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 62 79  e'll continue by
25a0: 20 64 65 66 69 6e 69 6e 67 20 73 65 76 65 72 61   defining severa
25b0: 6c 20 66 75 72 74 68 65 72 20 54 6f 70 6f 4c 61  l further TopoLa
25c0: 79 65 72 73 20 72 65 73 70 65 63 74 69 76 65 6c  yers respectivel
25d0: 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20  y corresponding 
25e0: 74 6f 20 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20  to <b>Populated 
25f0: 50 6c 61 63 65 73 3c 2f 62 3e 2c 20 3c 62 3e 4d  Places</b>, <b>M
2600: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62  unicipalities</b
2610: 3e 2c 20 3c 62 3e 50 72 6f 76 69 6e 63 65 73 3c  >, <b>Provinces<
2620: 2f 62 3e 20 61 6e 64 20 3c 62 3e 52 65 67 69 6f  /b> and <b>Regio
2630: 6e 3c 2f 62 3e 20 61 64 6d 69 6e 69 73 74 72 61  n</b> administra
2640: 74 69 76 65 20 6c 65 76 65 6c 73 2e 3c 62 72 3e  tive levels.<br>
2650: 0d 0a 3c 75 3e 52 65 63 61 6c 6c 3c 2f 75 3e 3a  ..<u>Recall</u>:
2660: 20 61 6c 6c 20 74 68 65 73 65 20 61 64 6d 69 6e   all these admin
2670: 69 73 74 72 61 74 69 76 65 20 6c 65 76 65 6c 73  istrative levels
2680: 20 69 6e 20 74 68 65 20 69 6e 69 74 69 61 6c 20   in the initial 
2690: 64 61 74 61 73 65 74 20 61 72 65 20 73 69 6d 70  dataset are simp
26a0: 6c 79 20 64 65 66 69 6e 65 64 20 62 79 20 72 65  ly defined by re
26b0: 6c 61 74 69 6f 6e 61 6c 20 63 6f 64 65 73 20 69  lational codes i
26c0: 6e 74 65 6e 64 65 64 20 74 6f 20 61 67 67 72 65  ntended to aggre
26d0: 67 61 74 65 20 6c 6f 77 65 72 20 6c 65 76 65 6c  gate lower level
26e0: 20 65 6e 74 69 74 69 65 73 3b 20 69 6e 20 74 68   entities; in th
26f0: 69 73 20 63 61 73 65 20 74 68 65 72 65 20 61 72  is case there ar
2700: 65 20 6e 6f 20 65 78 70 6c 69 63 69 74 20 67 65  e no explicit ge
2710: 6f 6d 65 74 72 69 65 73 20 61 74 20 61 6c 6c 2e  ometries at all.
2720: 20 53 6f 20 61 72 65 20 61 72 65 20 6e 6f 74 20   So are are not 
2730: 64 69 72 65 63 74 6c 79 20 61 6c 6c 6f 77 65 64  directly allowed
2740: 20 74 6f 20 63 72 65 61 74 65 20 61 20 66 75 6c   to create a ful
2750: 6c 79 20 64 65 66 69 6e 65 64 20 54 6f 70 6f 4c  ly defined TopoL
2760: 61 79 65 72 2c 20 61 6e 64 20 63 61 6c 6c 69 6e  ayer, and callin
2770: 67 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 72 65  g <b>TopoGeo_Cre
2780: 61 74 65 54 6f 70 6f 6c 61 79 65 72 28 29 3c 2f  ateTopolayer()</
2790: 62 3e 20 69 73 20 6a 75 73 74 20 69 6d 70 6f 73  b> is just impos
27a0: 73 69 62 6c 65 20 62 65 63 61 75 73 65 20 77 65  sible because we
27b0: 20 6c 61 63 6b 20 61 6e 79 20 61 70 70 72 6f 70   lack any approp
27c0: 72 69 61 74 65 20 47 65 6f 6d 65 74 72 79 20 63  riate Geometry c
27d0: 6f 6c 75 6d 6e 2e 3c 62 72 3e 0d 0a 41 6e 79 77  olumn.<br>..Anyw
27e0: 61 79 20 77 65 20 63 61 6e 20 69 6e 76 6f 6b 65  ay we can invoke
27f0: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 74   <b>TopoGeo_Init
2800: 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 3b  TopoLayer()</b>;
2810: 20 74 68 69 73 20 77 69 6c 6c 20 69 6e 69 74 69   this will initi
2820: 61 6c 69 7a 65 20 61 6e 20 6f 6e 6c 79 20 70 61  alize an only pa
2830: 72 74 69 61 6c 6c 79 20 64 65 66 69 6e 65 64 20  rtially defined 
2840: 54 6f 70 6f 4c 61 79 65 72 2c 20 62 75 74 20 77  TopoLayer, but w
2850: 65 20 63 61 6e 20 65 61 73 69 6c 79 20 63 6f 6d  e can easily com
2860: 70 6c 65 74 65 20 69 6e 20 61 20 73 65 63 6f 6e  plete in a secon
2870: 64 20 74 69 6d 65 20 61 6e 79 20 6d 69 73 73 69  d time any missi
2880: 6e 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 73  ng information s
2890: 6f 20 74 6f 20 67 65 74 20 61 20 70 72 6f 70 65  o to get a prope
28a0: 72 6c 79 20 77 6f 72 6b 69 6e 67 20 54 6f 70 6f  rly working Topo
28b0: 4c 61 79 65 72 20 28 3c 69 3e 61 73 20 77 65 27  Layer (<i>as we'
28c0: 6c 6c 20 73 65 65 20 6c 61 74 65 72 20 69 6e 20  ll see later in 
28d0: 66 75 6c 6c 20 64 65 74 61 69 6c 29 2e 3c 2f 6c  full detail).</l
28e0: 69 3e 0d 0a 3c 6c 69 3e 66 69 6e 61 6c 6c 79 20  i>..<li>finally 
28f0: 77 65 27 6c 6c 20 3c 69 3e 64 65 74 61 63 68 3c  we'll <i>detach<
2900: 2f 69 3e 20 74 68 65 20 6e 6f 77 20 75 73 65 6c  /i> the now usel
2910: 65 73 73 20 65 78 74 65 72 6e 61 6c 20 64 62 2d  ess external db-
2920: 66 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c  file.</li>..</ol
2930: 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 3e 54 6f 70  >..<hr>..<h3>Top
2940: 6f 4c 61 79 65 72 73 20 2f 20 54 6f 70 6f 46 65  oLayers / TopoFe
2950: 61 74 75 72 65 73 3a 20 6c 61 79 6f 75 74 20 6f  atures: layout o
2960: 66 20 44 42 20 54 61 62 6c 65 73 20 61 6e 64 20  f DB Tables and 
2970: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 72 65  corresponding re
2980: 6c 61 74 69 6f 6e 73 68 69 70 73 3c 2f 68 33 3e  lationships</h3>
2990: 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 70 61 64  ..<table cellpad
29a0: 64 69 6e 67 3d 22 36 22 20 63 65 6c 6c 73 70 61  ding="6" cellspa
29b0: 63 69 6e 67 3d 22 38 22 3e 0d 0a 3c 74 72 3e 3c  cing="8">..<tr><
29c0: 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 6f  td>..<b><<i>topo
29d0: 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70  -prefix</i>>_top
29e0: 6f 6c 61 79 65 72 73 3c 2f 62 3e 0d 0a 3c 76 65  olayers</b>..<ve
29f0: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
2a00: 2a 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31  * FROM census201
2a10: 31 5f 74 6f 70 6f 6c 61 79 65 72 73 3b 0d 0a 3c  1_topolayers;..<
2a20: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 20  /verbatim>..The 
2a30: 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62  <b>TopoLayers</b
2a40: 3e 20 74 61 62 6c 65 20 63 6f 6e 74 61 69 6e 73  > table contains
2a50: 20 61 20 64 69 73 74 69 6e 63 74 20 72 6f 77 20   a distinct row 
2a60: 66 6f 72 20 65 76 65 72 79 20 54 6f 70 6f 4c 61  for every TopoLa
2a70: 79 65 72 20 64 65 66 69 6e 65 64 20 6f 6e 20 74  yer defined on t
2a80: 68 65 20 63 75 72 72 65 6e 74 20 54 6f 70 6f 6c  he current Topol
2a90: 6f 67 79 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 45 61  ogy.<br><br>..Ea
2aa0: 63 68 20 54 6f 70 6f 4c 61 79 65 72 20 69 73 20  ch TopoLayer is 
2ab0: 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 61 6e  identified by an
2ac0: 20 3c 62 3e 69 64 3c 2f 62 3e 20 61 6e 64 20 62   <b>id</b> and b
2ad0: 79 20 61 20 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3b  y a <b>name</b>;
2ae0: 20 62 6f 74 68 20 61 72 65 20 72 65 71 75 69 72   both are requir
2af0: 65 64 20 74 6f 20 62 65 20 75 6e 69 71 75 65 20  ed to be unique 
2b00: 76 61 6c 75 65 73 2e 0d 0a 3c 2f 74 64 3e 3c 74  values...</td><t
2b10: 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30  d>.."<i>census20
2b20: 31 31 5f 74 6f 70 6f 6c 61 79 65 72 73 3c 2f 69  11_topolayers</i
2b30: 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73  >"..<table cells
2b40: 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 64  pan="4" cellpadd
2b50: 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d  ing="6" bgcolor=
2b60: 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 72  "#f8f8f0" border
2b70: 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62  ="1">..<tr><td b
2b80: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22  gcolor="#f0f0f8"
2b90: 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64  ><b>topolayer_id
2ba0: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62  </b></td>..<td b
2bb0: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22  gcolor="#f0f0f8"
2bc0: 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 6e 61  ><b>topolayer_na
2bd0: 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e  me</b></td></tr>
2be0: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d  ..<tr><td align=
2bf0: 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74  "right">1</td><t
2c00: 64 3e 63 65 6e 73 75 73 5f 61 72 65 61 73 3c 2f  d>census_areas</
2c10: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74  td></tr>..<tr><t
2c20: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
2c30: 32 3c 2f 74 64 3e 3c 74 64 3e 70 70 6c 3c 2f 74  2</td><td>ppl</t
2c40: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
2c50: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33   align="right">3
2c60: 3c 2f 74 64 3e 3c 74 64 3e 63 6f 6d 3c 2f 74 64  </td><td>com</td
2c70: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
2c80: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 3c  align="right">4<
2c90: 2f 74 64 3e 3c 74 64 3e 70 72 6f 76 3c 2f 74 64  /td><td>prov</td
2ca0: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20  ></tr>..<tr><td 
2cb0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 3c  align="right">5<
2cc0: 2f 74 64 3e 3c 74 64 3e 72 65 67 3c 2f 74 64 3e  /td><td>reg</td>
2cd0: 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d  </tr>..</table>.
2ce0: 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  .</td></tr>..<tr
2cf0: 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f  ><td>..<b><<i>to
2d00: 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74  po-prefix</i>>_t
2d10: 6f 70 6f 66 65 61 74 75 72 65 73 5f 3c 3c 69 3e  opofeatures_<<i>
2d20: 74 6f 70 6f 6c 61 79 65 72 2d 69 64 3c 2f 69 3e  topolayer-id</i>
2d30: 3e 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d  ></b>..<verbatim
2d40: 3e 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d  >..SELECT * FROM
2d50: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f   census2011_topo
2d60: 66 65 61 74 75 72 65 73 5f 32 3b 0d 0a 0d 0a 53  features_2;....S
2d70: 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 63 65 6e  ELECT * FROM cen
2d80: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
2d90: 75 72 65 73 5f 34 3b 0d 0a 3c 2f 76 65 72 62 61  ures_4;..</verba
2da0: 74 69 6d 3e 0d 0a 54 68 65 20 73 61 6d 65 20 54  tim>..The same T
2db0: 6f 70 6f 6c 6f 67 79 20 63 61 6e 20 63 6f 6e 74  opology can cont
2dc0: 61 69 6e 20 6d 6f 72 65 20 74 68 61 6e 20 61 20  ain more than a 
2dd0: 73 69 6e 67 6c 65 20 3c 62 3e 54 6f 70 6f 46 65  single <b>TopoFe
2de0: 61 74 75 72 65 73 3c 2f 62 3e 20 74 61 62 6c 65  atures</b> table
2df0: 2c 20 61 6e 64 20 65 61 63 68 20 54 6f 70 6f 46  , and each TopoF
2e00: 65 61 74 75 72 65 73 20 74 61 62 6c 65 20 63 6f  eatures table co
2e10: 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 20 73  rresponds to a s
2e20: 69 6e 67 6c 65 20 54 6f 70 6f 4c 61 79 65 72 2e  ingle TopoLayer.
2e30: 3c 62 72 3e 0d 0a 45 76 65 72 79 20 74 61 62 6c  <br>..Every tabl
2e40: 65 20 63 61 6e 20 68 61 76 65 20 61 20 73 70 65  e can have a spe
2e50: 63 69 66 69 63 20 6c 61 79 6f 75 74 20 6f 6e 20  cific layout on 
2e60: 69 74 73 20 6f 77 6e 20 28 73 74 72 69 63 74 6c  its own (strictl
2e70: 79 20 72 65 66 6c 65 63 74 69 6e 67 20 74 68 65  y reflecting the
2e80: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74   information att
2e90: 72 69 62 75 74 65 73 20 66 6f 72 20 65 61 63 68  ributes for each
2ea0: 20 6c 61 79 65 72 29 2c 20 61 6e 79 77 61 79 20   layer), anyway 
2eb0: 61 6c 6c 20 74 68 65 6d 20 77 69 6c 6c 20 68 61  all them will ha
2ec0: 76 65 20 61 20 3c 62 3e 75 6e 69 71 75 65 20 54  ve a <b>unique T
2ed0: 6f 70 6f 46 65 61 74 75 72 65 20 69 64 65 6e 74  opoFeature ident
2ee0: 69 66 69 65 72 3c 2f 62 3e 20 28 3c 62 3e 3c 69  ifier</b> (<b><i
2ef0: 3e 66 69 64 3c 2f 69 3e 3c 2f 62 3e 29 20 61 63  >fid</i></b>) ac
2f00: 74 69 6e 67 20 69 6e 20 74 68 65 20 50 72 69 6d  ting in the Prim
2f10: 61 72 79 20 4b 65 79 20 72 6f 6c 65 2e 3c 62 72  ary Key role.<br
2f20: 3e 0d 0a 54 68 65 20 72 65 6c 61 74 69 6f 6e 73  >..The relations
2f30: 68 69 70 20 62 65 74 77 65 65 6e 20 74 61 62 6c  hip between tabl
2f40: 65 20 6e 61 6d 65 73 20 61 6e 64 20 54 6f 70 6f  e names and Topo
2f50: 4c 61 79 65 72 73 20 69 73 20 65 73 74 61 62 6c  Layers is establ
2f60: 69 73 68 65 64 20 62 79 20 61 70 70 65 6e 64 69  ished by appendi
2f70: 6e 67 20 61 20 6e 75 6d 65 72 69 63 20 73 75 66  ng a numeric suf
2f80: 66 69 78 20 74 6f 20 74 68 65 20 63 6f 6d 6d 6f  fix to the commo
2f90: 6e 20 6e 61 6d 65 20 74 68 61 74 20 6d 75 73 74  n name that must
2fa0: 20 65 78 61 63 74 6c 79 20 6d 61 74 63 68 20 74   exactly match t
2fb0: 68 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f  he <b>topolayer_
2fc0: 69 64 3c 2f 62 3e 20 76 61 6c 75 65 20 64 65 63  id</b> value dec
2fd0: 6c 61 72 65 64 20 69 6e 20 74 68 65 20 3c 62 3e  lared in the <b>
2fe0: 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 6d  TopoLayers</b> m
2ff0: 61 69 6e 20 74 61 62 6c 65 2e 3c 62 72 3e 3c 62  ain table.<br><b
3000: 72 3e 0d 0a 41 73 20 69 73 20 73 68 6f 77 6e 20  r>..As is shown 
3010: 69 6e 20 74 68 69 73 20 65 78 61 6d 70 6c 65 20  in this example 
3020: 74 68 65 20 66 69 72 73 74 20 74 61 62 6c 65 20  the first table 
3030: 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  <b>census2011_to
3040: 70 6f 66 65 61 74 75 72 65 73 5f 32 3c 2f 62 3e  pofeatures_2</b>
3050: 20 28 3c 69 3e 74 6f 70 6f 6c 61 79 65 72 5f 69   (<i>topolayer_i
3060: 64 3c 2f 69 3e 3d 3c 69 3e 32 3c 2f 69 3e 29 20  d</i>=<i>2</i>) 
3070: 63 6f 6e 74 61 69 6e 73 20 61 6c 6c 20 54 6f 70  contains all Top
3080: 6f 46 65 61 74 75 72 65 73 20 61 73 73 6f 63 69  oFeatures associ
3090: 61 74 65 64 20 74 6f 20 74 68 65 20 54 6f 70 6f  ated to the Topo
30a0: 4c 61 79 65 72 20 3c 62 3e 70 70 6c 3c 2f 62 3e  Layer <b>ppl</b>
30b0: 20 28 3c 69 3e 50 6f 70 75 6c 61 74 65 64 20 50   (<i>Populated P
30c0: 6c 61 63 65 73 3c 2f 69 3e 29 2e 3c 62 72 3e 3c  laces</i>).<br><
30d0: 62 72 3e 0d 0a 54 68 65 20 73 65 63 6f 6e 64 20  br>..The second 
30e0: 74 61 62 6c 65 20 3c 62 3e 63 65 6e 73 75 73 32  table <b>census2
30f0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
3100: 5f 34 3c 2f 62 3e 20 28 3c 69 3e 74 6f 70 6f 6c  _4</b> (<i>topol
3110: 61 79 65 72 5f 69 64 3c 2f 69 3e 3d 3c 69 3e 34  ayer_id</i>=<i>4
3120: 3c 2f 69 3e 29 20 63 6f 6e 74 61 69 6e 73 20 61  </i>) contains a
3130: 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20  ll TopoFeatures 
3140: 61 73 73 6f 63 69 61 74 65 64 20 74 6f 20 74 68  associated to th
3150: 65 20 54 6f 70 6f 4c 61 79 65 72 20 3c 62 3e 70  e TopoLayer <b>p
3160: 72 6f 76 3c 2f 62 3e 20 28 3c 69 3e 50 72 6f 76  rov</b> (<i>Prov
3170: 69 6e 63 65 73 3c 2f 69 3e 29 2e 0d 0a 3c 2f 74  inces</i>)...</t
3180: 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73  d><td>.."<i>cens
3190: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75  us2011_topofeatu
31a0: 72 65 73 5f 32 3c 2f 69 3e 22 0d 0a 3c 74 61 62  res_2</i>"..<tab
31b0: 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20  le cellspan="4" 
31c0: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20  cellpadding="6" 
31d0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30  bgcolor="#f8f8f0
31e0: 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c  " border="1">..<
31f0: 74 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22  tr><td bgcolor="
3200: 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 69 64 3c  #f0f0f8"><b>fid<
3210: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
3220: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
3230: 3c 62 3e 63 6f 64 5f 70 70 6c 3c 2f 62 3e 3c 2f  <b>cod_ppl</b></
3240: 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72  td>..<td bgcolor
3250: 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f  ="#f0f0f8"><b>co
3260: 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a  d_com</b></td>..
3270: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
3280: 66 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62  f0f8"><b>name</b
3290: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f  ></td>..<td bgco
32a0: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62  lor="#f0f0f8"><b
32b0: 3e 70 6f 70 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74  >pop_2011</b></t
32c0: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  d>..<td bgcolor=
32d0: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6d 5f 32  "#f0f0f8"><b>m_2
32e0: 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74  011</b></td>..<t
32f0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30  d bgcolor="#f0f0
3300: 66 38 22 3e 3c 62 3e 66 5f 32 30 31 31 3c 2f 62  f8"><b>f_2011</b
3310: 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  ></td></tr>..<tr
3320: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3330: 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  t">1</td><td ali
3340: 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 35 31 34  gn="right">20514
3350: 32 37 30 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  2705</td><td ali
3360: 67 6e 3d 22 72 69 67 68 74 22 3e 34 35 30 30 31  gn="right">45001
3370: 3c 2f 74 64 3e 3c 74 64 3e 41 6c 62 69 61 6e 6f  </td><td>Albiano
3380: 20 4d 61 67 72 61 3c 2f 74 64 3e 3c 74 64 20 61   Magra</td><td a
3390: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 39 30  lign="right">190
33a0: 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  7</td><td align=
33b0: 22 72 69 67 68 74 22 3e 39 31 39 3c 2f 74 64 3e  "right">919</td>
33c0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
33d0: 22 3e 39 38 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  ">988</td></tr>.
33e0: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
33f0: 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64  right">2</td><td
3400: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
3410: 30 35 31 34 32 37 30 36 3c 2f 74 64 3e 3c 74 64  05142706</td><td
3420: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34   align="right">4
3430: 35 30 30 31 3c 2f 74 64 3e 3c 74 64 3e 41 75 6c  5001</td><td>Aul
3440: 6c 61 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  la</td><td align
3450: 3d 22 72 69 67 68 74 22 3e 34 33 32 31 3c 2f 74  ="right">4321</t
3460: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
3470: 68 74 22 3e 32 30 34 36 3c 2f 74 64 3e 3c 74 64  ht">2046</td><td
3480: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
3490: 32 37 35 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  275</td></tr>..<
34a0: 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  tr><td align="ri
34b0: 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 20 61  ght">3</td><td a
34c0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 35  lign="right">205
34d0: 31 34 32 37 31 30 3c 2f 74 64 3e 3c 74 64 20 61  142710</td><td a
34e0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 35 30  lign="right">450
34f0: 30 31 3c 2f 74 64 3e 3c 74 64 3e 43 61 70 72 69  01</td><td>Capri
3500: 67 6c 69 6f 6c 61 3c 2f 74 64 3e 3c 74 64 20 61  gliola</td><td a
3510: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 32  lign="right">482
3520: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3530: 72 69 67 68 74 22 3e 32 32 36 3c 2f 74 64 3e 3c  right">226</td><
3540: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3550: 3e 32 35 36 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a  >256</td></tr>..
3560: 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d  <tr><td colspan=
3570: 22 37 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65  "7" align="cente
3580: 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72  r"><hr></td></tr
3590: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e  >..<tr><td align
35a0: 3d 22 72 69 67 68 74 22 3e 31 30 31 38 3c 2f 74  ="right">1018</t
35b0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
35c0: 68 74 22 3e 31 34 31 30 37 37 35 34 31 35 3c 2f  ht">1410775415</
35d0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
35e0: 67 68 74 22 3e 31 30 30 30 30 37 3c 2f 74 64 3e  ght">100007</td>
35f0: 3c 74 64 3e 53 61 73 73 65 74 61 3c 2f 74 64 3e  <td>Sasseta</td>
3600: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
3610: 22 3e 32 38 35 3c 2f 74 64 3e 3c 74 64 20 61 6c  ">285</td><td al
3620: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 33 37 3c  ign="right">137<
3630: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3640: 69 67 68 74 22 3e 31 34 38 3c 2f 74 64 3e 3c 2f  ight">148</td></
3650: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69  tr>..<tr><td ali
3660: 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 31 39 3c  gn="right">1019<
3670: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3680: 69 67 68 74 22 3e 31 34 31 30 37 38 35 34 31 35  ight">1410785415
3690: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
36a0: 72 69 67 68 74 22 3e 31 30 30 30 30 37 3c 2f 74  right">100007</t
36b0: 64 3e 3c 74 64 3e 54 65 72 72 69 67 6f 6c 69 3c  d><td>Terrigoli<
36c0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
36d0: 69 67 68 74 22 3e 35 33 37 3c 2f 74 64 3e 3c 74  ight">537</td><t
36e0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
36f0: 32 36 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  264</td><td alig
3700: 6e 3d 22 72 69 67 68 74 22 3e 32 37 33 3c 2f 74  n="right">273</t
3710: 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65  d></tr>..</table
3720: 3e 0d 0a 3c 62 72 3e 0d 0a 22 3c 69 3e 63 65 6e  >..<br>.."<i>cen
3730: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
3740: 75 72 65 73 5f 34 3c 2f 69 3e 22 0d 0a 3c 74 61  ures_4</i>"..<ta
3750: 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22  ble cellspan="4"
3760: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22   cellpadding="6"
3770: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66   bgcolor="#f8f8f
3780: 30 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a  0" border="1">..
3790: 3c 74 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  <tr><td bgcolor=
37a0: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 69 64  "#f0f0f8"><b>fid
37b0: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62  </b></td>..<td b
37c0: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22  gcolor="#f0f0f8"
37d0: 3e 3c 62 3e 63 6f 64 5f 70 72 6f 76 3c 2f 62 3e  ><b>cod_prov</b>
37e0: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c  </td>..<td bgcol
37f0: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e  or="#f0f0f8"><b>
3800: 63 6f 64 5f 72 65 67 3c 2f 62 3e 3c 2f 74 64 3e  cod_reg</b></td>
3810: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  ..<td bgcolor="#
3820: 66 30 66 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c  f0f0f8"><b>name<
3830: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
3840: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
3850: 3c 62 3e 61 62 62 72 65 76 3c 2f 62 3e 3c 2f 74  <b>abbrev</b></t
3860: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  d>..<td bgcolor=
3870: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 70 6f 70  "#f0f0f8"><b>pop
3880: 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a  _2011</b></td>..
3890: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
38a0: 66 30 66 38 22 3e 3c 62 3e 6d 5f 32 30 31 31 3c  f0f8"><b>m_2011<
38b0: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67  /b></td>..<td bg
38c0: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e  color="#f0f0f8">
38d0: 3c 62 3e 66 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74  <b>f_2011</b></t
38e0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
38f0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31   align="right">1
3900: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3910: 72 69 67 68 74 22 3e 34 35 3c 2f 74 64 3e 3c 74  right">45</td><t
3920: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3930: 39 3c 2f 74 64 3e 3c 74 64 3e 4d 61 73 73 61 26  9</td><td>Massa&
3940: 6e 62 73 70 3b 43 61 72 72 61 72 61 3c 2f 74 64  nbsp;Carrara</td
3950: 3e 3c 74 64 3e 4d 53 3c 2f 74 64 3e 3c 74 64 20  ><td>MS</td><td 
3960: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 39  align="right">19
3970: 39 36 35 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  9650</td><td ali
3980: 67 6e 3d 22 72 69 67 68 74 22 3e 39 35 37 35 34  gn="right">95754
3990: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
39a0: 72 69 67 68 74 22 3e 31 30 33 38 39 36 3c 2f 74  right">103896</t
39b0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
39c0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
39d0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
39e0: 72 69 67 68 74 22 3e 34 36 3c 2f 74 64 3e 3c 74  right">46</td><t
39f0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
3a00: 39 3c 2f 74 64 3e 3c 74 64 3e 4c 75 63 63 61 3c  9</td><td>Lucca<
3a10: 2f 74 64 3e 3c 74 64 3e 4c 55 3c 2f 74 64 3e 3c  /td><td>LU</td><
3a20: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3a30: 3e 33 38 38 33 32 37 3c 2f 74 64 3e 3c 74 64 20  >388327</td><td 
3a40: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 38  align="right">18
3a50: 36 31 38 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  6183</td><td ali
3a60: 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 32 31 34  gn="right">20214
3a70: 34 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  4</td></tr>..<tr
3a80: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3a90: 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  t">3</td><td ali
3aa0: 67 6e 3d 22 72 69 67 68 74 22 3e 34 37 3c 2f 74  gn="right">47</t
3ab0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
3ac0: 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 50 69  ht">9</td><td>Pi
3ad0: 73 74 6f 69 61 3c 2f 74 64 3e 3c 74 64 3e 50 54  stoia</td><td>PT
3ae0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3af0: 72 69 67 68 74 22 3e 32 38 37 38 36 36 3c 2f 74  right">287866</t
3b00: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
3b10: 68 74 22 3e 31 33 38 30 35 34 3c 2f 74 64 3e 3c  ht">138054</td><
3b20: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3b30: 3e 31 34 39 38 31 32 3c 2f 74 64 3e 3c 2f 74 72  >149812</td></tr
3b40: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70  >..<tr><td colsp
3b50: 61 6e 3d 22 38 22 20 61 6c 69 67 6e 3d 22 63 65  an="8" align="ce
3b60: 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c  nter"><hr></td><
3b70: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c  /tr>..<tr><td al
3b80: 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74  ign="right">9</t
3b90: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
3ba0: 68 74 22 3e 35 33 3c 2f 74 64 3e 3c 74 64 20 61  ht">53</td><td a
3bb0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f  lign="right">9</
3bc0: 74 64 3e 3c 74 64 3e 47 72 6f 73 73 65 74 6f 3c  td><td>Grosseto<
3bd0: 2f 74 64 3e 3c 74 64 3e 47 52 3c 2f 74 64 3e 3c  /td><td>GR</td><
3be0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3bf0: 3e 32 32 30 35 36 34 3c 2f 74 64 3e 3c 74 64 20  >220564</td><td 
3c00: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30  align="right">10
3c10: 35 35 38 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69  5585</td><td ali
3c20: 67 6e 3d 22 72 69 67 68 74 22 3e 31 31 34 39 37  gn="right">11497
3c30: 39 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  9</td></tr>..<tr
3c40: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  ><td align="righ
3c50: 74 22 3e 31 30 3c 2f 74 64 3e 3c 74 64 20 61 6c  t">10</td><td al
3c60: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 30 3c  ign="right">100<
3c70: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72  /td><td align="r
3c80: 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e  ight">9</td><td>
3c90: 50 72 61 74 6f 3c 2f 74 64 3e 3c 74 64 3e 50 4f  Prato</td><td>PO
3ca0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
3cb0: 72 69 67 68 74 22 3e 32 34 35 39 31 36 3c 2f 74  right">245916</t
3cc0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
3cd0: 68 74 22 3e 31 31 39 30 38 38 3c 2f 74 64 3e 3c  ht">119088</td><
3ce0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
3cf0: 3e 31 32 36 38 32 38 3c 2f 74 64 3e 3c 2f 74 72  >126828</td></tr
3d00: 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74  >..</table>..</t
3d10: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
3d20: 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70  >..<b><<i>topo-p
3d30: 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 66  refix</i>>_topof
3d40: 65 61 74 75 72 65 73 3c 2f 62 3e 0d 0a 3c 76 65  eatures</b>..<ve
3d50: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
3d60: 2a 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31  * FROM census201
3d70: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 3b 0d  1_topofeatures;.
3d80: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68  .</verbatim>..Th
3d90: 65 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65  e <b>TopoFeature
3da0: 73 2d 67 65 6f 6d 65 74 72 69 65 73 3c 2f 62 3e  s-geometries</b>
3db0: 20 74 61 62 6c 65 20 69 73 20 69 6e 74 65 6e 64   table is intend
3dc0: 65 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74 6c  ed to permanentl
3dd0: 79 20 73 74 6f 72 65 20 61 6c 6c 20 72 65 6c 61  y store all rela
3de0: 74 69 6f 6e 73 20 62 65 74 77 65 65 6e 20 54 6f  tions between To
3df0: 70 6f 46 65 61 74 75 72 65 73 20 61 6e 64 20 54  poFeatures and T
3e00: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76  opology primitiv
3e10: 65 73 20 72 65 71 75 69 72 65 64 20 69 6e 20 6f  es required in o
3e20: 72 64 65 72 20 74 6f 20 63 6f 72 72 65 63 74 6c  rder to correctl
3e30: 79 20 62 75 69 6c 64 20 74 68 65 20 65 78 70 65  y build the expe
3e40: 63 74 65 64 20 6f 75 74 70 75 74 20 47 65 6f 6d  cted output Geom
3e50: 65 74 72 79 20 66 6f 72 20 65 61 63 68 20 54 6f  etry for each To
3e60: 70 6f 46 65 61 74 75 72 65 2e 0d 0a 3c 75 6c 3e  poFeature...<ul>
3e70: 0d 0a 3c 6c 69 3e 3c 62 3e 75 69 64 3c 2f 62 3e  ..<li><b>uid</b>
3e80: 20 69 73 20 74 68 65 20 50 72 69 6d 61 72 79 20   is the Primary 
3e90: 4b 65 79 2c 20 61 6e 64 20 69 73 20 73 69 6d 70  Key, and is simp
3ea0: 6c 79 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 62  ly intended to b
3eb0: 65 20 61 6e 20 75 6e 69 71 75 65 20 69 64 65 6e  e an unique iden
3ec0: 74 69 66 69 65 72 20 66 6f 72 20 65 61 63 68 20  tifier for each 
3ed0: 72 6f 77 20 62 75 74 20 64 6f 65 73 6e 27 74 20  row but doesn't 
3ee0: 69 6e 74 65 6e 64 20 74 6f 20 68 61 76 65 20 61  intend to have a
3ef0: 6e 79 20 73 70 65 63 69 61 6c 20 6d 65 61 6e 69  ny special meani
3f00: 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62  ng.</li>..<li><b
3f10: 3e 6e 6f 64 65 5f 69 64 3c 2f 62 3e 2c 20 3c 62  >node_id</b>, <b
3f20: 3e 65 64 67 65 5f 69 64 3c 2f 62 3e 20 61 6e 64  >edge_id</b> and
3f30: 20 3c 62 3e 66 61 63 65 5f 69 64 3c 2f 62 3e 20   <b>face_id</b> 
3f40: 61 72 65 20 46 6f 72 65 69 67 6e 20 4b 65 79 73  are Foreign Keys
3f50: 20 64 69 72 65 63 74 6c 79 20 72 65 66 65 72 65   directly refere
3f60: 6e 63 69 6e 67 20 61 20 54 6f 70 6f 6c 6f 67 79  ncing a Topology
3f70: 20 70 72 69 6d 69 74 69 76 65 3b 20 74 77 6f 20   primitive; two 
3f80: 6f 66 20 74 68 65 73 65 20 76 61 6c 75 65 73 20  of these values 
3f90: 61 72 65 20 61 6c 77 61 79 73 20 65 78 70 65 63  are always expec
3fa0: 74 65 64 20 74 6f 20 62 65 20 4e 55 4c 4c 2c 20  ted to be NULL, 
3fb0: 61 6e 64 20 6f 6e 6c 79 20 6f 6e 65 20 69 73 20  and only one is 
3fc0: 65 78 70 65 63 74 65 64 20 74 6f 20 65 66 66 65  expected to effe
3fd0: 63 74 69 76 65 6c 79 20 72 65 66 65 72 65 6e 63  ctively referenc
3fe0: 65 20 61 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69  e a Topology pri
3ff0: 6d 69 74 69 76 65 20 64 65 70 65 6e 64 69 6e 67  mitive depending
4000: 20 6f 6e 20 69 74 73 20 74 79 70 65 2e 3c 2f 6c   on its type.</l
4010: 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 74 6f 70 6f 6c  i>..<li><b>topol
4020: 61 79 65 72 5f 69 64 3c 2f 62 3e 20 61 6e 64 20  ayer_id</b> and 
4030: 3c 62 3e 66 69 64 3c 2f 62 3e 20 74 6f 67 65 74  <b>fid</b> toget
4040: 68 65 72 20 61 72 65 20 69 6e 74 65 6e 64 65 64  her are intended
4050: 20 74 6f 20 65 73 74 61 62 6c 69 73 68 20 61 20   to establish a 
4060: 72 65 6c 61 74 69 6f 6e 61 6c 20 72 65 66 65 72  relational refer
4070: 65 6e 63 65 20 74 6f 20 73 6f 6d 65 20 73 70 65  ence to some spe
4080: 63 69 66 69 63 20 54 6f 70 6f 46 65 61 74 75 72  cific TopoFeatur
4090: 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a  e.</li>..</ul>..
40a0: 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70 6c 65  <br>..<u>Example
40b0: 20 23 31 3c 2f 75 3e 3a 20 61 6c 6c 20 54 6f 70   #1</u>: all Top
40c0: 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73  ology primitives
40d0: 20 64 69 72 65 63 74 6c 79 20 72 65 66 65 72 65   directly refere
40e0: 6e 63 65 64 20 62 79 20 72 6f 77 73 20 64 65 63  nced by rows dec
40f0: 6c 61 72 69 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61  laring <b>topola
4100: 79 65 72 5f 69 64 3d 32 3c 2f 62 3e 20 61 6e 64  yer_id=2</b> and
4110: 20 3c 62 3e 66 69 64 3d 33 3c 2f 62 3e 20 6d 75   <b>fid=3</b> mu
4120: 73 74 20 62 65 20 61 67 67 72 65 67 61 74 65 64  st be aggregated
4130: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 62 75 69   in order to bui
4140: 6c 64 20 74 68 65 20 6f 75 74 70 75 74 20 47 65  ld the output Ge
4150: 6f 6d 65 74 72 79 20 63 6f 72 72 65 73 70 6f 6e  ometry correspon
4160: 64 69 6e 67 20 74 6f 20 74 68 65 20 50 6f 70 75  ding to the Popu
4170: 6c 61 74 65 64 20 50 6c 61 63 65 20 6f 66 20 3c  lated Place of <
4180: 62 3e 43 61 70 72 69 67 6c 69 6f 6c 61 3c 2f 62  b>Caprigliola</b
4190: 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70  >.<br>..<u>Examp
41a0: 6c 65 20 23 32 3c 2f 75 3e 3a 20 61 6c 6c 20 70  le #2</u>: all p
41b0: 72 69 6d 69 74 69 76 65 73 20 72 65 66 65 72 65  rimitives refere
41c0: 6e 63 65 64 20 62 79 20 72 6f 77 73 20 64 65 63  nced by rows dec
41d0: 6c 61 72 69 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61  laring <b>topola
41e0: 79 65 72 5f 69 64 3d 34 3c 2f 62 3e 20 61 6e 64  yer_id=4</b> and
41f0: 20 3c 62 3e 66 69 64 3d 39 3c 2f 62 3e 20 6d 75   <b>fid=9</b> mu
4200: 73 74 20 62 65 20 61 67 67 72 65 67 61 74 65 64  st be aggregated
4210: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 62 75 69   in order to bui
4220: 6c 64 20 74 68 65 20 6f 75 74 70 75 74 20 47 65  ld the output Ge
4230: 6f 6d 65 74 72 79 20 63 6f 72 72 65 73 70 6f 6e  ometry correspon
4240: 64 69 6e 67 20 74 6f 20 74 68 65 20 50 72 6f 76  ding to the Prov
4250: 69 6e 63 65 20 6f 66 20 3c 62 3e 47 72 6f 73 73  ince of <b>Gross
4260: 65 74 6f 3c 2f 62 3e 2e 0d 0a 3c 2f 74 64 3e 3c  eto</b>...</td><
4270: 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75 73 32  td>.."<i>census2
4280: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
4290: 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 65  </i>"..<table ce
42a0: 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70  llspan="4" cellp
42b0: 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c  adding="6" bgcol
42c0: 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72  or="#f8f8f0" bor
42d0: 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74  der="1">..<tr><t
42e0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30  d bgcolor="#f0f0
42f0: 66 38 22 3e 3c 62 3e 75 69 64 3c 2f 62 3e 3c 2f  f8"><b>uid</b></
4300: 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72  td>..<td bgcolor
4310: 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e 6f  ="#f0f0f8"><b>no
4320: 64 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a  de_id</b></td>..
4330: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
4340: 66 30 66 38 22 3e 3c 62 3e 65 64 67 65 5f 69 64  f0f8"><b>edge_id
4350: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62  </b></td>..<td b
4360: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22  gcolor="#f0f0f8"
4370: 3e 3c 62 3e 66 61 63 65 5f 69 64 3c 2f 62 3e 3c  ><b>face_id</b><
4380: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
4390: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 74  r="#f0f0f8"><b>t
43a0: 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 3e 3c  opolayer_id</b><
43b0: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
43c0: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 66  r="#f0f0f8"><b>f
43d0: 69 64 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e  id</b></td></tr>
43e0: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d  ..<tr><td align=
43f0: 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74  "right">1</td><t
4400: 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e  d>NULL</td><td>N
4410: 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  ULL</td><td alig
4420: 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e  n="right">1</td>
4430: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
4440: 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  ">1</td><td alig
4450: 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e  n="right">1</td>
4460: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61  </tr>..<tr><td a
4470: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f  lign="right">2</
4480: 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e  td><td>NULL</td>
4490: 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64  <td>NULL</td><td
44a0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
44b0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  </td><td align="
44c0: 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64  right">1</td><td
44d0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32   align="right">2
44e0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
44f0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
4500: 22 3e 33 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c  ">3</td><td>NULL
4510: 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74  </td><td>NULL</t
4520: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
4530: 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 20 61 6c  ht">3</td><td al
4540: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74  ign="right">1</t
4550: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
4560: 68 74 22 3e 33 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  ht">3</td></tr>.
4570: 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e  .<tr><td colspan
4580: 3d 22 36 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74  ="6" align="cent
4590: 65 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74  er"><hr></td></t
45a0: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67  r>..<tr><td alig
45b0: 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 37 30 3c  n="right">28870<
45c0: 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64  /td><td>NULL</td
45d0: 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74  ><td>NULL</td><t
45e0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  d align="right">
45f0: 32 38 38 36 34 3c 2f 74 64 3e 3c 74 64 20 61 6c  28864</td><td al
4600: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74  ign="right">1</t
4610: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
4620: 68 74 22 3e 32 38 38 36 37 3c 2f 74 64 3e 3c 2f  ht">28867</td></
4630: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69  tr>..<tr><td ali
4640: 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 37 31  gn="right">28871
4650: 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74  </td><td>NULL</t
4660: 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c  d><td>NULL</td><
4670: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
4680: 3e 32 38 38 36 38 3c 2f 74 64 3e 3c 74 64 20 61  >28868</td><td a
4690: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f  lign="right">1</
46a0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
46b0: 67 68 74 22 3e 32 38 38 36 38 3c 2f 74 64 3e 3c  ght">28868</td><
46c0: 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a  /tr>..</table>..
46d0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61  </td></tr>..</ta
46e0: 62 6c 65 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c  ble>..<table cel
46f0: 6c 70 61 64 64 69 6e 67 3d 22 38 22 20 62 67 63  lpadding="8" bgc
4700: 6f 6c 6f 72 3d 22 23 64 30 66 66 62 30 22 3e 0d  olor="#d0ffb0">.
4710: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 46  .<tr><td>..<h3>F
4720: 69 6e 61 6c 20 72 65 6d 61 72 6b 73 3c 2f 68 33  inal remarks</h3
4730: 3e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 62 6f 74  >..<ol>..<li>bot
4740: 68 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 72 65  h <b>TopoGeo_Cre
4750: 61 74 65 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f  ateTopoLayer()</
4760: 62 3e 20 61 6e 64 20 3c 62 3e 54 6f 70 6f 47 65  b> and <b>TopoGe
4770: 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28  o_InitTopoLayer(
4780: 29 3c 2f 62 3e 20 77 69 6c 6c 20 72 65 67 69 73  )</b> will regis
4790: 74 65 72 20 74 68 65 20 54 6f 70 6f 4c 61 79 65  ter the TopoLaye
47a0: 72 20 69 6e 74 6f 20 74 68 65 20 3c 62 3e 54 6f  r into the <b>To
47b0: 70 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 74 61 62  poLayers</b> tab
47c0: 6c 65 2c 20 61 6e 64 20 77 69 6c 6c 20 63 72 65  le, and will cre
47d0: 61 74 65 20 61 6e 64 20 70 6f 70 75 6c 61 74 65  ate and populate
47e0: 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69   the correspondi
47f0: 6e 67 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72  ng <b>TopoFeatur
4800: 65 73 3c 2f 62 3e 20 74 61 62 6c 65 20 62 79 20  es</b> table by 
4810: 69 6d 70 6f 72 74 69 6e 67 20 61 6c 6c 20 69 6e  importing all in
4820: 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 69 62  formation attrib
4830: 75 74 65 73 20 66 6f 72 20 65 61 63 68 20 46 65  utes for each Fe
4840: 61 74 75 72 65 20 64 65 66 69 6e 65 64 20 62 79  ature defined by
4850: 20 74 68 65 20 72 65 66 65 72 65 6e 63 65 20 74   the reference t
4860: 61 62 6c 65 20 28 6f 72 20 72 65 66 65 72 65 6e  able (or referen
4870: 63 65 20 76 69 65 77 29 2e 3c 2f 6c 69 3e 0d 0a  ce view).</li>..
4880: 3c 6c 69 3e 6f 6e 6c 79 20 3c 62 3e 54 6f 70 6f  <li>only <b>Topo
4890: 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f 4c 61  Geo_CreateTopoLa
48a0: 79 65 72 28 29 3c 2f 62 3e 20 77 69 6c 6c 20 61  yer()</b> will a
48b0: 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 70 6f 70  utomatically pop
48c0: 75 6c 61 74 65 20 74 68 65 20 3c 62 3e 54 6f 70  ulate the <b>Top
48d0: 6f 46 65 61 74 75 72 65 73 2d 67 65 6f 6d 65 74  oFeatures-geomet
48e0: 72 79 3c 2f 62 3e 20 74 61 62 6c 65 2c 20 61 6e  ry</b> table, an
48f0: 64 20 77 68 69 6c 65 20 64 6f 69 6e 67 20 73 6f  d while doing so
4900: 2c 20 69 64 65 6e 74 69 66 79 20 61 6c 6c 20 72  , identify all r
4910: 65 6c 61 74 69 6f 6e 73 68 69 70 73 20 65 78 69  elationships exi
4920: 73 74 69 6e 67 20 62 65 74 77 65 65 6e 20 74 68  sting between th
4930: 65 20 47 65 6f 6d 65 74 72 69 65 73 20 66 6f 75  e Geometries fou
4940: 6e 64 20 69 6e 74 6f 20 74 68 65 20 72 65 66 65  nd into the refe
4950: 72 65 6e 63 65 20 74 61 62 6c 65 20 6f 72 20 76  rence table or v
4960: 69 65 77 20 61 6e 64 20 74 68 65 20 54 6f 70 6f  iew and the Topo
4970: 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20  logy primitives 
4980: 62 61 73 65 64 20 6f 6e 20 74 68 65 20 76 61 6c  based on the val
4990: 75 65 73 20 6f 66 20 74 68 65 20 3c 62 3e 54 6f  ues of the <b>To
49a0: 70 6f 53 65 65 64 73 3c 2f 62 3e 2e 3c 2f 6c 69  poSeeds</b>.</li
49b0: 3e 0d 0a 3c 6c 69 3e 61 73 20 61 70 70 6f 73 65  >..<li>as appose
49c0: 64 20 74 6f 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f  d to <b>TopoGeo_
49d0: 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c  InitTopoLayer()<
49e0: 2f 62 3e 2c 20 77 68 69 63 68 20 77 69 6c 6c 20  /b>, which will 
49f0: 6e 65 76 65 72 20 61 74 74 65 6d 70 74 20 74 6f  never attempt to
4a00: 20 69 64 65 6e 74 69 66 79 20 74 68 65 20 72 65   identify the re
4a10: 6c 61 74 69 6f 6e 73 68 69 70 73 20 69 6e 74 65  lationships inte
4a20: 72 63 75 72 72 69 6e 67 20 62 65 74 77 65 65 6e  rcurring between
4a30: 20 6f 75 74 70 75 74 20 47 65 6f 6d 65 74 72 69   output Geometri
4a40: 65 73 20 61 6e 64 20 54 6f 70 6f 6c 6f 67 79 20  es and Topology 
4a50: 70 72 69 6d 69 74 69 76 65 73 2e 20 54 68 69 73  primitives. This
4a60: 20 74 61 73 6b 20 77 69 6c 6c 20 61 6c 77 61 79   task will alway
4a70: 73 20 62 65 20 64 65 66 65 72 72 65 64 20 66 6f  s be deferred fo
4a80: 72 20 74 68 65 20 75 73 65 72 20 74 6f 20 64 65  r the user to de
4a90: 61 6c 20 77 69 74 68 20 6c 61 74 65 72 2e 3c 62  al with later.<b
4aa0: 72 3e 0d 0a 59 6f 75 20 63 6f 75 6c 64 2c 20 66  r>..You could, f
4ab0: 6f 72 20 65 78 61 6d 70 6c 65 2c 20 6d 61 6e 75  or example, manu
4ac0: 61 6c 6c 79 20 73 65 6c 65 63 74 20 61 6c 6c 20  ally select all 
4ad0: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69  Topology primiti
4ae0: 76 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  ves correspondin
4af0: 67 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 54 6f  g to a single To
4b00: 70 6f 46 65 61 74 75 72 65 3b 20 6f 72 20 6d 6f  poFeature; or mo
4b10: 72 65 20 70 72 6f 62 61 62 6c 79 20 79 6f 75 20  re probably you 
4b20: 63 6f 75 6c 64 20 70 65 72 66 6f 72 6d 20 74 68  could perform th
4b30: 69 73 20 74 61 73 6b 20 69 6e 20 61 20 73 65 63  is task in a sec
4b40: 6f 6e 64 20 72 6f 75 6e 64 20 62 79 20 65 78 65  ond round by exe
4b50: 63 75 74 69 6e 67 20 73 6f 6d 65 20 61 70 70 72  cuting some appr
4b60: 6f 70 72 69 61 74 65 20 53 51 4c 20 73 74 61 74  opriate SQL stat
4b70: 65 6d 65 6e 74 20 28 3c 69 3e 61 73 20 77 65 27  ement (<i>as we'
4b80: 6c 6c 20 73 65 65 6e 20 73 6f 6f 6e 20 69 6e 20  ll seen soon in 
4b90: 74 68 65 20 6e 65 78 74 20 65 78 61 6d 70 6c 65  the next example
4ba0: 3c 2f 69 3e 29 2e 20 0d 0a 3c 2f 6f 6c 3e 0d 0a  </i>). ..</ol>..
4bb0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61  </td></tr>..</ta
4bc0: 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a  ble><br>..<hr>..
4bd0: 3c 68 33 3e 54 6f 70 6f 47 65 6f 5f 45 78 70 6f  <h3>TopoGeo_Expo
4be0: 72 74 54 6f 70 6f 4c 61 79 65 72 3a 20 65 78 70  rtTopoLayer: exp
4bf0: 6f 72 74 69 6e 67 20 61 20 66 75 6c 6c 20 54 6f  orting a full To
4c00: 70 6f 4c 61 79 65 72 20 69 6e 74 6f 20 61 20 47  poLayer into a G
4c10: 65 6f 54 61 62 6c 65 3c 2f 68 33 3e 0d 0a 3c 74  eoTable</h3>..<t
4c20: 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25  able width="100%
4c30: 22 20 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20  "  cellspan="4" 
4c40: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20  cellpadding="6" 
4c50: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30  bgcolor="#f8f8f0
4c60: 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c  " border="1">..<
4c70: 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22  tr><td colspan="
4c80: 32 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72  2" align="center
4c90: 22 3e 3c 62 3e 65 78 70 6f 72 74 69 6e 67 20 74  "><b>exporting t
4ca0: 68 65 20 43 65 6e 73 75 73 20 41 72 65 61 73 20  he Census Areas 
4cb0: 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 3c 2f 74  TopoLayer</b></t
4cc0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
4cd0: 3e 0d 0a 57 65 27 6c 6c 20 73 74 61 72 74 20 62  >..We'll start b
4ce0: 79 20 65 78 70 6f 72 74 69 6e 67 20 66 69 72 73  y exporting firs
4cf0: 74 20 74 68 65 20 6f 6e 6c 79 20 63 6f 6d 70 6c  t the only compl
4d00: 65 74 65 6c 79 20 64 65 66 69 6e 65 64 20 54 6f  etely defined To
4d10: 70 6f 4c 61 79 65 72 20 77 65 20 68 61 76 65 20  poLayer we have 
4d20: 61 74 20 74 68 69 73 20 70 6f 69 6e 74 20 69 6e  at this point in
4d30: 20 74 68 65 20 74 65 73 74 20 44 42 2d 66 69 6c   the test DB-fil
4d40: 65 2c 20 69 2e 65 2e 20 3c 62 3e 63 65 6e 73 75  e, i.e. <b>censu
4d50: 73 5f 61 72 65 61 73 3c 2f 62 3e 0d 0a 3c 76 65  s_areas</b>..<ve
4d60: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
4d70: 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f  TopoGeo_ExportTo
4d80: 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32  poLayer('census2
4d90: 30 31 31 27 2c 20 27 63 65 6e 73 75 73 5f 61 72  011', 'census_ar
4da0: 65 61 73 27 2c 20 27 6f 75 74 5f 63 65 6e 73 75  eas', 'out_censu
4db0: 73 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f  s_2011', 1);..</
4dc0: 76 65 72 62 61 74 69 6d 3e 0d 0a 41 73 20 79 6f  verbatim>..As yo
4dd0: 75 20 63 61 6e 20 65 61 73 69 6c 79 20 63 68 65  u can easily che
4de0: 63 6b 20 62 79 20 79 6f 75 72 73 65 6c 66 20 61  ck by yourself a
4df0: 20 6e 65 77 20 47 65 6f 54 61 62 6c 65 20 6e 61   new GeoTable na
4e00: 6d 65 64 20 3c 62 3e 6f 75 74 5f 63 65 6e 73 75  med <b>out_censu
4e10: 73 5f 32 30 31 31 3c 2f 62 3e 20 68 61 73 20 62  s_2011</b> has b
4e20: 65 65 6e 20 63 72 65 61 74 65 64 20 62 79 20 3c  een created by <
4e30: 62 3e 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74  b>TopoGeo_Export
4e40: 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 3a  TopoLayer()</b>:
4e50: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 69 73  ..<ul>..<li>this
4e60: 20 47 65 6f 54 61 62 6c 65 20 63 6f 6e 74 61 69   GeoTable contai
4e70: 6e 73 20 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75  ns all TopoFeatu
4e80: 72 65 73 20 64 65 66 69 6e 65 64 20 69 6e 74 6f  res defined into
4e90: 20 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 2e 3c   the TopoLayer.<
4ea0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 65 61 63 68 20 54  /li>..<li>each T
4eb0: 6f 70 6f 46 65 61 74 75 72 65 20 66 61 69 74 68  opoFeature faith
4ec0: 66 75 6c 6c 79 20 70 72 65 73 65 72 76 65 73 20  fully preserves 
4ed0: 69 74 73 20 69 6e 69 74 69 61 6c 20 69 6e 66 6f  its initial info
4ee0: 72 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74  rmation attribut
4ef0: 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6c  es.</li>..<li>al
4f00: 6c 20 47 65 6f 6d 65 74 72 69 65 73 20 61 72 65  l Geometries are
4f10: 20 70 72 65 63 69 73 65 6c 79 20 62 75 69 6c 74   precisely built
4f20: 20 62 79 20 61 67 67 72 65 67 61 74 69 6e 67 20   by aggregating 
4f30: 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  the correspondin
4f40: 67 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69  g Topology primi
4f50: 74 69 76 65 73 20 61 73 20 73 70 65 63 69 66 69  tives as specifi
4f60: 65 64 20 62 79 20 54 6f 70 6f 4c 61 79 65 72 20  ed by TopoLayer 
4f70: 2f 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 72  / TopoFeatures r
4f80: 65 6c 61 74 69 6f 6e 73 68 69 70 73 2e 3c 2f 6c  elationships.</l
4f90: 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 3c 62 72  i>..</ul><br><br
4fa0: 3e 0d 0a 54 68 65 20 69 6d 61 67 65 20 65 78 61  >..The image exa
4fb0: 6d 70 6c 69 66 69 65 73 20 61 20 63 68 6f 72 6f  mplifies a choro
4fc0: 70 6c 65 74 68 20 63 65 6e 74 65 72 65 64 20 61  pleth centered a
4fd0: 72 6f 75 6e 64 20 74 68 65 20 49 73 6c 61 6e 64  round the Island
4fe0: 20 6f 66 20 45 6c 62 61 20 61 6e 64 20 62 61 73   of Elba and bas
4ff0: 65 64 20 6f 6e 20 74 68 65 20 3c 62 3e 6f 75 74  ed on the <b>out
5000: 5f 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e  _census_2011</b>
5010: 20 47 65 6f 54 61 62 6c 65 3a 20 61 6c 6c 20 43   GeoTable: all C
5020: 65 6e 73 75 73 20 41 72 65 61 73 20 61 72 65 20  ensus Areas are 
5030: 64 69 73 70 6c 61 79 65 64 20 62 79 20 61 64 6f  displayed by ado
5040: 70 74 69 6e 67 20 61 20 63 6f 6c 6f 75 72 20 64  pting a colour d
5050: 69 72 65 63 74 6c 79 20 63 6f 72 72 65 73 70 6f  irectly correspo
5060: 6e 64 69 6e 67 20 74 6f 20 74 68 65 69 72 20 70  nding to their p
5070: 6f 70 75 6c 61 74 69 6f 6e 20 64 65 6e 73 69 74  opulation densit
5080: 79 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c  y...</td><td>..<
5090: 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f  img src="https:/
50a0: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74  /www.gaia-gis.it
50b0: 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66  /gaia-sins/topof
50c0: 69 67 73 2f 65 6c 62 61 2d 63 68 6f 72 6f 70 6c  igs/elba-choropl
50d0: 65 74 68 2e 70 6e 67 22 20 61 6c 74 3d 22 65 6c  eth.png" alt="el
50e0: 62 61 2d 63 68 6f 72 6f 70 6c 65 74 68 22 3e 0d  ba-choropleth">.
50f0: 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74  .</td></tr>..</t
5100: 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d  able><br>..<hr>.
5110: 0a 3c 68 33 3e 42 75 69 6c 64 69 6e 67 20 61 20  .<h3>Building a 
5120: 66 75 6c 6c 20 68 69 65 72 61 72 63 68 79 20 6f  full hierarchy o
5130: 66 20 41 64 6d 69 6e 69 73 74 72 61 74 69 76 65  f Administrative
5140: 20 4c 65 76 65 6c 73 20 62 79 20 53 51 4c 20 73   Levels by SQL s
5150: 74 61 74 65 6d 65 6e 74 73 3c 2f 68 33 3e 0d 0a  tatements</h3>..
5160: 41 73 20 77 65 27 76 65 20 61 6c 72 65 61 64 79  As we've already
5170: 20 73 65 65 6e 20 62 65 66 6f 72 65 20 77 65 20   seen before we 
5180: 61 72 65 20 6e 6f 77 20 65 78 70 65 63 74 65 64  are now expected
5190: 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20 73 6f 6d   to complete som
51a0: 65 77 61 79 20 74 68 65 20 54 6f 70 6f 46 65 61  eway the TopoFea
51b0: 74 75 72 65 73 20 64 65 66 69 6e 69 74 69 6f 6e  tures definition
51c0: 73 20 73 75 70 70 6f 72 74 69 6e 67 20 74 68 65  s supporting the
51d0: 20 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c   <b>Populated Pl
51e0: 61 63 65 73 3c 2f 62 3e 2c 20 3c 62 3e 4d 75 6e  aces</b>, <b>Mun
51f0: 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2c  icipalities</b>,
5200: 20 3c 62 3e 50 72 6f 76 69 6e 63 65 73 3c 2f 62   <b>Provinces</b
5210: 3e 20 61 6e 64 20 3c 62 3e 52 65 67 69 6f 6e 3c  > and <b>Region<
5220: 2f 62 3e 20 54 6f 70 6f 4c 61 79 65 72 73 20 77  /b> TopoLayers w
5230: 65 27 76 65 20 70 72 65 76 69 6f 75 73 6c 79 20  e've previously 
5240: 63 72 65 61 74 65 64 20 62 79 20 63 61 6c 6c 69  created by calli
5250: 6e 67 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e  ng <b>TopoGeo_In
5260: 69 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62  itTopoLayer()</b
5270: 3e 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 48 61 70 70  >.<br><br>..Happ
5280: 69 6c 79 20 65 6e 6f 75 67 68 20 61 6c 6c 20 74  ily enough all t
5290: 68 65 73 65 20 61 64 6d 69 6e 69 73 74 72 61 74  hese administrat
52a0: 69 76 65 20 6c 65 76 65 6c 73 20 61 72 65 20 73  ive levels are s
52b0: 69 6d 70 6c 79 20 62 61 73 65 64 20 6f 6e 20 64  imply based on d
52c0: 69 72 65 63 74 20 61 67 67 72 65 67 61 74 69 6f  irect aggregatio
52d0: 6e 73 20 6f 66 20 3c 62 3e 43 65 6e 73 75 73 20  ns of <b>Census 
52e0: 41 72 65 61 73 3c 2f 62 3e 2c 20 73 6f 20 77 65  Areas</b>, so we
52f0: 20 6a 75 73 74 20 68 61 76 65 20 74 6f 20 65 78   just have to ex
5300: 65 63 75 74 65 20 66 65 77 20 61 70 70 72 6f 70  ecute few approp
5310: 72 69 61 74 65 20 53 51 4c 20 73 74 61 74 65 6d  riate SQL statem
5320: 65 6e 74 73 2e 0d 0a 3c 76 65 72 62 61 74 69 6d  ents...<verbatim
5330: 3e 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63  >..INSERT INTO c
5340: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
5350: 61 74 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e  atures..SELECT N
5360: 55 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20  ULL, c.node_id, 
5370: 63 2e 65 64 67 65 5f 69 64 2c 20 63 2e 66 61 63  c.edge_id, c.fac
5380: 65 5f 69 64 2c 20 32 2c 20 61 2e 66 69 64 0d 0a  e_id, 2, a.fid..
5390: 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f  FROM census2011_
53a0: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 20 41  topofeatures_2 A
53b0: 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73  S a..JOIN census
53c0: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
53d0: 73 5f 31 20 41 53 20 62 20 4f 4e 20 28 62 2e 63  s_1 AS b ON (b.c
53e0: 6f 64 5f 70 70 6c 20 3d 20 61 2e 63 6f 64 5f 70  od_ppl = a.cod_p
53f0: 70 6c 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73  pl)..JOIN census
5400: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
5410: 73 20 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70  s AS c ON (c.top
5420: 6f 6c 61 79 65 72 5f 69 64 20 3d 20 31 20 41 4e  olayer_id = 1 AN
5430: 44 20 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 29  D c.fid = b.fid)
5440: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  ;..</verbatim>..
5450: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 65 6e  <ul>..<li><b>cen
5460: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
5470: 75 72 65 73 5f 31 3c 2f 62 3e 20 69 73 20 74 68  ures_1</b> is th
5480: 65 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 74  e TopoFeatures t
5490: 61 62 6c 65 20 63 6f 72 72 65 73 70 6f 6e 64 69  able correspondi
54a0: 6e 67 20 74 6f 20 3c 62 3e 43 65 6e 73 75 73 20  ng to <b>Census 
54b0: 41 72 65 61 73 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d  Areas</b>.</li>.
54c0: 0a 3c 6c 69 3e 3c 62 3e 63 65 6e 73 75 73 32 30  .<li><b>census20
54d0: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f  11_topofeatures_
54e0: 32 3c 2f 62 3e 20 69 73 20 74 68 65 20 63 6f 72  2</b> is the cor
54f0: 72 65 73 70 6f 6e 64 73 20 74 6f 20 3c 62 3e 50  responds to <b>P
5500: 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73 3c  opulated Places<
5510: 2f 62 3e 3b 20 74 68 65 20 63 6c 61 75 73 65 20  /b>; the clause 
5520: 3c 62 3e 62 2e 63 6f 64 5f 70 70 6c 20 3d 20 61  <b>b.cod_ppl = a
5530: 2e 63 6f 64 5f 70 70 6c 3c 2f 62 3e 20 77 69 6c  .cod_ppl</b> wil
5540: 6c 20 72 65 6c 61 74 69 6f 6e 61 6c 6c 79 20 6a  l relationally j
5550: 6f 69 6e 20 65 61 63 68 20 50 6f 70 75 6c 61 74  oin each Populat
5560: 65 64 20 50 6c 61 63 65 20 74 6f 20 69 74 73 20  ed Place to its 
5570: 75 6e 64 65 72 6c 61 79 69 6e 67 20 43 65 6e 73  underlaying Cens
5580: 75 73 20 41 72 65 61 73 2e 3c 2f 6c 69 3e 0d 0a  us Areas.</li>..
5590: 3c 6c 69 3e 73 6f 20 77 65 20 63 61 6e 20 64 75  <li>so we can du
55a0: 6c 79 20 69 6e 73 65 72 74 20 69 6e 74 6f 20 74  ly insert into t
55b0: 68 65 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72  he <b>TopoFeatur
55c0: 65 73 2d 67 65 6f 6d 65 74 72 79 3c 2f 62 3e 20  es-geometry</b> 
55d0: 74 61 62 6c 65 20 28 69 2e 65 2e 20 3c 69 3e 63  table (i.e. <i>c
55e0: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
55f0: 61 74 75 72 65 73 3c 2f 69 3e 29 20 61 20 6e 65  atures</i>) a ne
5600: 77 20 6c 65 76 65 6c 20 6f 66 20 72 65 66 65 72  w level of refer
5610: 65 6e 63 65 73 20 74 6f 20 54 6f 70 6f 6c 6f 67  ences to Topolog
5620: 79 20 70 72 69 6d 69 74 69 76 65 73 20 62 79 20  y primitives by 
5630: 73 69 6d 70 6c 79 20 63 6f 70 79 69 6e 67 20 61  simply copying a
5640: 6c 6c 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 61  ll definitions a
5650: 6c 72 65 61 64 79 20 73 74 6f 72 65 64 20 69 6e  lready stored in
5660: 74 6f 20 74 68 65 20 70 72 65 76 69 6f 75 73 20  to the previous 
5670: 68 69 65 72 61 72 63 68 69 63 61 6c 20 6c 65 76  hierarchical lev
5680: 65 6c 2e 3c 62 72 3e 0d 0a 41 6e 64 20 74 6f 20  el.<br>..And to 
5690: 64 6f 20 73 75 63 68 20 61 20 74 68 69 6e 67 20  do such a thing 
56a0: 77 65 20 73 69 6d 70 6c 79 20 68 61 76 65 20 74  we simply have t
56b0: 6f 20 72 65 61 64 20 66 72 6f 6d 20 3c 62 3e 74  o read from <b>t
56c0: 6f 70 6f 6c 61 79 65 72 3d 31 3c 2f 62 3e 20 74  opolayer=1</b> t
56d0: 68 65 6e 20 69 6e 73 65 72 74 69 6e 67 20 69 6e  hen inserting in
56e0: 74 6f 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d  to <b>topolayer=
56f0: 32 3c 2f 62 3e 20 61 66 74 65 72 20 73 65 74 74  2</b> after sett
5700: 69 6e 67 20 74 68 65 20 61 70 70 72 6f 70 72 69  ing the appropri
5710: 61 74 65 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 76  ate <b>fid</b> v
5720: 61 6c 75 65 73 2e 3c 62 72 3e 0d 0a 52 65 61 6c  alues.<br>..Real
5730: 6c 79 20 6e 6f 74 20 61 20 64 69 66 66 69 63 75  ly not a difficu
5740: 6c 74 20 74 61 73 6b 2e 3c 2f 6c 69 3e 0d 0a 3c  lt task.</li>..<
5750: 2f 75 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  /ul>..<verbatim>
5760: 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65  ..INSERT INTO ce
5770: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61  nsus2011_topofea
5780: 74 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55  tures..SELECT NU
5790: 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63  LL, c.node_id, c
57a0: 2e 65 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65  .edge_id, c.face
57b0: 5f 69 64 2c 20 33 2c 20 61 2e 66 69 64 0d 0a 46  _id, 3, a.fid..F
57c0: 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74  ROM census2011_t
57d0: 6f 70 6f 66 65 61 74 75 72 65 73 5f 33 20 41 53  opofeatures_3 AS
57e0: 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32   a..JOIN census2
57f0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
5800: 5f 31 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f  _1 AS b ON (b.co
5810: 64 5f 63 6f 6d 20 3d 20 61 2e 63 6f 64 5f 63 6f  d_com = a.cod_co
5820: 6d 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32  m)..JOIN census2
5830: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
5840: 20 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f   AS c ON (c.topo
5850: 6c 61 79 65 72 5f 69 64 20 3d 20 31 20 41 4e 44  layer_id = 1 AND
5860: 20 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 3b   c.fid = b.fid);
5870: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57  ..</verbatim>..W
5880: 65 20 63 61 6e 20 61 64 6f 70 74 20 65 78 61 63  e can adopt exac
5890: 74 6c 79 20 74 68 65 20 73 61 6d 65 20 69 64 65  tly the same ide
58a0: 6e 74 69 63 61 6c 20 61 70 70 72 6f 61 63 68 20  ntical approach 
58b0: 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f 6d 70  in order to comp
58c0: 6c 65 74 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65  lete <b>topolaye
58d0: 72 3d 33 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f  r=3</b> correspo
58e0: 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 4d 75 6e 69  nding to <b>Muni
58f0: 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2e 0d  cipalities</b>..
5900: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49 4e 53  .<verbatim>..INS
5910: 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 75 73 32  ERT INTO census2
5920: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
5930: 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 63  ..SELECT NULL, c
5940: 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64 67 65  .node_id, c.edge
5950: 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 64 2c 20  _id, c.face_id, 
5960: 34 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20 63  4, a.fid..FROM c
5970: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
5980: 61 74 75 72 65 73 5f 34 20 41 53 20 61 0d 0a 4a  atures_4 AS a..J
5990: 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74  OIN census2011_t
59a0: 6f 70 6f 66 65 61 74 75 72 65 73 5f 33 20 41 53  opofeatures_3 AS
59b0: 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 70 72 6f   b ON (b.cod_pro
59c0: 76 20 3d 20 61 2e 63 6f 64 5f 70 72 6f 76 29 0d  v = a.cod_prov).
59d0: 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31  .JOIN census2011
59e0: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 53  _topofeatures AS
59f0: 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 61 79   c ON (c.topolay
5a00: 65 72 5f 69 64 20 3d 20 33 20 41 4e 44 20 63 2e  er_id = 3 AND c.
5a10: 66 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c  fid = b.fid);..<
5a20: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 4d 6f 72 65  /verbatim>..More
5a30: 20 6f 72 20 6c 65 73 73 20 74 68 65 20 73 61 6d   or less the sam
5a40: 65 20 69 73 20 66 6f 72 20 64 65 72 69 76 69 6e  e is for derivin
5a50: 67 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 34  g <b>topolayer=4
5a60: 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69  </b> correspondi
5a70: 6e 67 20 74 6f 20 3c 62 3e 50 72 6f 76 69 6e 63  ng to <b>Provinc
5a80: 65 73 3c 2f 62 3e 3b 20 74 68 69 73 20 74 69 6d  es</b>; this tim
5a90: 65 20 77 65 27 6c 6c 20 73 69 6d 70 6c 79 20 61  e we'll simply a
5aa0: 67 67 72 65 67 61 74 65 20 74 68 65 20 75 6e 64  ggregate the und
5ab0: 65 72 6c 79 69 6e 67 20 4d 75 6e 69 63 69 70 61  erlying Municipa
5ac0: 6c 69 74 69 65 73 20 66 72 6f 6d 20 3c 62 3e 74  lities from <b>t
5ad0: 6f 70 6f 6c 61 79 65 72 3d 33 3c 2f 62 3e 2e 0d  opolayer=3</b>..
5ae0: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65  .</verbatim>..We
5af0: 20 63 61 6e 20 61 64 6f 70 74 20 65 78 61 63 74   can adopt exact
5b00: 6c 79 20 74 68 65 20 73 61 6d 65 20 69 64 65 6e  ly the same iden
5b10: 74 69 63 61 6c 20 61 70 70 72 6f 61 63 68 20 69  tical approach i
5b20: 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f 6d 70 6c  n order to compl
5b30: 65 74 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72  ete <b>topolayer
5b40: 3d 33 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e  =3</b> correspon
5b50: 64 69 6e 67 20 74 6f 20 3c 62 3e 4d 75 6e 69 63  ding to <b>Munic
5b60: 69 70 61 6c 69 74 69 65 73 3c 2f 62 3e 2e 0d 0a  ipalities</b>...
5b70: 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49 4e 53 45  <verbatim>..INSE
5b80: 52 54 20 49 4e 54 4f 20 63 65 6e 73 75 73 32 30  RT INTO census20
5b90: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 0d  11_topofeatures.
5ba0: 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 63 2e  .SELECT NULL, c.
5bb0: 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64 67 65 5f  node_id, c.edge_
5bc0: 69 64 2c 20 63 2e 66 61 63 65 5f 69 64 2c 20 35  id, c.face_id, 5
5bd0: 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20 63 65  , a.fid..FROM ce
5be0: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61  nsus2011_topofea
5bf0: 74 75 72 65 73 5f 35 20 41 53 20 61 0d 0a 4a 4f  tures_5 AS a..JO
5c00: 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  IN census2011_to
5c10: 70 6f 66 65 61 74 75 72 65 73 5f 34 20 41 53 20  pofeatures_4 AS 
5c20: 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 72 65 67 20  b ON (b.cod_reg 
5c30: 3d 20 61 2e 63 6f 64 5f 72 65 67 29 0d 0a 4a 4f  = a.cod_reg)..JO
5c40: 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f  IN census2011_to
5c50: 70 6f 66 65 61 74 75 72 65 73 20 41 53 20 63 20  pofeatures AS c 
5c60: 4f 4e 20 28 63 2e 74 6f 70 6f 6c 61 79 65 72 5f  ON (c.topolayer_
5c70: 69 64 20 3d 20 34 20 41 4e 44 20 63 2e 66 69 64  id = 4 AND c.fid
5c80: 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65   = b.fid);..</ve
5c90: 72 62 61 74 69 6d 3e 0d 0a 41 6e 64 20 66 69 6e  rbatim>..And fin
5ca0: 61 6c 6c 79 20 77 65 20 63 61 6e 20 64 65 72 69  ally we can deri
5cb0: 76 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d  ve <b>topolayer=
5cc0: 35 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e 64  5</b> correspond
5cd0: 69 6e 67 20 74 6f 20 3c 62 3e 52 65 67 69 6f 6e  ing to <b>Region
5ce0: 73 3c 2f 62 3e 20 62 79 20 64 69 72 65 63 74 6c  s</b> by directl
5cf0: 79 20 61 67 67 72 65 67 61 74 69 6e 67 20 74 68  y aggregating th
5d00: 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 50 72 6f  e underlying Pro
5d10: 76 69 6e 63 65 73 20 66 72 6f 6d 20 3c 62 3e 74  vinces from <b>t
5d20: 6f 70 6f 6c 61 79 65 72 3d 34 3c 2f 62 3e 2e 0d  opolayer=4</b>..
5d30: 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c  .<br><br>..<tabl
5d40: 65 20 77 69 64 74 68 3d 22 31 30 30 25 22 20 20  e width="100%"  
5d50: 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c  cellspan="4" cel
5d60: 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63  lpadding="6" bgc
5d70: 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62  olor="#f8f8f0" b
5d80: 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e  order="1">..<tr>
5d90: 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 31  <td>..<b>step #1
5da0: 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20  : exporting the 
5db0: 52 65 67 69 6f 6e 20 54 6f 70 6f 4c 61 79 65 72  Region TopoLayer
5dc0: 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e  </b>..<verbatim>
5dd0: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f  ..SELECT TopoGeo
5de0: 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72  _ExportTopoLayer
5df0: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27  ('census2011', '
5e00: 72 65 67 27 2c 20 27 6f 75 74 5f 72 65 67 5f 32  reg', 'out_reg_2
5e10: 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72  011', 1);..</ver
5e20: 62 61 74 69 6d 3e 0d 0a 57 65 20 61 72 65 20 6e  batim>..We are n
5e30: 6f 77 20 64 65 66 69 6e 69 74 65 6c 79 20 72 65  ow definitely re
5e40: 61 64 79 20 74 6f 20 65 78 70 6f 72 74 20 61 6e  ady to export an
5e50: 79 20 6f 74 68 65 72 20 41 64 6d 69 6e 69 73 74  y other Administ
5e60: 72 61 74 69 76 65 20 4c 65 76 65 6c 2e 3c 62 72  rative Level.<br
5e70: 3e 0d 0a 46 6f 72 20 74 68 65 20 73 61 6b 65 20  >..For the sake 
5e80: 6f 66 20 63 6c 61 72 69 74 79 20 77 65 27 6c 6c  of clarity we'll
5e90: 20 66 6f 6c 6c 6f 77 20 61 20 74 6f 70 2d 62 6f   follow a top-bo
5ea0: 74 74 6f 6d 20 6f 72 64 65 72 2c 20 73 6f 20 77  ttom order, so w
5eb0: 65 27 6c 6c 20 73 74 61 72 74 20 62 79 20 65 78  e'll start by ex
5ec0: 70 6f 72 74 69 6e 67 20 66 69 72 73 74 20 74 68  porting first th
5ed0: 65 20 77 68 6f 6c 65 20 54 75 73 63 61 6e 79 2e  e whole Tuscany.
5ee0: 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d  ..</td><td>..<im
5ef0: 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77  g src="https://w
5f00: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67  ww.gaia-gis.it/g
5f10: 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67  aia-sins/topofig
5f20: 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 72 65 67 69  s/topolayer-regi
5f30: 6f 6e 2e 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70  on.png" alt="top
5f40: 6f 6c 61 79 65 72 2d 72 65 67 69 6f 6e 22 3e 0d  olayer-region">.
5f50: 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  .</td></tr>..<tr
5f60: 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23  ><td>..<b>step #
5f70: 32 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65  2: exporting the
5f80: 20 50 72 6f 76 69 6e 63 65 73 20 54 6f 70 6f 4c   Provinces TopoL
5f90: 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61  ayer</b>..<verba
5fa0: 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70  tim>..SELECT Top
5fb0: 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c  oGeo_ExportTopoL
5fc0: 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31  ayer('census2011
5fd0: 27 2c 20 27 70 72 6f 76 27 2c 20 27 6f 75 74 5f  ', 'prov', 'out_
5fe0: 70 72 6f 76 5f 32 30 31 31 27 2c 20 31 29 3b 0d  prov_2011', 1);.
5ff0: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65  .</verbatim>..We
6000: 27 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 62 79 20  'll continue by 
6010: 65 78 70 6f 72 74 69 6e 67 20 61 6c 6c 20 74 68  exporting all th
6020: 65 20 54 75 73 63 61 6e 79 20 50 72 6f 76 69 6e  e Tuscany Provin
6030: 63 65 73 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d  ces...</td><td>.
6040: 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73  .<img src="https
6050: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e  ://www.gaia-gis.
6060: 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70  it/gaia-sins/top
6070: 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d  ofigs/topolayer-
6080: 70 72 6f 76 69 6e 63 65 73 2e 70 6e 67 22 20 61  provinces.png" a
6090: 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d 70 72  lt="topolayer-pr
60a0: 6f 76 69 6e 63 65 73 22 3e 0d 0a 3c 2f 74 64 3e  ovinces">..</td>
60b0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d  </tr>..<tr><td>.
60c0: 0a 3c 62 3e 73 74 65 70 20 23 33 3a 20 65 78 70  .<b>step #3: exp
60d0: 6f 72 74 69 6e 67 20 74 68 65 20 4d 75 6e 69 63  orting the Munic
60e0: 69 70 61 6c 69 74 69 65 73 20 54 6f 70 6f 4c 61  ipalities TopoLa
60f0: 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74  yer</b>..<verbat
6100: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f  im>..SELECT Topo
6110: 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61  Geo_ExportTopoLa
6120: 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27  yer('census2011'
6130: 2c 20 27 63 6f 6d 27 2c 20 27 6f 75 74 5f 63 6f  , 'com', 'out_co
6140: 6d 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f  m_2011', 1);..</
6150: 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 6e 20  verbatim>..Then 
6160: 77 65 27 6c 6c 20 65 78 70 6f 72 74 20 61 6c 6c  we'll export all
6170: 20 74 68 65 20 54 75 73 63 61 6e 79 20 4d 75 6e   the Tuscany Mun
6180: 69 63 69 70 61 6c 69 74 69 65 73 2e 3c 62 72 3e  icipalities.<br>
6190: 0d 0a 46 6f 72 20 62 65 74 74 65 72 20 63 6c 61  ..For better cla
61a0: 72 69 74 79 20 74 68 65 20 66 69 67 75 72 65 20  rity the figure 
61b0: 73 68 6f 77 73 20 61 20 6d 61 67 6e 69 66 69 65  shows a magnifie
61c0: 64 20 64 65 74 61 69 6c 20 63 65 6e 74 65 72 65  d detail centere
61d0: 64 20 61 72 6f 75 6e 64 20 74 68 65 20 49 73 6c  d around the Isl
61e0: 61 6e 64 20 6f 66 20 45 6c 62 61 2e 0d 0a 3c 2f  and of Elba...</
61f0: 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72  td><td>..<img sr
6200: 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67  c="https://www.g
6210: 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d  aia-gis.it/gaia-
6220: 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f  sins/topofigs/to
6230: 70 6f 6c 61 79 65 72 2d 6d 75 6e 69 63 69 70 61  polayer-municipa
6240: 6c 69 74 69 65 73 2e 70 6e 67 22 20 61 6c 74 3d  lities.png" alt=
6250: 22 74 6f 70 6f 6c 61 79 65 72 2d 6d 75 6e 69 63  "topolayer-munic
6260: 69 70 61 6c 69 74 69 65 73 22 3e 0d 0a 3c 2f 74  ipalities">..</t
6270: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
6280: 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 34 3a 20 65  >..<b>step #4: e
6290: 78 70 6f 72 74 69 6e 67 20 74 68 65 20 50 6f 70  xporting the Pop
62a0: 75 6c 61 74 65 64 20 50 6c 61 63 65 73 20 54 6f  ulated Places To
62b0: 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65  poLayer</b>..<ve
62c0: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
62d0: 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f  TopoGeo_ExportTo
62e0: 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32  poLayer('census2
62f0: 30 31 31 27 2c 20 27 70 70 6c 27 2c 20 27 6f 75  011', 'ppl', 'ou
6300: 74 5f 70 70 6c 5f 32 30 31 31 27 2c 20 31 29 3b  t_ppl_2011', 1);
6310: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41  ..</verbatim>..A
6320: 6e 64 20 77 65 27 6c 6c 20 66 69 6e 61 6c 6c 79  nd we'll finally
6330: 20 65 78 70 6f 72 74 20 61 6c 6c 20 50 6f 70 75   export all Popu
6340: 6c 61 74 65 64 20 50 6c 61 63 65 73 2e 3c 62 72  lated Places.<br
6350: 3e 3c 62 72 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c  ><br><br><br>..<
6360: 75 3e 43 6f 6e 63 6c 75 73 69 6f 6e 3c 2f 75 3e  u>Conclusion</u>
6370: 3a 20 77 65 20 73 74 61 72 74 65 64 20 74 68 69  : we started thi
6380: 73 20 61 64 76 61 6e 63 65 64 20 74 75 74 6f 72  s advanced tutor
6390: 69 61 6c 20 62 79 20 69 6d 70 6f 72 74 69 6e 67  ial by importing
63a0: 20 69 6e 74 6f 20 61 20 54 6f 70 6f 6c 6f 67 79   into a Topology
63b0: 20 6a 75 73 74 20 61 20 73 69 6e 67 6c 65 20 6c   just a single l
63c0: 61 79 65 72 20 28 43 65 6e 73 75 73 20 41 72 65  ayer (Census Are
63d0: 61 73 29 20 61 6e 64 20 6e 6f 77 20 77 65 27 76  as) and now we'v
63e0: 65 20 66 69 6e 69 73 68 65 64 20 62 79 20 70 72  e finished by pr
63f0: 6f 64 75 63 69 6e 67 20 61 20 63 6f 6d 70 6c 65  oducing a comple
6400: 74 65 20 73 65 74 20 6f 66 20 61 64 6d 69 6e 69  te set of admini
6410: 73 74 72 61 74 69 76 65 20 62 6f 75 6e 64 61 72  strative boundar
6420: 69 65 73 20 61 74 20 64 69 66 66 65 72 65 6e 74  ies at different
6430: 20 68 69 65 72 61 72 63 68 69 63 61 6c 20 6c 65   hierarchical le
6440: 76 65 6c 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69  vels:..<ul>..<li
6450: 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65  >Populated Place
6460: 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 4d 75 6e 69  s</li>..<li>Muni
6470: 63 69 70 61 6c 69 74 69 65 73 3c 2f 6c 69 3e 0d  cipalities</li>.
6480: 0a 3c 6c 69 3e 50 72 6f 76 69 6e 63 65 73 3c 2f  .<li>Provinces</
6490: 6c 69 3e 0d 0a 3c 6c 69 3e 52 65 67 69 6f 6e 3c  li>..<li>Region<
64a0: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74  /li>..</ul>..</t
64b0: 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63  d><td>..<img src
64c0: 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61  ="https://www.ga
64d0: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
64e0: 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70  ins/topofigs/top
64f0: 6f 6c 61 79 65 72 2d 70 6f 70 75 6c 61 74 65 64  olayer-populated
6500: 2d 70 6c 61 63 65 73 2e 70 6e 67 22 20 61 6c 74  -places.png" alt
6510: 3d 22 74 6f 70 6f 6c 61 79 65 72 2d 70 6f 70 75  ="topolayer-popu
6520: 6c 61 74 65 64 2d 70 6c 61 63 65 73 22 3e 0d 0a  lated-places">..
6530: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61  </td></tr>..</ta
6540: 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a  ble><br>..<hr>..
6550: 3c 68 33 3e 52 65 63 65 6e 74 20 63 68 61 6e 67  <h3>Recent chang
6560: 65 73 3a 20 6f 6c 64 20 4d 75 6e 69 63 69 70 61  es: old Municipa
6570: 6c 69 74 69 65 73 20 6d 65 72 67 69 6e 67 20 69  lities merging i
6580: 6e 74 6f 20 6e 65 77 20 4d 75 6e 69 63 69 70 61  nto new Municipa
6590: 6c 69 74 69 65 73 3c 2f 68 33 3e 0d 0a 49 66 20  lities</h3>..If 
65a0: 79 6f 75 20 72 65 6d 65 6d 62 65 72 20 74 68 65  you remember the
65b0: 20 69 6e 69 74 69 61 6c 20 3c 62 3e 74 75 73 63   initial <b>tusc
65c0: 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e  any-census-2011.
65d0: 73 71 6c 69 74 65 3c 2f 62 3e 20 44 42 2d 66 69  sqlite</b> DB-fi
65e0: 6c 65 20 63 6f 6e 74 61 69 6e 73 20 61 20 3c 62  le contains a <b
65f0: 3e 63 6f 6d 5f 32 30 31 34 5f 31 35 3c 2f 62 3e  >com_2014_15</b>
6600: 20 54 61 62 6c 65 3b 20 64 75 72 69 6e 67 20 79   Table; during y
6610: 65 61 72 73 20 32 30 31 34 20 61 6e 64 20 32 30  ears 2014 and 20
6620: 31 35 20 66 65 77 20 4d 75 6e 69 63 69 70 61 6c  15 few Municipal
6630: 69 74 69 65 73 20 6d 65 72 67 65 64 20 74 77 6f  ities merged two
6640: 20 62 79 20 74 77 6f 20 74 68 75 73 20 67 69 76   by two thus giv
6650: 69 6e 67 20 62 69 72 74 68 20 74 6f 20 6e 65 77  ing birth to new
6660: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2e   Municipalities.
6670: 20 54 68 69 73 20 69 73 20 74 68 65 20 66 75 6c   This is the ful
6680: 6c 20 6c 69 73 74 3a 3c 62 72 3e 3c 62 72 3e 0d  l list:<br><br>.
6690: 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e  .<table cellspan
66a0: 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67  ="4" cellpadding
66b0: 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ="6" bgcolor="#f
66c0: 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31  8f8f0" border="1
66d0: 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73  ">..<tr><td cols
66e0: 70 61 6e 3d 22 33 22 20 61 6c 69 67 6e 3d 22 63  pan="3" align="c
66f0: 65 6e 74 65 72 22 20 62 67 63 6f 6c 6f 72 3d 22  enter" bgcolor="
6700: 23 66 30 66 30 66 38 22 3e 3c 62 3e 4e 65 77 20  #f0f0f8"><b>New 
6710: 4d 75 6e 69 63 69 70 61 6c 69 74 79 20 28 32 30  Municipality (20
6720: 31 34 2f 31 35 29 3c 2f 62 3e 3c 2f 74 64 3e 3c  14/15)</b></td><
6730: 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22 20 61  td colspan="2" a
6740: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 20 20 62  lign="center"  b
6750: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22  gcolor="#f0f8f8"
6760: 3e 3c 62 3e 73 75 70 70 72 65 73 73 65 64 20 23  ><b>suppressed #
6770: 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 63 6f  1</b></td><td co
6780: 6c 73 70 61 6e 3d 22 32 22 20 61 6c 69 67 6e 3d  lspan="2" align=
6790: 22 63 65 6e 74 65 72 22 20 62 67 63 6f 6c 6f 72  "center" bgcolor
67a0: 3d 22 23 66 38 66 30 66 38 22 3e 3c 62 3e 73 75  ="#f8f0f8"><b>su
67b0: 70 70 72 65 73 73 65 64 20 23 32 3c 2f 62 3e 3c  ppressed #2</b><
67c0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c  /td></tr>..<tr><
67d0: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
67e0: 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 70 72 6f 76  0f8"><b>cod_prov
67f0: 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63  </b></td><td bgc
6800: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c  olor="#f0f0f8"><
6810: 62 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74  b>cod_com</b></t
6820: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  d><td bgcolor="#
6830: 66 30 66 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c  f0f0f8"><b>name<
6840: 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  /b></td><td bgco
6850: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 3c 62  lor="#f0f8f8"><b
6860: 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64  >cod_com</b></td
6870: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
6880: 30 66 38 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f  0f8f8"><b>name</
6890: 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  b></td><td bgcol
68a0: 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 3c 62 3e  or="#f8f0f8"><b>
68b0: 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 3e  cod_com</b></td>
68c0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38  <td bgcolor="#f8
68d0: 66 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 3c 2f 62  f0f8"><b>name</b
68e0: 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72  ></td></tr>..<tr
68f0: 3e 3c 74 64 3e 41 52 3c 2f 74 64 3e 3c 74 64 20  ><td>AR</td><td 
6900: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 31  align="right">51
6910: 30 34 30 3c 2f 74 64 3e 3c 74 64 3e 43 61 73 74  040</td><td>Cast
6920: 65 6c 66 72 61 6e 63 6f 20 50 69 61 6e 64 69 73  elfranco Piandis
6930: 63 c3 b2 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  c..</td><td bgco
6940: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 20 61 6c  lor="#f0f8f8" al
6950: 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30 30  ign="right">5100
6960: 39 3c 2f 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  9</td bgcolor="#
6970: 66 30 66 38 66 38 22 3e 3c 74 64 20 62 67 63 6f  f0f8f8"><td bgco
6980: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e 43 61  lor="#f0f8f8">Ca
6990: 73 74 65 6c 66 72 61 6e 63 6f 20 64 69 20 53 6f  stelfranco di So
69a0: 70 72 61 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  pra</td><td bgco
69b0: 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c  lor="#f8f0f8" al
69c0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30 32  ign="right">5102
69d0: 39 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f  9</td><td bgcolo
69e0: 72 3d 22 23 66 38 66 30 66 38 22 3e 50 69 61 6e  r="#f8f0f8">Pian
69f0: 20 64 69 20 53 63 6f 3c 2f 74 64 3e 3c 2f 74 72   di Sco</td></tr
6a00: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 41 52 3c 2f 74  >..<tr><td>AR</t
6a10: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67  d><td align="rig
6a20: 68 74 22 3e 35 31 30 34 31 3c 2f 74 64 3e 3c 74  ht">51041</td><t
6a30: 64 3e 50 72 61 74 6f 76 65 63 63 68 69 6f 20 53  d>Pratovecchio S
6a40: 74 69 61 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f  tia</td><td bgco
6a50: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 20 61 6c  lor="#f0f8f8" al
6a60: 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 31 30 33  ign="right">5103
6a70: 32 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f  2</td><td bgcolo
6a80: 72 3d 22 23 66 30 66 38 66 38 22 3e 50 72 61 74  r="#f0f8f8">Prat
6a90: 6f 76 65 63 63 68 69 6f 3c 2f 74 64 3e 3c 74 64  ovecchio</td><td
6aa0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66   bgcolor="#f8f0f
6ab0: 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  8" align="right"
6ac0: 3e 35 31 30 33 36 3c 2f 74 64 3e 3c 74 64 20 62  >51036</td><td b
6ad0: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22  gcolor="#f8f0f8"
6ae0: 3e 53 74 69 61 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  >Stia</td></tr>.
6af0: 0a 3c 74 72 3e 3c 74 64 3e 46 49 3c 2f 74 64 3e  .<tr><td>FI</td>
6b00: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
6b10: 22 3e 34 38 30 35 32 3c 2f 74 64 3e 3c 74 64 3e  ">48052</td><td>
6b20: 46 69 67 6c 69 6e 65 20 65 20 49 6e 63 69 73 61  Figline e Incisa
6b30: 20 56 61 6c 64 61 72 6e 6f 3c 2f 74 64 3e 3c 74   Valdarno</td><t
6b40: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38  d bgcolor="#f0f8
6b50: 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  f8" align="right
6b60: 22 3e 34 38 30 31 36 3c 2f 74 64 3e 3c 74 64 20  ">48016</td><td 
6b70: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38  bgcolor="#f0f8f8
6b80: 22 3e 46 69 67 6c 69 6e 65 20 56 61 6c 64 61 72  ">Figline Valdar
6b90: 6e 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  no</td><td bgcol
6ba0: 6f 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69  or="#f8f0f8" ali
6bb0: 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 30 32 33  gn="right">48023
6bc0: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6bd0: 3d 22 23 66 38 66 30 66 38 22 3e 49 6e 63 69 73  ="#f8f0f8">Incis
6be0: 61 20 69 6e 20 56 61 6c 20 64 27 41 72 6e 6f 3c  a in Val d'Arno<
6bf0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c  /td></tr>..<tr><
6c00: 74 64 3e 46 49 3c 2f 74 64 3e 3c 74 64 20 61 6c  td>FI</td><td al
6c10: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 30 35  ign="right">4805
6c20: 33 3c 2f 74 64 3e 3c 74 64 3e 53 63 61 72 70 65  3</td><td>Scarpe
6c30: 72 69 61 20 65 20 53 61 6e 20 50 69 65 72 6f 3c  ria e San Piero<
6c40: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
6c50: 22 23 66 30 66 38 66 38 22 20 61 6c 69 67 6e 3d  "#f0f8f8" align=
6c60: 22 72 69 67 68 74 22 3e 34 38 30 34 32 3c 2f 74  "right">48042</t
6c70: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23  d><td bgcolor="#
6c80: 66 30 66 38 66 38 22 3e 53 63 61 72 70 65 72 69  f0f8f8">Scarperi
6c90: 61 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f  a</td><td bgcolo
6ca0: 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69 67  r="#f8f0f8" alig
6cb0: 6e 3d 22 72 69 67 68 74 22 3e 34 38 30 34 30 3c  n="right">48040<
6cc0: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d  /td><td bgcolor=
6cd0: 22 23 66 38 66 30 66 38 22 3e 53 61 6e 20 50 69  "#f8f0f8">San Pi
6ce0: 65 72 6f 20 61 20 53 69 65 76 65 3c 2f 74 64 3e  ero a Sieve</td>
6cf0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 4c  </tr>..<tr><td>L
6d00: 55 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d  U</td><td align=
6d10: 22 72 69 67 68 74 22 3e 34 36 30 33 36 3c 2f 74  "right">46036</t
6d20: 64 3e 3c 74 64 3e 46 61 62 62 72 69 63 68 65 20  d><td>Fabbriche 
6d30: 64 69 20 56 65 72 67 65 6d 6f 6c 69 3c 2f 74 64  di Vergemoli</td
6d40: 3e 3c 74 64 20 20 62 67 63 6f 6c 6f 72 3d 22 23  ><td  bgcolor="#
6d50: 66 30 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72  f0f8f8" align="r
6d60: 69 67 68 74 22 3e 34 36 30 31 32 3c 2f 74 64 3e  ight">46012</td>
6d70: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
6d80: 66 38 66 38 22 3e 46 61 62 62 72 69 63 68 65 20  f8f8">Fabbriche 
6d90: 64 69 20 56 61 6c 6c 69 63 6f 3c 2f 74 64 3e 3c  di Vallico</td><
6da0: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66  td bgcolor="#f8f
6db0: 30 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68  0f8" align="righ
6dc0: 74 22 3e 34 36 30 33 32 3c 2f 74 64 3e 3c 74 64  t">46032</td><td
6dd0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66   bgcolor="#f8f0f
6de0: 38 22 3e 56 65 72 67 65 6d 6f 6c 69 3c 2f 74 64  8">Vergemoli</td
6df0: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e  ></tr>..<tr><td>
6e00: 4c 55 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e  LU</td><td align
6e10: 3d 22 72 69 67 68 74 22 3e 34 36 30 33 37 3c 2f  ="right">46037</
6e20: 74 64 3e 3c 74 64 3e 53 69 6c 6c 61 6e 6f 20 47  td><td>Sillano G
6e30: 69 75 6e 63 75 67 6e 61 6e 6f 3c 2f 74 64 3e 3c  iuncugnano</td><
6e40: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
6e50: 38 66 38 22 61 6c 69 67 6e 3d 22 72 69 67 68 74  8f8"align="right
6e60: 22 3e 34 36 30 32 39 3c 2f 74 64 3e 3c 74 64 20  ">46029</td><td 
6e70: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38  bgcolor="#f0f8f8
6e80: 22 3e 53 69 6c 6c 61 6e 6f 3c 2f 74 64 3e 3c 74  ">Sillano</td><t
6e90: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30  d bgcolor="#f8f0
6ea0: 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  f8" align="right
6eb0: 22 3e 34 36 30 31 36 3c 2f 74 64 3e 3c 74 64 20  ">46016</td><td 
6ec0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38  bgcolor="#f8f0f8
6ed0: 22 3e 47 69 75 6e 63 75 67 6e 61 6e 6f 3c 2f 74  ">Giuncugnano</t
6ee0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
6ef0: 3e 50 49 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  >PI</td><td alig
6f00: 6e 3d 22 72 69 67 68 74 22 3e 35 30 30 35 30 3c  n="right">50050<
6f10: 2f 74 64 3e 3c 74 64 3e 43 61 73 63 69 61 6e 61  /td><td>Casciana
6f20: 20 54 65 72 6d 65 20 4c 61 72 69 3c 2f 74 64 3e   Terme Lari</td>
6f30: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30  <td bgcolor="#f0
6f40: 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 67  f8f8" align="rig
6f50: 68 74 22 3e 35 30 30 30 37 3c 2f 74 64 3e 3c 74  ht">50007</td><t
6f60: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38  d bgcolor="#f0f8
6f70: 66 38 22 3e 43 61 73 63 69 61 6e 61 20 54 65 72  f8">Casciana Ter
6f80: 6d 65 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c  me</td><td bgcol
6f90: 6f 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69  or="#f8f0f8" ali
6fa0: 67 6e 3d 22 72 69 67 68 74 22 3e 35 30 30 31 37  gn="right">50017
6fb0: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72  </td><td bgcolor
6fc0: 3d 22 23 66 38 66 30 66 38 22 3e 4c 61 72 69 3c  ="#f8f0f8">Lari<
6fd0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c  /td></tr>..<tr><
6fe0: 74 64 3e 50 49 3c 2f 74 64 3e 3c 74 64 20 61 6c  td>PI</td><td al
6ff0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 30 30 34  ign="right">5004
7000: 31 3c 2f 74 64 3e 3c 74 64 3e 43 72 65 73 70 69  1</td><td>Crespi
7010: 6e 61 20 4c 6f 72 65 6e 7a 61 6e 61 3c 2f 74 64  na Lorenzana</td
7020: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
7030: 30 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 69  0f8f8" align="ri
7040: 67 68 74 22 3e 35 30 30 31 33 3c 2f 74 64 3e 3c  ght">50013</td><
7050: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66  td bgcolor="#f0f
7060: 38 66 38 22 3e 43 72 65 73 70 69 6e 61 3c 2f 74  8f8">Crespina</t
7070: 64 3e 3c 74 64 20 20 62 67 63 6f 6c 6f 72 3d 22  d><td  bgcolor="
7080: 23 66 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22  #f8f0f8" align="
7090: 72 69 67 68 74 22 3e 35 30 30 31 38 3c 2f 74 64  right">50018</td
70a0: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66  ><td bgcolor="#f
70b0: 38 66 30 66 38 22 3e 4c 6f 72 65 6e 7a 61 6e 61  8f0f8">Lorenzana
70c0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61  </td></tr>..</ta
70d0: 62 6c 65 3e 0d 0a 3c 62 72 3e 0d 0a 53 75 63 68  ble>..<br>..Such
70e0: 20 63 68 61 6e 67 65 73 20 73 69 6d 70 6c 79 20   changes simply 
70f0: 61 66 66 65 63 74 73 20 4d 75 6e 69 63 69 70 61  affects Municipa
7100: 6c 69 74 69 65 73 3b 20 50 72 6f 76 69 6e 63 65  lities; Province
7110: 73 20 61 72 65 20 75 6e 61 66 66 65 63 74 65 64  s are unaffected
7120: 20 62 79 20 74 68 69 73 20 70 72 6f 63 65 73 73   by this process
7130: 3b 20 73 6f 20 77 65 20 63 61 6e 20 6e 6f 77 20  ; so we can now 
7140: 64 75 6c 79 20 67 65 6e 65 72 61 74 65 20 61 20  duly generate a 
7150: 66 75 72 74 68 65 72 20 6c 61 79 65 72 20 63 6f  further layer co
7160: 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 32  rresponding to 2
7170: 30 31 35 20 4d 75 6e 69 63 69 70 61 6c 69 74 69  015 Municipaliti
7180: 65 73 2c 20 61 6e 64 20 77 65 20 73 69 6d 70 6c  es, and we simpl
7190: 79 20 68 61 76 65 20 74 6f 20 73 6c 69 67 68 74  y have to slight
71a0: 6c 79 20 72 65 61 72 72 61 6e 67 65 20 74 68 65  ly rearrange the
71b0: 20 54 6f 70 6f 4c 61 79 65 72 73 2f 54 6f 70 6f   TopoLayers/Topo
71c0: 46 65 61 74 75 72 65 73 20 64 65 66 69 6e 69 74  Features definit
71d0: 69 6f 6e 73 20 69 6e 20 6f 72 64 65 72 20 74 6f  ions in order to
71e0: 20 61 63 68 69 65 76 65 20 74 68 69 73 20 66 75   achieve this fu
71f0: 72 74 68 65 72 20 67 6f 61 6c 2e 0d 0a 3c 76 65  rther goal...<ve
7200: 72 62 61 74 69 6d 3e 0d 0a 41 54 54 41 43 48 20  rbatim>..ATTACH 
7210: 44 41 54 41 42 41 53 45 20 22 2e 2f 74 75 73 63  DATABASE "./tusc
7220: 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e  any-census-2011.
7230: 73 71 6c 69 74 65 22 20 41 53 20 69 73 74 61 74  sqlite" AS istat
7240: 3b 0d 0a 0d 0a 43 52 45 41 54 45 20 54 41 42 4c  ;....CREATE TABL
7250: 45 20 63 6f 6d 32 30 31 35 20 41 53 0d 0a 53 45  E com2015 AS..SE
7260: 4c 45 43 54 20 2a 20 46 52 4f 4d 20 69 73 74 61  LECT * FROM ista
7270: 74 2e 70 6f 70 5f 63 6f 6d 5f 32 30 31 31 3b 0d  t.pop_com_2011;.
7280: 0a 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63  ...INSERT INTO c
7290: 6f 6d 32 30 31 35 0d 0a 53 45 4c 45 43 54 20 61  om2015..SELECT a
72a0: 2e 63 6f 64 5f 63 6f 6d 2c 20 61 2e 63 6f 64 5f  .cod_com, a.cod_
72b0: 70 72 6f 76 2c 20 61 2e 63 6f 64 5f 69 73 74 61  prov, a.cod_ista
72c0: 74 2c 20 61 2e 63 6f 64 5f 63 61 64 61 73 74 72  t, a.cod_cadastr
72d0: 65 2c 20 61 2e 6e 61 6d 65 2c 20 61 2e 74 6f 77  e, a.name, a.tow
72e0: 6e 68 61 6c 6c 5f 61 64 64 72 2c 0d 0a 20 20 20  nhall_addr,..   
72f0: 20 53 75 6d 28 62 2e 70 6f 70 5f 32 30 31 31 29   Sum(b.pop_2011)
7300: 2c 20 53 75 6d 28 62 2e 6d 5f 32 30 31 31 29 2c  , Sum(b.m_2011),
7310: 20 53 75 6d 28 62 2e 66 5f 32 30 31 31 29 0d 0a   Sum(b.f_2011)..
7320: 46 52 4f 4d 20 69 73 74 61 74 2e 63 6f 6d 5f 32  FROM istat.com_2
7330: 30 31 34 5f 31 35 20 41 53 20 61 0d 0a 4a 4f 49  014_15 AS a..JOI
7340: 4e 20 69 73 74 61 74 2e 70 6f 70 5f 63 6f 6d 5f  N istat.pop_com_
7350: 32 30 31 31 20 41 53 20 62 20 4f 4e 20 28 62 2e  2011 AS b ON (b.
7360: 63 6f 64 5f 63 6f 6d 20 49 4e 20 28 61 2e 6f 6c  cod_com IN (a.ol
7370: 64 5f 63 6f 64 5f 63 6f 6d 5f 31 2c 20 61 2e 6f  d_cod_com_1, a.o
7380: 6c 64 5f 63 6f 64 5f 63 6f 6d 5f 32 29 29 0d 0a  ld_cod_com_2))..
7390: 47 52 4f 55 50 20 42 59 20 61 2e 63 6f 64 5f 63  GROUP BY a.cod_c
73a0: 6f 6d 3b 0d 0a 0d 0a 44 45 54 41 43 48 20 44 41  om;....DETACH DA
73b0: 54 41 42 41 53 45 20 69 73 74 61 74 3b 0d 0a 3c  TABASE istat;..<
73c0: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 6f 6c 3e  /verbatim>..<ol>
73d0: 0d 0a 3c 6c 69 3e 77 65 27 6c 6c 20 3c 69 3e 61  ..<li>we'll <i>a
73e0: 74 74 61 63 68 3c 2f 69 3e 20 79 65 74 20 61 6e  ttach</i> yet an
73f0: 6f 74 68 65 72 20 74 69 6d 65 20 74 68 65 20 69  other time the i
7400: 6e 69 74 69 61 6c 20 3c 62 3e 74 75 73 63 61 6e  nitial <b>tuscan
7410: 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71  y-census-2011.sq
7420: 6c 69 74 65 3c 2f 62 3e 20 44 42 2d 66 69 6c 65  lite</b> DB-file
7430: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 77 65 27 6c  .</li>..<li>we'l
7440: 6c 20 63 72 65 61 74 65 20 61 20 6e 65 77 20 3c  l create a new <
7450: 62 3e 63 6f 6d 32 30 31 35 3c 2f 62 3e 20 74 61  b>com2015</b> ta
7460: 62 6c 65 20 62 79 20 6a 75 73 74 20 6a 75 73 74  ble by just just
7470: 20 63 6f 70 79 69 6e 67 20 74 68 65 20 3c 62 3e   copying the <b>
7480: 69 73 74 61 74 2e 70 6f 70 5f 63 6f 6d 5f 32 30  istat.pop_com_20
7490: 31 31 3c 2f 62 3e 20 56 69 65 77 2e 3c 2f 6c 69  11</b> View.</li
74a0: 3e 0d 0a 3c 6c 69 3e 61 6e 64 20 66 69 6e 61 6c  >..<li>and final
74b0: 6c 79 20 77 65 27 6c 6c 20 61 70 70 65 6e 64 20  ly we'll append 
74c0: 74 6f 20 74 68 65 20 73 61 6d 65 20 74 61 62 6c  to the same tabl
74d0: 65 20 74 68 65 20 6e 65 77 20 4d 75 6e 69 63 69  e the new Munici
74e0: 70 61 6c 69 74 69 65 73 20 66 72 6f 6d 20 74 68  palities from th
74f0: 65 20 3c 62 3e 69 73 74 61 74 2e 63 6f 6d 5f 32  e <b>istat.com_2
7500: 30 31 34 5f 31 35 3c 2f 62 3e 20 74 61 62 6c 65  014_15</b> table
7510: 3b 20 64 75 72 69 6e 67 20 74 68 69 73 20 73 74  ; during this st
7520: 65 70 20 77 65 27 6c 6c 20 63 6f 6d 70 75 74 65  ep we'll compute
7530: 20 74 68 65 20 50 6f 70 75 6c 61 74 69 6f 6e 20   the Population 
7540: 32 30 31 31 20 63 65 6e 73 75 73 20 76 61 6c 75  2011 census valu
7550: 65 73 2e 3c 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65  es.<br>..<u>Note
7560: 3c 2f 75 3e 3a 20 61 66 74 65 72 20 63 6f 6d 70  </u>: after comp
7570: 6c 65 74 69 6e 67 20 74 68 65 20 61 62 6f 76 65  leting the above
7580: 20 73 74 65 70 73 20 6e 6f 77 20 74 68 65 20 3c   steps now the <
7590: 62 3e 63 6f 6d 32 30 31 35 3c 2f 62 3e 20 74 61  b>com2015</b> ta
75a0: 62 6c 65 20 63 6f 6e 74 61 69 6e 73 20 62 6f 74  ble contains bot
75b0: 68 20 73 75 70 70 72 65 73 73 65 64 20 61 6e 64  h suppressed and
75c0: 20 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74   new Municipalit
75d0: 69 65 73 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 0d  ies</li>..</ol>.
75e0: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c  .<verbatim>..SEL
75f0: 45 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74  ECT TopoGeo_Init
7600: 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75  TopoLayer('censu
7610: 73 32 30 31 31 27 2c 20 4e 55 4c 4c 2c 20 27 63  s2011', NULL, 'c
7620: 6f 6d 32 30 31 35 27 2c 20 27 63 6f 6d 32 30 31  om2015', 'com201
7630: 35 27 29 3b 0d 0a 0d 0a 49 4e 53 45 52 54 20 49  5');....INSERT I
7640: 4e 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74  NTO census2011_t
7650: 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c  opofeatures..SEL
7660: 45 43 54 20 4e 55 4c 4c 2c 20 61 2e 6e 6f 64 65  ECT NULL, a.node
7670: 5f 69 64 2c 20 61 2e 65 64 67 65 5f 69 64 2c 20  _id, a.edge_id, 
7680: 61 2e 66 61 63 65 5f 69 64 2c 20 36 2c 20 61 2e  a.face_id, 6, a.
7690: 66 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73  fid..FROM census
76a0: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
76b0: 73 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e  s AS a..JOIN cen
76c0: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74  sus2011_topofeat
76d0: 75 72 65 73 5f 33 20 41 53 20 62 20 4f 4e 20 28  ures_3 AS b ON (
76e0: 61 2e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d  a.topolayer_id =
76f0: 20 33 20 41 4e 44 20 61 2e 66 69 64 20 3d 20 62   3 AND a.fid = b
7700: 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74  .fid);..</verbat
7710: 69 6d 3e 0d 0a 4e 6f 74 68 69 6e 67 20 72 65 61  im>..Nothing rea
7720: 6c 6c 79 20 69 6e 74 65 72 65 73 74 69 6e 67 20  lly interesting 
7730: 69 6e 20 74 68 69 73 2c 20 62 65 63 61 75 73 65  in this, because
7740: 20 77 65 20 61 6c 72 65 61 64 79 20 70 65 72 66   we already perf
7750: 6f 72 6d 65 64 20 74 68 69 73 20 73 74 65 70 20  ormed this step 
7760: 64 75 72 69 6e 67 20 74 68 65 20 70 72 65 76 69  during the previ
7770: 6f 75 73 20 65 78 65 72 63 69 73 65 2e 20 57 65  ous exercise. We
7780: 27 76 65 20 73 69 6d 70 6c 79 20 69 6e 69 74 69  've simply initi
7790: 61 6c 69 7a 65 64 20 79 65 74 20 61 6e 6f 74 68  alized yet anoth
77a0: 65 72 20 54 6f 70 6f 4c 61 79 65 72 73 2c 20 61  er TopoLayers, a
77b0: 6e 64 20 77 65 27 76 65 20 63 6f 70 69 65 64 20  nd we've copied 
77c0: 69 6e 74 6f 20 69 74 20 74 68 65 20 73 61 6d 65  into it the same
77d0: 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 64 65   TopoFeatures de
77e0: 66 69 6e 69 74 69 6f 6e 73 20 61 6c 72 65 61 64  finitions alread
77f0: 79 20 73 75 70 70 6f 72 74 69 6e 67 20 32 30 31  y supporting 201
7800: 31 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73  1 Municipalities
7810: 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 55  ...<verbatim>..U
7820: 50 44 41 54 45 20 63 65 6e 73 75 73 32 30 31 31  PDATE census2011
7830: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53  _topofeatures..S
7840: 45 54 20 66 69 64 20 3d 20 28 53 45 4c 45 43 54  ET fid = (SELECT
7850: 20 66 69 64 20 46 52 4f 4d 20 63 65 6e 73 75 73   fid FROM census
7860: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65  2011_topofeature
7870: 73 5f 36 20 57 48 45 52 45 20 63 6f 64 5f 63 6f  s_6 WHERE cod_co
7880: 6d 20 3d 20 35 31 30 34 30 29 0d 0a 57 48 45 52  m = 51040)..WHER
7890: 45 20 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d  E topolayer_id =
78a0: 20 36 20 41 4e 44 20 66 69 64 20 49 4e 20 28 53   6 AND fid IN (S
78b0: 45 4c 45 43 54 20 66 69 64 20 46 52 4f 4d 20 63  ELECT fid FROM c
78c0: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65  ensus2011_topofe
78d0: 61 74 75 72 65 73 5f 36 20 57 48 45 52 45 20 63  atures_6 WHERE c
78e0: 6f 64 5f 63 6f 6d 20 69 6e 20 28 35 31 30 30 39  od_com in (51009
78f0: 2c 20 35 31 30 32 39 29 29 3b 0d 0a 0d 0a 55 50  , 51029));....UP
7900: 44 41 54 45 20 63 65 6e 73 75 73 32 30 31 31 5f  DATE census2011_
7910: 74 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45  topofeatures..SE
7920: 54 20 66 69 64 20 3d 20 28 53 45 4c 45 43 54 20  T fid = (SELECT 
7930: 66 69 64 20 46 52 4f 4d 20 63 65 6e 73 75 73 32  fid FROM census2
7940: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73  011_topofeatures
7950: 5f 36 20 57 48 45 52 45 20 63 6f 64 5f 63 6f 6d  _6 WHERE cod_com
7960: 20 3d 20 35 31 30 34 31 29 0d 0a 57 48 45 52 45   = 51041)..WHERE
7970: 20 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20   topolayer_id = 
7980: 36 20 41 4e 44 20 66 69 64 20 49 4e 20 28 53 45  6 AND fid IN (SE
7990: 4c 45 43 54 20 66 69 64 20 46 52 4f 4d 20 63 65  LECT fid FROM ce
79a0: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61  nsus2011_topofea
79b0: 74 75 72 65 73 5f 36 20 57 48 45 52 45 20 63 6f  tures_6 WHERE co
79c0: 64 5f 63 6f 6d 20 69 6e 20 28 35 31 30 33 32 2c  d_com in (51032,
79d0: 20 35 31 30 33 36 29 29 3b 0d 0a 3c 2f 76 65 72   51036));..</ver
79e0: 62 61 74 69 6d 3e 0d 0a 4e 6f 77 20 77 65 27 76  batim>..Now we'v
79f0: 65 20 73 69 6d 70 6c 79 20 75 70 64 61 74 65 64  e simply updated
7a00: 20 61 6c 6c 20 72 65 6c 61 74 69 6f 6e 73 68 69   all relationshi
7a10: 70 73 20 62 65 74 77 65 65 6e 20 54 6f 70 6f 6c  ps between Topol
7a20: 6f 67 79 20 46 61 63 65 73 20 61 6e 64 20 54 6f  ogy Faces and To
7a30: 70 6f 46 65 61 74 75 72 65 73 20 62 79 20 74 72  poFeatures by tr
7a40: 61 6e 73 66 65 72 72 69 6e 67 20 74 68 65 6d 20  ansferring them 
7a50: 66 72 6f 6d 20 3c 62 3e 35 31 30 30 39 20 3c 69  from <b>51009 <i
7a60: 3e 43 61 73 74 65 6c 66 72 61 6e 63 6f 20 64 69  >Castelfranco di
7a70: 20 53 6f 70 72 61 3c 2f 69 3e 3c 2f 62 3e 20 61   Sopra</i></b> a
7a80: 6e 64 20 3c 62 3e 35 31 30 32 39 20 3c 69 3e 50  nd <b>51029 <i>P
7a90: 69 61 6e 20 64 69 20 53 63 6f 3c 2f 69 3e 3c 2f  ian di Sco</i></
7aa0: 62 3e 20 74 6f 20 3c 62 3e 35 31 30 34 35 20 3c  b> to <b>51045 <
7ab0: 69 3e 43 61 73 74 65 6c 66 72 61 6e 63 6f 20 50  i>Castelfranco P
7ac0: 69 61 6e 64 69 73 63 c3 b2 3c 2f 69 3e 3c 2f 62  iandisc..</i></b
7ad0: 3e 2e 20 54 68 65 6e 20 77 65 27 76 65 20 72 65  >. Then we've re
7ae0: 70 6c 69 65 64 20 74 68 65 20 73 61 6d 65 20 61  plied the same a
7af0: 63 74 69 6f 6e 2e 66 72 6f 6d 20 3c 62 3e 35 31  ction.from <b>51
7b00: 30 33 32 20 3c 69 3e 50 72 61 74 6f 76 65 63 63  032 <i>Pratovecc
7b10: 68 69 6f 3c 2f 69 3e 3c 2f 62 3e 20 61 6e 64 20  hio</i></b> and 
7b20: 3c 62 3e 35 31 30 34 31 20 3c 69 3e 53 74 69 61  <b>51041 <i>Stia
7b30: 3c 2f 69 3e 3c 2f 62 3e 20 74 6f 20 3c 62 3e 35  </i></b> to <b>5
7b40: 31 30 34 31 20 3c 69 3e 50 72 61 74 6f 76 65 63  1041 <i>Pratovec
7b50: 63 68 69 6f 20 53 74 69 61 3c 2f 69 3e 3c 2f 62  chio Stia</i></b
7b60: 3e 20 73 6f 20 74 6f 20 63 6f 72 72 65 63 74 6c  > so to correctl
7b70: 79 20 75 70 64 61 74 65 20 61 6c 6c 20 6e 65 77  y update all new
7b80: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20   Municipalities 
7b90: 69 6e 74 65 72 65 73 74 69 6e 67 20 74 68 65 20  interesting the 
7ba0: 50 72 6f 76 69 6e 63 65 20 6f 66 20 41 72 65 7a  Province of Arez
7bb0: 7a 6f 2e 3c 62 72 3e 0d 0a 59 6f 75 20 63 6f 75  zo.<br>..You cou
7bc0: 6c 64 20 65 76 65 6e 74 75 61 6c 6c 79 20 63 6f  ld eventually co
7bd0: 6e 74 69 6e 75 65 20 62 79 20 79 6f 75 72 73 65  ntinue by yourse
7be0: 6c 66 20 73 6f 20 74 6f 20 75 70 64 61 74 65 20  lf so to update 
7bf0: 61 6c 6c 20 50 72 6f 76 69 6e 63 65 73 2e 20 0d  all Provinces. .
7c00: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c  .<verbatim>..SEL
7c10: 45 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f  ECT TopoGeo_Expo
7c20: 72 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e  rtTopoLayer('cen
7c30: 73 75 73 32 30 31 31 27 2c 20 27 63 6f 6d 32 30  sus2011', 'com20
7c40: 31 35 27 2c 20 27 6f 75 74 5f 63 6f 6d 5f 61 72  15', 'out_com_ar
7c50: 5f 32 30 31 35 27 2c 20 31 2c 20 31 29 3b 0d 0a  _2015', 1, 1);..
7c60: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f  ..SELECT TopoGeo
7c70: 5f 49 6e 73 65 72 74 46 65 61 74 75 72 65 46 72  _InsertFeatureFr
7c80: 6f 6d 54 6f 70 6f 4c 61 79 65 72 20 28 27 63 65  omTopoLayer ('ce
7c90: 6e 73 75 73 32 30 31 31 27 2c 20 27 63 6f 6d 32  nsus2011', 'com2
7ca0: 30 31 35 27 2c 20 27 6f 75 74 5f 63 6f 6d 5f 61  015', 'out_com_a
7cb0: 72 5f 32 30 31 35 27 2c 20 66 69 64 29 0d 0a 46  r_2015', fid)..F
7cc0: 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74  ROM census2011_t
7cd0: 6f 70 6f 66 65 61 74 75 72 65 73 5f 36 0d 0a 57  opofeatures_6..W
7ce0: 48 45 52 45 20 63 6f 64 5f 70 72 6f 76 20 3d 20  HERE cod_prov = 
7cf0: 35 31 20 41 4e 44 20 63 6f 64 5f 63 6f 6d 20 4e  51 AND cod_com N
7d00: 4f 54 20 49 4e 20 28 35 31 30 30 39 2c 20 35 31  OT IN (51009, 51
7d10: 30 32 39 2c 20 35 31 30 33 32 2c 20 35 31 30 33  029, 51032, 5103
7d20: 36 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  6);..</verbatim>
7d30: 0d 0a 46 69 6e 61 6c 6c 79 20 77 65 27 6c 6c 20  ..Finally we'll 
7d40: 65 78 70 6f 72 74 20 61 20 6e 65 77 20 6c 61 79  export a new lay
7d50: 65 72 20 72 65 70 72 65 73 65 6e 74 69 6e 67 20  er representing 
7d60: 74 68 65 20 75 70 64 61 74 65 64 20 32 30 31 35  the updated 2015
7d70: 20 50 72 6f 76 69 6e 63 65 20 6f 66 20 41 72 65   Province of Are
7d80: 7a 7a 6f 2e 3c 62 72 3e 0d 0a 54 68 69 73 20 74  zzo.<br>..This t
7d90: 69 6d 65 20 77 65 27 6c 6c 20 69 6e 76 6f 6b 65  ime we'll invoke
7da0: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 45 78 70 6f   <b>TopoGeo_Expo
7db0: 72 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62  rtTopoLayer()</b
7dc0: 3e 20 62 79 20 73 70 65 63 69 66 79 69 6e 67 20  > by specifying 
7dd0: 74 68 65 20 3c 62 3e 3c 69 3e 63 72 65 61 74 65  the <b><i>create
7de0: 2d 6f 6e 6c 79 3c 2f 69 3e 3c 2f 62 3e 20 73 70  -only</i></b> sp
7df0: 65 63 69 61 6c 20 6f 70 74 69 6f 6e 2c 20 61 6e  ecial option, an
7e00: 64 20 74 68 65 6e 20 77 65 27 6c 6c 20 75 73 65  d then we'll use
7e10: 20 74 68 65 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f   the <b>TopoGeo_
7e20: 49 6e 73 65 72 74 46 65 61 74 75 72 65 46 72 6f  InsertFeatureFro
7e30: 6d 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e  mTopoLayer()</b>
7e40: 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 69 6e   SQL function in
7e50: 20 6f 72 64 65 72 20 74 6f 20 73 65 6c 65 63 74   order to select
7e60: 69 76 65 6c 79 20 65 78 70 6f 72 74 20 6f 6e 6c  ively export onl
7e70: 79 20 61 20 6c 69 6d 69 74 65 64 20 73 75 62 73  y a limited subs
7e80: 65 74 20 66 72 6f 6d 20 74 68 65 20 6f 76 65 72  et from the over
7e90: 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 65 73  all TopoFeatures
7ea0: 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c  .<br><br>..<tabl
7eb0: 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63  e cellspan="4" c
7ec0: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62  ellpadding="6" b
7ed0: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22  gcolor="#f8f8f0"
7ee0: 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74   border="1">..<t
7ef0: 72 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63  r><td>..<img src
7f00: 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61  ="https://www.ga
7f10: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
7f20: 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70  ins/topofigs/top
7f30: 6f 2d 61 72 2d 32 30 31 31 2e 70 6e 67 22 20 61  o-ar-2011.png" a
7f40: 6c 74 3d 22 74 6f 70 6f 2d 61 72 2d 32 30 31 31  lt="topo-ar-2011
7f50: 22 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c  ">..</td><td>..<
7f60: 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f  img src="https:/
7f70: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74  /www.gaia-gis.it
7f80: 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66  /gaia-sins/topof
7f90: 69 67 73 2f 74 6f 70 6f 2d 61 72 2d 32 30 31 35  igs/topo-ar-2015
7fa0: 2e 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f 2d  .png" alt="topo-
7fb0: 61 72 2d 32 30 31 35 22 3e 0d 0a 3c 2f 74 64 3e  ar-2015">..</td>
7fc0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61  </tr>..<tr><td a
7fd0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 4d 75  lign="center">Mu
7fe0: 6e 69 63 69 70 61 6c 69 74 69 65 73 20 69 6e 20  nicipalities in 
7ff0: 74 68 65 20 50 72 6f 76 69 6e 63 65 20 6f 66 20  the Province of 
8000: 41 72 65 7a 7a 6f 3a 20 3c 62 3e 32 30 31 31 3c  Arezzo: <b>2011<
8010: 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67  /b></td><td alig
8020: 6e 3d 22 63 65 6e 74 65 72 22 3e 4d 75 6e 69 63  n="center">Munic
8030: 69 70 61 6c 69 74 69 65 73 20 69 6e 20 74 68 65  ipalities in the
8040: 20 50 72 6f 76 69 6e 63 65 20 6f 66 20 41 72 65   Province of Are
8050: 7a 7a 6f 3a 20 3c 62 3e 32 30 31 35 3c 2f 62 3e  zzo: <b>2015</b>
8060: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61  </td></tr>..</ta
8070: 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a  ble><br>..<hr>..
8080: 3c 2f 64 69 76 3e 0d 0a 3c 74 61 62 6c 65 20 77  </div>..<table w
8090: 69 64 74 68 3d 22 31 30 30 25 22 3e 3c 74 72 3e  idth="100%"><tr>
80a0: 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 25  ..<td width="33%
80b0: 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e 3c  " align="left"><
80c0: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f  a href="https://
80d0: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f  www.gaia-gis.it/
80e0: 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61  fossil/libspatia
80f0: 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 74  lite/wiki?name=t
8100: 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 69 61 74 65  opo-intermediate
8110: 22 3e 70 72 65 76 69 6f 75 73 20 70 61 67 65 3c  ">previous page<
8120: 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 61 6c  /a></td>..<td al
8130: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 61 20  ign="center"><a 
8140: 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77  href="https://ww
8150: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f  w.gaia-gis.it/fo
8160: 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69  ssil/libspatiali
8170: 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 49 53 4f  te/wiki?name=ISO
8180: 2b 54 6f 70 6f 6c 6f 67 79 22 3e 62 61 63 6b 20  +Topology">back 
8190: 74 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f 74 64  to index</a></td
81a0: 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33  >..<td width="33
81b0: 25 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  %" align="right"
81c0: 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74  ></td>..</tr></t
81d0: 61 62 6c 65 3e 0a 5a 20 31 62 39 39 65 38 64 64  able>.Z 1b99e8dd
81e0: 31 35 62 63 36 34 37 61 66 32 65 66 34 61 30 37  15bc647af2ef4a07
81f0: 65 32 63 32 35 33 64 33 0a                       e2c253d3.