Wiki page
[topo-advanced] by
sandro
2015-11-17 17:45:03.
0000: 44 20 32 30 31 35 2d 31 31 2d 31 37 54 31 37 3a D 2015-11-17T17:
0010: 34 35 3a 30 33 2e 35 37 38 0a 4c 20 74 6f 70 6f 45:03.578.L topo
0020: 2d 61 64 76 61 6e 63 65 64 0a 50 20 36 66 37 61 -advanced.P 6f7a
0030: 37 37 33 66 35 63 64 63 64 65 64 38 62 31 33 62 773f5cdcded8b13b
0040: 30 38 63 62 31 66 61 65 34 39 36 37 61 33 66 61 08cb1fae4967a3fa
0050: 32 35 66 30 0a 55 20 73 61 6e 64 72 6f 0a 57 20 25f0.U sandro.W
0060: 32 36 33 36 37 0a 3c 74 61 62 6c 65 20 63 65 6c 26367.<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 65 e required to be
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 63 61 6e 20 68 61 ery table can ha
2ec0: 76 65 20 61 20 73 70 65 63 69 66 69 63 20 6c 61 ve a specific la
2ed0: 79 6f 75 74 20 6f 6e 20 69 74 73 20 6f 77 6e 20 yout on its own
2ee0: 28 73 74 72 69 63 74 6c 79 20 72 65 66 6c 65 63 (strictly reflec
2ef0: 74 69 6e 67 20 74 68 65 20 69 6e 66 6f 72 6d 61 ting the informa
2f00: 74 69 6f 6e 20 61 74 74 72 69 62 75 74 65 73 20 tion attributes
2f10: 66 6f 72 20 65 61 63 68 20 6c 61 79 65 72 29 2c for each layer),
2f20: 20 61 6e 79 77 61 79 20 61 6c 6c 20 74 68 65 6d anyway all them
2f30: 20 77 69 6c 6c 20 68 61 76 65 20 61 20 3c 62 3e will have a <b>
2f40: 75 6e 69 71 75 65 20 54 6f 70 6f 46 65 61 74 75 unique TopoFeatu
2f50: 72 65 20 69 64 65 6e 74 69 66 69 65 72 3c 2f 62 re identifier</b
2f60: 3e 20 28 3c 62 3e 3c 69 3e 66 69 64 3c 2f 69 3e > (<b><i>fid</i>
2f70: 3c 2f 62 3e 29 20 61 63 74 69 6e 67 20 69 6e 20 </b>) acting in
2f80: 74 68 65 20 50 72 69 6d 61 72 79 20 4b 65 79 20 the Primary Key
2f90: 72 6f 6c 65 2e 3c 62 72 3e 0d 0a 54 68 65 20 72 role.<br>..The r
2fa0: 65 6c 61 74 69 6f 6e 73 68 69 70 20 62 65 74 77 elationship betw
2fb0: 65 65 6e 20 74 61 62 6c 65 20 6e 61 6d 65 73 20 een table names
2fc0: 61 6e 64 20 54 6f 70 6f 4c 61 79 65 72 73 20 69 and TopoLayers i
2fd0: 73 20 65 73 74 61 62 6c 69 73 68 65 64 20 62 79 s established by
2fe0: 20 61 70 70 65 6e 64 69 6e 67 20 61 20 6e 75 6d appending a num
2ff0: 65 72 69 63 20 73 75 66 66 69 78 20 74 6f 20 74 eric suffix to t
3000: 68 65 20 63 6f 6d 6d 6f 6e 20 6e 61 6d 65 20 74 he common name t
3010: 68 61 74 20 6d 75 73 74 20 65 78 61 63 74 6c 79 hat must exactly
3020: 20 6d 61 74 63 68 20 74 68 65 20 3c 62 3e 74 6f match the <b>to
3030: 70 6f 6c 61 79 65 72 5f 69 64 3c 2f 62 3e 20 76 polayer_id</b> v
3040: 61 6c 75 65 20 64 65 63 6c 61 72 65 64 20 69 6e alue declared in
3050: 20 74 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 the <b>TopoLaye
3060: 72 73 3c 2f 62 3e 20 6d 61 69 6e 20 74 61 62 6c rs</b> main tabl
3070: 65 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 41 73 20 69 e.<br><br>..As i
3080: 73 20 73 68 6f 77 6e 20 69 6e 20 74 68 69 73 20 s shown in this
3090: 65 78 61 6d 70 6c 65 20 74 68 65 20 66 69 72 73 example the firs
30a0: 74 20 74 61 62 6c 65 20 3c 62 3e 63 65 6e 73 75 t table <b>censu
30b0: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 s2011_topofeatur
30c0: 65 73 5f 32 3c 2f 62 3e 20 28 3c 69 3e 74 6f 70 es_2</b> (<i>top
30d0: 6f 6c 61 79 65 72 5f 69 64 3c 2f 69 3e 3d 3c 69 olayer_id</i>=<i
30e0: 3e 32 3c 2f 69 3e 29 20 63 6f 6e 74 61 69 6e 73 >2</i>) contains
30f0: 20 61 6c 6c 20 54 6f 70 6f 46 65 61 74 75 72 65 all TopoFeature
3100: 73 20 61 73 73 6f 63 69 61 74 65 64 20 74 6f 20 s associated to
3110: 74 68 65 20 54 6f 70 6f 4c 61 79 65 72 20 3c 62 the TopoLayer <b
3120: 3e 70 70 6c 3c 2f 62 3e 20 28 3c 69 3e 50 6f 70 >ppl</b> (<i>Pop
3130: 75 6c 61 74 65 64 20 50 6c 61 63 65 73 3c 2f 69 ulated Places</i
3140: 3e 29 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 54 68 65 >).<br><br>..The
3150: 20 73 65 63 6f 6e 64 20 74 61 62 6c 65 20 3c 62 second table <b
3160: 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f >census2011_topo
3170: 66 65 61 74 75 72 65 73 5f 34 3c 2f 62 3e 20 28 features_4</b> (
3180: 3c 69 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c <i>topolayer_id<
3190: 2f 69 3e 3d 3c 69 3e 34 3c 2f 69 3e 29 20 63 6f /i>=<i>4</i>) co
31a0: 6e 74 61 69 6e 73 20 61 6c 6c 20 54 6f 70 6f 46 ntains all TopoF
31b0: 65 61 74 75 72 65 73 20 61 73 73 6f 63 69 61 74 eatures associat
31c0: 65 64 20 74 6f 20 74 68 65 20 54 6f 70 6f 4c 61 ed to the TopoLa
31d0: 79 65 72 20 3c 62 3e 70 72 6f 76 3c 2f 62 3e 20 yer <b>prov</b>
31e0: 28 3c 69 3e 50 72 6f 76 69 6e 63 65 73 3c 2f 69 (<i>Provinces</i
31f0: 3e 29 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a >)...</td><td>..
3200: 22 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 "<i>census2011_t
3210: 6f 70 6f 66 65 61 74 75 72 65 73 5f 32 3c 2f 69 opofeatures_2</i
3220: 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 >"..<table cells
3230: 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 pan="4" cellpadd
3240: 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d ing="6" bgcolor=
3250: 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 72 "#f8f8f0" border
3260: 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 ="1">..<tr><td b
3270: 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 gcolor="#f0f0f8"
3280: 3e 3c 62 3e 66 69 64 3c 2f 62 3e 3c 2f 74 64 3e ><b>fid</b></td>
3290: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 ..<td bgcolor="#
32a0: 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 70 f0f0f8"><b>cod_p
32b0: 70 6c 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 pl</b></td>..<td
32c0: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
32d0: 38 22 3e 3c 62 3e 63 6f 64 5f 63 6f 6d 3c 2f 62 8"><b>cod_com</b
32e0: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
32f0: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
3300: 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a >name</b></td>..
3310: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 <td bgcolor="#f0
3320: 66 30 66 38 22 3e 3c 62 3e 70 6f 70 5f 32 30 31 f0f8"><b>pop_201
3330: 31 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 1</b></td>..<td
3340: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 bgcolor="#f0f0f8
3350: 22 3e 3c 62 3e 6d 5f 32 30 31 31 3c 2f 62 3e 3c "><b>m_2011</b><
3360: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f /td>..<td bgcolo
3370: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 r="#f0f0f8"><b>f
3380: 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f _2011</b></td></
3390: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 tr>..<tr><td ali
33a0: 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 gn="right">1</td
33b0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
33c0: 74 22 3e 32 30 35 31 34 32 37 30 35 3c 2f 74 64 t">205142705</td
33d0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
33e0: 74 22 3e 34 35 30 30 31 3c 2f 74 64 3e 3c 74 64 t">45001</td><td
33f0: 3e 41 6c 62 69 61 6e 6f 20 4d 61 67 72 61 3c 2f >Albiano Magra</
3400: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3410: 67 68 74 22 3e 31 39 30 37 3c 2f 74 64 3e 3c 74 ght">1907</td><t
3420: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
3430: 39 31 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 919</td><td alig
3440: 6e 3d 22 72 69 67 68 74 22 3e 39 38 38 3c 2f 74 n="right">988</t
3450: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
3460: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
3470: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3480: 72 69 67 68 74 22 3e 32 30 35 31 34 32 37 30 36 right">205142706
3490: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
34a0: 72 69 67 68 74 22 3e 34 35 30 30 31 3c 2f 74 64 right">45001</td
34b0: 3e 3c 74 64 3e 41 75 6c 6c 61 3c 2f 74 64 3e 3c ><td>Aulla</td><
34c0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
34d0: 3e 34 33 32 31 3c 2f 74 64 3e 3c 74 64 20 61 6c >4321</td><td al
34e0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 30 34 36 ign="right">2046
34f0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
3500: 72 69 67 68 74 22 3e 32 32 37 35 3c 2f 74 64 3e right">2275</td>
3510: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 </tr>..<tr><td a
3520: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f lign="right">3</
3530: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3540: 67 68 74 22 3e 32 30 35 31 34 32 37 31 30 3c 2f ght">205142710</
3550: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3560: 67 68 74 22 3e 34 35 30 30 31 3c 2f 74 64 3e 3c ght">45001</td><
3570: 74 64 3e 43 61 70 72 69 67 6c 69 6f 6c 61 3c 2f td>Caprigliola</
3580: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3590: 67 68 74 22 3e 34 38 32 3c 2f 74 64 3e 3c 74 64 ght">482</td><td
35a0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
35b0: 32 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 26</td><td align
35c0: 3d 22 72 69 67 68 74 22 3e 32 35 36 3c 2f 74 64 ="right">256</td
35d0: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 ></tr>..<tr><td
35e0: 63 6f 6c 73 70 61 6e 3d 22 37 22 20 61 6c 69 67 colspan="7" alig
35f0: 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 68 72 3e 3c n="center"><hr><
3600: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
3610: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3620: 3e 31 30 31 38 3c 2f 74 64 3e 3c 74 64 20 61 6c >1018</td><td al
3630: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 34 31 30 ign="right">1410
3640: 37 37 35 34 31 35 3c 2f 74 64 3e 3c 74 64 20 61 775415</td><td a
3650: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 30 lign="right">100
3660: 30 30 37 3c 2f 74 64 3e 3c 74 64 3e 53 61 73 73 007</td><td>Sass
3670: 65 74 61 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 eta</td><td alig
3680: 6e 3d 22 72 69 67 68 74 22 3e 32 38 35 3c 2f 74 n="right">285</t
3690: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
36a0: 68 74 22 3e 31 33 37 3c 2f 74 64 3e 3c 74 64 20 ht">137</td><td
36b0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 34 align="right">14
36c0: 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 8</td></tr>..<tr
36d0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
36e0: 74 22 3e 31 30 31 39 3c 2f 74 64 3e 3c 74 64 20 t">1019</td><td
36f0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 34 align="right">14
3700: 31 30 37 38 35 34 31 35 3c 2f 74 64 3e 3c 74 64 10785415</td><td
3710: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
3720: 30 30 30 30 37 3c 2f 74 64 3e 3c 74 64 3e 54 65 00007</td><td>Te
3730: 72 72 69 67 6f 6c 69 3c 2f 74 64 3e 3c 74 64 20 rrigoli</td><td
3740: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 33 align="right">53
3750: 37 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 7</td><td align=
3760: 22 72 69 67 68 74 22 3e 32 36 34 3c 2f 74 64 3e "right">264</td>
3770: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
3780: 22 3e 32 37 33 3c 2f 74 64 3e 3c 2f 74 72 3e 0d ">273</td></tr>.
3790: 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 62 72 3e 0d .</table>..<br>.
37a0: 0a 22 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f ."<i>census2011_
37b0: 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 3c 2f topofeatures_4</
37c0: 69 3e 22 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c i>"..<table cell
37d0: 73 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 span="4" cellpad
37e0: 64 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 ding="6" bgcolor
37f0: 3d 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 ="#f8f8f0" borde
3800: 72 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 r="1">..<tr><td
3810: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 bgcolor="#f0f0f8
3820: 22 3e 3c 62 3e 66 69 64 3c 2f 62 3e 3c 2f 74 64 "><b>fid</b></td
3830: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
3840: 23 66 30 66 30 66 38 22 3e 3c 62 3e 63 6f 64 5f #f0f0f8"><b>cod_
3850: 70 72 6f 76 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c prov</b></td>..<
3860: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 td bgcolor="#f0f
3870: 30 66 38 22 3e 3c 62 3e 63 6f 64 5f 72 65 67 3c 0f8"><b>cod_reg<
3880: 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 /b></td>..<td bg
3890: 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e color="#f0f0f8">
38a0: 3c 62 3e 6e 61 6d 65 3c 2f 62 3e 3c 2f 74 64 3e <b>name</b></td>
38b0: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 ..<td bgcolor="#
38c0: 66 30 66 30 66 38 22 3e 3c 62 3e 61 62 62 72 65 f0f0f8"><b>abbre
38d0: 76 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 v</b></td>..<td
38e0: 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 38 bgcolor="#f0f0f8
38f0: 22 3e 3c 62 3e 70 6f 70 5f 32 30 31 31 3c 2f 62 "><b>pop_2011</b
3900: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
3910: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
3920: 3e 6d 5f 32 30 31 31 3c 2f 62 3e 3c 2f 74 64 3e >m_2011</b></td>
3930: 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 ..<td bgcolor="#
3940: 66 30 66 30 66 38 22 3e 3c 62 3e 66 5f 32 30 31 f0f0f8"><b>f_201
3950: 31 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 1</b></td></tr>.
3960: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 .<tr><td align="
3970: 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 right">1</td><td
3980: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 align="right">4
3990: 35 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 5</td><td align=
39a0: 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 "right">9</td><t
39b0: 64 3e 4d 61 73 73 61 26 6e 62 73 70 3b 43 61 72 d>Massa Car
39c0: 72 61 72 61 3c 2f 74 64 3e 3c 74 64 3e 4d 53 3c rara</td><td>MS<
39d0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
39e0: 69 67 68 74 22 3e 31 39 39 36 35 30 3c 2f 74 64 ight">199650</td
39f0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3a00: 74 22 3e 39 35 37 35 34 3c 2f 74 64 3e 3c 74 64 t">95754</td><td
3a10: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
3a20: 30 33 38 39 36 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 03896</td></tr>.
3a30: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 .<tr><td align="
3a40: 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 right">2</td><td
3a50: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 align="right">4
3a60: 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 6</td><td align=
3a70: 22 72 69 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 "right">9</td><t
3a80: 64 3e 4c 75 63 63 61 3c 2f 74 64 3e 3c 74 64 3e d>Lucca</td><td>
3a90: 4c 55 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e LU</td><td align
3aa0: 3d 22 72 69 67 68 74 22 3e 33 38 38 33 32 37 3c ="right">388327<
3ab0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3ac0: 69 67 68 74 22 3e 31 38 36 31 38 33 3c 2f 74 64 ight">186183</td
3ad0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3ae0: 74 22 3e 32 30 32 31 34 34 3c 2f 74 64 3e 3c 2f t">202144</td></
3af0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 tr>..<tr><td ali
3b00: 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 gn="right">3</td
3b10: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3b20: 74 22 3e 34 37 3c 2f 74 64 3e 3c 74 64 20 61 6c t">47</td><td al
3b30: 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c 2f 74 ign="right">9</t
3b40: 64 3e 3c 74 64 3e 50 69 73 74 6f 69 61 3c 2f 74 d><td>Pistoia</t
3b50: 64 3e 3c 74 64 3e 50 54 3c 2f 74 64 3e 3c 74 64 d><td>PT</td><td
3b60: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
3b70: 38 37 38 36 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 87866</td><td al
3b80: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 33 38 30 ign="right">1380
3b90: 35 34 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 54</td><td align
3ba0: 3d 22 72 69 67 68 74 22 3e 31 34 39 38 31 32 3c ="right">149812<
3bb0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
3bc0: 74 64 20 63 6f 6c 73 70 61 6e 3d 22 38 22 20 61 td colspan="8" a
3bd0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 68 lign="center"><h
3be0: 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 r></td></tr>..<t
3bf0: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
3c00: 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 20 61 6c ht">9</td><td al
3c10: 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 33 3c 2f ign="right">53</
3c20: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
3c30: 67 68 74 22 3e 39 3c 2f 74 64 3e 3c 74 64 3e 47 ght">9</td><td>G
3c40: 72 6f 73 73 65 74 6f 3c 2f 74 64 3e 3c 74 64 3e rosseto</td><td>
3c50: 47 52 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e GR</td><td align
3c60: 3d 22 72 69 67 68 74 22 3e 32 32 30 35 36 34 3c ="right">220564<
3c70: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3c80: 69 67 68 74 22 3e 31 30 35 35 38 35 3c 2f 74 64 ight">105585</td
3c90: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
3ca0: 74 22 3e 31 31 34 39 37 39 3c 2f 74 64 3e 3c 2f t">114979</td></
3cb0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 tr>..<tr><td ali
3cc0: 67 6e 3d 22 72 69 67 68 74 22 3e 31 30 3c 2f 74 gn="right">10</t
3cd0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3ce0: 68 74 22 3e 31 30 30 3c 2f 74 64 3e 3c 74 64 20 ht">100</td><td
3cf0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 3c align="right">9<
3d00: 2f 74 64 3e 3c 74 64 3e 50 72 61 74 6f 3c 2f 74 /td><td>Prato</t
3d10: 64 3e 3c 74 64 3e 50 4f 3c 2f 74 64 3e 3c 74 64 d><td>PO</td><td
3d20: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 align="right">2
3d30: 34 35 39 31 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 45916</td><td al
3d40: 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 31 39 30 ign="right">1190
3d50: 38 38 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 88</td><td align
3d60: 3d 22 72 69 67 68 74 22 3e 31 32 36 38 32 38 3c ="right">126828<
3d70: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 /td></tr>..</tab
3d80: 6c 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d le>..</td></tr>.
3d90: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 3c 3c .<tr><td>..<b><<
3da0: 69 3e 74 6f 70 6f 2d 70 72 65 66 69 78 3c 2f 69 i>topo-prefix</i
3db0: 3e 3e 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 3c >>_topofeatures<
3dc0: 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d /b>..<verbatim>.
3dd0: 0a 53 45 4c 45 43 54 20 2a 20 46 52 4f 4d 20 63 .SELECT * FROM c
3de0: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 ensus2011_topofe
3df0: 61 74 75 72 65 73 3b 0d 0a 3c 2f 76 65 72 62 61 atures;..</verba
3e00: 74 69 6d 3e 0d 0a 54 68 65 20 3c 62 3e 54 6f 70 tim>..The <b>Top
3e10: 6f 46 65 61 74 75 72 65 73 2d 67 65 6f 6d 65 74 oFeatures-geomet
3e20: 72 69 65 73 3c 2f 62 3e 20 74 61 62 6c 65 20 69 ries</b> table i
3e30: 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 70 65 s intended to pe
3e40: 72 6d 61 6e 65 6e 74 6c 79 20 73 74 6f 72 65 20 rmanently store
3e50: 61 6c 6c 20 72 65 6c 61 74 69 6f 6e 73 20 62 65 all relations be
3e60: 74 77 65 65 6e 20 54 6f 70 6f 46 65 61 74 75 72 tween TopoFeatur
3e70: 65 73 20 61 6e 64 20 54 6f 70 6f 6c 6f 67 79 20 es and Topology
3e80: 70 72 69 6d 69 74 69 76 65 73 20 72 65 71 75 69 primitives requi
3e90: 72 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 red in order to
3ea0: 63 6f 72 72 65 63 74 6c 79 20 62 75 69 6c 64 20 correctly build
3eb0: 74 68 65 20 65 78 70 65 63 74 65 64 20 6f 75 74 the expected out
3ec0: 70 75 74 20 47 65 6f 6d 65 74 72 79 20 66 6f 72 put Geometry for
3ed0: 20 65 61 63 68 20 54 6f 70 6f 46 65 61 74 75 72 each TopoFeatur
3ee0: 65 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 e...<ul>..<li><b
3ef0: 3e 75 69 64 3c 2f 62 3e 20 69 73 20 74 68 65 20 >uid</b> is the
3f00: 50 72 69 6d 61 72 79 20 4b 65 79 2c 20 61 6e 64 Primary Key, and
3f10: 20 69 73 20 73 69 6d 70 6c 79 20 69 6e 74 65 6e is simply inten
3f20: 64 65 64 20 74 6f 20 62 65 20 61 6e 20 75 6e 69 ded to be an uni
3f30: 71 75 65 20 69 64 65 6e 74 69 66 69 65 72 20 66 que identifier f
3f40: 6f 72 20 65 61 63 68 20 72 6f 77 20 62 75 74 20 or each row but
3f50: 64 6f 65 73 6e 27 74 20 69 6e 74 65 6e 64 20 74 doesn't intend t
3f60: 6f 20 68 61 76 65 20 61 6e 79 20 73 70 65 63 69 o have any speci
3f70: 61 6c 20 6d 65 61 6e 69 6e 67 2e 3c 2f 6c 69 3e al meaning.</li>
3f80: 0d 0a 3c 6c 69 3e 3c 62 3e 6e 6f 64 65 5f 69 64 ..<li><b>node_id
3f90: 3c 2f 62 3e 2c 20 3c 62 3e 65 64 67 65 5f 69 64 </b>, <b>edge_id
3fa0: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 66 61 63 65 </b> and <b>face
3fb0: 5f 69 64 3c 2f 62 3e 20 61 72 65 20 46 6f 72 65 _id</b> are Fore
3fc0: 69 67 6e 20 4b 65 79 73 20 64 69 72 65 63 74 6c ign Keys directl
3fd0: 79 20 72 65 66 65 72 65 6e 63 69 6e 67 20 61 20 y referencing a
3fe0: 54 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 Topology primiti
3ff0: 76 65 3b 20 74 77 6f 20 6f 66 20 74 68 65 73 65 ve; two of these
4000: 20 76 61 6c 75 65 73 20 61 72 65 20 61 6c 77 61 values are alwa
4010: 79 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 62 ys expected to b
4020: 65 20 4e 55 4c 4c 2c 20 61 6e 64 20 6f 6e 6c 79 e NULL, and only
4030: 20 6f 6e 65 20 69 73 20 65 78 70 65 63 74 65 64 one is expected
4040: 20 74 6f 20 65 66 66 65 63 74 69 76 65 6c 79 20 to effectively
4050: 72 65 66 65 72 65 6e 63 65 20 61 20 54 6f 70 6f reference a Topo
4060: 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 20 64 logy primitive d
4070: 65 70 65 6e 64 69 6e 67 20 6f 6e 20 69 74 73 20 epending on its
4080: 74 79 70 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e type.</li>..<li>
4090: 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3c <b>topolayer_id<
40a0: 2f 62 3e 20 61 6e 64 20 3c 62 3e 66 69 64 3c 2f /b> and <b>fid</
40b0: 62 3e 20 74 6f 67 65 74 68 65 72 20 61 72 65 20 b> together are
40c0: 69 6e 74 65 6e 64 65 64 20 74 6f 20 65 73 74 61 intended to esta
40d0: 62 6c 69 73 68 20 61 20 72 65 6c 61 74 69 6f 6e blish a relation
40e0: 61 6c 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 al reference to
40f0: 73 6f 6d 65 20 73 70 65 63 69 66 69 63 20 54 6f some specific To
4100: 70 6f 46 65 61 74 75 72 65 2e 3c 2f 6c 69 3e 0d poFeature.</li>.
4110: 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 75 .</ul>..<br>..<u
4120: 3e 45 78 61 6d 70 6c 65 20 23 31 3c 2f 75 3e 3a >Example #1</u>:
4130: 20 61 6c 6c 20 54 6f 70 6f 6c 6f 67 79 20 70 72 all Topology pr
4140: 69 6d 69 74 69 76 65 73 20 64 69 72 65 63 74 6c imitives directl
4150: 79 20 72 65 66 65 72 65 6e 63 65 64 20 62 79 20 y referenced by
4160: 72 6f 77 73 20 64 65 63 6c 61 72 69 6e 67 20 3c rows declaring <
4170: 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3d 32 b>topolayer_id=2
4180: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 66 69 64 3d </b> and <b>fid=
4190: 33 3c 2f 62 3e 20 6d 75 73 74 20 62 65 20 61 67 3</b> must be ag
41a0: 67 72 65 67 61 74 65 64 20 69 6e 20 6f 72 64 65 gregated in orde
41b0: 72 20 74 6f 20 62 75 69 6c 64 20 74 68 65 20 6f r to build the o
41c0: 75 74 70 75 74 20 47 65 6f 6d 65 74 72 79 20 63 utput Geometry c
41d0: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 orresponding to
41e0: 74 68 65 20 50 6f 70 75 6c 61 74 65 64 20 50 6c the Populated Pl
41f0: 61 63 65 20 6f 66 20 3c 62 3e 43 61 70 72 69 67 ace of <b>Caprig
4200: 6c 69 6f 6c 61 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a liola</b>.<br>..
4210: 3c 75 3e 45 78 61 6d 70 6c 65 20 23 32 3c 2f 75 <u>Example #2</u
4220: 3e 3a 20 61 6c 6c 20 70 72 69 6d 69 74 69 76 65 >: all primitive
4230: 73 20 72 65 66 65 72 65 6e 63 65 64 20 62 79 20 s referenced by
4240: 72 6f 77 73 20 64 65 63 6c 61 72 69 6e 67 20 3c rows declaring <
4250: 62 3e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 3d 34 b>topolayer_id=4
4260: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 66 69 64 3d </b> and <b>fid=
4270: 39 3c 2f 62 3e 20 6d 75 73 74 20 62 65 20 61 67 9</b> must be ag
4280: 67 72 65 67 61 74 65 64 20 69 6e 20 6f 72 64 65 gregated in orde
4290: 72 20 74 6f 20 62 75 69 6c 64 20 74 68 65 20 6f r to build the o
42a0: 75 74 70 75 74 20 47 65 6f 6d 65 74 72 79 20 63 utput Geometry c
42b0: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 orresponding to
42c0: 74 68 65 20 50 72 6f 76 69 6e 63 65 20 6f 66 20 the Province of
42d0: 3c 62 3e 47 72 6f 73 73 65 74 6f 3c 2f 62 3e 2e <b>Grosseto</b>.
42e0: 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 22 3c 69 ..</td><td>.."<i
42f0: 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f >census2011_topo
4300: 66 65 61 74 75 72 65 73 3c 2f 69 3e 22 0d 0a 3c features</i>"..<
4310: 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 6e 3d 22 table cellspan="
4320: 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 4" cellpadding="
4330: 36 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 6" bgcolor="#f8f
4340: 38 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 8f0" border="1">
4350: 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f 6c 6f ..<tr><td bgcolo
4360: 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 3e 75 r="#f0f0f8"><b>u
4370: 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 id</b></td>..<td
4380: 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 66 bgcolor="#f0f0f
4390: 38 22 3e 3c 62 3e 6e 6f 64 65 5f 69 64 3c 2f 62 8"><b>node_id</b
43a0: 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f ></td>..<td bgco
43b0: 6c 6f 72 3d 22 23 66 30 66 30 66 38 22 3e 3c 62 lor="#f0f0f8"><b
43c0: 3e 65 64 67 65 5f 69 64 3c 2f 62 3e 3c 2f 74 64 >edge_id</b></td
43d0: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
43e0: 23 66 30 66 30 66 38 22 3e 3c 62 3e 66 61 63 65 #f0f0f8"><b>face
43f0: 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 _id</b></td>..<t
4400: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
4410: 66 38 22 3e 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 f8"><b>topolayer
4420: 5f 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 _id</b></td>..<t
4430: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
4440: 66 38 22 3e 3c 62 3e 66 69 64 3c 2f 62 3e 3c 2f f8"><b>fid</b></
4450: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
4460: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
4470: 31 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 1</td><td>NULL</
4480: 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e td><td>NULL</td>
4490: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
44a0: 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ">1</td><td alig
44b0: 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64 3e n="right">1</td>
44c0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
44d0: 22 3e 31 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c ">1</td></tr>..<
44e0: 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 tr><td align="ri
44f0: 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 3e 4e ght">2</td><td>N
4500: 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c ULL</td><td>NULL
4510: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
4520: 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 74 64 right">2</td><td
4530: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
4540: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
4550: 72 69 67 68 74 22 3e 32 3c 2f 74 64 3e 3c 2f 74 right">2</td></t
4560: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 r>..<tr><td alig
4570: 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 64 3e n="right">3</td>
4580: 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 <td>NULL</td><td
4590: 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c >NULL</td><td al
45a0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 ign="right">3</t
45b0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
45c0: 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c ht">1</td><td al
45d0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 3c 2f 74 ign="right">3</t
45e0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
45f0: 20 63 6f 6c 73 70 61 6e 3d 22 36 22 20 61 6c 69 colspan="6" ali
4600: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 68 72 3e gn="center"><hr>
4610: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
4620: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
4630: 22 3e 32 38 38 37 30 3c 2f 74 64 3e 3c 74 64 3e ">28870</td><td>
4640: 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c NULL</td><td>NUL
4650: 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d L</td><td align=
4660: 22 72 69 67 68 74 22 3e 32 38 38 36 34 3c 2f 74 "right">28864</t
4670: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
4680: 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c ht">1</td><td al
4690: 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 36 ign="right">2886
46a0: 37 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 7</td></tr>..<tr
46b0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
46c0: 74 22 3e 32 38 38 37 31 3c 2f 74 64 3e 3c 74 64 t">28871</td><td
46d0: 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 >NULL</td><td>NU
46e0: 4c 4c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e LL</td><td align
46f0: 3d 22 72 69 67 68 74 22 3e 32 38 38 36 38 3c 2f ="right">28868</
4700: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
4710: 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 ght">1</td><td a
4720: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 38 38 lign="right">288
4730: 36 38 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 68</td></tr>..</
4740: 74 61 62 6c 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 table>..</td></t
4750: 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 74 r>..</table>..<t
4760: 61 62 6c 65 20 63 65 6c 6c 70 61 64 64 69 6e 67 able cellpadding
4770: 3d 22 38 22 20 62 67 63 6f 6c 6f 72 3d 22 23 64 ="8" bgcolor="#d
4780: 30 66 66 62 30 22 3e 0d 0a 3c 74 72 3e 3c 74 64 0ffb0">..<tr><td
4790: 3e 0d 0a 3c 68 33 3e 46 69 6e 61 6c 20 72 65 6d >..<h3>Final rem
47a0: 61 72 6b 73 3c 2f 68 33 3e 0d 0a 3c 6f 6c 3e 0d arks</h3>..<ol>.
47b0: 0a 3c 6c 69 3e 62 6f 74 68 20 3c 62 3e 54 6f 70 .<li>both <b>Top
47c0: 6f 47 65 6f 5f 43 72 65 61 74 65 54 6f 70 6f 4c oGeo_CreateTopoL
47d0: 61 79 65 72 28 29 3c 2f 62 3e 20 61 6e 64 20 3c ayer()</b> and <
47e0: 62 3e 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f b>TopoGeo_InitTo
47f0: 70 6f 4c 61 79 65 72 28 29 3c 2f 62 3e 20 77 69 poLayer()</b> wi
4800: 6c 6c 20 72 65 67 69 73 74 65 72 20 74 68 65 20 ll register the
4810: 54 6f 70 6f 4c 61 79 65 72 20 69 6e 74 6f 20 74 TopoLayer into t
4820: 68 65 20 3c 62 3e 54 6f 70 6f 4c 61 79 65 72 73 he <b>TopoLayers
4830: 3c 2f 62 3e 20 74 61 62 6c 65 2c 20 61 6e 64 20 </b> table, and
4840: 77 69 6c 6c 20 63 72 65 61 74 65 20 61 6e 64 20 will create and
4850: 70 6f 70 75 6c 61 74 65 20 74 68 65 20 63 6f 72 populate the cor
4860: 72 65 73 70 6f 6e 64 69 6e 67 20 3c 62 3e 54 6f responding <b>To
4870: 70 6f 46 65 61 74 75 72 65 73 3c 2f 62 3e 20 74 poFeatures</b> t
4880: 61 62 6c 65 20 62 79 20 69 6d 70 6f 72 74 69 6e able by importin
4890: 67 20 61 6c 6c 20 69 6e 66 6f 72 6d 61 74 69 6f g all informatio
48a0: 6e 20 61 74 74 72 69 62 75 74 65 73 20 66 6f 72 n attributes for
48b0: 20 65 61 63 68 20 46 65 61 74 75 72 65 20 64 65 each Feature de
48c0: 66 69 6e 65 64 20 62 79 20 74 68 65 20 72 65 66 fined by the ref
48d0: 65 72 65 6e 63 65 20 74 61 62 6c 65 20 28 6f 72 erence table (or
48e0: 20 72 65 66 65 72 65 6e 63 65 20 76 69 65 77 29 reference view)
48f0: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 6f 6e 6c 79 .</li>..<li>only
4900: 20 3c 62 3e 54 6f 70 6f 47 65 6f 5f 43 72 65 61 <b>TopoGeo_Crea
4910: 74 65 54 6f 70 6f 4c 61 79 65 72 28 29 3c 2f 62 teTopoLayer()</b
4920: 3e 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 > will automatic
4930: 61 6c 6c 79 20 70 6f 70 75 6c 61 74 65 20 74 68 ally populate th
4940: 65 20 3c 62 3e 54 6f 70 6f 46 65 61 74 75 72 65 e <b>TopoFeature
4950: 73 2d 67 65 6f 6d 65 74 72 79 3c 2f 62 3e 20 74 s-geometry</b> t
4960: 61 62 6c 65 2c 20 61 6e 64 20 77 68 69 6c 65 20 able, and while
4970: 64 6f 69 6e 67 20 73 6f 2c 20 69 64 65 6e 74 69 doing so, identi
4980: 66 79 20 61 6c 6c 20 72 65 6c 61 74 69 6f 6e 73 fy all relations
4990: 68 69 70 73 20 65 78 69 73 74 69 6e 67 20 62 65 hips existing be
49a0: 74 77 65 65 6e 20 74 68 65 20 47 65 6f 6d 65 74 tween the Geomet
49b0: 72 69 65 73 20 66 6f 75 6e 64 20 69 6e 74 6f 20 ries found into
49c0: 74 68 65 20 72 65 66 65 72 65 6e 63 65 20 74 61 the reference ta
49d0: 62 6c 65 20 6f 72 20 76 69 65 77 20 61 6e 64 20 ble or view and
49e0: 74 68 65 20 54 6f 70 6f 6c 6f 67 79 20 70 72 69 the Topology pri
49f0: 6d 69 74 69 76 65 73 20 62 61 73 65 64 20 6f 6e mitives based on
4a00: 20 74 68 65 20 76 61 6c 75 65 73 20 6f 66 20 74 the values of t
4a10: 68 65 20 3c 62 3e 54 6f 70 6f 53 65 65 64 73 3c he <b>TopoSeeds<
4a20: 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 /b>.</li>..<li>a
4a30: 73 20 61 70 70 6f 73 65 64 20 74 6f 20 3c 62 3e s apposed to <b>
4a40: 54 6f 70 6f 47 65 6f 5f 49 6e 69 74 54 6f 70 6f TopoGeo_InitTopo
4a50: 4c 61 79 65 72 28 29 3c 2f 62 3e 2c 20 77 68 69 Layer()</b>, whi
4a60: 63 68 20 77 69 6c 6c 20 6e 65 76 65 72 20 61 74 ch will never at
4a70: 74 65 6d 70 74 20 74 6f 20 69 64 65 6e 74 69 66 tempt to identif
4a80: 79 20 74 68 65 20 72 65 6c 61 74 69 6f 6e 73 68 y the relationsh
4a90: 69 70 73 20 69 6e 74 65 72 63 75 72 72 69 6e 67 ips intercurring
4aa0: 20 62 65 74 77 65 65 6e 20 6f 75 74 70 75 74 20 between output
4ab0: 47 65 6f 6d 65 74 72 69 65 73 20 61 6e 64 20 54 Geometries and T
4ac0: 6f 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 opology primitiv
4ad0: 65 73 2e 20 54 68 69 73 20 74 61 73 6b 20 77 69 es. This task wi
4ae0: 6c 6c 20 61 6c 77 61 79 73 20 62 65 20 64 65 66 ll always be def
4af0: 65 72 72 65 64 20 66 6f 72 20 74 68 65 20 75 73 erred for the us
4b00: 65 72 20 74 6f 20 64 65 61 6c 20 77 69 74 68 20 er to deal with
4b10: 6c 61 74 65 72 2e 3c 62 72 3e 0d 0a 59 6f 75 20 later.<br>..You
4b20: 63 6f 75 6c 64 2c 20 66 6f 72 20 65 78 61 6d 70 could, for examp
4b30: 6c 65 2c 20 6d 61 6e 75 61 6c 6c 79 20 73 65 6c le, manually sel
4b40: 65 63 74 20 61 6c 6c 20 54 6f 70 6f 6c 6f 67 79 ect all Topology
4b50: 20 70 72 69 6d 69 74 69 76 65 73 20 63 6f 72 72 primitives corr
4b60: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 61 20 73 esponding to a s
4b70: 69 6e 67 6c 65 20 54 6f 70 6f 46 65 61 74 75 72 ingle TopoFeatur
4b80: 65 3b 20 6f 72 20 6d 6f 72 65 20 70 72 6f 62 61 e; or more proba
4b90: 62 6c 79 20 79 6f 75 20 63 6f 75 6c 64 20 70 65 bly you could pe
4ba0: 72 66 6f 72 6d 20 74 68 69 73 20 74 61 73 6b 20 rform this task
4bb0: 69 6e 20 61 20 73 65 63 6f 6e 64 20 72 6f 75 6e in a second roun
4bc0: 64 20 62 79 20 65 78 65 63 75 74 69 6e 67 20 73 d by executing s
4bd0: 6f 6d 65 20 61 70 70 72 6f 70 72 69 61 74 65 20 ome appropriate
4be0: 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 20 28 3c SQL statement (<
4bf0: 69 3e 61 73 20 77 65 27 6c 6c 20 73 65 65 6e 20 i>as we'll seen
4c00: 73 6f 6f 6e 20 69 6e 20 74 68 65 20 6e 65 78 74 soon in the next
4c10: 20 65 78 61 6d 70 6c 65 3c 2f 69 3e 29 2e 20 0d example</i>). .
4c20: 0a 3c 2f 6f 6c 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 .</ol>..</td></t
4c30: 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e r>..</table><br>
4c40: 0d 0a 3c 68 72 3e 0d 0a 3c 68 33 3e 54 6f 70 6f ..<hr>..<h3>Topo
4c50: 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 Geo_ExportTopoLa
4c60: 79 65 72 3a 20 65 78 70 6f 72 74 69 6e 67 20 61 yer: exporting a
4c70: 20 66 75 6c 6c 20 54 6f 70 6f 4c 61 79 65 72 20 full TopoLayer
4c80: 69 6e 74 6f 20 61 20 47 65 6f 54 61 62 6c 65 3c into a GeoTable<
4c90: 2f 68 33 3e 0d 0a 3c 74 61 62 6c 65 20 77 69 64 /h3>..<table wid
4ca0: 74 68 3d 22 31 30 30 25 22 20 20 63 65 6c 6c 73 th="100%" cells
4cb0: 70 61 6e 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 pan="4" cellpadd
4cc0: 69 6e 67 3d 22 36 22 20 62 67 63 6f 6c 6f 72 3d ing="6" bgcolor=
4cd0: 22 23 66 38 66 38 66 30 22 20 62 6f 72 64 65 72 "#f8f8f0" border
4ce0: 3d 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 ="1">..<tr><td c
4cf0: 6f 6c 73 70 61 6e 3d 22 32 22 20 61 6c 69 67 6e olspan="2" align
4d00: 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 65 78 70 ="center"><b>exp
4d10: 6f 72 74 69 6e 67 20 74 68 65 20 43 65 6e 73 75 orting the Censu
4d20: 73 20 41 72 65 61 73 20 54 6f 70 6f 4c 61 79 65 s Areas TopoLaye
4d30: 72 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d r</b></td></tr>.
4d40: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 57 65 27 6c 6c .<tr><td>..We'll
4d50: 20 73 74 61 72 74 20 62 79 20 65 78 70 6f 72 74 start by export
4d60: 69 6e 67 20 66 69 72 73 74 20 74 68 65 20 6f 6e ing first the on
4d70: 6c 79 20 63 6f 6d 70 6c 65 74 65 6c 79 20 64 65 ly completely de
4d80: 66 69 6e 65 64 20 54 6f 70 6f 4c 61 79 65 72 20 fined TopoLayer
4d90: 77 65 20 68 61 76 65 20 61 74 20 74 68 69 73 20 we have at this
4da0: 70 6f 69 6e 74 20 69 6e 20 74 68 65 20 74 65 73 point in the tes
4db0: 74 20 44 42 2d 66 69 6c 65 2c 20 69 2e 65 2e 20 t DB-file, i.e.
4dc0: 3c 62 3e 63 65 6e 73 75 73 5f 61 72 65 61 73 3c <b>census_areas<
4dd0: 2f 62 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d /b>..<verbatim>.
4de0: 0a 53 45 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f .SELECT TopoGeo_
4df0: 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 ExportTopoLayer(
4e00: 27 63 65 6e 73 75 73 32 30 31 31 27 2c 20 27 63 'census2011', 'c
4e10: 65 6e 73 75 73 5f 61 72 65 61 73 27 2c 20 27 6f ensus_areas', 'o
4e20: 75 74 5f 63 65 6e 73 75 73 5f 32 30 31 31 27 2c ut_census_2011',
4e30: 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 1);..</verbatim
4e40: 3e 0d 0a 41 73 20 79 6f 75 20 63 61 6e 20 65 61 >..As you can ea
4e50: 73 69 6c 79 20 63 68 65 63 6b 20 62 79 20 79 6f sily check by yo
4e60: 75 72 73 65 6c 66 20 61 20 6e 65 77 20 47 65 6f urself a new Geo
4e70: 54 61 62 6c 65 20 6e 61 6d 65 64 20 3c 62 3e 6f Table named <b>o
4e80: 75 74 5f 63 65 6e 73 75 73 5f 32 30 31 31 3c 2f ut_census_2011</
4e90: 62 3e 20 68 61 73 20 62 65 65 6e 20 63 72 65 61 b> has been crea
4ea0: 74 65 64 20 62 79 20 3c 62 3e 54 6f 70 6f 47 65 ted by <b>TopoGe
4eb0: 6f 5f 45 78 70 6f 72 74 54 6f 70 6f 4c 61 79 65 o_ExportTopoLaye
4ec0: 72 28 29 3c 2f 62 3e 3a 0d 0a 3c 75 6c 3e 0d 0a r()</b>:..<ul>..
4ed0: 3c 6c 69 3e 74 68 69 73 20 47 65 6f 54 61 62 6c <li>this GeoTabl
4ee0: 65 20 63 6f 6e 74 61 69 6e 73 20 61 6c 6c 20 54 e contains all T
4ef0: 6f 70 6f 46 65 61 74 75 72 65 73 20 64 65 66 69 opoFeatures defi
4f00: 6e 65 64 20 69 6e 74 6f 20 74 68 65 20 54 6f 70 ned into the Top
4f10: 6f 4c 61 79 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c 6c oLayer.</li>..<l
4f20: 69 3e 65 61 63 68 20 54 6f 70 6f 46 65 61 74 75 i>each TopoFeatu
4f30: 72 65 20 66 61 69 74 68 66 75 6c 6c 79 20 70 72 re faithfully pr
4f40: 65 73 65 72 76 65 73 20 69 74 73 20 69 6e 69 74 eserves its init
4f50: 69 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 ial information
4f60: 61 74 74 72 69 62 75 74 65 73 2e 3c 2f 6c 69 3e attributes.</li>
4f70: 0d 0a 3c 6c 69 3e 61 6c 6c 20 47 65 6f 6d 65 74 ..<li>all Geomet
4f80: 72 69 65 73 20 61 72 65 20 70 72 65 63 69 73 65 ries are precise
4f90: 6c 79 20 62 75 69 6c 74 20 62 79 20 61 67 67 72 ly built by aggr
4fa0: 65 67 61 74 69 6e 67 20 74 68 65 20 63 6f 72 72 egating the corr
4fb0: 65 73 70 6f 6e 64 69 6e 67 20 54 6f 70 6f 6c 6f esponding Topolo
4fc0: 67 79 20 70 72 69 6d 69 74 69 76 65 73 20 61 73 gy primitives as
4fd0: 20 73 70 65 63 69 66 69 65 64 20 62 79 20 54 6f specified by To
4fe0: 70 6f 4c 61 79 65 72 20 2f 20 54 6f 70 6f 46 65 poLayer / TopoFe
4ff0: 61 74 75 72 65 73 20 72 65 6c 61 74 69 6f 6e 73 atures relations
5000: 68 69 70 73 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c hips.</li>..</ul
5010: 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 54 68 65 20 69 ><br><br>..The i
5020: 6d 61 67 65 20 65 78 61 6d 70 6c 65 73 20 61 20 mage examples a
5030: 63 68 6f 72 6f 70 6c 65 74 68 20 63 65 6e 74 65 choropleth cente
5040: 72 65 64 20 61 72 6f 75 6e 64 20 74 68 65 20 49 red around the I
5050: 73 6c 61 6e 64 20 6f 66 20 45 6c 62 61 20 61 6e sland of Elba an
5060: 64 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 3c d based on the <
5070: 62 3e 6f 75 74 5f 63 65 6e 73 75 73 5f 32 30 31 b>out_census_201
5080: 31 3c 2f 62 3e 20 47 65 6f 54 61 62 6c 65 3a 20 1</b> GeoTable:
5090: 61 6c 6c 20 43 65 6e 73 75 73 20 41 72 65 61 73 all Census Areas
50a0: 20 61 72 65 20 64 69 73 70 6c 61 79 65 64 20 62 are displayed b
50b0: 79 20 61 64 6f 70 74 69 6e 67 20 61 20 63 6f 6c y adopting a col
50c0: 6f 75 72 20 64 69 72 65 63 74 6c 79 20 63 6f 72 our directly cor
50d0: 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 responding to th
50e0: 65 69 72 20 70 6f 70 75 6c 61 74 69 6f 6e 20 64 eir population d
50f0: 65 6e 73 69 74 79 2e 0d 0a 3c 2f 74 64 3e 3c 74 ensity...</td><t
5100: 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 d>..<img src="ht
5110: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 tps://www.gaia-g
5120: 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f is.it/gaia-sins/
5130: 74 6f 70 6f 66 69 67 73 2f 65 6c 62 61 2d 63 68 topofigs/elba-ch
5140: 6f 72 6f 70 6c 65 74 68 2e 70 6e 67 22 20 61 6c oropleth.png" al
5150: 74 3d 22 65 6c 62 61 2d 63 68 6f 72 6f 70 6c 65 t="elba-chorople
5160: 74 68 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e th">..</td></tr>
5170: 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a ..</table><br>..
5180: 3c 68 72 3e 0d 0a 3c 68 33 3e 42 75 69 6c 64 69 <hr>..<h3>Buildi
5190: 6e 67 20 61 20 66 75 6c 6c 20 68 69 65 72 61 72 ng a full hierar
51a0: 63 68 79 20 6f 66 20 41 64 6d 69 6e 69 73 74 72 chy of Administr
51b0: 61 74 69 76 65 20 4c 65 76 65 6c 73 20 62 79 20 ative Levels by
51c0: 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 73 3c 2f SQL statements</
51d0: 68 33 3e 0d 0a 41 73 20 77 65 27 76 65 20 61 6c h3>..As we've al
51e0: 72 65 61 64 79 20 73 65 65 6e 20 62 65 66 6f 72 ready seen befor
51f0: 65 20 77 65 20 61 72 65 20 6e 6f 77 20 65 78 70 e we are now exp
5200: 65 63 74 65 64 20 74 6f 20 63 6f 6d 70 6c 65 74 ected to complet
5210: 65 20 73 6f 6d 65 77 61 79 20 74 68 65 20 54 6f e someway the To
5220: 70 6f 46 65 61 74 75 72 65 73 20 64 65 66 69 6e poFeatures defin
5230: 69 74 69 6f 6e 73 20 73 75 70 70 6f 72 74 69 6e itions supportin
5240: 67 20 74 68 65 20 3c 62 3e 50 6f 70 75 6c 61 74 g the <b>Populat
5250: 65 64 20 50 6c 61 63 65 73 3c 2f 62 3e 2c 20 3c ed Places</b>, <
5260: 62 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 b>Municipalities
5270: 3c 2f 62 3e 2c 20 3c 62 3e 50 72 6f 76 69 6e 63 </b>, <b>Provinc
5280: 65 73 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 52 65 es</b> and <b>Re
5290: 67 69 6f 6e 3c 2f 62 3e 20 54 6f 70 6f 4c 61 79 gion</b> TopoLay
52a0: 65 72 73 20 77 65 27 76 65 20 70 72 65 76 69 6f ers we've previo
52b0: 75 73 6c 79 20 63 72 65 61 74 65 64 20 62 79 20 usly created by
52c0: 63 61 6c 6c 69 6e 67 20 3c 62 3e 54 6f 70 6f 47 calling <b>TopoG
52d0: 65 6f 5f 49 6e 69 74 54 6f 70 6f 4c 61 79 65 72 eo_InitTopoLayer
52e0: 28 29 3c 2f 62 3e 2e 3c 62 72 3e 3c 62 72 3e 0d ()</b>.<br><br>.
52f0: 0a 48 61 70 70 69 6c 79 20 65 6e 6f 75 67 68 20 .Happily enough
5300: 61 6c 6c 20 74 68 65 73 65 20 61 64 6d 69 6e 69 all these admini
5310: 73 74 72 61 74 69 76 65 20 6c 65 76 65 6c 73 20 strative levels
5320: 61 72 65 20 73 69 6d 70 6c 79 20 62 61 73 65 64 are simply based
5330: 20 6f 6e 20 64 69 72 65 63 74 20 61 67 67 72 65 on direct aggre
5340: 67 61 74 69 6f 6e 73 20 6f 66 20 3c 62 3e 43 65 gations of <b>Ce
5350: 6e 73 75 73 20 41 72 65 61 73 3c 2f 62 3e 2c 20 nsus Areas</b>,
5360: 73 6f 20 77 65 20 6a 75 73 74 20 68 61 76 65 20 so we just have
5370: 74 6f 20 65 78 65 63 75 74 65 20 66 65 77 20 61 to execute few a
5380: 70 70 72 6f 70 72 69 61 74 65 20 53 51 4c 20 73 ppropriate SQL s
5390: 74 61 74 65 6d 65 6e 74 73 2e 0d 0a 3c 76 65 72 tatements...<ver
53a0: 62 61 74 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 batim>..INSERT I
53b0: 4e 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74 NTO census2011_t
53c0: 6f 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c opofeatures..SEL
53d0: 45 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 ECT NULL, c.node
53e0: 5f 69 64 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20 _id, c.edge_id,
53f0: 63 2e 66 61 63 65 5f 69 64 2c 20 32 2c 20 61 2e c.face_id, 2, a.
5400: 66 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 fid..FROM census
5410: 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 2011_topofeature
5420: 73 5f 32 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 s_2 AS a..JOIN c
5430: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 ensus2011_topofe
5440: 61 74 75 72 65 73 5f 31 20 41 53 20 62 20 4f 4e atures_1 AS b ON
5450: 20 28 62 2e 63 6f 64 5f 70 70 6c 20 3d 20 61 2e (b.cod_ppl = a.
5460: 63 6f 64 5f 70 70 6c 29 0d 0a 4a 4f 49 4e 20 63 cod_ppl)..JOIN c
5470: 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 ensus2011_topofe
5480: 61 74 75 72 65 73 20 41 53 20 63 20 4f 4e 20 28 atures AS c ON (
5490: 63 2e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d c.topolayer_id =
54a0: 20 31 20 41 4e 44 20 63 2e 66 69 64 20 3d 20 62 1 AND c.fid = b
54b0: 2e 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 .fid);..</verbat
54c0: 69 6d 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c im>..<ul>..<li><
54d0: 62 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 6f 70 b>census2011_top
54e0: 6f 66 65 61 74 75 72 65 73 5f 31 3c 2f 62 3e 20 ofeatures_1</b>
54f0: 69 73 20 74 68 65 20 54 6f 70 6f 46 65 61 74 75 is the TopoFeatu
5500: 72 65 73 20 74 61 62 6c 65 20 63 6f 72 72 65 73 res table corres
5510: 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 43 65 ponding to <b>Ce
5520: 6e 73 75 73 20 41 72 65 61 73 3c 2f 62 3e 2e 3c nsus Areas</b>.<
5530: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 65 6e /li>..<li><b>cen
5540: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
5550: 75 72 65 73 5f 32 3c 2f 62 3e 20 69 73 20 74 68 ures_2</b> is th
5560: 65 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f e corresponds to
5570: 20 3c 62 3e 50 6f 70 75 6c 61 74 65 64 20 50 6c <b>Populated Pl
5580: 61 63 65 73 3c 2f 62 3e 3b 20 74 68 65 20 63 6c aces</b>; the cl
5590: 61 75 73 65 20 3c 62 3e 62 2e 63 6f 64 5f 70 70 ause <b>b.cod_pp
55a0: 6c 20 3d 20 61 2e 63 6f 64 5f 70 70 6c 3c 2f 62 l = a.cod_ppl</b
55b0: 3e 20 77 69 6c 6c 20 72 65 6c 61 74 69 6f 6e 61 > will relationa
55c0: 6c 6c 79 20 6a 6f 69 6e 20 65 61 63 68 20 50 6f lly join each Po
55d0: 70 75 6c 61 74 65 64 20 50 6c 61 63 65 20 74 6f pulated Place to
55e0: 20 69 74 73 20 75 6e 64 65 72 6c 61 79 69 6e 67 its underlaying
55f0: 20 43 65 6e 73 75 73 20 41 72 65 61 73 2e 3c 2f Census Areas.</
5600: 6c 69 3e 0d 0a 3c 6c 69 3e 73 6f 20 77 65 20 63 li>..<li>so we c
5610: 61 6e 20 64 75 6c 79 20 69 6e 73 65 72 74 20 69 an duly insert i
5620: 6e 74 6f 20 74 68 65 20 3c 62 3e 54 6f 70 6f 46 nto the <b>TopoF
5630: 65 61 74 75 72 65 73 2d 67 65 6f 6d 65 74 72 79 eatures-geometry
5640: 3c 2f 62 3e 20 74 61 62 6c 65 20 28 69 2e 65 2e </b> table (i.e.
5650: 20 3c 69 3e 63 65 6e 73 75 73 32 30 31 31 5f 74 <i>census2011_t
5660: 6f 70 6f 66 65 61 74 75 72 65 73 3c 2f 69 3e 29 opofeatures</i>)
5670: 20 61 20 6e 65 77 20 6c 65 76 65 6c 20 6f 66 20 a new level of
5680: 72 65 66 65 72 65 6e 63 65 73 20 74 6f 20 54 6f references to To
5690: 70 6f 6c 6f 67 79 20 70 72 69 6d 69 74 69 76 65 pology primitive
56a0: 73 20 62 79 20 73 69 6d 70 6c 79 20 63 6f 70 79 s by simply copy
56b0: 69 6e 67 20 61 6c 6c 20 64 65 66 69 6e 69 74 69 ing all definiti
56c0: 6f 6e 73 20 61 6c 72 65 61 64 79 20 73 74 6f 72 ons already stor
56d0: 65 64 20 69 6e 74 6f 20 74 68 65 20 70 72 65 76 ed into the prev
56e0: 69 6f 75 73 20 68 69 65 72 61 72 63 68 69 63 61 ious hierarchica
56f0: 6c 20 6c 65 76 65 6c 2e 3c 62 72 3e 0d 0a 41 6e l level.<br>..An
5700: 64 20 74 6f 20 64 6f 20 73 75 63 68 20 61 20 74 d to do such a t
5710: 68 69 6e 67 20 77 65 20 73 69 6d 70 6c 79 20 68 hing we simply h
5720: 61 76 65 20 74 6f 20 72 65 61 64 20 66 72 6f 6d ave to read from
5730: 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 31 3c <b>topolayer=1<
5740: 2f 62 3e 20 74 68 65 6e 20 69 6e 73 65 72 74 69 /b> then inserti
5750: 6e 67 20 69 6e 74 6f 20 3c 62 3e 74 6f 70 6f 6c ng into <b>topol
5760: 61 79 65 72 3d 32 3c 2f 62 3e 20 61 66 74 65 72 ayer=2</b> after
5770: 20 73 65 74 74 69 6e 67 20 74 68 65 20 61 70 70 setting the app
5780: 72 6f 70 72 69 61 74 65 20 3c 62 3e 66 69 64 3c ropriate <b>fid<
5790: 2f 62 3e 20 76 61 6c 75 65 73 2e 3c 62 72 3e 0d /b> values.<br>.
57a0: 0a 52 65 61 6c 6c 79 20 6e 6f 74 20 61 20 64 69 .Really not a di
57b0: 66 66 69 63 75 6c 74 20 74 61 73 6b 2e 3c 2f 6c fficult task.</l
57c0: 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 76 65 72 62 i>..</ul>..<verb
57d0: 61 74 69 6d 3e 0d 0a 49 4e 53 45 52 54 20 49 4e atim>..INSERT IN
57e0: 54 4f 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f TO census2011_to
57f0: 70 6f 66 65 61 74 75 72 65 73 0d 0a 53 45 4c 45 pofeatures..SELE
5800: 43 54 20 4e 55 4c 4c 2c 20 63 2e 6e 6f 64 65 5f CT NULL, c.node_
5810: 69 64 2c 20 63 2e 65 64 67 65 5f 69 64 2c 20 63 id, c.edge_id, c
5820: 2e 66 61 63 65 5f 69 64 2c 20 33 2c 20 61 2e 66 .face_id, 3, a.f
5830: 69 64 0d 0a 46 52 4f 4d 20 63 65 6e 73 75 73 32 id..FROM census2
5840: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 011_topofeatures
5850: 5f 33 20 41 53 20 61 0d 0a 4a 4f 49 4e 20 63 65 _3 AS a..JOIN ce
5860: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
5870: 74 75 72 65 73 5f 31 20 41 53 20 62 20 4f 4e 20 tures_1 AS b ON
5880: 28 62 2e 63 6f 64 5f 63 6f 6d 20 3d 20 61 2e 63 (b.cod_com = a.c
5890: 6f 64 5f 63 6f 6d 29 0d 0a 4a 4f 49 4e 20 63 65 od_com)..JOIN ce
58a0: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
58b0: 74 75 72 65 73 20 41 53 20 63 20 4f 4e 20 28 63 tures AS c ON (c
58c0: 2e 74 6f 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 .topolayer_id =
58d0: 31 20 41 4e 44 20 63 2e 66 69 64 20 3d 20 62 2e 1 AND c.fid = b.
58e0: 66 69 64 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 fid);..</verbati
58f0: 6d 3e 0d 0a 57 65 20 63 61 6e 20 61 64 6f 70 74 m>..We can adopt
5900: 20 65 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d exactly the sam
5910: 65 20 69 64 65 6e 74 69 63 61 6c 20 61 70 70 72 e identical appr
5920: 6f 61 63 68 20 69 6e 20 6f 72 64 65 72 20 74 6f oach in order to
5930: 20 63 6f 6d 70 6c 65 74 65 20 3c 62 3e 74 6f 70 complete <b>top
5940: 6f 6c 61 79 65 72 3d 33 3c 2f 62 3e 20 63 6f 72 olayer=3</b> cor
5950: 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 responding to <b
5960: 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c >Municipalities<
5970: 2f 62 3e 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e /b>...<verbatim>
5980: 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 ..INSERT INTO ce
5990: 6e 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 nsus2011_topofea
59a0: 74 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 tures..SELECT NU
59b0: 4c 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 LL, c.node_id, c
59c0: 2e 65 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 .edge_id, c.face
59d0: 5f 69 64 2c 20 34 2c 20 61 2e 66 69 64 0d 0a 46 _id, 4, a.fid..F
59e0: 52 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 ROM census2011_t
59f0: 6f 70 6f 66 65 61 74 75 72 65 73 5f 34 20 41 53 opofeatures_4 AS
5a00: 20 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 a..JOIN census2
5a10: 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 011_topofeatures
5a20: 5f 33 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f _3 AS b ON (b.co
5a30: 64 5f 70 72 6f 76 20 3d 20 61 2e 63 6f 64 5f 70 d_prov = a.cod_p
5a40: 72 6f 76 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 rov)..JOIN censu
5a50: 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 s2011_topofeatur
5a60: 65 73 20 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f es AS c ON (c.to
5a70: 70 6f 6c 61 79 65 72 5f 69 64 20 3d 20 33 20 41 polayer_id = 3 A
5a80: 4e 44 20 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 ND c.fid = b.fid
5a90: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d );..</verbatim>.
5aa0: 0a 4d 6f 72 65 20 6f 72 20 6c 65 73 73 20 74 68 .More or less th
5ab0: 65 20 73 61 6d 65 20 69 73 20 66 6f 72 20 64 65 e same is for de
5ac0: 72 69 76 69 6e 67 20 3c 62 3e 74 6f 70 6f 6c 61 riving <b>topola
5ad0: 79 65 72 3d 34 3c 2f 62 3e 20 63 6f 72 72 65 73 yer=4</b> corres
5ae0: 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 50 72 ponding to <b>Pr
5af0: 6f 76 69 6e 63 65 73 3c 2f 62 3e 3b 20 74 68 69 ovinces</b>; thi
5b00: 73 20 74 69 6d 65 20 77 65 27 6c 6c 20 73 69 6d s time we'll sim
5b10: 70 6c 79 20 61 67 67 72 65 67 61 74 65 20 74 68 ply aggregate th
5b20: 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 4d 75 6e e underlying Mun
5b30: 69 63 69 70 61 6c 69 74 69 65 73 20 66 72 6f 6d icipalities from
5b40: 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 33 3c <b>topolayer=3<
5b50: 2f 62 3e 2e 0d 0a 3c 2f 76 65 72 62 61 74 69 6d /b>...</verbatim
5b60: 3e 0d 0a 57 65 20 63 61 6e 20 61 64 6f 70 74 20 >..We can adopt
5b70: 65 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 exactly the same
5b80: 20 69 64 65 6e 74 69 63 61 6c 20 61 70 70 72 6f identical appro
5b90: 61 63 68 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 ach in order to
5ba0: 63 6f 6d 70 6c 65 74 65 20 3c 62 3e 74 6f 70 6f complete <b>topo
5bb0: 6c 61 79 65 72 3d 33 3c 2f 62 3e 20 63 6f 72 72 layer=3</b> corr
5bc0: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e esponding to <b>
5bd0: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c 2f Municipalities</
5be0: 62 3e 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d b>...<verbatim>.
5bf0: 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 65 6e .INSERT INTO cen
5c00: 73 75 73 32 30 31 31 5f 74 6f 70 6f 66 65 61 74 sus2011_topofeat
5c10: 75 72 65 73 0d 0a 53 45 4c 45 43 54 20 4e 55 4c ures..SELECT NUL
5c20: 4c 2c 20 63 2e 6e 6f 64 65 5f 69 64 2c 20 63 2e L, c.node_id, c.
5c30: 65 64 67 65 5f 69 64 2c 20 63 2e 66 61 63 65 5f edge_id, c.face_
5c40: 69 64 2c 20 35 2c 20 61 2e 66 69 64 0d 0a 46 52 id, 5, a.fid..FR
5c50: 4f 4d 20 63 65 6e 73 75 73 32 30 31 31 5f 74 6f OM census2011_to
5c60: 70 6f 66 65 61 74 75 72 65 73 5f 35 20 41 53 20 pofeatures_5 AS
5c70: 61 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 a..JOIN census20
5c80: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 5f 11_topofeatures_
5c90: 34 20 41 53 20 62 20 4f 4e 20 28 62 2e 63 6f 64 4 AS b ON (b.cod
5ca0: 5f 72 65 67 20 3d 20 61 2e 63 6f 64 5f 72 65 67 _reg = a.cod_reg
5cb0: 29 0d 0a 4a 4f 49 4e 20 63 65 6e 73 75 73 32 30 )..JOIN census20
5cc0: 31 31 5f 74 6f 70 6f 66 65 61 74 75 72 65 73 20 11_topofeatures
5cd0: 41 53 20 63 20 4f 4e 20 28 63 2e 74 6f 70 6f 6c AS c ON (c.topol
5ce0: 61 79 65 72 5f 69 64 20 3d 20 34 20 41 4e 44 20 ayer_id = 4 AND
5cf0: 63 2e 66 69 64 20 3d 20 62 2e 66 69 64 29 3b 0d c.fid = b.fid);.
5d00: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41 6e .</verbatim>..An
5d10: 64 20 66 69 6e 61 6c 6c 79 20 77 65 20 63 61 6e d finally we can
5d20: 20 64 65 72 69 76 65 20 3c 62 3e 74 6f 70 6f 6c derive <b>topol
5d30: 61 79 65 72 3d 35 3c 2f 62 3e 20 63 6f 72 72 65 ayer=5</b> corre
5d40: 73 70 6f 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 52 sponding to <b>R
5d50: 65 67 69 6f 6e 73 3c 2f 62 3e 20 62 79 20 64 69 egions</b> by di
5d60: 72 65 63 74 6c 79 20 61 67 67 72 65 67 61 74 69 rectly aggregati
5d70: 6e 67 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e ng the underlyin
5d80: 67 20 50 72 6f 76 69 6e 63 65 73 20 66 72 6f 6d g Provinces from
5d90: 20 3c 62 3e 74 6f 70 6f 6c 61 79 65 72 3d 34 3c <b>topolayer=4<
5da0: 2f 62 3e 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a /b>...<br><br>..
5db0: 3c 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 <table width="10
5dc0: 30 25 22 20 20 63 65 6c 6c 73 70 61 6e 3d 22 34 0%" cellspan="4
5dd0: 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 " cellpadding="6
5de0: 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 38 66 38 " bgcolor="#f8f8
5df0: 66 30 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d f0" border="1">.
5e00: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 .<tr><td>..<b>st
5e10: 65 70 20 23 31 3a 20 65 78 70 6f 72 74 69 6e 67 ep #1: exporting
5e20: 20 74 68 65 20 52 65 67 69 6f 6e 20 54 6f 70 6f the Region Topo
5e30: 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 65 72 62 Layer</b>..<verb
5e40: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 54 6f atim>..SELECT To
5e50: 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 6f 70 6f poGeo_ExportTopo
5e60: 4c 61 79 65 72 28 27 63 65 6e 73 75 73 32 30 31 Layer('census201
5e70: 31 27 2c 20 27 72 65 67 27 2c 20 27 6f 75 74 5f 1', 'reg', 'out_
5e80: 72 65 67 5f 32 30 31 31 27 2c 20 31 29 3b 0d 0a reg_2011', 1);..
5e90: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 57 65 20 </verbatim>..We
5ea0: 61 72 65 20 6e 6f 77 20 64 65 66 69 6e 69 74 65 are now definite
5eb0: 6c 79 20 72 65 61 64 79 20 74 6f 20 65 78 70 6f ly ready to expo
5ec0: 72 74 20 61 6e 79 20 6f 74 68 65 72 20 41 64 6d rt any other Adm
5ed0: 69 6e 69 73 74 72 61 74 69 76 65 20 4c 65 76 65 inistrative Leve
5ee0: 6c 2e 3c 62 72 3e 0d 0a 46 6f 72 20 74 68 65 20 l.<br>..For the
5ef0: 73 61 6b 65 20 6f 66 20 63 6c 61 72 69 74 79 20 sake of clarity
5f00: 77 65 27 6c 6c 20 66 6f 6c 6c 6f 77 20 61 20 74 we'll follow a t
5f10: 6f 70 2d 62 6f 74 74 6f 6d 20 6f 72 64 65 72 2c op-bottom order,
5f20: 20 73 6f 20 77 65 27 6c 6c 20 73 74 61 72 74 20 so we'll start
5f30: 62 79 20 65 78 70 6f 72 74 69 6e 67 20 66 69 72 by exporting fir
5f40: 73 74 20 74 68 65 20 77 68 6f 6c 65 20 54 75 73 st the whole Tus
5f50: 63 61 6e 79 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e cany...</td><td>
5f60: 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 70 ..<img src="http
5f70: 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 s://www.gaia-gis
5f80: 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 74 6f .it/gaia-sins/to
5f90: 70 6f 66 69 67 73 2f 74 6f 70 6f 6c 61 79 65 72 pofigs/topolayer
5fa0: 2d 72 65 67 69 6f 6e 2e 70 6e 67 22 20 61 6c 74 -region.png" alt
5fb0: 3d 22 74 6f 70 6f 6c 61 79 65 72 2d 72 65 67 69 ="topolayer-regi
5fc0: 6f 6e 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e on">..</td></tr>
5fd0: 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 ..<tr><td>..<b>s
5fe0: 74 65 70 20 23 32 3a 20 65 78 70 6f 72 74 69 6e tep #2: exportin
5ff0: 67 20 74 68 65 20 50 72 6f 76 69 6e 63 65 73 20 g the Provinces
6000: 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c TopoLayer</b>..<
6010: 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 verbatim>..SELEC
6020: 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 T TopoGeo_Export
6030: 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 TopoLayer('censu
6040: 73 32 30 31 31 27 2c 20 27 70 72 6f 76 27 2c 20 s2011', 'prov',
6050: 27 6f 75 74 5f 70 72 6f 76 5f 32 30 31 31 27 2c 'out_prov_2011',
6060: 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 1);..</verbatim
6070: 3e 0d 0a 57 65 27 6c 6c 20 63 6f 6e 74 69 6e 75 >..We'll continu
6080: 65 20 62 79 20 65 78 70 6f 72 74 69 6e 67 20 61 e by exporting a
6090: 6c 6c 20 74 68 65 20 54 75 73 63 61 6e 79 20 50 ll the Tuscany P
60a0: 72 6f 76 69 6e 63 65 73 2e 0d 0a 3c 2f 74 64 3e rovinces...</td>
60b0: 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 <td>..<img src="
60c0: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 https://www.gaia
60d0: 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e -gis.it/gaia-sin
60e0: 73 2f 74 6f 70 6f 66 69 67 73 2f 74 6f 70 6f 6c s/topofigs/topol
60f0: 61 79 65 72 2d 70 72 6f 76 69 6e 63 65 73 2e 70 ayer-provinces.p
6100: 6e 67 22 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 ng" alt="topolay
6110: 65 72 2d 70 72 6f 76 69 6e 63 65 73 22 3e 0d 0a er-provinces">..
6120: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
6130: 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 23 33 <td>..<b>step #3
6140: 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 68 65 20 : exporting the
6150: 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 20 54 Municipalities T
6160: 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e 0d 0a 3c 76 opoLayer</b>..<v
6170: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 erbatim>..SELECT
6180: 20 54 6f 70 6f 47 65 6f 5f 45 78 70 6f 72 74 54 TopoGeo_ExportT
6190: 6f 70 6f 4c 61 79 65 72 28 27 63 65 6e 73 75 73 opoLayer('census
61a0: 32 30 31 31 27 2c 20 27 63 6f 6d 27 2c 20 27 6f 2011', 'com', 'o
61b0: 75 74 5f 63 6f 6d 5f 32 30 31 31 27 2c 20 31 29 ut_com_2011', 1)
61c0: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a ;..</verbatim>..
61d0: 54 68 65 6e 20 77 65 27 6c 6c 20 65 78 70 6f 72 Then we'll expor
61e0: 74 20 61 6c 6c 20 74 68 65 20 54 75 73 63 61 6e t all the Tuscan
61f0: 79 20 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 y Municipalities
6200: 2e 3c 62 72 3e 0d 0a 46 6f 72 20 62 65 74 74 65 .<br>..For bette
6210: 72 20 63 6c 61 72 69 74 79 20 74 68 65 20 66 69 r clarity the fi
6220: 67 75 72 65 20 73 68 6f 77 73 20 61 20 6d 61 67 gure shows a mag
6230: 6e 69 66 69 65 64 20 64 65 74 61 69 6c 20 63 65 nified detail ce
6240: 6e 74 65 72 65 64 20 61 72 6f 75 6e 64 20 74 68 ntered around th
6250: 65 20 49 73 6c 61 6e 64 20 6f 66 20 45 6c 62 61 e Island of Elba
6260: 2e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 ...</td><td>..<i
6270: 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f mg src="https://
6280: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f www.gaia-gis.it/
6290: 67 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 gaia-sins/topofi
62a0: 67 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 6d 75 6e gs/topolayer-mun
62b0: 69 63 69 70 61 6c 69 74 69 65 73 2e 70 6e 67 22 icipalities.png"
62c0: 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 2d alt="topolayer-
62d0: 6d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 22 3e municipalities">
62e0: 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 ..</td></tr>..<t
62f0: 72 3e 3c 74 64 3e 0d 0a 3c 62 3e 73 74 65 70 20 r><td>..<b>step
6300: 23 34 3a 20 65 78 70 6f 72 74 69 6e 67 20 74 68 #4: exporting th
6310: 65 20 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 e Populated Plac
6320: 65 73 20 54 6f 70 6f 4c 61 79 65 72 3c 2f 62 3e es TopoLayer</b>
6330: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 ..<verbatim>..SE
6340: 4c 45 43 54 20 54 6f 70 6f 47 65 6f 5f 45 78 70 LECT TopoGeo_Exp
6350: 6f 72 74 54 6f 70 6f 4c 61 79 65 72 28 27 63 65 ortTopoLayer('ce
6360: 6e 73 75 73 32 30 31 31 27 2c 20 27 70 70 6c 27 nsus2011', 'ppl'
6370: 2c 20 27 6f 75 74 5f 70 70 6c 5f 32 30 31 31 27 , 'out_ppl_2011'
6380: 2c 20 31 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 , 1);..</verbati
6390: 6d 3e 0d 0a 41 6e 64 20 77 65 27 6c 6c 20 66 69 m>..And we'll fi
63a0: 6e 61 6c 6c 79 20 65 78 70 6f 72 74 20 61 6c 6c nally export all
63b0: 20 50 6f 70 75 6c 61 74 65 64 20 50 6c 61 63 65 Populated Place
63c0: 73 2e 3c 62 72 3e 3c 62 72 3e 3c 62 72 3e 3c 62 s.<br><br><br><b
63d0: 72 3e 0d 0a 3c 75 3e 43 6f 6e 63 6c 75 73 69 6f r>..<u>Conclusio
63e0: 6e 3c 2f 75 3e 3a 20 77 65 20 73 74 61 72 74 65 n</u>: we starte
63f0: 64 20 74 68 69 73 20 61 64 76 61 6e 63 65 64 20 d this advanced
6400: 74 75 74 6f 72 69 61 6c 20 62 79 20 69 6d 70 6f tutorial by impo
6410: 72 74 69 6e 67 20 69 6e 74 6f 20 61 20 54 6f 70 rting into a Top
6420: 6f 6c 6f 67 79 20 6a 75 73 74 20 61 20 73 69 6e ology just a sin
6430: 67 6c 65 20 6c 61 79 65 72 20 28 43 65 6e 73 75 gle layer (Censu
6440: 73 20 41 72 65 61 73 29 20 61 6e 64 20 6e 6f 77 s Areas) and now
6450: 20 77 65 27 76 65 20 66 69 6e 69 73 68 65 64 20 we've finished
6460: 62 79 20 70 72 6f 64 75 63 69 6e 67 20 61 20 63 by producing a c
6470: 6f 6d 70 6c 65 74 65 20 73 65 74 20 6f 66 20 61 omplete set of a
6480: 64 6d 69 6e 69 73 74 72 61 74 69 76 65 20 62 6f dministrative bo
6490: 75 6e 64 61 72 69 65 73 20 61 74 20 64 69 66 66 undaries at diff
64a0: 65 72 65 6e 74 20 68 69 65 72 61 72 63 68 69 63 erent hierarchic
64b0: 61 6c 20 6c 65 76 65 6c 73 3a 0d 0a 3c 75 6c 3e al levels:..<ul>
64c0: 0d 0a 3c 6c 69 3e 50 6f 70 75 6c 61 74 65 64 20 ..<li>Populated
64d0: 50 6c 61 63 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69 Places</li>..<li
64e0: 3e 4d 75 6e 69 63 69 70 61 6c 69 74 69 65 73 3c >Municipalities<
64f0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 50 72 6f 76 69 6e /li>..<li>Provin
6500: 63 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 52 65 ces</li>..<li>Re
6510: 67 69 6f 6e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e gion</li>..</ul>
6520: 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d ..</td><td>..<im
6530: 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 g src="https://w
6540: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 ww.gaia-gis.it/g
6550: 61 69 61 2d 73 69 6e 73 2f 74 6f 70 6f 66 69 67 aia-sins/topofig
6560: 73 2f 74 6f 70 6f 6c 61 79 65 72 2d 70 6f 70 75 s/topolayer-popu
6570: 6c 61 74 65 64 2d 70 6c 61 63 65 73 2e 70 6e 67 lated-places.png
6580: 22 20 61 6c 74 3d 22 74 6f 70 6f 6c 61 79 65 72 " alt="topolayer
6590: 2d 70 6f 70 75 6c 61 74 65 64 2d 70 6c 61 63 65 -populated-place
65a0: 73 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d s">..</td></tr>.
65b0: 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c .</table><br>..<
65c0: 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 table width="100
65d0: 25 22 3e 3c 74 72 3e 0d 0a 3c 74 64 20 77 69 64 %"><tr>..<td wid
65e0: 74 68 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 th="33%" align="
65f0: 6c 65 66 74 22 3e 3c 61 20 68 72 65 66 3d 22 68 left"><a href="h
6600: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
6610: 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 gis.it/fossil/li
6620: 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 bspatialite/wiki
6630: 3f 6e 61 6d 65 3d 74 6f 70 6f 2d 69 6e 74 65 72 ?name=topo-inter
6640: 6d 65 64 69 61 74 65 22 3e 70 72 65 76 69 6f 75 mediate">previou
6650: 73 20 70 61 67 65 3c 2f 61 3e 3c 2f 74 64 3e 0d s page</a></td>.
6660: 0a 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 .<td align="cent
6670: 65 72 22 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 er"><a href="htt
6680: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
6690: 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 s.it/fossil/libs
66a0: 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e patialite/wiki?n
66b0: 61 6d 65 3d 6d 69 73 63 2d 64 6f 63 73 22 3e 62 ame=misc-docs">b
66c0: 61 63 6b 20 74 6f 20 69 6e 64 65 78 3c 2f 61 3e ack to index</a>
66d0: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 77 69 64 74 68 </td>..<td width
66e0: 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 72 69 ="33%" align="ri
66f0: 67 68 74 22 3e 3c 61 20 68 72 65 66 3d 22 68 74 ght"><a href="ht
6700: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 tps://www.gaia-g
6710: 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 is.it/fossil/lib
6720: 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f spatialite/wiki?
6730: 6e 61 6d 65 3d 74 6f 70 6f 2d 61 64 76 61 6e 63 name=topo-advanc
6740: 65 64 22 3e 6e 65 78 74 20 70 61 67 65 3c 2f 61 ed">next page</a
6750: 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 ></td>..</tr></t
6760: 61 62 6c 65 3e 0a 5a 20 36 39 36 37 36 34 33 31 able>.Z 69676431
6770: 65 38 36 62 64 64 35 39 38 65 33 66 37 64 33 65 e86bdd598e3f7d3e
6780: 61 62 34 38 64 36 37 63 0a ab48d67c.