Wiki page
[topo-advanced] by
sandro
2015-11-16 20:40:17.
0000: 44 20 32 30 31 35 2d 31 31 2d 31 36 54 32 30 3a D 2015-11-16T20:
0010: 34 30 3a 31 37 2e 37 35 30 0a 4c 20 74 6f 70 6f 40:17.750.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 64 31 38 62 -advanced.P d18b
0030: 32 64 39 39 31 32 66 33 37 66 64 66 66 64 31 32 2d9912f37fdffd12
0040: 31 35 34 66 33 62 66 35 66 61 62 38 61 66 33 62 154f3bf5fab8af3b
0050: 33 64 34 32 0a 55 20 73 61 6e 64 72 6f 0a 57 20 3d42.U sandro.W
0060: 32 36 33 33 38 0a 3c 74 61 62 6c 65 20 63 65 6c 26338.<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 73 74 amically reconst
06f0: 72 75 63 74 65 64 20 65 76 65 72 79 20 74 69 6d ructed every tim
0700: 65 20 74 68 61 74 20 74 68 65 79 20 61 72 65 20 e that they are
0710: 72 65 66 65 72 65 6e 63 65 64 20 28 61 6e 64 20 referenced (and
0720: 74 68 69 73 20 63 6f 75 6c 64 20 65 61 73 69 6c this could easil
0730: 79 20 62 65 63 6f 6d 65 20 61 20 72 65 61 6c 20 y become a real
0740: 62 6f 74 74 6c 65 6e 65 63 6b 29 2e 3c 2f 6c 69 bottleneck).</li
0750: 3e 0d 0a 3c 6c 69 3e 6f 6e 20 74 68 65 20 6f 74 >..<li>on the ot
0760: 68 65 72 20 68 61 6e 64 20 61 20 47 65 6f 54 61 her hand a GeoTa
0770: 62 6c 65 20 28 61 6b 61 20 3c 75 3e 3c 69 3e 6c ble (aka <u><i>l
0780: 61 79 65 72 3c 2f 69 3e 3c 2f 75 3e 2c 20 61 73 ayer</i></u>, as
0790: 20 69 6e 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 47 in the common G
07a0: 49 53 20 70 61 72 6c 61 6e 63 65 29 20 69 73 20 IS parlance) is
07b0: 61 6c 77 61 79 73 20 62 61 73 65 64 20 6f 6e 20 always based on
07c0: 6d 61 6e 79 20 64 69 73 74 69 6e 63 74 20 66 65 many distinct fe
07d0: 61 74 75 72 65 73 2c 20 61 6e 64 20 66 6f 72 20 atures, and for
07e0: 65 61 63 68 20 66 65 61 74 75 72 65 20 61 20 47 each feature a G
07f0: 65 6f 6d 65 74 72 79 20 61 6e 64 20 61 6e 20 61 eometry and an a
0800: 73 73 6f 63 69 61 74 65 64 20 73 65 74 20 6f 66 ssociated set of
0810: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 information att
0820: 72 69 62 75 74 65 73 20 61 72 65 20 65 78 70 65 ributes are expe
0830: 63 74 65 64 20 74 6f 20 62 65 20 64 65 63 6c 61 cted to be decla
0840: 72 65 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 red.</li>..<li>t
0850: 68 65 72 65 20 69 73 20 66 75 72 74 68 65 72 20 here is further
0860: 64 69 66 66 65 72 65 6e 63 65 20 74 6f 20 62 65 difference to be
0870: 20 74 61 6b 65 6e 20 69 6e 20 70 72 6f 70 65 72 taken in proper
0880: 20 61 63 63 6f 75 6e 74 3a 20 54 6f 70 6f 6c 6f account: Topolo
0890: 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 6e 65 gy primitives ne
08a0: 63 65 73 73 61 72 69 6c 79 20 61 72 65 20 65 6c cessarily are el
08b0: 65 6d 65 6e 74 61 72 79 2e 20 46 65 61 74 75 72 ementary. Featur
08c0: 65 20 47 65 6f 6d 65 74 72 69 65 73 20 63 61 6e e Geometries can
08d0: 20 75 73 75 61 6c 6c 79 20 72 65 70 72 65 73 65 usually represe
08e0: 6e 74 20 73 6f 6d 65 20 63 6f 6d 70 6c 65 78 20 nt some complex
08f0: 74 79 70 65 3a 20 4d 55 4c 54 49 50 4f 49 4e 54 type: MULTIPOINT
0900: 2c 20 4d 55 4c 54 49 4c 49 4e 45 53 54 52 49 4e , MULTILINESTRIN
0910: 47 2c 20 4d 55 4c 54 49 50 4f 4c 59 47 4f 4e 20 G, MULTIPOLYGON
0920: 61 6e 64 2c 20 6d 61 79 20 62 65 2c 20 47 45 4f and, may be, GEO
0930: 4d 45 54 52 59 43 4f 4c 4c 45 43 54 49 4f 4e 2e METRYCOLLECTION.
0940: 20 53 6f 20 69 74 20 73 68 6f 75 6c 64 20 62 65 So it should be
0950: 20 61 62 73 6f 6c 75 74 65 6c 79 20 63 6c 65 61 absolutely clea
0960: 72 20 74 68 61 74 20 61 20 46 65 61 74 75 72 65 r that a Feature
0970: 20 47 65 6f 6d 65 74 72 79 20 64 6f 65 73 20 6e Geometry does n
0980: 6f 74 20 6e 65 63 65 73 73 61 72 69 6c 79 20 63 ot necessarily c
0990: 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 20 orresponds to a
09a0: 73 69 6e 67 6c 65 20 54 6f 70 6f 6c 6f 67 79 20 single Topology
09b0: 70 72 69 6d 69 74 69 76 65 20 3b 20 61 20 46 65 primitive ; a Fe
09c0: 61 74 75 72 65 20 47 65 6f 6d 65 74 72 79 20 63 ature Geometry c
09d0: 6f 75 6c 64 20 65 61 73 69 6c 79 20 62 65 20 64 ould easily be d
09e0: 65 72 69 76 65 64 20 66 72 6f 6d 20 61 67 67 72 erived from aggr
09f0: 65 67 61 74 69 6e 67 20 6d 61 6e 79 20 64 69 66 egating many dif
0a00: 66 65 72 65 6e 74 20 54 6f 70 6f 6c 6f 67 79 20 ferent Topology
0a10: 70 72 69 6d 69 74 69 76 65 73 2e 3c 2f 6c 69 3e primitives.</li>
0a20: 20 0d 0a 3c 6c 69 3e 74 68 61 74 27 73 20 6e 6f ..<li>that's no
0a30: 74 20 61 6c 6c 3a 20 6d 61 6e 79 20 64 69 66 66 t all: many diff
0a40: 65 72 65 6e 74 20 47 65 6f 54 61 62 6c 65 73 20 erent GeoTables
0a50: 63 6f 75 6c 64 20 65 76 65 6e 74 75 61 6c 6c 79 could eventually
0a60: 20 62 65 20 64 65 72 69 76 65 64 20 66 72 6f 6d be derived from
0a70: 20 61 20 73 69 6e 67 6c 65 20 54 6f 70 6f 6c 6f a single Topolo
0a80: 67 79 3b 20 61 6e 64 20 74 68 65 20 73 61 6d 65 gy; and the same
0a90: 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 Topology primit
0aa0: 69 76 65 20 63 6f 75 6c 64 20 70 6c 61 79 20 61 ive could play a
0ab0: 20 76 65 72 79 20 64 69 66 66 65 72 65 6e 74 20 very different
0ac0: 72 6f 6c 65 20 69 6e 20 65 76 65 72 79 6f 6e 65 role in everyone
0ad0: 20 6f 66 20 74 68 65 73 65 20 47 65 6f 54 61 62 of these GeoTab
0ae0: 6c 65 73 2e 3c 62 72 3e 0d 0a 4a 75 73 74 20 61 les.<br>..Just a
0af0: 20 62 61 73 69 63 61 6c 6c 79 20 73 69 6d 70 6c basically simpl
0b00: 65 20 65 78 61 6d 70 6c 65 3a 20 69 6d 61 67 69 e example: imagi
0b10: 6e 65 20 61 20 54 6f 70 6f 6c 6f 67 79 20 63 6f ne a Topology co
0b20: 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 rresponding to s
0b30: 6f 6d 65 20 6c 61 6e 64 20 72 65 67 69 73 74 72 ome land registr
0b40: 79 20 6d 61 70 2e 20 57 65 27 6c 6c 20 73 75 72 y map. We'll sur
0b50: 65 6c 79 20 68 61 76 65 20 6d 61 6e 79 20 70 6f ely have many po
0b60: 74 65 6e 74 69 61 6c 20 6c 61 79 65 72 73 3a 20 tential layers:
0b70: 62 75 69 6c 64 69 6e 67 73 2c 20 61 67 72 69 63 buildings, agric
0b80: 75 6c 74 75 72 61 6c 20 6c 61 6e 64 2c 20 70 6f ultural land, po
0b90: 70 75 6c 61 74 65 64 20 70 6c 61 63 65 73 2c 20 pulated places,
0ba0: 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20 62 administrative b
0bb0: 6f 75 6e 64 61 72 69 65 73 2c 20 72 6f 61 64 73 oundaries, roads
0bc0: 2c 20 70 6f 6e 64 73 2c 20 72 69 76 65 72 73 2c , ponds, rivers,
0bd0: 20 66 65 6e 63 65 73 20 61 6e 64 20 73 6f 20 6f fences and so o
0be0: 6e 2e 3c 62 72 3e 0d 0a 49 6e 20 73 75 63 68 20 n.<br>..In such
0bf0: 61 20 63 6f 6e 74 65 78 74 20 61 20 66 65 6e 63 a context a fenc
0c00: 65 20 63 6f 75 6c 64 20 65 61 73 69 6c 79 20 63 e could easily c
0c10: 6f 72 72 65 73 70 6f 6e 64 20 74 6f 20 61 20 46 orrespond to a F
0c20: 65 61 74 75 72 65 20 77 69 74 68 69 6e 20 74 68 eature within th
0c30: 65 20 22 3c 69 3e 3c 62 3e 66 65 6e 63 65 73 3c e "<i><b>fences<
0c40: 2f 62 3e 3c 2f 69 3e 22 20 6c 61 79 65 72 2c 20 /b></i>" layer,
0c50: 63 6f 75 6c 64 20 70 72 6f 62 61 62 6c 79 20 64 could probably d
0c60: 65 6c 69 6d 69 74 20 74 77 6f 20 61 64 6a 61 63 elimit two adjac
0c70: 65 6e 74 20 61 67 72 69 63 75 6c 74 75 72 61 6c ent agricultural
0c80: 20 61 72 65 61 73 20 61 6e 64 20 63 6f 75 6c 64 areas and could
0c90: 20 65 76 65 6e 74 75 61 6c 6c 79 20 62 65 20 70 eventually be p
0ca0: 61 72 74 20 6f 66 20 73 6f 6d 65 20 61 64 6d 69 art of some admi
0cb0: 6e 69 73 74 72 61 74 69 76 65 20 62 6f 75 6e 64 nistrative bound
0cc0: 61 72 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c ary.</li>..<li><
0cd0: 62 3e 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e b>TopoLayers</b>
0ce0: 20 61 6e 64 20 3c 62 3e 54 6f 70 6f 46 65 61 74 and <b>TopoFeat
0cf0: 75 72 65 73 3c 2f 62 3e 20 72 65 70 72 65 73 65 ures</b> represe
0d00: 6e 74 20 61 20 63 6f 6d 70 6c 65 78 20 61 6e 64 nt a complex and
0d10: 20 66 6c 65 78 69 62 6c 65 20 73 74 72 75 63 74 flexible struct
0d20: 75 72 65 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 ure intended to
0d30: 65 73 74 61 62 6c 69 73 68 20 70 65 72 6d 61 6e establish perman
0d40: 65 6e 74 20 65 78 70 6c 69 63 69 74 20 63 6f 72 ent explicit cor
0d50: 72 65 73 70 6f 6e 64 65 6e 63 65 73 20 62 65 74 respondences bet
0d60: 77 65 65 6e 20 54 6f 70 6f 6c 6f 67 79 20 50 72 ween Topology Pr
0d70: 69 6d 69 74 69 76 65 73 20 61 6e 64 20 47 65 6f imitives and Geo
0d80: 54 61 62 6c 65 20 46 65 61 74 75 72 65 73 2e 0d Table Features..
0d90: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 65 61 63 68 20 .<ul>..<li>each
0da0: 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e <b>TopoLayer</b>
0db0: 20 69 73 20 75 6e 69 71 75 65 6c 79 20 69 64 65 is uniquely ide
0dc0: 6e 74 69 66 69 65 64 20 62 79 20 69 74 73 20 3c ntified by its <
0dd0: 62 3e 6e 61 6d 65 3c 2f 62 3e 20 61 6e 64 20 64 b>name</b> and d
0de0: 69 72 65 63 74 6c 79 20 63 6f 72 72 65 73 70 6f irectly correspo
0df0: 6e 64 73 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 nds to a single
0e00: 47 65 6f 54 61 62 6c 65 20 74 6f 20 62 65 20 65 GeoTable to be e
0e10: 78 70 6f 72 74 65 64 20 66 72 6f 6d 20 74 68 65 xported from the
0e20: 20 54 6f 70 6f 6c 6f 67 79 3c 62 72 3e 0d 0a 41 Topology<br>..A
0e30: 6e 20 61 72 62 69 74 72 61 72 79 20 6e 75 6d 62 n arbitrary numb
0e40: 65 72 20 6f 66 20 54 6f 70 6f 4c 61 79 65 72 73 er of TopoLayers
0e50: 20 63 61 6e 20 62 65 20 63 72 65 61 74 65 64 20 can be created
0e60: 6f 6e 20 74 68 65 20 73 61 6d 65 20 54 6f 70 6f on the same Topo
0e70: 6c 6f 67 79 2c 20 61 6e 64 20 65 61 63 68 20 6f logy, and each o
0e80: 6e 65 20 6f 66 20 74 68 65 6d 20 77 69 6c 6c 20 ne of them will
0e90: 61 63 74 20 61 73 20 61 20 73 65 70 61 72 61 74 act as a separat
0ea0: 65 20 63 6f 6e 74 61 69 6e 65 72 2e 3c 2f 6c 69 e container.</li
0eb0: 3e 0d 0a 3c 6c 69 3e 65 61 63 68 20 3c 62 3e 54 >..<li>each <b>T
0ec0: 6f 70 6f 46 65 61 74 75 72 65 3c 2f 62 3e 20 69 opoFeature</b> i
0ed0: 73 20 75 6e 69 71 75 65 6c 79 20 69 64 65 6e 74 s uniquely ident
0ee0: 69 66 69 65 64 20 62 79 20 69 74 73 20 3c 62 3e ified by its <b>
0ef0: 66 69 64 3c 2f 62 3e 20 28 3c 69 3e 66 65 61 74 fid</b> (<i>feat
0f00: 75 72 65 2d 69 64 3c 2f 69 3e 29 20 61 6e 64 20 ure-id</i>) and
0f10: 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 corresponds to a
0f20: 20 73 69 6e 67 6c 65 20 46 65 61 74 75 72 65 20 single Feature
0f30: 63 6f 6e 74 61 69 6e 69 6e 67 20 61 6e 20 69 6e containing an in
0f40: 64 69 76 69 64 75 61 6c 20 73 65 74 20 6f 66 20 dividual set of
0f50: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 information attr
0f60: 69 62 75 74 65 73 2e 3c 62 72 3e 0d 0a 54 68 65 ibutes.<br>..The
0f70: 20 47 65 6f 6d 65 74 72 79 20 66 6f 72 20 65 61 Geometry for ea
0f80: 63 68 20 54 6f 70 6f 46 65 61 74 75 72 65 20 69 ch TopoFeature i
0f90: 73 20 61 6c 77 61 79 73 20 69 6e 64 69 72 65 63 s always indirec
0fa0: 74 6c 79 20 64 65 66 69 6e 65 64 20 62 79 20 73 tly defined by s
0fb0: 70 65 63 69 66 79 69 6e 67 20 61 20 6c 69 73 74 pecifying a list
0fc0: 20 6f 66 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 of Topology pri
0fd0: 6d 69 74 69 76 65 73 20 69 6e 64 69 76 69 64 75 mitives individu
0fe0: 61 6c 6c 79 20 72 65 66 65 72 65 6e 63 65 64 20 ally referenced
0ff0: 62 79 20 74 68 65 69 72 20 49 44 73 2e 3c 62 72 by their IDs.<br
1000: 3e 0d 0a 53 75 63 68 20 61 20 67 65 6f 6d 65 74 >..Such a geomet
1010: 72 79 20 6f 62 76 69 6f 75 73 6c 79 20 69 73 20 ry obviously is
1020: 61 20 3c 75 3e 3c 69 3e 76 69 72 74 75 61 6c 3c a <u><i>virtual<
1030: 2f 69 3e 3c 2f 75 3e 20 6f 6e 65 2c 20 61 6e 64 /i></u> one, and
1040: 20 77 69 6c 6c 20 62 65 20 61 63 74 75 61 6c 6c will be actuall
1050: 79 20 6d 61 74 65 72 69 61 6c 69 7a 65 64 20 28 y materialized (
1060: 62 79 20 61 67 67 72 65 67 61 74 69 6e 67 20 61 by aggregating a
1070: 6c 6c 20 72 65 66 65 72 65 6e 63 65 64 20 54 6f ll referenced To
1080: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 pology primitive
1090: 73 29 20 6f 6e 6c 79 20 77 68 65 6e 20 65 78 70 s) only when exp
10a0: 6f 72 74 69 6e 67 20 74 68 65 20 64 65 73 74 69 orting the desti
10b0: 6e 61 74 69 6f 6e 20 47 65 6f 54 61 62 6c 65 2e nation GeoTable.
10c0: 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 </li>..</ul></li
10d0: 3e 0d 0a 3c 6c 69 3e 54 68 65 20 54 6f 70 6f 4c >..<li>The TopoL
10e0: 61 79 65 72 73 20 2f 20 54 6f 70 6f 46 65 61 74 ayers / TopoFeat
10f0: 75 72 65 73 20 73 74 72 75 63 74 75 72 65 20 69 ures structure i
1100: 73 20 70 72 61 63 74 69 63 61 6c 6c 79 20 69 6d s practically im
1110: 70 6c 65 6d 65 6e 74 65 64 20 61 73 20 61 20 73 plemented as a s
1120: 65 74 20 6f 66 20 73 65 76 65 72 61 6c 20 63 6c et of several cl
1130: 6f 73 65 6c 79 20 72 65 6c 61 74 65 64 20 44 42 osely related DB
1140: 2d 74 61 62 6c 65 73 20 29 77 65 27 6c 6c 20 65 -tables )we'll e
1150: 78 61 6d 69 6e 65 20 6c 61 74 65 72 20 74 68 65 xamine later the
1160: 69 72 20 72 65 73 70 65 63 74 69 76 65 20 6c 61 ir respective la
1170: 79 6f 75 74 73 20 69 6e 20 66 75 6c 6c 20 64 65 youts in full de
1180: 74 61 69 6c 29 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c tail):..<ul>..<l
1190: 69 3e 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 i><b><<i>topo-pr
11a0: 65 66 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 6c 61 efix</i>>_topola
11b0: 79 65 72 73 3c 2f 62 3e 3a 20 74 68 69 73 20 66 yers</b>: this f
11c0: 69 72 73 74 20 74 61 62 6c 65 20 73 69 6d 70 6c irst table simpl
11d0: 79 20 69 73 20 61 20 63 61 74 61 6c 6f 67 20 6f y is a catalog o
11e0: 66 20 61 6c 6c 20 54 6f 70 6f 4c 61 79 65 72 73 f all TopoLayers
11f0: 20 73 75 70 70 6f 72 74 69 6e 67 20 74 68 65 20 supporting the
1200: 73 61 6d 65 20 54 6f 70 6f 6c 6f 67 79 2e 3c 62 same Topology.<b
1210: 72 3e 0d 0a 45 61 63 68 20 54 6f 70 6f 4c 61 79 r>..Each TopoLay
1220: 65 72 20 69 73 20 69 64 65 6e 74 69 66 69 65 64 er is identified
1230: 20 62 79 20 69 74 73 20 3c 62 3e 6e 61 6d 65 3c by its <b>name<
1240: 2f 62 3e 20 61 6e 64 20 62 79 20 69 74 73 20 3c /b> and by its <
1250: 62 3e 49 44 3c 2f 62 3e 3b 20 62 6f 74 68 20 69 b>ID</b>; both i
1260: 64 65 6e 74 69 66 69 65 72 73 20 61 72 65 20 67 dentifiers are g
1270: 72 61 6e 74 65 64 20 74 6f 20 62 65 20 3c 69 3e ranted to be <i>
1280: 3c 75 3e 75 6e 69 71 75 65 3c 2f 75 3e 3c 2f 69 <u>unique</u></i
1290: 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e >.</li>..<li><b>
12a0: 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c <<i>topo-prefix<
12b0: 2f 69 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72 65 /i>>_topofeature
12c0: 73 3c 2f 62 3e 3a 20 74 68 69 73 20 73 65 63 6f s</b>: this seco
12d0: 6e 64 20 74 61 62 6c 65 20 69 73 20 69 6e 74 65 nd table is inte
12e0: 6e 64 65 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e nded to permanen
12f0: 74 6c 79 20 73 74 6f 72 65 20 61 6c 6c 20 63 72 tly store all cr
1300: 6f 73 73 2d 72 65 66 65 72 65 6e 63 65 73 20 65 oss-references e
1310: 78 69 73 74 69 6e 67 20 62 65 74 77 65 65 6e 20 xisting between
1320: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 Topology primiti
1330: 76 65 73 20 61 6e 64 20 54 6f 70 6f 46 65 61 74 ves and TopoFeat
1340: 75 72 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e ures.</li>..<li>
1350: 3c 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 <b><<i>topo-pref
1360: 69 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 66 65 61 74 ix</i>>_topofeat
1370: 75 72 65 73 5f 3c 3c 69 3e 74 6f 70 6f 6c 61 79 ures_<<i>topolay
1380: 65 72 2d 69 64 3c 2f 69 3e 3e 3c 2f 62 3e 3a 20 er-id</i>></b>:
1390: 66 6f 72 20 65 61 63 68 20 73 69 6e 67 6c 65 20 for each single
13a0: 54 6f 70 6f 4c 61 79 65 72 20 61 20 73 65 70 61 TopoLayer a sepa
13b0: 72 61 74 65 20 74 61 62 6c 65 20 69 73 20 72 65 rate table is re
13c0: 71 75 69 72 65 64 2e 20 54 68 65 20 61 63 74 75 quired. The actu
13d0: 61 6c 20 63 6f 72 72 65 73 70 6f 6e 64 65 6e 63 al correspondenc
13e0: 65 20 69 73 20 65 73 74 61 62 6c 69 73 68 65 64 e is established
13f0: 20 76 69 61 20 74 68 65 20 3c 62 3e 54 6f 70 6f via the <b>Topo
1400: 4c 61 79 65 72 2d 49 44 3c 2f 62 3e 20 73 75 66 Layer-ID</b> suf
1410: 66 69 78 2e 3c 62 72 3e 0d 0a 41 6c 6c 20 74 68 fix.<br>..All th
1420: 65 73 65 20 74 61 62 6c 65 73 20 61 72 65 20 69 ese tables are i
1430: 6e 74 65 6e 64 65 64 20 74 6f 20 70 65 72 6d 61 ntended to perma
1440: 6e 65 6e 74 6c 79 20 73 74 6f 72 65 20 74 68 65 nently store the
1450: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 information att
1460: 72 69 62 75 74 65 73 20 66 6f 72 20 65 61 63 68 ributes for each
1470: 20 54 6f 70 6f 46 65 61 74 75 72 65 20 69 6e 20 TopoFeature in
1480: 74 68 65 20 73 61 6d 65 20 54 6f 70 6f 4c 61 79 the same TopoLay
1490: 65 72 2e 0d 0a 44 69 66 66 65 72 65 6e 74 20 54 er...Different T
14a0: 6f 70 6f 4c 61 79 65 72 73 20 77 69 6c 6c 20 6f opoLayers will o
14b0: 62 76 69 6f 75 73 6c 79 20 73 75 70 70 6f 72 74 bviously support
14c0: 20 61 20 64 69 66 66 65 72 65 6e 74 20 73 65 74 a different set
14d0: 20 6f 66 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 of information
14e0: 61 74 74 72 69 62 75 74 65 73 20 74 68 75 73 20 attributes thus
14f0: 72 65 71 75 69 72 69 6e 67 20 61 6e 20 69 6e 64 requiring an ind
1500: 69 76 69 64 75 61 6c 20 74 61 62 6c 65 20 6c 61 ividual table la
1510: 79 6f 75 74 2e 3c 62 72 3e 0d 0a 41 6e 79 77 61 yout.<br>..Anywa
1520: 79 20 61 6c 6c 20 74 68 65 73 65 20 74 61 62 6c y all these tabl
1530: 65 73 20 61 72 65 20 61 6c 77 61 79 73 20 65 78 es are always ex
1540: 70 65 63 74 65 64 20 74 6f 20 64 65 63 6c 61 72 pected to declar
1550: 65 20 61 20 3c 62 3e 50 72 69 6d 61 72 79 20 4b e a <b>Primary K
1560: 65 79 3c 2f 62 3e 20 6f 66 20 74 68 65 20 3c 62 ey</b> of the <b
1570: 3e 49 4e 54 45 47 45 52 3c 2f 62 3e 20 74 79 70 >INTEGER</b> typ
1580: 65 20 6e 61 6d 65 64 20 3c 62 3e 66 69 64 3c 2f e named <b>fid</
1590: 62 3e 20 61 6e 64 20 69 6e 74 65 6e 64 65 64 20 b> and intended
15a0: 74 6f 20 62 65 20 61 6e 20 75 6e 69 71 75 65 20 to be an unique
15b0: 69 64 65 6e 74 69 66 69 65 72 20 66 6f 72 20 65 identifier for e
15c0: 61 63 68 20 54 6f 70 6f 46 65 61 74 75 72 65 2e ach TopoFeature.
15d0: 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 </li>..</ul></li
15e0: 3e 0d 0a 3c 6c 69 3e 53 65 76 65 72 61 6c 20 53 >..<li>Several S
15f0: 51 4c 20 66 75 6e 63 74 69 6f 6e 73 20 61 72 65 QL functions are
1600: 20 73 70 65 63 69 66 69 63 61 6c 6c 79 20 69 6e specifically in
1610: 74 65 6e 64 65 64 20 74 6f 20 73 75 70 70 6f 72 tended to suppor
1620: 74 20 70 72 6f 63 65 73 73 69 6e 67 20 6f 70 65 t processing ope
1630: 72 61 74 69 6f 6e 73 20 62 61 73 65 64 20 6f 6e rations based on
1640: 20 54 6f 70 6f 4c 61 79 65 72 73 20 61 6e 64 20 TopoLayers and
1650: 54 6f 70 6f 46 65 61 74 75 72 65 73 3b 20 77 65 TopoFeatures; we
1660: 27 6c 6c 20 65 78 61 6d 69 6e 65 20 6c 61 74 65 'll examine late
1670: 72 20 61 6c 6c 20 74 68 65 6d 20 69 6e 20 66 75 r all them in fu
1680: 6c 6c 20 64 65 74 61 69 6c 2e 3c 2f 6c 69 3e 0d ll detail.</li>.
1690: 0a 3c 2f 75 6c 3e 3c 62 72 3e 3c 62 72 3e 0d 0a .</ul><br><br>..
16a0: 3c 68 72 3e 0d 0a 3c 68 32 3e 61 20 71 75 69 63 <hr>..<h2>a quic
16b0: 6b 20 70 72 61 63 74 69 63 61 6c 20 65 78 65 72 k practical exer
16c0: 63 69 73 65 3c 2f 68 32 3e 0d 0a 50 72 65 72 65 cise</h2>..Prere
16d0: 71 75 69 73 69 74 65 73 3a 0d 0a 3c 6f 6c 3e 0d quisites:..<ol>.
16e0: 0a 3c 6c 69 3e 64 6f 77 6e 6c 6f 61 64 20 74 68 .<li>download th
16f0: 65 20 73 61 6d 70 6c 65 20 44 42 2d 66 69 6c 65 e sample DB-file
1700: 20 66 72 6f 6d 20 3c 61 20 68 72 65 66 3d 22 68 from <a href="h
1710: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
1720: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 gis.it/gaia-sins
1730: 2f 74 6f 70 6f 73 61 6d 70 6c 65 73 2f 74 75 73 /toposamples/tus
1740: 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 31 31 cany-census-2011
1750: 2e 37 7a 22 3e 68 65 72 65 3c 2f 61 3e 3c 62 72 .7z">here</a><br
1760: 3e 0d 0a 49 74 20 63 6f 6e 74 61 69 6e 73 20 43 >..It contains C
1770: 65 6e 73 75 73 20 64 61 74 61 20 28 32 30 31 31 ensus data (2011
1780: 29 20 6b 69 6e 64 6c 79 20 72 65 6c 65 61 73 65 ) kindly release
1790: 64 20 62 79 20 49 53 54 41 54 20 75 6e 64 65 72 d by ISTAT under
17a0: 20 3c 62 3e 43 43 2d 42 59 3c 2f 62 3e 20 6c 69 <b>CC-BY</b> li
17b0: 63 65 6e 73 65 20 74 65 72 6d 73 2e 3c 62 72 3e cense terms.<br>
17c0: 0d 0a 54 68 65 20 6f 72 69 67 69 6e 61 6c 20 64 ..The original d
17d0: 61 74 61 73 65 74 73 20 68 61 76 65 20 62 65 65 atasets have bee
17e0: 6e 20 73 6c 69 67 68 74 6c 79 20 72 65 61 72 72 n slightly rearr
17f0: 61 6e 67 65 64 20 69 6e 20 61 20 6d 6f 72 65 20 anged in a more
1800: 63 6f 6e 76 65 6e 69 65 6e 74 20 66 6f 72 6d 2e convenient form.
1810: 0d 0a 41 6c 6c 20 67 65 6f 6d 65 74 72 69 65 73 ..All geometries
1820: 20 61 72 65 20 69 6e 20 74 68 65 20 3c 62 3e 53 are in the <b>S
1830: 52 49 44 20 33 32 36 33 32 3c 2f 62 3e 20 28 3c RID 32632</b> (<
1840: 69 3e 57 47 53 20 38 34 20 2f 20 55 54 4d 20 7a i>WGS 84 / UTM z
1850: 6f 6e 65 20 33 32 4e 3c 2f 69 3e 29 3a 0d 0a 3c one 32N</i>):..<
1860: 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 65 6e 73 ul>..<li><b>cens
1870: 75 73 5f 32 30 31 31 3c 2f 62 3e 3a 20 61 6c 6c us_2011</b>: all
1880: 20 43 65 6e 73 75 73 20 41 72 65 61 73 20 28 32 Census Areas (2
1890: 30 31 31 29 20 63 6f 76 65 72 69 6e 67 20 54 75 011) covering Tu
18a0: 73 63 61 6e 79 2e 3c 62 72 3e 0d 0a 3c 75 3e 4e scany.<br>..<u>N
18b0: 6f 74 65 3a 3c 2f 75 3e 20 73 65 76 65 72 61 6c ote:</u> several
18c0: 20 43 65 6e 73 75 73 20 41 72 65 61 73 20 61 72 Census Areas ar
18d0: 65 20 63 6f 6d 70 6c 65 74 65 6c 79 20 75 6e 69 e completely uni
18e0: 6e 68 61 62 69 74 65 64 20 28 6c 61 6b 65 73 2c nhabited (lakes,
18f0: 20 6d 61 72 73 68 6c 61 6e 64 73 2c 20 68 69 67 marshlands, hig
1900: 68 20 6d 6f 75 6e 74 61 69 6e 73 20 61 6e 64 20 h mountains and
1910: 61 6c 69 6b 65 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c alike).</li>..<l
1920: 69 3e 3c 62 3e 70 70 6c 5f 32 30 31 31 3c 2f 62 i><b>ppl_2011</b
1930: 3e 3a 20 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 >: Populated Pla
1940: 63 65 73 20 28 64 65 66 69 6e 65 64 20 61 73 20 ces (defined as
1950: 61 6e 20 61 67 67 72 65 67 61 74 69 6f 6e 20 6f an aggregation o
1960: 66 20 43 65 6e 73 75 73 20 41 72 65 61 73 29 2e f Census Areas).
1970: 3c 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c 2f 75 <br>..<u>Note</u
1980: 3e 3a 20 6e 6f 74 20 61 6c 6c 20 43 65 6e 73 75 >: not all Censu
1990: 73 20 41 72 65 61 73 20 62 65 6c 6f 6e 67 20 74 s Areas belong t
19a0: 6f 20 61 20 50 6f 70 75 6c 61 74 65 64 20 50 6c o a Populated Pl
19b0: 61 63 65 3a 20 74 68 65 72 65 20 61 72 65 20 6d ace: there are m
19c0: 61 6e 79 20 73 65 6c 66 2d 73 74 61 6e 64 69 6e any self-standin
19d0: 67 20 64 69 73 70 65 72 73 65 64 20 72 75 72 61 g dispersed rura
19e0: 6c 20 61 72 65 61 73 2e 3c 2f 6c 69 3e 0d 0a 3c l areas.</li>..<
19f0: 6c 69 3e 3c 62 3e 63 6f 6d 5f 32 30 31 31 3c 2f li><b>com_2011</
1a00: 62 3e 3a 20 54 75 73 63 61 6e 79 20 4d 75 6e 69 b>: Tuscany Muni
1a10: 63 69 70 61 6c 69 74 69 65 73 20 2f 20 4c 6f 63 cipalities / Loc
1a20: 61 6c 20 43 6f 75 6e 63 69 6c 73 20 32 30 31 31 al Councils 2011
1a30: 20 28 64 65 66 69 6e 65 64 20 61 73 20 61 6e 20 (defined as an
1a40: 61 67 67 72 65 67 61 74 69 6f 6e 73 20 6f 66 20 aggregations of
1a50: 43 65 6e 73 75 73 20 41 72 65 61 73 29 2e 3c 2f Census Areas).</
1a60: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 6f 6d 5f li>..<li><b>com_
1a70: 32 30 31 34 5f 31 35 3c 2f 62 3e 3a 20 66 65 77 2014_15</b>: few
1a80: 20 6e 65 77 20 4d 75 6e 69 63 69 70 61 6c 69 74 new Municipalit
1a90: 69 65 73 20 63 72 65 61 74 65 64 20 64 75 72 69 ies created duri
1aa0: 6e 67 20 79 65 61 72 73 20 32 30 31 34 2f 31 35 ng years 2014/15
1ab0: 20 62 79 20 6d 65 72 67 69 6e 67 20 70 72 65 2d by merging pre-
1ac0: 65 78 69 73 74 69 6e 67 20 73 6d 61 6c 6c 65 72 existing smaller
1ad0: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2e Municipalities.
1ae0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 70 72 </li>..<li><b>pr
1af0: 6f 76 5f 32 30 31 31 3c 2f 62 3e 3a 20 54 75 73 ov_2011</b>: Tus
1b00: 63 61 6e 79 20 50 72 6f 76 69 6e 63 65 73 20 2f cany Provinces /
1b10: 20 43 6f 75 6e 74 69 65 73 20 28 64 65 66 69 6e Counties (defin
1b20: 65 64 20 61 73 20 61 6e 20 61 67 67 72 65 67 61 ed as an aggrega
1b30: 74 69 6f 6e 20 6f 66 20 4d 75 6e 69 63 69 70 61 tion of Municipa
1b40: 6c 69 74 69 65 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c lities).</li>..<
1b50: 6c 69 3e 3c 62 3e 72 65 67 5f 32 30 31 31 3c 2f li><b>reg_2011</
1b60: 62 3e 3a 20 54 75 73 63 61 6e 79 20 52 65 67 69 b>: Tuscany Regi
1b70: 6f 6e 20 28 64 65 66 69 6e 65 64 20 61 73 20 61 on (defined as a
1b80: 6e 20 61 67 67 72 65 67 61 74 69 6f 6e 20 6f 66 n aggregation of
1b90: 20 50 72 6f 76 69 6e 63 65 73 29 2e 3c 2f 6c 69 Provinces).</li
1ba0: 3e 0d 0a 3c 6c 69 3e 6a 75 73 74 20 3c 62 3e 63 >..<li>just <b>c
1bb0: 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20 61 ensus_2011</b> a
1bc0: 6c 6f 6e 65 20 73 75 70 70 6f 72 74 73 20 67 65 lone supports ge
1bd0: 6f 6d 65 74 72 69 65 73 3b 20 61 6e 79 20 6f 74 ometries; any ot
1be0: 68 65 72 20 61 64 6d 69 6e 69 73 74 72 61 74 69 her administrati
1bf0: 76 65 20 6c 65 76 65 6c 20 69 73 20 73 69 6d 70 ve level is simp
1c00: 6c 79 20 64 65 66 69 6e 65 64 20 62 79 20 72 65 ly defined by re
1c10: 6c 61 74 69 6f 6e 61 6c 20 63 6f 64 65 73 2e 3c lational codes.<
1c20: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e /li>..</ul></li>
1c30: 0d 0a 3c 6c 69 3e 75 6e 63 6f 6d 70 72 65 73 73 ..<li>uncompress
1c40: 20 74 68 65 20 64 6f 77 6e 6c 6f 61 64 65 64 20 the downloaded
1c50: 64 62 2d 66 69 6c 65 20 28 3c 62 3e 3c 69 3e 74 db-file (<b><i>t
1c60: 75 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d 32 30 uscany-census-20
1c70: 31 31 2e 73 71 6c 69 74 65 3c 2f 69 3e 3c 2f 62 11.sqlite</i></b
1c80: 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6e 6f >).</li>..<li>no
1c90: 77 20 79 6f 75 20 63 61 6e 20 66 69 6e 61 6c 6c w you can finall
1ca0: 79 20 73 74 61 72 74 20 61 20 53 70 61 74 69 61 y start a Spatia
1cb0: 4c 69 74 65 20 73 65 73 73 69 6f 6e 20 75 73 69 Lite session usi
1cc0: 6e 67 20 79 6f 75 72 20 70 72 65 66 65 72 72 65 ng your preferre
1cd0: 64 20 53 70 61 74 69 61 4c 69 74 65 20 66 72 6f d SpatiaLite fro
1ce0: 6e 74 20 65 6e 64 20 74 6f 6f 6c 3a 0d 0a 3c 75 nt end tool:..<u
1cf0: 6c 3e 0d 0a 3c 6c 69 3e 3c 75 3e 41 74 74 65 6e l>..<li><u>Atten
1d00: 74 69 6f 6e 3c 2f 75 3e 3a 20 79 6f 75 20 6d 75 tion</u>: you mu
1d10: 73 74 20 6e 6f 74 20 64 69 72 65 63 74 6c 79 20 st not directly
1d20: 63 6f 6e 6e 65 63 74 20 74 6f 20 3c 62 3e 3c 69 connect to <b><i
1d30: 3e 74 75 73 63 61 6e 79 2d 63 65 6e 73 75 73 2d >tuscany-census-
1d40: 32 30 31 31 2e 73 71 6c 69 74 65 3c 2f 69 3e 3c 2011.sqlite</i><
1d50: 2f 62 3e 3b 20 79 6f 75 20 61 72 65 20 65 78 70 /b>; you are exp
1d60: 65 63 74 65 64 20 69 6e 73 74 65 61 64 20 74 6f ected instead to
1d70: 20 63 6f 6e 6e 65 63 74 20 61 20 6e 65 77 20 28 connect a new (
1d80: 65 6d 70 74 79 29 20 44 42 2d 66 69 6c 65 20 6e empty) DB-file n
1d90: 61 6d 65 64 20 3c 62 3e 74 75 73 63 61 6e 79 2d amed <b>tuscany-
1da0: 74 6f 70 6f 2d 32 30 31 31 2e 73 71 6c 69 74 65 topo-2011.sqlite
1db0: 3c 2f 62 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e </b></li>..</ul>
1dc0: 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c 76 </li>..</ol>..<v
1dd0: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 erbatim>..SELECT
1de0: 20 43 72 65 61 74 65 54 6f 70 6f 6c 6f 67 79 28 CreateTopology(
1df0: 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 33 32 'census2011', 32
1e00: 36 33 32 2c 20 30 2c 20 30 29 3b 0d 0a 31 0d 0a 632, 0, 0);..1..
1e10: 0d 0a 41 54 54 41 43 48 20 44 41 54 41 42 41 53 ..ATTACH DATABAS
1e20: 45 20 22 2e 2f 74 75 73 63 61 6e 79 2d 63 65 6e E "./tuscany-cen
1e30: 73 75 73 2d 32 30 31 31 2e 73 71 6c 69 74 65 22 sus-2011.sqlite"
1e40: 20 41 53 20 69 73 74 61 74 3b 0d 0a 0d 0a 53 45 AS istat;....SE
1e50: 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 46 72 6f LECT TopoGeo_Fro
1e60: 6d 47 65 6f 54 61 62 6c 65 28 27 63 65 6e 73 75 mGeoTable('censu
1e70: 73 32 30 31 31 27 2c 20 27 69 73 74 61 74 27 2c s2011', 'istat',
1e80: 20 27 63 65 6e 73 75 73 5f 32 30 31 31 27 2c 20 'census_2011',
1e90: 4e 55 4c 4c 2c 20 30 2c 20 35 31 32 2c 20 2d 31 NULL, 0, 512, -1
1ea0: 29 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 );..1....SELECT
1eb0: 53 54 5f 56 61 6c 69 64 61 74 65 54 6f 70 6f 47 ST_ValidateTopoG
1ec0: 65 6f 28 27 63 65 6e 73 75 73 32 30 31 31 27 29 eo('census2011')
1ed0: 3b 0d 0a 4e 55 4c 4c 0d 0a 0d 0a 53 45 4c 45 43 ;..NULL....SELEC
1ee0: 54 20 2a 20 46 52 4f 4d 20 54 45 4d 50 2e 63 65 T * FROM TEMP.ce
1ef0: 6e 73 75 73 32 30 31 31 5f 76 61 6c 69 64 61 74 nsus2011_validat
1f00: 65 5f 74 6f 70 6f 67 65 6f 3b 0d 0a 0d 0a 53 45 e_topogeo;....SE
1f10: 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 43 72 65 LECT TopoGeo_Cre
1f20: 61 74 65 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 ateTopoLayer('ce
1f30: 6e 73 75 73 32 30 31 31 27 2c 20 27 69 73 74 61 nsus2011', 'ista
1f40: 74 27 2c 20 27 63 65 6e 73 75 73 5f 32 30 31 31 t', 'census_2011
1f50: 27 2c 20 4e 55 4c 4c 2c 20 27 63 65 6e 73 75 73 ', NULL, 'census
1f60: 5f 61 72 65 61 73 27 29 3b 0d 0a 31 0d 0a 0d 0a _areas');..1....
1f70: 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 49 SELECT TopoGeo_I
1f80: 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 nitTopoLayer('ce
1f90: 6e 73 75 73 32 30 31 31 27 2c 20 27 69 73 74 61 nsus2011', 'ista
1fa0: 74 27 2c 20 27 70 6f 70 5f 70 70 6c 5f 32 30 31 t', 'pop_ppl_201
1fb0: 31 27 2c 20 27 70 70 6c 27 29 3b 0d 0a 31 0d 0a 1', 'ppl');..1..
1fc0: 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f ..SELECT TopoGeo
1fd0: 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 28 27 _InitTopoLayer('
1fe0: 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 69 73 census2011', 'is
1ff0: 74 61 74 27 2c 20 27 70 6f 70 5f 63 6f 6d 5f 32 tat', 'pop_com_2
2000: 30 31 31 27 2c 20 27 63 6f 6d 27 29 3b 0d 0a 31 011', 'com');..1
2010: 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 ....SELECT TopoG
2020: 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 eo_InitTopoLayer
2030: 28 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 ('census2011', '
2040: 69 73 74 61 74 27 2c 20 27 70 6f 70 5f 70 72 6f istat', 'pop_pro
2050: 76 5f 32 30 31 31 27 2c 20 27 70 72 6f 76 27 29 v_2011', 'prov')
2060: 3b 0d 0a 31 0d 0a 0d 0a 53 45 4c 45 43 54 20 54 ;..1....SELECT T
2070: 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c opoGeo_InitTopoL
2080: 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 31 ayer('census2011
2090: 27 2c 20 27 69 73 74 61 74 27 2c 20 27 70 6f 70 ', 'istat', 'pop
20a0: 5f 72 65 67 5f 32 30 31 31 27 2c 20 27 72 65 67 _reg_2011', 'reg
20b0: 27 29 3b 0d 0a 31 0d 0a 0d 0a 44 45 54 41 43 48 ');..1....DETACH
20c0: 20 44 41 54 41 42 41 53 45 20 69 73 74 61 74 3b DATABASE istat;
20d0: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 ..</verbatim>..W
20e0: 65 27 6c 6c 20 73 74 61 72 74 20 74 68 69 73 20 e'll start this
20f0: 70 72 61 63 74 69 63 61 6c 20 74 75 74 6f 72 69 practical tutori
2100: 61 6c 20 62 79 20 64 75 6c 79 20 72 65 70 6c 69 al by duly repli
2110: 63 61 74 69 6e 67 20 74 68 65 20 73 61 6d 65 20 cating the same
2120: 73 74 65 70 73 20 77 65 27 76 65 20 61 6c 72 65 steps we've alre
2130: 61 64 79 20 65 78 61 6d 69 6e 65 64 20 69 6e 20 ady examined in
2140: 74 68 65 20 69 6e 74 65 72 6d 65 64 69 61 74 65 the intermediate
2150: 20 74 75 74 6f 72 69 61 6c 3a 0d 0a 3c 75 6c 3e tutorial:..<ul>
2160: 0d 0a 3c 6c 69 3e 77 65 27 6c 6c 20 63 72 65 61 ..<li>we'll crea
2170: 74 65 20 61 20 6e 65 77 20 32 44 20 54 6f 70 6f te a new 2D Topo
2180: 6c 6f 67 79 20 6e 61 6d 65 64 20 3c 62 3e 63 65 logy named <b>ce
2190: 6e 73 75 73 32 30 31 31 3c 2f 62 3e 20 61 6e 64 nsus2011</b> and
21a0: 20 6c 6f 63 61 74 65 64 20 69 6e 74 6f 20 3c 62 located into <b
21b0: 3e 53 52 49 44 20 33 32 36 33 32 3c 2f 62 3e 2e >SRID 32632</b>.
21c0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 6e 20 </li>..<li>then
21d0: 77 65 27 6c 6c 20 3c 69 3e 61 74 74 61 63 68 3c we'll <i>attach<
21e0: 2f 69 3e 20 74 68 65 20 3c 62 3e 74 75 73 63 61 /i> the <b>tusca
21f0: 6e 79 2d 74 6f 70 6f 2d 32 30 31 31 2e 73 71 6c ny-topo-2011.sql
2200: 69 74 65 3c 2f 62 3e 20 65 78 74 65 72 6e 61 6c ite</b> external
2210: 20 44 42 2d 66 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a DB-file.</li>..
2220: 3c 6c 69 3e 6e 6f 77 20 77 65 27 6c 6c 20 70 6f <li>now we'll po
2230: 70 75 6c 61 74 65 20 74 68 65 20 3c 62 3e 63 65 pulate the <b>ce
2240: 6e 73 75 73 32 30 31 31 3c 2f 62 3e 20 54 6f 70 nsus2011</b> Top
2250: 6f 6c 6f 67 79 20 62 79 20 69 6d 70 6f 72 74 69 ology by importi
2260: 6e 67 20 74 68 65 20 3c 62 3e 69 73 74 61 74 2e ng the <b>istat.
2270: 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20 census_2011</b>
2280: 47 65 6f 54 61 62 6c 65 2c 20 61 6e 64 20 74 68 GeoTable, and th
2290: 65 6e 20 77 65 27 6c 6c 20 69 6d 6d 65 64 69 61 en we'll immedia
22a0: 74 65 6c 79 20 63 68 65 63 6b 20 69 66 20 74 68 tely check if th
22b0: 69 73 20 54 6f 70 6f 6c 6f 67 79 20 69 73 20 66 is Topology is f
22c0: 75 6c 6c 79 20 76 61 6c 69 64 2e 3c 2f 6c 69 3e ully valid.</li>
22d0: 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 4e 6f 77 ..</ul><br>..Now
22e0: 20 77 65 20 61 72 65 20 66 69 6e 61 6c 6c 79 20 we are finally
22f0: 72 65 61 64 79 20 74 6f 20 73 74 61 72 74 20 64 ready to start d
2300: 65 66 69 6e 69 6e 67 20 61 6c 6c 20 3c 62 3e 54 efining all <b>T
2310: 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 62 61 opoLayers</b> ba
2320: 73 65 64 20 6f 6e 20 74 68 65 20 3c 62 3e 63 65 sed on the <b>ce
2330: 6e 73 75 73 32 30 31 31 3c 2f 62 3e 20 54 6f 70 nsus2011</b> Top
2340: 6f 6c 6f 67 79 3b 20 65 61 63 68 20 73 69 6e 67 ology; each sing
2350: 6c 65 20 54 6f 70 6f 4c 61 79 65 72 20 77 69 6c le TopoLayer wil
2360: 6c 20 70 72 65 63 69 73 65 6c 79 20 72 65 70 72 l precisely repr
2370: 65 73 65 6e 74 20 73 6f 6d 65 20 61 64 6d 69 6e esent some admin
2380: 69 73 74 72 61 74 69 76 65 20 6c 65 76 65 6c 2c istrative level,
2390: 20 61 6e 64 20 61 6c 6c 20 54 6f 70 6f 4c 61 79 and all TopoLay
23a0: 65 72 73 20 61 6c 74 6f 67 65 74 68 65 72 20 77 ers altogether w
23b0: 69 6c 6c 20 63 6f 6d 70 6c 65 74 65 6c 79 20 72 ill completely r
23c0: 65 70 72 65 73 65 6e 74 20 74 68 65 20 77 68 6f epresent the who
23d0: 6c 65 20 54 75 73 63 61 6e 20 61 64 6d 69 6e 69 le Tuscan admini
23e0: 73 74 72 61 74 69 76 65 20 68 69 65 72 61 72 63 strative hierarc
23f0: 68 79 2e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 73 hy...<ol>..<li>s
2400: 6f 20 77 65 27 6c 6c 20 64 75 6c 79 20 69 6e 76 o we'll duly inv
2410: 6f 6b 65 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 oke <b>TopoGeo_C
2420: 72 65 61 74 65 54 6f 70 6f 4c 61 79 65 72 28 29 reateTopoLayer()
2430: 3c 2f 62 3e 20 69 6e 20 6f 72 64 65 72 20 74 6f </b> in order to
2440: 20 63 6f 6d 70 6c 65 74 65 6c 79 20 64 65 66 69 completely defi
2450: 6e 65 20 61 20 66 69 72 73 74 20 54 6f 70 6f 4c ne a first TopoL
2460: 61 79 65 72 20 72 65 70 72 65 73 65 6e 74 69 6e ayer representin
2470: 67 20 3c 62 3e 43 65 6e 73 75 73 20 41 72 65 61 g <b>Census Area
2480: 73 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 52 s</b>.<br>..<u>R
2490: 65 63 61 6c 6c 3c 2f 75 3e 3a 20 74 68 65 20 3c ecall</u>: the <
24a0: 62 3e 69 73 74 61 74 2e 63 65 6e 73 75 73 5f 32 b>istat.census_2
24b0: 30 31 31 3c 2f 62 3e 20 69 73 20 74 68 65 20 75 011</b> is the u
24c0: 6e 69 71 75 65 20 72 65 61 6c 20 47 65 6f 54 61 nique real GeoTa
24d0: 62 6c 65 20 77 65 20 68 61 76 65 20 69 6e 20 6f ble we have in o
24e0: 75 72 20 69 6e 69 74 69 61 6c 20 64 61 74 61 73 ur initial datas
24f0: 65 74 2c 20 62 65 63 61 75 73 65 20 69 74 20 63 et, because it c
2500: 6f 6e 74 61 69 6e 73 20 62 6f 74 68 20 69 6e 66 ontains both inf
2510: 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75 ormation attribu
2520: 74 65 73 20 61 6e 64 20 67 65 6f 6d 65 74 72 69 tes and geometri
2530: 65 73 3b 20 61 6e 64 20 65 61 63 68 20 43 65 6e es; and each Cen
2540: 73 75 73 20 41 72 65 61 20 69 73 20 65 78 70 65 sus Area is expe
2550: 63 74 65 64 20 74 6f 20 64 69 72 65 63 74 6c 79 cted to directly
2560: 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 6f 20 61 correspond to a
2570: 20 73 69 6e 67 6c 65 20 54 6f 70 6f 6c 6f 67 79 single Topology
2580: 20 46 61 63 65 2e 20 28 3c 69 3e 77 65 27 6c 6c Face. (<i>we'll
2590: 20 65 78 61 6d 69 6e 65 20 6c 61 74 65 72 20 69 examine later i
25a0: 6e 20 6d 6f 72 65 20 64 65 70 74 68 20 68 6f 77 n more depth how
25b0: 20 54 6f 70 6f 4c 61 79 65 72 20 2f 20 54 6f 70 TopoLayer / Top
25c0: 6f 46 65 61 74 75 72 65 20 72 65 6c 61 74 69 6f oFeature relatio
25d0: 6e 73 68 69 70 73 20 68 61 76 65 20 62 65 65 6e nships have been
25e0: 20 61 63 74 75 61 6c 6c 79 20 64 65 66 69 6e 65 actually define
25f0: 64 3c 2f 69 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c d</i>).</li>..<l
2600: 69 3e 74 68 65 6e 20 77 65 27 6c 6c 20 63 6f 6e i>then we'll con
2610: 74 69 6e 75 65 20 62 79 20 64 65 66 69 6e 69 6e tinue by definin
2620: 67 20 73 65 76 65 72 61 6c 20 66 75 72 74 68 65 g several furthe
2630: 72 20 54 6f 70 6f 4c 61 79 65 72 73 20 72 65 73 r TopoLayers res
2640: 70 65 63 74 69 76 65 6c 79 20 63 6f 72 72 65 73 pectively corres
2650: 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 50 6f ponding to <b>Po
2660: 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73 3c 2f pulated Places</
2670: 62 3e 2c 20 3c 62 3e 4d 75 6e 69 63 69 70 61 6c b>, <b>Municipal
2680: 69 74 69 65 73 3c 2f 62 3e 2c 20 3c 62 3e 50 72 ities</b>, <b>Pr
2690: 6f 76 69 6e 63 65 73 3c 2f 62 3e 20 61 6e 64 20 ovinces</b> and
26a0: 3c 62 3e 52 65 67 69 6f 6e 3c 2f 62 3e 20 61 64 <b>Region</b> ad
26b0: 6d 69 6e 69 73 74 72 61 74 69 76 65 20 6c 65 76 ministrative lev
26c0: 65 6c 73 2e 3c 62 72 3e 0d 0a 3c 75 3e 52 65 63 els.<br>..<u>Rec
26d0: 61 6c 6c 3c 2f 75 3e 3a 20 61 6c 6c 20 74 68 65 all</u>: all the
26e0: 73 65 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 se administrativ
26f0: 65 20 6c 65 76 65 6c 73 20 69 6e 20 74 68 65 20 e levels in the
2700: 69 6e 69 74 69 61 6c 20 64 61 74 61 73 65 74 20 initial dataset
2710: 61 72 65 20 73 69 6d 70 6c 79 20 64 65 66 69 6e are simply defin
2720: 65 64 20 62 79 20 72 65 6c 61 74 69 6f 6e 61 6c ed by relational
2730: 20 63 6f 64 65 73 20 69 6e 74 65 6e 64 65 64 20 codes intended
2740: 74 6f 20 61 67 67 72 65 67 61 74 65 20 6c 6f 77 to aggregate low
2750: 65 72 20 6c 65 76 65 6c 20 65 6e 74 69 74 69 65 er level entitie
2760: 73 3b 20 69 6e 20 74 68 69 73 20 63 61 73 65 20 s; in this case
2770: 74 68 65 72 65 20 61 72 65 20 6e 6f 20 65 78 70 there are no exp
2780: 6c 69 63 69 74 20 67 65 6f 6d 65 74 72 69 65 73 licit geometries
2790: 20 61 74 20 61 6c 6c 2e 20 53 6f 20 61 72 65 20 at all. So are
27a0: 61 72 65 20 6e 6f 74 20 64 69 72 65 63 74 6c 79 are not directly
27b0: 20 61 6c 6c 6f 77 65 64 20 74 6f 20 63 72 65 61 allowed to crea
27c0: 74 65 20 61 20 66 75 6c 6c 79 20 64 65 66 69 6e te a fully defin
27d0: 65 64 20 54 6f 70 6f 4c 61 79 65 72 2c 20 61 6e ed TopoLayer, an
27e0: 64 20 63 61 6c 6c 69 6e 67 20 3c 62 3e 54 6f 70 d calling <b>Top
27f0: 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f 6c oGeo_CreateTopol
2800: 61 79 65 72 28 29 3c 2f 62 3e 20 69 73 20 6a 75 ayer()</b> is ju
2810: 73 74 20 69 6d 70 6f 73 73 69 62 6c 65 20 62 65 st impossible be
2820: 63 61 75 73 65 20 77 65 20 6c 61 63 6b 20 61 6e cause we lack an
2830: 79 20 61 70 70 72 6f 70 72 69 61 74 65 20 47 65 y appropriate Ge
2840: 6f 6d 65 74 72 79 20 63 6f 6c 75 6d 6e 2e 3c 62 ometry column.<b
2850: 72 3e 0d 0a 41 6e 79 77 61 79 20 77 65 20 63 61 r>..Anyway we ca
2860: 6e 20 69 6e 76 6f 6b 65 20 3c 62 3e 54 6f 70 6f n invoke <b>Topo
2870: 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 Geo_InitTopoLaye
2880: 72 28 29 3c 2f 62 3e 3b 20 74 68 69 73 20 77 69 r()</b>; this wi
2890: 6c 6c 20 69 6e 69 74 69 61 6c 69 7a 65 20 61 6e ll initialize an
28a0: 20 6f 6e 6c 79 20 70 61 72 74 69 61 6c 6c 79 20 only partially
28b0: 64 65 66 69 6e 65 64 20 54 6f 70 6f 4c 61 79 65 defined TopoLaye
28c0: 72 2c 20 62 75 74 20 77 65 20 63 61 6e 20 65 61 r, but we can ea
28d0: 73 69 6c 79 20 63 6f 6d 70 6c 65 74 65 20 69 6e sily complete in
28e0: 20 61 20 73 65 63 6f 6e 64 20 74 69 6d 65 20 61 a second time a
28f0: 6e 79 20 6d 69 73 73 69 6e 67 20 69 6e 66 6f 72 ny missing infor
2900: 6d 61 74 69 6f 6e 20 73 6f 20 74 6f 20 67 65 74 mation so to get
2910: 20 61 20 70 72 6f 70 65 72 6c 79 20 77 6f 72 6b a properly work
2920: 69 6e 67 20 54 6f 70 6f 4c 61 79 65 72 20 28 3c ing TopoLayer (<
2930: 69 3e 61 73 20 77 65 27 6c 6c 20 73 65 65 20 6c i>as we'll see l
2940: 61 74 65 72 20 69 6e 20 66 75 6c 6c 20 64 65 74 ater in full det
2950: 61 69 6c 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e ail).</li>..<li>
2960: 66 69 6e 61 6c 6c 79 20 77 65 27 6c 6c 20 3c 69 finally we'll <i
2970: 3e 64 65 74 61 63 68 3c 2f 69 3e 20 74 68 65 20 >detach</i> the
2980: 6e 6f 77 20 75 73 65 6c 65 73 73 20 65 78 74 65 now useless exte
2990: 72 6e 61 6c 20 64 62 2d 66 69 6c 65 2e 3c 2f 6c rnal db-file.</l
29a0: 69 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c 68 72 3e 0d i>..</ol>..<hr>.
29b0: 0a 3c 68 33 3e 54 6f 70 6f 4c 61 79 65 72 73 20 .<h3>TopoLayers
29c0: 2f 20 54 6f 70 6f 46 65 61 74 75 72 65 73 3a 20 / TopoFeatures:
29d0: 6c 61 79 6f 75 74 20 6f 66 20 44 42 20 54 61 62 layout of DB Tab
29e0: 6c 65 73 20 61 6e 64 20 63 6f 72 72 65 73 70 6f les and correspo
29f0: 6e 64 69 6e 67 20 72 65 6c 61 74 69 6f 6e 73 68 nding relationsh
2a00: 69 70 73 3c 2f 68 33 3e 0d 0a 3c 74 61 62 6c 65 ips</h3>..<table
2a10: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 cellpadding="6"
2a20: 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d 22 38 22 cellspacing="8"
2a30: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e >..<tr><td>..<b>
2a40: 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c <<i>topo-prefix<
2a50: 2f 69 3e 3e 5f 74 6f 70 6f 6c 61 79 65 72 73 3c /i>>_topolayers<
2a60: 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d /b>..<verbatim>.
2a70: 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 63 .SELECT * FROM c
2a80: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 6c 61 ensus2011_topola
2a90: 79 65 72 73 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 yers;..</verbati
2aa0: 6d 3e 0d 0a 54 68 65 20 3c 62 3e 54 6f 70 6f 4c m>..The <b>TopoL
2ab0: 61 79 65 72 73 3c 2f 62 3e 20 74 61 62 6c 65 20 ayers</b> table
2ac0: 63 6f 6e 74 61 69 6e 73 20 61 20 64 69 73 74 69 contains a disti
2ad0: 6e 63 74 20 72 6f 77 20 66 6f 72 20 65 76 65 72 nct row for ever
2ae0: 79 20 54 6f 70 6f 4c 61 79 65 72 20 64 65 66 69 y TopoLayer defi
2af0: 6e 65 64 20 6f 6e 20 74 68 65 20 63 75 72 72 65 ned on the curre
2b00: 6e 74 20 54 6f 70 6f 6c 6f 67 79 2e 3c 62 72 3e nt Topology.<br>
2b10: 3c 62 72 3e 0d 0a 45 61 63 68 20 54 6f 70 6f 4c <br>..Each TopoL
2b20: 61 79 65 72 20 69 73 20 69 64 65 6e 74 69 66 69 ayer is identifi
2b30: 65 64 20 62 79 20 61 6e 20 3c 62 3e 69 64 3c 2f ed by an <b>id</
2b40: 62 3e 20 61 6e 64 20 62 79 20 61 20 3c 62 3e 6e b> and by a <b>n
2b50: 61 6d 65 3c 2f 62 3e 3b 20 62 6f 74 68 20 61 72 ame</b>; both ar
2b60: 65 20 72 65 71 75 69 72 65 64 20 74 6f 20 62 79 e required to by
2b70: 20 75 6e 69 71 75 65 20 76 61 6c 75 65 73 2e 0d unique values..
2b80: 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 22 3c 69 3e .</td><td>.."<i>
2b90: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 6c census2011_topol
2ba0: 61 79 65 72 73 3c 2f 69 3e 22 0d 0a 3c 74 61 62 ayers</i>"..<tab
2bb0: 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 le cellspan="4"
2bc0: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 cellpadding="6"
2bd0: 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 bgcolor="#f8f8f0
2be0: 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c " border="1">..<
2bf0: 74 72 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 tr><td bgcolor="
2c00: 23 66 30 66 30 66 38 22 3e 3c 62 3e 74 6f 70 6f #f0f0f8"><b>topo
2c10: 6c 61 79 65 72 5f 69 64 3c 2f 62 3e 3c 2f 74 64 layer_id</b></td
2c20: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
2c30: 23 66 30 66 30 66 38 22 3e 3c 62 3e 74 6f 70 6f #f0f0f8"><b>topo
2c40: 6c 61 79 65 72 5f 6e 61 6d 65 3c 2f 62 3e 3c 2f layer_name</b></
2c50: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
2c60: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
2c70: 31 3c 2f 74 64 3e 3c 74 64 3e 63 65 6e 73 75 73 1</td><td>census
2c80: 5f 61 72 65 61 73 3c 2f 74 64 3e 3c 2f 74 72 3e _areas</td></tr>
2c90: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d ..<tr><td align=
2ca0: 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 "right">2</td><t
2cb0: 64 3e 70 70 6c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d d>ppl</td></tr>.
2cc0: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 .<tr><td align="
2cd0: 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 right">3</td><td
2ce0: 3e 63 6f 6d 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a >com</td></tr>..
2cf0: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
2d00: 69 67 68 74 22 3e 34 3c 2f 74 64 3e 3c 74 64 3e ight">4</td><td>
2d10: 70 72 6f 76 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a prov</td></tr>..
2d20: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
2d30: 69 67 68 74 22 3e 35 3c 2f 74 64 3e 3c 74 64 3e ight">5</td><td>
2d40: 72 65 67 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c reg</td></tr>..<
2d50: 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f /table>..</td></
2d60: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c tr>..<tr><td>..<
2d70: 62 3e 3c 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 b><<i>topo-prefi
2d80: 78 3c 2f 69 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 x</i>>_topofeatu
2d90: 72 65 73 5f 3c 3c 69 3e 74 6f 70 6f 6c 61 79 65 res_<<i>topolaye
2da0: 72 2d 69 64 3c 2f 69 3e 3e 3c 2f 62 3e 0d 0a 3c r-id</i>></b>..<
2db0: 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 verbatim>..SELEC
2dc0: 54 20 2a 20 46 52 4f 4d 20 63 65 6e 73 75 73 32 T * FROM census2
2dd0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 011_topofeatures
2de0: 5f 32 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 2a 20 _2;....SELECT *
2df0: 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f FROM census2011_
2e00: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 3b 0d topofeatures_4;.
2e10: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 .</verbatim>..Th
2e20: 65 20 73 61 6d 65 20 54 6f 70 6f 6c 6f 67 79 20 e same Topology
2e30: 63 61 6e 20 63 6f 6e 74 61 69 6e 20 6d 6f 72 65 can contain more
2e40: 20 74 68 61 6e 20 61 20 73 69 6e 67 6c 65 20 3c than a single <
2e50: 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 3c 2f b>TopoFeatures</
2e60: 62 3e 20 74 61 62 6c 65 2c 20 61 6e 64 20 65 61 b> table, and ea
2e70: 63 68 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 ch TopoFeatures
2e80: 74 61 62 6c 65 20 63 6f 72 72 65 73 70 6f 6e 64 table correspond
2e90: 73 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 54 6f s to a single To
2ea0: 70 6f 4c 61 79 65 72 2e 3c 62 72 3e 0d 0a 45 76 poLayer.<br>..Ev
2eb0: 65 72 79 20 74 61 62 6c 65 20 6f 6e 65 20 68 61 ery table one ha
2ec0: 73 20 61 20 73 70 65 63 69 66 69 63 20 6c 61 79 s a specific lay
2ed0: 6f 75 74 20 6f 6e 20 69 74 73 20 6f 77 6e 20 28 out on its own (
2ee0: 73 74 72 69 63 74 6c 79 20 72 65 66 6c 65 63 74 strictly reflect
2ef0: 69 6e 67 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 ing the informat
2f00: 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 20 66 ion attributes f
2f10: 6f 72 20 65 61 63 68 20 6c 61 79 65 72 29 2c 20 or each layer),
2f20: 61 6e 79 77 61 79 20 61 6c 6c 20 74 68 65 6d 20 anyway all them
2f30: 77 69 6c 6c 20 68 61 76 65 20 61 20 3c 62 3e 75 will have a <b>u
2f40: 6e 69 71 75 65 20 54 6f 70 6f 46 65 61 74 75 72 nique TopoFeatur
2f50: 65 20 69 64 65 6e 74 69 66 69 65 72 3c 2f 62 3e e identifier</b>
2f60: 20 28 3c 62 3e 3c 69 3e 66 69 64 3c 2f 69 3e 3c (<b><i>fid</i><
2f70: 2f 62 3e 29 20 61 63 74 69 6e 67 20 69 6e 20 74 /b>) acting in t
2f80: 68 65 20 50 72 69 6d 61 72 79 20 4b 65 79 20 72 he Primary Key r
2f90: 6f 6c 65 2e 3c 62 72 3e 0d 0a 54 68 65 20 63 6f ole.<br>..The co
2fa0: 72 72 65 73 70 6f 6e 64 65 6e 63 65 20 62 65 74 rrespondence bet
2fb0: 77 65 65 6e 20 74 61 62 6c 65 20 6e 61 6d 65 73 ween table names
2fc0: 20 61 6e 64 20 54 6f 70 6f 4c 61 79 65 72 73 20 and TopoLayers
2fd0: 69 73 20 65 73 74 61 62 6c 69 73 68 65 64 20 62 is established b
2fe0: 79 20 61 70 70 65 6e 64 69 6e 67 20 61 20 6e 75 y appending a nu
2ff0: 6d 65 72 69 63 20 73 75 66 66 69 78 20 74 6f 20 meric suffix to
3000: 74 68 65 20 63 6f 6d 6d 6f 6e 20 6e 61 6d 65 20 the common name
3010: 74 68 61 74 20 6d 75 73 74 20 65 78 61 63 74 6c that must exactl
3020: 79 20 6d 61 74 63 68 20 74 68 65 20 3c 62 3e 74 y match the <b>t
3030: 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 3e 20 opolayer_id</b>
3040: 76 61 6c 75 65 20 64 65 63 6c 61 72 65 64 20 69 value declared i
3050: 6e 20 74 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 79 n the <b>TopoLay
3060: 65 72 73 3c 2f 62 3e 20 6d 61 69 6e 20 74 61 62 ers</b> main tab
3070: 6c 65 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 41 73 20 le.<br><br>..As
3080: 69 73 20 73 68 6f 77 6e 20 69 6e 20 74 68 69 73 is shown in this
3090: 20 65 78 61 6d 70 6c 65 20 74 68 65 20 66 69 72 example the fir
30a0: 73 74 20 74 61 62 6c 65 20 3c 62 3e 63 65 6e 73 st table <b>cens
30b0: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 us2011_topofeatu
30c0: 72 65 73 5f 32 3c 2f 62 3e 20 28 3c 69 3e 74 6f res_2</b> (<i>to
30d0: 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 69 3e 3d 3c polayer_id</i>=<
30e0: 69 3e 32 3c 2f 69 3e 29 20 63 6f 6e 74 61 69 6e i>2</i>) contain
30f0: 73 20 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 s all TopoFeatur
3100: 65 73 20 61 73 73 6f 63 69 61 74 65 64 20 74 6f es associated to
3110: 20 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20 3c the TopoLayer <
3120: 62 3e 70 70 6c 3c 2f 62 3e 20 28 3c 69 3e 50 6f b>ppl</b> (<i>Po
3130: 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73 3c 2f pulated Places</
3140: 69 3e 29 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 54 68 i>).<br><br>..Th
3150: 65 20 73 65 63 6f 6e 64 20 74 61 62 6c 65 20 3c e second table <
3160: 62 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 b>census2011_top
3170: 6f 66 65 61 74 75 72 65 73 5f 34 3c 2f 62 3e 20 ofeatures_4</b>
3180: 28 3c 69 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 (<i>topolayer_id
3190: 3c 2f 69 3e 3d 3c 69 3e 34 3c 2f 69 3e 29 20 63 </i>=<i>4</i>) c
31a0: 6f 6e 74 61 69 6e 73 20 61 6c 6c 20 54 6f 70 6f ontains all Topo
31b0: 46 65 61 74 75 72 65 73 20 61 73 73 6f 63 69 61 Features associa
31c0: 74 65 64 20 74 6f 20 74 68 65 20 54 6f 70 6f 4c ted to the TopoL
31d0: 61 79 65 72 20 3c 62 3e 70 72 6f 76 3c 2f 62 3e ayer <b>prov</b>
31e0: 20 28 3c 69 3e 50 72 6f 76 69 6e 63 65 73 3c 2f (<i>Provinces</
31f0: 69 3e 29 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d i>)...</td><td>.
3200: 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f ."<i>census2011_
3210: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 3c 2f topofeatures_2</
3220: 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c i>"..<table cell
3230: 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 span="4" cellpad
3240: 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 ding="6" bgcolor
3250: 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 ="#f8f8f0" borde
3260: 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 r="1">..<tr><td
3270: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 bgcolor="#f0f0f8
3280: 22 3e 3c 62 3e 66 69 64 3c 2f 62 3e 3c 2f 74 64 "><b>fid</b></td
3290: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
32a0: 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f #f0f0f8"><b>cod_
32b0: 70 70 6c 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 ppl</b></td>..<t
32c0: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
32d0: 66 38 22 3e 3c 62 3e 63 6f 64 5f 63 6f 6d 3c 2f f8"><b>cod_com</
32e0: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 b></td>..<td bgc
32f0: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c olor="#f0f0f8"><
3300: 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 0d b>name</b></td>.
3310: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 .<td bgcolor="#f
3320: 30 66 30 66 38 22 3e 3c 62 3e 70 6f 70 5f 32 30 0f0f8"><b>pop_20
3330: 31 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 11</b></td>..<td
3340: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
3350: 38 22 3e 3c 62 3e 6d 5f 32 30 31 31 3c 2f 62 3e 8"><b>m_2011</b>
3360: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c </td>..<td bgcol
3370: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e or="#f0f0f8"><b>
3380: 66 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 3c f_2011</b></td><
3390: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c /tr>..<tr><td al
33a0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 ign="right">1</t
33b0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
33c0: 68 74 22 3e 32 30 35 31 34 32 37 30 35 3c 2f 74 ht">205142705</t
33d0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
33e0: 68 74 22 3e 34 35 30 30 31 3c 2f 74 64 3e 3c 74 ht">45001</td><t
33f0: 64 3e 41 6c 62 69 61 6e 6f 20 4d 61 67 72 61 3c d>Albiano Magra<
3400: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3410: 69 67 68 74 22 3e 31 39 30 37 3c 2f 74 64 3e 3c ight">1907</td><
3420: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3430: 3e 39 31 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 >919</td><td ali
3440: 67 6e 3d 22 72 69 67 68 74 22 3e 39 38 38 3c 2f gn="right">988</
3450: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
3460: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3470: 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 2</td><td align=
3480: 22 72 69 67 68 74 22 3e 32 30 35 31 34 32 37 30 "right">20514270
3490: 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 6</td><td align=
34a0: 22 72 69 67 68 74 22 3e 34 35 30 30 31 3c 2f 74 "right">45001</t
34b0: 64 3e 3c 74 64 3e 41 75 6c 6c 61 3c 2f 74 64 3e d><td>Aulla</td>
34c0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
34d0: 22 3e 34 33 32 31 3c 2f 74 64 3e 3c 74 64 20 61 ">4321</td><td a
34e0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 34 lign="right">204
34f0: 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 6</td><td align=
3500: 22 72 69 67 68 74 22 3e 32 32 37 35 3c 2f 74 64 "right">2275</td
3510: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 ></tr>..<tr><td
3520: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c align="right">3<
3530: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3540: 69 67 68 74 22 3e 32 30 35 31 34 32 37 31 30 3c ight">205142710<
3550: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3560: 69 67 68 74 22 3e 34 35 30 30 31 3c 2f 74 64 3e ight">45001</td>
3570: 3c 74 64 3e 43 61 70 72 69 67 6c 69 6f 6c 61 3c <td>Caprigliola<
3580: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3590: 69 67 68 74 22 3e 34 38 32 3c 2f 74 64 3e 3c 74 ight">482</td><t
35a0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
35b0: 32 32 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 226</td><td alig
35c0: 6e 3d 22 72 69 67 68 74 22 3e 32 35 36 3c 2f 74 n="right">256</t
35d0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
35e0: 20 63 6f 6c 73 70 61 6e 3d 22 37 22 20 61 6c 69 colspan="7" ali
35f0: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 68 72 3e gn="center"><hr>
3600: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
3610: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3620: 22 3e 31 30 31 38 3c 2f 74 64 3e 3c 74 64 20 61 ">1018</td><td a
3630: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 34 31 lign="right">141
3640: 30 37 37 35 34 31 35 3c 2f 74 64 3e 3c 74 64 20 0775415</td><td
3650: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 align="right">10
3660: 30 30 30 37 3c 2f 74 64 3e 3c 74 64 3e 53 61 73 0007</td><td>Sas
3670: 73 65 74 61 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 seta</td><td ali
3680: 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 35 3c 2f gn="right">285</
3690: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
36a0: 67 68 74 22 3e 31 33 37 3c 2f 74 64 3e 3c 74 64 ght">137</td><td
36b0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
36c0: 34 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 48</td></tr>..<t
36d0: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
36e0: 68 74 22 3e 31 30 31 39 3c 2f 74 64 3e 3c 74 64 ht">1019</td><td
36f0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
3700: 34 31 30 37 38 35 34 31 35 3c 2f 74 64 3e 3c 74 410785415</td><t
3710: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3720: 31 30 30 30 30 37 3c 2f 74 64 3e 3c 74 64 3e 54 100007</td><td>T
3730: 65 72 72 69 67 6f 6c 69 3c 2f 74 64 3e 3c 74 64 errigoli</td><td
3740: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 align="right">5
3750: 33 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 37</td><td align
3760: 3d 22 72 69 67 68 74 22 3e 32 36 34 3c 2f 74 64 ="right">264</td
3770: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3780: 74 22 3e 32 37 33 3c 2f 74 64 3e 3c 2f 74 72 3e t">273</td></tr>
3790: 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 62 72 3e ..</table>..<br>
37a0: 0d 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 .."<i>census2011
37b0: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 3c _topofeatures_4<
37c0: 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c /i>"..<table cel
37d0: 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 lspan="4" cellpa
37e0: 64 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f dding="6" bgcolo
37f0: 72 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 r="#f8f8f0" bord
3800: 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 er="1">..<tr><td
3810: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
3820: 38 22 3e 3c 62 3e 66 69 64 3c 2f 62 3e 3c 2f 74 8"><b>fid</b></t
3830: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d d>..<td bgcolor=
3840: 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 "#f0f0f8"><b>cod
3850: 5f 70 72 6f 76 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a _prov</b></td>..
3860: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 <td bgcolor="#f0
3870: 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 72 65 67 f0f8"><b>cod_reg
3880: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 </b></td>..<td b
3890: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 gcolor="#f0f0f8"
38a0: 3e 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 ><b>name</b></td
38b0: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
38c0: 23 66 30 66 30 66 38 22 3e 3c 62 3e 61 62 62 72 #f0f0f8"><b>abbr
38d0: 65 76 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 ev</b></td>..<td
38e0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
38f0: 38 22 3e 3c 62 3e 70 6f 70 5f 32 30 31 31 3c 2f 8"><b>pop_2011</
3900: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 b></td>..<td bgc
3910: 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c olor="#f0f0f8"><
3920: 62 3e 6d 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 b>m_2011</b></td
3930: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
3940: 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 5f 32 30 #f0f0f8"><b>f_20
3950: 31 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 11</b></td></tr>
3960: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d ..<tr><td align=
3970: 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 "right">1</td><t
3980: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3990: 34 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 45</td><td align
39a0: 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c ="right">9</td><
39b0: 74 64 3e 4d 61 73 73 61 26 6e 62 73 70 3b 43 61 td>Massa Ca
39c0: 72 72 61 72 61 3c 2f 74 64 3e 3c 74 64 3e 4d 53 rrara</td><td>MS
39d0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
39e0: 72 69 67 68 74 22 3e 31 39 39 36 35 30 3c 2f 74 right">199650</t
39f0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3a00: 68 74 22 3e 39 35 37 35 34 3c 2f 74 64 3e 3c 74 ht">95754</td><t
3a10: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3a20: 31 30 33 38 39 36 3c 2f 74 64 3e 3c 2f 74 72 3e 103896</td></tr>
3a30: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d ..<tr><td align=
3a40: 22 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 "right">2</td><t
3a50: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3a60: 34 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 46</td><td align
3a70: 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c ="right">9</td><
3a80: 74 64 3e 4c 75 63 63 61 3c 2f 74 64 3e 3c 74 64 td>Lucca</td><td
3a90: 3e 4c 55 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 >LU</td><td alig
3aa0: 6e 3d 22 72 69 67 68 74 22 3e 33 38 38 33 32 37 n="right">388327
3ab0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3ac0: 72 69 67 68 74 22 3e 31 38 36 31 38 33 3c 2f 74 right">186183</t
3ad0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3ae0: 68 74 22 3e 32 30 32 31 34 34 3c 2f 74 64 3e 3c ht">202144</td><
3af0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c /tr>..<tr><td al
3b00: 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 ign="right">3</t
3b10: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3b20: 68 74 22 3e 34 37 3c 2f 74 64 3e 3c 74 64 20 61 ht">47</td><td a
3b30: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f lign="right">9</
3b40: 74 64 3e 3c 74 64 3e 50 69 73 74 6f 69 61 3c 2f td><td>Pistoia</
3b50: 74 64 3e 3c 74 64 3e 50 54 3c 2f 74 64 3e 3c 74 td><td>PT</td><t
3b60: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3b70: 32 38 37 38 36 36 3c 2f 74 64 3e 3c 74 64 20 61 287866</td><td a
3b80: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 33 38 lign="right">138
3b90: 30 35 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 054</td><td alig
3ba0: 6e 3d 22 72 69 67 68 74 22 3e 31 34 39 38 31 32 n="right">149812
3bb0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
3bc0: 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 38 22 20 <td colspan="8"
3bd0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c align="center"><
3be0: 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c hr></td></tr>..<
3bf0: 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 tr><td align="ri
3c00: 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 20 61 ght">9</td><td a
3c10: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 33 3c lign="right">53<
3c20: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3c30: 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e ight">9</td><td>
3c40: 47 72 6f 73 73 65 74 6f 3c 2f 74 64 3e 3c 74 64 Grosseto</td><td
3c50: 3e 47 52 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 >GR</td><td alig
3c60: 6e 3d 22 72 69 67 68 74 22 3e 32 32 30 35 36 34 n="right">220564
3c70: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3c80: 72 69 67 68 74 22 3e 31 30 35 35 38 35 3c 2f 74 right">105585</t
3c90: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3ca0: 68 74 22 3e 31 31 34 39 37 39 3c 2f 74 64 3e 3c ht">114979</td><
3cb0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c /tr>..<tr><td al
3cc0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 3c 2f ign="right">10</
3cd0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3ce0: 67 68 74 22 3e 31 30 30 3c 2f 74 64 3e 3c 74 64 ght">100</td><td
3cf0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 align="right">9
3d00: 3c 2f 74 64 3e 3c 74 64 3e 50 72 61 74 6f 3c 2f </td><td>Prato</
3d10: 74 64 3e 3c 74 64 3e 50 4f 3c 2f 74 64 3e 3c 74 td><td>PO</td><t
3d20: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3d30: 32 34 35 39 31 36 3c 2f 74 64 3e 3c 74 64 20 61 245916</td><td a
3d40: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 31 39 lign="right">119
3d50: 30 38 38 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 088</td><td alig
3d60: 6e 3d 22 72 69 67 68 74 22 3e 31 32 36 38 32 38 n="right">126828
3d70: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 </td></tr>..</ta
3d80: 62 6c 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e ble>..</td></tr>
3d90: 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c ..<tr><td>..<b><
3da0: 3c 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f <i>topo-prefix</
3db0: 69 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 i>>_topofeatures
3dc0: 3c 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e </b>..<verbatim>
3dd0: 0d 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 ..SELECT * FROM
3de0: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 census2011_topof
3df0: 65 61 74 75 72 65 73 3b 0d 0a 3c 2f 76 65 72 62 eatures;..</verb
3e00: 61 74 69 6d 3e 0d 0a 54 68 65 20 3c 62 3e 54 6f atim>..The <b>To
3e10: 70 6f 46 65 61 74 75 72 65 73 2d 67 65 6f 6d 65 poFeatures-geome
3e20: 74 72 69 65 73 3c 2f 62 3e 20 74 61 62 6c 65 20 tries</b> table
3e30: 69 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 70 is intended to p
3e40: 65 72 6d 61 6e 65 6e 74 6c 79 20 73 74 6f 72 65 ermanently store
3e50: 20 61 6c 6c 20 72 65 6c 61 74 69 6f 6e 73 20 62 all relations b
3e60: 65 74 77 65 65 6e 20 54 6f 70 6f 46 65 61 74 75 etween TopoFeatu
3e70: 72 65 73 20 61 6e 64 20 54 6f 70 6f 6c 6f 67 79 res and Topology
3e80: 20 70 72 69 6d 69 74 69 76 65 73 20 72 65 71 75 primitives requ
3e90: 69 72 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f ired in order to
3ea0: 20 63 6f 72 72 65 63 74 6c 79 20 62 75 69 6c 64 correctly build
3eb0: 20 74 68 65 20 65 78 70 65 63 74 65 64 20 6f 75 the expected ou
3ec0: 74 70 75 74 20 47 65 6f 6d 65 74 72 79 20 66 6f tput Geometry fo
3ed0: 72 20 65 61 63 68 20 54 6f 70 6f 46 65 61 74 75 r each TopoFeatu
3ee0: 72 65 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c re...<ul>..<li><
3ef0: 62 3e 75 69 64 3c 2f 62 3e 20 69 73 20 74 68 65 b>uid</b> is the
3f00: 20 50 72 69 6d 61 72 79 20 4b 65 79 2c 20 61 6e Primary Key, an
3f10: 64 20 69 73 20 73 69 6d 70 6c 79 20 69 6e 74 65 d is simply inte
3f20: 6e 64 65 64 20 74 6f 20 62 65 20 61 6e 20 75 6e nded to be an un
3f30: 69 71 75 65 20 69 64 65 6e 74 69 66 69 65 72 20 ique identifier
3f40: 66 6f 72 20 65 61 63 68 20 72 6f 77 20 62 75 74 for each row but
3f50: 20 64 6f 65 73 6e 27 74 20 69 6e 74 65 6e 64 73 doesn't intends
3f60: 20 61 6e 79 20 73 70 65 63 69 61 6c 20 6d 65 61 any special mea
3f70: 6e 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e ning.</li>..<li>
3f80: 3c 62 3e 6e 6f 64 65 5f 69 64 3c 2f 62 3e 2c 20 <b>node_id</b>,
3f90: 3c 62 3e 65 64 67 65 5f 69 64 3c 2f 62 3e 20 61 <b>edge_id</b> a
3fa0: 6e 64 20 3c 62 3e 66 61 63 65 5f 69 64 3c 2f 62 nd <b>face_id</b
3fb0: 3e 20 61 72 65 20 46 6f 72 65 69 67 6e 20 4b 65 > are Foreign Ke
3fc0: 79 73 20 64 69 72 65 63 74 6c 79 20 72 65 66 65 ys directly refe
3fd0: 72 65 6e 63 69 6e 67 20 61 20 54 6f 70 6f 6c 6f rencing a Topolo
3fe0: 67 79 20 70 72 69 6d 69 74 69 76 65 3b 20 74 77 gy primitive; tw
3ff0: 6f 20 6f 66 20 74 68 65 73 65 20 76 61 6c 75 65 o of these value
4000: 73 20 61 72 65 20 61 6c 77 61 79 73 20 65 78 70 s are always exp
4010: 65 63 74 65 64 20 74 6f 20 62 65 20 4e 55 4c 4c ected to be NULL
4020: 2c 20 61 6e 64 20 6f 6e 6c 79 20 6f 6e 65 20 69 , and only one i
4030: 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 65 66 s expected to ef
4040: 66 65 63 74 69 76 65 6c 79 20 72 65 66 65 72 65 fectively refere
4050: 6e 63 65 20 61 20 54 6f 70 6f 6c 6f 67 79 20 70 nce a Topology p
4060: 72 69 6d 69 74 69 76 65 20 64 65 70 65 6e 64 69 rimitive dependi
4070: 6e 67 20 6f 6e 20 69 74 73 20 74 79 70 65 2e 3c ng on its type.<
4080: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 74 6f 70 /li>..<li><b>top
4090: 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 3e 20 61 6e olayer_id</b> an
40a0: 64 20 3c 62 3e 66 69 64 3c 2f 62 3e 20 74 6f 67 d <b>fid</b> tog
40b0: 65 74 68 65 72 20 61 72 65 20 69 6e 74 65 6e 64 ether are intend
40c0: 65 64 20 74 6f 20 65 73 74 61 62 6c 69 73 68 20 ed to establish
40d0: 61 20 72 65 6c 61 74 69 6f 6e 61 6c 20 72 65 66 a relational ref
40e0: 65 72 65 6e 63 65 20 74 6f 20 73 6f 6d 65 20 73 erence to some s
40f0: 70 65 63 69 66 69 63 20 54 6f 70 6f 46 65 61 74 pecific TopoFeat
4100: 75 72 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e ure.</li>..</ul>
4110: 0d 0a 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61 6d 70 ..<br>..<u>Examp
4120: 6c 65 20 23 31 3c 2f 75 3e 3a 20 61 6c 6c 20 54 le #1</u>: all T
4130: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 opology primitiv
4140: 65 73 20 64 69 72 65 63 74 6c 79 20 72 65 66 65 es directly refe
4150: 72 65 6e 63 65 64 20 62 79 20 72 6f 77 73 20 64 renced by rows d
4160: 65 63 6c 61 72 69 6e 67 20 3c 62 3e 74 6f 70 6f eclaring <b>topo
4170: 6c 61 79 65 72 5f 69 64 3d 32 3c 2f 62 3e 20 61 layer_id=2</b> a
4180: 6e 64 20 3c 62 3e 66 69 64 3d 33 3c 2f 62 3e 20 nd <b>fid=3</b>
4190: 6d 75 73 74 20 62 65 20 61 67 67 72 65 67 61 74 must be aggregat
41a0: 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 62 ed in order to b
41b0: 75 69 6c 64 20 74 68 65 20 6f 75 74 70 75 74 20 uild the output
41c0: 47 65 6f 6d 65 74 72 79 20 63 6f 72 72 65 73 70 Geometry corresp
41d0: 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20 50 6f onding to the Po
41e0: 70 75 6c 61 74 65 64 20 50 6c 61 63 65 20 6f 66 pulated Place of
41f0: 20 3c 62 3e 43 61 70 72 69 67 6c 69 6f 6c 61 3c <b>Caprigliola<
4200: 2f 62 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 45 78 61 /b>.<br>..<u>Exa
4210: 6d 70 6c 65 20 23 32 3c 2f 75 3e 3a 20 61 6c 6c mple #2</u>: all
4220: 20 70 72 69 6d 69 74 69 76 65 73 20 72 65 66 65 primitives refe
4230: 72 65 6e 63 65 64 20 62 79 20 72 6f 77 73 20 64 renced by rows d
4240: 65 63 6c 61 72 69 6e 67 20 3c 62 3e 74 6f 70 6f eclaring <b>topo
4250: 6c 61 79 65 72 5f 69 64 3d 34 3c 2f 62 3e 20 61 layer_id=4</b> a
4260: 6e 64 20 3c 62 3e 66 69 64 3d 39 3c 2f 62 3e 20 nd <b>fid=9</b>
4270: 6d 75 73 74 20 62 65 20 61 67 67 72 65 67 61 74 must be aggregat
4280: 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 62 ed in order to b
4290: 75 69 6c 64 20 74 68 65 20 6f 75 74 70 75 74 20 uild the output
42a0: 47 65 6f 6d 65 74 72 79 20 63 6f 72 72 65 73 70 Geometry corresp
42b0: 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20 50 72 onding to the Pr
42c0: 6f 76 69 6e 63 65 20 6f 66 20 3c 62 3e 47 72 6f ovince of <b>Gro
42d0: 73 73 65 74 6f 3c 2f 62 3e 2e 0d 0a 3c 2f 74 64 sseto</b>...</td
42e0: 3e 3c 74 64 3e 0d 0a 22 3c 69 3e 63 65 6e 73 75 ><td>.."<i>censu
42f0: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 s2011_topofeatur
4300: 65 73 3c 2f 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 es</i>"..<table
4310: 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 65 6c cellspan="4" cel
4320: 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62 67 63 lpadding="6" bgc
4330: 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 20 62 olor="#f8f8f0" b
4340: 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e order="1">..<tr>
4350: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 <td bgcolor="#f0
4360: 66 30 66 38 22 3e 3c 62 3e 75 69 64 3c 2f 62 3e f0f8"><b>uid</b>
4370: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c </td>..<td bgcol
4380: 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e or="#f0f0f8"><b>
4390: 6e 6f 64 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e node_id</b></td>
43a0: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 ..<td bgcolor="#
43b0: 66 30 66 30 66 38 22 3e 3c 62 3e 65 64 67 65 5f f0f0f8"><b>edge_
43c0: 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 id</b></td>..<td
43d0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
43e0: 38 22 3e 3c 62 3e 66 61 63 65 5f 69 64 3c 2f 62 8"><b>face_id</b
43f0: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
4400: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
4410: 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 >topolayer_id</b
4420: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
4430: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
4440: 3e 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 >fid</b></td></t
4450: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 r>..<tr><td alig
4460: 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e n="right">1</td>
4470: 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 <td>NULL</td><td
4480: 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c >NULL</td><td al
4490: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 ign="right">1</t
44a0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
44b0: 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c ht">1</td><td al
44c0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 ign="right">1</t
44d0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
44e0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
44f0: 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 </td><td>NULL</t
4500: 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c d><td>NULL</td><
4510: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
4520: 3e 32 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >2</td><td align
4530: 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c ="right">1</td><
4540: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
4550: 3e 32 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 >2</td></tr>..<t
4560: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
4570: 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 3e 4e 55 ht">3</td><td>NU
4580: 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c LL</td><td>NULL<
4590: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
45a0: 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 74 64 20 ight">3</td><td
45b0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c align="right">1<
45c0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
45d0: 69 67 68 74 22 3e 33 3c 2f 74 64 3e 3c 2f 74 72 ight">3</td></tr
45e0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 >..<tr><td colsp
45f0: 61 6e 3d 22 36 22 20 61 6c 69 67 6e 3d 22 63 65 an="6" align="ce
4600: 6e 74 65 72 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c nter"><hr></td><
4610: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c /tr>..<tr><td al
4620: 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 37 ign="right">2887
4630: 30 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 0</td><td>NULL</
4640: 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e td><td>NULL</td>
4650: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
4660: 22 3e 32 38 38 36 34 3c 2f 74 64 3e 3c 74 64 20 ">28864</td><td
4670: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c align="right">1<
4680: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
4690: 69 67 68 74 22 3e 32 38 38 36 37 3c 2f 74 64 3e ight">28867</td>
46a0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 </tr>..<tr><td a
46b0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 lign="right">288
46c0: 37 31 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 71</td><td>NULL<
46d0: 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 /td><td>NULL</td
46e0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
46f0: 74 22 3e 32 38 38 36 38 3c 2f 74 64 3e 3c 74 64 t">28868</td><td
4700: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
4710: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
4720: 72 69 67 68 74 22 3e 32 38 38 36 38 3c 2f 74 64 right">28868</td
4730: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e ></tr>..</table>
4740: 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f ..</td></tr>..</
4750: 74 61 62 6c 65 3e 0d 0a 3c 74 61 62 6c 65 20 63 table>..<table c
4760: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 38 22 20 62 ellpadding="8" b
4770: 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 62 30 22 gcolor="#d0ffb0"
4780: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 >..<tr><td>..<h3
4790: 3e 46 69 6e 61 6c 20 72 65 6d 61 72 6b 73 3c 2f >Final remarks</
47a0: 68 33 3e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 62 h3>..<ol>..<li>b
47b0: 6f 74 68 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 oth <b>TopoGeo_C
47c0: 72 65 61 74 65 54 6f 70 6f 4c 61 79 65 72 28 29 reateTopoLayer()
47d0: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 54 6f 70 6f </b> and <b>Topo
47e0: 47 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 Geo_InitTopoLaye
47f0: 72 28 29 3c 2f 62 3e 20 77 69 6c 6c 20 72 65 67 r()</b> will reg
4800: 69 73 74 65 72 20 74 68 65 20 54 6f 70 6f 4c 61 ister the TopoLa
4810: 79 65 72 20 69 6e 74 6f 20 74 68 65 20 3c 62 3e yer into the <b>
4820: 54 6f 70 6f 4c 61 79 65 72 73 3c 2f 62 3e 20 74 TopoLayers</b> t
4830: 61 62 6c 65 2c 20 61 6e 64 20 77 69 6c 6c 20 63 able, and will c
4840: 72 65 61 74 65 20 61 6e 64 20 70 6f 70 75 6c 61 reate and popula
4850: 74 65 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e te the correspon
4860: 64 69 6e 67 20 3c 62 3e 54 6f 70 6f 46 65 61 74 ding <b>TopoFeat
4870: 75 72 65 73 3c 2f 62 3e 20 74 61 62 6c 65 20 62 ures</b> table b
4880: 79 20 69 6d 70 6f 72 74 69 6e 67 20 61 6c 6c 20 y importing all
4890: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 74 72 information attr
48a0: 69 62 75 74 65 73 20 66 6f 72 20 65 61 63 68 20 ibutes for each
48b0: 46 65 61 74 75 72 65 20 64 65 66 69 6e 65 64 20 Feature defined
48c0: 62 79 20 74 68 65 20 72 65 66 65 72 65 6e 63 65 by the reference
48d0: 20 74 61 62 6c 65 20 28 6f 72 20 72 65 66 65 72 table (or refer
48e0: 65 6e 63 65 20 76 69 65 77 29 2e 3c 2f 6c 69 3e ence view).</li>
48f0: 0d 0a 3c 6c 69 3e 61 6e 79 77 61 79 20 6f 6e 6c ..<li>anyway onl
4900: 79 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 y <b>TopoGeo_Cre
4910: 61 74 65 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f ateTopoLayer()</
4920: 62 3e 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 b> will automati
4930: 63 61 6c 6c 79 20 70 6f 70 75 6c 61 74 65 20 74 cally populate t
4940: 68 65 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 he <b>TopoFeatur
4950: 65 73 2d 67 65 6f 6d 65 74 72 79 3c 2f 62 3e 20 es-geometry</b>
4960: 74 61 62 6c 65 2c 20 61 6e 64 20 77 69 6c 6c 20 table, and will
4970: 64 6f 20 73 75 63 68 20 61 20 74 68 69 6e 67 20 do such a thing
4980: 62 79 20 69 64 65 6e 74 69 66 79 69 6e 67 20 61 by identifying a
4990: 6c 6c 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 ll relationships
49a0: 20 65 78 69 73 74 69 6e 67 20 62 65 74 77 65 65 existing betwee
49b0: 6e 20 74 68 65 20 47 65 6f 6d 65 74 72 69 65 73 n the Geometries
49c0: 20 66 6f 75 6e 64 20 69 6e 74 6f 20 74 68 65 20 found into the
49d0: 72 65 66 65 72 65 6e 63 65 20 74 61 62 6c 65 20 reference table
49e0: 6f 72 20 76 69 65 77 20 61 6e 64 20 74 68 65 20 or view and the
49f0: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 Topology primiti
4a00: 76 65 73 20 76 69 61 20 74 68 65 20 69 6e 74 65 ves via the inte
4a10: 72 6d 65 64 69 61 74 69 6f 6e 20 6f 66 20 74 68 rmediation of th
4a20: 65 20 3c 62 3e 54 6f 70 6f 53 65 65 64 73 3c 2f e <b>TopoSeeds</
4a30: 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6f 6e b>.</li>..<li>on
4a40: 20 74 68 65 20 6f 74 68 65 72 20 68 61 6e 64 20 the other hand
4a50: 3c 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 <b>TopoGeo_InitT
4a60: 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 77 opoLayer()</b> w
4a70: 69 6c 6c 20 6e 65 76 65 72 20 61 74 74 65 6d 70 ill never attemp
4a80: 74 20 74 6f 20 69 64 65 6e 74 69 66 79 20 74 68 t to identify th
4a90: 65 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73 20 e relationships
4aa0: 69 6e 74 65 72 63 75 72 72 69 6e 67 20 62 65 74 intercurring bet
4ab0: 77 65 65 6e 20 6f 75 74 70 75 74 20 47 65 6f 6d ween output Geom
4ac0: 65 74 72 69 65 73 20 61 6e 64 20 54 6f 70 6f 6c etries and Topol
4ad0: 6f 67 79 20 70 72 69 6d 69 74 69 76 65 73 2e 20 ogy primitives.
4ae0: 54 68 69 73 20 74 61 73 6b 20 77 69 6c 6c 20 61 This task will a
4af0: 6c 77 61 79 73 20 62 65 20 64 65 66 65 72 72 65 lways be deferre
4b00: 64 2e 3c 62 72 3e 0d 0a 59 6f 75 20 63 6f 75 6c d.<br>..You coul
4b10: 64 20 65 2e 67 2e 20 6d 61 6e 75 61 6c 6c 79 20 d e.g. manually
4b20: 63 68 65 72 72 79 20 70 69 63 6b 20 61 6c 6c 20 cherry pick all
4b30: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 Topology primiti
4b40: 76 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e ves correspondin
4b50: 67 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 54 6f g to a single To
4b60: 70 6f 46 65 61 74 75 72 65 3b 20 6f 72 20 6d 6f poFeature; or mo
4b70: 72 65 20 70 72 6f 62 61 62 6c 79 20 79 6f 75 20 re probably you
4b80: 63 6f 75 6c 64 20 70 65 72 66 6f 72 6d 20 74 68 could perform th
4b90: 69 73 20 74 61 73 6b 20 69 6e 20 61 20 73 65 63 is task in a sec
4ba0: 6f 6e 64 20 74 69 6d 65 20 62 79 20 65 78 65 63 ond time by exec
4bb0: 75 74 69 6e 67 20 73 6f 6d 65 20 61 70 70 72 6f uting some appro
4bc0: 70 72 69 61 74 65 20 53 51 4c 20 73 74 61 74 65 priate SQL state
4bd0: 6d 65 6e 74 20 28 3c 69 3e 61 73 20 77 65 27 6c ment (<i>as we'l
4be0: 6c 20 73 65 65 6e 20 73 6f 6f 6e 20 69 6e 20 74 l seen soon in t
4bf0: 68 65 20 6e 65 78 74 20 65 78 61 6d 70 6c 65 3c he next example<
4c00: 2f 69 3e 29 2e 20 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c /i>). ..</ol>..<
4c10: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 /td></tr>..</tab
4c20: 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c le><br>..<hr>..<
4c30: 68 33 3e 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 h3>TopoGeo_Expor
4c40: 74 54 6f 70 6f 4c 61 79 65 72 3a 20 65 78 70 6f tTopoLayer: expo
4c50: 72 74 69 6e 67 20 61 20 66 75 6c 6c 20 54 6f 70 rting a full Top
4c60: 6f 4c 61 79 65 72 20 69 6e 74 6f 20 61 20 47 65 oLayer into a Ge
4c70: 6f 54 61 62 6c 65 3c 2f 68 33 3e 0d 0a 3c 74 61 oTable</h3>..<ta
4c80: 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 22 ble width="100%"
4c90: 20 20 63 65 6c 6c 73 70 61 6e 3d 22 34 22 20 63 cellspan="4" c
4ca0: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 62 ellpadding="6" b
4cb0: 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 66 30 22 gcolor="#f8f8f0"
4cc0: 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 border="1">..<t
4cd0: 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 32 r><td colspan="2
4ce0: 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 " align="center"
4cf0: 3e 3c 62 3e 65 78 70 6f 72 74 69 6e 67 20 74 68 ><b>exporting th
4d00: 65 20 43 65 6e 73 75 73 20 41 72 65 61 73 20 54 e Census Areas T
4d10: 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 3c 2f 74 64 opoLayer</b></td
4d20: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e ></tr>..<tr><td>
4d30: 0d 0a 57 65 27 6c 6c 20 73 74 61 72 74 20 62 79 ..We'll start by
4d40: 20 65 78 70 6f 72 74 69 6e 67 20 66 69 72 73 74 exporting first
4d50: 20 74 68 65 20 6f 6e 6c 79 20 63 6f 6d 70 6c 65 the only comple
4d60: 74 65 6c 79 20 64 65 66 69 6e 65 64 20 54 6f 70 tely defined Top
4d70: 6f 4c 61 79 65 72 20 77 65 20 68 61 76 65 20 61 oLayer we have a
4d80: 74 20 74 68 69 73 20 70 6f 69 6e 74 20 69 6e 20 t this point in
4d90: 74 68 65 20 74 65 73 74 20 44 42 2d 66 69 6c 65 the test DB-file
4da0: 2c 20 69 2e 65 2e 20 3c 62 3e 63 65 6e 73 75 73 , i.e. <b>census
4db0: 5f 61 72 65 61 73 3c 2f 62 3e 0d 0a 3c 76 65 72 _areas</b>..<ver
4dc0: 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 batim>..SELECT T
4dd0: 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 opoGeo_ExportTop
4de0: 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 oLayer('census20
4df0: 31 31 27 2c 20 27 63 65 6e 73 75 73 5f 61 72 65 11', 'census_are
4e00: 61 73 27 2c 20 27 6f 75 74 5f 63 65 6e 73 75 73 as', 'out_census
4e10: 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 _2011', 1);..</v
4e20: 65 72 62 61 74 69 6d 3e 0d 0a 41 73 20 79 6f 75 erbatim>..As you
4e30: 20 63 61 6e 20 65 61 73 69 6c 79 20 63 68 65 63 can easily chec
4e40: 6b 20 62 79 20 79 6f 75 72 73 65 6c 66 20 61 20 k by yourself a
4e50: 6e 65 77 20 47 65 6f 54 61 62 6c 65 20 6e 61 6d new GeoTable nam
4e60: 65 64 20 3c 62 3e 6f 75 74 5f 63 65 6e 73 75 73 ed <b>out_census
4e70: 5f 32 30 31 31 3c 2f 62 3e 20 68 61 73 20 62 65 _2011</b> has be
4e80: 65 6e 20 63 72 65 61 74 65 64 20 62 79 20 3c 62 en created by <b
4e90: 3e 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 >TopoGeo_ExportT
4ea0: 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 3a 0d opoLayer()</b>:.
4eb0: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 69 73 20 .<ul>..<li>this
4ec0: 47 65 6f 54 61 62 6c 65 20 63 6f 6e 74 61 69 6e GeoTable contain
4ed0: 73 20 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 s all TopoFeatur
4ee0: 65 73 20 64 65 66 69 6e 65 64 20 69 6e 74 6f 20 es defined into
4ef0: 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 2e 3c 2f the TopoLayer.</
4f00: 6c 69 3e 0d 0a 3c 6c 69 3e 65 61 63 68 20 54 6f li>..<li>each To
4f10: 70 6f 46 65 61 74 75 72 65 20 66 61 69 74 68 66 poFeature faithf
4f20: 75 6c 6c 79 20 70 72 65 73 65 72 76 65 73 20 69 ully preserves i
4f30: 74 73 20 69 6e 69 74 69 61 6c 20 69 6e 66 6f 72 ts initial infor
4f40: 6d 61 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 mation attribute
4f50: 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6c 6c s.</li>..<li>all
4f60: 20 47 65 6f 6d 65 74 72 69 65 73 20 61 72 65 20 Geometries are
4f70: 70 72 65 63 69 73 65 6c 79 20 62 75 69 6c 74 20 precisely built
4f80: 62 79 20 61 67 67 72 65 67 61 74 69 6e 67 20 74 by aggregating t
4f90: 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 he corresponding
4fa0: 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 Topology primit
4fb0: 69 76 65 73 20 61 73 20 73 70 65 63 69 66 69 65 ives as specifie
4fc0: 64 20 62 79 20 54 6f 70 6f 4c 61 79 65 72 20 2f d by TopoLayer /
4fd0: 20 54 6f 70 6f 46 65 61 74 75 72 65 73 20 72 65 TopoFeatures re
4fe0: 6c 61 74 69 6f 6e 73 68 69 70 73 2e 3c 2f 6c 69 lationships.</li
4ff0: 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 3c 62 72 3e >..</ul><br><br>
5000: 0d 0a 54 68 65 20 69 6d 61 67 65 20 65 78 61 6d ..The image exam
5010: 70 6c 65 73 20 61 20 63 68 6f 72 6f 70 6c 65 74 ples a choroplet
5020: 68 20 63 65 6e 74 65 72 65 64 20 61 72 6f 75 6e h centered aroun
5030: 64 20 74 68 65 20 49 73 6c 61 6e 64 20 6f 66 20 d the Island of
5040: 45 6c 62 61 20 61 6e 64 20 62 61 73 65 64 20 6f Elba and based o
5050: 6e 20 74 68 65 20 3c 62 3e 6f 75 74 5f 63 65 6e n the <b>out_cen
5060: 73 75 73 5f 32 30 31 31 3c 2f 62 3e 20 47 65 6f sus_2011</b> Geo
5070: 54 61 62 6c 65 3a 20 61 6c 6c 20 43 65 6e 73 75 Table: all Censu
5080: 73 20 41 72 65 61 73 20 61 72 65 20 64 69 73 70 s Areas are disp
5090: 6c 61 79 65 64 20 62 79 20 61 64 6f 70 74 69 6e layed by adoptin
50a0: 67 20 61 20 63 6f 6c 6f 75 72 20 64 69 72 65 63 g a colour direc
50b0: 74 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e tly correspondin
50c0: 67 20 74 6f 20 74 68 65 69 72 20 70 6f 70 75 6c g to their popul
50d0: 61 74 69 6f 6e 20 64 65 6e 73 69 74 79 2e 0d 0a ation density...
50e0: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 </td><td>..<img
50f0: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 src="https://www
5100: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 .gaia-gis.it/gai
5110: 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f a-sins/topofigs/
5120: 65 6c 62 61 2d 63 68 6f 72 6f 70 6c 65 74 68 2e elba-choropleth.
5130: 70 6e 67 22 20 61 6c 74 3d 22 65 6c 62 61 2d 63 png" alt="elba-c
5140: 68 6f 72 6f 70 6c 65 74 68 22 3e 0d 0a 3c 2f 74 horopleth">..</t
5150: 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 d></tr>..</table
5160: 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 ><br>..<hr>..<h3
5170: 3e 42 75 69 6c 64 69 6e 67 20 61 20 66 75 6c 6c >Building a full
5180: 20 68 69 65 72 61 72 63 68 79 20 6f 66 20 41 64 hierarchy of Ad
5190: 6d 69 6e 69 73 74 72 61 74 69 76 65 20 4c 65 76 ministrative Lev
51a0: 65 6c 73 20 62 79 20 53 51 4c 20 73 74 61 74 65 els by SQL state
51b0: 6d 65 6e 74 73 3c 2f 68 33 3e 0d 0a 41 73 20 77 ments</h3>..As w
51c0: 65 27 76 65 20 61 6c 72 65 61 64 79 20 73 65 65 e've already see
51d0: 6e 20 62 65 66 6f 72 65 20 77 65 20 61 72 65 20 n before we are
51e0: 6e 6f 77 20 65 78 70 65 63 74 65 64 20 74 6f 20 now expected to
51f0: 63 6f 6d 70 6c 65 74 65 20 73 6f 6d 65 77 61 79 complete someway
5200: 20 74 68 65 20 54 6f 70 6f 46 65 61 74 75 72 65 the TopoFeature
5210: 73 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 73 75 s definitions su
5220: 70 70 6f 72 74 69 6e 67 20 74 68 65 20 3c 62 3e pporting the <b>
5230: 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 73 Populated Places
5240: 3c 2f 62 3e 2c 20 3c 62 3e 4d 75 6e 69 63 69 70 </b>, <b>Municip
5250: 61 6c 69 74 69 65 73 3c 2f 62 3e 2c 20 3c 62 3e alities</b>, <b>
5260: 50 72 6f 76 69 6e 63 65 73 3c 2f 62 3e 20 61 6e Provinces</b> an
5270: 64 20 3c 62 3e 52 65 67 69 6f 6e 3c 2f 62 3e 20 d <b>Region</b>
5280: 54 6f 70 6f 4c 61 79 65 72 73 20 77 65 27 76 65 TopoLayers we've
5290: 20 70 72 65 76 69 6f 75 73 6c 79 20 63 72 65 61 previously crea
52a0: 74 65 64 20 62 79 20 63 61 6c 6c 69 6e 67 20 3c ted by calling <
52b0: 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f b>TopoGeo_InitTo
52c0: 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 2e 3c 62 poLayer()</b>.<b
52d0: 72 3e 3c 62 72 3e 0d 0a 48 61 70 70 69 6c 79 20 r><br>..Happily
52e0: 65 6e 6f 75 67 68 20 61 6c 6c 20 74 68 65 73 65 enough all these
52f0: 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20 administrative
5300: 6c 65 76 65 6c 73 20 61 72 65 20 73 69 6d 70 6c levels are simpl
5310: 79 20 62 61 73 65 64 20 6f 6e 20 64 69 72 65 63 y based on direc
5320: 74 20 61 67 67 72 65 67 61 74 69 6f 6e 73 20 6f t aggregations o
5330: 66 20 3c 62 3e 43 65 6e 73 75 73 20 41 72 65 61 f <b>Census Area
5340: 73 3c 2f 62 3e 2c 20 73 6f 20 77 65 20 6a 75 73 s</b>, so we jus
5350: 74 20 68 61 76 65 20 74 6f 20 65 78 65 63 75 74 t have to execut
5360: 65 20 66 65 77 20 61 70 70 72 6f 70 72 69 61 74 e few appropriat
5370: 65 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 73 e SQL statements
5380: 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49 ...<verbatim>..I
5390: 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 75 NSERT INTO censu
53a0: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 s2011_topofeatur
53b0: 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c es..SELECT NULL,
53c0: 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64 c.node_id, c.ed
53d0: 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 64 ge_id, c.face_id
53e0: 2c 20 32 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d , 2, a.fid..FROM
53f0: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f census2011_topo
5400: 66 65 61 74 75 72 65 73 5f 32 20 41 53 20 61 0d features_2 AS a.
5410: 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 .JOIN census2011
5420: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 31 20 _topofeatures_1
5430: 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 70 AS b ON (b.cod_p
5440: 70 6c 20 3d 20 61 2e 63 6f 64 5f 70 70 6c 29 0d pl = a.cod_ppl).
5450: 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 .JOIN census2011
5460: 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20 41 53 _topofeatures AS
5470: 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 6f 67 c ON (c.topolog
5480: 79 5f 69 64 20 3d 20 31 20 41 4e 44 20 63 2e 66 y_id = 1 AND c.f
5490: 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f id = b.fid);..</
54a0: 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 75 6c 3e 0d verbatim>..<ul>.
54b0: 0a 3c 6c 69 3e 3c 62 3e 63 65 6e 73 75 73 32 30 .<li><b>census20
54c0: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 11_topofeatures_
54d0: 31 3c 2f 62 3e 20 69 73 20 74 68 65 20 54 6f 70 1</b> is the Top
54e0: 6f 46 65 61 74 75 72 65 73 20 74 61 62 6c 65 20 oFeatures table
54f0: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f corresponding to
5500: 20 3c 62 3e 43 65 6e 73 75 73 20 41 72 65 61 73 <b>Census Areas
5510: 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e </b>.</li>..<li>
5520: 3c 62 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f <b>census2011_to
5530: 70 6f 66 65 61 74 75 72 65 73 5f 32 3c 2f 62 3e pofeatures_2</b>
5540: 20 69 73 20 74 68 65 20 63 6f 72 72 65 73 70 6f is the correspo
5550: 6e 64 73 20 74 6f 20 3c 62 3e 50 6f 70 75 6c 61 nds to <b>Popula
5560: 74 65 64 20 50 6c 61 63 65 73 3c 2f 62 3e 3b 20 ted Places</b>;
5570: 74 68 65 20 63 6c 61 75 73 65 20 3c 62 3e 62 2e the clause <b>b.
5580: 63 6f 64 5f 70 70 6c 20 3d 20 61 2e 63 6f 64 5f cod_ppl = a.cod_
5590: 70 70 6c 3c 2f 62 3e 20 77 69 6c 6c 20 72 65 6c ppl</b> will rel
55a0: 61 74 69 6f 6e 61 6c 6c 79 20 6a 6f 69 6e 20 65 ationally join e
55b0: 61 63 68 20 50 6f 70 75 6c 61 74 65 64 20 50 6c ach Populated Pl
55c0: 61 63 65 20 74 6f 20 69 74 73 20 75 6e 64 65 72 ace to its under
55d0: 6c 61 79 69 6e 67 20 43 65 6e 73 75 73 20 41 72 laying Census Ar
55e0: 65 61 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 73 eas.</li>..<li>s
55f0: 6f 20 77 65 20 63 61 6e 20 64 75 6c 79 20 69 6e o we can duly in
5600: 73 65 72 74 20 69 6e 74 6f 20 74 68 65 20 3c 62 sert into the <b
5610: 3e 54 6f 70 6f 46 65 61 74 75 72 65 73 2d 67 65 >TopoFeatures-ge
5620: 6f 6d 65 74 72 79 3c 2f 62 3e 20 74 61 62 6c 65 ometry</b> table
5630: 20 28 69 2e 65 2e 20 3c 69 3e 63 65 6e 73 75 73 (i.e. <i>census
5640: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 2011_topofeature
5650: 73 3c 2f 69 3e 29 20 61 20 6e 65 77 20 6c 65 76 s</i>) a new lev
5660: 65 6c 20 6f 66 20 72 65 66 65 72 65 6e 63 65 73 el of references
5670: 20 74 6f 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 to Topology pri
5680: 6d 69 74 69 76 65 73 20 62 79 20 73 69 6d 70 6c mitives by simpl
5690: 79 20 63 6f 70 79 69 6e 67 20 61 6c 6c 20 64 65 y copying all de
56a0: 66 69 6e 69 74 69 6f 6e 73 20 61 6c 72 65 61 64 finitions alread
56b0: 79 20 73 74 6f 72 65 64 20 69 6e 74 6f 20 74 68 y stored into th
56c0: 65 20 70 72 65 76 69 6f 75 73 20 68 69 65 72 61 e previous hiera
56d0: 72 63 68 69 63 61 6c 20 6c 65 76 65 6c 2e 3c 62 rchical level.<b
56e0: 72 3e 0d 0a 41 6e 64 20 74 6f 20 64 6f 20 73 75 r>..And to do su
56f0: 63 68 20 61 20 74 68 69 6e 67 20 77 65 20 73 69 ch a thing we si
5700: 6d 70 6c 79 20 68 61 76 65 20 74 6f 20 72 65 61 mply have to rea
5710: 64 20 66 72 6f 6d 20 3c 62 3e 74 6f 70 6f 6c 61 d from <b>topola
5720: 79 65 72 3d 31 3c 2f 62 3e 20 74 68 65 6e 20 69 yer=1</b> then i
5730: 6e 73 65 72 74 69 6e 67 20 69 6e 74 6f 20 3c 62 nserting into <b
5740: 3e 74 6f 70 6f 6c 61 79 65 72 3d 32 3c 2f 62 3e >topolayer=2</b>
5750: 20 61 66 74 65 72 20 73 65 74 74 69 6e 67 20 74 after setting t
5760: 68 65 20 61 70 70 72 6f 70 72 69 61 74 65 20 3c he appropriate <
5770: 62 3e 66 69 64 3c 2f 62 3e 20 76 61 6c 75 65 73 b>fid</b> values
5780: 2e 3c 62 72 3e 0d 0a 52 65 61 6c 6c 79 20 6e 6f .<br>..Really no
5790: 74 20 61 20 64 69 66 66 69 63 75 6c 74 20 74 61 t a difficult ta
57a0: 73 6b 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d sk.</li>..</ul>.
57b0: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 49 4e 53 .<verbatim>..INS
57c0: 45 52 54 20 49 4e 54 4f 20 63 65 6e 73 75 73 32 ERT INTO census2
57d0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 011_topofeatures
57e0: 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 63 ..SELECT NULL, c
57f0: 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e 65 64 67 65 .node_id, c.edge
5800: 5f 69 64 2c 20 63 2e 66 61 63 65 5f 69 64 2c 20 _id, c.face_id,
5810: 33 2c 20 61 2e 66 69 64 0d 0a 46 52 4f 4d 20 63 3, a.fid..FROM c
5820: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 ensus2011_topofe
5830: 61 74 75 72 65 73 5f 33 20 41 53 20 61 0d 0a 4a atures_3 AS a..J
5840: 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 OIN census2011_t
5850: 6f 70 6f 66 65 61 74 75 72 65 73 5f 31 20 41 53 opofeatures_1 AS
5860: 20 62 20 4f 4e 20 28 62 2e 63 6f 64 5f 63 6f 6d b ON (b.cod_com
5870: 20 3d 20 61 2e 63 6f 64 5f 63 6f 6d 29 0d 0a 4a = a.cod_com)..J
5880: 4f 49 4e 20 63 65 6e 73 75 73 32 30 31 31 5f 74 OIN census2011_t
5890: 6f 70 6f 66 65 61 74 75 72 65 73 20 41 53 20 63 opofeatures AS c
58a0: 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c 6f 67 79 5f ON (c.topology_
58b0: 69 64 20 3d 20 31 20 41 4e 44 20 63 2e 66 69 64 id = 1 AND c.fid
58c0: 20 3d 20 62 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 = b.fid);..</ve
58d0: 72 62 61 74 69 6d 3e 0d 0a 57 65 20 63 61 6e 20 rbatim>..We can
58e0: 61 64 6f 70 74 20 65 78 61 63 74 6c 79 20 74 68 adopt exactly th
58f0: 65 20 73 61 6d 65 20 69 64 65 6e 74 69 63 61 6c e same identical
5900: 20 61 70 70 72 6f 61 63 68 20 69 6e 20 6f 72 64 approach in ord
5910: 65 72 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20 3c er to complete <
5920: 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 33 3c 2f 62 b>topolayer=3</b
5930: 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 > corresponding
5940: 74 6f 20 3c 62 3e 4d 75 6e 69 63 69 70 61 6c 69 to <b>Municipali
5950: 74 69 65 73 3c 2f 62 3e 2e 0d 0a 3c 76 65 72 62 ties</b>...<verb
5960: 61 74 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 4e atim>..INSERT IN
5970: 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f TO census2011_to
5980: 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c 45 pofeatures..SELE
5990: 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 5f CT NULL, c.node_
59a0: 69 64 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20 63 id, c.edge_id, c
59b0: 2e 66 61 63 65 5f 69 64 2c 20 34 2c 20 61 2e 66 .face_id, 4, a.f
59c0: 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 id..FROM census2
59d0: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 011_topofeatures
59e0: 5f 34 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 _4 AS a..JOIN ce
59f0: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
5a00: 74 75 72 65 73 5f 33 20 41 53 20 62 20 4f 4e 20 tures_3 AS b ON
5a10: 28 62 2e 63 6f 64 5f 70 72 6f 76 20 3d 20 61 2e (b.cod_prov = a.
5a20: 63 6f 64 5f 70 72 6f 76 29 0d 0a 4a 4f 49 4e 20 cod_prov)..JOIN
5a30: 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 census2011_topof
5a40: 65 61 74 75 72 65 73 20 41 53 20 63 20 4f 4e 20 eatures AS c ON
5a50: 28 63 2e 74 6f 70 6f 6c 6f 67 79 5f 69 64 20 3d (c.topology_id =
5a60: 20 33 20 41 4e 44 20 63 2e 66 69 64 20 3d 20 62 3 AND c.fid = b
5a70: 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 .fid);..</verbat
5a80: 69 6d 3e 0d 0a 4d 6f 72 65 20 6f 72 20 6c 65 73 im>..More or les
5a90: 73 20 74 68 65 20 73 61 6d 65 20 69 73 20 66 6f s the same is fo
5aa0: 72 20 64 65 72 69 76 69 6e 67 20 3c 62 3e 74 6f r deriving <b>to
5ab0: 70 6f 6c 61 79 65 72 3d 34 3c 2f 62 3e 20 63 6f polayer=4</b> co
5ac0: 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c rresponding to <
5ad0: 62 3e 50 72 6f 76 69 6e 63 65 73 3c 2f 62 3e 3b b>Provinces</b>;
5ae0: 20 74 68 69 73 20 74 69 6d 65 20 77 65 27 6c 6c this time we'll
5af0: 20 73 69 6d 70 6c 79 20 61 67 67 72 65 67 61 74 simply aggregat
5b00: 65 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 e the underlying
5b10: 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20 Municipalities
5b20: 66 72 6f 6d 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 from <b>topolaye
5b30: 72 3d 33 3c 2f 62 3e 2e 0d 0a 3c 2f 76 65 72 62 r=3</b>...</verb
5b40: 61 74 69 6d 3e 0d 0a 57 65 20 63 61 6e 20 61 64 atim>..We can ad
5b50: 6f 70 74 20 65 78 61 63 74 6c 79 20 74 68 65 20 opt exactly the
5b60: 73 61 6d 65 20 69 64 65 6e 74 69 63 61 6c 20 61 same identical a
5b70: 70 70 72 6f 61 63 68 20 69 6e 20 6f 72 64 65 72 pproach in order
5b80: 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20 3c 62 3e to complete <b>
5b90: 74 6f 70 6f 6c 61 79 65 72 3d 33 3c 2f 62 3e 20 topolayer=3</b>
5ba0: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f corresponding to
5bb0: 20 3c 62 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 <b>Municipaliti
5bc0: 65 73 3c 2f 62 3e 2e 0d 0a 3c 76 65 72 62 61 74 es</b>...<verbat
5bd0: 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f im>..INSERT INTO
5be0: 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f census2011_topo
5bf0: 66 65 61 74 75 72 65 73 0d 0a 53 45 4c 45 43 54 features..SELECT
5c00: 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 NULL, c.node_id
5c10: 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20 63 2e 66 , c.edge_id, c.f
5c20: 61 63 65 5f 69 64 2c 20 35 2c 20 61 2e 66 69 64 ace_id, 5, a.fid
5c30: 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 ..FROM census201
5c40: 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 35 1_topofeatures_5
5c50: 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 AS a..JOIN cens
5c60: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 us2011_topofeatu
5c70: 72 65 73 5f 34 20 41 53 20 62 20 4f 4e 20 28 62 res_4 AS b ON (b
5c80: 2e 63 6f 64 5f 72 65 67 20 3d 20 61 2e 63 6f 64 .cod_reg = a.cod
5c90: 5f 72 65 67 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 _reg)..JOIN cens
5ca0: 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 us2011_topofeatu
5cb0: 72 65 73 20 41 53 20 63 20 4f 4e 20 28 63 2e 74 res AS c ON (c.t
5cc0: 6f 70 6f 6c 6f 67 79 5f 69 64 20 3d 20 34 20 41 opology_id = 4 A
5cd0: 4e 44 20 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 ND c.fid = b.fid
5ce0: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d );..</verbatim>.
5cf0: 0a 41 6e 64 20 66 69 6e 61 6c 6c 79 20 77 65 20 .And finally we
5d00: 63 61 6e 20 64 65 72 69 76 65 20 3c 62 3e 74 6f can derive <b>to
5d10: 70 6f 6c 61 79 65 72 3d 35 3c 2f 62 3e 20 63 6f polayer=5</b> co
5d20: 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c rresponding to <
5d30: 62 3e 52 65 67 69 6f 6e 73 3c 2f 62 3e 20 62 79 b>Regions</b> by
5d40: 20 64 69 72 65 63 74 6c 79 20 61 67 67 72 65 67 directly aggreg
5d50: 61 74 69 6e 67 20 74 68 65 20 75 6e 64 65 72 6c ating the underl
5d60: 79 69 6e 67 20 50 72 6f 76 69 6e 63 65 73 20 66 ying Provinces f
5d70: 72 6f 6d 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 rom <b>topolayer
5d80: 3d 34 3c 2f 62 3e 2e 0d 0a 3c 62 72 3e 3c 62 72 =4</b>...<br><br
5d90: 3e 0d 0a 3c 74 61 62 6c 65 20 77 69 64 74 68 3d >..<table width=
5da0: 22 31 30 30 25 22 20 20 63 65 6c 6c 73 70 61 6e "100%" cellspan
5db0: 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 ="4" cellpadding
5dc0: 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 ="6" bgcolor="#f
5dd0: 38 66 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 8f8f0" border="1
5de0: 22 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 ">..<tr><td>..<b
5df0: 3e 73 74 65 70 20 23 31 3a 20 65 78 70 6f 72 74 >step #1: export
5e00: 69 6e 67 20 74 68 65 20 52 65 67 69 6f 6e 20 54 ing the Region T
5e10: 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 opoLayer</b>..<v
5e20: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 erbatim>..SELECT
5e30: 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 TopoGeo_ExportT
5e40: 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 opoLayer('census
5e50: 32 30 31 31 27 2c 20 27 72 65 67 27 2c 20 27 6f 2011', 'reg', 'o
5e60: 75 74 5f 72 65 67 5f 32 30 31 31 27 2c 20 31 29 ut_reg_2011', 1)
5e70: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a ;..</verbatim>..
5e80: 57 65 20 61 72 65 20 6e 6f 77 20 64 65 66 69 6e We are now defin
5e90: 69 74 65 6c 79 20 72 65 61 64 79 20 74 6f 20 65 itely ready to e
5ea0: 78 70 6f 72 74 20 61 6e 79 20 6f 74 68 65 72 20 xport any other
5eb0: 41 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20 4c Administrative L
5ec0: 65 76 65 6c 2e 3c 62 72 3e 0d 0a 46 6f 72 20 74 evel.<br>..For t
5ed0: 68 65 20 73 61 6b 65 20 6f 66 20 63 6c 61 72 69 he sake of clari
5ee0: 74 79 20 77 65 27 6c 6c 20 66 6f 6c 6c 6f 77 20 ty we'll follow
5ef0: 61 20 74 6f 70 2d 62 6f 74 74 6f 6d 20 6f 72 64 a top-bottom ord
5f00: 65 72 2c 20 73 6f 20 77 65 27 6c 6c 20 73 74 61 er, so we'll sta
5f10: 72 74 20 62 79 20 65 78 70 6f 72 74 69 6e 67 20 rt by exporting
5f20: 66 69 72 73 74 20 74 68 65 20 77 68 6f 6c 65 20 first the whole
5f30: 54 75 73 63 61 6e 79 2e 0d 0a 3c 2f 74 64 3e 3c Tuscany...</td><
5f40: 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 td>..<img src="h
5f50: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
5f60: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 gis.it/gaia-sins
5f70: 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 /topofigs/topola
5f80: 79 65 72 2d 72 65 67 69 6f 6e 2e 70 6e 67 22 20 yer-region.png"
5f90: 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d 72 alt="topolayer-r
5fa0: 65 67 69 6f 6e 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f egion">..</td></
5fb0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c tr>..<tr><td>..<
5fc0: 62 3e 73 74 65 70 20 23 32 3a 20 65 78 70 6f 72 b>step #2: expor
5fd0: 74 69 6e 67 20 74 68 65 20 50 72 6f 76 69 6e 63 ting the Provinc
5fe0: 65 73 20 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e es TopoLayer</b>
5ff0: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 ..<verbatim>..SE
6000: 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 LECT TopoGeo_Exp
6010: 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 ortTopoLayer('ce
6020: 6e 73 75 73 32 30 31 31 27 2c 20 27 70 72 6f 76 nsus2011', 'prov
6030: 27 2c 20 27 6f 75 74 5f 70 72 6f 76 5f 32 30 31 ', 'out_prov_201
6040: 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 1', 1);..</verba
6050: 74 69 6d 3e 0d 0a 57 65 27 6c 6c 20 63 6f 6e 74 tim>..We'll cont
6060: 69 6e 75 65 20 62 79 20 65 78 70 6f 72 74 69 6e inue by exportin
6070: 67 20 61 6c 6c 20 74 68 65 20 54 75 73 63 61 6e g all the Tuscan
6080: 79 20 50 72 6f 76 69 6e 63 65 73 2e 0d 0a 3c 2f y Provinces...</
6090: 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 td><td>..<img sr
60a0: 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 c="https://www.g
60b0: 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d aia-gis.it/gaia-
60c0: 73 69 6e 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f sins/topofigs/to
60d0: 70 6f 6c 61 79 65 72 2d 70 72 6f 76 69 6e 63 65 polayer-province
60e0: 73 2e 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f s.png" alt="topo
60f0: 6c 61 79 65 72 2d 70 72 6f 76 69 6e 63 65 73 22 layer-provinces"
6100: 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c >..</td></tr>..<
6110: 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 tr><td>..<b>step
6120: 20 23 33 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 #3: exporting t
6130: 68 65 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 he Municipalitie
6140: 73 20 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d s TopoLayer</b>.
6150: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c .<verbatim>..SEL
6160: 45 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f ECT TopoGeo_Expo
6170: 72 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e rtTopoLayer('cen
6180: 73 75 73 32 30 31 31 27 2c 20 27 63 6f 6d 27 2c sus2011', 'com',
6190: 20 27 6f 75 74 5f 63 6f 6d 5f 32 30 31 31 27 2c 'out_com_2011',
61a0: 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 1);..</verbatim
61b0: 3e 0d 0a 54 68 65 6e 20 77 65 27 6c 6c 20 65 78 >..Then we'll ex
61c0: 70 6f 72 74 20 61 6c 6c 20 74 68 65 20 54 75 73 port all the Tus
61d0: 63 61 6e 79 20 4d 75 6e 69 63 69 70 61 6c 69 74 cany Municipalit
61e0: 69 65 73 2e 3c 62 72 3e 0d 0a 46 6f 72 20 62 65 ies.<br>..For be
61f0: 74 74 65 72 20 63 6c 61 72 69 74 79 20 74 68 65 tter clarity the
6200: 20 66 69 67 75 72 65 20 73 68 6f 77 73 20 61 20 figure shows a
6210: 6d 61 67 6e 69 66 69 65 64 20 64 65 74 61 69 6c magnified detail
6220: 20 63 65 6e 74 65 72 65 64 20 61 72 6f 75 6e 64 centered around
6230: 20 74 68 65 20 49 73 6c 61 6e 64 20 6f 66 20 45 the Island of E
6240: 6c 62 61 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d lba...</td><td>.
6250: 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 .<img src="https
6260: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e ://www.gaia-gis.
6270: 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 it/gaia-sins/top
6280: 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d ofigs/topolayer-
6290: 6d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 2e 70 municipalities.p
62a0: 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 ng" alt="topolay
62b0: 65 72 2d 6d 75 6e 69 63 69 70 61 6c 69 74 69 65 er-municipalitie
62c0: 73 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d s">..</td></tr>.
62d0: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 .<tr><td>..<b>st
62e0: 65 70 20 23 34 3a 20 65 78 70 6f 72 74 69 6e 67 ep #4: exporting
62f0: 20 74 68 65 20 50 6f 70 75 6c 61 74 65 64 20 50 the Populated P
6300: 6c 61 63 65 73 20 54 6f 70 6f 4c 61 79 65 72 3c laces TopoLayer<
6310: 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d /b>..<verbatim>.
6320: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f .SELECT TopoGeo_
6330: 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 ExportTopoLayer(
6340: 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 70 'census2011', 'p
6350: 70 6c 27 2c 20 27 6f 75 74 5f 70 70 6c 5f 32 30 pl', 'out_ppl_20
6360: 31 31 27 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 11', 1);..</verb
6370: 61 74 69 6d 3e 0d 0a 41 6e 64 20 77 65 27 6c 6c atim>..And we'll
6380: 20 66 69 6e 61 6c 6c 79 20 65 78 70 6f 72 74 20 finally export
6390: 61 6c 6c 20 50 6f 70 75 6c 61 74 65 64 20 50 6c all Populated Pl
63a0: 61 63 65 73 2e 3c 62 72 3e 3c 62 72 3e 3c 62 72 aces.<br><br><br
63b0: 3e 3c 62 72 3e 0d 0a 3c 75 3e 43 6f 6e 63 6c 75 ><br>..<u>Conclu
63c0: 73 69 6f 6e 3c 2f 75 3e 3a 20 77 65 20 73 74 61 sion</u>: we sta
63d0: 72 74 65 64 20 74 68 69 73 20 61 64 76 61 6e 63 rted this advanc
63e0: 65 64 20 74 75 74 6f 72 69 61 6c 20 62 79 20 69 ed tutorial by i
63f0: 6d 70 6f 72 74 69 6e 67 20 69 6e 74 6f 20 61 20 mporting into a
6400: 54 6f 70 6f 6c 6f 67 79 20 6a 75 73 74 20 61 20 Topology just a
6410: 73 69 6e 67 6c 65 20 6c 61 79 65 72 20 28 43 65 single layer (Ce
6420: 6e 73 75 73 20 41 72 65 61 73 29 20 61 6e 64 20 nsus Areas) and
6430: 6e 6f 77 20 77 65 27 76 65 20 66 69 6e 69 73 68 now we've finish
6440: 65 64 20 62 79 20 70 72 6f 64 75 63 69 6e 67 20 ed by producing
6450: 61 20 63 6f 6d 70 6c 65 74 65 20 73 65 74 20 6f a complete set o
6460: 66 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65 f administrative
6470: 20 62 6f 75 6e 64 61 72 69 65 73 20 61 74 20 64 boundaries at d
6480: 69 66 66 65 72 65 6e 74 20 68 69 65 72 61 72 63 ifferent hierarc
6490: 68 69 63 61 6c 20 6c 65 76 65 6c 73 3a 0d 0a 3c hical levels:..<
64a0: 75 6c 3e 0d 0a 3c 6c 69 3e 50 6f 70 75 6c 61 74 ul>..<li>Populat
64b0: 65 64 20 50 6c 61 63 65 73 3c 2f 6c 69 3e 0d 0a ed Places</li>..
64c0: 3c 6c 69 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 <li>Municipaliti
64d0: 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 50 72 6f es</li>..<li>Pro
64e0: 76 69 6e 63 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69 vinces</li>..<li
64f0: 3e 52 65 67 69 6f 6e 3c 2f 6c 69 3e 0d 0a 3c 2f >Region</li>..</
6500: 75 6c 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a ul>..</td><td>..
6510: 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a <img src="https:
6520: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 //www.gaia-gis.i
6530: 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f t/gaia-sins/topo
6540: 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 70 figs/topolayer-p
6550: 6f 70 75 6c 61 74 65 64 2d 70 6c 61 63 65 73 2e opulated-places.
6560: 70 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 png" alt="topola
6570: 79 65 72 2d 70 6f 70 75 6c 61 74 65 64 2d 70 6c yer-populated-pl
6580: 61 63 65 73 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 aces">..</td></t
6590: 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e r>..</table><br>
65a0: 0d 0a 3c 74 61 62 6c 65 20 77 69 64 74 68 3d 22 ..<table width="
65b0: 31 30 30 25 22 3e 3c 74 72 3e 0d 0a 3c 74 64 20 100%"><tr>..<td
65c0: 77 69 64 74 68 3d 22 33 33 25 22 20 61 6c 69 67 width="33%" alig
65d0: 6e 3d 22 6c 65 66 74 22 3e 3c 61 20 68 72 65 66 n="left"><a href
65e0: 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 ="https://www.ga
65f0: 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c ia-gis.it/fossil
6600: 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 /libspatialite/w
6610: 69 6b 69 3f 6e 61 6d 65 3d 74 6f 70 6f 2d 69 6e iki?name=topo-in
6620: 74 65 72 6d 65 64 69 61 74 65 22 3e 70 72 65 76 termediate">prev
6630: 69 6f 75 73 20 70 61 67 65 3c 2f 61 3e 3c 2f 74 ious page</a></t
6640: 64 3e 0d 0a 3c 74 64 20 61 6c 69 67 6e 3d 22 63 d>..<td align="c
6650: 65 6e 74 65 72 22 3e 3c 61 20 68 72 65 66 3d 22 enter"><a href="
6660: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 https://www.gaia
6670: 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c -gis.it/fossil/l
6680: 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b ibspatialite/wik
6690: 69 3f 6e 61 6d 65 3d 6d 69 73 63 2d 64 6f 63 73 i?name=misc-docs
66a0: 22 3e 62 61 63 6b 20 74 6f 20 69 6e 64 65 78 3c ">back to index<
66b0: 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 77 69 /a></td>..<td wi
66c0: 64 74 68 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d dth="33%" align=
66d0: 22 72 69 67 68 74 22 3e 3c 61 20 68 72 65 66 3d "right"><a href=
66e0: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 "https://www.gai
66f0: 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f a-gis.it/fossil/
6700: 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 libspatialite/wi
6710: 6b 69 3f 6e 61 6d 65 3d 74 6f 70 6f 2d 61 64 76 ki?name=topo-adv
6720: 61 6e 63 65 64 22 3e 6e 65 78 74 20 70 61 67 65 anced">next page
6730: 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e </a></td>..</tr>
6740: 3c 2f 74 61 62 6c 65 3e 0a 5a 20 33 32 62 34 32 </table>.Z 32b42
6750: 37 39 65 33 39 33 62 37 64 65 33 62 66 39 63 65 79e393b7de3bf9ce
6760: 64 66 63 64 39 63 36 66 30 34 64 0a dfcd9c6f04d.