Wiki page
[topo-advanced] by
sandro
2015-11-16 19:36:04.
0000: 44 20 32 30 31 35 2d 31 31 2d 31 36 54 31 39 3a D 2015-11-16T19:
0010: 33 36 3a 30 34 2e 32 34 37 0a 4c 20 74 6f 70 6f 36:04.247.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 63 31 35 66 -advanced.P c15f
0030: 61 63 35 37 63 62 36 35 61 62 34 34 31 65 38 30 ac57cb65ab441e80
0040: 37 32 32 36 32 61 66 30 31 39 63 32 64 66 63 34 72262af019c2dfc4
0050: 34 62 33 31 0a 55 20 73 61 6e 64 72 6f 0a 57 20 4b31.U sandro.W
0060: 32 36 31 36 39 0a 3c 74 61 62 6c 65 20 63 65 6c 26169.<table cel
0070: 6c 73 70 61 63 69 6e 67 3d 22 31 32 22 20 77 69 lspacing="12" wi
0080: 64 74 68 3d 22 31 30 30 25 22 3e 0d 0a 3c 74 72 dth="100%">..<tr
0090: 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22 ><td colspan="2"
00a0: 3e 0d 0a 3c 74 61 62 6c 65 20 77 69 64 74 68 3d >..<table width=
00b0: 22 31 30 30 25 22 20 62 67 63 6f 6c 6f 72 3d 22 "100%" bgcolor="
00c0: 23 66 30 66 30 66 38 22 3e 0d 0a 3c 74 72 3e 3c #f0f0f8">..<tr><
00d0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
00e0: 22 3e 0d 0a 3c 68 31 3e 54 6f 70 6f 6c 6f 67 79 ">..<h1>Topology
00f0: 2d 47 65 6f 6d 65 74 72 79 3a 20 61 6e 20 61 64 -Geometry: an ad
0100: 76 61 6e 63 65 64 20 74 75 74 6f 72 69 61 6c 3c vanced tutorial<
0110: 2f 68 31 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e /h1>..</td></tr>
0120: 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 74 61 62 6c 65 </table>..<table
0130: 20 77 69 64 74 68 3d 22 31 30 30 25 22 3e 3c 74 width="100%"><t
0140: 72 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 r>..<td width="3
0150: 33 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3%" align="left"
0160: 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a ><a href="https:
0170: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 //www.gaia-gis.i
0180: 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 t/fossil/libspat
0190: 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 ialite/wiki?name
01a0: 3d 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 69 61 =topo-intermedia
01b0: 74 65 22 3e 70 72 65 76 69 6f 75 73 20 70 61 67 te">previous pag
01c0: 65 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 e</a></td>..<td
01d0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c align="center"><
01e0: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f a href="https://
01f0: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f www.gaia-gis.it/
0200: 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 fossil/libspatia
0210: 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 6d lite/wiki?name=m
0220: 69 73 63 2d 64 6f 63 73 22 3e 62 61 63 6b 20 74 isc-docs">back t
0230: 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f 74 64 3e o index</a></td>
0240: 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 25 ..<td width="33%
0250: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e " align="right">
0260: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f <a href="https:/
0270: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 /www.gaia-gis.it
0280: 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 /fossil/libspati
0290: 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d alite/wiki?name=
02a0: 74 6f 70 6f 2d 61 64 76 61 6e 63 65 64 22 3e 6e topo-advanced">n
02b0: 65 78 74 20 70 61 67 65 3c 2f 61 3e 3c 2f 74 64 ext page</a></td
02c0: 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e >..</tr></table>
02d0: 0d 0a 3c 68 33 3e 54 6f 70 6f 4c 61 79 65 72 73 ..<h3>TopoLayers
02e0: 20 61 6e 64 20 54 6f 70 6f 46 65 61 74 75 72 65 and TopoFeature
02f0: 73 3c 2f 68 33 3e 0d 0a 49 6e 20 74 68 65 20 70 s</h3>..In the p
0300: 72 65 76 69 6f 75 73 20 74 75 74 6f 72 69 61 6c revious tutorial
0310: 20 77 65 27 76 65 20 65 78 61 6d 69 6e 65 64 20 we've examined
0320: 61 20 66 69 72 73 74 20 63 6f 75 70 6c 65 20 6f a first couple o
0330: 66 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 73 20 f SQL functions
0340: 69 6e 74 65 6e 64 65 64 20 74 6f 20 65 78 70 6f intended to expo
0350: 72 74 20 61 20 47 65 6f 54 61 62 6c 65 20 6f 75 rt a GeoTable ou
0360: 74 20 66 72 6f 6d 20 61 6e 20 65 78 69 73 74 69 t from an existi
0370: 6e 67 20 54 6f 70 6f 6c 6f 67 79 3a 20 3c 62 3e ng Topology: <b>
0380: 54 6f 70 6f 47 65 6f 5f 54 6f 47 65 6f 54 61 62 TopoGeo_ToGeoTab
0390: 6c 65 28 29 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e le()</b> and <b>
03a0: 54 6f 70 6f 47 65 6f 5f 54 6f 47 65 6f 54 61 62 TopoGeo_ToGeoTab
03b0: 6c 65 47 65 6e 65 72 61 6c 69 7a 65 28 29 3c 2f leGeneralize()</
03c0: 62 3e 2e 3c 62 72 3e 0d 0a 41 6e 79 77 61 79 20 b>.<br>..Anyway
03d0: 53 70 61 74 69 61 4c 69 74 65 20 73 75 70 70 6f SpatiaLite suppo
03e0: 72 74 73 20 61 6e 20 6d 6f 72 65 20 73 6f 70 68 rts an more soph
03f0: 69 73 74 69 63 61 74 65 64 20 28 61 6e 64 20 63 isticated (and c
0400: 6f 6d 70 6c 65 78 29 20 61 70 70 72 6f 61 63 68 omplex) approach
0410: 20 62 61 73 65 64 20 6f 6e 20 3c 62 3e 54 6f 70 based on <b>Top
0420: 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 61 6e 64 20 oLayers</b> and
0430: 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 3c <b>TopoFeatures<
0440: 2f 62 3e 20 73 70 65 63 69 66 69 63 61 6c 6c 79 /b> specifically
0450: 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 73 75 70 intended to sup
0460: 70 6f 72 74 20 61 20 76 65 72 79 20 66 6c 65 78 port a very flex
0470: 69 62 6c 65 20 6d 65 63 68 61 6e 69 73 6d 20 66 ible mechanism f
0480: 6f 72 20 65 78 70 6f 72 74 69 6e 67 20 61 20 66 or exporting a f
0490: 75 6c 6c 20 73 65 74 20 6f 66 20 47 65 6f 54 61 ull set of GeoTa
04a0: 62 6c 65 28 73 29 20 64 69 72 65 63 74 6c 79 20 ble(s) directly
04b0: 64 65 72 69 76 69 6e 67 20 66 72 6f 6d 20 61 20 deriving from a
04c0: 54 6f 70 6f 6c 6f 67 79 2e 0d 0a 3c 68 34 3e 61 Topology...<h4>a
04d0: 20 63 6f 6e 63 65 70 74 75 61 6c 20 72 65 66 65 conceptual refe
04e0: 72 65 6e 63 65 20 66 72 61 6d 65 77 6f 72 6b 3c rence framework<
04f0: 2f 68 34 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e /h4>..<ul>..<li>
0500: 61 6e 20 49 53 4f 20 54 6f 70 6f 6c 6f 67 79 20 an ISO Topology
0510: 69 73 20 6a 75 73 74 20 69 6e 74 65 6e 64 65 64 is just intended
0520: 20 74 6f 20 73 75 70 70 6f 72 74 20 61 20 63 6f to support a co
0530: 6e 73 69 73 74 65 6e 74 20 73 65 74 20 6f 66 20 nsistent set of
0540: 3c 62 3e 4e 6f 64 65 73 3c 2f 62 3e 2c 20 3c 62 <b>Nodes</b>, <b
0550: 3e 45 64 67 65 73 3c 2f 62 3e 20 61 6e 64 20 3c >Edges</b> and <
0560: 62 3e 46 61 63 65 73 3c 2f 62 3e 20 70 72 69 6d b>Faces</b> prim
0570: 69 74 69 76 65 73 20 66 75 6c 6c 79 20 63 6f 76 itives fully cov
0580: 65 72 69 6e 67 20 74 68 65 20 70 6c 61 6e 65 2e ering the plane.
0590: 0d 0a 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 ..Topology primi
05a0: 74 69 76 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 tives correspond
05b0: 20 74 6f 20 70 75 72 65 20 67 65 6f 6d 65 74 72 to pure geometr
05c0: 69 65 73 2c 20 61 6e 64 20 63 61 6e 20 6e 65 76 ies, and can nev
05d0: 65 72 20 62 65 20 64 69 72 65 63 74 6c 79 20 20 er be directly
05e0: 61 73 73 6f 63 69 61 74 65 64 20 74 6f 20 61 20 associated to a
05f0: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 73 65 corresponding se
0600: 74 20 6f 66 20 69 6e 66 6f 72 6d 61 74 69 6f 6e t of information
0610: 20 61 74 74 72 69 62 75 74 65 73 2e 0d 0a 42 6f attributes...Bo
0620: 74 68 20 4e 6f 64 65 20 61 6e 64 20 45 64 67 65 th Node and Edge
0630: 20 70 72 69 6d 69 74 69 76 65 73 20 64 69 72 65 primitives dire
0640: 63 74 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 20 ctly correspond
0650: 74 6f 20 61 20 3c 75 3e 3c 69 3e 72 65 61 6c 20 to a <u><i>real
0660: 67 65 6f 6d 65 74 72 79 3c 2f 69 3e 3c 2f 75 3e geometry</i></u>
0670: 2c 20 62 75 74 20 46 61 63 65 20 70 72 69 6d 69 , but Face primi
0680: 74 69 76 65 73 20 73 69 6d 70 6c 79 20 63 6f 72 tives simply cor
0690: 72 65 73 70 6f 6e 64 20 74 6f 20 61 20 3c 75 3e respond to a <u>
06a0: 3c 69 3e 76 69 72 74 75 61 6c 20 67 65 6f 6d 65 <i>virtual geome
06b0: 74 72 79 3c 2f 69 3e 3c 2f 75 3e 20 74 68 75 73 try</i></u> thus
06c0: 20 6e 65 63 65 73 73 61 72 69 6c 79 20 72 65 71 necessarily req
06d0: 75 69 72 69 6e 67 20 74 6f 20 62 65 20 64 79 6e uiring to be dyn
06e0: 61 6d 69 63 61 6c 6c 79 20 72 65 63 6f 6e 74 72 amically recontr
06f0: 75 63 74 65 64 20 65 76 65 72 79 20 74 69 6d 65 ucted every time
0700: 20 74 68 61 74 20 74 68 65 79 20 61 72 65 20 72 that they are r
0710: 65 66 65 72 65 6e 63 65 64 20 28 61 6e 64 20 74 eferenced (and t
0720: 68 69 73 20 63 6f 75 6c 64 20 65 61 73 69 6c 79 his could easily
0730: 20 62 65 63 6f 6d 65 20 61 20 72 65 61 6c 20 62 become a real b
0740: 6f 74 74 6c 65 6e 65 63 6b 29 2e 3c 2f 6c 69 3e ottleneck).</li>
0750: 0d 0a 3c 6c 69 3e 6f 6e 20 74 68 65 20 6f 74 68 ..<li>on the oth
0760: 65 72 20 68 61 6e 64 20 61 20 47 65 6f 54 61 62 er hand a GeoTab
0770: 6c 65 20 28 61 6b 61 20 3c 75 3e 3c 69 3e 6c 61 le (aka <u><i>la
0780: 79 65 72 3c 2f 69 3e 3c 2f 75 3e 2c 20 61 73 20 yer</i></u>, as
0790: 69 6e 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 47 49 in the common GI
07a0: 53 20 70 61 72 6c 61 6e 63 65 29 20 69 73 20 61 S parlance) is a
07b0: 6c 77 61 79 73 20 62 61 73 65 64 20 6f 6e 20 6d lways based on m
07c0: 61 6e 79 20 64 69 73 74 69 6e 63 74 20 66 65 61 any distinct fea
07d0: 74 75 72 65 73 2c 20 61 6e 64 20 66 6f 72 20 65 tures, and for e
07e0: 61 63 68 20 66 65 61 74 75 72 65 20 61 20 47 65 ach feature a Ge
07f0: 6f 6d 65 74 72 79 20 61 6e 64 20 61 6e 20 61 73 ometry and an as
0800: 73 6f 63 69 61 74 65 64 20 73 65 74 20 6f 66 20 sociated set of
0810: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 information attr
0820: 69 62 75 74 65 73 20 61 72 65 20 65 78 70 65 63 ibutes are expec
0830: 74 65 64 20 74 6f 20 62 65 20 64 65 63 6c 61 72 ted to be declar
0840: 65 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 ed.</li>..<li>th
0850: 65 72 65 20 69 73 20 66 75 72 74 68 65 72 20 64 ere is further d
0860: 69 66 66 65 72 65 6e 63 65 20 74 6f 20 62 65 20 ifference to be
0870: 74 61 6b 65 6e 20 69 6e 20 70 72 6f 70 65 72 20 taken in proper
0880: 61 63 63 6f 75 6e 74 3a 20 54 6f 70 6f 6c 6f 67 account: Topolog
0890: 79 20 70 72 69 6d 69 74 69 76 65 73 20 6e 65 63 y primitives nec
08a0: 65 73 73 61 72 69 6c 79 20 61 72 65 20 65 6c 65 essarily are ele
08b0: 6d 65 6e 74 61 72 79 2e 20 46 65 61 74 75 72 65 mentary. Feature
08c0: 20 47 65 6f 6d 65 74 72 69 65 73 20 63 61 6e 20 Geometries can
08d0: 75 73 75 61 6c 6c 79 20 72 65 70 72 65 73 65 6e usually represen
08e0: 74 20 73 6f 6d 65 20 63 6f 6d 70 6c 65 78 20 74 t some complex t
08f0: 79 70 65 3a 20 4d 55 4c 54 49 50 4f 49 4e 54 2c ype: MULTIPOINT,
0900: 20 4d 55 4c 54 49 4c 49 4e 45 53 54 52 49 4e 47 MULTILINESTRING
0910: 2c 20 4d 55 4c 54 49 50 4f 4c 59 47 4f 4e 20 61 , MULTIPOLYGON a
0920: 6e 64 2c 20 6d 61 79 20 62 65 2c 20 47 45 4f 4d nd, may be, GEOM
0930: 45 54 52 59 43 4f 4c 4c 45 43 54 49 4f 4e 2e 20 ETRYCOLLECTION.
0940: 53 6f 20 69 74 20 73 68 6f 75 6c 64 20 62 65 20 So it should be
0950: 61 62 73 6f 6c 75 74 65 6c 79 20 63 6c 65 61 72 absolutely clear
0960: 20 74 68 61 74 20 61 20 46 65 61 74 75 72 65 20 that a Feature
0970: 47 65 6f 6d 65 74 72 79 20 64 6f 65 73 20 6e 6f Geometry does no
0980: 74 20 6e 65 63 65 73 73 61 72 69 6c 79 20 63 6f t necessarily co
0990: 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 20 73 rresponds to a s
09a0: 69 6e 67 6c 65 20 54 6f 70 6f 6c 6f 67 79 20 70 ingle Topology p
09b0: 72 69 6d 69 74 69 76 65 20 3b 20 61 20 46 65 61 rimitive ; a Fea
09c0: 74 75 72 65 20 47 65 6f 6d 65 74 72 79 20 63 6f ture Geometry co
09d0: 75 6c 64 20 65 61 73 69 6c 79 20 62 65 20 64 65 uld easily be de
09e0: 72 69 76 65 64 20 66 72 6f 6d 20 61 67 67 72 65 rived from aggre
09f0: 67 61 74 69 6e 67 20 6d 61 6e 79 20 64 69 66 66 gating many diff
0a00: 65 72 65 6e 74 20 54 6f 70 6f 6c 6f 67 79 20 70 erent Topology p
0a10: 72 69 6d 69 74 65 73 2e 3c 2f 6c 69 3e 20 0d 0a rimites.</li> ..
0a20: 3c 6c 69 3e 74 68 61 74 27 73 20 6e 6f 74 20 61 <li>that's not a
0a30: 6c 6c 3a 20 6d 61 6e 79 20 64 69 66 66 65 72 65 ll: many differe
0a40: 6e 74 20 47 65 6f 54 61 62 6c 65 73 20 63 6f 75 nt GeoTables cou
0a50: 6c 64 20 65 76 65 6e 61 74 75 61 6c 6c 79 20 62 ld evenatually b
0a60: 65 20 64 65 72 69 76 65 64 20 66 72 6f 6d 20 61 e derived from a
0a70: 20 73 69 6e 67 6c 65 20 54 6f 70 6f 6c 6f 67 79 single Topology
0a80: 3b 20 61 6e 64 20 74 68 65 20 73 61 6d 65 20 54 ; and the same T
0a90: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 opology primitiv
0aa0: 65 20 63 6f 75 6c 64 20 70 6c 61 79 20 61 20 76 e could play a v
0ab0: 65 72 79 20 64 69 66 66 65 72 65 6e 74 20 72 6f ery different ro
0ac0: 6c 65 20 69 6e 20 65 76 65 72 79 6f 6e 65 20 6f le in everyone o
0ad0: 66 20 74 68 65 73 65 20 47 65 6f 54 61 62 6c 65 f these GeoTable
0ae0: 73 2e 3c 62 72 3e 0d 0a 4a 75 73 74 20 61 20 62 s.<br>..Just a b
0af0: 61 73 69 63 61 6c 6c 79 20 73 69 6d 70 6c 65 20 asically simple
0b00: 65 78 61 6d 70 6c 65 3a 20 69 6d 61 67 69 6e 65 example: imagine
0b10: 20 61 20 54 6f 70 6f 6c 6f 67 79 20 63 6f 72 72 a Topology corr
0b20: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 6f 6d esponding to som
0b30: 65 20 63 61 64 61 73 74 72 61 6c 20 6d 61 70 2e e cadastral map.
0b40: 20 57 65 27 6c 6c 20 73 75 72 65 6c 79 20 68 61 We'll surely ha
0b50: 76 65 20 6d 61 6e 79 20 70 6f 74 65 6e 74 69 61 ve many potentia
0b60: 6c 20 6c 61 79 65 72 73 3a 20 62 75 69 6c 64 69 l layers: buildi
0b70: 6e 67 73 2c 20 61 67 72 69 63 75 6c 74 75 72 61 ngs, agricultura
0b80: 6c 20 6c 61 6e 64 2c 20 70 6f 70 75 6c 61 74 65 l land, populate
0b90: 64 20 70 6c 61 63 65 73 2c 20 61 64 6d 69 6e 69 d places, admini
0ba0: 73 74 72 61 74 69 76 65 20 62 6f 75 6e 64 61 72 strative boundar
0bb0: 69 65 73 2c 20 72 6f 61 64 73 2c 20 70 6f 6e 64 ies, roads, pond
0bc0: 73 2c 20 72 69 76 65 72 73 2c 20 66 65 6e 63 65 s, rivers, fence
0bd0: 73 20 61 6e 64 20 73 6f 20 6f 6e 2e 3c 62 72 3e s and so on.<br>
0be0: 0d 0a 49 6e 20 73 75 63 68 20 61 20 63 6f 6e 74 ..In such a cont
0bf0: 65 78 74 20 61 20 66 65 6e 63 65 20 63 6f 75 6c ext a fence coul
0c00: 64 20 65 61 73 69 6c 79 20 63 6f 72 72 65 73 70 d easily corresp
0c10: 6f 6e 64 20 74 6f 20 61 20 46 65 61 74 75 72 65 ond to a Feature
0c20: 20 77 69 74 68 69 6e 20 74 68 65 20 22 3c 69 3e within the "<i>
0c30: 3c 62 3e 66 65 6e 63 65 73 3c 2f 62 3e 3c 2f 69 <b>fences</b></i
0c40: 3e 22 20 6c 61 79 65 72 2c 20 63 6f 75 6c 64 20 >" layer, could
0c50: 70 72 6f 62 61 62 6c 79 20 64 65 6c 69 6d 69 74 probably delimit
0c60: 20 74 77 6f 20 61 64 6a 61 63 65 6e 74 20 61 67 two adjacent ag
0c70: 72 69 63 75 6c 74 75 72 61 6c 20 61 72 65 61 73 ricultural areas
0c80: 20 61 6e 64 20 63 6f 75 6c 64 20 65 76 65 6e 74 and could event
0c90: 75 61 6c 6c 79 20 62 65 20 70 61 72 74 20 6f 66 ually be part of
0ca0: 20 73 6f 6d 65 20 61 64 6d 69 6e 69 73 74 72 61 some administra
0cb0: 74 69 76 65 20 62 6f 75 6e 64 61 72 79 2e 3c 2f tive boundary.</
0cc0: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 54 6f 70 6f li>..<li><b>Topo
0cd0: 4c 61 79 65 72 73 3c 2f 62 3e 20 61 6e 64 20 3c Layers</b> and <
0ce0: 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 3c 2f b>TopoFeatures</
0cf0: 62 3e 20 72 65 70 72 65 73 65 6e 74 20 61 20 63 b> represent a c
0d00: 6f 6d 70 6c 65 78 20 61 6e 64 20 66 6c 65 78 69 omplex and flexi
0d10: 62 6c 65 20 73 74 72 75 63 74 75 72 65 20 69 6e ble structure in
0d20: 74 65 6e 64 65 64 20 74 6f 20 65 73 74 61 62 6c tended to establ
0d30: 69 73 68 20 70 65 72 6d 61 6e 65 6e 74 20 65 78 ish permanent ex
0d40: 70 6c 69 63 69 74 20 63 6f 72 72 65 73 70 6f 6e plicit correspon
0d50: 64 65 6e 63 65 73 20 62 65 74 77 65 65 6e 20 54 dences between T
0d60: 6f 70 6f 6c 6f 67 79 20 50 72 69 6d 69 74 69 76 opology Primitiv
0d70: 65 73 20 61 6e 64 20 47 65 6f 54 61 62 6c 65 20 es and GeoTable
0d80: 46 65 61 74 75 72 65 73 2e 0d 0a 3c 75 6c 3e 0d Features...<ul>.
0d90: 0a 3c 6c 69 3e 65 61 63 68 20 3c 62 3e 54 6f 70 .<li>each <b>Top
0da0: 6f 4c 61 79 65 72 3c 2f 62 3e 20 69 73 20 75 6e oLayer</b> is un
0db0: 69 71 75 65 6c 79 20 69 64 65 6e 74 69 66 69 65 iquely identifie
0dc0: 64 20 62 79 20 69 74 73 20 3c 62 3e 6e 61 6d 65 d by its <b>name
0dd0: 3c 2f 62 3e 20 61 6e 64 20 64 69 72 65 63 74 6c </b> and directl
0de0: 79 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f y corresponds to
0df0: 20 61 20 73 69 6e 67 6c 65 20 47 65 6f 54 61 62 a single GeoTab
0e00: 6c 65 20 74 6f 20 62 65 20 65 78 70 6f 72 74 65 le to be exporte
0e10: 64 20 66 72 6f 6d 20 74 68 65 20 54 6f 70 6f 6c d from the Topol
0e20: 6f 67 79 3c 62 72 3e 0d 0a 41 6e 20 61 72 62 69 ogy<br>..An arbi
0e30: 74 72 61 72 79 20 6e 75 6d 62 65 72 20 6f 66 20 trary number of
0e40: 54 6f 70 6f 4c 61 79 65 72 73 20 63 61 6e 20 62 TopoLayers can b
0e50: 65 20 63 72 65 61 74 65 64 20 6f 6e 20 74 68 65 e created on the
0e60: 20 73 61 6d 65 20 54 6f 70 6f 6c 6f 67 79 2c 20 same Topology,
0e70: 61 6e 64 20 65 61 63 68 20 6f 6e 65 20 6f 66 20 and each one of
0e80: 74 68 65 6d 20 77 69 6c 6c 20 61 63 74 20 61 73 them will act as
0e90: 20 61 20 73 65 70 61 72 61 74 65 20 63 6f 6e 74 a separate cont
0ea0: 61 69 6e 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 ainer.</li>..<li
0eb0: 3e 65 61 63 68 20 3c 62 3e 54 6f 70 6f 46 65 61 >each <b>TopoFea
0ec0: 74 75 72 65 3c 2f 62 3e 20 69 73 20 75 6e 69 71 ture</b> is uniq
0ed0: 75 65 6c 79 20 69 64 65 6e 74 69 66 69 65 64 20 uely identified
0ee0: 62 79 20 69 74 73 20 3c 62 3e 66 69 64 3c 2f 62 by its <b>fid</b
0ef0: 3e 20 28 3c 69 3e 66 65 61 74 75 72 65 2d 69 64 > (<i>feature-id
0f00: 3c 2f 69 3e 29 20 61 6e 64 20 63 6f 72 72 65 73 </i>) and corres
0f10: 70 6f 6e 64 73 20 74 6f 20 61 20 73 69 6e 67 6c ponds to a singl
0f20: 65 20 46 65 61 74 75 72 65 20 63 6f 6e 74 61 69 e Feature contai
0f30: 6e 69 6e 67 20 61 6e 20 69 6e 64 69 76 69 64 75 ning an individu
0f40: 61 6c 20 73 65 74 20 6f 66 20 69 6e 66 6f 72 6d al set of inform
0f50: 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 ation attributes
0f60: 2e 3c 62 72 3e 0d 0a 54 68 65 20 47 65 6f 6d 65 .<br>..The Geome
0f70: 74 72 79 20 66 6f 72 20 65 61 63 68 20 54 6f 70 try for each Top
0f80: 6f 46 65 61 74 75 72 65 20 69 73 20 61 6c 77 61 oFeature is alwa
0f90: 79 73 20 69 6e 64 69 72 65 63 74 6c 79 20 64 65 ys indirectly de
0fa0: 66 69 6e 65 64 20 62 79 20 73 70 65 63 69 66 79 fined by specify
0fb0: 69 6e 67 20 61 20 6c 69 73 74 20 6f 66 20 54 6f ing a list of To
0fc0: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 pology primitive
0fd0: 73 20 69 6e 64 69 76 69 64 75 61 6c 6c 79 20 72 s individually r
0fe0: 65 66 65 72 65 6e 63 65 64 20 62 79 20 74 68 65 eferenced by the
0ff0: 69 72 20 49 44 73 2e 3c 62 72 3e 0d 0a 53 75 63 ir IDs.<br>..Suc
1000: 68 20 61 20 67 65 6f 6d 65 74 72 79 20 6f 62 76 h a geometry obv
1010: 69 6f 75 73 6c 79 20 69 73 20 61 20 3c 75 3e 3c iously is a <u><
1020: 69 3e 76 69 72 74 75 61 6c 3c 2f 69 3e 3c 2f 75 i>virtual</i></u
1030: 3e 20 6f 6e 65 2c 20 61 6e 64 20 77 69 6c 6c 20 > one, and will
1040: 62 65 20 61 63 74 75 61 6c 6c 79 20 6d 61 74 65 be actually mate
1050: 72 69 61 6c 69 7a 65 64 20 28 62 79 20 61 67 67 rialized (by agg
1060: 72 65 67 61 74 69 6e 67 20 61 6c 6c 20 72 65 66 regating all ref
1070: 65 72 65 6e 63 65 64 20 54 6f 70 6f 6c 6f 67 79 erenced Topology
1080: 20 70 72 69 6d 69 74 69 76 65 73 29 20 6f 6e 6c primitives) onl
1090: 79 20 77 68 65 6e 20 65 78 70 6f 72 74 69 6e 67 y when exporting
10a0: 20 74 68 65 20 64 65 73 74 69 6e 61 74 69 6f 6e the destination
10b0: 20 47 65 6f 54 61 62 6c 65 2e 3c 2f 6c 69 3e 0d GeoTable.</li>.
10c0: 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 .</ul></li>..<li
10d0: 3e 54 68 65 20 54 6f 70 6f 4c 61 79 65 72 73 20 >The TopoLayers
10e0: 2f 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 73 / TopoFeatures s
10f0: 74 72 75 63 74 75 72 65 20 69 73 20 70 72 61 63 tructure is prac
1100: 74 69 63 61 6c 6c 79 20 69 6d 70 6c 65 6d 65 6e tically implemen
1110: 74 65 64 20 61 73 20 61 20 73 65 74 20 6f 66 20 ted as a set of
1120: 73 65 76 65 72 61 6c 20 63 6c 6f 73 65 6c 79 20 several closely
1130: 72 65 6c 61 74 65 64 20 44 42 2d 74 61 62 6c 65 related DB-table
1140: 73 20 29 77 65 27 6c 6c 20 65 78 61 6d 69 6e 65 s )we'll examine
1150: 20 6c 61 74 65 72 20 74 68 65 69 72 20 72 65 73 later their res
1160: 70 65 63 74 69 76 65 20 6c 61 79 6f 75 74 73 20 pective layouts
1170: 69 6e 20 66 75 6c 6c 20 64 65 74 61 69 6c 29 3a in full detail):
1180: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c ..<ul>..<li><b><
1190: 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f <i>topo-prefix</
11a0: 69 3e 3e 5f 74 6f 70 6f 6c 61 79 65 72 73 3c 2f i>>_topolayers</
11b0: 62 3e 3a 20 74 68 69 73 20 66 69 72 73 74 20 74 b>: this first t
11c0: 61 62 6c 65 20 73 69 6d 70 6c 79 20 69 73 20 61 able simply is a
11d0: 20 63 61 74 61 6c 6f 67 20 6f 66 20 61 6c 6c 20 catalog of all
11e0: 54 6f 70 6f 4c 61 79 65 72 73 20 73 75 70 70 6f TopoLayers suppo
11f0: 72 74 69 6e 67 20 74 68 65 20 73 61 6d 65 20 54 rting the same T
1200: 6f 70 6f 6c 6f 67 79 2e 3c 62 72 3e 0d 0a 45 61 opology.<br>..Ea
1210: 63 68 20 54 6f 70 6f 4c 61 79 65 72 20 69 73 20 ch TopoLayer is
1220: 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 69 74 identified by it
1230: 73 20 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 20 61 6e s <b>name</b> an
1240: 64 20 62 79 20 69 74 73 20 3c 62 3e 49 44 3c 2f d by its <b>ID</
1250: 62 3e 3b 20 62 6f 74 68 20 69 64 65 6e 74 69 66 b>; both identif
1260: 69 65 72 73 20 61 72 65 20 67 72 61 6e 74 65 64 iers are granted
1270: 20 74 6f 20 62 65 20 3c 69 3e 3c 75 3e 75 6e 69 to be <i><u>uni
1280: 71 75 65 3c 2f 75 3e 3c 2f 69 3e 2e 3c 2f 6c 69 que</u></i>.</li
1290: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c 3c 69 3e 74 6f >..<li><b><<i>to
12a0: 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 po-prefix</i>>_t
12b0: 6f 70 6f 66 65 61 74 75 72 65 73 3c 2f 62 3e 3a opofeatures</b>:
12c0: 20 74 68 69 73 20 73 65 63 6f 6e 64 20 74 61 62 this second tab
12d0: 6c 65 20 69 73 20 69 6e 74 65 6e 64 65 64 20 74 le is intended t
12e0: 6f 20 70 65 72 6d 61 6e 65 6e 74 6c 79 20 73 74 o permanently st
12f0: 6f 72 65 20 61 6c 6c 20 63 72 6f 73 73 2d 72 65 ore all cross-re
1300: 66 65 72 65 6e 63 65 73 20 65 78 69 73 74 69 6e ferences existin
1310: 67 20 62 65 74 77 65 65 6e 20 54 6f 70 6f 6c 6f g between Topolo
1320: 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 61 6e gy primitives an
1330: 64 20 54 6f 70 6f 46 65 61 74 75 72 65 73 2e 3c d TopoFeatures.<
1340: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c 3c 69 /li>..<li><b><<i
1350: 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e >topo-prefix</i>
1360: 3e 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 3c >_topofeatures_<
1370: 3c 69 3e 74 6f 70 6f 6c 61 79 65 72 2d 69 64 3c <i>topolayer-id<
1380: 2f 69 3e 3e 3c 2f 62 3e 3a 20 66 6f 72 20 65 61 /i>></b>: for ea
1390: 63 68 20 73 69 6e 67 6c 65 20 54 6f 70 6f 4c 61 ch single TopoLa
13a0: 79 65 72 20 61 20 73 65 70 61 72 61 74 65 20 74 yer a separate t
13b0: 61 62 6c 65 20 69 73 20 72 65 71 75 69 72 65 64 able is required
13c0: 2e 20 54 68 65 20 61 63 74 75 61 6c 20 63 6f 72 . The actual cor
13d0: 72 65 73 70 6f 6e 64 65 6e 63 65 20 69 73 20 65 respondence is e
13e0: 73 74 61 62 6c 69 73 68 65 64 20 76 69 61 20 74 stablished via t
13f0: 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 2d he <b>TopoLayer-
1400: 49 44 3c 2f 62 3e 20 73 75 66 66 69 78 2e 3c 62 ID</b> suffix.<b
1410: 72 3e 0d 0a 41 6c 6c 20 74 68 65 73 65 20 74 61 r>..All these ta
1420: 62 6c 65 73 20 61 72 65 20 69 6e 74 65 6e 64 65 bles are intende
1430: 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74 6c 79 d to permanently
1440: 20 73 74 6f 72 65 20 74 68 65 20 69 6e 66 6f 72 store the infor
1450: 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 mation attribute
1460: 73 20 66 6f 72 20 65 61 63 68 20 54 6f 70 6f 46 s for each TopoF
1470: 65 61 74 75 72 65 20 69 6e 20 74 68 65 20 73 61 eature in the sa
1480: 6d 65 20 54 6f 70 6f 4c 61 79 65 72 2e 0d 0a 44 me TopoLayer...D
1490: 69 66 66 65 72 65 6e 74 20 54 6f 70 6f 4c 61 79 ifferent TopoLay
14a0: 65 72 73 20 77 69 6c 6c 20 6f 62 76 69 6f 73 75 ers will obviosu
14b0: 6c 79 20 73 75 70 70 6f 72 74 20 61 20 64 69 66 ly support a dif
14c0: 66 65 72 65 6e 74 20 73 65 74 20 6f 66 20 69 6e ferent set of in
14d0: 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 formation attrib
14e0: 75 74 65 73 20 74 68 75 73 20 72 65 71 75 69 72 utes thus requir
14f0: 69 6e 67 20 61 6e 20 69 6e 64 69 76 69 64 75 61 ing an individua
1500: 6c 20 74 61 62 6c 65 20 6c 61 79 6f 75 74 2e 3c l table layout.<
1510: 62 72 3e 0d 0a 41 6e 79 77 61 79 20 61 6c 6c 20 br>..Anyway all
1520: 74 68 65 73 65 20 74 61 62 6c 65 73 20 61 72 65 these tables are
1530: 20 61 6c 77 61 79 73 20 65 78 70 65 63 74 65 64 always expected
1540: 20 74 6f 20 64 65 63 6c 61 72 65 20 61 20 3c 62 to declare a <b
1550: 3e 50 72 69 6d 61 72 79 20 4b 65 79 3c 2f 62 3e >Primary Key</b>
1560: 20 6f 66 20 74 68 65 20 3c 62 3e 49 4e 54 45 47 of the <b>INTEG
1570: 45 52 3c 2f 62 3e 20 74 79 70 65 20 6e 61 6d 65 ER</b> type name
1580: 64 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 61 6e 64 d <b>fid</b> and
1590: 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 62 65 20 intended to be
15a0: 61 6e 20 75 6e 69 71 75 65 20 69 64 65 6e 74 69 an unique identi
15b0: 66 69 65 72 20 66 6f 72 20 65 61 63 68 20 54 6f fier for each To
15c0: 70 6f 46 65 61 74 75 72 65 2e 3c 2f 6c 69 3e 0d poFeature.</li>.
15d0: 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 .</ul></li>..<li
15e0: 3e 53 65 76 65 72 61 6c 20 53 51 4c 20 66 75 6e >Several SQL fun
15f0: 63 74 69 6f 6e 73 20 61 72 65 20 73 70 65 63 69 ctions are speci
1600: 66 69 63 61 6c 6c 79 20 69 6e 74 65 6e 64 65 64 fically intended
1610: 20 74 6f 20 73 75 70 70 6f 72 74 20 70 72 6f 63 to support proc
1620: 65 73 73 69 6e 67 20 6f 70 65 72 61 74 69 6f 6e essing operation
1630: 73 20 62 61 73 65 64 20 6f 6e 20 54 6f 70 6f 4c s based on TopoL
1640: 61 79 65 72 73 20 61 6e 64 20 54 6f 70 6f 46 65 ayers and TopoFe
1650: 61 74 75 65 73 3b 20 77 65 27 6c 6c 20 65 78 61 atues; we'll exa
1660: 6d 69 6e 65 20 6c 61 74 65 72 20 61 6c 6c 20 74 mine later all t
1670: 68 65 6d 20 69 6e 20 66 75 6c 6c 20 64 65 74 61 hem in full deta
1680: 69 6c 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c il.</li>..</ul><
1690: 62 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c br><br>..<hr>..<
16a0: 68 32 3e 61 20 71 75 69 63 6b 20 70 72 61 63 74 h2>a quick pract
16b0: 69 63 61 6c 20 65 78 65 72 63 69 73 65 3c 2f 68 ical exercise</h
16c0: 32 3e 0d 0a 50 72 65 72 65 71 75 69 73 69 74 65 2>..Prerequisite
16d0: 73 3a 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 64 6f s:..<ol>..<li>do
16e0: 77 6e 6c 6f 61 64 20 74 68 65 20 73 61 6d 70 6c wnload the sampl
16f0: 65 20 44 42 2d 66 69 6c 65 20 66 72 6f 6d 20 3c e DB-file from <
1700: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f a href="https://
1710: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f www.gaia-gis.it/
1720: 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 73 61 gaia-sins/toposa
1730: 6d 70 6c 65 73 2f 74 75 73 63 61 6e 79 2d 63 65 mples/tuscany-ce
1740: 6e 73 75 73 2d 32 30 31 31 2e 37 7a 22 3e 68 65 nsus-2011.7z">he
1750: 72 65 3c 2f 61 3e 3c 62 72 3e 0d 0a 49 74 20 63 re</a><br>..It c
1760: 6f 6e 74 61 69 6e 73 20 43 65 6e 73 75 73 20 64 ontains Census d
1770: 61 74 61 20 28 32 30 31 31 29 20 6b 69 6e 64 6c ata (2011) kindl
1780: 79 20 72 65 6c 65 61 73 65 64 20 62 79 20 49 53 y released by IS
1790: 54 41 54 20 75 6e 64 65 72 20 3c 62 3e 43 43 2d TAT under <b>CC-
17a0: 42 59 3c 2f 62 3e 20 6c 69 63 65 6e 73 65 20 74 BY</b> license t
17b0: 65 72 6d 73 2e 3c 62 72 3e 0d 0a 54 68 65 20 6f erms.<br>..The o
17c0: 72 69 67 69 6e 61 6c 20 64 61 74 61 73 65 74 73 riginal datasets
17d0: 20 68 61 76 65 20 62 65 65 6e 20 73 6c 69 67 68 have been sligh
17e0: 74 6c 79 20 72 65 61 72 72 61 6e 67 65 64 20 69 tly rearranged i
17f0: 6e 20 61 20 6d 6f 72 65 20 63 6f 6e 76 65 6e 69 n a more conveni
1800: 65 6e 74 20 66 6f 72 6d 2e 0d 0a 41 6c 6c 20 67 ent form...All g
1810: 65 6f 6d 65 74 72 69 65 73 20 61 72 65 20 69 6e eometries are in
1820: 20 74 68 65 20 3c 62 3e 53 52 49 44 20 33 32 36 the <b>SRID 326
1830: 33 32 3c 2f 62 3e 20 28 3c 69 3e 57 47 53 20 38 32</b> (<i>WGS 8
1840: 34 20 2f 20 55 54 4d 20 7a 6f 6e 65 20 33 32 4e 4 / UTM zone 32N
1850: 3c 2f 69 3e 29 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c </i>):..<ul>..<l
1860: 69 3e 3c 62 3e 63 65 6e 73 75 73 5f 32 30 31 31 i><b>census_2011
1870: 3c 2f 62 3e 3a 20 61 6c 6c 20 43 65 6e 73 75 73 </b>: all Census
1880: 20 41 72 65 61 73 20 28 32 30 31 31 29 20 63 6f Areas (2011) co
1890: 76 65 72 69 6e 67 20 54 75 73 63 61 6e 79 2e 3c vering Tuscany.<
18a0: 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3a 3c 2f 75 br>..<u>Note:</u
18b0: 3e 20 73 65 76 65 72 61 6c 20 43 65 6e 73 75 73 > several Census
18c0: 20 41 72 65 61 73 20 61 72 65 20 63 6f 6d 70 6c Areas are compl
18d0: 65 74 65 6c 79 20 75 6e 69 6e 68 61 62 69 74 65 etely uninhabite
18e0: 64 20 28 6c 61 6b 65 73 2c 20 6d 61 72 73 68 6c d (lakes, marshl
18f0: 61 6e 64 73 2c 20 68 69 67 68 20 6d 6f 75 6e 74 ands, high mount
1900: 61 69 6e 73 20 61 6e 64 20 61 6c 69 6b 65 29 2e ains and alike).
1910: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 70 70 </li>..<li><b>pp
1920: 6c 5f 32 30 31 31 3c 2f 62 3e 3a 20 50 6f 70 75 l_2011</b>: Popu
1930: 6c 61 74 65 64 20 50 6c 61 63 65 73 20 28 64 65 lated Places (de
1940: 66 69 6e 65 64 20 61 73 20 61 6e 20 61 67 67 72 fined as an aggr
1950: 65 67 61 74 69 6f 6e 20 6f 66 20 43 65 6e 73 75 egation of Censu
1960: 73 20 41 72 65 61 73 29 2e 3c 62 72 3e 0d 0a 3c s Areas).<br>..<
1970: 75 3e 4e 6f 74 65 3c 2f 75 3e 3a 20 6e 6f 74 20 u>Note</u>: not
1980: 61 6c 6c 20 43 65 6e 73 75 73 20 41 72 65 61 73 all Census Areas
1990: 20 62 65 6c 6f 6e 67 20 74 6f 20 61 20 50 6f 70 belong to a Pop
19a0: 75 6c 61 74 65 64 20 50 6c 61 63 65 3a 20 74 68 ulated Place: th
19b0: 65 72 65 20 61 72 65 20 6d 61 6e 79 20 73 65 6c ere are many sel
19c0: 66 2d 73 74 61 6e 64 69 6e 67 20 64 69 73 70 65 f-standing dispe
19d0: 72 73 65 64 20 72 75 72 61 6c 20 61 72 65 61 73 rsed rural areas
19e0: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 .</li>..<li><b>c
19f0: 6f 6d 5f 32 30 31 31 3c 2f 62 3e 3a 20 54 75 73 om_2011</b>: Tus
1a00: 63 61 6e 79 20 4d 75 6e 69 63 69 70 61 6c 69 74 cany Municipalit
1a10: 69 65 73 20 2f 20 4c 6f 63 61 6c 20 43 6f 75 6e ies / Local Coun
1a20: 63 69 6c 73 20 32 30 31 31 20 28 64 65 66 69 6e cils 2011 (defin
1a30: 65 64 20 61 73 20 61 6e 20 61 67 67 72 65 67 61 ed as an aggrega
1a40: 74 69 6f 6e 73 20 6f 66 20 43 65 6e 73 75 73 20 tions of Census
1a50: 41 72 65 61 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c Areas).</li>..<l
1a60: 69 3e 3c 62 3e 63 6f 6d 5f 32 30 31 34 5f 31 35 i><b>com_2014_15
1a70: 3c 2f 62 3e 3a 20 66 65 77 20 6e 65 77 20 4d 75 </b>: few new Mu
1a80: 6e 69 63 69 70 61 6c 69 74 69 65 73 20 63 72 65 nicipalities cre
1a90: 61 74 65 64 20 64 75 72 69 6e 67 20 79 65 61 72 ated during year
1aa0: 73 20 32 30 31 34 2f 31 35 20 62 79 20 6d 65 72 s 2014/15 by mer
1ab0: 67 69 6e 67 20 70 72 65 2d 65 78 69 73 74 69 6e ging pre-existin
1ac0: 67 20 73 6d 61 6c 6c 65 72 20 4d 75 6e 69 63 69 g smaller Munici
1ad0: 70 61 6c 69 74 69 65 73 2e 3c 2f 6c 69 3e 0d 0a palities.</li>..
1ae0: 3c 6c 69 3e 3c 62 3e 70 72 6f 76 5f 32 30 31 31 <li><b>prov_2011
1af0: 3c 2f 62 3e 3a 20 54 75 73 63 61 6e 79 20 50 72 </b>: Tuscany Pr
1b00: 6f 76 69 6e 63 65 73 20 2f 20 43 6f 75 6e 74 69 ovinces / Counti
1b10: 65 73 20 28 64 65 66 69 6e 65 64 20 61 73 20 61 es (defined as a
1b20: 6e 20 61 67 67 72 65 67 61 74 69 6f 6e 20 6f 66 n aggregation of
1b30: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 29 Municipalities)
1b40: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 72 .</li>..<li><b>r
1b50: 65 67 5f 32 30 31 31 3c 2f 62 3e 3a 20 54 75 73 eg_2011</b>: Tus
1b60: 63 61 6e 79 20 52 65 67 69 6f 6e 20 28 64 65 66 cany Region (def
1b70: 69 6e 65 64 20 61 73 20 61 6e 20 61 67 67 72 65 ined as an aggre
1b80: 67 61 74 69 6f 6e 20 6f 66 20 50 72 6f 76 69 6e gation of Provin
1b90: 63 65 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e ces).</li>..<li>
1ba0: 6a 75 73 74 20 3c 62 3e 63 65 6e 73 75 73 5f 32 just <b>census_2
1bb0: 30 31 31 3c 2f 62 3e 20 61 6c 6f 6e 65 20 73 75 011</b> alone su
1bc0: 70 70 6f 72 74 73 20 67 65 6f 6d 65 74 72 69 65 pports geometrie
1bd0: 73 3b 20 61 6e 79 20 6f 74 68 65 72 20 61 64 6d s; any other adm
1be0: 69 6e 69 73 74 72 61 74 69 76 65 20 6c 65 76 65 inistrative leve
1bf0: 6c 20 69 73 20 73 69 6d 70 6c 79 20 64 65 66 69 l is simply defi
1c00: 6e 65 64 20 62 79 20 72 65 6c 61 74 69 6f 6e 61 ned by relationa
1c10: 6c 20 63 6f 64 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c l codes.</li>..<
1c20: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 75 /ul></li>..<li>u
1c30: 6e 63 6f 6d 70 72 65 73 73 20 74 68 65 20 64 6f ncompress the do
1c40: 77 6e 6c 6f 61 64 65 64 20 64 62 2d 66 69 6c 65 wnloaded db-file
1c50: 20 28 3c 62 3e 3c 69 3e 74 75 73 63 61 6e 79 2d (<b><i>tuscany-
1c60: 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 census-2011.sqli
1c70: 74 65 3c 2f 69 3e 3c 2f 62 3e 29 2e 3c 2f 6c 69 te</i></b>).</li
1c80: 3e 0d 0a 3c 6c 69 3e 6e 6f 77 20 79 6f 75 20 63 >..<li>now you c
1c90: 61 6e 20 66 69 6e 61 6c 6c 79 20 73 74 61 72 74 an finally start
1ca0: 20 61 20 53 70 61 74 69 61 4c 69 74 65 20 73 65 a SpatiaLite se
1cb0: 73 73 69 6f 6e 20 75 73 69 6e 67 20 79 6f 75 72 ssion using your
1cc0: 20 70 72 65 66 65 72 72 65 64 20 53 70 61 74 69 preferred Spati
1cd0: 61 4c 69 74 65 20 66 72 6f 6e 74 20 65 6e 64 20 aLite front end
1ce0: 74 6f 6f 6c 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 tool:..<ul>..<li
1cf0: 3e 3c 75 3e 41 74 74 65 6e 74 69 6f 6e 3c 2f 75 ><u>Attention</u
1d00: 3e 3a 20 79 6f 75 20 6d 75 73 74 20 6e 6f 74 20 >: you must not
1d10: 64 69 72 65 63 74 6c 79 20 63 6f 6e 6e 65 63 74 directly connect
1d20: 20 74 6f 20 3c 62 3e 3c 69 3e 74 75 73 63 61 6e to <b><i>tuscan
1d30: 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 2e 73 71 y-census-2011.sq
1d40: 6c 69 74 65 3c 2f 69 3e 3c 2f 62 3e 3b 20 79 6f lite</i></b>; yo
1d50: 75 20 61 72 65 20 65 78 70 65 63 74 65 64 20 69 u are expected i
1d60: 6e 73 74 65 61 64 20 74 6f 20 63 6f 6e 6e 65 63 nstead to connec
1d70: 74 20 61 20 6e 65 77 20 28 65 6d 70 74 79 29 20 t a new (empty)
1d80: 44 42 2d 66 69 6c 65 20 6e 61 6d 65 64 20 3c 62 DB-file named <b
1d90: 3e 74 75 73 63 61 6e 79 2d 74 6f 70 6f 2d 32 30 >tuscany-topo-20
1da0: 31 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 3c 2f 6c 11.sqlite</b></l
1db0: 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a i>..</ul></li>..
1dc0: 3c 2f 6f 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d </ol>..<verbatim
1dd0: 3e 0d 0a 53 45 4c 45 43 54 20 43 72 65 61 74 65 >..SELECT Create
1de0: 54 6f 70 6f 6c 6f 67 79 28 27 63 65 6e 73 75 73 Topology('census
1df0: 32 30 31 31 27 2c 20 33 32 36 33 32 2c 20 30 2c 2011', 32632, 0,
1e00: 20 30 29 3b 0d 0a 31 0d 0a 0d 0a 41 54 54 41 43 0);..1....ATTAC
1e10: 48 20 44 41 54 41 42 41 53 45 20 22 2e 2f 74 75 H DATABASE "./tu
1e20: 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 scany-census-201
1e30: 31 2e 73 71 6c 69 74 65 22 20 41 53 20 69 73 74 1.sqlite" AS ist
1e40: 61 74 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f at;....SELECT To
1e50: 70 6f 47 65 6f 5f 46 72 6f 6d 47 65 6f 54 61 62 poGeo_FromGeoTab
1e60: 6c 65 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c le('census2011',
1e70: 20 27 69 73 74 61 74 27 2c 20 27 63 65 6e 73 75 'istat', 'censu
1e80: 73 5f 32 30 31 31 27 2c 20 4e 55 4c 4c 2c 20 30 s_2011', NULL, 0
1e90: 2c 20 35 31 32 2c 20 2d 31 29 3b 0d 0a 31 0d 0a , 512, -1);..1..
1ea0: 0d 0a 53 45 4c 45 43 54 20 53 54 5f 56 61 6c 69 ..SELECT ST_Vali
1eb0: 64 61 74 65 54 6f 70 6f 47 65 6f 28 27 63 65 6e dateTopoGeo('cen
1ec0: 73 75 73 32 30 31 31 27 29 3b 0d 0a 4e 55 4c 4c sus2011');..NULL
1ed0: 0d 0a 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f ....SELECT * FRO
1ee0: 4d 20 54 45 4d 50 2e 63 65 6e 73 75 73 32 30 31 M TEMP.census201
1ef0: 31 5f 76 61 6c 69 64 61 74 65 5f 74 6f 70 6f 67 1_validate_topog
1f00: 65 6f 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f eo;....SELECT To
1f10: 70 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f poGeo_CreateTopo
1f20: 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 Layer('census201
1f30: 31 27 2c 20 27 69 73 74 61 74 27 2c 20 27 63 65 1', 'istat', 'ce
1f40: 6e 73 75 73 5f 32 30 31 31 27 2c 20 4e 55 4c 4c nsus_2011', NULL
1f50: 2c 20 27 63 65 6e 73 75 73 5f 61 72 65 61 73 27 , 'census_areas'
1f60: 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 );..1....SELECT
1f70: 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f TopoGeo_InitTopo
1f80: 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 Layer('census201
1f90: 31 27 2c 20 27 69 73 74 61 74 27 2c 20 27 70 6f 1', 'istat', 'po
1fa0: 70 5f 70 70 6c 5f 32 30 31 31 27 2c 20 27 70 70 p_ppl_2011', 'pp
1fb0: 6c 27 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 l');..1....SELEC
1fc0: 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f T TopoGeo_InitTo
1fd0: 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 poLayer('census2
1fe0: 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c 20 27 011', 'istat', '
1ff0: 70 6f 70 5f 63 6f 6d 5f 32 30 31 31 27 2c 20 27 pop_com_2011', '
2000: 63 6f 6d 27 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c com');..1....SEL
2010: 45 43 54 20 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 ECT TopoGeo_Init
2020: 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 TopoLayer('censu
2030: 73 32 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c s2011', 'istat',
2040: 20 27 70 6f 70 5f 70 72 6f 76 5f 32 30 31 31 27 'pop_prov_2011'
2050: 2c 20 27 70 72 6f 76 27 29 3b 0d 0a 31 0d 0a 0d , 'prov');..1...
2060: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f .SELECT TopoGeo_
2070: 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 InitTopoLayer('c
2080: 65 6e 73 75 73 32 30 31 31 27 2c 20 27 69 73 74 ensus2011', 'ist
2090: 61 74 27 2c 20 27 70 6f 70 5f 72 65 67 5f 32 30 at', 'pop_reg_20
20a0: 31 31 27 2c 20 27 72 65 67 27 29 3b 0d 0a 31 0d 11', 'reg');..1.
20b0: 0a 0d 0a 44 45 54 41 43 48 20 44 41 54 41 42 41 ...DETACH DATABA
20c0: 53 45 20 69 73 74 61 74 3b 0d 0a 3c 2f 76 65 72 SE istat;..</ver
20d0: 62 61 74 69 6d 3e 0d 0a 57 65 27 6c 6c 20 73 74 batim>..We'll st
20e0: 61 72 74 20 74 68 69 73 20 70 72 61 63 74 69 63 art this practic
20f0: 61 6c 20 74 75 74 6f 72 69 61 6c 20 62 79 20 64 al tutorial by d
2100: 75 6c 79 20 72 65 70 6c 69 63 61 74 69 6e 67 20 uly replicating
2110: 74 68 65 20 73 61 6d 65 20 73 74 65 70 73 20 77 the same steps w
2120: 65 27 76 65 20 61 6c 72 65 61 64 79 20 65 78 61 e've already exa
2130: 6d 69 6e 65 64 20 69 6e 20 74 68 65 20 69 6e 74 mined in the int
2140: 65 72 6d 65 74 69 61 74 65 20 74 75 74 6f 72 69 ermetiate tutori
2150: 61 6c 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 77 al:..<ul>..<li>w
2160: 65 27 6c 6c 20 63 72 65 61 74 65 20 61 20 6e 65 e'll create a ne
2170: 77 20 32 44 20 54 6f 70 6f 6c 6f 67 79 20 6e 61 w 2D Topology na
2180: 6d 65 64 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 med <b>census201
2190: 31 3c 2f 62 3e 20 61 6e 64 20 6c 6f 63 61 74 65 1</b> and locate
21a0: 64 20 69 6e 74 6f 20 3c 62 3e 53 52 49 44 20 33 d into <b>SRID 3
21b0: 32 36 33 32 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 2632</b>.</li>..
21c0: 3c 6c 69 3e 74 68 65 6e 20 77 65 27 6c 6c 20 3c <li>then we'll <
21d0: 69 3e 61 74 74 61 63 68 3c 2f 69 3e 20 74 68 65 i>attach</i> the
21e0: 20 3c 62 3e 74 75 73 63 61 6e 79 2d 74 6f 70 6f <b>tuscany-topo
21f0: 2d 32 30 31 31 2e 73 71 6c 69 74 65 3c 2f 62 3e -2011.sqlite</b>
2200: 20 65 78 74 65 72 6e 61 6c 20 44 42 2d 66 69 6c external DB-fil
2210: 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6e 6f 77 e.</li>..<li>now
2220: 20 77 65 27 6c 6c 20 70 6f 70 75 6c 61 74 65 20 we'll populate
2230: 74 68 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 the <b>census201
2240: 31 3c 2f 62 3e 20 54 6f 70 6f 6c 6f 67 79 20 62 1</b> Topology b
2250: 79 20 69 6d 70 6f 72 74 69 6e 67 20 74 68 65 20 y importing the
2260: 3c 62 3e 69 73 74 61 74 2e 63 65 6e 73 75 73 5f <b>istat.census_
2270: 32 30 31 31 3c 2f 62 3e 20 47 65 6f 54 61 62 6c 2011</b> GeoTabl
2280: 65 2c 20 61 6e 64 20 74 68 65 6e 20 77 65 27 6c e, and then we'l
2290: 6c 20 69 6d 6d 65 64 69 61 74 6c 79 20 63 68 65 l immediatly che
22a0: 63 6b 20 69 66 20 74 68 69 73 20 54 6f 70 6f 6c ck if this Topol
22b0: 6f 67 79 20 69 73 20 66 75 6c 6c 79 20 76 61 6c ogy is fully val
22c0: 69 64 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c id.</li>..</ul><
22d0: 62 72 3e 0d 0a 4e 6f 77 20 77 65 20 61 72 65 20 br>..Now we are
22e0: 66 69 6e 61 6c 6c 79 20 72 65 61 64 79 20 74 6f finally ready to
22f0: 20 73 74 61 72 74 20 64 65 66 69 6e 69 6e 67 20 start defining
2300: 61 6c 6c 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 all <b>TopoLayer
2310: 73 3c 2f 62 3e 20 62 61 73 65 64 20 6f 6e 20 74 s</b> based on t
2320: 68 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 he <b>census2011
2330: 3c 2f 62 3e 20 54 6f 70 6f 6c 6f 67 79 3b 20 65 </b> Topology; e
2340: 61 63 68 20 73 69 6e 67 6c 65 20 54 6f 70 6f 4c ach single TopoL
2350: 61 79 65 72 20 77 69 6c 6c 20 70 72 65 63 69 73 ayer will precis
2360: 65 6c 79 20 72 65 70 72 65 73 65 6e 74 20 73 6f ely represent so
2370: 6d 65 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 me administrativ
2380: 65 20 6c 65 76 65 6c 2c 20 61 6e 64 20 61 6c 6c e level, and all
2390: 20 54 6f 70 6f 4c 61 79 65 72 73 20 61 6c 6c 74 TopoLayers allt
23a0: 6f 67 65 74 68 65 72 20 77 69 6c 6c 20 63 6f 6d ogether will com
23b0: 70 6c 65 74 65 6c 79 20 72 65 70 72 65 73 65 6e pletely represen
23c0: 74 20 74 68 65 20 77 68 6f 6c 65 20 54 75 73 63 t the whole Tusc
23d0: 61 6e 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 an administrativ
23e0: 65 20 68 69 65 72 61 72 63 68 79 2e 0d 0a 3c 6f e hierarchy...<o
23f0: 6c 3e 0d 0a 3c 6c 69 3e 73 6f 20 77 65 27 6c 6c l>..<li>so we'll
2400: 20 64 75 6c 79 20 69 6e 76 6f 6b 65 20 3c 62 3e duly invoke <b>
2410: 54 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f TopoGeo_CreateTo
2420: 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 69 6e poLayer()</b> in
2430: 20 6f 72 64 65 72 20 74 6f 20 63 6f 6d 70 6c 65 order to comple
2440: 74 65 6c 79 20 64 65 66 69 6e 65 20 61 20 66 69 tely define a fi
2450: 72 73 74 20 54 6f 70 6f 4c 61 79 65 72 20 72 65 rst TopoLayer re
2460: 70 72 65 73 65 6e 74 69 6e 67 20 3c 62 3e 43 65 presenting <b>Ce
2470: 6e 73 75 73 20 41 72 65 61 73 3c 2f 62 3e 2e 3c nsus Areas</b>.<
2480: 62 72 3e 0d 0a 3c 75 3e 52 65 63 61 6c 6c 3c 2f br>..<u>Recall</
2490: 75 3e 3a 20 74 68 65 20 3c 62 3e 69 73 74 61 74 u>: the <b>istat
24a0: 2e 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e .census_2011</b>
24b0: 20 69 73 20 74 68 65 20 75 6e 69 71 75 65 20 72 is the unique r
24c0: 65 61 6c 20 47 65 6f 54 61 62 6c 65 20 77 65 20 eal GeoTable we
24d0: 68 61 76 65 20 69 6e 20 6f 75 72 20 69 6e 69 74 have in our init
24e0: 69 61 6c 20 64 61 74 61 73 65 74 2c 20 62 65 63 ial dataset, bec
24f0: 61 75 73 65 20 69 74 20 63 6f 6e 74 61 69 6e 73 ause it contains
2500: 20 62 6f 74 68 20 69 6e 66 6f 72 6d 61 74 69 6f both informatio
2510: 6e 20 61 74 74 72 69 62 75 74 65 73 20 61 6e 64 n attributes and
2520: 20 67 65 6f 6d 65 74 72 69 65 73 3b 20 61 6e 64 geometries; and
2530: 20 65 61 63 68 20 43 65 6e 73 75 73 20 41 72 65 each Census Are
2540: 61 20 69 73 20 65 78 70 65 63 74 65 64 20 74 6f a is expected to
2550: 20 64 69 72 65 63 74 6c 79 20 63 6f 72 72 65 73 directly corres
2560: 70 6f 6e 64 20 74 6f 20 61 20 73 69 6e 67 6c 65 pond to a single
2570: 20 54 6f 70 6f 6c 6f 67 79 20 46 61 63 65 2e 20 Topology Face.
2580: 28 3c 69 3e 77 65 27 6c 6c 20 65 78 61 6d 69 6e (<i>we'll examin
2590: 65 20 6c 61 74 65 72 20 69 6e 20 6d 6f 72 65 20 e later in more
25a0: 64 65 70 74 68 20 68 6f 77 20 54 6f 70 6f 4c 61 depth how TopoLa
25b0: 79 65 72 20 2f 20 54 6f 70 6f 46 65 61 74 75 72 yer / TopoFeatur
25c0: 65 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 20 e relationships
25d0: 68 61 76 65 20 62 65 65 6e 20 61 63 74 75 61 6c have been actual
25e0: 6c 79 20 64 65 66 69 6e 65 64 3c 2f 69 3e 29 2e ly defined</i>).
25f0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 6e 20 </li>..<li>then
2600: 77 65 27 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 62 we'll continue b
2610: 79 20 64 65 66 69 6e 69 6e 67 20 73 65 76 65 72 y defining sever
2620: 61 6c 20 66 75 72 74 68 65 72 20 54 6f 70 6f 4c al further TopoL
2630: 61 79 65 72 73 20 72 65 73 70 65 63 74 69 76 65 ayers respective
2640: 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 ly corresponding
2650: 20 74 6f 20 3c 62 3e 50 6f 70 75 6c 61 74 65 64 to <b>Populated
2660: 20 50 6c 61 63 65 73 3c 2f 62 3e 2c 20 3c 62 3e Places</b>, <b>
2670: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f Municipalities</
2680: 62 3e 2c 20 3c 62 3e 50 72 6f 76 69 6e 63 65 73 b>, <b>Provinces
2690: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 52 65 67 69 </b> and <b>Regi
26a0: 6f 6e 3c 2f 62 3e 20 61 64 6d 69 6e 69 73 74 72 on</b> administr
26b0: 61 74 69 76 65 20 6c 65 76 65 6c 73 2e 3c 62 72 ative levels.<br
26c0: 3e 0d 0a 3c 75 3e 52 65 63 61 6c 6c 3c 2f 75 3e >..<u>Recall</u>
26d0: 3a 20 61 6c 6c 20 74 68 65 73 65 20 61 64 6d 69 : all these admi
26e0: 6e 69 73 74 72 61 74 69 76 65 20 6c 65 76 65 6c nistrative level
26f0: 73 20 69 6e 20 74 68 65 20 69 6e 69 74 69 61 6c s in the initial
2700: 20 64 61 74 61 73 65 74 20 61 72 65 20 73 69 6d dataset are sim
2710: 70 6c 79 20 64 65 66 69 6e 65 64 20 62 79 20 72 ply defined by r
2720: 65 6c 61 74 69 6f 6e 61 6c 20 63 6f 64 65 73 20 elational codes
2730: 69 6e 74 65 6e 64 65 64 20 74 6f 20 61 67 67 72 intended to aggr
2740: 65 67 61 74 65 20 6c 6f 77 65 72 20 6c 65 76 65 egate lower leve
2750: 6c 20 65 6e 74 69 74 69 65 73 3b 20 69 6e 20 74 l entities; in t
2760: 68 69 73 20 63 61 73 65 20 74 68 65 72 65 20 61 his case there a
2770: 72 65 20 6e 6f 20 65 78 70 6c 69 63 69 74 20 67 re no explicit g
2780: 65 6f 6d 65 74 72 69 65 73 20 61 74 20 61 6c 6c eometries at all
2790: 2e 20 53 6f 20 61 72 65 20 61 72 65 20 6e 6f 74 . So are are not
27a0: 20 64 69 72 65 63 74 6c 79 20 61 6c 6c 6f 77 65 directly allowe
27b0: 64 20 74 6f 20 63 72 65 61 74 65 20 61 20 66 75 d to create a fu
27c0: 6c 6c 79 20 64 65 66 69 6e 65 64 20 54 6f 70 6f lly defined Topo
27d0: 4c 61 79 65 72 2c 20 61 6e 64 20 63 61 6c 6c 69 Layer, and calli
27e0: 6e 67 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 72 ng <b>TopoGeo_Cr
27f0: 65 61 74 65 54 6f 70 6f 6c 61 79 65 72 28 29 3c eateTopolayer()<
2800: 2f 62 3e 20 69 73 20 6a 75 73 74 20 69 6d 70 6f /b> is just impo
2810: 73 73 69 62 6c 65 20 62 65 63 61 75 73 65 20 77 ssible because w
2820: 65 20 6c 61 63 6b 20 61 6e 79 20 61 70 70 72 6f e lack any appro
2830: 70 72 69 61 74 65 20 47 65 6f 6d 65 74 72 79 20 priate Geometry
2840: 63 6f 6c 75 6d 6e 2e 3c 62 72 3e 0d 0a 41 6e 79 column.<br>..Any
2850: 77 61 79 20 77 65 20 63 61 6e 20 69 6e 76 6f 6b way we can invok
2860: 65 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 e <b>TopoGeo_Ini
2870: 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e tTopoLayer()</b>
2880: 3b 20 74 68 69 73 20 77 69 6c 6c 20 69 6e 69 74 ; this will init
2890: 69 61 6c 69 7a 65 20 61 6e 20 6f 6e 6c 79 20 70 ialize an only p
28a0: 61 72 74 69 61 6c 6c 79 20 64 65 66 69 6e 65 64 artially defined
28b0: 20 54 6f 70 6f 4c 61 79 65 72 2c 20 62 75 74 20 TopoLayer, but
28c0: 77 65 20 63 61 6e 20 65 61 73 69 6c 79 20 63 6f we can easily co
28d0: 6d 70 6c 65 74 65 20 69 6e 20 61 20 73 65 63 6f mplete in a seco
28e0: 6e 64 20 74 69 6d 65 20 61 6e 79 20 6d 69 73 73 nd time any miss
28f0: 69 6e 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 ing information
2900: 73 6f 20 74 6f 20 67 65 74 20 61 20 70 72 6f 70 so to get a prop
2910: 65 72 6c 79 20 77 6f 72 6b 69 6e 67 20 54 6f 70 erly working Top
2920: 6f 4c 61 79 65 72 20 28 3c 69 3e 61 73 20 77 65 oLayer (<i>as we
2930: 27 6c 6c 20 73 65 65 20 6c 61 74 65 72 20 69 6e 'll see later in
2940: 20 66 75 6c 6c 20 64 65 74 61 69 6c 29 2e 3c 2f full detail).</
2950: 6c 69 3e 0d 0a 3c 6c 69 3e 66 69 6e 61 6c 6c 79 li>..<li>finally
2960: 20 77 65 27 6c 6c 20 3c 69 3e 64 65 74 61 63 68 we'll <i>detach
2970: 3c 2f 69 3e 20 74 68 65 20 6e 6f 77 20 75 73 65 </i> the now use
2980: 6c 65 73 73 20 65 78 74 65 72 6e 61 6c 20 64 62 less external db
2990: 2d 66 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f -file.</li>..</o
29a0: 6c 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 3e 54 6f l>..<hr>..<h3>To
29b0: 70 6f 4c 61 79 65 72 73 20 2f 20 54 6f 70 6f 46 poLayers / TopoF
29c0: 65 61 74 75 72 65 73 3a 20 6c 61 79 6f 75 74 20 eatures: layout
29d0: 6f 66 20 44 42 20 54 61 62 6c 65 73 20 61 6e 64 of DB Tables and
29e0: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 72 corresponding r
29f0: 65 6c 61 74 69 6f 6e 73 68 69 70 73 3c 2f 68 33 elationships</h3
2a00: 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 70 61 >..<table cellpa
2a10: 64 64 69 6e 67 3d 22 36 22 20 63 65 6c 6c 73 70 dding="6" cellsp
2a20: 61 63 69 6e 67 3d 22 38 22 3e 0d 0a 3c 74 72 3e acing="8">..<tr>
2a30: 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 <td>..<b><<i>top
2a40: 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f o-prefix</i>>_to
2a50: 70 6f 6c 61 79 65 72 73 3c 2f 62 3e 0d 0a 3c 76 polayers</b>..<v
2a60: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 erbatim>..SELECT
2a70: 20 2a 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 * FROM census20
2a80: 31 31 5f 74 6f 70 6f 6c 61 79 65 72 73 3b 0d 0a 11_topolayers;..
2a90: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 </verbatim>..The
2aa0: 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f <b>TopoLayers</
2ab0: 62 3e 20 74 61 62 6c 65 20 63 6f 6e 74 61 69 6e b> table contain
2ac0: 73 20 61 20 64 69 73 74 69 6e 63 74 20 72 6f 77 s a distinct row
2ad0: 20 66 6f 72 20 65 76 65 72 79 20 54 6f 70 6f 4c for every TopoL
2ae0: 61 79 65 72 20 64 65 66 69 6e 65 64 20 6f 6e 20 ayer defined on
2af0: 74 68 65 20 63 75 72 72 65 6e 74 20 54 6f 70 6f the current Topo
2b00: 6c 6f 67 79 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 45 logy.<br><br>..E
2b10: 61 63 68 20 54 6f 70 6f 4c 61 79 65 72 20 69 73 ach TopoLayer is
2b20: 20 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 61 identified by a
2b30: 6e 20 3c 62 3e 69 64 3c 2f 62 3e 20 61 6e 64 20 n <b>id</b> and
2b40: 62 79 20 61 20 3c 62 3e 6e 61 6d 65 3c 2f 62 3e by a <b>name</b>
2b50: 3b 20 62 6f 74 68 20 61 72 65 20 72 65 71 75 69 ; both are requi
2b60: 72 65 64 20 74 6f 20 62 79 20 75 6e 69 71 75 65 red to by unique
2b70: 20 76 61 6c 75 65 73 2e 0d 0a 3c 2f 74 64 3e 3c values...</td><
2b80: 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75 73 32 td>.."<i>census2
2b90: 30 31 31 5f 74 6f 70 6f 6c 61 79 65 72 73 3c 2f 011_topolayers</
2ba0: 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c i>"..<table cell
2bb0: 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 span="4" cellpad
2bc0: 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 ding="6" bgcolor
2bd0: 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 ="#f8f8f0" borde
2be0: 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 r="1">..<tr><td
2bf0: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 bgcolor="#f0f0f8
2c00: 22 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 "><b>topolayer_i
2c10: 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 d</b></td>..<td
2c20: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 bgcolor="#f0f0f8
2c30: 22 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 6e "><b>topolayer_n
2c40: 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 ame</b></td></tr
2c50: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e >..<tr><td align
2c60: 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c ="right">1</td><
2c70: 74 64 3e 63 65 6e 73 75 73 5f 61 72 65 61 73 3c td>census_areas<
2c80: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
2c90: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
2ca0: 3e 32 3c 2f 74 64 3e 3c 74 64 3e 70 70 6c 3c 2f >2</td><td>ppl</
2cb0: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
2cc0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
2cd0: 33 3c 2f 74 64 3e 3c 74 64 3e 63 6f 6d 3c 2f 74 3</td><td>com</t
2ce0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
2cf0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 align="right">4
2d00: 3c 2f 74 64 3e 3c 74 64 3e 70 72 6f 76 3c 2f 74 </td><td>prov</t
2d10: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
2d20: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 align="right">5
2d30: 3c 2f 74 64 3e 3c 74 64 3e 72 65 67 3c 2f 74 64 </td><td>reg</td
2d40: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e ></tr>..</table>
2d50: 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 ..</td></tr>..<t
2d60: 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 r><td>..<b><<i>t
2d70: 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f opo-prefix</i>>_
2d80: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 3c 3c 69 topofeatures_<<i
2d90: 3e 74 6f 70 6f 6c 61 79 65 72 2d 69 64 3c 2f 69 >topolayer-id</i
2da0: 3e 3e 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 >></b>..<verbati
2db0: 6d 3e 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f m>..SELECT * FRO
2dc0: 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 M census2011_top
2dd0: 6f 66 65 61 74 75 72 65 73 5f 32 3b 0d 0a 0d 0a ofeatures_2;....
2de0: 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 63 65 SELECT * FROM ce
2df0: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
2e00: 74 75 72 65 73 5f 34 3b 0d 0a 3c 2f 76 65 72 62 tures_4;..</verb
2e10: 61 74 69 6d 3e 0d 0a 54 68 65 20 73 61 6d 65 20 atim>..The same
2e20: 54 6f 70 6f 6c 6f 67 79 20 63 61 6e 20 63 6f 6e Topology can con
2e30: 74 61 69 6e 20 6d 6f 72 65 20 74 68 61 6e 20 61 tain more than a
2e40: 20 73 69 6e 67 6c 65 20 3c 62 3e 54 6f 70 6f 46 single <b>TopoF
2e50: 65 61 74 75 72 65 73 3c 2f 62 3e 20 74 61 62 6c eatures</b> tabl
2e60: 65 2c 20 61 6e 64 20 65 61 63 68 20 54 6f 70 6f e, and each Topo
2e70: 46 65 61 74 75 72 65 73 20 74 61 62 6c 65 20 63 Features table c
2e80: 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 20 orresponds to a
2e90: 73 69 6e 67 6c 65 20 54 6f 70 6f 4c 61 79 65 72 single TopoLayer
2ea0: 2e 3c 62 72 3e 0d 0a 45 76 65 72 79 20 74 61 62 .<br>..Every tab
2eb0: 6c 65 20 6f 6e 65 20 68 61 73 20 61 20 73 70 65 le one has a spe
2ec0: 63 69 66 69 63 20 6c 61 79 6f 75 74 20 6f 6e 20 cific layout on
2ed0: 69 74 73 20 6f 77 6e 20 28 73 74 72 69 63 74 6c its own (strictl
2ee0: 79 20 72 65 66 6c 65 63 74 69 6e 67 20 74 68 65 y reflecting the
2ef0: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 information att
2f00: 72 69 62 75 74 65 73 20 66 6f 72 20 65 61 63 68 ributes for each
2f10: 20 6c 61 79 65 72 29 2c 20 61 6e 79 77 61 79 20 layer), anyway
2f20: 61 6c 6c 20 74 68 65 6d 20 77 69 6c 6c 20 68 61 all them will ha
2f30: 76 65 20 61 20 3c 62 3e 75 6e 69 71 75 65 20 54 ve a <b>unique T
2f40: 6f 70 6f 46 65 61 74 75 72 65 20 69 64 65 6e 74 opoFeature ident
2f50: 69 66 69 65 72 3c 2f 62 3e 20 28 3c 62 3e 3c 69 ifier</b> (<b><i
2f60: 3e 66 69 64 3c 2f 69 3e 3c 2f 62 3e 29 20 61 63 >fid</i></b>) ac
2f70: 74 69 6e 67 20 69 6e 20 74 68 65 20 50 72 69 6d ting in the Prim
2f80: 61 72 79 20 4b 65 79 20 72 6f 6c 65 2e 3c 62 72 ary Key role.<br
2f90: 3e 0d 0a 54 68 65 20 63 6f 72 72 65 73 70 6f 6e >..The correspon
2fa0: 64 65 6e 63 79 20 62 65 74 77 65 65 6e 20 74 61 dency between ta
2fb0: 62 6c 65 20 6e 61 6d 65 73 20 61 6e 64 20 54 6f ble names and To
2fc0: 70 6f 4c 61 79 65 72 73 20 69 73 20 65 73 74 61 poLayers is esta
2fd0: 62 6c 69 73 68 65 64 20 62 79 20 61 70 70 65 6e blished by appen
2fe0: 64 69 6e 67 20 61 20 6e 75 6d 65 72 69 63 20 73 ding a numeric s
2ff0: 75 66 66 69 78 20 74 6f 20 74 68 65 20 63 6f 6d uffix to the com
3000: 6d 6f 6e 20 6e 61 6d 65 20 74 68 61 74 20 6d 75 mon name that mu
3010: 73 74 20 65 78 61 63 74 6c 79 20 6d 61 74 63 68 st exactly match
3020: 20 74 68 65 20 3c 62 3e 74 6f 70 6f 6c 6f 61 79 the <b>topoloay
3030: 65 72 5f 69 64 3c 2f 62 3e 20 76 61 6c 75 65 20 er_id</b> value
3040: 64 65 63 6c 61 72 65 64 20 69 6e 20 74 68 65 20 declared in the
3050: 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 <b>TopoLayers</b
3060: 3e 20 6d 61 69 6e 20 74 61 62 6c 65 2e 3c 62 72 > main table.<br
3070: 3e 3c 62 72 3e 0d 0a 41 73 20 69 73 20 73 68 6f ><br>..As is sho
3080: 77 6e 20 69 6e 20 74 68 69 73 20 65 78 61 6d 70 wn in this examp
3090: 6c 65 20 74 68 65 20 66 69 72 73 74 20 74 61 62 le the first tab
30a0: 6c 65 20 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 le <b>census2011
30b0: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 3c _topofeatures_2<
30c0: 2f 62 3e 20 28 3c 69 3e 74 6f 70 6f 6c 61 79 65 /b> (<i>topolaye
30d0: 72 5f 69 64 3c 2f 69 3e 3d 3c 69 3e 32 3c 2f 69 r_id</i>=<i>2</i
30e0: 3e 29 20 63 6f 6e 74 61 69 6e 73 20 61 6c 6c 20 >) contains all
30f0: 54 6f 70 6f 46 65 61 74 75 72 65 73 20 61 73 73 TopoFeatures ass
3100: 6f 63 69 61 74 65 64 20 74 6f 20 74 68 65 20 54 ociated to the T
3110: 6f 70 6f 4c 61 79 65 72 20 3c 62 3e 70 70 6c 3c opoLayer <b>ppl<
3120: 2f 62 3e 20 28 3c 69 3e 50 6f 70 75 6c 61 74 65 /b> (<i>Populate
3130: 64 20 50 6c 61 63 65 73 3c 2f 69 3e 29 2e 3c 62 d Places</i>).<b
3140: 72 3e 3c 62 72 3e 0d 0a 54 68 65 20 73 65 63 6f r><br>..The seco
3150: 6e 64 20 74 61 62 6c 65 20 3c 62 3e 63 65 6e 73 nd table <b>cens
3160: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 us2011_topofeatu
3170: 72 65 73 5f 34 3c 2f 62 3e 20 28 3c 69 3e 74 6f res_4</b> (<i>to
3180: 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 69 3e 3d 3c polayer_id</i>=<
3190: 69 3e 34 3c 2f 69 3e 29 20 63 6f 6e 74 61 69 6e i>4</i>) contain
31a0: 73 20 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 s all TopoFeatur
31b0: 65 73 20 61 73 73 6f 63 69 61 74 65 64 20 74 6f es associated to
31c0: 20 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20 3c the TopoLayer <
31d0: 62 3e 70 72 6f 76 3c 2f 62 3e 20 28 3c 69 3e 50 b>prov</b> (<i>P
31e0: 72 6f 76 69 6e 63 65 73 3c 2f 69 3e 29 2e 0d 0a rovinces</i>)...
31f0: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e 63 </td><td>.."<i>c
3200: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 ensus2011_topofe
3210: 61 74 75 72 65 73 5f 32 3c 2f 69 3e 22 0d 0a 3c atures_2</i>"..<
3220: 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 table cellspan="
3230: 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 4" cellpadding="
3240: 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 6" bgcolor="#f8f
3250: 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 8f0" border="1">
3260: 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f 6c 6f ..<tr><td bgcolo
3270: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 r="#f0f0f8"><b>f
3280: 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 id</b></td>..<td
3290: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
32a0: 38 22 3e 3c 62 3e 63 6f 64 5f 70 70 6c 3c 2f 62 8"><b>cod_ppl</b
32b0: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
32c0: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
32d0: 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 >cod_com</b></td
32e0: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
32f0: 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e 61 6d 65 #f0f0f8"><b>name
3300: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 </b></td>..<td b
3310: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 gcolor="#f0f0f8"
3320: 3e 3c 62 3e 70 6f 70 5f 32 30 31 31 3c 2f 62 3e ><b>pop_2011</b>
3330: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c </td>..<td bgcol
3340: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e or="#f0f0f8"><b>
3350: 6d 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d m_2011</b></td>.
3360: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 .<td bgcolor="#f
3370: 30 66 30 66 38 22 3e 3c 62 3e 66 5f 32 30 31 31 0f0f8"><b>f_2011
3380: 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a </b></td></tr>..
3390: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
33a0: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 ight">1</td><td
33b0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 align="right">20
33c0: 35 31 34 32 37 30 35 3c 2f 74 64 3e 3c 74 64 20 5142705</td><td
33d0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 35 align="right">45
33e0: 30 30 31 3c 2f 74 64 3e 3c 74 64 3e 41 6c 62 69 001</td><td>Albi
33f0: 61 6e 6f 20 4d 61 67 72 61 3c 2f 74 64 3e 3c 74 ano Magra</td><t
3400: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3410: 31 39 30 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 1907</td><td ali
3420: 67 6e 3d 22 72 69 67 68 74 22 3e 39 31 39 3c 2f gn="right">919</
3430: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3440: 67 68 74 22 3e 39 38 38 3c 2f 74 64 3e 3c 2f 74 ght">988</td></t
3450: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 r>..<tr><td alig
3460: 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e n="right">2</td>
3470: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3480: 22 3e 32 30 35 31 34 32 37 30 36 3c 2f 74 64 3e ">205142706</td>
3490: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
34a0: 22 3e 34 35 30 30 31 3c 2f 74 64 3e 3c 74 64 3e ">45001</td><td>
34b0: 41 75 6c 6c 61 3c 2f 74 64 3e 3c 74 64 20 61 6c Aulla</td><td al
34c0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 33 32 31 ign="right">4321
34d0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
34e0: 72 69 67 68 74 22 3e 32 30 34 36 3c 2f 74 64 3e right">2046</td>
34f0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3500: 22 3e 32 32 37 35 3c 2f 74 64 3e 3c 2f 74 72 3e ">2275</td></tr>
3510: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d ..<tr><td align=
3520: 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 "right">3</td><t
3530: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3540: 32 30 35 31 34 32 37 31 30 3c 2f 74 64 3e 3c 74 205142710</td><t
3550: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3560: 34 35 30 30 31 3c 2f 74 64 3e 3c 74 64 3e 43 61 45001</td><td>Ca
3570: 70 72 69 67 6c 69 6f 6c 61 3c 2f 74 64 3e 3c 74 prigliola</td><t
3580: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3590: 34 38 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 482</td><td alig
35a0: 6e 3d 22 72 69 67 68 74 22 3e 32 32 36 3c 2f 74 n="right">226</t
35b0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
35c0: 68 74 22 3e 32 35 36 3c 2f 74 64 3e 3c 2f 74 72 ht">256</td></tr
35d0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 >..<tr><td colsp
35e0: 61 6e 3d 22 37 22 20 61 6c 69 67 6e 3d 22 63 65 an="7" align="ce
35f0: 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c nter"><hr></td><
3600: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c /tr>..<tr><td al
3610: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 31 38 ign="right">1018
3620: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3630: 72 69 67 68 74 22 3e 31 34 31 30 37 37 35 34 31 right">141077541
3640: 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 5</td><td align=
3650: 22 72 69 67 68 74 22 3e 31 30 30 30 30 37 3c 2f "right">100007</
3660: 74 64 3e 3c 74 64 3e 53 61 73 73 65 74 61 3c 2f td><td>Sasseta</
3670: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3680: 67 68 74 22 3e 32 38 35 3c 2f 74 64 3e 3c 74 64 ght">285</td><td
3690: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
36a0: 33 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 37</td><td align
36b0: 3d 22 72 69 67 68 74 22 3e 31 34 38 3c 2f 74 64 ="right">148</td
36c0: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 ></tr>..<tr><td
36d0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 align="right">10
36e0: 31 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 19</td><td align
36f0: 3d 22 72 69 67 68 74 22 3e 31 34 31 30 37 38 35 ="right">1410785
3700: 34 31 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 415</td><td alig
3710: 6e 3d 22 72 69 67 68 74 22 3e 31 30 30 30 30 37 n="right">100007
3720: 3c 2f 74 64 3e 3c 74 64 3e 54 65 72 72 69 67 6f </td><td>Terrigo
3730: 6c 69 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e li</td><td align
3740: 3d 22 72 69 67 68 74 22 3e 35 33 37 3c 2f 74 64 ="right">537</td
3750: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3760: 74 22 3e 32 36 34 3c 2f 74 64 3e 3c 74 64 20 61 t">264</td><td a
3770: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 37 33 lign="right">273
3780: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 </td></tr>..</ta
3790: 62 6c 65 3e 0d 0a 3c 62 72 3e 0d 0a 22 3c 69 3e ble>..<br>.."<i>
37a0: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 census2011_topof
37b0: 65 61 74 75 72 65 73 5f 34 3c 2f 69 3e 22 0d 0a eatures_4</i>"..
37c0: 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d <table cellspan=
37d0: 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d "4" cellpadding=
37e0: 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 "6" bgcolor="#f8
37f0: 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22 f8f0" border="1"
3800: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f 6c >..<tr><td bgcol
3810: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e or="#f0f0f8"><b>
3820: 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 fid</b></td>..<t
3830: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
3840: 66 38 22 3e 3c 62 3e 63 6f 64 5f 70 72 6f 76 3c f8"><b>cod_prov<
3850: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 /b></td>..<td bg
3860: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e color="#f0f0f8">
3870: 3c 62 3e 63 6f 64 5f 72 65 67 3c 2f 62 3e 3c 2f <b>cod_reg</b></
3880: 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 td>..<td bgcolor
3890: 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 6e 61 ="#f0f0f8"><b>na
38a0: 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 me</b></td>..<td
38b0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
38c0: 38 22 3e 3c 62 3e 61 62 62 72 65 76 3c 2f 62 3e 8"><b>abbrev</b>
38d0: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c </td>..<td bgcol
38e0: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e or="#f0f0f8"><b>
38f0: 70 6f 70 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 pop_2011</b></td
3900: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
3910: 23 66 30 66 30 66 38 22 3e 3c 62 3e 6d 5f 32 30 #f0f0f8"><b>m_20
3920: 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 11</b></td>..<td
3930: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
3940: 38 22 3e 3c 62 3e 66 5f 32 30 31 31 3c 2f 62 3e 8"><b>f_2011</b>
3950: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
3960: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3970: 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ">1</td><td alig
3980: 6e 3d 22 72 69 67 68 74 22 3e 34 35 3c 2f 74 64 n="right">45</td
3990: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
39a0: 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 4d 61 73 t">9</td><td>Mas
39b0: 73 61 26 6e 62 73 70 3b 43 61 72 72 61 72 61 3c sa Carrara<
39c0: 2f 74 64 3e 3c 74 64 3e 4d 53 3c 2f 74 64 3e 3c /td><td>MS</td><
39d0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
39e0: 3e 31 39 39 36 35 30 3c 2f 74 64 3e 3c 74 64 20 >199650</td><td
39f0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 35 align="right">95
3a00: 37 35 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 754</td><td alig
3a10: 6e 3d 22 72 69 67 68 74 22 3e 31 30 33 38 39 36 n="right">103896
3a20: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
3a30: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3a40: 22 3e 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ">2</td><td alig
3a50: 6e 3d 22 72 69 67 68 74 22 3e 34 36 3c 2f 74 64 n="right">46</td
3a60: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3a70: 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 4c 75 63 t">9</td><td>Luc
3a80: 63 61 3c 2f 74 64 3e 3c 74 64 3e 4c 55 3c 2f 74 ca</td><td>LU</t
3a90: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3aa0: 68 74 22 3e 33 38 38 33 32 37 3c 2f 74 64 3e 3c ht">388327</td><
3ab0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3ac0: 3e 31 38 36 31 38 33 3c 2f 74 64 3e 3c 74 64 20 >186183</td><td
3ad0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 align="right">20
3ae0: 32 31 34 34 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 2144</td></tr>..
3af0: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
3b00: 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 20 ight">3</td><td
3b10: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 37 align="right">47
3b20: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3b30: 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 right">9</td><td
3b40: 3e 50 69 73 74 6f 69 61 3c 2f 74 64 3e 3c 74 64 >Pistoia</td><td
3b50: 3e 50 54 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 >PT</td><td alig
3b60: 6e 3d 22 72 69 67 68 74 22 3e 32 38 37 38 36 36 n="right">287866
3b70: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3b80: 72 69 67 68 74 22 3e 31 33 38 30 35 34 3c 2f 74 right">138054</t
3b90: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3ba0: 68 74 22 3e 31 34 39 38 31 32 3c 2f 74 64 3e 3c ht">149812</td><
3bb0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f /tr>..<tr><td co
3bc0: 6c 73 70 61 6e 3d 22 38 22 20 61 6c 69 67 6e 3d lspan="8" align=
3bd0: 22 63 65 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 "center"><hr></t
3be0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
3bf0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 align="right">9
3c00: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3c10: 72 69 67 68 74 22 3e 35 33 3c 2f 74 64 3e 3c 74 right">53</td><t
3c20: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3c30: 39 3c 2f 74 64 3e 3c 74 64 3e 47 72 6f 73 73 65 9</td><td>Grosse
3c40: 74 6f 3c 2f 74 64 3e 3c 74 64 3e 47 52 3c 2f 74 to</td><td>GR</t
3c50: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3c60: 68 74 22 3e 32 32 30 35 36 34 3c 2f 74 64 3e 3c ht">220564</td><
3c70: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3c80: 3e 31 30 35 35 38 35 3c 2f 74 64 3e 3c 74 64 20 >105585</td><td
3c90: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 31 align="right">11
3ca0: 34 39 37 39 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 4979</td></tr>..
3cb0: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
3cc0: 69 67 68 74 22 3e 31 30 3c 2f 74 64 3e 3c 74 64 ight">10</td><td
3cd0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
3ce0: 30 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 00</td><td align
3cf0: 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c ="right">9</td><
3d00: 74 64 3e 50 72 61 74 6f 3c 2f 74 64 3e 3c 74 64 td>Prato</td><td
3d10: 3e 50 4f 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 >PO</td><td alig
3d20: 6e 3d 22 72 69 67 68 74 22 3e 32 34 35 39 31 36 n="right">245916
3d30: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3d40: 72 69 67 68 74 22 3e 31 31 39 30 38 38 3c 2f 74 right">119088</t
3d50: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3d60: 68 74 22 3e 31 32 36 38 32 38 3c 2f 74 64 3e 3c ht">126828</td><
3d70: 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a /tr>..</table>..
3d80: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
3d90: 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 <td>..<b><<i>top
3da0: 6f 2d 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f o-prefix</i>>_to
3db0: 70 6f 66 65 61 74 75 72 65 73 3c 2f 62 3e 0d 0a pofeatures</b>..
3dc0: 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 <verbatim>..SELE
3dd0: 43 54 20 2a 20 46 52 4f 4d 20 63 65 6e 73 75 73 CT * FROM census
3de0: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 2011_topofeature
3df0: 73 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d s;..</verbatim>.
3e00: 0a 54 68 65 20 3c 62 3e 54 6f 70 6f 46 65 61 74 .The <b>TopoFeat
3e10: 75 72 65 73 2d 67 65 6f 6d 65 74 72 69 65 73 3c ures-geometries<
3e20: 2f 62 3e 20 74 61 62 6c 65 20 69 73 20 69 6e 74 /b> table is int
3e30: 65 6e 64 65 64 20 74 6f 20 70 65 72 6d 61 6e 65 ended to permane
3e40: 6e 74 6c 79 20 73 74 6f 72 65 20 61 6c 6c 20 72 ntly store all r
3e50: 65 6c 61 74 69 6f 6e 73 20 62 65 74 77 65 65 6e elations between
3e60: 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 61 6e TopoFeatures an
3e70: 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 d Topology primi
3e80: 74 69 76 65 73 20 72 65 71 75 69 72 65 64 20 69 tives required i
3e90: 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f 72 72 65 n order to corre
3ea0: 63 74 6c 79 20 62 75 69 6c 64 20 74 68 65 20 65 ctly build the e
3eb0: 78 70 65 63 74 65 64 20 6f 75 74 70 75 74 20 47 xpected output G
3ec0: 65 6f 6d 65 74 72 79 20 66 6f 72 20 65 61 63 68 eometry for each
3ed0: 20 54 6f 70 6f 46 65 61 74 75 72 65 2e 0d 0a 3c TopoFeature...<
3ee0: 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 75 69 64 3c ul>..<li><b>uid<
3ef0: 2f 62 3e 20 69 73 20 74 68 65 20 50 72 69 6d 61 /b> is the Prima
3f00: 72 79 20 4b 65 79 2c 20 61 6e 64 20 69 73 20 73 ry Key, and is s
3f10: 69 6d 70 6c 79 20 69 6e 74 65 6e 64 65 64 20 74 imply intended t
3f20: 6f 20 62 65 20 61 6e 20 75 6e 69 71 75 65 20 69 o be an unique i
3f30: 64 65 6e 74 69 66 69 65 72 20 66 6f 72 20 65 61 dentifier for ea
3f40: 63 68 20 72 6f 77 20 62 75 74 20 64 6f 65 73 6e ch row but doesn
3f50: 27 74 20 69 6e 74 65 6e 64 73 20 61 6e 79 20 73 't intends any s
3f60: 70 65 63 69 61 6c 20 6d 65 61 6e 69 6e 67 2e 3c pecial meaning.<
3f70: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 6e 6f 64 /li>..<li><b>nod
3f80: 65 5f 69 64 3c 2f 62 3e 2c 20 3c 62 3e 65 64 67 e_id</b>, <b>edg
3f90: 65 5f 69 64 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e e_id</b> and <b>
3fa0: 66 61 63 65 5f 69 64 3c 2f 62 3e 20 61 72 65 20 face_id</b> are
3fb0: 46 6f 72 65 69 67 6e 20 4b 65 79 73 20 64 69 72 Foreign Keys dir
3fc0: 65 63 74 6c 79 20 72 65 66 65 72 65 6e 63 69 6e ectly referencin
3fd0: 67 20 61 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 g a Topology pri
3fe0: 6d 69 74 69 76 65 3b 20 74 77 6f 20 6f 66 20 74 mitive; two of t
3ff0: 68 65 73 65 20 76 61 6c 75 65 73 20 61 72 65 20 hese values are
4000: 61 6c 77 61 79 73 20 65 78 70 65 63 74 65 64 20 always expected
4010: 74 6f 20 62 65 20 4e 55 4c 4c 2c 20 61 6e 64 20 to be NULL, and
4020: 6f 6e 6c 79 20 6f 6e 65 20 69 73 20 65 78 70 65 only one is expe
4030: 63 74 65 64 20 74 6f 20 65 66 66 65 63 74 69 76 cted to effectiv
4040: 65 6c 79 20 72 65 66 65 72 65 6e 63 65 20 61 20 ely reference a
4050: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 Topology primiti
4060: 76 65 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 ve depending on
4070: 69 74 73 20 74 79 70 65 2e 3c 2f 6c 69 3e 0d 0a its type.</li>..
4080: 3c 6c 69 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 <li><b>topolayer
4090: 5f 69 64 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 66 _id</b> and <b>f
40a0: 69 64 3c 2f 62 3e 20 74 6f 67 65 74 68 65 72 20 id</b> together
40b0: 61 72 65 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 are intended to
40c0: 65 73 74 61 62 6c 69 73 68 20 61 20 72 65 6c 61 establish a rela
40d0: 74 69 6f 6e 61 6c 20 72 65 66 65 72 65 6e 63 65 tional reference
40e0: 20 74 6f 20 73 6f 6d 65 20 73 70 65 63 69 66 69 to some specifi
40f0: 63 20 54 6f 70 6f 46 65 61 74 75 72 65 2e 3c 2f c TopoFeature.</
4100: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e li>..</ul>..<br>
4110: 0d 0a 3c 75 3e 45 78 61 6d 70 6c 65 20 23 31 3c ..<u>Example #1<
4120: 2f 75 3e 3a 20 61 6c 6c 20 54 6f 70 6f 6c 6f 67 /u>: all Topolog
4130: 79 20 70 72 69 6d 69 74 69 76 65 73 20 64 69 72 y primitives dir
4140: 65 63 74 6c 79 20 72 65 66 65 72 65 6e 63 65 64 ectly referenced
4150: 20 62 79 20 72 6f 77 73 20 64 65 63 6c 61 72 69 by rows declari
4160: 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f ng <b>topolayer_
4170: 69 64 3d 32 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e id=2</b> and <b>
4180: 66 69 64 3d 33 3c 2f 62 3e 20 6d 75 73 74 20 62 fid=3</b> must b
4190: 65 20 61 67 67 72 65 67 61 74 65 64 20 69 6e 20 e aggregated in
41a0: 6f 72 64 65 72 20 74 6f 20 62 75 69 6c 64 20 74 order to build t
41b0: 68 65 20 6f 75 74 70 75 74 20 47 65 6f 6d 65 74 he output Geomet
41c0: 72 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 ry corresponding
41d0: 20 74 6f 20 74 68 65 20 50 6f 70 75 6c 61 74 65 to the Populate
41e0: 64 20 50 6c 61 63 65 20 6f 66 20 3c 62 3e 43 61 d Place of <b>Ca
41f0: 70 72 69 67 6c 69 6f 6c 61 3c 2f 62 3e 2e 3c 62 prigliola</b>.<b
4200: 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70 6c 65 20 23 r>..<u>Example #
4210: 32 3c 2f 75 3e 3a 20 61 6c 6c 20 70 72 69 6d 69 2</u>: all primi
4220: 74 69 76 65 73 20 72 65 66 65 72 65 6e 63 65 64 tives referenced
4230: 20 62 79 20 72 6f 77 73 20 64 65 63 6c 61 72 69 by rows declari
4240: 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f ng <b>topolayer_
4250: 69 64 3d 34 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e id=4</b> and <b>
4260: 66 69 64 3d 39 3c 2f 62 3e 20 6d 75 73 74 20 62 fid=9</b> must b
4270: 65 20 61 67 67 72 65 67 61 74 65 64 20 69 6e 20 e aggregated in
4280: 6f 72 64 65 72 20 74 6f 20 62 75 69 6c 64 20 74 order to build t
4290: 68 65 20 6f 75 74 70 75 74 20 47 65 6f 6d 65 74 he output Geomet
42a0: 72 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 ry corresponding
42b0: 20 74 6f 20 74 68 65 20 50 72 6f 76 69 6e 63 65 to the Province
42c0: 20 6f 66 20 3c 62 3e 47 72 6f 73 73 65 74 6f 3c of <b>Grosseto<
42d0: 2f 62 3e 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d /b>...</td><td>.
42e0: 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f ."<i>census2011_
42f0: 74 6f 70 6f 66 65 61 74 75 72 65 73 3c 2f 69 3e topofeatures</i>
4300: 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 "..<table cellsp
4310: 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 an="4" cellpaddi
4320: 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 ng="6" bgcolor="
4330: 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d #f8f8f0" border=
4340: 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 "1">..<tr><td bg
4350: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e color="#f0f0f8">
4360: 3c 62 3e 75 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d <b>uid</b></td>.
4370: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 .<td bgcolor="#f
4380: 30 66 30 66 38 22 3e 3c 62 3e 6e 6f 64 65 5f 69 0f0f8"><b>node_i
4390: 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 d</b></td>..<td
43a0: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 bgcolor="#f0f0f8
43b0: 22 3e 3c 62 3e 65 64 67 65 5f 69 64 3c 2f 62 3e "><b>edge_id</b>
43c0: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c </td>..<td bgcol
43d0: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e or="#f0f0f8"><b>
43e0: 66 61 63 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e face_id</b></td>
43f0: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 ..<td bgcolor="#
4400: 66 30 66 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c f0f0f8"><b>topol
4410: 61 79 65 72 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e ayer_id</b></td>
4420: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 ..<td bgcolor="#
4430: 66 30 66 30 66 38 22 3e 3c 62 3e 66 69 64 3c 2f f0f0f8"><b>fid</
4440: 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 b></td></tr>..<t
4450: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
4460: 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 4e 55 ht">1</td><td>NU
4470: 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c LL</td><td>NULL<
4480: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
4490: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 ight">1</td><td
44a0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c align="right">1<
44b0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
44c0: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 2f 74 72 ight">1</td></tr
44d0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e >..<tr><td align
44e0: 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c ="right">2</td><
44f0: 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e td>NULL</td><td>
4500: 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 NULL</td><td ali
4510: 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 gn="right">2</td
4520: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
4530: 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 t">1</td><td ali
4540: 67 6e 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 gn="right">2</td
4550: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 ></tr>..<tr><td
4560: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c align="right">3<
4570: 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 /td><td>NULL</td
4580: 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 ><td>NULL</td><t
4590: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
45a0: 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 3</td><td align=
45b0: 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 "right">1</td><t
45c0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
45d0: 33 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3</td></tr>..<tr
45e0: 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 36 22 ><td colspan="6"
45f0: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
4600: 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a <hr></td></tr>..
4610: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
4620: 69 67 68 74 22 3e 32 38 38 37 30 3c 2f 74 64 3e ight">28870</td>
4630: 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 <td>NULL</td><td
4640: 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c >NULL</td><td al
4650: 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 36 ign="right">2886
4660: 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 4</td><td align=
4670: 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 "right">1</td><t
4680: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
4690: 32 38 38 36 37 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 28867</td></tr>.
46a0: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 .<tr><td align="
46b0: 72 69 67 68 74 22 3e 32 38 38 37 31 3c 2f 74 64 right">28871</td
46c0: 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 ><td>NULL</td><t
46d0: 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 d>NULL</td><td a
46e0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 lign="right">288
46f0: 36 38 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 68</td><td align
4700: 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c ="right">1</td><
4710: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
4720: 3e 32 38 38 36 38 3c 2f 74 64 3e 3c 2f 74 72 3e >28868</td></tr>
4730: 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74 64 ..</table>..</td
4740: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e ></tr>..</table>
4750: 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 70 61 64 ..<table cellpad
4760: 64 69 6e 67 3d 22 38 22 20 62 67 63 6f 6c 6f 72 ding="8" bgcolor
4770: 3d 22 23 64 30 66 66 62 30 22 3e 0d 0a 3c 74 72 ="#d0ffb0">..<tr
4780: 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 46 69 6e 61 6c ><td>..<h3>Final
4790: 20 72 65 6d 61 72 6b 73 3c 2f 68 33 3e 0d 0a 3c remarks</h3>..<
47a0: 6f 6c 3e 0d 0a 3c 6c 69 3e 62 6f 74 68 20 3c 62 ol>..<li>both <b
47b0: 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54 >TopoGeo_CreateT
47c0: 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 61 opoLayer()</b> a
47d0: 6e 64 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e nd <b>TopoGeo_In
47e0: 69 74 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 itTopoLayer()</b
47f0: 3e 20 77 69 6c 6c 20 72 65 67 69 73 74 65 72 20 > will register
4800: 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20 69 6e the TopoLayer in
4810: 74 6f 20 74 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 to the <b>TopoLa
4820: 79 65 72 73 3c 2f 62 3e 20 74 61 62 6c 65 2c 20 yers</b> table,
4830: 61 6e 64 20 77 69 6c 6c 20 63 72 65 61 74 65 20 and will create
4840: 61 6e 64 20 70 6f 70 75 6c 61 74 65 20 74 68 65 and populate the
4850: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 3c corresponding <
4860: 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 3c 2f b>TopoFeatures</
4870: 62 3e 20 74 61 62 6c 65 20 62 79 20 69 6d 70 6f b> table by impo
4880: 72 74 69 6e 67 20 61 6c 6c 20 69 6e 66 6f 72 6d rting all inform
4890: 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 ation attributes
48a0: 20 66 6f 72 20 65 61 63 68 20 46 65 61 74 75 72 for each Featur
48b0: 65 20 64 65 66 69 6e 65 64 20 62 79 20 74 68 65 e defined by the
48c0: 20 72 65 66 65 72 65 6e 63 65 20 74 61 62 6c 65 reference table
48d0: 20 28 6f 72 20 72 65 66 65 72 65 6e 63 65 20 76 (or reference v
48e0: 69 65 77 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e iew).</li>..<li>
48f0: 61 6e 79 77 61 79 20 6f 6e 6c 79 20 3c 62 3e 54 anyway only <b>T
4900: 6f 70 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 opoGeo_CreateTop
4910: 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 77 69 6c oLayer()</b> wil
4920: 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 l automatically
4930: 70 6f 70 75 6c 61 74 65 20 74 68 65 20 3c 62 3e populate the <b>
4940: 54 6f 70 6f 46 65 61 74 75 72 65 73 2d 67 65 6f TopoFeatures-geo
4950: 6d 65 74 72 79 3c 2f 62 3e 20 74 61 62 6c 65 2c metry</b> table,
4960: 20 61 6e 64 20 77 69 6c 6c 20 64 6f 20 73 75 63 and will do suc
4970: 68 20 61 20 74 68 69 6e 67 20 62 79 20 69 64 65 h a thing by ide
4980: 6e 74 69 66 79 69 6e 67 20 61 6c 6c 20 72 65 6c ntifying all rel
4990: 61 74 69 6f 6e 73 68 69 70 73 20 65 78 69 73 74 ationships exist
49a0: 69 6e 67 20 62 65 74 77 65 65 6e 20 74 68 65 20 ing between the
49b0: 47 65 6f 6d 65 74 72 69 65 73 20 66 6f 75 6e 64 Geometries found
49c0: 20 69 6e 74 6f 20 74 68 65 20 72 65 66 65 72 65 into the refere
49d0: 6e 63 65 20 74 61 62 6c 65 20 6f 72 20 76 69 65 nce table or vie
49e0: 77 20 61 6e 64 20 74 68 65 20 54 6f 70 6f 6c 6f w and the Topolo
49f0: 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 76 69 gy primitives vi
4a00: 61 20 74 68 65 20 69 6e 74 65 72 6d 65 64 69 61 a the intermedia
4a10: 74 69 6f 6e 20 6f 66 20 74 68 65 20 3c 62 3e 54 tion of the <b>T
4a20: 6f 70 6f 53 65 65 64 73 3c 2f 62 3e 2e 3c 2f 6c opoSeeds</b>.</l
4a30: 69 3e 0d 0a 3c 6c 69 3e 6f 6e 20 74 68 65 20 6f i>..<li>on the o
4a40: 74 68 65 72 20 68 61 6e 64 20 3c 62 3e 54 6f 70 ther hand <b>Top
4a50: 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 oGeo_InitTopoLay
4a60: 65 72 28 29 3c 2f 62 3e 20 77 69 6c 6c 20 6e 65 er()</b> will ne
4a70: 76 65 72 20 61 74 74 65 6d 70 74 20 74 6f 20 69 ver attempt to i
4a80: 64 65 6e 74 69 66 79 20 74 68 65 20 72 65 6c 61 dentify the rela
4a90: 74 69 6f 6e 73 68 69 70 73 20 69 6e 74 65 72 63 tionships interc
4aa0: 75 72 72 69 6e 67 20 62 65 74 77 65 65 6e 20 6f urring between o
4ab0: 75 74 70 75 74 20 47 65 6f 6d 65 74 72 69 65 73 utput Geometries
4ac0: 20 61 6e 64 20 54 6f 70 6f 6c 6f 67 79 20 70 72 and Topology pr
4ad0: 69 6d 69 74 69 76 65 73 2e 20 54 68 69 73 20 74 imitives. This t
4ae0: 61 73 6b 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 ask will always
4af0: 62 65 20 64 65 66 65 72 72 65 64 2e 3c 62 72 3e be deferred.<br>
4b00: 0d 0a 59 6f 75 20 63 6f 75 6c 64 20 65 2e 67 2e ..You could e.g.
4b10: 20 6d 61 6e 75 61 6c 6c 79 20 63 68 65 72 72 79 manually cherry
4b20: 20 70 69 63 6b 20 61 6c 6c 20 54 6f 70 6f 6c 6f pick all Topolo
4b30: 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 63 6f gy primitives co
4b40: 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 61 rresponding to a
4b50: 20 73 69 6e 67 6c 65 20 54 6f 70 6f 46 65 61 74 single TopoFeat
4b60: 75 72 65 3b 20 6f 72 20 6d 6f 72 65 20 70 72 6f ure; or more pro
4b70: 62 61 62 6c 79 20 79 6f 75 20 63 6f 75 6c 64 20 bably you could
4b80: 70 65 72 66 6f 72 6d 20 74 68 69 73 20 74 61 73 perform this tas
4b90: 6b 20 69 6e 20 61 20 73 65 63 6f 6e 64 20 74 69 k in a second ti
4ba0: 6d 65 20 62 79 20 65 78 65 63 75 74 69 6e 67 20 me by executing
4bb0: 73 6f 6d 65 20 61 70 70 72 6f 70 72 69 61 74 65 some appropriate
4bc0: 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 20 28 SQL statement (
4bd0: 3c 69 3e 61 73 20 77 65 27 6c 6c 20 73 65 65 6e <i>as we'll seen
4be0: 20 73 6f 6f 6e 20 69 6e 20 74 68 65 20 6e 65 78 soon in the nex
4bf0: 74 20 65 78 61 6d 70 6c 65 3c 2f 69 3e 29 2e 20 t example</i>).
4c00: 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c 2f 74 64 3e 3c 2f ..</ol>..</td></
4c10: 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 tr>..</table><br
4c20: 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 3e 54 6f 70 >..<hr>..<h3>Top
4c30: 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c oGeo_ExportTopoL
4c40: 61 79 65 72 3a 20 65 78 70 6f 72 74 69 6e 67 20 ayer: exporting
4c50: 61 20 66 75 6c 6c 20 54 6f 70 6f 4c 61 79 65 72 a full TopoLayer
4c60: 20 69 6e 74 6f 20 61 20 47 65 6f 54 61 62 6c 65 into a GeoTable
4c70: 3c 2f 68 33 3e 0d 0a 3c 74 61 62 6c 65 20 77 69 </h3>..<table wi
4c80: 64 74 68 3d 22 31 30 30 25 22 20 20 63 65 6c 6c dth="100%" cell
4c90: 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 span="4" cellpad
4ca0: 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 ding="6" bgcolor
4cb0: 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 ="#f8f8f0" borde
4cc0: 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 r="1">..<tr><td
4cd0: 63 6f 6c 73 70 61 6e 3d 22 32 22 20 61 6c 69 67 colspan="2" alig
4ce0: 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 65 78 n="center"><b>ex
4cf0: 70 6f 72 74 69 6e 67 20 74 68 65 20 43 65 6e 73 porting the Cens
4d00: 75 73 20 41 72 65 61 73 20 54 6f 70 6f 4c 61 79 us Areas TopoLay
4d10: 65 72 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e er</b></td></tr>
4d20: 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 57 65 27 6c ..<tr><td>..We'l
4d30: 6c 20 73 74 61 72 74 20 62 79 20 65 78 70 6f 72 l start by expor
4d40: 74 69 6e 67 20 66 69 72 73 74 20 74 68 65 20 6f ting first the o
4d50: 6e 6c 79 20 63 6f 6d 70 6c 65 74 65 6c 79 20 64 nly completely d
4d60: 65 66 69 6e 65 64 20 54 6f 70 6f 4c 61 79 65 72 efined TopoLayer
4d70: 20 77 65 20 68 61 76 65 20 61 74 20 74 68 69 73 we have at this
4d80: 20 70 6f 69 6e 74 20 69 6e 20 74 68 65 20 74 65 point in the te
4d90: 73 74 20 44 42 2d 66 69 6c 65 2c 20 69 2e 65 2e st DB-file, i.e.
4da0: 20 3c 62 3e 63 65 6e 73 75 73 5f 61 72 65 61 73 <b>census_areas
4db0: 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e </b>..<verbatim>
4dc0: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f ..SELECT TopoGeo
4dd0: 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 _ExportTopoLayer
4de0: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 ('census2011', '
4df0: 63 65 6e 73 75 73 5f 61 72 65 61 73 27 2c 20 27 census_areas', '
4e00: 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30 31 31 27 out_census_2011'
4e10: 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 , 1);..</verbati
4e20: 6d 3e 0d 0a 41 73 20 79 6f 75 20 63 61 6e 20 65 m>..As you can e
4e30: 61 73 69 6c 79 20 63 68 65 63 6b 20 62 79 20 79 asily check by y
4e40: 6f 75 72 73 65 6c 66 20 61 20 6e 65 77 20 47 65 ourself a new Ge
4e50: 6f 54 61 62 6c 65 20 6e 61 6d 65 64 20 3c 62 3e oTable named <b>
4e60: 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30 31 31 3c out_census_2011<
4e70: 2f 62 3e 20 68 61 73 20 62 65 65 6e 20 63 72 65 /b> has been cre
4e80: 61 74 65 64 20 62 79 20 3c 62 3e 54 6f 70 6f 47 ated by <b>TopoG
4e90: 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 eo_ExportTopoLay
4ea0: 65 72 28 29 3c 2f 62 3e 3a 0d 0a 3c 75 6c 3e 0d er()</b>:..<ul>.
4eb0: 0a 3c 6c 69 3e 74 68 69 73 20 47 65 6f 54 61 62 .<li>this GeoTab
4ec0: 6c 65 20 63 6f 6e 74 61 69 6e 73 20 61 6c 6c 20 le contains all
4ed0: 54 6f 70 6f 46 65 61 74 75 72 65 73 20 64 65 66 TopoFeatures def
4ee0: 69 6e 65 64 20 69 6e 74 6f 20 74 68 65 20 54 6f ined into the To
4ef0: 70 6f 4c 61 79 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c poLayer.</li>..<
4f00: 6c 69 3e 65 61 63 68 20 54 6f 70 6f 46 65 61 74 li>each TopoFeat
4f10: 75 72 65 20 66 61 69 74 68 66 75 6c 6c 79 20 70 ure faithfully p
4f20: 72 65 73 65 72 76 65 73 20 69 74 73 20 69 6e 69 reserves its ini
4f30: 74 69 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e tial information
4f40: 20 61 74 74 72 69 62 75 74 65 73 2e 3c 2f 6c 69 attributes.</li
4f50: 3e 0d 0a 3c 6c 69 3e 61 6c 6c 20 47 65 6f 6d 65 >..<li>all Geome
4f60: 74 72 69 65 73 20 61 72 65 20 70 72 65 63 69 73 tries are precis
4f70: 65 6c 79 20 62 75 69 6c 74 20 62 79 20 61 67 67 ely built by agg
4f80: 72 65 67 61 74 69 6e 67 20 74 68 65 20 63 6f 72 regating the cor
4f90: 72 65 73 70 6f 6e 64 69 6e 67 20 54 6f 70 6f 6c responding Topol
4fa0: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 61 ogy primitives a
4fb0: 73 20 73 70 65 63 69 66 69 65 64 20 62 79 20 54 s specified by T
4fc0: 6f 70 6f 4c 61 79 65 72 20 2f 20 54 6f 70 6f 46 opoLayer / TopoF
4fd0: 65 61 74 75 72 65 73 20 72 65 6c 61 74 69 6f 6e eatures relation
4fe0: 73 68 69 70 73 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 ships.</li>..</u
4ff0: 6c 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 54 68 65 20 l><br><br>..The
5000: 69 6d 61 67 65 20 65 78 61 6d 70 6c 69 65 73 20 image examplies
5010: 61 20 63 68 6f 72 6f 70 6c 65 74 68 20 63 65 6e a choropleth cen
5020: 74 65 72 65 64 20 61 72 6f 75 6e 64 20 74 68 65 tered around the
5030: 20 49 73 6c 61 6e 64 20 6f 66 20 45 6c 62 61 20 Island of Elba
5040: 61 6e 64 20 62 61 73 65 64 20 6f 6e 20 74 68 65 and based on the
5050: 20 3c 62 3e 6f 75 74 5f 63 65 6e 73 75 73 5f 32 <b>out_census_2
5060: 30 31 31 3c 2f 62 3e 20 47 65 6f 54 61 62 6c 65 011</b> GeoTable
5070: 3a 20 61 6c 6c 20 43 65 6e 73 75 73 20 41 72 65 : all Census Are
5080: 61 73 20 61 72 65 20 64 69 73 70 6c 61 79 65 64 as are displayed
5090: 20 62 79 20 61 64 6f 70 74 69 6e 67 20 61 20 63 by adopting a c
50a0: 6f 6c 6f 75 72 20 64 69 72 65 63 74 6c 79 20 63 olour directly c
50b0: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 orresponding to
50c0: 74 68 65 69 72 20 70 6f 70 75 6c 61 74 69 6f 6e their population
50d0: 20 64 65 6e 73 69 74 79 2e 0d 0a 3c 2f 74 64 3e density...</td>
50e0: 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 <td>..<img src="
50f0: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 https://www.gaia
5100: 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e -gis.it/gaia-sin
5110: 73 2f 74 6f 70 6f 66 69 67 73 2f 65 6c 62 61 2d s/topofigs/elba-
5120: 63 68 6f 72 6f 70 6c 65 74 68 2e 70 6e 67 22 20 choropleth.png"
5130: 61 6c 74 3d 22 65 6c 62 61 2d 63 68 6c 6f 72 6f alt="elba-chloro
5140: 70 6c 65 74 68 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f pleth">..</td></
5150: 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 tr>..</table><br
5160: 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 3e 42 75 69 >..<hr>..<h3>Bui
5170: 6c 64 69 6e 67 20 61 20 66 75 6c 6c 20 68 69 65 lding a full hie
5180: 72 61 72 63 68 79 20 6f 66 20 41 64 6d 69 6e 69 rarchy of Admini
5190: 73 74 72 61 74 69 76 65 20 4c 65 76 65 6c 73 20 strative Levels
51a0: 62 79 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 by SQL statement
51b0: 73 3c 2f 68 33 3e 0d 0a 41 73 20 77 65 27 76 65 s</h3>..As we've
51c0: 20 61 6c 72 65 61 64 79 20 73 65 65 6e 20 62 65 already seen be
51d0: 66 6f 72 65 20 77 65 20 61 72 65 20 6e 6f 77 20 fore we are now
51e0: 65 78 70 65 63 74 65 64 20 74 6f 20 63 6f 6d 70 expected to comp
51f0: 6c 65 74 65 20 73 6f 6d 65 77 61 79 20 74 68 65 lete someway the
5200: 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 64 65 TopoFeatures de
5210: 66 69 6e 69 74 69 6f 6e 73 20 73 75 70 70 6f 72 finitions suppor
5220: 74 69 6e 67 20 74 68 65 20 3c 62 3e 50 6f 70 75 ting the <b>Popu
5230: 6c 61 74 65 64 20 50 6c 61 63 65 73 3c 2f 62 3e lated Places</b>
5240: 2c 20 3c 62 3e 4d 75 6e 69 63 69 70 61 6c 69 74 , <b>Municipalit
5250: 69 65 73 3c 2f 62 3e 2c 20 3c 62 3e 50 72 6f 76 ies</b>, <b>Prov
5260: 69 6e 63 65 73 3c 2f 62 3e 20 61 6e 64 20 3c 62 inces</b> and <b
5270: 3e 52 65 67 69 6f 6e 3c 2f 62 3e 20 54 6f 70 6f >Region</b> Topo
5280: 4c 61 79 65 72 73 20 77 65 27 76 65 20 70 72 65 Layers we've pre
5290: 76 69 6f 75 73 6c 79 20 63 72 65 61 74 65 64 20 viously created
52a0: 62 79 20 63 61 6c 6c 69 6e 67 20 3c 62 3e 54 6f by calling <b>To
52b0: 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 poGeo_InitTopoLa
52c0: 79 65 72 28 29 3c 2f 62 3e 2e 3c 62 72 3e 3c 62 yer()</b>.<br><b
52d0: 72 3e 0d 0a 48 61 70 70 69 6c 79 20 65 6e 6f 75 r>..Happily enou
52e0: 67 68 20 61 6c 6c 20 74 68 65 73 65 20 61 64 6d gh all these adm
52f0: 69 6e 69 73 74 72 61 74 69 76 65 20 6c 65 76 65 inistrative leve
5300: 6c 73 20 61 72 65 20 73 69 6d 70 6c 79 20 62 61 ls are simply ba
5310: 73 65 64 20 6f 6e 20 64 69 72 65 63 74 20 61 67 sed on direct ag
5320: 67 72 65 74 61 74 69 6f 6e 73 20 6f 66 20 3c 62 gretations of <b
5330: 3e 43 65 6e 73 75 73 20 41 72 65 61 73 3c 2f 62 >Census Areas</b
5340: 3e 2c 20 73 6f 20 77 65 20 6a 75 73 74 20 68 61 >, so we just ha
5350: 76 65 20 74 6f 20 65 78 65 63 75 74 65 20 66 65 ve to execute fe
5360: 77 20 61 70 70 72 6f 70 72 69 61 74 65 20 53 51 w appropriate SQ
5370: 4c 20 73 74 61 74 65 6d 65 6e 74 73 2e 0d 0a 3c L statements...<
5380: 76 65 72 62 61 74 69 6d 3e 0d 0a 49 4e 53 45 52 verbatim>..INSER
5390: 54 20 49 4e 54 4f 20 63 65 6e 73 75 73 32 30 31 T INTO census201
53a0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 1_topofeatures..
53b0: 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e SELECT NULL, c.n
53c0: 6f 64 65 5f 69 64 2c 20 63 2e 65 64 67 65 5f 69 ode_id, c.edge_i
53d0: 64 2c 20 63 2e 66 61 63 65 5f 69 64 2c 20 32 2c d, c.face_id, 2,
53e0: 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20 63 65 6e a.fid..FROM cen
53f0: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
5400: 75 72 65 73 5f 32 20 41 53 20 61 0d 0a 4a 4f 49 ures_2 AS a..JOI
5410: 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 N census2011_top
5420: 6f 66 65 61 74 75 72 65 73 5f 31 20 41 53 20 62 ofeatures_1 AS b
5430: 20 4f 4e 20 28 62 2e 63 6f 64 5f 70 70 6c 20 3d ON (b.cod_ppl =
5440: 20 61 2e 63 6f 64 5f 70 70 6c 29 0d 0a 4a 4f 49 a.cod_ppl)..JOI
5450: 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 N census2011_top
5460: 6f 66 65 61 74 75 72 65 73 20 41 53 20 63 20 4f ofeatures AS c O
5470: 4e 20 28 63 2e 74 6f 70 6f 6c 6f 67 79 5f 69 64 N (c.topology_id
5480: 20 3d 20 31 20 41 4e 44 20 63 2e 66 69 64 20 3d = 1 AND c.fid =
5490: 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 b.fid);..</verb
54a0: 61 74 69 6d 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 atim>..<ul>..<li
54b0: 3e 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 ><b>census2011_t
54c0: 6f 70 6f 66 65 61 74 75 72 65 73 5f 31 3c 2f 62 opofeatures_1</b
54d0: 3e 20 69 73 20 74 68 65 20 54 6f 70 6f 46 65 61 > is the TopoFea
54e0: 74 75 72 65 73 20 74 61 62 6c 65 20 63 6f 72 72 tures table corr
54f0: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e esponding to <b>
5500: 43 65 6e 73 75 73 20 41 72 65 61 73 3c 2f 62 3e Census Areas</b>
5510: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 .</li>..<li><b>c
5520: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 ensus2011_topofe
5530: 61 74 75 72 65 73 5f 32 3c 2f 62 3e 20 69 73 20 atures_2</b> is
5540: 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 the corresponds
5550: 74 6f 20 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20 to <b>Populated
5560: 50 6c 61 63 65 73 3c 2f 62 3e 3b 20 74 68 65 20 Places</b>; the
5570: 63 6c 61 75 73 65 20 3c 62 3e 62 2e 63 6f 64 5f clause <b>b.cod_
5580: 70 70 6c 20 3d 20 61 2e 63 6f 64 5f 70 70 6c 3c ppl = a.cod_ppl<
5590: 2f 62 3e 20 77 69 6c 6c 20 72 65 6c 61 74 69 6f /b> will relatio
55a0: 6e 61 6c 6c 79 20 6a 6f 69 6e 20 65 61 63 68 20 nally join each
55b0: 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 20 Populated Place
55c0: 74 6f 20 69 74 73 20 75 6e 64 65 72 6c 61 79 69 to its underlayi
55d0: 6e 67 20 43 65 6e 73 75 73 20 41 72 65 61 73 2e ng Census Areas.
55e0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 73 6f 20 77 65 </li>..<li>so we
55f0: 20 63 61 6e 20 64 75 6c 79 20 69 6e 73 65 72 74 can duly insert
5600: 20 69 6e 74 6f 20 74 68 65 20 3c 62 3e 54 6f 70 into the <b>Top
5610: 6f 46 65 61 74 75 72 65 73 2d 67 65 6f 6d 65 74 oFeatures-geomet
5620: 72 79 3c 2f 62 3e 20 74 61 62 6c 65 20 28 69 2e ry</b> table (i.
5630: 65 2e 20 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 e. <i>census2011
5640: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 3c 2f 69 _topofeatures</i
5650: 3e 29 20 61 20 6e 65 77 20 6c 65 76 65 6c 20 6f >) a new level o
5660: 66 20 72 65 66 65 72 65 6e 63 65 73 20 74 6f 20 f references to
5670: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 74 69 76 Topology primtiv
5680: 65 73 20 62 79 20 73 69 6d 70 6c 79 20 63 6f 70 es by simply cop
5690: 79 69 6e 67 20 61 6c 6c 20 64 65 66 69 6e 69 74 ying all definit
56a0: 69 6f 6e 73 20 61 6c 72 65 61 64 79 20 73 74 6f ions already sto
56b0: 72 65 64 20 69 6e 74 6f 20 74 68 65 20 70 72 65 red into the pre
56c0: 76 69 6f 75 73 20 68 69 65 72 61 72 63 68 69 63 vious hierarchic
56d0: 61 6c 20 6c 65 76 65 6c 2e 3c 62 72 3e 0d 0a 41 al level.<br>..A
56e0: 6e 64 20 74 6f 20 64 6f 20 73 75 63 68 20 61 20 nd to do such a
56f0: 74 68 69 6e 67 20 77 65 20 73 69 6d 70 6c 79 20 thing we simply
5700: 68 61 76 65 20 74 6f 20 72 65 61 64 20 66 72 6f have to read fro
5710: 6d 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 31 m <b>topolayer=1
5720: 3c 2f 62 3e 20 74 68 65 6e 20 69 6e 73 65 72 74 </b> then insert
5730: 69 6e 67 20 69 6e 74 6f 20 3c 62 3e 74 6f 70 6f ing into <b>topo
5740: 6c 61 79 65 72 3d 32 3c 2f 62 3e 20 61 66 74 65 layer=2</b> afte
5750: 72 20 73 65 74 74 69 6e 67 20 74 68 65 20 61 70 r setting the ap
5760: 70 72 6f 70 72 69 61 74 65 20 3c 62 3e 66 69 64 propriate <b>fid
5770: 3c 2f 62 3e 20 76 61 6c 75 65 73 2e 3c 62 72 3e </b> values.<br>
5780: 0d 0a 52 65 61 6c 6c 79 20 6e 6f 74 20 61 20 64 ..Really not a d
5790: 69 66 66 69 63 75 6c 74 20 74 61 73 6b 2e 3c 2f ifficult task.</
57a0: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 76 65 72 li>..</ul>..<ver
57b0: 62 61 74 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 batim>..INSERT I
57c0: 4e 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74 NTO census2011_t
57d0: 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c opofeatures..SEL
57e0: 45 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 ECT NULL, c.node
57f0: 5f 69 64 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20 _id, c.edge_id,
5800: 63 2e 66 61 63 65 5f 69 64 2c 20 33 2c 20 61 2e c.face_id, 3, a.
5810: 66 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 fid..FROM census
5820: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 2011_topofeature
5830: 73 5f 33 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 s_3 AS a..JOIN c
5840: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 ensus2011_topofe
5850: 61 74 75 72 65 73 5f 31 20 41 53 20 62 20 4f 4e atures_1 AS b ON
5860: 20 28 62 2e 63 6f 64 5f 63 6f 6d 20 3d 20 61 2e (b.cod_com = a.
5870: 63 6f 64 5f 63 6f 6d 29 0d 0a 4a 4f 49 4e 20 63 cod_com)..JOIN c
5880: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 ensus2011_topofe
5890: 61 74 75 72 65 73 20 41 53 20 63 20 4f 4e 20 28 atures AS c ON (
58a0: 63 2e 74 6f 70 6f 6c 6f 67 79 5f 69 64 20 3d 20 c.topology_id =
58b0: 31 20 41 4e 44 20 63 2e 66 69 64 20 3d 20 62 2e 1 AND c.fid = b.
58c0: 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 fid);..</verbati
58d0: 6d 3e 0d 0a 57 65 20 63 61 6e 20 61 64 6f 70 74 m>..We can adopt
58e0: 20 65 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d exactly the sam
58f0: 65 20 69 64 65 6e 74 69 63 61 6c 20 61 70 70 72 e identical appr
5900: 6f 61 63 68 20 69 6e 20 6f 72 64 65 72 20 74 6f oach in order to
5910: 20 63 6f 6d 70 6c 65 74 65 20 3c 62 3e 74 6f 70 complete <b>top
5920: 6f 6c 61 79 65 72 3d 33 3c 2f 62 3e 20 63 6f 72 olayer=3</b> cor
5930: 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 responding to <b
5940: 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c >Municipalities<
5950: 2f 62 3e 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e /b>...<verbatim>
5960: 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 ..INSERT INTO ce
5970: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
5980: 74 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 tures..SELECT NU
5990: 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 LL, c.node_id, c
59a0: 2e 65 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 .edge_id, c.face
59b0: 5f 69 64 2c 20 34 2c 20 61 2e 66 69 64 0d 0a 46 _id, 4, a.fid..F
59c0: 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 ROM census2011_t
59d0: 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 20 41 53 opofeatures_4 AS
59e0: 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 a..JOIN census2
59f0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 011_topofeatures
5a00: 5f 33 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f _3 AS b ON (b.co
5a10: 64 5f 70 72 6f 76 20 3d 20 61 2e 63 6f 64 5f 70 d_prov = a.cod_p
5a20: 72 6f 76 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 rov)..JOIN censu
5a30: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 s2011_topofeatur
5a40: 65 73 20 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f es AS c ON (c.to
5a50: 70 6f 6c 6f 67 79 5f 69 64 20 3d 20 33 20 41 4e pology_id = 3 AN
5a60: 44 20 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 D c.fid = b.fid)
5a70: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a ;..</verbatim>..
5a80: 4d 6f 72 65 20 6f 72 20 6c 65 73 73 20 74 68 65 More or less the
5a90: 20 73 61 6d 65 20 69 73 20 66 6f 72 20 64 65 72 same is for der
5aa0: 69 76 69 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 79 iving <b>topolay
5ab0: 65 72 3d 34 3c 2f 62 3e 20 63 6f 72 72 65 73 70 er=4</b> corresp
5ac0: 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 50 72 6f onding to <b>Pro
5ad0: 76 69 6e 63 65 73 3c 2f 62 3e 3b 20 74 68 69 73 vinces</b>; this
5ae0: 20 74 69 6d 65 20 77 65 27 6c 6c 20 73 69 6d 70 time we'll simp
5af0: 6c 79 20 61 67 67 72 65 74 61 74 65 20 74 68 65 ly aggretate the
5b00: 20 75 6e 64 65 72 6c 79 69 6e 67 20 4d 75 6e 69 underlying Muni
5b10: 63 69 70 61 6c 69 74 69 65 73 20 66 72 6f 6d 20 cipalities from
5b20: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 33 3c 2f <b>topolayer=3</
5b30: 62 3e 2e 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e b>...</verbatim>
5b40: 0d 0a 57 65 20 63 61 6e 20 61 64 6f 70 74 20 65 ..We can adopt e
5b50: 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 20 xactly the same
5b60: 69 64 65 6e 74 69 63 61 6c 20 61 70 70 72 6f 61 identical approa
5b70: 63 68 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 ch in order to c
5b80: 6f 6d 70 6c 65 74 65 20 3c 62 3e 74 6f 70 6f 6c omplete <b>topol
5b90: 61 79 65 72 3d 33 3c 2f 62 3e 20 63 6f 72 72 65 ayer=3</b> corre
5ba0: 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 4d sponding to <b>M
5bb0: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f 62 unicipalities</b
5bc0: 3e 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a >...<verbatim>..
5bd0: 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 INSERT INTO cens
5be0: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 us2011_topofeatu
5bf0: 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c res..SELECT NULL
5c00: 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 , c.node_id, c.e
5c10: 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 dge_id, c.face_i
5c20: 64 2c 20 35 2c 20 61 2e 66 69 64 0d 0a 46 52 4f d, 5, a.fid..FRO
5c30: 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 M census2011_top
5c40: 6f 66 65 61 74 75 72 65 73 5f 35 20 41 53 20 61 ofeatures_5 AS a
5c50: 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 ..JOIN census201
5c60: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 1_topofeatures_4
5c70: 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f AS b ON (b.cod_
5c80: 72 65 67 20 3d 20 61 2e 63 6f 64 5f 72 65 67 29 reg = a.cod_reg)
5c90: 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 ..JOIN census201
5ca0: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 1_topofeatures A
5cb0: 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 6f S c ON (c.topolo
5cc0: 67 79 5f 69 64 20 3d 20 34 20 41 4e 44 20 63 2e gy_id = 4 AND c.
5cd0: 66 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c fid = b.fid);..<
5ce0: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41 6e 64 20 /verbatim>..And
5cf0: 66 69 6e 61 6c 6c 79 20 77 65 20 63 61 6e 20 64 finally we can d
5d00: 65 72 69 76 65 20 3c 62 3e 74 6f 70 6f 6c 61 79 erive <b>topolay
5d10: 65 72 3d 35 3c 2f 62 3e 20 63 6f 72 72 65 73 70 er=5</b> corresp
5d20: 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 52 65 67 onding to <b>Reg
5d30: 69 6f 6e 73 3c 2f 62 3e 20 62 79 20 64 69 72 65 ions</b> by dire
5d40: 63 74 6c 79 20 61 67 67 72 65 67 61 74 69 6e 67 ctly aggregating
5d50: 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 the underlying
5d60: 50 72 6f 76 69 6e 63 65 73 20 66 72 6f 6d 20 3c Provinces from <
5d70: 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 34 3c 2f 62 b>topolayer=4</b
5d80: 3e 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 >...<br><br>..<t
5d90: 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 able width="100%
5da0: 22 20 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 " cellspan="4"
5db0: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 cellpadding="6"
5dc0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 bgcolor="#f8f8f0
5dd0: 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c " border="1">..<
5de0: 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 tr><td>..<b>step
5df0: 20 23 31 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 #1: exporting t
5e00: 68 65 20 52 65 67 69 6f 6e 20 54 6f 70 6f 4c 61 he Region TopoLa
5e10: 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 yer</b>..<verbat
5e20: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f im>..SELECT Topo
5e30: 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 Geo_ExportTopoLa
5e40: 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27 yer('census2011'
5e50: 2c 20 27 72 65 67 27 2c 20 27 6f 75 74 5f 72 65 , 'reg', 'out_re
5e60: 67 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f g_2011', 1);..</
5e70: 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65 20 61 72 verbatim>..We ar
5e80: 65 20 6e 6f 77 20 64 65 66 69 6e 69 74 65 6c 79 e now definitely
5e90: 20 72 65 61 64 79 20 74 6f 20 65 78 70 6f 72 74 ready to export
5ea0: 20 61 6e 79 20 6f 74 68 65 72 20 41 64 6d 69 6e any other Admin
5eb0: 69 73 74 72 61 74 69 76 65 20 4c 65 76 65 6c 2e istrative Level.
5ec0: 3c 62 72 3e 0d 0a 46 6f 72 20 74 68 65 20 73 61 <br>..For the sa
5ed0: 6b 65 20 6f 66 20 63 6c 65 61 72 69 74 79 20 77 ke of clearity w
5ee0: 65 27 6c 6c 20 66 6f 6c 6c 6f 77 20 61 20 74 6f e'll follow a to
5ef0: 70 2d 62 6f 74 74 6f 6d 20 6f 72 64 65 72 2c 20 p-bottom order,
5f00: 73 6f 20 77 65 27 6c 6c 20 73 74 61 72 74 20 62 so we'll start b
5f10: 79 20 65 78 70 6f 72 74 69 6e 67 20 66 69 72 73 y exporting firs
5f20: 74 20 74 68 65 20 77 68 6f 6c 65 20 54 75 73 63 t the whole Tusc
5f30: 61 6e 79 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d any...</td><td>.
5f40: 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 .<img src="https
5f50: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e ://www.gaia-gis.
5f60: 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 it/gaia-sins/top
5f70: 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d ofigs/topolayer-
5f80: 72 65 67 69 6f 6e 2e 70 6e 67 22 20 61 6c 74 3d region.png" alt=
5f90: 22 74 6f 70 6f 6c 61 79 65 72 2d 72 65 67 69 6f "topolayer-regio
5fa0: 6e 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d n">..</td></tr>.
5fb0: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 .<tr><td>..<b>st
5fc0: 65 70 20 23 32 3a 20 65 78 70 6f 72 74 69 6e 67 ep #2: exporting
5fd0: 20 74 68 65 20 50 72 6f 76 69 6e 63 65 73 20 54 the Provinces T
5fe0: 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 opoLayer</b>..<v
5ff0: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 erbatim>..SELECT
6000: 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 TopoGeo_ExportT
6010: 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 opoLayer('census
6020: 32 30 31 31 27 2c 20 27 70 72 6f 76 27 2c 20 27 2011', 'prov', '
6030: 6f 75 74 5f 70 72 6f 76 5f 32 30 31 31 27 2c 20 out_prov_2011',
6040: 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 1);..</verbatim>
6050: 0d 0a 57 65 27 6c 6c 20 63 6f 6e 74 69 6e 75 65 ..We'll continue
6060: 20 62 79 20 65 78 70 6f 72 74 69 6e 67 20 61 6c by exporting al
6070: 6c 20 74 68 65 20 54 75 73 63 61 6e 79 20 50 72 l the Tuscany Pr
6080: 6f 76 69 6e 63 65 73 2e 0d 0a 3c 2f 74 64 3e 3c ovinces...</td><
6090: 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 td>..<img src="h
60a0: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
60b0: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 gis.it/gaia-sins
60c0: 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 /topofigs/topola
60d0: 79 65 72 2d 70 72 6f 76 69 6e 63 65 73 2e 70 6e yer-provinces.pn
60e0: 67 22 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 g" alt="topolaye
60f0: 72 2d 70 72 6f 76 69 6e 63 65 73 22 3e 0d 0a 3c r-provinces">..<
6100: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
6110: 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 33 3a td>..<b>step #3:
6120: 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20 4d exporting the M
6130: 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20 54 6f unicipalities To
6140: 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 poLayer</b>..<ve
6150: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 rbatim>..SELECT
6160: 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f TopoGeo_ExportTo
6170: 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 poLayer('census2
6180: 30 31 31 27 2c 20 27 63 6f 6d 27 2c 20 27 6f 75 011', 'com', 'ou
6190: 74 5f 63 6f 6d 5f 32 30 31 31 27 2c 20 31 29 3b t_com_2011', 1);
61a0: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 ..</verbatim>..T
61b0: 68 65 6e 20 77 65 27 6c 6c 20 65 78 70 6f 72 74 hen we'll export
61c0: 20 61 6c 6c 20 74 68 65 20 54 75 73 63 61 6e 79 all the Tuscany
61d0: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2e Municipalities.
61e0: 3c 62 72 3e 0d 0a 46 6f 72 20 62 65 74 74 65 72 <br>..For better
61f0: 6c 20 63 6c 65 61 72 69 74 79 20 74 68 65 20 66 l clearity the f
6200: 69 67 75 72 65 20 73 68 6f 77 73 20 61 20 6d 61 igure shows a ma
6210: 67 6e 69 66 69 65 64 20 64 65 74 61 69 6c 20 63 gnified detail c
6220: 65 6e 74 65 72 65 64 20 61 72 6f 75 6e 64 20 74 entered around t
6230: 68 65 20 49 73 6c 61 6e 64 20 6f 66 20 45 6c 62 he Island of Elb
6240: 61 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c a...</td><td>..<
6250: 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f img src="https:/
6260: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 /www.gaia-gis.it
6270: 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 /gaia-sins/topof
6280: 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 6d 75 igs/topolayer-mu
6290: 6e 69 63 69 70 61 6c 69 74 69 65 73 2e 70 6e 67 nicipalities.png
62a0: 22 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 " alt="topolayer
62b0: 2d 6d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 22 -municipalities"
62c0: 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c >..</td></tr>..<
62d0: 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 tr><td>..<b>step
62e0: 20 23 34 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 #4: exporting t
62f0: 68 65 20 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 he Populated Pla
6300: 63 65 73 20 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 ces TopoLayer</b
6310: 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 >..<verbatim>..S
6320: 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 ELECT TopoGeo_Ex
6330: 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 portTopoLayer('c
6340: 65 6e 73 75 73 32 30 31 31 27 2c 20 27 70 70 6c ensus2011', 'ppl
6350: 27 2c 20 27 6f 75 74 5f 70 70 6c 5f 32 30 31 31 ', 'out_ppl_2011
6360: 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 ', 1);..</verbat
6370: 69 6d 3e 0d 0a 41 6e 64 20 77 65 27 6c 6c 20 66 im>..And we'll f
6380: 69 6e 61 6c 6c 79 20 65 78 70 6f 72 74 20 61 6c inally export al
6390: 6c 20 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 l Populated Plac
63a0: 65 73 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 75 3e es.<br><br>..<u>
63b0: 43 6f 6e 63 6c 75 73 69 6f 6e 3c 2f 75 3e 3a 20 Conclusion</u>:
63c0: 77 65 20 73 74 61 72 74 65 64 20 62 79 20 69 6d we started by im
63d0: 70 6f 72 74 69 6e 67 20 69 6e 74 6f 20 61 20 54 porting into a T
63e0: 6f 70 6f 6c 6f 67 79 20 6a 75 73 74 20 61 20 73 opology just a s
63f0: 69 6e 67 6c 65 20 6c 61 79 65 72 20 28 43 65 6e ingle layer (Cen
6400: 73 75 73 20 41 72 65 61 73 29 20 61 6e 64 20 6e sus Areas) and n
6410: 6f 77 20 77 65 20 68 61 76 65 20 61 20 63 6f 6d ow we have a com
6420: 70 6c 65 74 65 20 73 65 74 20 6f 66 20 41 64 6d plete set of Adm
6430: 69 6e 69 73 74 72 61 74 69 76 65 20 42 6f 75 6e inistrative Boun
6440: 64 61 72 69 65 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c daries:..<ul>..<
6450: 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d /ul>..</td><td>.
6460: 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 .<img src="https
6470: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e ://www.gaia-gis.
6480: 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 it/gaia-sins/top
6490: 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d ofigs/topolayer-
64a0: 70 6f 70 75 6c 61 74 65 64 2d 70 6c 61 63 65 73 populated-places
64b0: 2e 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f 6c .png" alt="topol
64c0: 61 79 65 72 2d 70 6f 70 75 6c 61 74 65 64 2d 70 ayer-populated-p
64d0: 6c 61 63 65 73 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f laces">..</td></
64e0: 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 tr>..</table><br
64f0: 3e 0d 0a 0d 0a 0d 0a 0d 0a 3c 74 61 62 6c 65 20 >........<table
6500: 77 69 64 74 68 3d 22 31 30 30 25 22 3e 3c 74 72 width="100%"><tr
6510: 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 >..<td width="33
6520: 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e %" align="left">
6530: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f <a href="https:/
6540: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 /www.gaia-gis.it
6550: 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 /fossil/libspati
6560: 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d alite/wiki?name=
6570: 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 69 61 74 topo-intermediat
6580: 65 22 3e 70 72 65 76 69 6f 75 73 20 70 61 67 65 e">previous page
6590: 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 61 </a></td>..<td a
65a0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 61 lign="center"><a
65b0: 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 href="https://w
65c0: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 ww.gaia-gis.it/f
65d0: 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c ossil/libspatial
65e0: 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 6d 69 ite/wiki?name=mi
65f0: 73 63 2d 64 6f 63 73 22 3e 62 61 63 6b 20 74 6f sc-docs">back to
6600: 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f 74 64 3e 0d index</a></td>.
6610: 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 25 22 .<td width="33%"
6620: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 3c align="right"><
6630: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f a href="https://
6640: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f www.gaia-gis.it/
6650: 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 fossil/libspatia
6660: 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 74 lite/wiki?name=t
6670: 6f 70 6f 2d 61 64 76 61 6e 63 65 64 22 3e 6e 65 opo-advanced">ne
6680: 78 74 20 70 61 67 65 3c 2f 61 3e 3c 2f 74 64 3e xt page</a></td>
6690: 0d 0a 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 0a ..</tr></table>.
66a0: 5a 20 30 66 30 65 38 34 33 63 36 31 61 30 38 36 Z 0f0e843c61a086
66b0: 37 33 37 61 63 30 64 31 36 33 35 35 39 33 39 37 737ac0d163559397
66c0: 37 63 0a 7c.