Wiki page
[topo-advanced] by
sandro
2015-12-21 08:14:44.
0000: 44 20 32 30 31 35 2d 31 32 2d 32 31 54 30 38 3a D 2015-12-21T08:
0010: 31 34 3a 34 34 2e 39 32 37 0a 4c 20 74 6f 70 6f 14:44.927.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 39 36 62 39 -advanced.P 96b9
0030: 38 63 39 65 39 36 66 64 38 32 39 33 35 39 65 32 8c9e96fd829359e2
0040: 65 38 31 61 66 66 38 66 63 37 33 31 30 37 36 62 e81aff8fc731076b
0050: 62 30 31 66 0a 55 20 73 61 6e 64 72 6f 0a 57 20 b01f.U sandro.W
0060: 33 33 32 35 31 0a 3c 74 61 62 6c 65 20 63 65 6c 33251.<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 2c 20 70 72 61 63 74 2>a quick, pract
1640: 69 63 61 6c 20 65 78 65 72 63 69 73 65 3c 2f 68 ical exercise</h
1650: 32 3e 0d 0a 52 65 71 75 69 72 65 6d 65 6e 74 73 2>..Requirements
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 74 68 65 20 79 ted during the y
1a30: 65 61 72 73 20 32 30 31 34 2f 31 35 2c 20 74 68 ears 2014/15, th
1a40: 72 6f 75 67 68 20 74 68 65 20 6d 65 72 67 69 6e rough the mergin
1a50: 67 20 6f 66 20 70 72 65 2d 65 78 69 73 74 69 6e g of pre-existin
1a60: 67 20 73 6d 61 6c 6c 65 72 20 4d 75 6e 69 63 69 g smaller Munici
1a70: 70 61 6c 69 74 69 65 73 2e 3c 2f 6c 69 3e 0d 0a palities.</li>..
1a80: 3c 6c 69 3e 3c 62 3e 70 72 6f 76 5f 32 30 31 31 <li><b>prov_2011
1a90: 3c 2f 62 3e 3a 20 54 75 73 63 61 6e 79 20 50 72 </b>: Tuscany Pr
1aa0: 6f 76 69 6e 63 65 73 20 2f 20 43 6f 75 6e 74 69 ovinces / Counti
1ab0: 65 73 20 28 64 65 66 69 6e 65 64 20 61 73 20 61 es (defined as a
1ac0: 6e 20 61 67 67 72 65 67 61 74 69 6f 6e 20 6f 66 n aggregation of
1ad0: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 29 Municipalities)
1ae0: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 72 .</li>..<li><b>r
1af0: 65 67 5f 32 30 31 31 3c 2f 62 3e 3a 20 54 75 73 eg_2011</b>: Tus
1b00: 63 61 6e 79 20 52 65 67 69 6f 6e 20 28 64 65 66 cany Region (def
1b10: 69 6e 65 64 20 61 73 20 61 6e 20 61 67 67 72 65 ined as an aggre
1b20: 67 61 74 69 6f 6e 20 6f 66 20 50 72 6f 76 69 6e gation of Provin
1b30: 63 65 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e ces).</li>..<li>
1b40: 6f 6e 6c 79 20 74 68 65 20 74 61 62 6c 65 20 3c only the table <
1b50: 62 3e 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 b>census_2011</b
1b60: 3e 20 68 61 73 20 67 65 6f 6d 65 74 72 69 65 73 > has geometries
1b70: 3b 20 6f 74 68 65 72 20 61 64 6d 69 6e 69 73 74 ; other administ
1b80: 72 61 74 69 6f 6e 20 6c 65 76 65 6c 73 20 61 72 ration levels ar
1b90: 65 20 64 65 66 69 6e 65 64 20 62 79 20 72 65 6c e defined by rel
1ba0: 61 74 69 6f 6e 20 63 6f 64 65 73 2e 3c 2f 6c 69 ation codes.</li
1bb0: 3e 0d 0a 3c 6c 69 3e 3c 75 3e 41 74 74 65 6e 74 >..<li><u>Attent
1bc0: 69 6f 6e 3c 2f 75 3e 3a 20 64 75 72 69 6e 67 20 ion</u>: during
1bd0: 74 68 69 73 20 73 61 6d 70 6c 65 20 28 61 73 20 this sample (as
1be0: 69 6e 20 6f 74 68 65 72 73 29 2c 20 77 65 20 77 in others), we w
1bf0: 69 6c 6c 20 3c 62 3e 6e 65 76 65 72 3c 2f 62 3e ill <b>never</b>
1c00: 20 64 69 72 65 63 74 6c 79 20 6f 70 65 6e 20 74 directly open t
1c10: 68 69 73 20 64 61 74 61 62 61 73 65 2c 20 62 75 his database, bu
1c20: 74 20 6f 6e 6c 79 20 61 74 74 61 63 68 20 69 74 t only attach it
1c30: 20 74 6f 20 74 68 65 20 64 61 74 61 62 61 73 65 to the database
1c40: 20 77 65 20 61 72 65 20 63 72 65 61 74 69 6e 67 we are creating
1c50: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c .</li>..</ul></l
1c60: 69 3e 0d 0a 3c 6c 69 3e 75 6e 63 6f 6d 70 72 65 i>..<li>uncompre
1c70: 73 73 20 74 68 65 20 64 6f 77 6e 6c 6f 61 64 65 ss the downloade
1c80: 64 20 64 62 2d 66 69 6c 65 20 28 3c 62 3e 3c 69 d db-file (<b><i
1c90: 3e 74 75 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d >tuscany-census-
1ca0: 32 30 31 31 2e 73 71 6c 69 74 65 3c 2f 69 3e 3c 2011.sqlite</i><
1cb0: 2f 62 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e /b>).</li>..<li>
1cc0: 6e 6f 77 20 73 74 61 72 74 20 61 20 53 70 61 74 now start a Spat
1cd0: 69 61 4c 69 74 65 20 73 65 73 73 69 6f 6e 20 75 iaLite session u
1ce0: 73 69 6e 67 20 79 6f 75 72 20 70 72 65 66 65 72 sing your prefer
1cf0: 72 65 64 20 53 70 61 74 69 61 4c 69 74 65 20 66 red SpatiaLite f
1d00: 72 6f 6e 74 20 65 6e 64 20 74 6f 6f 6c 3a 0d 0a ront end tool:..
1d10: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 43 6f 6e 6e 65 63 <ul>..<li>Connec
1d20: 74 20 74 6f 20 61 20 6e 65 77 20 28 65 6d 70 74 t to a new (empt
1d30: 79 29 20 44 42 2d 66 69 6c 65 20 6e 61 6d 65 64 y) DB-file named
1d40: 20 3c 62 3e 3c 69 3e 74 75 73 63 61 6e 79 2d 63 <b><i>tuscany-c
1d50: 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 74 ensus-2011.sqlit
1d60: 65 3c 2f 69 3e 3c 2f 62 3e 2c 20 74 6f 20 77 68 e</i></b>, to wh
1d70: 69 63 68 20 3c 62 3e 74 75 73 63 61 6e 79 2d 74 ich <b>tuscany-t
1d80: 6f 70 6f 2d 32 30 31 31 2e 73 71 6c 69 74 65 3c opo-2011.sqlite<
1d90: 2f 62 3e 20 77 69 6c 6c 20 62 65 20 61 74 74 61 /b> will be atta
1da0: 63 68 65 64 20 74 6f 2e 3c 2f 6c 69 3e 0d 0a 3c ched to.</li>..<
1db0: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e /ul></li>..</ol>
1dc0: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 ..<verbatim>..SE
1dd0: 4c 45 43 54 20 43 72 65 61 74 65 54 6f 70 6f 6c LECT CreateTopol
1de0: 6f 67 79 28 27 63 65 6e 73 75 73 32 30 31 31 27 ogy('census2011'
1df0: 2c 20 33 32 36 33 32 2c 20 30 2c 20 30 29 3b 0d , 32632, 0, 0);.
1e00: 0a 31 0d 0a 0d 0a 41 54 54 41 43 48 20 44 41 54 .1....ATTACH DAT
1e10: 41 42 41 53 45 20 22 2e 2f 74 75 73 63 61 6e 79 ABASE "./tuscany
1e20: 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c -census-2011.sql
1e30: 69 74 65 22 20 41 53 20 69 73 74 61 74 3b 0d 0a ite" AS istat;..
1e40: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f ..SELECT TopoGeo
1e50: 5f 46 72 6f 6d 47 65 6f 54 61 62 6c 65 28 27 63 _FromGeoTable('c
1e60: 65 6e 73 75 73 32 30 31 31 27 2c 20 27 69 73 74 ensus2011', 'ist
1e70: 61 74 27 2c 20 27 63 65 6e 73 75 73 5f 32 30 31 at', 'census_201
1e80: 31 27 2c 20 4e 55 4c 4c 2c 20 30 2c 20 35 31 32 1', NULL, 0, 512
1e90: 2c 20 2d 31 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c , -1);..1....SEL
1ea0: 45 43 54 20 53 54 5f 56 61 6c 69 64 61 74 65 54 ECT ST_ValidateT
1eb0: 6f 70 6f 47 65 6f 28 27 63 65 6e 73 75 73 32 30 opoGeo('census20
1ec0: 31 31 27 29 3b 0d 0a 4e 55 4c 4c 0d 0a 0d 0a 53 11');..NULL....S
1ed0: 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 54 45 4d ELECT * FROM TEM
1ee0: 50 2e 63 65 6e 73 75 73 32 30 31 31 5f 76 61 6c P.census2011_val
1ef0: 69 64 61 74 65 5f 74 6f 70 6f 67 65 6f 3b 0d 0a idate_topogeo;..
1f00: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f ..SELECT TopoGeo
1f10: 5f 43 72 65 61 74 65 54 6f 70 6f 4c 61 79 65 72 _CreateTopoLayer
1f20: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 ('census2011', '
1f30: 69 73 74 61 74 27 2c 20 27 63 65 6e 73 75 73 5f istat', 'census_
1f40: 32 30 31 31 27 2c 20 4e 55 4c 4c 2c 20 27 63 65 2011', NULL, 'ce
1f50: 6e 73 75 73 5f 61 72 65 61 73 27 29 3b 0d 0a 31 nsus_areas');..1
1f60: 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 ....SELECT TopoG
1f70: 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 eo_InitTopoLayer
1f80: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 ('census2011', '
1f90: 69 73 74 61 74 27 2c 20 27 70 6f 70 5f 70 70 6c istat', 'pop_ppl
1fa0: 5f 32 30 31 31 27 2c 20 27 70 70 6c 27 29 3b 0d _2011', 'ppl');.
1fb0: 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70 .1....SELECT Top
1fc0: 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 oGeo_InitTopoLay
1fd0: 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c er('census2011',
1fe0: 20 27 69 73 74 61 74 27 2c 20 27 70 6f 70 5f 63 'istat', 'pop_c
1ff0: 6f 6d 5f 32 30 31 31 27 2c 20 27 63 6f 6d 27 29 om_2011', 'com')
2000: 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 ;..1....SELECT T
2010: 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c opoGeo_InitTopoL
2020: 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 ayer('census2011
2030: 27 2c 20 27 69 73 74 61 74 27 2c 20 27 70 6f 70 ', 'istat', 'pop
2040: 5f 70 72 6f 76 5f 32 30 31 31 27 2c 20 27 70 72 _prov_2011', 'pr
2050: 6f 76 27 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 ov');..1....SELE
2060: 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 CT TopoGeo_InitT
2070: 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 opoLayer('census
2080: 32 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c 20 2011', 'istat',
2090: 27 70 6f 70 5f 72 65 67 5f 32 30 31 31 27 2c 20 'pop_reg_2011',
20a0: 27 72 65 67 27 29 3b 0d 0a 31 0d 0a 0d 0a 44 45 'reg');..1....DE
20b0: 54 41 43 48 20 44 41 54 41 42 41 53 45 20 69 73 TACH DATABASE is
20c0: 74 61 74 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d tat;..</verbatim
20d0: 3e 0d 0a 57 65 27 6c 6c 20 73 74 61 72 74 20 74 >..We'll start t
20e0: 68 69 73 20 70 72 61 63 74 69 63 61 6c 20 74 75 his practical tu
20f0: 74 6f 72 69 61 6c 20 62 79 20 64 75 6c 79 20 72 torial by duly r
2100: 65 70 6c 69 63 61 74 69 6e 67 20 74 68 65 20 73 eplicating the s
2110: 61 6d 65 20 73 74 65 70 73 20 77 65 27 76 65 20 ame steps we've
2120: 61 6c 72 65 61 64 79 20 65 78 61 6d 69 6e 65 64 already examined
2130: 20 69 6e 20 74 68 65 20 70 72 65 76 69 6f 75 73 in the previous
2140: 20 74 75 74 6f 72 69 61 6c 20 69 6e 20 3c 62 3e tutorial in <b>
2150: 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 69 61 74 topo-intermediat
2160: 65 3c 2f 62 3e 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c e</b>:..<ul>..<l
2170: 69 3e 77 65 27 6c 6c 20 63 72 65 61 74 65 20 61 i>we'll create a
2180: 20 6e 65 77 20 32 44 20 54 6f 70 6f 6c 6f 67 79 new 2D Topology
2190: 20 6e 61 6d 65 64 20 3c 62 3e 63 65 6e 73 75 73 named <b>census
21a0: 32 30 31 31 3c 2f 62 3e 20 61 6e 64 20 6c 6f 63 2011</b> and loc
21b0: 61 74 65 64 20 69 6e 74 6f 20 3c 62 3e 53 52 49 ated into <b>SRI
21c0: 44 20 33 32 36 33 32 3c 2f 62 3e 2e 3c 2f 6c 69 D 32632</b>.</li
21d0: 3e 0d 0a 3c 6c 69 3e 74 68 65 6e 20 77 65 27 6c >..<li>then we'l
21e0: 6c 20 3c 69 3e 61 74 74 61 63 68 3c 2f 69 3e 20 l <i>attach</i>
21f0: 74 68 65 20 3c 62 3e 74 75 73 63 61 6e 79 2d 74 the <b>tuscany-t
2200: 6f 70 6f 2d 32 30 31 31 2e 73 71 6c 69 74 65 3c opo-2011.sqlite<
2210: 2f 62 3e 20 65 78 74 65 72 6e 61 6c 20 44 42 2d /b> external DB-
2220: 66 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e file.</li>..<li>
2230: 61 66 74 65 72 2d 77 68 69 63 68 20 77 65 27 6c after-which we'l
2240: 6c 20 70 6f 70 75 6c 61 74 65 20 74 68 65 20 3c l populate the <
2250: 62 3e 63 65 6e 73 75 73 32 30 31 31 3c 2f 62 3e b>census2011</b>
2260: 20 54 6f 70 6f 6c 6f 67 79 20 62 79 20 69 6d 70 Topology by imp
2270: 6f 72 74 69 6e 67 20 74 68 65 20 3c 62 3e 69 73 orting the <b>is
2280: 74 61 74 2e 63 65 6e 73 75 73 5f 32 30 31 31 3c tat.census_2011<
2290: 2f 62 3e 20 47 65 6f 54 61 62 6c 65 2e 3c 2f 6c /b> GeoTable.</l
22a0: 69 3e 0d 0a 3c 6c 69 3e 41 73 20 66 69 6e 61 6c i>..<li>As final
22b0: 20 74 61 73 6b 20 77 65 27 6c 6c 20 63 68 65 63 task we'll chec
22c0: 6b 20 69 66 20 74 68 69 73 20 54 6f 70 6f 6c 6f k if this Topolo
22d0: 67 79 20 69 73 20 66 75 6c 6c 79 20 76 61 6c 69 gy is fully vali
22e0: 64 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 d.</li>..</ul><b
22f0: 72 3e 0d 0a 41 66 74 65 72 20 74 68 65 73 65 20 r>..After these
2300: 70 72 65 70 61 72 61 74 69 6f 6e 73 20 68 61 76 preparations hav
2310: 65 20 62 65 65 6e 20 63 6f 6d 70 6c 65 74 65 64 e been completed
2320: 2c 20 77 65 20 61 72 65 20 72 65 61 64 79 20 74 , we are ready t
2330: 6f 20 73 74 61 72 74 20 64 65 66 69 6e 69 6e 67 o start defining
2340: 20 61 6c 6c 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 all <b>TopoLaye
2350: 72 73 3c 2f 62 3e 20 62 61 73 65 64 20 6f 6e 20 rs</b> based on
2360: 74 68 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 the <b>census201
2370: 31 3c 2f 62 3e 20 54 6f 70 6f 6c 6f 67 79 3b 20 1</b> Topology;
2380: 65 61 63 68 20 73 69 6e 67 6c 65 20 54 6f 70 6f each single Topo
2390: 4c 61 79 65 72 20 77 69 6c 6c 20 70 72 65 63 69 Layer will preci
23a0: 73 65 6c 79 20 72 65 70 72 65 73 65 6e 74 20 73 sely represent s
23b0: 6f 6d 65 20 61 64 6d 69 6e 69 73 74 72 61 74 69 ome administrati
23c0: 76 65 20 6c 65 76 65 6c 2c 20 61 6e 64 20 61 6c ve level, and al
23d0: 6c 20 54 6f 70 6f 4c 61 79 65 72 73 20 61 6c 74 l TopoLayers alt
23e0: 6f 67 65 74 68 65 72 20 77 69 6c 6c 20 63 6f 6d ogether will com
23f0: 70 6c 65 74 65 6c 79 20 72 65 70 72 65 73 65 6e pletely represen
2400: 74 20 74 68 65 20 77 68 6f 6c 65 20 54 75 73 63 t the whole Tusc
2410: 61 6e 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 an administrativ
2420: 65 20 68 69 65 72 61 72 63 68 79 2e 0d 0a 3c 6f e hierarchy...<o
2430: 6c 3e 0d 0a 3c 6c 69 3e 46 69 72 73 74 20 69 6e l>..<li>First in
2440: 76 6f 6b 65 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f voke <b>TopoGeo_
2450: 43 72 65 61 74 65 54 6f 70 6f 4c 61 79 65 72 28 CreateTopoLayer(
2460: 29 3c 2f 62 3e 20 69 6e 20 6f 72 64 65 72 20 74 )</b> in order t
2470: 6f 20 63 6f 6d 70 6c 65 74 65 6c 79 20 64 65 66 o completely def
2480: 69 6e 65 20 61 20 66 69 72 73 74 20 54 6f 70 6f ine a first Topo
2490: 4c 61 79 65 72 20 72 65 70 72 65 73 65 6e 74 69 Layer representi
24a0: 6e 67 20 3c 62 3e 43 65 6e 73 75 73 20 41 72 65 ng <b>Census Are
24b0: 61 73 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e as</b>.<br>..<u>
24c0: 52 65 63 61 6c 6c 3c 2f 75 3e 3a 20 74 68 65 20 Recall</u>: the
24d0: 3c 62 3e 69 73 74 61 74 2e 63 65 6e 73 75 73 5f <b>istat.census_
24e0: 32 30 31 31 3c 2f 62 3e 20 69 73 20 61 6e 20 65 2011</b> is an e
24f0: 78 69 73 74 69 6e 67 20 27 3c 62 3e 47 65 6f 54 xisting '<b>GeoT
2500: 61 62 6c 65 3c 2f 62 3e 27 2c 20 62 65 69 6e 67 able</b>', being
2510: 20 75 73 65 64 20 61 73 20 6f 75 72 20 69 6e 69 used as our ini
2520: 74 69 61 6c 20 64 61 74 61 73 65 74 2c 20 73 69 tial dataset, si
2530: 6e 63 65 20 69 74 20 61 6c 72 65 61 64 79 20 63 nce it already c
2540: 6f 6e 74 61 69 6e 73 20 62 6f 74 68 20 74 68 65 ontains both the
2550: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 information att
2560: 72 69 62 75 74 65 73 20 61 6e 64 20 67 65 6f 6d ributes and geom
2570: 65 74 72 69 65 73 20 6e 65 65 64 65 64 2c 20 66 etries needed, f
2580: 6f 72 20 77 68 69 63 68 20 3c 62 3e 65 61 63 68 or which <b>each
2590: 3c 2f 62 3e 20 27 43 65 6e 73 75 73 20 41 72 65 </b> 'Census Are
25a0: 61 27 20 69 73 20 65 78 70 65 63 74 65 64 20 74 a' is expected t
25b0: 6f 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 6f 20 o correspond to
25c0: 61 20 3c 62 3e 73 69 6e 67 6c 65 3c 2f 62 3e 20 a <b>single</b>
25d0: 54 6f 70 6f 6c 6f 67 79 20 46 61 63 65 2e 20 28 Topology Face. (
25e0: 6c 61 74 65 72 20 77 65 27 6c 6c 20 65 78 61 6d later we'll exam
25f0: 69 6e 65 20 69 6e 20 6d 6f 72 65 20 64 65 70 74 ine in more dept
2600: 68 2c 20 68 6f 77 20 74 68 65 20 54 6f 70 6f 4c h, how the TopoL
2610: 61 79 65 72 20 2f 20 54 6f 70 6f 46 65 61 74 75 ayer / TopoFeatu
2620: 72 65 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 re relationships
2630: 20 68 61 76 65 20 61 63 74 75 61 6c 6c 79 20 62 have actually b
2640: 65 65 6e 20 64 65 66 69 6e 65 64 29 2e 3c 2f 6c een defined).</l
2650: 69 3e 0d 0a 3c 6c 69 3e 74 68 65 6e 20 77 65 27 i>..<li>then we'
2660: 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 62 79 20 64 ll continue by d
2670: 65 66 69 6e 69 6e 67 20 73 65 76 65 72 61 6c 20 efining several
2680: 66 75 72 74 68 65 72 20 54 6f 70 6f 4c 61 79 65 further TopoLaye
2690: 72 73 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 rs corresponding
26a0: 20 74 6f 20 74 68 65 20 3c 62 3e 50 6f 70 75 6c to the <b>Popul
26b0: 61 74 65 64 20 50 6c 61 63 65 73 3c 2f 62 3e 2c ated Places</b>,
26c0: 20 3c 62 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 <b>Municipaliti
26d0: 65 73 3c 2f 62 3e 2c 20 3c 62 3e 50 72 6f 76 69 es</b>, <b>Provi
26e0: 6e 63 65 73 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e nces</b> and <b>
26f0: 52 65 67 69 6f 6e 3c 2f 62 3e 20 61 64 6d 69 6e Region</b> admin
2700: 69 73 74 72 61 74 69 6f 6e 20 6c 65 76 65 6c 73 istration levels
2710: 2e 3c 62 72 3e 0d 0a 3c 75 3e 52 65 63 61 6c 6c .<br>..<u>Recall
2720: 3c 2f 75 3e 3a 20 61 6c 6c 20 74 68 65 73 65 20 </u>: all these
2730: 61 64 6d 69 6e 69 73 74 72 61 74 69 6f 6e 20 6c administration l
2740: 65 76 65 6c 73 20 69 6e 20 74 68 65 20 69 6e 69 evels in the ini
2750: 74 69 61 6c 20 64 61 74 61 73 65 74 20 61 72 65 tial dataset are
2760: 20 73 69 6d 70 6c 79 20 64 65 66 69 6e 65 64 20 simply defined
2770: 62 79 20 72 65 6c 61 74 69 6f 6e 20 63 6f 64 65 by relation code
2780: 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 63 6f s intended to co
2790: 6c 6c 65 63 74 2f 61 67 67 72 65 67 61 74 65 20 llect/aggregate
27a0: 74 68 65 20 6c 6f 77 65 72 20 6c 65 76 65 6c 20 the lower level
27b0: 65 6e 74 69 74 69 65 73 20 77 68 65 72 65 2c 20 entities where,
27c0: 69 6e 20 74 68 69 73 20 63 61 73 65 2c 20 68 61 in this case, ha
27d0: 76 65 20 6e 6f 20 67 65 6f 6d 65 74 72 69 65 73 ve no geometries
27e0: 20 61 74 20 61 6c 6c 2e 20 42 65 69 6e 67 20 73 at all. Being s
27f0: 6f 2c 20 77 65 20 63 61 6e 6e 6f 74 20 63 72 65 o, we cannot cre
2800: 61 74 65 20 61 20 66 75 6c 6c 79 20 64 65 66 69 ate a fully defi
2810: 6e 65 64 20 54 6f 70 6f 4c 61 79 65 72 20 62 79 ned TopoLayer by
2820: 20 63 61 6c 6c 69 6e 67 20 3c 62 3e 54 6f 70 6f calling <b>Topo
2830: 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f 6c 61 Geo_CreateTopola
2840: 79 65 72 28 29 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a yer()</b>.<br>..
2850: 42 79 20 69 6e 76 6f 6b 69 6e 67 20 3c 62 3e 54 By invoking <b>T
2860: 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c opoGeo_InitTopoL
2870: 61 79 65 72 28 29 3c 2f 62 3e 20 6f 6e 6c 79 20 ayer()</b> only
2880: 61 20 70 61 72 74 69 61 6c 6c 79 20 64 65 66 69 a partially defi
2890: 6e 65 64 20 54 6f 70 6f 4c 61 79 65 72 20 77 69 ned TopoLayer wi
28a0: 6c 6c 20 69 6e 69 74 69 61 6c 69 7a 65 64 2c 20 ll initialized,
28b0: 62 75 74 20 77 68 69 63 68 20 77 69 6c 6c 20 62 but which will b
28c0: 65 20 63 6f 6d 70 6c 65 6d 65 6e 74 20 6c 61 74 e complement lat
28d0: 65 72 20 61 6e 79 20 6d 69 73 73 69 6e 67 20 69 er any missing i
28e0: 6e 66 6f 72 6d 61 74 69 6f 6e 20 2d 20 74 68 75 nformation - thu
28f0: 73 20 61 63 68 69 65 76 69 6e 67 2c 20 77 69 74 s achieving, wit
2900: 68 20 61 20 73 65 63 6f 6e 64 20 73 74 65 70 20 h a second step
2910: 2d 20 61 20 70 72 6f 70 65 72 6c 79 20 77 6f 72 - a properly wor
2920: 6b 69 6e 67 20 54 6f 70 6f 4c 61 79 65 72 20 28 king TopoLayer (
2930: 61 73 20 77 65 27 6c 6c 20 73 65 65 20 6c 61 74 as we'll see lat
2940: 65 72 20 69 6e 20 66 75 6c 6c 20 64 65 74 61 69 er in full detai
2950: 6c 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 66 69 l).</li>..<li>fi
2960: 6e 61 6c 6c 79 20 77 65 27 6c 6c 20 64 65 74 61 nally we'll deta
2970: 63 68 20 74 68 65 20 6e 6f 20 6c 6f 6e 67 65 72 ch the no longer
2980: 20 6e 65 65 64 65 64 20 65 78 74 65 72 6e 61 6c needed external
2990: 20 64 62 2d 66 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a db-file.</li>..
29a0: 3c 2f 6f 6c 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 </ol>..<hr>..<h3
29b0: 3e 54 6f 70 6f 4c 61 79 65 72 73 20 2f 20 54 6f >TopoLayers / To
29c0: 70 6f 46 65 61 74 75 72 65 73 3a 20 6c 61 79 6f poFeatures: layo
29d0: 75 74 20 6f 66 20 44 42 20 54 61 62 6c 65 73 20 ut of DB Tables
29e0: 61 6e 64 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e and correspondin
29f0: 67 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 3c g relationships<
2a00: 2f 68 33 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c /h3>..<table cel
2a10: 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 63 65 6c lpadding="6" cel
2a20: 6c 73 70 61 63 69 6e 67 3d 22 38 22 3e 0d 0a 3c lspacing="8">..<
2a30: 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e tr><td>..<b><<i>
2a40: 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e topo-prefix</i>>
2a50: 5f 74 6f 70 6f 6c 61 79 65 72 73 3c 2f 62 3e 0d _topolayers</b>.
2a60: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c .<verbatim>..SEL
2a70: 45 43 54 20 2a 20 46 52 4f 4d 20 63 65 6e 73 75 ECT * FROM censu
2a80: 73 32 30 31 31 5f 74 6f 70 6f 6c 61 79 65 72 73 s2011_topolayers
2a90: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a ;..</verbatim>..
2aa0: 54 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 The <b>TopoLayer
2ab0: 73 3c 2f 62 3e 20 74 61 62 6c 65 20 63 6f 6e 74 s</b> table cont
2ac0: 61 69 6e 73 20 61 20 64 69 73 74 69 6e 63 74 20 ains a distinct
2ad0: 72 6f 77 20 66 6f 72 20 65 76 65 72 79 20 54 6f row for every To
2ae0: 70 6f 4c 61 79 65 72 20 64 65 66 69 6e 65 64 20 poLayer defined
2af0: 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 20 54 on the current T
2b00: 6f 70 6f 6c 6f 67 79 2e 3c 62 72 3e 3c 62 72 3e opology.<br><br>
2b10: 0d 0a 45 61 63 68 20 54 6f 70 6f 4c 61 79 65 72 ..Each TopoLayer
2b20: 20 69 73 20 69 64 65 6e 74 69 66 69 65 64 20 62 is identified b
2b30: 79 20 61 6e 20 3c 62 3e 69 64 3c 2f 62 3e 20 61 y an <b>id</b> a
2b40: 6e 64 20 62 79 20 61 20 3c 62 3e 6e 61 6d 65 3c nd by a <b>name<
2b50: 2f 62 3e 3b 20 62 6f 74 68 20 61 72 65 20 72 65 /b>; both are re
2b60: 71 75 69 72 65 64 20 74 6f 20 62 65 20 75 6e 69 quired to be uni
2b70: 71 75 65 20 76 61 6c 75 65 73 2e 0d 0a 3c 2f 74 que values...</t
2b80: 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73 d><td>.."<i>cens
2b90: 75 73 32 30 31 31 5f 74 6f 70 6f 6c 61 79 65 72 us2011_topolayer
2ba0: 73 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 s</i>"..<table c
2bb0: 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c ellspan="4" cell
2bc0: 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f padding="6" bgco
2bd0: 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f lor="#f8f8f0" bo
2be0: 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c rder="1">..<tr><
2bf0: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 td bgcolor="#f0f
2c00: 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 0f8"><b>topolaye
2c10: 72 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c r_id</b></td>..<
2c20: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 td bgcolor="#f0f
2c30: 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 0f8"><b>topolaye
2c40: 72 5f 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 3c r_name</b></td><
2c50: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c /tr>..<tr><td al
2c60: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 ign="right">1</t
2c70: 64 3e 3c 74 64 3e 63 65 6e 73 75 73 5f 61 72 65 d><td>census_are
2c80: 61 73 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 as</td></tr>..<t
2c90: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
2ca0: 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 3e 70 70 ht">2</td><td>pp
2cb0: 6c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 l</td></tr>..<tr
2cc0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
2cd0: 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 3e 63 6f 6d t">3</td><td>com
2ce0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
2cf0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
2d00: 22 3e 34 3c 2f 74 64 3e 3c 74 64 3e 70 72 6f 76 ">4</td><td>prov
2d10: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
2d20: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
2d30: 22 3e 35 3c 2f 74 64 3e 3c 74 64 3e 72 65 67 3c ">5</td><td>reg<
2d40: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 /td></tr>..</tab
2d50: 6c 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d le>..</td></tr>.
2d60: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c .<tr><td>..<b><<
2d70: 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69 i>topo-prefix</i
2d80: 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f >>_topofeatures_
2d90: 3c 3c 69 3e 74 6f 70 6f 6c 61 79 65 72 2d 69 64 <<i>topolayer-id
2da0: 3c 2f 69 3e 3e 3c 2f 62 3e 0d 0a 3c 76 65 72 62 </i>></b>..<verb
2db0: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 2a 20 atim>..SELECT *
2dc0: 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f FROM census2011_
2dd0: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 3b 0d topofeatures_2;.
2de0: 0a 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d ...SELECT * FROM
2df0: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f census2011_topo
2e00: 66 65 61 74 75 72 65 73 5f 34 3b 0d 0a 3c 2f 76 features_4;..</v
2e10: 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 20 73 61 erbatim>..The sa
2e20: 6d 65 20 54 6f 70 6f 6c 6f 67 79 20 63 61 6e 20 me Topology can
2e30: 63 6f 6e 74 61 69 6e 20 6d 6f 72 65 20 74 68 61 contain more tha
2e40: 6e 20 61 20 73 69 6e 67 6c 65 20 3c 62 3e 54 6f n a single <b>To
2e50: 70 6f 46 65 61 74 75 72 65 73 3c 2f 62 3e 20 74 poFeatures</b> t
2e60: 61 62 6c 65 2c 20 61 6e 64 20 65 61 63 68 20 54 able, and each T
2e70: 6f 70 6f 46 65 61 74 75 72 65 73 20 74 61 62 6c opoFeatures tabl
2e80: 65 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f e corresponds to
2e90: 20 61 20 73 69 6e 67 6c 65 20 54 6f 70 6f 4c 61 a single TopoLa
2ea0: 79 65 72 2e 3c 62 72 3e 0d 0a 45 76 65 72 79 20 yer.<br>..Every
2eb0: 74 61 62 6c 65 20 63 61 6e 20 68 61 76 65 20 61 table can have a
2ec0: 20 73 70 65 63 69 66 69 63 20 6c 61 79 6f 75 74 specific layout
2ed0: 20 6f 6e 20 69 74 73 20 6f 77 6e 20 28 73 74 72 on its own (str
2ee0: 69 63 74 6c 79 20 72 65 66 6c 65 63 74 69 6e 67 ictly reflecting
2ef0: 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e the information
2f00: 20 61 74 74 72 69 62 75 74 65 73 20 66 6f 72 20 attributes for
2f10: 65 61 63 68 20 6c 61 79 65 72 29 2c 20 61 6e 79 each layer), any
2f20: 77 61 79 20 61 6c 6c 20 74 68 65 6d 20 77 69 6c way all them wil
2f30: 6c 20 68 61 76 65 20 61 20 3c 62 3e 75 6e 69 71 l have a <b>uniq
2f40: 75 65 20 54 6f 70 6f 46 65 61 74 75 72 65 20 69 ue TopoFeature i
2f50: 64 65 6e 74 69 66 69 65 72 3c 2f 62 3e 20 28 3c dentifier</b> (<
2f60: 62 3e 3c 69 3e 66 69 64 3c 2f 69 3e 3c 2f 62 3e b><i>fid</i></b>
2f70: 29 20 61 63 74 69 6e 67 20 69 6e 20 74 68 65 20 ) acting in the
2f80: 50 72 69 6d 61 72 79 20 4b 65 79 20 72 6f 6c 65 Primary Key role
2f90: 2e 3c 62 72 3e 0d 0a 54 68 65 20 72 65 6c 61 74 .<br>..The relat
2fa0: 69 6f 6e 73 68 69 70 20 62 65 74 77 65 65 6e 20 ionship between
2fb0: 74 61 62 6c 65 20 6e 61 6d 65 73 20 61 6e 64 20 table names and
2fc0: 54 6f 70 6f 4c 61 79 65 72 73 20 69 73 20 65 73 TopoLayers is es
2fd0: 74 61 62 6c 69 73 68 65 64 20 62 79 20 61 70 70 tablished by app
2fe0: 65 6e 64 69 6e 67 20 61 20 6e 75 6d 65 72 69 63 ending a numeric
2ff0: 20 73 75 66 66 69 78 20 74 6f 20 74 68 65 20 63 suffix to the c
3000: 6f 6d 6d 6f 6e 20 6e 61 6d 65 20 74 68 61 74 20 ommon name that
3010: 6d 75 73 74 20 65 78 61 63 74 6c 79 20 6d 61 74 must exactly mat
3020: 63 68 20 74 68 65 20 3c 62 3e 74 6f 70 6f 6c 61 ch the <b>topola
3030: 79 65 72 5f 69 64 3c 2f 62 3e 20 76 61 6c 75 65 yer_id</b> value
3040: 20 64 65 63 6c 61 72 65 64 20 69 6e 20 74 68 65 declared in the
3050: 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f <b>TopoLayers</
3060: 62 3e 20 6d 61 69 6e 20 74 61 62 6c 65 2e 3c 62 b> main table.<b
3070: 72 3e 3c 62 72 3e 0d 0a 41 73 20 69 73 20 73 68 r><br>..As is sh
3080: 6f 77 6e 20 69 6e 20 74 68 69 73 20 65 78 61 6d own in this exam
3090: 70 6c 65 20 74 68 65 20 66 69 72 73 74 20 74 61 ple the first ta
30a0: 62 6c 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 ble <b>census201
30b0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 1_topofeatures_2
30c0: 3c 2f 62 3e 20 28 3c 69 3e 74 6f 70 6f 6c 61 79 </b> (<i>topolay
30d0: 65 72 5f 69 64 3c 2f 69 3e 3d 3c 69 3e 32 3c 2f er_id</i>=<i>2</
30e0: 69 3e 29 20 63 6f 6e 74 61 69 6e 73 20 61 6c 6c i>) contains all
30f0: 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 61 73 TopoFeatures as
3100: 73 6f 63 69 61 74 65 64 20 74 6f 20 74 68 65 20 sociated to the
3110: 54 6f 70 6f 4c 61 79 65 72 20 3c 62 3e 70 70 6c TopoLayer <b>ppl
3120: 3c 2f 62 3e 20 28 3c 69 3e 50 6f 70 75 6c 61 74 </b> (<i>Populat
3130: 65 64 20 50 6c 61 63 65 73 3c 2f 69 3e 29 2e 3c ed Places</i>).<
3140: 62 72 3e 3c 62 72 3e 0d 0a 54 68 65 20 73 65 63 br><br>..The sec
3150: 6f 6e 64 20 74 61 62 6c 65 20 3c 62 3e 63 65 6e ond table <b>cen
3160: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
3170: 75 72 65 73 5f 34 3c 2f 62 3e 20 28 3c 69 3e 74 ures_4</b> (<i>t
3180: 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 69 3e 3d opolayer_id</i>=
3190: 3c 69 3e 34 3c 2f 69 3e 29 20 63 6f 6e 74 61 69 <i>4</i>) contai
31a0: 6e 73 20 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75 ns all TopoFeatu
31b0: 72 65 73 20 61 73 73 6f 63 69 61 74 65 64 20 74 res associated t
31c0: 6f 20 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20 o the TopoLayer
31d0: 3c 62 3e 70 72 6f 76 3c 2f 62 3e 20 28 3c 69 3e <b>prov</b> (<i>
31e0: 50 72 6f 76 69 6e 63 65 73 3c 2f 69 3e 29 2e 0d Provinces</i>)..
31f0: 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e .</td><td>.."<i>
3200: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 census2011_topof
3210: 65 61 74 75 72 65 73 5f 32 3c 2f 69 3e 22 0d 0a eatures_2</i>"..
3220: 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d <table cellspan=
3230: 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d "4" cellpadding=
3240: 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 "6" bgcolor="#f8
3250: 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22 f8f0" border="1"
3260: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f 6c >..<tr><td bgcol
3270: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e or="#f0f0f8"><b>
3280: 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 fid</b></td>..<t
3290: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
32a0: 66 38 22 3e 3c 62 3e 63 6f 64 5f 70 70 6c 3c 2f f8"><b>cod_ppl</
32b0: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 b></td>..<td bgc
32c0: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c olor="#f0f0f8"><
32d0: 62 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 b>cod_com</b></t
32e0: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d d>..<td bgcolor=
32f0: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e 61 6d "#f0f0f8"><b>nam
3300: 65 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 e</b></td>..<td
3310: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 bgcolor="#f0f0f8
3320: 22 3e 3c 62 3e 70 6f 70 5f 32 30 31 31 3c 2f 62 "><b>pop_2011</b
3330: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
3340: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
3350: 3e 6d 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e >m_2011</b></td>
3360: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 ..<td bgcolor="#
3370: 66 30 66 30 66 38 22 3e 3c 62 3e 66 5f 32 30 31 f0f0f8"><b>f_201
3380: 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 1</b></td></tr>.
3390: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 .<tr><td align="
33a0: 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 right">1</td><td
33b0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
33c0: 30 35 31 34 32 37 30 35 3c 2f 74 64 3e 3c 74 64 05142705</td><td
33d0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 align="right">4
33e0: 35 30 30 31 3c 2f 74 64 3e 3c 74 64 3e 41 6c 62 5001</td><td>Alb
33f0: 69 61 6e 6f 20 4d 61 67 72 61 3c 2f 74 64 3e 3c iano Magra</td><
3400: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3410: 3e 31 39 30 37 3c 2f 74 64 3e 3c 74 64 20 61 6c >1907</td><td al
3420: 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 31 39 3c ign="right">919<
3430: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3440: 69 67 68 74 22 3e 39 38 38 3c 2f 74 64 3e 3c 2f ight">988</td></
3450: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 tr>..<tr><td ali
3460: 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 gn="right">2</td
3470: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3480: 74 22 3e 32 30 35 31 34 32 37 30 36 3c 2f 74 64 t">205142706</td
3490: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
34a0: 74 22 3e 34 35 30 30 31 3c 2f 74 64 3e 3c 74 64 t">45001</td><td
34b0: 3e 41 75 6c 6c 61 3c 2f 74 64 3e 3c 74 64 20 61 >Aulla</td><td a
34c0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 33 32 lign="right">432
34d0: 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 1</td><td align=
34e0: 22 72 69 67 68 74 22 3e 32 30 34 36 3c 2f 74 64 "right">2046</td
34f0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3500: 74 22 3e 32 32 37 35 3c 2f 74 64 3e 3c 2f 74 72 t">2275</td></tr
3510: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e >..<tr><td align
3520: 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c ="right">3</td><
3530: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3540: 3e 32 30 35 31 34 32 37 31 30 3c 2f 74 64 3e 3c >205142710</td><
3550: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3560: 3e 34 35 30 30 31 3c 2f 74 64 3e 3c 74 64 3e 43 >45001</td><td>C
3570: 61 70 72 69 67 6c 69 6f 6c 61 3c 2f 74 64 3e 3c aprigliola</td><
3580: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3590: 3e 34 38 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 >482</td><td ali
35a0: 67 6e 3d 22 72 69 67 68 74 22 3e 32 32 36 3c 2f gn="right">226</
35b0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
35c0: 67 68 74 22 3e 32 35 36 3c 2f 74 64 3e 3c 2f 74 ght">256</td></t
35d0: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 r>..<tr><td cols
35e0: 70 61 6e 3d 22 37 22 20 61 6c 69 67 6e 3d 22 63 pan="7" align="c
35f0: 65 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e enter"><hr></td>
3600: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 </tr>..<tr><td a
3610: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 31 lign="right">101
3620: 38 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 8</td><td align=
3630: 22 72 69 67 68 74 22 3e 31 34 31 30 37 37 35 34 "right">14107754
3640: 31 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 15</td><td align
3650: 3d 22 72 69 67 68 74 22 3e 31 30 30 30 30 37 3c ="right">100007<
3660: 2f 74 64 3e 3c 74 64 3e 53 61 73 73 65 74 61 3c /td><td>Sasseta<
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 32 38 35 3c 2f 74 64 3e 3c 74 ight">285</td><t
3690: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
36a0: 31 33 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 137</td><td alig
36b0: 6e 3d 22 72 69 67 68 74 22 3e 31 34 38 3c 2f 74 n="right">148</t
36c0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
36d0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
36e0: 30 31 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 019</td><td alig
36f0: 6e 3d 22 72 69 67 68 74 22 3e 31 34 31 30 37 38 n="right">141078
3700: 35 34 31 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 5415</td><td ali
3710: 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 30 30 30 gn="right">10000
3720: 37 3c 2f 74 64 3e 3c 74 64 3e 54 65 72 72 69 67 7</td><td>Terrig
3730: 6f 6c 69 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 oli</td><td alig
3740: 6e 3d 22 72 69 67 68 74 22 3e 35 33 37 3c 2f 74 n="right">537</t
3750: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3760: 68 74 22 3e 32 36 34 3c 2f 74 64 3e 3c 74 64 20 ht">264</td><td
3770: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 37 align="right">27
3780: 33 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 3</td></tr>..</t
3790: 61 62 6c 65 3e 0d 0a 3c 62 72 3e 0d 0a 22 3c 69 able>..<br>.."<i
37a0: 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f >census2011_topo
37b0: 66 65 61 74 75 72 65 73 5f 34 3c 2f 69 3e 22 0d features_4</i>".
37c0: 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e .<table cellspan
37d0: 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 ="4" cellpadding
37e0: 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 ="6" bgcolor="#f
37f0: 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 8f8f0" border="1
3800: 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f ">..<tr><td bgco
3810: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
3820: 3e 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c >fid</b></td>..<
3830: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 td bgcolor="#f0f
3840: 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 70 72 6f 76 0f8"><b>cod_prov
3850: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 </b></td>..<td b
3860: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 gcolor="#f0f0f8"
3870: 3e 3c 62 3e 63 6f 64 5f 72 65 67 3c 2f 62 3e 3c ><b>cod_reg</b><
3880: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f /td>..<td bgcolo
3890: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e r="#f0f0f8"><b>n
38a0: 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 ame</b></td>..<t
38b0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
38c0: 66 38 22 3e 3c 62 3e 61 62 62 72 65 76 3c 2f 62 f8"><b>abbrev</b
38d0: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
38e0: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
38f0: 3e 70 6f 70 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 >pop_2011</b></t
3900: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d d>..<td bgcolor=
3910: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6d 5f 32 "#f0f0f8"><b>m_2
3920: 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 011</b></td>..<t
3930: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
3940: 66 38 22 3e 3c 62 3e 66 5f 32 30 31 31 3c 2f 62 f8"><b>f_2011</b
3950: 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 ></td></tr>..<tr
3960: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3970: 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 t">1</td><td ali
3980: 67 6e 3d 22 72 69 67 68 74 22 3e 34 35 3c 2f 74 gn="right">45</t
3990: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
39a0: 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 4d 61 ht">9</td><td>Ma
39b0: 73 73 61 26 6e 62 73 70 3b 43 61 72 72 61 72 61 ssa Carrara
39c0: 3c 2f 74 64 3e 3c 74 64 3e 4d 53 3c 2f 74 64 3e </td><td>MS</td>
39d0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
39e0: 22 3e 31 39 39 36 35 30 3c 2f 74 64 3e 3c 74 64 ">199650</td><td
39f0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 align="right">9
3a00: 35 37 35 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 5754</td><td ali
3a10: 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 33 38 39 gn="right">10389
3a20: 36 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 6</td></tr>..<tr
3a30: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3a40: 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 t">2</td><td ali
3a50: 67 6e 3d 22 72 69 67 68 74 22 3e 34 36 3c 2f 74 gn="right">46</t
3a60: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3a70: 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 4c 75 ht">9</td><td>Lu
3a80: 63 63 61 3c 2f 74 64 3e 3c 74 64 3e 4c 55 3c 2f cca</td><td>LU</
3a90: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3aa0: 67 68 74 22 3e 33 38 38 33 32 37 3c 2f 74 64 3e ght">388327</td>
3ab0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3ac0: 22 3e 31 38 36 31 38 33 3c 2f 74 64 3e 3c 74 64 ">186183</td><td
3ad0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
3ae0: 30 32 31 34 34 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 02144</td></tr>.
3af0: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 .<tr><td align="
3b00: 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 right">3</td><td
3b10: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 align="right">4
3b20: 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 7</td><td align=
3b30: 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 "right">9</td><t
3b40: 64 3e 50 69 73 74 6f 69 61 3c 2f 74 64 3e 3c 74 d>Pistoia</td><t
3b50: 64 3e 50 54 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 d>PT</td><td ali
3b60: 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 37 38 36 gn="right">28786
3b70: 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 6</td><td align=
3b80: 22 72 69 67 68 74 22 3e 31 33 38 30 35 34 3c 2f "right">138054</
3b90: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3ba0: 67 68 74 22 3e 31 34 39 38 31 32 3c 2f 74 64 3e ght">149812</td>
3bb0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 </tr>..<tr><td c
3bc0: 6f 6c 73 70 61 6e 3d 22 38 22 20 61 6c 69 67 6e olspan="8" align
3bd0: 3d 22 63 65 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f ="center"><hr></
3be0: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
3bf0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3c00: 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 9</td><td align=
3c10: 22 72 69 67 68 74 22 3e 35 33 3c 2f 74 64 3e 3c "right">53</td><
3c20: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3c30: 3e 39 3c 2f 74 64 3e 3c 74 64 3e 47 72 6f 73 73 >9</td><td>Gross
3c40: 65 74 6f 3c 2f 74 64 3e 3c 74 64 3e 47 52 3c 2f eto</td><td>GR</
3c50: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3c60: 67 68 74 22 3e 32 32 30 35 36 34 3c 2f 74 64 3e ght">220564</td>
3c70: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3c80: 22 3e 31 30 35 35 38 35 3c 2f 74 64 3e 3c 74 64 ">105585</td><td
3c90: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
3ca0: 31 34 39 37 39 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 14979</td></tr>.
3cb0: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 .<tr><td align="
3cc0: 72 69 67 68 74 22 3e 31 30 3c 2f 74 64 3e 3c 74 right">10</td><t
3cd0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3ce0: 31 30 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 100</td><td alig
3cf0: 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e n="right">9</td>
3d00: 3c 74 64 3e 50 72 61 74 6f 3c 2f 74 64 3e 3c 74 <td>Prato</td><t
3d10: 64 3e 50 4f 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 d>PO</td><td ali
3d20: 67 6e 3d 22 72 69 67 68 74 22 3e 32 34 35 39 31 gn="right">24591
3d30: 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 6</td><td align=
3d40: 22 72 69 67 68 74 22 3e 31 31 39 30 38 38 3c 2f "right">119088</
3d50: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3d60: 67 68 74 22 3e 31 32 36 38 32 38 3c 2f 74 64 3e ght">126828</td>
3d70: 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d </tr>..</table>.
3d80: 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 .</td></tr>..<tr
3d90: 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f ><td>..<b><<i>to
3da0: 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 po-prefix</i>>_t
3db0: 6f 70 6f 66 65 61 74 75 72 65 73 3c 2f 62 3e 0d opofeatures</b>.
3dc0: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c .<verbatim>..SEL
3dd0: 45 43 54 20 2a 20 46 52 4f 4d 20 63 65 6e 73 75 ECT * FROM censu
3de0: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 s2011_topofeatur
3df0: 65 73 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e es;..</verbatim>
3e00: 0d 0a 54 68 65 20 3c 62 3e 54 6f 70 6f 46 65 61 ..The <b>TopoFea
3e10: 74 75 72 65 73 2d 67 65 6f 6d 65 74 72 69 65 73 tures-geometries
3e20: 3c 2f 62 3e 20 74 61 62 6c 65 20 69 73 20 69 6e </b> table is in
3e30: 74 65 6e 64 65 64 20 74 6f 20 70 65 72 6d 61 6e tended to perman
3e40: 65 6e 74 6c 79 20 73 74 6f 72 65 20 61 6c 6c 20 ently store all
3e50: 72 65 6c 61 74 69 6f 6e 73 20 62 65 74 77 65 65 relations betwee
3e60: 6e 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 61 n TopoFeatures a
3e70: 6e 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d nd Topology prim
3e80: 69 74 69 76 65 73 20 72 65 71 75 69 72 65 64 20 itives required
3e90: 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f 72 72 in order to corr
3ea0: 65 63 74 6c 79 20 62 75 69 6c 64 20 74 68 65 20 ectly build the
3eb0: 65 78 70 65 63 74 65 64 20 6f 75 74 70 75 74 20 expected output
3ec0: 47 65 6f 6d 65 74 72 79 20 66 6f 72 20 65 61 63 Geometry for eac
3ed0: 68 20 54 6f 70 6f 46 65 61 74 75 72 65 2e 0d 0a h TopoFeature...
3ee0: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 75 69 64 <ul>..<li><b>uid
3ef0: 3c 2f 62 3e 20 69 73 20 74 68 65 20 50 72 69 6d </b> is the Prim
3f00: 61 72 79 20 4b 65 79 2c 20 61 6e 64 20 69 73 20 ary Key, and is
3f10: 73 69 6d 70 6c 79 20 69 6e 74 65 6e 64 65 64 20 simply intended
3f20: 74 6f 20 62 65 20 61 6e 20 75 6e 69 71 75 65 20 to be an unique
3f30: 69 64 65 6e 74 69 66 69 65 72 20 66 6f 72 20 65 identifier for e
3f40: 61 63 68 20 72 6f 77 20 62 75 74 20 64 6f 65 73 ach row but does
3f50: 6e 27 74 20 69 6e 74 65 6e 64 20 74 6f 20 68 61 n't intend to ha
3f60: 76 65 20 61 6e 79 20 73 70 65 63 69 61 6c 20 6d ve any special m
3f70: 65 61 6e 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c 6c eaning.</li>..<l
3f80: 69 3e 3c 62 3e 6e 6f 64 65 5f 69 64 3c 2f 62 3e i><b>node_id</b>
3f90: 2c 20 3c 62 3e 65 64 67 65 5f 69 64 3c 2f 62 3e , <b>edge_id</b>
3fa0: 20 61 6e 64 20 3c 62 3e 66 61 63 65 5f 69 64 3c and <b>face_id<
3fb0: 2f 62 3e 20 61 72 65 20 46 6f 72 65 69 67 6e 20 /b> are Foreign
3fc0: 4b 65 79 73 20 64 69 72 65 63 74 6c 79 20 72 65 Keys directly re
3fd0: 66 65 72 65 6e 63 69 6e 67 20 61 20 54 6f 70 6f ferencing a Topo
3fe0: 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 3b 20 logy primitive;
3ff0: 74 77 6f 20 6f 66 20 74 68 65 73 65 20 76 61 6c two of these val
4000: 75 65 73 20 61 72 65 20 61 6c 77 61 79 73 20 65 ues are always e
4010: 78 70 65 63 74 65 64 20 74 6f 20 62 65 20 4e 55 xpected to be NU
4020: 4c 4c 2c 20 61 6e 64 20 6f 6e 6c 79 20 6f 6e 65 LL, and only one
4030: 20 69 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 is expected to
4040: 65 66 66 65 63 74 69 76 65 6c 79 20 72 65 66 65 effectively refe
4050: 72 65 6e 63 65 20 61 20 54 6f 70 6f 6c 6f 67 79 rence a Topology
4060: 20 70 72 69 6d 69 74 69 76 65 20 64 65 70 65 6e primitive depen
4070: 64 69 6e 67 20 6f 6e 20 69 74 73 20 74 79 70 65 ding on its type
4080: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 74 .</li>..<li><b>t
4090: 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 3e 20 opolayer_id</b>
40a0: 61 6e 64 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 74 and <b>fid</b> t
40b0: 6f 67 65 74 68 65 72 20 61 72 65 20 69 6e 74 65 ogether are inte
40c0: 6e 64 65 64 20 74 6f 20 65 73 74 61 62 6c 69 73 nded to establis
40d0: 68 20 61 20 72 65 6c 61 74 69 6f 6e 61 6c 20 72 h a relational r
40e0: 65 66 65 72 65 6e 63 65 20 74 6f 20 73 6f 6d 65 eference to some
40f0: 20 73 70 65 63 69 66 69 63 20 54 6f 70 6f 46 65 specific TopoFe
4100: 61 74 75 72 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 ature.</li>..</u
4110: 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61 l>..<br>..<u>Exa
4120: 6d 70 6c 65 20 23 31 3c 2f 75 3e 3a 20 61 6c 6c mple #1</u>: all
4130: 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 Topology primit
4140: 69 76 65 73 20 64 69 72 65 63 74 6c 79 20 72 65 ives directly re
4150: 66 65 72 65 6e 63 65 64 20 62 79 20 72 6f 77 73 ferenced by rows
4160: 20 64 65 63 6c 61 72 69 6e 67 20 3c 62 3e 74 6f declaring <b>to
4170: 70 6f 6c 61 79 65 72 5f 69 64 3d 32 3c 2f 62 3e polayer_id=2</b>
4180: 20 61 6e 64 20 3c 62 3e 66 69 64 3d 33 3c 2f 62 and <b>fid=3</b
4190: 3e 20 6d 75 73 74 20 62 65 20 61 67 67 72 65 67 > must be aggreg
41a0: 61 74 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f ated in order to
41b0: 20 62 75 69 6c 64 20 74 68 65 20 6f 75 74 70 75 build the outpu
41c0: 74 20 47 65 6f 6d 65 74 72 79 20 63 6f 72 72 65 t Geometry corre
41d0: 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20 sponding to the
41e0: 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 20 Populated Place
41f0: 6f 66 20 3c 62 3e 43 61 70 72 69 67 6c 69 6f 6c of <b>Caprigliol
4200: 61 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 45 a</b>.<br>..<u>E
4210: 78 61 6d 70 6c 65 20 23 32 3c 2f 75 3e 3a 20 61 xample #2</u>: a
4220: 6c 6c 20 70 72 69 6d 69 74 69 76 65 73 20 72 65 ll primitives re
4230: 66 65 72 65 6e 63 65 64 20 62 79 20 72 6f 77 73 ferenced by rows
4240: 20 64 65 63 6c 61 72 69 6e 67 20 3c 62 3e 74 6f declaring <b>to
4250: 70 6f 6c 61 79 65 72 5f 69 64 3d 34 3c 2f 62 3e polayer_id=4</b>
4260: 20 61 6e 64 20 3c 62 3e 66 69 64 3d 39 3c 2f 62 and <b>fid=9</b
4270: 3e 20 6d 75 73 74 20 62 65 20 61 67 67 72 65 67 > must be aggreg
4280: 61 74 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f ated in order to
4290: 20 62 75 69 6c 64 20 74 68 65 20 6f 75 74 70 75 build the outpu
42a0: 74 20 47 65 6f 6d 65 74 72 79 20 63 6f 72 72 65 t Geometry corre
42b0: 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20 sponding to the
42c0: 50 72 6f 76 69 6e 63 65 20 6f 66 20 3c 62 3e 47 Province of <b>G
42d0: 72 6f 73 73 65 74 6f 3c 2f 62 3e 2e 0d 0a 3c 2f rosseto</b>...</
42e0: 74 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e td><td>.."<i>cen
42f0: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
4300: 75 72 65 73 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c ures</i>"..<tabl
4310: 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 e cellspan="4" c
4320: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62 ellpadding="6" b
4330: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 gcolor="#f8f8f0"
4340: 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 border="1">..<t
4350: 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 r><td bgcolor="#
4360: 66 30 66 30 66 38 22 3e 3c 62 3e 75 69 64 3c 2f f0f0f8"><b>uid</
4370: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 b></td>..<td bgc
4380: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c olor="#f0f0f8"><
4390: 62 3e 6e 6f 64 65 5f 69 64 3c 2f 62 3e 3c 2f 74 b>node_id</b></t
43a0: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d d>..<td bgcolor=
43b0: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 65 64 67 "#f0f0f8"><b>edg
43c0: 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c e_id</b></td>..<
43d0: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 td bgcolor="#f0f
43e0: 30 66 38 22 3e 3c 62 3e 66 61 63 65 5f 69 64 3c 0f8"><b>face_id<
43f0: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 /b></td>..<td bg
4400: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e color="#f0f0f8">
4410: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c <b>topolayer_id<
4420: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 /b></td>..<td bg
4430: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e color="#f0f0f8">
4440: 3c 62 3e 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e 3c <b>fid</b></td><
4450: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c /tr>..<tr><td al
4460: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 ign="right">1</t
4470: 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c d><td>NULL</td><
4480: 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 td>NULL</td><td
4490: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c align="right">1<
44a0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
44b0: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 ight">1</td><td
44c0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c align="right">1<
44d0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
44e0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
44f0: 3e 32 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c >2</td><td>NULL<
4500: 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 /td><td>NULL</td
4510: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
4520: 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 t">2</td><td ali
4530: 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 gn="right">1</td
4540: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
4550: 74 22 3e 32 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a t">2</td></tr>..
4560: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
4570: 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 3e ight">3</td><td>
4580: 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c NULL</td><td>NUL
4590: 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d L</td><td align=
45a0: 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 "right">3</td><t
45b0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
45c0: 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 1</td><td align=
45d0: 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 2f "right">3</td></
45e0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c tr>..<tr><td col
45f0: 73 70 61 6e 3d 22 36 22 20 61 6c 69 67 6e 3d 22 span="6" align="
4600: 63 65 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 64 center"><hr></td
4610: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 ></tr>..<tr><td
4620: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 align="right">28
4630: 38 37 30 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 870</td><td>NULL
4640: 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 </td><td>NULL</t
4650: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
4660: 68 74 22 3e 32 38 38 36 34 3c 2f 74 64 3e 3c 74 ht">28864</td><t
4670: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
4680: 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 1</td><td align=
4690: 22 72 69 67 68 74 22 3e 32 38 38 36 37 3c 2f 74 "right">28867</t
46a0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
46b0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
46c0: 38 38 37 31 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 8871</td><td>NUL
46d0: 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f L</td><td>NULL</
46e0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
46f0: 67 68 74 22 3e 32 38 38 36 38 3c 2f 74 64 3e 3c ght">28868</td><
4700: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
4710: 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >1</td><td align
4720: 3d 22 72 69 67 68 74 22 3e 32 38 38 36 38 3c 2f ="right">28868</
4730: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c td></tr>..</tabl
4740: 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a e>..</td></tr>..
4750: 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 74 61 62 6c 65 </table>..<table
4760: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 38 22 cellpadding="8"
4770: 20 62 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 62 bgcolor="#d0ffb
4780: 30 22 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 0">..<tr><td>..<
4790: 68 33 3e 46 69 6e 61 6c 20 72 65 6d 61 72 6b 73 h3>Final remarks
47a0: 3c 2f 68 33 3e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 </h3>..<ol>..<li
47b0: 3e 62 6f 74 68 20 3c 62 3e 54 6f 70 6f 47 65 6f >both <b>TopoGeo
47c0: 5f 43 72 65 61 74 65 54 6f 70 6f 4c 61 79 65 72 _CreateTopoLayer
47d0: 28 29 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 54 6f ()</b> and <b>To
47e0: 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 poGeo_InitTopoLa
47f0: 79 65 72 28 29 3c 2f 62 3e 20 77 69 6c 6c 20 72 yer()</b> will r
4800: 65 67 69 73 74 65 72 20 74 68 65 20 54 6f 70 6f egister the Topo
4810: 4c 61 79 65 72 20 69 6e 74 6f 20 74 68 65 20 3c Layer into the <
4820: 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e b>TopoLayers</b>
4830: 20 74 61 62 6c 65 2c 20 61 6e 64 20 77 69 6c 6c table, and will
4840: 20 63 72 65 61 74 65 20 61 6e 64 20 70 6f 70 75 create and popu
4850: 6c 61 74 65 20 74 68 65 20 63 6f 72 72 65 73 70 late the corresp
4860: 6f 6e 64 69 6e 67 20 3c 62 3e 54 6f 70 6f 46 65 onding <b>TopoFe
4870: 61 74 75 72 65 73 3c 2f 62 3e 20 74 61 62 6c 65 atures</b> table
4880: 20 62 79 20 69 6d 70 6f 72 74 69 6e 67 20 61 6c by importing al
4890: 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 l information at
48a0: 74 72 69 62 75 74 65 73 20 66 6f 72 20 65 61 63 tributes for eac
48b0: 68 20 46 65 61 74 75 72 65 20 64 65 66 69 6e 65 h Feature define
48c0: 64 20 62 79 20 74 68 65 20 72 65 66 65 72 65 6e d by the referen
48d0: 63 65 20 74 61 62 6c 65 20 28 6f 72 20 72 65 66 ce table (or ref
48e0: 65 72 65 6e 63 65 20 76 69 65 77 29 2e 3c 2f 6c erence view).</l
48f0: 69 3e 0d 0a 3c 6c 69 3e 6f 6e 6c 79 20 3c 62 3e i>..<li>only <b>
4900: 54 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f TopoGeo_CreateTo
4910: 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 77 69 poLayer()</b> wi
4920: 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 ll automatically
4930: 20 70 6f 70 75 6c 61 74 65 20 74 68 65 20 3c 62 populate the <b
4940: 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 2d 67 65 >TopoFeatures-ge
4950: 6f 6d 65 74 72 79 3c 2f 62 3e 20 74 61 62 6c 65 ometry</b> table
4960: 2c 20 61 6e 64 20 77 68 69 6c 65 20 64 6f 69 6e , and while doin
4970: 67 20 73 6f 2c 20 69 64 65 6e 74 69 66 79 20 61 g so, identify a
4980: 6c 6c 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 ll relationships
4990: 20 65 78 69 73 74 69 6e 67 20 62 65 74 77 65 65 existing betwee
49a0: 6e 20 74 68 65 20 47 65 6f 6d 65 74 72 69 65 73 n the Geometries
49b0: 20 66 6f 75 6e 64 20 69 6e 74 6f 20 74 68 65 20 found into the
49c0: 72 65 66 65 72 65 6e 63 65 20 74 61 62 6c 65 20 reference table
49d0: 6f 72 20 76 69 65 77 20 61 6e 64 20 74 68 65 20 or view and the
49e0: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 Topology primiti
49f0: 76 65 73 20 62 61 73 65 64 20 6f 6e 20 74 68 65 ves based on the
4a00: 20 76 61 6c 75 65 73 20 6f 66 20 74 68 65 20 3c values of the <
4a10: 62 3e 54 6f 70 6f 53 65 65 64 73 3c 2f 62 3e 2e b>TopoSeeds</b>.
4a20: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 73 20 61 70 </li>..<li>as ap
4a30: 70 6f 73 65 64 20 74 6f 20 3c 62 3e 54 6f 70 6f posed to <b>Topo
4a40: 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 Geo_InitTopoLaye
4a50: 72 28 29 3c 2f 62 3e 2c 20 77 68 69 63 68 20 77 r()</b>, which w
4a60: 69 6c 6c 20 6e 65 76 65 72 20 61 74 74 65 6d 70 ill never attemp
4a70: 74 20 74 6f 20 69 64 65 6e 74 69 66 79 20 74 68 t to identify th
4a80: 65 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 20 e relationships
4a90: 69 6e 74 65 72 63 75 72 72 69 6e 67 20 62 65 74 intercurring bet
4aa0: 77 65 65 6e 20 6f 75 74 70 75 74 20 47 65 6f 6d ween output Geom
4ab0: 65 74 72 69 65 73 20 61 6e 64 20 54 6f 70 6f 6c etries and Topol
4ac0: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 2e 20 ogy primitives.
4ad0: 54 68 69 73 20 74 61 73 6b 20 77 69 6c 6c 20 61 This task will a
4ae0: 6c 77 61 79 73 20 62 65 20 64 65 66 65 72 72 65 lways be deferre
4af0: 64 20 66 6f 72 20 74 68 65 20 75 73 65 72 20 74 d for the user t
4b00: 6f 20 64 65 61 6c 20 77 69 74 68 20 6c 61 74 65 o deal with late
4b10: 72 2e 3c 62 72 3e 0d 0a 59 6f 75 20 63 6f 75 6c r.<br>..You coul
4b20: 64 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 d, for example,
4b30: 6d 61 6e 75 61 6c 6c 79 20 73 65 6c 65 63 74 20 manually select
4b40: 61 6c 6c 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 all Topology pri
4b50: 6d 69 74 69 76 65 73 20 63 6f 72 72 65 73 70 6f mitives correspo
4b60: 6e 64 69 6e 67 20 74 6f 20 61 20 73 69 6e 67 6c nding to a singl
4b70: 65 20 54 6f 70 6f 46 65 61 74 75 72 65 3b 20 6f e TopoFeature; o
4b80: 72 20 6d 6f 72 65 20 70 72 6f 62 61 62 6c 79 20 r more probably
4b90: 79 6f 75 20 63 6f 75 6c 64 20 70 65 72 66 6f 72 you could perfor
4ba0: 6d 20 74 68 69 73 20 74 61 73 6b 20 69 6e 20 61 m this task in a
4bb0: 20 73 65 63 6f 6e 64 20 72 6f 75 6e 64 20 62 79 second round by
4bc0: 20 65 78 65 63 75 74 69 6e 67 20 73 6f 6d 65 20 executing some
4bd0: 61 70 70 72 6f 70 72 69 61 74 65 20 53 51 4c 20 appropriate SQL
4be0: 73 74 61 74 65 6d 65 6e 74 20 28 3c 69 3e 61 73 statement (<i>as
4bf0: 20 77 65 27 6c 6c 20 73 65 65 6e 20 73 6f 6f 6e we'll seen soon
4c00: 20 69 6e 20 74 68 65 20 6e 65 78 74 20 65 78 61 in the next exa
4c10: 6d 70 6c 65 3c 2f 69 3e 29 2e 20 0d 0a 3c 2f 6f mple</i>). ..</o
4c20: 6c 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a l>..</td></tr>..
4c30: 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 </table><br>..<h
4c40: 72 3e 0d 0a 3c 68 33 3e 54 6f 70 6f 47 65 6f 5f r>..<h3>TopoGeo_
4c50: 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 3a ExportTopoLayer:
4c60: 20 65 78 70 6f 72 74 69 6e 67 20 61 20 66 75 6c exporting a ful
4c70: 6c 20 54 6f 70 6f 4c 61 79 65 72 20 69 6e 74 6f l TopoLayer into
4c80: 20 61 20 47 65 6f 54 61 62 6c 65 3c 2f 68 33 3e a GeoTable</h3>
4c90: 0d 0a 3c 74 61 62 6c 65 20 77 69 64 74 68 3d 22 ..<table width="
4ca0: 31 30 30 25 22 20 20 63 65 6c 6c 73 70 61 6e 3d 100%" cellspan=
4cb0: 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d "4" cellpadding=
4cc0: 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 "6" bgcolor="#f8
4cd0: 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22 f8f0" border="1"
4ce0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 >..<tr><td colsp
4cf0: 61 6e 3d 22 32 22 20 61 6c 69 67 6e 3d 22 63 65 an="2" align="ce
4d00: 6e 74 65 72 22 3e 3c 62 3e 65 78 70 6f 72 74 69 nter"><b>exporti
4d10: 6e 67 20 74 68 65 20 43 65 6e 73 75 73 20 41 72 ng the Census Ar
4d20: 65 61 73 20 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 eas TopoLayer</b
4d30: 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 ></td></tr>..<tr
4d40: 3e 3c 74 64 3e 0d 0a 57 65 27 6c 6c 20 73 74 61 ><td>..We'll sta
4d50: 72 74 20 62 79 20 65 78 70 6f 72 74 69 6e 67 20 rt by exporting
4d60: 66 69 72 73 74 20 74 68 65 20 6f 6e 6c 79 20 63 first the only c
4d70: 6f 6d 70 6c 65 74 65 6c 79 20 64 65 66 69 6e 65 ompletely define
4d80: 64 20 54 6f 70 6f 4c 61 79 65 72 20 77 65 20 68 d TopoLayer we h
4d90: 61 76 65 20 61 74 20 74 68 69 73 20 70 6f 69 6e ave at this poin
4da0: 74 20 69 6e 20 74 68 65 20 74 65 73 74 20 44 42 t in the test DB
4db0: 2d 66 69 6c 65 2c 20 69 2e 65 2e 20 3c 62 3e 63 -file, i.e. <b>c
4dc0: 65 6e 73 75 73 5f 61 72 65 61 73 3c 2f 62 3e 0d ensus_areas</b>.
4dd0: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c .<verbatim>..SEL
4de0: 45 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f ECT TopoGeo_Expo
4df0: 72 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e rtTopoLayer('cen
4e00: 73 75 73 32 30 31 31 27 2c 20 27 63 65 6e 73 75 sus2011', 'censu
4e10: 73 5f 61 72 65 61 73 27 2c 20 27 6f 75 74 5f 63 s_areas', 'out_c
4e20: 65 6e 73 75 73 5f 32 30 31 31 27 2c 20 31 29 3b ensus_2011', 1);
4e30: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41 ..</verbatim>..A
4e40: 73 20 79 6f 75 20 63 61 6e 20 65 61 73 69 6c 79 s you can easily
4e50: 20 63 68 65 63 6b 20 62 79 20 79 6f 75 72 73 65 check by yourse
4e60: 6c 66 20 61 20 6e 65 77 20 47 65 6f 54 61 62 6c lf a new GeoTabl
4e70: 65 20 6e 61 6d 65 64 20 3c 62 3e 6f 75 74 5f 63 e named <b>out_c
4e80: 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20 68 ensus_2011</b> h
4e90: 61 73 20 62 65 65 6e 20 63 72 65 61 74 65 64 20 as been created
4ea0: 62 79 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 45 78 by <b>TopoGeo_Ex
4eb0: 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c portTopoLayer()<
4ec0: 2f 62 3e 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e /b>:..<ul>..<li>
4ed0: 74 68 69 73 20 47 65 6f 54 61 62 6c 65 20 63 6f this GeoTable co
4ee0: 6e 74 61 69 6e 73 20 61 6c 6c 20 54 6f 70 6f 46 ntains all TopoF
4ef0: 65 61 74 75 72 65 73 20 64 65 66 69 6e 65 64 20 eatures defined
4f00: 69 6e 74 6f 20 74 68 65 20 54 6f 70 6f 4c 61 79 into the TopoLay
4f10: 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 65 61 er.</li>..<li>ea
4f20: 63 68 20 54 6f 70 6f 46 65 61 74 75 72 65 20 66 ch TopoFeature f
4f30: 61 69 74 68 66 75 6c 6c 79 20 70 72 65 73 65 72 aithfully preser
4f40: 76 65 73 20 69 74 73 20 69 6e 69 74 69 61 6c 20 ves its initial
4f50: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 information attr
4f60: 69 62 75 74 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c ibutes.</li>..<l
4f70: 69 3e 61 6c 6c 20 47 65 6f 6d 65 74 72 69 65 73 i>all Geometries
4f80: 20 61 72 65 20 70 72 65 63 69 73 65 6c 79 20 62 are precisely b
4f90: 75 69 6c 74 20 62 79 20 61 67 67 72 65 67 61 74 uilt by aggregat
4fa0: 69 6e 67 20 74 68 65 20 63 6f 72 72 65 73 70 6f ing the correspo
4fb0: 6e 64 69 6e 67 20 54 6f 70 6f 6c 6f 67 79 20 70 nding Topology p
4fc0: 72 69 6d 69 74 69 76 65 73 20 61 73 20 73 70 65 rimitives as spe
4fd0: 63 69 66 69 65 64 20 62 79 20 54 6f 70 6f 4c 61 cified by TopoLa
4fe0: 79 65 72 20 2f 20 54 6f 70 6f 46 65 61 74 75 72 yer / TopoFeatur
4ff0: 65 73 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 es relationships
5000: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 .</li>..</ul><br
5010: 3e 3c 62 72 3e 0d 0a 54 68 65 20 69 6d 61 67 65 ><br>..The image
5020: 20 65 78 61 6d 70 6c 69 66 69 65 73 20 61 20 63 examplifies a c
5030: 68 6f 72 6f 70 6c 65 74 68 20 63 65 6e 74 65 72 horopleth center
5040: 65 64 20 61 72 6f 75 6e 64 20 74 68 65 20 49 73 ed around the Is
5050: 6c 61 6e 64 20 6f 66 20 45 6c 62 61 20 61 6e 64 land of Elba and
5060: 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 3c 62 based on the <b
5070: 3e 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30 31 31 >out_census_2011
5080: 3c 2f 62 3e 20 47 65 6f 54 61 62 6c 65 3a 20 61 </b> GeoTable: a
5090: 6c 6c 20 43 65 6e 73 75 73 20 41 72 65 61 73 20 ll Census Areas
50a0: 61 72 65 20 64 69 73 70 6c 61 79 65 64 20 62 79 are displayed by
50b0: 20 61 64 6f 70 74 69 6e 67 20 61 20 63 6f 6c 6f adopting a colo
50c0: 75 72 20 64 69 72 65 63 74 6c 79 20 63 6f 72 72 ur directly corr
50d0: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 esponding to the
50e0: 69 72 20 70 6f 70 75 6c 61 74 69 6f 6e 20 64 65 ir population de
50f0: 6e 73 69 74 79 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 nsity...</td><td
5100: 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 >..<img src="htt
5110: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
5120: 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 s.it/gaia-sins/t
5130: 6f 70 6f 66 69 67 73 2f 65 6c 62 61 2d 63 68 6f opofigs/elba-cho
5140: 72 6f 70 6c 65 74 68 2e 70 6e 67 22 20 61 6c 74 ropleth.png" alt
5150: 3d 22 65 6c 62 61 2d 63 68 6f 72 6f 70 6c 65 74 ="elba-choroplet
5160: 68 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d h">..</td></tr>.
5170: 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c .</table><br>..<
5180: 68 72 3e 0d 0a 3c 68 33 3e 42 75 69 6c 64 69 6e hr>..<h3>Buildin
5190: 67 20 61 20 66 75 6c 6c 20 68 69 65 72 61 72 63 g a full hierarc
51a0: 68 79 20 6f 66 20 41 64 6d 69 6e 69 73 74 72 61 hy of Administra
51b0: 74 69 76 65 20 4c 65 76 65 6c 73 20 62 79 20 53 tive Levels by S
51c0: 51 4c 20 73 74 61 74 65 6d 65 6e 74 73 3c 2f 68 QL statements</h
51d0: 33 3e 0d 0a 41 73 20 77 65 27 76 65 20 61 6c 72 3>..As we've alr
51e0: 65 61 64 79 20 73 65 65 6e 20 62 65 66 6f 72 65 eady seen before
51f0: 20 77 65 20 61 72 65 20 6e 6f 77 20 65 78 70 65 we are now expe
5200: 63 74 65 64 20 74 6f 20 63 6f 6d 70 6c 65 74 65 cted to complete
5210: 20 73 6f 6d 65 77 61 79 20 74 68 65 20 54 6f 70 someway the Top
5220: 6f 46 65 61 74 75 72 65 73 20 64 65 66 69 6e 69 oFeatures defini
5230: 74 69 6f 6e 73 20 73 75 70 70 6f 72 74 69 6e 67 tions supporting
5240: 20 74 68 65 20 3c 62 3e 50 6f 70 75 6c 61 74 65 the <b>Populate
5250: 64 20 50 6c 61 63 65 73 3c 2f 62 3e 2c 20 3c 62 d Places</b>, <b
5260: 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c >Municipalities<
5270: 2f 62 3e 2c 20 3c 62 3e 50 72 6f 76 69 6e 63 65 /b>, <b>Province
5280: 73 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 52 65 67 s</b> and <b>Reg
5290: 69 6f 6e 3c 2f 62 3e 20 54 6f 70 6f 4c 61 79 65 ion</b> TopoLaye
52a0: 72 73 20 77 65 27 76 65 20 70 72 65 76 69 6f 75 rs we've previou
52b0: 73 6c 79 20 63 72 65 61 74 65 64 20 62 79 20 63 sly created by c
52c0: 61 6c 6c 69 6e 67 20 3c 62 3e 54 6f 70 6f 47 65 alling <b>TopoGe
52d0: 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 o_InitTopoLayer(
52e0: 29 3c 2f 62 3e 2e 3c 62 72 3e 3c 62 72 3e 0d 0a )</b>.<br><br>..
52f0: 48 61 70 70 69 6c 79 20 65 6e 6f 75 67 68 20 61 Happily enough a
5300: 6c 6c 20 74 68 65 73 65 20 61 64 6d 69 6e 69 73 ll these adminis
5310: 74 72 61 74 69 76 65 20 6c 65 76 65 6c 73 20 61 trative levels a
5320: 72 65 20 73 69 6d 70 6c 79 20 62 61 73 65 64 20 re simply based
5330: 6f 6e 20 64 69 72 65 63 74 20 61 67 67 72 65 67 on direct aggreg
5340: 61 74 69 6f 6e 73 20 6f 66 20 3c 62 3e 43 65 6e ations of <b>Cen
5350: 73 75 73 20 41 72 65 61 73 3c 2f 62 3e 2c 20 73 sus Areas</b>, s
5360: 6f 20 77 65 20 6a 75 73 74 20 68 61 76 65 20 74 o we just have t
5370: 6f 20 65 78 65 63 75 74 65 20 66 65 77 20 61 70 o execute few ap
5380: 70 72 6f 70 72 69 61 74 65 20 53 51 4c 20 73 74 propriate SQL st
5390: 61 74 65 6d 65 6e 74 73 2e 0d 0a 3c 76 65 72 62 atements...<verb
53a0: 61 74 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 4e atim>..INSERT IN
53b0: 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f TO census2011_to
53c0: 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c 45 pofeatures..SELE
53d0: 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 5f CT NULL, c.node_
53e0: 69 64 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20 63 id, c.edge_id, c
53f0: 2e 66 61 63 65 5f 69 64 2c 20 32 2c 20 61 2e 66 .face_id, 2, a.f
5400: 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 id..FROM census2
5410: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 011_topofeatures
5420: 5f 32 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 _2 AS a..JOIN ce
5430: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
5440: 74 75 72 65 73 5f 31 20 41 53 20 62 20 4f 4e 20 tures_1 AS b ON
5450: 28 62 2e 63 6f 64 5f 70 70 6c 20 3d 20 61 2e 63 (b.cod_ppl = a.c
5460: 6f 64 5f 70 70 6c 29 0d 0a 4a 4f 49 4e 20 63 65 od_ppl)..JOIN ce
5470: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
5480: 74 75 72 65 73 20 41 53 20 63 20 4f 4e 20 28 63 tures AS c ON (c
5490: 2e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 .topolayer_id =
54a0: 31 20 41 4e 44 20 63 2e 66 69 64 20 3d 20 62 2e 1 AND c.fid = b.
54b0: 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 fid);..</verbati
54c0: 6d 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 m>..<ul>..<li><b
54d0: 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f >census2011_topo
54e0: 66 65 61 74 75 72 65 73 5f 31 3c 2f 62 3e 20 69 features_1</b> i
54f0: 73 20 74 68 65 20 54 6f 70 6f 46 65 61 74 75 72 s the TopoFeatur
5500: 65 73 20 74 61 62 6c 65 20 63 6f 72 72 65 73 70 es table corresp
5510: 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 43 65 6e onding to <b>Cen
5520: 73 75 73 20 41 72 65 61 73 3c 2f 62 3e 2e 3c 2f sus Areas</b>.</
5530: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 65 6e 73 li>..<li><b>cens
5540: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 us2011_topofeatu
5550: 72 65 73 5f 32 3c 2f 62 3e 20 69 73 20 74 68 65 res_2</b> is the
5560: 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 corresponds to
5570: 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 <b>Populated Pla
5580: 63 65 73 3c 2f 62 3e 3b 20 74 68 65 20 63 6c 61 ces</b>; the cla
5590: 75 73 65 20 3c 62 3e 62 2e 63 6f 64 5f 70 70 6c use <b>b.cod_ppl
55a0: 20 3d 20 61 2e 63 6f 64 5f 70 70 6c 3c 2f 62 3e = a.cod_ppl</b>
55b0: 20 77 69 6c 6c 20 72 65 6c 61 74 69 6f 6e 61 6c will relational
55c0: 6c 79 20 6a 6f 69 6e 20 65 61 63 68 20 50 6f 70 ly join each Pop
55d0: 75 6c 61 74 65 64 20 50 6c 61 63 65 20 74 6f 20 ulated Place to
55e0: 69 74 73 20 75 6e 64 65 72 6c 61 79 69 6e 67 20 its underlaying
55f0: 43 65 6e 73 75 73 20 41 72 65 61 73 2e 3c 2f 6c Census Areas.</l
5600: 69 3e 0d 0a 3c 6c 69 3e 73 6f 20 77 65 20 63 61 i>..<li>so we ca
5610: 6e 20 64 75 6c 79 20 69 6e 73 65 72 74 20 69 6e n duly insert in
5620: 74 6f 20 74 68 65 20 3c 62 3e 54 6f 70 6f 46 65 to the <b>TopoFe
5630: 61 74 75 72 65 73 2d 67 65 6f 6d 65 74 72 79 3c atures-geometry<
5640: 2f 62 3e 20 74 61 62 6c 65 20 28 69 2e 65 2e 20 /b> table (i.e.
5650: 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f <i>census2011_to
5660: 70 6f 66 65 61 74 75 72 65 73 3c 2f 69 3e 29 20 pofeatures</i>)
5670: 61 20 6e 65 77 20 6c 65 76 65 6c 20 6f 66 20 72 a new level of r
5680: 65 66 65 72 65 6e 63 65 73 20 74 6f 20 54 6f 70 eferences to Top
5690: 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 ology primitives
56a0: 20 62 79 20 73 69 6d 70 6c 79 20 63 6f 70 79 69 by simply copyi
56b0: 6e 67 20 61 6c 6c 20 64 65 66 69 6e 69 74 69 6f ng all definitio
56c0: 6e 73 20 61 6c 72 65 61 64 79 20 73 74 6f 72 65 ns already store
56d0: 64 20 69 6e 74 6f 20 74 68 65 20 70 72 65 76 69 d into the previ
56e0: 6f 75 73 20 68 69 65 72 61 72 63 68 69 63 61 6c ous hierarchical
56f0: 20 6c 65 76 65 6c 2e 3c 62 72 3e 0d 0a 41 6e 64 level.<br>..And
5700: 20 74 6f 20 64 6f 20 73 75 63 68 20 61 20 74 68 to do such a th
5710: 69 6e 67 20 77 65 20 73 69 6d 70 6c 79 20 68 61 ing we simply ha
5720: 76 65 20 74 6f 20 72 65 61 64 20 66 72 6f 6d 20 ve to read from
5730: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 31 3c 2f <b>topolayer=1</
5740: 62 3e 20 74 68 65 6e 20 69 6e 73 65 72 74 69 6e b> then insertin
5750: 67 20 69 6e 74 6f 20 3c 62 3e 74 6f 70 6f 6c 61 g into <b>topola
5760: 79 65 72 3d 32 3c 2f 62 3e 20 61 66 74 65 72 20 yer=2</b> after
5770: 73 65 74 74 69 6e 67 20 74 68 65 20 61 70 70 72 setting the appr
5780: 6f 70 72 69 61 74 65 20 3c 62 3e 66 69 64 3c 2f opriate <b>fid</
5790: 62 3e 20 76 61 6c 75 65 73 2e 3c 62 72 3e 0d 0a b> values.<br>..
57a0: 52 65 61 6c 6c 79 20 6e 6f 74 20 61 20 64 69 66 Really not a dif
57b0: 66 69 63 75 6c 74 20 74 61 73 6b 2e 3c 2f 6c 69 ficult task.</li
57c0: 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 76 65 72 62 61 >..</ul>..<verba
57d0: 74 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 4e 54 tim>..INSERT INT
57e0: 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 O census2011_top
57f0: 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c 45 43 ofeatures..SELEC
5800: 54 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 T NULL, c.node_i
5810: 64 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20 63 2e d, c.edge_id, c.
5820: 66 61 63 65 5f 69 64 2c 20 33 2c 20 61 2e 66 69 face_id, 3, a.fi
5830: 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 d..FROM census20
5840: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 11_topofeatures_
5850: 33 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 3 AS a..JOIN cen
5860: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
5870: 75 72 65 73 5f 31 20 41 53 20 62 20 4f 4e 20 28 ures_1 AS b ON (
5880: 62 2e 63 6f 64 5f 63 6f 6d 20 3d 20 61 2e 63 6f b.cod_com = a.co
5890: 64 5f 63 6f 6d 29 0d 0a 4a 4f 49 4e 20 63 65 6e d_com)..JOIN cen
58a0: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
58b0: 75 72 65 73 20 41 53 20 63 20 4f 4e 20 28 63 2e ures AS c ON (c.
58c0: 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 31 topolayer_id = 1
58d0: 20 41 4e 44 20 63 2e 66 69 64 20 3d 20 62 2e 66 AND c.fid = b.f
58e0: 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d id);..</verbatim
58f0: 3e 0d 0a 57 65 20 63 61 6e 20 61 64 6f 70 74 20 >..We can adopt
5900: 65 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 exactly the same
5910: 20 69 64 65 6e 74 69 63 61 6c 20 61 70 70 72 6f identical appro
5920: 61 63 68 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 ach in order to
5930: 63 6f 6d 70 6c 65 74 65 20 3c 62 3e 74 6f 70 6f complete <b>topo
5940: 6c 61 79 65 72 3d 33 3c 2f 62 3e 20 63 6f 72 72 layer=3</b> corr
5950: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e esponding to <b>
5960: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f Municipalities</
5970: 62 3e 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d b>...<verbatim>.
5980: 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e .INSERT INTO cen
5990: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
59a0: 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c ures..SELECT NUL
59b0: 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e L, c.node_id, c.
59c0: 65 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f edge_id, c.face_
59d0: 69 64 2c 20 34 2c 20 61 2e 66 69 64 0d 0a 46 52 id, 4, a.fid..FR
59e0: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f OM census2011_to
59f0: 70 6f 66 65 61 74 75 72 65 73 5f 34 20 41 53 20 pofeatures_4 AS
5a00: 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 a..JOIN census20
5a10: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 11_topofeatures_
5a20: 33 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 3 AS b ON (b.cod
5a30: 5f 70 72 6f 76 20 3d 20 61 2e 63 6f 64 5f 70 72 _prov = a.cod_pr
5a40: 6f 76 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 ov)..JOIN census
5a50: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 2011_topofeature
5a60: 73 20 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70 s AS c ON (c.top
5a70: 6f 6c 61 79 65 72 5f 69 64 20 3d 20 33 20 41 4e olayer_id = 3 AN
5a80: 44 20 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 D c.fid = b.fid)
5a90: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a ;..</verbatim>..
5aa0: 4d 6f 72 65 20 6f 72 20 6c 65 73 73 20 74 68 65 More or less the
5ab0: 20 73 61 6d 65 20 69 73 20 66 6f 72 20 64 65 72 same is for der
5ac0: 69 76 69 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79 iving <b>topolay
5ad0: 65 72 3d 34 3c 2f 62 3e 20 63 6f 72 72 65 73 70 er=4</b> corresp
5ae0: 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 50 72 6f onding to <b>Pro
5af0: 76 69 6e 63 65 73 3c 2f 62 3e 3b 20 74 68 69 73 vinces</b>; this
5b00: 20 74 69 6d 65 20 77 65 27 6c 6c 20 73 69 6d 70 time we'll simp
5b10: 6c 79 20 61 67 67 72 65 67 61 74 65 20 74 68 65 ly aggregate the
5b20: 20 75 6e 64 65 72 6c 79 69 6e 67 20 4d 75 6e 69 underlying Muni
5b30: 63 69 70 61 6c 69 74 69 65 73 20 66 72 6f 6d 20 cipalities from
5b40: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 33 3c 2f <b>topolayer=3</
5b50: 62 3e 2e 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e b>...</verbatim>
5b60: 0d 0a 57 65 20 63 61 6e 20 61 64 6f 70 74 20 65 ..We can adopt e
5b70: 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 20 xactly the same
5b80: 69 64 65 6e 74 69 63 61 6c 20 61 70 70 72 6f 61 identical approa
5b90: 63 68 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 ch in order to c
5ba0: 6f 6d 70 6c 65 74 65 20 3c 62 3e 74 6f 70 6f 6c omplete <b>topol
5bb0: 61 79 65 72 3d 33 3c 2f 62 3e 20 63 6f 72 72 65 ayer=3</b> corre
5bc0: 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 4d sponding to <b>M
5bd0: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 unicipalities</b
5be0: 3e 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a >...<verbatim>..
5bf0: 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 INSERT INTO cens
5c00: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 us2011_topofeatu
5c10: 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c res..SELECT NULL
5c20: 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 , c.node_id, c.e
5c30: 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 dge_id, c.face_i
5c40: 64 2c 20 35 2c 20 61 2e 66 69 64 0d 0a 46 52 4f d, 5, a.fid..FRO
5c50: 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 M census2011_top
5c60: 6f 66 65 61 74 75 72 65 73 5f 35 20 41 53 20 61 ofeatures_5 AS a
5c70: 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 ..JOIN census201
5c80: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 1_topofeatures_4
5c90: 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f AS b ON (b.cod_
5ca0: 72 65 67 20 3d 20 61 2e 63 6f 64 5f 72 65 67 29 reg = a.cod_reg)
5cb0: 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 ..JOIN census201
5cc0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 1_topofeatures A
5cd0: 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 61 S c ON (c.topola
5ce0: 79 65 72 5f 69 64 20 3d 20 34 20 41 4e 44 20 63 yer_id = 4 AND c
5cf0: 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d 0a .fid = b.fid);..
5d00: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41 6e 64 </verbatim>..And
5d10: 20 66 69 6e 61 6c 6c 79 20 77 65 20 63 61 6e 20 finally we can
5d20: 64 65 72 69 76 65 20 3c 62 3e 74 6f 70 6f 6c 61 derive <b>topola
5d30: 79 65 72 3d 35 3c 2f 62 3e 20 63 6f 72 72 65 73 yer=5</b> corres
5d40: 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 52 65 ponding to <b>Re
5d50: 67 69 6f 6e 73 3c 2f 62 3e 20 62 79 20 64 69 72 gions</b> by dir
5d60: 65 63 74 6c 79 20 61 67 67 72 65 67 61 74 69 6e ectly aggregatin
5d70: 67 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 g the underlying
5d80: 20 50 72 6f 76 69 6e 63 65 73 20 66 72 6f 6d 20 Provinces from
5d90: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 34 3c 2f <b>topolayer=4</
5da0: 62 3e 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c b>...<br><br>..<
5db0: 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 table width="100
5dc0: 25 22 20 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 %" cellspan="4"
5dd0: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 cellpadding="6"
5de0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 bgcolor="#f8f8f
5df0: 30 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 0" border="1">..
5e00: 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 <tr><td>..<b>ste
5e10: 70 20 23 31 3a 20 65 78 70 6f 72 74 69 6e 67 20 p #1: exporting
5e20: 74 68 65 20 52 65 67 69 6f 6e 20 54 6f 70 6f 4c the Region TopoL
5e30: 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 ayer</b>..<verba
5e40: 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 tim>..SELECT Top
5e50: 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c oGeo_ExportTopoL
5e60: 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 ayer('census2011
5e70: 27 2c 20 27 72 65 67 27 2c 20 27 6f 75 74 5f 72 ', 'reg', 'out_r
5e80: 65 67 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c eg_2011', 1);..<
5e90: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65 20 61 /verbatim>..We a
5ea0: 72 65 20 6e 6f 77 20 64 65 66 69 6e 69 74 65 6c re now definitel
5eb0: 79 20 72 65 61 64 79 20 74 6f 20 65 78 70 6f 72 y ready to expor
5ec0: 74 20 61 6e 79 20 6f 74 68 65 72 20 41 64 6d 69 t any other Admi
5ed0: 6e 69 73 74 72 61 74 69 76 65 20 4c 65 76 65 6c nistrative Level
5ee0: 2e 3c 62 72 3e 0d 0a 46 6f 72 20 74 68 65 20 73 .<br>..For the s
5ef0: 61 6b 65 20 6f 66 20 63 6c 61 72 69 74 79 20 77 ake of clarity w
5f00: 65 27 6c 6c 20 66 6f 6c 6c 6f 77 20 61 20 74 6f e'll follow a to
5f10: 70 2d 62 6f 74 74 6f 6d 20 6f 72 64 65 72 2c 20 p-bottom order,
5f20: 73 6f 20 77 65 27 6c 6c 20 73 74 61 72 74 20 62 so we'll start b
5f30: 79 20 65 78 70 6f 72 74 69 6e 67 20 66 69 72 73 y exporting firs
5f40: 74 20 74 68 65 20 77 68 6f 6c 65 20 54 75 73 63 t the whole Tusc
5f50: 61 6e 79 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d any...</td><td>.
5f60: 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 .<img src="https
5f70: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e ://www.gaia-gis.
5f80: 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 it/gaia-sins/top
5f90: 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d ofigs/topolayer-
5fa0: 72 65 67 69 6f 6e 2e 70 6e 67 22 20 61 6c 74 3d region.png" alt=
5fb0: 22 74 6f 70 6f 6c 61 79 65 72 2d 72 65 67 69 6f "topolayer-regio
5fc0: 6e 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d n">..</td></tr>.
5fd0: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 .<tr><td>..<b>st
5fe0: 65 70 20 23 32 3a 20 65 78 70 6f 72 74 69 6e 67 ep #2: exporting
5ff0: 20 74 68 65 20 50 72 6f 76 69 6e 63 65 73 20 54 the Provinces T
6000: 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 opoLayer</b>..<v
6010: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 erbatim>..SELECT
6020: 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 TopoGeo_ExportT
6030: 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 opoLayer('census
6040: 32 30 31 31 27 2c 20 27 70 72 6f 76 27 2c 20 27 2011', 'prov', '
6050: 6f 75 74 5f 70 72 6f 76 5f 32 30 31 31 27 2c 20 out_prov_2011',
6060: 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 1);..</verbatim>
6070: 0d 0a 57 65 27 6c 6c 20 63 6f 6e 74 69 6e 75 65 ..We'll continue
6080: 20 62 79 20 65 78 70 6f 72 74 69 6e 67 20 61 6c by exporting al
6090: 6c 20 74 68 65 20 54 75 73 63 61 6e 79 20 50 72 l the Tuscany Pr
60a0: 6f 76 69 6e 63 65 73 2e 0d 0a 3c 2f 74 64 3e 3c ovinces...</td><
60b0: 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 td>..<img src="h
60c0: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
60d0: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 gis.it/gaia-sins
60e0: 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 /topofigs/topola
60f0: 79 65 72 2d 70 72 6f 76 69 6e 63 65 73 2e 70 6e yer-provinces.pn
6100: 67 22 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 g" alt="topolaye
6110: 72 2d 70 72 6f 76 69 6e 63 65 73 22 3e 0d 0a 3c r-provinces">..<
6120: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
6130: 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 33 3a td>..<b>step #3:
6140: 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20 4d exporting the M
6150: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20 54 6f unicipalities To
6160: 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 poLayer</b>..<ve
6170: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 rbatim>..SELECT
6180: 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f TopoGeo_ExportTo
6190: 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 poLayer('census2
61a0: 30 31 31 27 2c 20 27 63 6f 6d 27 2c 20 27 6f 75 011', 'com', 'ou
61b0: 74 5f 63 6f 6d 5f 32 30 31 31 27 2c 20 31 29 3b t_com_2011', 1);
61c0: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 ..</verbatim>..T
61d0: 68 65 6e 20 77 65 27 6c 6c 20 65 78 70 6f 72 74 hen we'll export
61e0: 20 61 6c 6c 20 74 68 65 20 54 75 73 63 61 6e 79 all the Tuscany
61f0: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2e Municipalities.
6200: 3c 62 72 3e 0d 0a 46 6f 72 20 62 65 74 74 65 72 <br>..For better
6210: 20 63 6c 61 72 69 74 79 20 74 68 65 20 66 69 67 clarity the fig
6220: 75 72 65 20 73 68 6f 77 73 20 61 20 6d 61 67 6e ure shows a magn
6230: 69 66 69 65 64 20 64 65 74 61 69 6c 20 63 65 6e ified detail cen
6240: 74 65 72 65 64 20 61 72 6f 75 6e 64 20 74 68 65 tered around the
6250: 20 49 73 6c 61 6e 64 20 6f 66 20 45 6c 62 61 2e Island of Elba.
6260: 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d ..</td><td>..<im
6270: 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 g src="https://w
6280: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 ww.gaia-gis.it/g
6290: 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 aia-sins/topofig
62a0: 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 6d 75 6e 69 s/topolayer-muni
62b0: 63 69 70 61 6c 69 74 69 65 73 2e 70 6e 67 22 20 cipalities.png"
62c0: 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d 6d alt="topolayer-m
62d0: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 22 3e 0d unicipalities">.
62e0: 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 .</td></tr>..<tr
62f0: 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 ><td>..<b>step #
6300: 34 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 4: exporting the
6310: 20 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 Populated Place
6320: 73 20 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d s TopoLayer</b>.
6330: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c .<verbatim>..SEL
6340: 45 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f ECT TopoGeo_Expo
6350: 72 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e rtTopoLayer('cen
6360: 73 75 73 32 30 31 31 27 2c 20 27 70 70 6c 27 2c sus2011', 'ppl',
6370: 20 27 6f 75 74 5f 70 70 6c 5f 32 30 31 31 27 2c 'out_ppl_2011',
6380: 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 1);..</verbatim
6390: 3e 0d 0a 41 6e 64 20 77 65 27 6c 6c 20 66 69 6e >..And we'll fin
63a0: 61 6c 6c 79 20 65 78 70 6f 72 74 20 61 6c 6c 20 ally export all
63b0: 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73 Populated Places
63c0: 2e 3c 62 72 3e 3c 62 72 3e 3c 62 72 3e 3c 62 72 .<br><br><br><br
63d0: 3e 0d 0a 3c 75 3e 43 6f 6e 63 6c 75 73 69 6f 6e >..<u>Conclusion
63e0: 3c 2f 75 3e 3a 20 77 65 20 73 74 61 72 74 65 64 </u>: we started
63f0: 20 74 68 69 73 20 61 64 76 61 6e 63 65 64 20 74 this advanced t
6400: 75 74 6f 72 69 61 6c 20 62 79 20 69 6d 70 6f 72 utorial by impor
6410: 74 69 6e 67 20 69 6e 74 6f 20 61 20 54 6f 70 6f ting into a Topo
6420: 6c 6f 67 79 20 6a 75 73 74 20 61 20 73 69 6e 67 logy just a sing
6430: 6c 65 20 6c 61 79 65 72 20 28 43 65 6e 73 75 73 le layer (Census
6440: 20 41 72 65 61 73 29 20 61 6e 64 20 6e 6f 77 20 Areas) and now
6450: 77 65 27 76 65 20 66 69 6e 69 73 68 65 64 20 62 we've finished b
6460: 79 20 70 72 6f 64 75 63 69 6e 67 20 61 20 63 6f y producing a co
6470: 6d 70 6c 65 74 65 20 73 65 74 20 6f 66 20 61 64 mplete set of ad
6480: 6d 69 6e 69 73 74 72 61 74 69 76 65 20 62 6f 75 ministrative bou
6490: 6e 64 61 72 69 65 73 20 61 74 20 64 69 66 66 65 ndaries at diffe
64a0: 72 65 6e 74 20 68 69 65 72 61 72 63 68 69 63 61 rent hierarchica
64b0: 6c 20 6c 65 76 65 6c 73 3a 0d 0a 3c 75 6c 3e 0d l levels:..<ul>.
64c0: 0a 3c 6c 69 3e 50 6f 70 75 6c 61 74 65 64 20 50 .<li>Populated P
64d0: 6c 61 63 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e laces</li>..<li>
64e0: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f Municipalities</
64f0: 6c 69 3e 0d 0a 3c 6c 69 3e 50 72 6f 76 69 6e 63 li>..<li>Provinc
6500: 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 52 65 67 es</li>..<li>Reg
6510: 69 6f 6e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d ion</li>..</ul>.
6520: 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 .</td><td>..<img
6530: 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 src="https://ww
6540: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 w.gaia-gis.it/ga
6550: 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 ia-sins/topofigs
6560: 2f 74 6f 70 6f 6c 61 79 65 72 2d 70 6f 70 75 6c /topolayer-popul
6570: 61 74 65 64 2d 70 6c 61 63 65 73 2e 70 6e 67 22 ated-places.png"
6580: 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d alt="topolayer-
6590: 70 6f 70 75 6c 61 74 65 64 2d 70 6c 61 63 65 73 populated-places
65a0: 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a ">..</td></tr>..
65b0: 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 </table><br>..<h
65c0: 72 3e 0d 0a 3c 68 33 3e 52 65 63 65 6e 74 20 63 r>..<h3>Recent c
65d0: 68 61 6e 67 65 73 3a 20 6f 6c 64 20 4d 75 6e 69 hanges: old Muni
65e0: 63 69 70 61 6c 69 74 69 65 73 20 6d 65 72 67 69 cipalities mergi
65f0: 6e 67 20 69 6e 74 6f 20 6e 65 77 20 4d 75 6e 69 ng into new Muni
6600: 63 69 70 61 6c 69 74 69 65 73 3c 2f 68 33 3e 0d cipalities</h3>.
6610: 0a 49 66 20 79 6f 75 20 72 65 6d 65 6d 62 65 72 .If you remember
6620: 20 74 68 65 20 69 6e 69 74 69 61 6c 20 3c 62 3e the initial <b>
6630: 74 75 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32 tuscany-census-2
6640: 30 31 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 20 44 011.sqlite</b> D
6650: 42 2d 66 69 6c 65 20 63 6f 6e 74 61 69 6e 73 20 B-file contains
6660: 61 20 3c 62 3e 63 6f 6d 5f 32 30 31 34 5f 31 35 a <b>com_2014_15
6670: 3c 2f 62 3e 20 54 61 62 6c 65 3b 20 64 75 72 69 </b> Table; duri
6680: 6e 67 20 79 65 61 72 73 20 32 30 31 34 20 61 6e ng years 2014 an
6690: 64 20 32 30 31 35 20 66 65 77 20 4d 75 6e 69 63 d 2015 few Munic
66a0: 69 70 61 6c 69 74 69 65 73 20 6d 65 72 67 65 64 ipalities merged
66b0: 20 74 77 6f 20 62 79 20 74 77 6f 20 74 68 75 73 two by two thus
66c0: 20 67 69 76 69 6e 67 20 62 69 72 74 68 20 74 6f giving birth to
66d0: 20 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74 new Municipalit
66e0: 69 65 73 2e 20 54 68 69 73 20 69 73 20 74 68 65 ies. This is the
66f0: 20 66 75 6c 6c 20 6c 69 73 74 3a 3c 62 72 3e 3c full list:<br><
6700: 62 72 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c br>..<table cell
6710: 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 span="4" cellpad
6720: 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 ding="6" bgcolor
6730: 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 ="#f8f8f0" borde
6740: 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 r="1">..<tr><td
6750: 63 6f 6c 73 70 61 6e 3d 22 33 22 20 61 6c 69 67 colspan="3" alig
6760: 6e 3d 22 63 65 6e 74 65 72 22 20 62 67 63 6f 6c n="center" bgcol
6770: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e or="#f0f0f8"><b>
6780: 4e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74 79 New Municipality
6790: 20 28 32 30 31 34 2f 31 35 29 3c 2f 62 3e 3c 2f (2014/15)</b></
67a0: 74 64 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 td><td colspan="
67b0: 32 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 2" align="center
67c0: 22 20 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 " bgcolor="#f0f
67d0: 38 66 38 22 3e 3c 62 3e 73 75 70 70 72 65 73 73 8f8"><b>suppress
67e0: 65 64 20 23 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 ed #1</b></td><t
67f0: 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22 20 61 6c d colspan="2" al
6800: 69 67 6e 3d 22 63 65 6e 74 65 72 22 20 62 67 63 ign="center" bgc
6810: 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 3c olor="#f8f0f8"><
6820: 62 3e 73 75 70 70 72 65 73 73 65 64 20 23 32 3c b>suppressed #2<
6830: 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c /b></td></tr>..<
6840: 74 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 tr><td bgcolor="
6850: 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f #f0f0f8"><b>cod_
6860: 70 72 6f 76 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 prov</b></td><td
6870: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
6880: 38 22 3e 3c 62 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 8"><b>cod_com</b
6890: 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f ></td><td bgcolo
68a0: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e r="#f0f0f8"><b>n
68b0: 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 ame</b></td><td
68c0: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 bgcolor="#f0f8f8
68d0: 22 3e 3c 62 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e "><b>cod_com</b>
68e0: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 </td><td bgcolor
68f0: 3d 22 23 66 30 66 38 66 38 22 3e 3c 62 3e 6e 61 ="#f0f8f8"><b>na
6900: 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 me</b></td><td b
6910: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 gcolor="#f8f0f8"
6920: 3e 3c 62 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c ><b>cod_com</b><
6930: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d /td><td bgcolor=
6940: 22 23 66 38 66 30 66 38 22 3e 3c 62 3e 6e 61 6d "#f8f0f8"><b>nam
6950: 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d e</b></td></tr>.
6960: 0a 3c 74 72 3e 3c 74 64 3e 41 52 3c 2f 74 64 3e .<tr><td>AR</td>
6970: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
6980: 22 3e 35 31 30 34 30 3c 2f 74 64 3e 3c 74 64 3e ">51040</td><td>
6990: 43 61 73 74 65 6c 66 72 61 6e 63 6f 20 50 69 61 Castelfranco Pia
69a0: 6e 64 69 73 63 c3 b2 3c 2f 74 64 3e 3c 74 64 20 ndisc..</td><td
69b0: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 bgcolor="#f0f8f8
69c0: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e " align="right">
69d0: 35 31 30 30 39 3c 2f 74 64 20 62 67 63 6f 6c 6f 51009</td bgcolo
69e0: 72 3d 22 23 66 30 66 38 66 38 22 3e 3c 74 64 20 r="#f0f8f8"><td
69f0: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 bgcolor="#f0f8f8
6a00: 22 3e 43 61 73 74 65 6c 66 72 61 6e 63 6f 20 64 ">Castelfranco d
6a10: 69 20 53 6f 70 72 61 3c 2f 74 64 3e 3c 74 64 20 i Sopra</td><td
6a20: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 bgcolor="#f8f0f8
6a30: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e " align="right">
6a40: 35 31 30 32 39 3c 2f 74 64 3e 3c 74 64 20 62 67 51029</td><td bg
6a50: 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e color="#f8f0f8">
6a60: 50 69 61 6e 20 64 69 20 53 63 6f 3c 2f 74 64 3e Pian di Sco</td>
6a70: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 41 </tr>..<tr><td>A
6a80: 52 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d R</td><td align=
6a90: 22 72 69 67 68 74 22 3e 35 31 30 34 31 3c 2f 74 "right">51041</t
6aa0: 64 3e 3c 74 64 3e 50 72 61 74 6f 76 65 63 63 68 d><td>Pratovecch
6ab0: 69 6f 20 53 74 69 61 3c 2f 74 64 3e 3c 74 64 20 io Stia</td><td
6ac0: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 bgcolor="#f0f8f8
6ad0: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e " align="right">
6ae0: 35 31 30 33 32 3c 2f 74 64 3e 3c 74 64 20 62 67 51032</td><td bg
6af0: 63 6f 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 3e color="#f0f8f8">
6b00: 50 72 61 74 6f 76 65 63 63 68 69 6f 3c 2f 74 64 Pratovecchio</td
6b10: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 ><td bgcolor="#f
6b20: 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22 72 69 8f0f8" align="ri
6b30: 67 68 74 22 3e 35 31 30 33 36 3c 2f 74 64 3e 3c ght">51036</td><
6b40: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 td bgcolor="#f8f
6b50: 30 66 38 22 3e 53 74 69 61 3c 2f 74 64 3e 3c 2f 0f8">Stia</td></
6b60: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 46 49 3c tr>..<tr><td>FI<
6b70: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
6b80: 69 67 68 74 22 3e 34 38 30 35 32 3c 2f 74 64 3e ight">48052</td>
6b90: 3c 74 64 3e 46 69 67 6c 69 6e 65 20 65 20 49 6e <td>Figline e In
6ba0: 63 69 73 61 20 56 61 6c 64 61 72 6e 6f 3c 2f 74 cisa Valdarno</t
6bb0: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 d><td bgcolor="#
6bc0: 66 30 66 38 66 38 22 20 61 6c 69 67 6e 3d 22 72 f0f8f8" align="r
6bd0: 69 67 68 74 22 3e 34 38 30 31 36 3c 2f 74 64 3e ight">48016</td>
6be0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 <td bgcolor="#f0
6bf0: 66 38 66 38 22 3e 46 69 67 6c 69 6e 65 20 56 61 f8f8">Figline Va
6c00: 6c 64 61 72 6e 6f 3c 2f 74 64 3e 3c 74 64 20 62 ldarno</td><td b
6c10: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 gcolor="#f8f0f8"
6c20: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 align="right">4
6c30: 38 30 32 33 3c 2f 74 64 3e 3c 74 64 20 62 67 63 8023</td><td bgc
6c40: 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 49 olor="#f8f0f8">I
6c50: 6e 63 69 73 61 20 69 6e 20 56 61 6c 20 64 27 41 ncisa in Val d'A
6c60: 72 6e 6f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c rno</td></tr>..<
6c70: 74 72 3e 3c 74 64 3e 46 49 3c 2f 74 64 3e 3c 74 tr><td>FI</td><t
6c80: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
6c90: 34 38 30 35 33 3c 2f 74 64 3e 3c 74 64 3e 53 63 48053</td><td>Sc
6ca0: 61 72 70 65 72 69 61 20 65 20 53 61 6e 20 50 69 arperia e San Pi
6cb0: 65 72 6f 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f ero</td><td bgco
6cc0: 6c 6f 72 3d 22 23 66 30 66 38 66 38 22 20 61 6c lor="#f0f8f8" al
6cd0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 30 34 ign="right">4804
6ce0: 32 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 2</td><td bgcolo
6cf0: 72 3d 22 23 66 30 66 38 66 38 22 3e 53 63 61 72 r="#f0f8f8">Scar
6d00: 70 65 72 69 61 3c 2f 74 64 3e 3c 74 64 20 62 67 peria</td><td bg
6d10: 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 20 color="#f8f0f8"
6d20: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 align="right">48
6d30: 30 34 30 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 040</td><td bgco
6d40: 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 53 61 lor="#f8f0f8">Sa
6d50: 6e 20 50 69 65 72 6f 20 61 20 53 69 65 76 65 3c n Piero a Sieve<
6d60: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
6d70: 74 64 3e 4c 55 3c 2f 74 64 3e 3c 74 64 20 61 6c td>LU</td><td al
6d80: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 36 30 33 ign="right">4603
6d90: 36 3c 2f 74 64 3e 3c 74 64 3e 46 61 62 62 72 69 6</td><td>Fabbri
6da0: 63 68 65 20 64 69 20 56 65 72 67 65 6d 6f 6c 69 che di Vergemoli
6db0: 3c 2f 74 64 3e 3c 74 64 20 20 62 67 63 6f 6c 6f </td><td bgcolo
6dc0: 72 3d 22 23 66 30 66 38 66 38 22 20 61 6c 69 67 r="#f0f8f8" alig
6dd0: 6e 3d 22 72 69 67 68 74 22 3e 34 36 30 31 32 3c n="right">46012<
6de0: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d /td><td bgcolor=
6df0: 22 23 66 30 66 38 66 38 22 3e 46 61 62 62 72 69 "#f0f8f8">Fabbri
6e00: 63 68 65 20 64 69 20 56 61 6c 6c 69 63 6f 3c 2f che di Vallico</
6e10: 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 td><td bgcolor="
6e20: 23 66 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22 #f8f0f8" align="
6e30: 72 69 67 68 74 22 3e 34 36 30 33 32 3c 2f 74 64 right">46032</td
6e40: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 ><td bgcolor="#f
6e50: 38 66 30 66 38 22 3e 56 65 72 67 65 6d 6f 6c 69 8f0f8">Vergemoli
6e60: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
6e70: 3c 74 64 3e 4c 55 3c 2f 74 64 3e 3c 74 64 20 61 <td>LU</td><td a
6e80: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 36 30 lign="right">460
6e90: 33 37 3c 2f 74 64 3e 3c 74 64 3e 53 69 6c 6c 61 37</td><td>Silla
6ea0: 6e 6f 20 47 69 75 6e 63 75 67 6e 61 6e 6f 3c 2f no Giuncugnano</
6eb0: 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 td><td bgcolor="
6ec0: 23 66 30 66 38 66 38 22 61 6c 69 67 6e 3d 22 72 #f0f8f8"align="r
6ed0: 69 67 68 74 22 3e 34 36 30 32 39 3c 2f 74 64 3e ight">46029</td>
6ee0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 <td bgcolor="#f0
6ef0: 66 38 66 38 22 3e 53 69 6c 6c 61 6e 6f 3c 2f 74 f8f8">Sillano</t
6f00: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 d><td bgcolor="#
6f10: 66 38 66 30 66 38 22 20 61 6c 69 67 6e 3d 22 72 f8f0f8" align="r
6f20: 69 67 68 74 22 3e 34 36 30 31 36 3c 2f 74 64 3e ight">46016</td>
6f30: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 <td bgcolor="#f8
6f40: 66 30 66 38 22 3e 47 69 75 6e 63 75 67 6e 61 6e f0f8">Giuncugnan
6f50: 6f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 o</td></tr>..<tr
6f60: 3e 3c 74 64 3e 50 49 3c 2f 74 64 3e 3c 74 64 20 ><td>PI</td><td
6f70: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 30 align="right">50
6f80: 30 35 30 3c 2f 74 64 3e 3c 74 64 3e 43 61 73 63 050</td><td>Casc
6f90: 69 61 6e 61 20 54 65 72 6d 65 20 4c 61 72 69 3c iana Terme Lari<
6fa0: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d /td><td bgcolor=
6fb0: 22 23 66 30 66 38 66 38 22 20 61 6c 69 67 6e 3d "#f0f8f8" align=
6fc0: 22 72 69 67 68 74 22 3e 35 30 30 30 37 3c 2f 74 "right">50007</t
6fd0: 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 d><td bgcolor="#
6fe0: 66 30 66 38 66 38 22 3e 43 61 73 63 69 61 6e 61 f0f8f8">Casciana
6ff0: 20 54 65 72 6d 65 3c 2f 74 64 3e 3c 74 64 20 62 Terme</td><td b
7000: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 gcolor="#f8f0f8"
7010: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 align="right">5
7020: 30 30 31 37 3c 2f 74 64 3e 3c 74 64 20 62 67 63 0017</td><td bgc
7030: 6f 6c 6f 72 3d 22 23 66 38 66 30 66 38 22 3e 4c olor="#f8f0f8">L
7040: 61 72 69 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c ari</td></tr>..<
7050: 74 72 3e 3c 74 64 3e 50 49 3c 2f 74 64 3e 3c 74 tr><td>PI</td><t
7060: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
7070: 35 30 30 34 31 3c 2f 74 64 3e 3c 74 64 3e 43 72 50041</td><td>Cr
7080: 65 73 70 69 6e 61 20 4c 6f 72 65 6e 7a 61 6e 61 espina Lorenzana
7090: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 </td><td bgcolor
70a0: 3d 22 23 66 30 66 38 66 38 22 20 61 6c 69 67 6e ="#f0f8f8" align
70b0: 3d 22 72 69 67 68 74 22 3e 35 30 30 31 33 3c 2f ="right">50013</
70c0: 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 td><td bgcolor="
70d0: 23 66 30 66 38 66 38 22 3e 43 72 65 73 70 69 6e #f0f8f8">Crespin
70e0: 61 3c 2f 74 64 3e 3c 74 64 20 20 62 67 63 6f 6c a</td><td bgcol
70f0: 6f 72 3d 22 23 66 38 66 30 66 38 22 20 61 6c 69 or="#f8f0f8" ali
7100: 67 6e 3d 22 72 69 67 68 74 22 3e 35 30 30 31 38 gn="right">50018
7110: 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 </td><td bgcolor
7120: 3d 22 23 66 38 66 30 66 38 22 3e 4c 6f 72 65 6e ="#f8f0f8">Loren
7130: 7a 61 6e 61 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a zana</td></tr>..
7140: 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 62 72 3e 0d 0a </table>..<br>..
7150: 53 75 63 68 20 63 68 61 6e 67 65 73 20 73 69 6d Such changes sim
7160: 70 6c 79 20 61 66 66 65 63 74 73 20 4d 75 6e 69 ply affects Muni
7170: 63 69 70 61 6c 69 74 69 65 73 3b 20 50 72 6f 76 cipalities; Prov
7180: 69 6e 63 65 73 20 61 72 65 20 75 6e 61 66 66 65 inces are unaffe
7190: 63 74 65 64 20 62 79 20 74 68 69 73 20 70 72 6f cted by this pro
71a0: 63 65 73 73 3b 20 73 6f 20 77 65 20 63 61 6e 20 cess; so we can
71b0: 6e 6f 77 20 64 75 6c 79 20 67 65 6e 65 72 61 74 now duly generat
71c0: 65 20 61 20 66 75 72 74 68 65 72 20 6c 61 79 65 e a further laye
71d0: 72 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 r corresponding
71e0: 74 6f 20 32 30 31 35 20 4d 75 6e 69 63 69 70 61 to 2015 Municipa
71f0: 6c 69 74 69 65 73 2c 20 61 6e 64 20 77 65 20 73 lities, and we s
7200: 69 6d 70 6c 79 20 68 61 76 65 20 74 6f 20 73 6c imply have to sl
7210: 69 67 68 74 6c 79 20 72 65 61 72 72 61 6e 67 65 ightly rearrange
7220: 20 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 73 2f the TopoLayers/
7230: 54 6f 70 6f 46 65 61 74 75 72 65 73 20 64 65 66 TopoFeatures def
7240: 69 6e 69 74 69 6f 6e 73 20 69 6e 20 6f 72 64 65 initions in orde
7250: 72 20 74 6f 20 61 63 68 69 65 76 65 20 74 68 69 r to achieve thi
7260: 73 20 66 75 72 74 68 65 72 20 67 6f 61 6c 2e 0d s further goal..
7270: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 41 54 54 .<verbatim>..ATT
7280: 41 43 48 20 44 41 54 41 42 41 53 45 20 22 2e 2f ACH DATABASE "./
7290: 74 75 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32 tuscany-census-2
72a0: 30 31 31 2e 73 71 6c 69 74 65 22 20 41 53 20 69 011.sqlite" AS i
72b0: 73 74 61 74 3b 0d 0a 0d 0a 43 52 45 41 54 45 20 stat;....CREATE
72c0: 54 41 42 4c 45 20 63 6f 6d 32 30 31 35 20 41 53 TABLE com2015 AS
72d0: 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 ..SELECT * FROM
72e0: 69 73 74 61 74 2e 70 6f 70 5f 63 6f 6d 5f 32 30 istat.pop_com_20
72f0: 31 31 3b 0d 0a 0d 0a 49 4e 53 45 52 54 20 49 4e 11;....INSERT IN
7300: 54 4f 20 63 6f 6d 32 30 31 35 0d 0a 53 45 4c 45 TO com2015..SELE
7310: 43 54 20 61 2e 63 6f 64 5f 63 6f 6d 2c 20 61 2e CT a.cod_com, a.
7320: 63 6f 64 5f 70 72 6f 76 2c 20 61 2e 63 6f 64 5f cod_prov, a.cod_
7330: 69 73 74 61 74 2c 20 61 2e 63 6f 64 5f 63 61 64 istat, a.cod_cad
7340: 61 73 74 72 65 2c 20 61 2e 6e 61 6d 65 2c 20 61 astre, a.name, a
7350: 2e 74 6f 77 6e 68 61 6c 6c 5f 61 64 64 72 2c 0d .townhall_addr,.
7360: 0a 20 20 20 20 53 75 6d 28 62 2e 70 6f 70 5f 32 . Sum(b.pop_2
7370: 30 31 31 29 2c 20 53 75 6d 28 62 2e 6d 5f 32 30 011), Sum(b.m_20
7380: 31 31 29 2c 20 53 75 6d 28 62 2e 66 5f 32 30 31 11), Sum(b.f_201
7390: 31 29 0d 0a 46 52 4f 4d 20 69 73 74 61 74 2e 63 1)..FROM istat.c
73a0: 6f 6d 5f 32 30 31 34 5f 31 35 20 41 53 20 61 0d om_2014_15 AS a.
73b0: 0a 4a 4f 49 4e 20 69 73 74 61 74 2e 70 6f 70 5f .JOIN istat.pop_
73c0: 63 6f 6d 5f 32 30 31 31 20 41 53 20 62 20 4f 4e com_2011 AS b ON
73d0: 20 28 62 2e 63 6f 64 5f 63 6f 6d 20 49 4e 20 28 (b.cod_com IN (
73e0: 61 2e 6f 6c 64 5f 63 6f 64 5f 63 6f 6d 5f 31 2c a.old_cod_com_1,
73f0: 20 61 2e 6f 6c 64 5f 63 6f 64 5f 63 6f 6d 5f 32 a.old_cod_com_2
7400: 29 29 0d 0a 47 52 4f 55 50 20 42 59 20 61 2e 63 ))..GROUP BY a.c
7410: 6f 64 5f 63 6f 6d 3b 0d 0a 0d 0a 44 45 54 41 43 od_com;....DETAC
7420: 48 20 44 41 54 41 42 41 53 45 20 69 73 74 61 74 H DATABASE istat
7430: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a ;..</verbatim>..
7440: 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 77 65 27 6c 6c 20 <ol>..<li>we'll
7450: 3c 69 3e 61 74 74 61 63 68 3c 2f 69 3e 20 79 65 <i>attach</i> ye
7460: 74 20 61 6e 6f 74 68 65 72 20 74 69 6d 65 20 74 t another time t
7470: 68 65 20 69 6e 69 74 69 61 6c 20 3c 62 3e 74 75 he initial <b>tu
7480: 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 scany-census-201
7490: 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 20 44 42 2d 1.sqlite</b> DB-
74a0: 66 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e file.</li>..<li>
74b0: 77 65 27 6c 6c 20 63 72 65 61 74 65 20 61 20 6e we'll create a n
74c0: 65 77 20 3c 62 3e 63 6f 6d 32 30 31 35 3c 2f 62 ew <b>com2015</b
74d0: 3e 20 74 61 62 6c 65 20 62 79 20 6a 75 73 74 20 > table by just
74e0: 6a 75 73 74 20 63 6f 70 79 69 6e 67 20 74 68 65 just copying the
74f0: 20 3c 62 3e 69 73 74 61 74 2e 70 6f 70 5f 63 6f <b>istat.pop_co
7500: 6d 5f 32 30 31 31 3c 2f 62 3e 20 56 69 65 77 2e m_2011</b> View.
7510: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6e 64 20 66 </li>..<li>and f
7520: 69 6e 61 6c 6c 79 20 77 65 27 6c 6c 20 61 70 70 inally we'll app
7530: 65 6e 64 20 74 6f 20 74 68 65 20 73 61 6d 65 20 end to the same
7540: 74 61 62 6c 65 20 74 68 65 20 6e 65 77 20 4d 75 table the new Mu
7550: 6e 69 63 69 70 61 6c 69 74 69 65 73 20 66 72 6f nicipalities fro
7560: 6d 20 74 68 65 20 3c 62 3e 69 73 74 61 74 2e 63 m the <b>istat.c
7570: 6f 6d 5f 32 30 31 34 5f 31 35 3c 2f 62 3e 20 74 om_2014_15</b> t
7580: 61 62 6c 65 3b 20 64 75 72 69 6e 67 20 74 68 69 able; during thi
7590: 73 20 73 74 65 70 20 77 65 27 6c 6c 20 63 6f 6d s step we'll com
75a0: 70 75 74 65 20 74 68 65 20 50 6f 70 75 6c 61 74 pute the Populat
75b0: 69 6f 6e 20 32 30 31 31 20 63 65 6e 73 75 73 20 ion 2011 census
75c0: 76 61 6c 75 65 73 2e 3c 62 72 3e 0d 0a 3c 75 3e values.<br>..<u>
75d0: 4e 6f 74 65 3c 2f 75 3e 3a 20 61 66 74 65 72 20 Note</u>: after
75e0: 63 6f 6d 70 6c 65 74 69 6e 67 20 74 68 65 20 61 completing the a
75f0: 62 6f 76 65 20 73 74 65 70 73 20 6e 6f 77 20 74 bove steps now t
7600: 68 65 20 3c 62 3e 63 6f 6d 32 30 31 35 3c 2f 62 he <b>com2015</b
7610: 3e 20 74 61 62 6c 65 20 63 6f 6e 74 61 69 6e 73 > table contains
7620: 20 62 6f 74 68 20 73 75 70 70 72 65 73 73 65 64 both suppressed
7630: 20 61 6e 64 20 6e 65 77 20 4d 75 6e 69 63 69 70 and new Municip
7640: 61 6c 69 74 69 65 73 3c 2f 6c 69 3e 0d 0a 3c 2f alities</li>..</
7650: 6f 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d ol>..<verbatim>.
7660: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f .SELECT TopoGeo_
7670: 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 InitTopoLayer('c
7680: 65 6e 73 75 73 32 30 31 31 27 2c 20 4e 55 4c 4c ensus2011', NULL
7690: 2c 20 27 63 6f 6d 32 30 31 35 27 2c 20 27 63 6f , 'com2015', 'co
76a0: 6d 32 30 31 35 27 29 3b 0d 0a 0d 0a 49 4e 53 45 m2015');....INSE
76b0: 52 54 20 49 4e 54 4f 20 63 65 6e 73 75 73 32 30 RT INTO census20
76c0: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 0d 11_topofeatures.
76d0: 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 61 2e .SELECT NULL, a.
76e0: 6e 6f 64 65 5f 69 64 2c 20 61 2e 65 64 67 65 5f node_id, a.edge_
76f0: 69 64 2c 20 61 2e 66 61 63 65 5f 69 64 2c 20 36 id, a.face_id, 6
7700: 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20 63 65 , a.fid..FROM ce
7710: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
7720: 74 75 72 65 73 20 41 53 20 61 0d 0a 4a 4f 49 4e tures AS a..JOIN
7730: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f census2011_topo
7740: 66 65 61 74 75 72 65 73 5f 33 20 41 53 20 62 20 features_3 AS b
7750: 4f 4e 20 28 61 2e 74 6f 70 6f 6c 61 79 65 72 5f ON (a.topolayer_
7760: 69 64 20 3d 20 33 20 41 4e 44 20 61 2e 66 69 64 id = 3 AND a.fid
7770: 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 = b.fid);..</ve
7780: 72 62 61 74 69 6d 3e 0d 0a 4e 6f 74 68 69 6e 67 rbatim>..Nothing
7790: 20 72 65 61 6c 6c 79 20 69 6e 74 65 72 65 73 74 really interest
77a0: 69 6e 67 20 69 6e 20 74 68 69 73 2c 20 62 65 63 ing in this, bec
77b0: 61 75 73 65 20 77 65 20 61 6c 72 65 61 64 79 20 ause we already
77c0: 70 65 72 66 6f 72 6d 65 64 20 74 68 69 73 20 73 performed this s
77d0: 74 65 70 20 64 75 72 69 6e 67 20 74 68 65 20 70 tep during the p
77e0: 72 65 76 69 6f 75 73 20 65 78 65 72 63 69 73 65 revious exercise
77f0: 2e 20 57 65 27 76 65 20 73 69 6d 70 6c 79 20 69 . We've simply i
7800: 6e 69 74 69 61 6c 69 7a 65 64 20 79 65 74 20 61 nitialized yet a
7810: 6e 6f 74 68 65 72 20 54 6f 70 6f 4c 61 79 65 72 nother TopoLayer
7820: 73 2c 20 61 6e 64 20 77 65 27 76 65 20 63 6f 70 s, and we've cop
7830: 69 65 64 20 69 6e 74 6f 20 69 74 20 74 68 65 20 ied into it the
7840: 73 61 6d 65 20 54 6f 70 6f 46 65 61 74 75 72 65 same TopoFeature
7850: 73 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 61 6c s definitions al
7860: 72 65 61 64 79 20 73 75 70 70 6f 72 74 69 6e 67 ready supporting
7870: 20 32 30 31 31 20 4d 75 6e 69 63 69 70 61 6c 69 2011 Municipali
7880: 74 69 65 73 2e 0d 0a 3c 76 65 72 62 61 74 69 6d ties...<verbatim
7890: 3e 0d 0a 55 50 44 41 54 45 20 63 65 6e 73 75 73 >..UPDATE census
78a0: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 2011_topofeature
78b0: 73 0d 0a 53 45 54 20 66 69 64 20 3d 20 28 53 45 s..SET fid = (SE
78c0: 4c 45 43 54 20 66 69 64 20 46 52 4f 4d 20 63 65 LECT fid FROM ce
78d0: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
78e0: 74 75 72 65 73 5f 36 20 57 48 45 52 45 20 63 6f tures_6 WHERE co
78f0: 64 5f 63 6f 6d 20 3d 20 35 31 30 34 30 29 0d 0a d_com = 51040)..
7900: 57 48 45 52 45 20 74 6f 70 6f 6c 61 79 65 72 5f WHERE topolayer_
7910: 69 64 20 3d 20 36 20 41 4e 44 20 66 69 64 20 49 id = 6 AND fid I
7920: 4e 20 28 53 45 4c 45 43 54 20 66 69 64 20 46 52 N (SELECT fid FR
7930: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f OM census2011_to
7940: 70 6f 66 65 61 74 75 72 65 73 5f 36 20 57 48 45 pofeatures_6 WHE
7950: 52 45 20 63 6f 64 5f 63 6f 6d 20 69 6e 20 28 35 RE cod_com in (5
7960: 31 30 30 39 2c 20 35 31 30 32 39 29 29 3b 0d 0a 1009, 51029));..
7970: 0d 0a 55 50 44 41 54 45 20 63 65 6e 73 75 73 32 ..UPDATE census2
7980: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 011_topofeatures
7990: 0d 0a 53 45 54 20 66 69 64 20 3d 20 28 53 45 4c ..SET fid = (SEL
79a0: 45 43 54 20 66 69 64 20 46 52 4f 4d 20 63 65 6e ECT fid FROM cen
79b0: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
79c0: 75 72 65 73 5f 36 20 57 48 45 52 45 20 63 6f 64 ures_6 WHERE cod
79d0: 5f 63 6f 6d 20 3d 20 35 31 30 34 31 29 0d 0a 57 _com = 51041)..W
79e0: 48 45 52 45 20 74 6f 70 6f 6c 61 79 65 72 5f 69 HERE topolayer_i
79f0: 64 20 3d 20 36 20 41 4e 44 20 66 69 64 20 49 4e d = 6 AND fid IN
7a00: 20 28 53 45 4c 45 43 54 20 66 69 64 20 46 52 4f (SELECT fid FRO
7a10: 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 M census2011_top
7a20: 6f 66 65 61 74 75 72 65 73 5f 36 20 57 48 45 52 ofeatures_6 WHER
7a30: 45 20 63 6f 64 5f 63 6f 6d 20 69 6e 20 28 35 31 E cod_com in (51
7a40: 30 33 32 2c 20 35 31 30 33 36 29 29 3b 0d 0a 3c 032, 51036));..<
7a50: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 4e 6f 77 20 /verbatim>..Now
7a60: 77 65 27 76 65 20 73 69 6d 70 6c 79 20 75 70 64 we've simply upd
7a70: 61 74 65 64 20 61 6c 6c 20 72 65 6c 61 74 69 6f ated all relatio
7a80: 6e 73 68 69 70 73 20 62 65 74 77 65 65 6e 20 54 nships between T
7a90: 6f 70 6f 6c 6f 67 79 20 46 61 63 65 73 20 61 6e opology Faces an
7aa0: 64 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 62 d TopoFeatures b
7ab0: 79 20 74 72 61 6e 73 66 65 72 72 69 6e 67 20 74 y transferring t
7ac0: 68 65 6d 20 66 72 6f 6d 20 3c 62 3e 35 31 30 30 hem from <b>5100
7ad0: 39 20 3c 69 3e 43 61 73 74 65 6c 66 72 61 6e 63 9 <i>Castelfranc
7ae0: 6f 20 64 69 20 53 6f 70 72 61 3c 2f 69 3e 3c 2f o di Sopra</i></
7af0: 62 3e 20 61 6e 64 20 3c 62 3e 35 31 30 32 39 20 b> and <b>51029
7b00: 3c 69 3e 50 69 61 6e 20 64 69 20 53 63 6f 3c 2f <i>Pian di Sco</
7b10: 69 3e 3c 2f 62 3e 20 74 6f 20 3c 62 3e 35 31 30 i></b> to <b>510
7b20: 34 35 20 3c 69 3e 43 61 73 74 65 6c 66 72 61 6e 45 <i>Castelfran
7b30: 63 6f 20 50 69 61 6e 64 69 73 63 c3 b2 3c 2f 69 co Piandisc..</i
7b40: 3e 3c 2f 62 3e 2e 20 54 68 65 6e 20 77 65 27 76 ></b>. Then we'v
7b50: 65 20 72 65 70 6c 69 65 64 20 74 68 65 20 73 61 e replied the sa
7b60: 6d 65 20 61 63 74 69 6f 6e 2e 66 72 6f 6d 20 3c me action.from <
7b70: 62 3e 35 31 30 33 32 20 3c 69 3e 50 72 61 74 6f b>51032 <i>Prato
7b80: 76 65 63 63 68 69 6f 3c 2f 69 3e 3c 2f 62 3e 20 vecchio</i></b>
7b90: 61 6e 64 20 3c 62 3e 35 31 30 34 31 20 3c 69 3e and <b>51041 <i>
7ba0: 53 74 69 61 3c 2f 69 3e 3c 2f 62 3e 20 74 6f 20 Stia</i></b> to
7bb0: 3c 62 3e 35 31 30 34 31 20 3c 69 3e 50 72 61 74 <b>51041 <i>Prat
7bc0: 6f 76 65 63 63 68 69 6f 20 53 74 69 61 3c 2f 69 ovecchio Stia</i
7bd0: 3e 3c 2f 62 3e 20 73 6f 20 74 6f 20 63 6f 72 72 ></b> so to corr
7be0: 65 63 74 6c 79 20 75 70 64 61 74 65 20 61 6c 6c ectly update all
7bf0: 20 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74 new Municipalit
7c00: 69 65 73 20 69 6e 74 65 72 65 73 74 69 6e 67 20 ies interesting
7c10: 74 68 65 20 50 72 6f 76 69 6e 63 65 20 6f 66 20 the Province of
7c20: 41 72 65 7a 7a 6f 2e 3c 62 72 3e 0d 0a 59 6f 75 Arezzo.<br>..You
7c30: 20 63 6f 75 6c 64 20 65 76 65 6e 74 75 61 6c 6c could eventuall
7c40: 79 20 63 6f 6e 74 69 6e 75 65 20 62 79 20 79 6f y continue by yo
7c50: 75 72 73 65 6c 66 20 73 6f 20 74 6f 20 75 70 64 urself so to upd
7c60: 61 74 65 20 61 6c 6c 20 50 72 6f 76 69 6e 63 65 ate all Province
7c70: 73 2e 20 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d s. ..<verbatim>.
7c80: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f .SELECT TopoGeo_
7c90: 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 ExportTopoLayer(
7ca0: 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 63 'census2011', 'c
7cb0: 6f 6d 32 30 31 35 27 2c 20 27 6f 75 74 5f 63 6f om2015', 'out_co
7cc0: 6d 5f 61 72 5f 32 30 31 35 27 2c 20 31 2c 20 31 m_ar_2015', 1, 1
7cd0: 29 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70 );....SELECT Top
7ce0: 6f 47 65 6f 5f 49 6e 73 65 72 74 46 65 61 74 75 oGeo_InsertFeatu
7cf0: 72 65 46 72 6f 6d 54 6f 70 6f 4c 61 79 65 72 20 reFromTopoLayer
7d00: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 ('census2011', '
7d10: 63 6f 6d 32 30 31 35 27 2c 20 27 6f 75 74 5f 63 com2015', 'out_c
7d20: 6f 6d 5f 61 72 5f 32 30 31 35 27 2c 20 66 69 64 om_ar_2015', fid
7d30: 29 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 )..FROM census20
7d40: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 11_topofeatures_
7d50: 36 0d 0a 57 48 45 52 45 20 63 6f 64 5f 70 72 6f 6..WHERE cod_pro
7d60: 76 20 3d 20 35 31 20 41 4e 44 20 63 6f 64 5f 63 v = 51 AND cod_c
7d70: 6f 6d 20 4e 4f 54 20 49 4e 20 28 35 31 30 30 39 om NOT IN (51009
7d80: 2c 20 35 31 30 32 39 2c 20 35 31 30 33 32 2c 20 , 51029, 51032,
7d90: 35 31 30 33 36 29 3b 0d 0a 3c 2f 76 65 72 62 61 51036);..</verba
7da0: 74 69 6d 3e 0d 0a 46 69 6e 61 6c 6c 79 20 77 65 tim>..Finally we
7db0: 27 6c 6c 20 65 78 70 6f 72 74 20 61 20 6e 65 77 'll export a new
7dc0: 20 6c 61 79 65 72 20 72 65 70 72 65 73 65 6e 74 layer represent
7dd0: 69 6e 67 20 74 68 65 20 75 70 64 61 74 65 64 20 ing the updated
7de0: 32 30 31 35 20 50 72 6f 76 69 6e 63 65 20 6f 66 2015 Province of
7df0: 20 41 72 65 7a 7a 6f 2e 3c 62 72 3e 0d 0a 54 68 Arezzo.<br>..Th
7e00: 69 73 20 74 69 6d 65 20 77 65 27 6c 6c 20 69 6e is time we'll in
7e10: 76 6f 6b 65 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f voke <b>TopoGeo_
7e20: 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 ExportTopoLayer(
7e30: 29 3c 2f 62 3e 20 62 79 20 73 70 65 63 69 66 79 )</b> by specify
7e40: 69 6e 67 20 74 68 65 20 3c 62 3e 3c 69 3e 63 72 ing the <b><i>cr
7e50: 65 61 74 65 2d 6f 6e 6c 79 3c 2f 69 3e 3c 2f 62 eate-only</i></b
7e60: 3e 20 73 70 65 63 69 61 6c 20 6f 70 74 69 6f 6e > special option
7e70: 2c 20 61 6e 64 20 74 68 65 6e 20 77 65 27 6c 6c , and then we'll
7e80: 20 75 73 65 20 74 68 65 20 3c 62 3e 54 6f 70 6f use the <b>Topo
7e90: 47 65 6f 5f 49 6e 73 65 72 74 46 65 61 74 75 72 Geo_InsertFeatur
7ea0: 65 46 72 6f 6d 54 6f 70 6f 4c 61 79 65 72 28 29 eFromTopoLayer()
7eb0: 3c 2f 62 3e 20 53 51 4c 20 66 75 6e 63 74 69 6f </b> SQL functio
7ec0: 6e 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 73 65 n in order to se
7ed0: 6c 65 63 74 69 76 65 6c 79 20 65 78 70 6f 72 74 lectively export
7ee0: 20 6f 6e 6c 79 20 61 20 6c 69 6d 69 74 65 64 20 only a limited
7ef0: 73 75 62 73 65 74 20 66 72 6f 6d 20 74 68 65 20 subset from the
7f00: 6f 76 65 72 61 6c 6c 20 54 6f 70 6f 46 65 61 74 overall TopoFeat
7f10: 75 72 65 73 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c ures.<br><br>..<
7f20: 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 table cellspan="
7f30: 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 4" cellpadding="
7f40: 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 6" bgcolor="#f8f
7f50: 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 8f0" border="1">
7f60: 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 ..<tr><td>..<img
7f70: 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 src="https://ww
7f80: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 w.gaia-gis.it/ga
7f90: 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 ia-sins/topofigs
7fa0: 2f 74 6f 70 6f 2d 61 72 2d 32 30 31 31 2e 70 6e /topo-ar-2011.pn
7fb0: 67 22 20 61 6c 74 3d 22 74 6f 70 6f 2d 61 72 2d g" alt="topo-ar-
7fc0: 32 30 31 31 22 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 2011">..</td><td
7fd0: 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 >..<img src="htt
7fe0: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
7ff0: 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 s.it/gaia-sins/t
8000: 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 2d 61 72 2d opofigs/topo-ar-
8010: 32 30 31 35 2e 70 6e 67 22 20 61 6c 74 3d 22 74 2015.png" alt="t
8020: 6f 70 6f 2d 61 72 2d 32 30 31 35 22 3e 0d 0a 3c opo-ar-2015">..<
8030: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
8040: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
8050: 22 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 ">Municipalities
8060: 20 69 6e 20 74 68 65 20 50 72 6f 76 69 6e 63 65 in the Province
8070: 20 6f 66 20 41 72 65 7a 7a 6f 3a 20 3c 62 3e 32 of Arezzo: <b>2
8080: 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 011</b></td><td
8090: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 4d align="center">M
80a0: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20 69 6e unicipalities in
80b0: 20 74 68 65 20 50 72 6f 76 69 6e 63 65 20 6f 66 the Province of
80c0: 20 41 72 65 7a 7a 6f 3a 20 3c 62 3e 32 30 31 35 Arezzo: <b>2015
80d0: 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a </b></td></tr>..
80e0: 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 </table><br>..<h
80f0: 72 3e 0d 0a 3c 2f 64 69 76 3e 0d 0a 3c 74 61 62 r>..</div>..<tab
8100: 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 22 3e le width="100%">
8110: 3c 74 72 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d <tr>..<td width=
8120: 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 "33%" align="lef
8130: 74 22 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 t"><a href="http
8140: 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 s://www.gaia-gis
8150: 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 .it/fossil/libsp
8160: 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 atialite/wiki?na
8170: 6d 65 3d 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 me=topo-intermed
8180: 69 61 74 65 22 3e 70 72 65 76 69 6f 75 73 20 70 iate">previous p
8190: 61 67 65 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 age</a></td>..<t
81a0: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
81b0: 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a ><a href="https:
81c0: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 //www.gaia-gis.i
81d0: 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 t/fossil/libspat
81e0: 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 ialite/wiki?name
81f0: 3d 49 53 4f 2b 54 6f 70 6f 6c 6f 67 79 22 3e 62 =ISO+Topology">b
8200: 61 63 6b 20 74 6f 20 69 6e 64 65 78 3c 2f 61 3e ack to index</a>
8210: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 77 69 64 74 68 </td>..<td width
8220: 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 72 69 ="33%" align="ri
8230: 67 68 74 22 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 ght"></td>..</tr
8240: 3e 3c 2f 74 61 62 6c 65 3e 0a 5a 20 66 65 66 34 ></table>.Z fef4
8250: 37 61 63 37 33 38 39 39 38 30 66 63 64 38 65 31 7ac7389980fcd8e1
8260: 62 30 33 33 31 66 66 39 64 31 30 32 0a b0331ff9d102.