Wiki page
[topo-advanced] by
sandro
2015-11-16 13:27:56.
0000: 44 20 32 30 31 35 2d 31 31 2d 31 36 54 31 33 3a D 2015-11-16T13:
0010: 32 37 3a 35 36 2e 38 37 37 0a 4c 20 74 6f 70 6f 27:56.877.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 37 31 30 38 -advanced.P 7108
0030: 34 30 35 62 30 30 61 32 63 38 32 38 31 36 36 36 405b00a2c8281666
0040: 30 33 63 32 36 35 65 30 64 65 39 65 36 34 38 36 03c265e0de9e6486
0050: 30 37 36 63 0a 55 20 73 61 6e 64 72 6f 0a 57 20 076c.U sandro.W
0060: 31 35 34 38 34 0a 3c 74 61 62 6c 65 20 63 65 6c 15484.<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 74 61 62 6c 65 20 77 69 64 74 68 l>..<table width
29b0: 3d 22 31 30 30 25 22 20 20 63 65 6c 6c 73 70 61 ="100%" cellspa
29c0: 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e n="4" cellpaddin
29d0: 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 g="6" bgcolor="#
29e0: 66 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 f8f8f0" border="
29f0: 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 1">..<tr><td col
2a00: 73 70 61 6e 3d 22 32 22 20 61 6c 69 67 6e 3d 22 span="2" align="
2a10: 63 65 6e 74 65 72 22 3e 3c 62 3e 54 6f 70 6f 47 center"><b>TopoG
2a20: 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 eo_ExportTopoLay
2a30: 65 72 3a 20 65 78 70 6f 72 74 69 6e 67 20 61 20 er: exporting a
2a40: 66 75 6c 6c 20 54 6f 70 6f 4c 61 79 65 72 20 69 full TopoLayer i
2a50: 6e 74 6f 20 61 20 47 65 6f 54 61 62 6c 65 3c 2f nto a GeoTable</
2a60: 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 b></td></tr>..<t
2a70: 72 3e 3c 74 64 3e 0d 0a 3c 76 65 72 62 61 74 69 r><td>..<verbati
2a80: 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 m>..SELECT TopoG
2a90: 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 eo_ExportTopoLay
2aa0: 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c er('census2011',
2ab0: 20 27 63 65 6e 73 75 73 5f 61 72 65 61 73 27 2c 'census_areas',
2ac0: 20 27 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30 31 'out_census_201
2ad0: 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 1', 1);..</verba
2ae0: 74 69 6d 3e 0d 0a 41 73 20 79 6f 75 20 63 61 6e tim>..As you can
2af0: 20 65 61 73 69 6c 79 20 63 68 65 63 6b 20 62 79 easily check by
2b00: 20 79 6f 75 72 73 65 6c 66 20 61 20 6e 65 77 20 yourself a new
2b10: 47 65 6f 54 61 62 6c 65 20 6e 61 6d 65 64 20 3c GeoTable named <
2b20: 62 3e 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30 31 b>out_census_201
2b30: 31 3c 2f 62 3e 20 68 61 73 20 62 65 65 6e 20 63 1</b> has been c
2b40: 72 65 61 74 65 64 20 62 79 20 3c 62 3e 54 6f 70 reated by <b>Top
2b50: 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c oGeo_ExportTopoL
2b60: 61 79 65 72 28 29 3c 2f 62 3e 3a 0d 0a 3c 75 6c ayer()</b>:..<ul
2b70: 3e 0d 0a 3c 6c 69 3e 74 68 69 73 20 47 65 6f 54 >..<li>this GeoT
2b80: 61 62 6c 65 20 63 6f 6e 74 61 69 6e 73 20 61 6c able contains al
2b90: 6c 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 64 l TopoFeatures d
2ba0: 65 66 69 6e 65 64 20 69 6e 74 6f 20 74 68 65 20 efined into the
2bb0: 54 6f 70 6f 4c 61 79 65 72 2e 3c 2f 6c 69 3e 0d TopoLayer.</li>.
2bc0: 0a 3c 6c 69 3e 65 61 63 68 20 54 6f 70 6f 46 65 .<li>each TopoFe
2bd0: 61 74 75 72 65 20 66 61 69 74 68 66 75 6c 6c 79 ature faithfully
2be0: 20 70 72 65 73 65 72 76 65 73 20 69 74 73 20 69 preserves its i
2bf0: 6e 69 74 69 61 6c 20 69 6e 66 6f 72 6d 61 74 69 nitial informati
2c00: 6f 6e 20 61 74 74 72 69 62 75 74 65 73 2e 3c 2f on attributes.</
2c10: 6c 69 3e 0d 0a 3c 6c 69 3e 61 6c 6c 20 47 65 6f li>..<li>all Geo
2c20: 6d 65 74 72 69 65 73 20 61 72 65 20 70 72 65 63 metries are prec
2c30: 69 73 65 6c 79 20 62 75 69 6c 74 20 62 79 20 61 isely built by a
2c40: 67 67 72 65 67 61 74 69 6e 67 20 74 68 65 20 63 ggregating the c
2c50: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 54 6f 70 orresponding Top
2c60: 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 ology primitives
2c70: 20 61 73 20 73 70 65 63 69 66 69 65 64 20 62 79 as specified by
2c80: 20 54 6f 70 6f 4c 61 79 65 72 20 2f 20 54 6f 70 TopoLayer / Top
2c90: 6f 46 65 61 74 75 72 65 73 20 72 65 6c 61 74 69 oFeatures relati
2ca0: 6f 6e 73 68 69 70 73 2e 3c 2f 6c 69 3e 0d 0a 3c onships.</li>..<
2cb0: 2f 75 6c 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 54 68 /ul><br><br>..Th
2cc0: 65 20 69 6d 61 67 65 20 65 78 61 6d 70 6c 69 65 e image examplie
2cd0: 73 20 61 20 63 68 6f 72 6f 70 6c 65 74 68 20 63 s a choropleth c
2ce0: 65 6e 74 65 72 65 64 20 61 72 6f 75 6e 64 20 74 entered around t
2cf0: 68 65 20 49 73 6c 61 6e 64 20 6f 66 20 45 6c 62 he Island of Elb
2d00: 61 20 61 6e 64 20 62 61 73 65 64 20 6f 6e 20 74 a and based on t
2d10: 68 65 20 3c 62 3e 6f 75 74 5f 63 65 6e 73 75 73 he <b>out_census
2d20: 5f 32 30 31 31 3c 2f 62 3e 20 47 65 6f 54 61 62 _2011</b> GeoTab
2d30: 6c 65 3a 20 61 6c 6c 20 43 65 6e 73 75 73 20 41 le: all Census A
2d40: 72 65 61 73 20 61 72 65 20 64 69 73 70 6c 61 79 reas are display
2d50: 65 64 20 62 79 20 61 64 6f 70 74 69 6e 67 20 61 ed by adopting a
2d60: 20 63 6f 6c 6f 75 72 20 64 69 72 65 63 74 6c 79 colour directly
2d70: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 corresponding t
2d80: 6f 20 74 68 65 69 72 20 70 6f 70 75 6c 61 74 69 o their populati
2d90: 6f 6e 20 64 65 6e 73 69 74 79 2e 0d 0a 3c 2f 74 on density...</t
2da0: 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 d><td>..<img src
2db0: 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 ="https://www.ga
2dc0: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 ia-gis.it/gaia-s
2dd0: 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 65 6c 62 ins/topofigs/elb
2de0: 61 2d 63 68 6f 72 6f 70 6c 65 74 68 2e 70 6e 67 a-choropleth.png
2df0: 22 20 61 6c 74 3d 22 65 6c 62 61 2d 63 68 6c 6f " alt="elba-chlo
2e00: 72 6f 70 6c 65 74 68 22 3e 0d 0a 3c 2f 74 64 3e ropleth">..</td>
2e10: 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c </tr>..</table><
2e20: 68 72 3e 0d 0a 3c 68 33 3e 54 6f 70 6f 4c 61 79 hr>..<h3>TopoLay
2e30: 65 72 73 20 2f 20 54 6f 70 6f 46 65 61 74 75 72 ers / TopoFeatur
2e40: 65 73 3a 20 6c 61 79 6f 75 74 20 6f 66 20 44 42 es: layout of DB
2e50: 20 54 61 62 6c 65 73 20 61 6e 64 20 63 6f 72 72 Tables and corr
2e60: 65 73 70 6f 6e 64 69 6e 67 20 72 65 6c 61 74 69 esponding relati
2e70: 6f 6e 73 68 69 70 73 3c 2f 68 33 3e 0d 0a 3c 62 onships</h3>..<b
2e80: 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 ><<i>topo-prefix
2e90: 3c 2f 69 3e 3e 5f 74 6f 70 6f 6c 61 79 65 72 73 </i>>_topolayers
2ea0: 3c 2f 62 3e 20 65 2e 67 2e 20 22 3c 69 3e 63 65 </b> e.g. "<i>ce
2eb0: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 6c 61 79 nsus2011_topolay
2ec0: 65 72 73 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 ers</i>"..<table
2ed0: 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 cellspan="4" ce
2ee0: 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 llpadding="6" bg
2ef0: 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 color="#f8f8f0"
2f00: 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 border="1">..<tr
2f10: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 ><td bgcolor="#f
2f20: 30 66 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c 61 0f0f8"><b>topola
2f30: 79 65 72 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d yer_id</b></td>.
2f40: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 .<td bgcolor="#f
2f50: 30 66 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c 61 0f0f8"><b>topola
2f60: 79 65 72 5f 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 yer_name</b></td
2f70: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 ></tr>..<tr><td
2f80: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c align="right">1<
2f90: 2f 74 64 3e 3c 74 64 3e 63 65 6e 73 75 73 5f 61 /td><td>census_a
2fa0: 72 65 61 73 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a reas</td></tr>..
2fb0: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
2fc0: 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 3e ight">2</td><td>
2fd0: 70 70 6c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c ppl</td></tr>..<
2fe0: 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 tr><td align="ri
2ff0: 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 3e 63 ght">3</td><td>c
3000: 6f 6d 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 om</td></tr>..<t
3010: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
3020: 68 74 22 3e 34 3c 2f 74 64 3e 3c 74 64 3e 70 72 ht">4</td><td>pr
3030: 6f 76 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 ov</td></tr>..<t
3040: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
3050: 68 74 22 3e 35 3c 2f 74 64 3e 3c 74 64 3e 72 65 ht">5</td><td>re
3060: 67 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 g</td></tr>..</t
3070: 61 62 6c 65 3e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d able>..<br><br>.
3080: 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 .<b><<i>topo-pre
3090: 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 66 65 61 fix</i>>_topofea
30a0: 74 75 72 65 73 3c 2f 62 3e 20 65 2e 67 2e 20 22 tures</b> e.g. "
30b0: 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f <i>census2011_to
30c0: 70 6f 66 65 61 74 75 72 65 73 3c 2f 69 3e 22 0d pofeatures</i>".
30d0: 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e .<table cellspan
30e0: 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 ="4" cellpadding
30f0: 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 ="6" bgcolor="#f
3100: 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 8f8f0" border="1
3110: 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f ">..<tr><td bgco
3120: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
3130: 3e 75 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c >uid</b></td>..<
3140: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 td bgcolor="#f0f
3150: 30 66 38 22 3e 3c 62 3e 6e 6f 64 65 5f 69 64 3c 0f8"><b>node_id<
3160: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 /b></td>..<td bg
3170: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e color="#f0f0f8">
3180: 3c 62 3e 65 64 67 65 5f 69 64 3c 2f 62 3e 3c 2f <b>edge_id</b></
3190: 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 td>..<td bgcolor
31a0: 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 61 ="#f0f0f8"><b>fa
31b0: 63 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a ce_id</b></td>..
31c0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 <td bgcolor="#f0
31d0: 66 30 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c 61 79 f0f8"><b>topolay
31e0: 65 72 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a er_id</b></td>..
31f0: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 <td bgcolor="#f0
3200: 66 30 66 38 22 3e 3c 62 3e 66 69 64 3c 2f 62 3e f0f8"><b>fid</b>
3210: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
3220: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3230: 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c ">1</td><td>NULL
3240: 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 </td><td>NULL</t
3250: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3260: 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c ht">1</td><td al
3270: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 ign="right">1</t
3280: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3290: 68 74 22 3e 31 3c 2f 74 64 3e 3c 2f 74 72 3e 0d ht">1</td></tr>.
32a0: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 .<tr><td align="
32b0: 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 right">2</td><td
32c0: 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 >NULL</td><td>NU
32d0: 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e LL</td><td align
32e0: 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c ="right">2</td><
32f0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3300: 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >1</td><td align
3310: 3d 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c ="right">2</td><
3320: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c /tr>..<tr><td al
3330: 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 ign="right">3</t
3340: 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c d><td>NULL</td><
3350: 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 td>NULL</td><td
3360: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c align="right">3<
3370: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3380: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 ight">1</td><td
3390: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c align="right">3<
33a0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
33b0: 74 64 20 63 6f 6c 73 70 61 6e 3d 22 36 22 20 61 td colspan="6" a
33c0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 68 lign="center"><h
33d0: 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 r></td></tr>..<t
33e0: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
33f0: 68 74 22 3e 32 38 38 37 30 3c 2f 74 64 3e 3c 74 ht">28870</td><t
3400: 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e d>NULL</td><td>N
3410: 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ULL</td><td alig
3420: 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 36 34 3c n="right">28864<
3430: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3440: 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 ight">1</td><td
3450: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 align="right">28
3460: 38 36 37 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 867</td></tr>..<
3470: 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 tr><td align="ri
3480: 67 68 74 22 3e 32 38 38 37 31 3c 2f 74 64 3e 3c ght">28871</td><
3490: 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e td>NULL</td><td>
34a0: 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 NULL</td><td ali
34b0: 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 36 38 gn="right">28868
34c0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
34d0: 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 right">1</td><td
34e0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
34f0: 38 38 36 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 8868</td></tr>..
3500: 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 62 72 3e 3c 62 </table>..<br><b
3510: 72 3e 0d 0a 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d r>..<b><<i>topo-
3520: 70 72 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f prefix</i>>_topo
3530: 66 65 61 74 75 72 65 73 5f 3c 3c 69 3e 74 6f 70 features_<<i>top
3540: 6f 6c 61 79 65 72 2d 69 64 3c 2f 69 3e 3e 3c 2f olayer-id</i>></
3550: 62 3e 20 65 2e 67 2e 20 22 3c 69 3e 63 65 6e 73 b> e.g. "<i>cens
3560: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 us2011_topofeatu
3570: 72 65 73 5f 31 3c 2f 69 3e 22 0d 0a 3c 74 61 62 res_1</i>"..<tab
3580: 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 le cellspan="4"
3590: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 cellpadding="6"
35a0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 bgcolor="#f8f8f0
35b0: 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c " border="1">..<
35c0: 74 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 tr><td bgcolor="
35d0: 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 69 64 3c #f0f0f8"><b>fid<
35e0: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 /b></td>..<td bg
35f0: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e color="#f0f0f8">
3600: 3c 62 3e 73 65 63 74 69 6f 6e 5f 69 64 3c 2f 62 <b>section_id</b
3610: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
3620: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
3630: 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 3e 3c 2f 74 64 >cod_com</b></td
3640: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
3650: 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f #f0f0f8"><b>cod_
3660: 70 70 6c 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 ppl</b></td>..<t
3670: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
3680: 66 38 22 3e 3c 62 3e 70 6f 70 5f 32 30 31 31 3c f8"><b>pop_2011<
3690: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 /b></td>..<td bg
36a0: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e color="#f0f0f8">
36b0: 3c 62 3e 6d 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 <b>m_2011</b></t
36c0: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d d>..<td bgcolor=
36d0: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 5f 32 "#f0f0f8"><b>f_2
36e0: 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 011</b></td></tr
36f0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e >..<tr><td align
3700: 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c ="right">1</td><
3710: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3720: 3e 34 35 30 30 31 30 30 30 30 30 30 31 3c 2f 74 >450010000001</t
3730: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3740: 68 74 22 3e 34 35 30 30 31 3c 2f 74 64 3e 3c 74 ht">45001</td><t
3750: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3760: 32 30 35 31 34 32 37 30 36 3c 2f 74 64 3e 3c 74 205142706</td><t
3770: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3780: 31 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 10</td><td align
3790: 3d 22 72 69 67 68 74 22 3e 37 3c 2f 74 64 3e 3c ="right">7</td><
37a0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
37b0: 3e 33 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 >3</td></tr>..<t
37c0: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
37d0: 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 20 61 6c ht">2</td><td al
37e0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 35 30 30 ign="right">4500
37f0: 31 30 30 30 30 30 30 32 3c 2f 74 64 3e 3c 74 64 10000002</td><td
3800: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 align="right">4
3810: 35 30 30 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 5001</td><td ali
3820: 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 35 31 34 gn="right">20514
3830: 32 37 30 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 2706</td><td ali
3840: 67 6e 3d 22 72 69 67 68 74 22 3e 31 35 35 3c 2f gn="right">155</
3850: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3860: 67 68 74 22 3e 36 39 3c 2f 74 64 3e 3c 74 64 20 ght">69</td><td
3870: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 38 36 align="right">86
3880: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 20 </td></tr>..<tr
3890: 63 6c 61 73 73 3d 22 64 30 22 3e 3c 74 64 20 61 class="d0"><td a
38a0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f lign="right">3</
38b0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
38c0: 67 68 74 22 3e 34 35 30 30 31 30 30 30 30 30 30 ght">45001000000
38d0: 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 3</td><td align=
38e0: 22 72 69 67 68 74 22 3e 34 35 30 30 31 3c 2f 74 "right">45001</t
38f0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3900: 68 74 22 3e 32 30 35 31 34 32 37 30 36 3c 2f 74 ht">205142706</t
3910: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3920: 68 74 22 3e 32 30 38 3c 2f 74 64 3e 3c 74 64 20 ht">208</td><td
3930: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 37 align="right">97
3940: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3950: 72 69 67 68 74 22 3e 31 31 31 3c 2f 74 64 3e 3c right">111</td><
3960: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f /tr>..<tr><td co
3970: 6c 73 70 61 6e 3d 22 37 22 20 61 6c 69 67 6e 3d lspan="7" align=
3980: 22 63 65 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 "center"><hr></t
3990: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
39a0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
39b0: 38 38 36 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 8867</td><td ali
39c0: 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 30 30 30 gn="right">10000
39d0: 37 30 30 30 30 30 36 34 3c 2f 74 64 3e 3c 74 64 70000064</td><td
39e0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
39f0: 30 30 30 30 37 3c 2f 74 64 3e 3c 74 64 3e 4e 55 00007</td><td>NU
3a00: 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e LL</td><td align
3a10: 3d 22 72 69 67 68 74 22 3e 30 3c 2f 74 64 3e 3c ="right">0</td><
3a20: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3a30: 3e 30 3c 2f 74 64 3e 09 3c 74 64 20 61 6c 69 67 >0</td>.<td alig
3a40: 6e 3d 22 72 69 67 68 74 22 3e 30 3c 2f 74 64 3e n="right">0</td>
3a50: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 </tr>..<tr><td a
3a60: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 lign="right">288
3a70: 36 38 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 68</td><td align
3a80: 3d 22 72 69 67 68 74 22 3e 31 30 30 30 30 37 30 ="right">1000070
3a90: 30 30 30 30 36 36 3c 2f 74 64 3e 3c 74 64 20 61 000066</td><td a
3aa0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 30 lign="right">100
3ab0: 30 30 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 007</td><td alig
3ac0: 6e 3d 22 72 69 67 68 74 22 3e 31 34 31 30 37 37 n="right">141077
3ad0: 35 34 31 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 5412</td><td ali
3ae0: 67 6e 3d 22 72 69 67 68 74 22 3e 30 3c 2f 74 64 gn="right">0</td
3af0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3b00: 74 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 t">0</td><td ali
3b10: 67 6e 3d 22 72 69 67 68 74 22 3e 30 3c 2f 74 64 gn="right">0</td
3b20: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e ></tr>..</table>
3b30: 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 ..<br><br>..<tab
3b40: 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 22 3e le width="100%">
3b50: 3c 74 72 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d <tr>..<td width=
3b60: 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 "33%" align="lef
3b70: 74 22 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 t"><a href="http
3b80: 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 s://www.gaia-gis
3b90: 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 .it/fossil/libsp
3ba0: 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 atialite/wiki?na
3bb0: 6d 65 3d 74 6f 70 6f 2d 69 6e 74 65 72 6d 65 64 me=topo-intermed
3bc0: 69 61 74 65 22 3e 70 72 65 76 69 6f 75 73 20 70 iate">previous p
3bd0: 61 67 65 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 age</a></td>..<t
3be0: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
3bf0: 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a ><a href="https:
3c00: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 //www.gaia-gis.i
3c10: 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 t/fossil/libspat
3c20: 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 ialite/wiki?name
3c30: 3d 6d 69 73 63 2d 64 6f 63 73 22 3e 62 61 63 6b =misc-docs">back
3c40: 20 74 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f 74 to index</a></t
3c50: 64 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 d>..<td width="3
3c60: 33 25 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 3%" align="right
3c70: 22 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 "><a href="https
3c80: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e ://www.gaia-gis.
3c90: 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 it/fossil/libspa
3ca0: 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d tialite/wiki?nam
3cb0: 65 3d 74 6f 70 6f 2d 61 64 76 61 6e 63 65 64 22 e=topo-advanced"
3cc0: 3e 6e 65 78 74 20 70 61 67 65 3c 2f 61 3e 3c 2f >next page</a></
3cd0: 74 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 61 62 6c td>..</tr></tabl
3ce0: 65 3e 0a 5a 20 30 39 35 64 62 36 38 31 63 65 36 e>.Z 095db681ce6
3cf0: 33 63 61 63 62 34 37 39 39 31 35 31 36 61 65 39 3cacb47991516ae9
3d00: 33 66 30 36 34 0a 3f064.