Artifact
a2a1995d003686095779367b8112c58f1ea06037:
Wiki page
[ZippedSHP] by
sandro
2020-05-08 11:32:57.
0000: 44 20 32 30 32 30 2d 30 35 2d 30 38 54 31 31 3a D 2020-05-08T11:
0010: 33 32 3a 35 37 2e 37 31 35 0a 4c 20 5a 69 70 70 32:57.715.L Zipp
0020: 65 64 53 48 50 0a 50 20 36 34 64 66 37 31 61 64 edSHP.P 64df71ad
0030: 36 37 33 34 66 39 35 38 37 32 37 36 30 38 63 65 6734f958727608ce
0040: 34 65 31 66 36 63 33 64 64 31 30 62 62 37 64 34 4e1f6c3dd10bb7d4
0050: 0a 55 20 73 61 6e 64 72 6f 0a 57 20 36 39 32 39 .U sandro.W 6929
0060: 0a 42 61 63 6b 20 74 6f 20 3c 61 20 68 72 65 66 .Back to <a href
0070: 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 ="https://www.ga
0080: 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c ia-gis.it/fossil
0090: 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 /libspatialite/w
00a0: 69 6b 69 3f 6e 61 6d 65 3d 35 2e 30 2e 30 2d 64 iki?name=5.0.0-d
00b0: 6f 63 22 3e 6d 61 69 6e 20 53 70 61 74 69 61 4c oc">main SpatiaL
00c0: 69 74 65 20 70 61 67 65 3c 2f 61 3e 0d 0a 3c 68 ite page</a>..<h
00d0: 32 3e 52 65 61 64 69 6e 67 20 53 48 50 20 61 6e 2>Reading SHP an
00e0: 64 20 44 42 46 20 66 69 6c 65 73 20 64 69 72 65 d DBF files dire
00f0: 63 74 6c 79 20 66 72 6f 6d 20 77 69 74 68 69 6e ctly from within
0100: 20 61 20 5a 69 70 66 69 6c 65 3c 2f 68 32 3e 0d a Zipfile</h2>.
0110: 0a 53 74 61 72 74 69 6e 67 20 73 69 6e 63 65 20 .Starting since
0120: 76 65 72 73 69 6f 6e 20 3c 62 3e 35 2e 30 2e 30 version <b>5.0.0
0130: 3c 2f 62 3e 20 53 70 61 74 69 61 4c 69 74 65 20 </b> SpatiaLite
0140: 68 61 73 20 74 68 65 20 63 61 70 61 62 69 6c 69 has the capabili
0150: 74 79 20 74 6f 20 64 69 72 65 63 74 6c 79 20 72 ty to directly r
0160: 65 61 64 20 61 6e 79 20 3c 62 3e 53 68 61 70 65 ead any <b>Shape
0170: 66 69 6c 65 3c 2f 62 3e 20 28 6f 72 20 3c 62 3e file</b> (or <b>
0180: 44 42 46 3c 2f 62 3e 20 66 69 6c 65 29 20 63 6f DBF</b> file) co
0190: 6e 74 61 69 6e 65 64 20 77 69 74 68 69 6e 20 61 ntained within a
01a0: 20 63 6f 6d 70 72 65 73 73 65 64 20 3c 62 3e 5a compressed <b>Z
01b0: 69 70 66 69 6c 65 3c 2f 62 3e 2e 3c 62 72 3e 0d ipfile</b>.<br>.
01c0: 0a 53 65 76 65 72 61 6c 20 63 6c 6f 73 65 6c 79 .Several closely
01d0: 20 72 65 6c 61 74 65 64 20 53 51 4c 20 66 75 6e related SQL fun
01e0: 63 74 69 6f 6e 73 20 68 61 76 65 20 62 65 65 6e ctions have been
01f0: 20 69 6e 74 72 6f 64 75 63 65 64 20 61 73 20 77 introduced as w
0200: 65 6c 6c 2e 0d 0a 3c 68 33 3e 41 63 63 65 73 73 ell...<h3>Access
0210: 69 6e 67 20 61 20 5a 69 70 70 65 64 20 53 48 50 ing a Zipped SHP
0220: 3c 2f 68 33 3e 0d 0a 41 6c 6c 20 74 68 65 73 65 </h3>..All these
0230: 20 6e 65 77 20 53 51 4c 20 66 75 6e 63 74 69 6f new SQL functio
0240: 6e 73 20 61 72 65 20 6e 6f 77 20 73 75 70 70 6f ns are now suppo
0250: 72 74 65 64 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 rted:..<ul>..<li
0260: 3e 3c 62 3e 49 6d 70 6f 72 74 5a 69 70 53 48 50 ><b>ImportZipSHP
0270: 28 29 3c 2f 62 3e 3a 20 74 68 65 20 6d 61 69 6e ()</b>: the main
0280: 20 66 75 6e 63 74 69 6f 6e 20 61 6c 6c 6f 77 69 function allowi
0290: 6e 67 20 74 6f 20 69 6d 70 6f 72 74 20 61 20 77 ng to import a w
02a0: 68 6f 6c 65 20 53 68 61 70 65 66 69 6c 65 20 69 hole Shapefile i
02b0: 6e 74 6f 20 61 20 6e 65 77 20 53 70 61 74 69 61 nto a new Spatia
02c0: 6c 20 54 61 62 6c 65 20 69 6e 74 6f 20 74 68 65 l Table into the
02d0: 20 63 75 72 72 65 6e 74 6c 79 20 63 6f 6e 6e 65 currently conne
02e0: 63 74 65 64 20 44 61 74 61 62 61 73 65 2e 3c 2f cted Database.</
02f0: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 50 52 4f 4a li>..<li><b>PROJ
0300: 5f 47 75 65 73 73 53 72 69 64 46 72 6f 6d 5a 69 _GuessSridFromZi
0310: 70 53 48 50 28 29 3c 2f 62 3e 3a 20 61 20 68 65 pSHP()</b>: a he
0320: 6c 70 65 72 20 66 75 63 74 69 6f 6e 20 66 6f 72 lper fuction for
0330: 20 61 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 67 attempting to g
0340: 75 65 73 73 20 74 68 65 20 53 52 49 44 20 66 6f uess the SRID fo
0350: 72 20 61 20 67 69 76 65 6e 20 7a 69 70 70 65 64 r a given zipped
0360: 20 53 48 50 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e SHP.</li>..<li>
0370: 3c 62 3e 5a 69 70 66 69 6c 65 5f 4e 75 6d 53 48 <b>Zipfile_NumSH
0380: 50 28 29 3c 2f 62 3e 3a 20 61 20 68 65 6c 70 65 P()</b>: a helpe
0390: 72 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 r function retur
03a0: 6e 69 6e 67 20 74 68 65 20 74 6f 74 61 6c 20 63 ning the total c
03b0: 6f 75 6e 74 20 6f 66 20 53 68 61 70 65 66 69 6c ount of Shapefil
03c0: 65 73 20 63 6f 6e 74 61 69 6e 65 64 20 77 69 74 es contained wit
03d0: 68 69 6e 20 61 20 67 69 76 65 6e 20 5a 69 70 66 hin a given Zipf
03e0: 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c ile.</li>..<li><
03f0: 62 3e 5a 69 70 66 69 6c 65 5f 53 68 70 4e 28 29 b>Zipfile_ShpN()
0400: 3c 2f 62 3e 3a 20 61 20 68 65 6c 70 65 72 20 66 </b>: a helper f
0410: 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e unction returnin
0420: 67 20 74 68 65 20 3c 62 3e 3c 69 3e 62 61 73 65 g the <b><i>base
0430: 6e 61 6d 65 3c 2f 69 3e 3c 2f 62 3e 20 66 6f 72 name</i></b> for
0440: 20 74 68 65 20 3c 62 3e 4e 74 68 3c 2f 62 3e 20 the <b>Nth</b>
0450: 53 68 61 70 65 66 69 6c 65 20 63 6f 6e 74 61 69 Shapefile contai
0460: 6e 65 64 20 77 69 74 68 69 6e 20 61 20 67 69 76 ned within a giv
0470: 65 6e 20 5a 69 70 66 69 6c 65 2e 3c 2f 6c 69 3e en Zipfile.</li>
0480: 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 57 ..</ul>..<br>..W
0490: 65 27 6c 6c 20 6e 6f 77 20 73 74 61 72 74 20 61 e'll now start a
04a0: 20 71 75 69 63 6b 20 74 75 74 6f 72 69 61 6c 20 quick tutorial
04b0: 61 62 6f 75 74 20 75 73 69 6e 67 20 61 6c 6c 20 about using all
04c0: 74 68 65 73 65 20 6e 65 77 20 53 51 4c 20 66 75 these new SQL fu
04d0: 6e 63 74 69 6f 6e 73 2e 0d 0a 3c 62 3e 4e 6f 74 nctions...<b>Not
04e0: 65 3c 2f 62 3e 3a 20 74 68 65 20 74 75 74 6f 72 e</b>: the tutor
04f0: 69 61 6c 20 69 73 20 62 61 73 65 64 20 6f 6e 20 ial is based on
0500: 74 68 65 20 64 61 74 61 73 65 74 20 79 6f 75 20 the dataset you
0510: 63 61 6e 20 64 6f 77 6e 6c 6f 61 64 20 66 72 6f can download fro
0520: 6d 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a m <a href="http:
0530: 2f 2f 77 77 77 2e 69 73 74 61 74 2e 69 74 2f 73 //www.istat.it/s
0540: 74 6f 72 61 67 65 2f 63 61 72 74 6f 67 72 61 66 torage/cartograf
0550: 69 61 2f 63 6f 6e 66 69 6e 69 5f 61 6d 6d 69 6e ia/confini_ammin
0560: 69 73 74 72 61 74 69 76 69 2f 6e 6f 6e 5f 67 65 istrativi/non_ge
0570: 6e 65 72 61 6c 69 7a 7a 61 74 69 2f 4c 69 6d 69 neralizzati/Limi
0580: 74 69 30 31 30 31 32 30 32 30 2e 7a 69 70 22 3e ti01012020.zip">
0590: 68 65 72 65 3c 2f 61 3e 0d 0a 3c 76 65 72 62 61 here</a>..<verba
05a0: 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 5a 69 70 tim>..SELECT Zip
05b0: 66 69 6c 65 5f 4e 75 6d 53 48 50 20 28 20 27 63 file_NumSHP ( 'c
05c0: 3a 2f 75 73 65 72 73 2f 61 66 75 72 69 2f 44 6f :/users/afuri/Do
05d0: 77 6e 6c 6f 61 64 73 2f 4c 69 6d 69 74 69 30 31 wnloads/Limiti01
05e0: 30 31 32 30 32 30 2e 7a 69 70 27 20 29 0d 0a 2d 012020.zip' )..-
05f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 34 0d 0a -----------..4..
0600: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 75 6c </verbatim>..<ul
0610: 3e 0d 0a 3c 6c 69 3e 74 68 65 20 53 51 4c 20 66 >..<li>the SQL f
0620: 75 6e 63 74 69 6f 6e 20 3c 62 3e 5a 69 70 66 69 unction <b>Zipfi
0630: 6c 65 5f 4e 75 6d 53 48 50 28 29 3c 2f 62 3e 20 le_NumSHP()</b>
0640: 77 69 6c 6c 20 69 6e 73 70 65 63 74 20 61 20 5a will inspect a Z
0650: 69 70 66 69 6c 65 20 74 68 65 6e 20 72 65 74 75 ipfile then retu
0660: 72 6e 69 6e 67 20 74 68 65 20 74 6f 74 61 6c 20 rning the total
0670: 63 6f 75 6e 74 20 6f 66 20 53 68 61 70 65 66 69 count of Shapefi
0680: 6c 65 73 20 69 74 20 63 6f 6e 74 61 69 6e 73 2e les it contains.
0690: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 74 20 72 65 </li>..<li>it re
06a0: 71 75 69 72 65 73 20 6a 75 73 74 20 61 20 73 69 quires just a si
06b0: 6e 67 6c 65 20 61 72 67 75 6d 65 6e 74 3a 20 74 ngle argument: t
06c0: 68 65 20 61 62 73 6f 6c 75 74 65 20 6f 72 20 72 he absolute or r
06d0: 65 6c 61 74 69 76 65 20 70 61 74 68 20 6c 65 61 elative path lea
06e0: 64 69 6e 67 20 74 6f 20 74 68 65 20 5a 69 70 66 ding to the Zipf
06f0: 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c ile.</li>..<li><
0700: 62 3e 4e 6f 74 65 3c 2f 62 3e 20 69 74 20 77 69 b>Note</b> it wi
0710: 6c 6c 20 72 65 74 75 72 6e 20 3c 62 3e 30 3c 2f ll return <b>0</
0720: 62 3e 20 69 66 20 74 68 65 20 5a 69 70 66 69 6c b> if the Zipfil
0730: 65 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 e does not conta
0740: 69 6e 20 61 6e 79 20 53 68 61 70 65 66 69 6c 65 in any Shapefile
0750: 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e ...<ul>..<li><b>
0760: 4e 55 4c 4c 3c 2f 62 3e 20 77 69 6c 6c 20 62 65 NULL</b> will be
0770: 20 72 65 74 75 72 6e 65 64 20 69 66 20 74 68 65 returned if the
0780: 20 5a 69 70 66 69 6c 65 20 64 6f 65 73 20 6e 6f Zipfile does no
0790: 74 20 65 78 69 73 74 20 6f 66 20 69 66 20 69 74 t exist of if it
07a0: 27 73 20 63 6f 72 72 75 70 74 65 64 20 6f 72 20 's corrupted or
07b0: 69 6e 76 61 6c 69 64 2e 3c 2f 6c 69 3e 0d 0a 3c invalid.</li>..<
07c0: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e /ul></li>..</ul>
07d0: 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 ..<verbatim>..SE
07e0: 4c 45 43 54 20 5a 69 70 66 69 6c 65 5f 73 68 70 LECT Zipfile_shp
07f0: 4e 20 28 20 27 63 3a 2f 75 73 65 72 73 2f 61 66 N ( 'c:/users/af
0800: 75 72 69 2f 44 6f 77 6e 6c 6f 61 64 73 2f 4c 69 uri/Downloads/Li
0810: 6d 69 74 69 30 31 30 31 32 30 32 30 2e 7a 69 70 miti01012020.zip
0820: 27 20 2c 20 31 20 29 0d 0a 2d 2d 2d 2d 2d 2d 0d ' , 1 )..------.
0830: 0a 4c 69 6d 69 74 69 30 31 30 31 32 30 32 30 2f .Limiti01012020/
0840: 43 6f 6d 30 31 30 31 32 30 32 30 2f 43 6f 6d 30 Com01012020/Com0
0850: 31 30 31 32 30 32 30 5f 57 47 53 38 34 0d 0a 0d 1012020_WGS84...
0860: 0a 53 45 4c 45 43 54 20 5a 69 70 66 69 6c 65 5f .SELECT Zipfile_
0870: 73 68 70 4e 20 28 20 27 63 3a 2f 75 73 65 72 73 shpN ( 'c:/users
0880: 2f 61 66 75 72 69 2f 44 6f 77 6e 6c 6f 61 64 73 /afuri/Downloads
0890: 2f 4c 69 6d 69 74 69 30 31 30 31 32 30 32 30 2e /Limiti01012020.
08a0: 7a 69 70 27 20 2c 20 32 20 29 0d 0a 2d 2d 2d 2d zip' , 2 )..----
08b0: 2d 2d 0d 0a 4c 69 6d 69 74 69 30 31 30 31 32 30 --..Limiti010120
08c0: 32 30 2f 50 72 6f 76 43 4d 30 31 30 31 32 30 32 20/ProvCM0101202
08d0: 30 2f 50 72 6f 76 43 4d 30 31 30 31 32 30 32 30 0/ProvCM01012020
08e0: 5f 57 47 53 38 34 0d 0a 0d 0a 53 45 4c 45 43 54 _WGS84....SELECT
08f0: 20 5a 69 70 66 69 6c 65 5f 73 68 70 4e 20 28 20 Zipfile_shpN (
0900: 27 63 3a 2f 75 73 65 72 73 2f 61 66 75 72 69 2f 'c:/users/afuri/
0910: 44 6f 77 6e 6c 6f 61 64 73 2f 4c 69 6d 69 74 69 Downloads/Limiti
0920: 30 31 30 31 32 30 32 30 2e 7a 69 70 27 20 2c 20 01012020.zip' ,
0930: 33 20 29 0d 0a 2d 2d 2d 2d 2d 2d 0d 0a 4c 69 6d 3 )..------..Lim
0940: 69 74 69 30 31 30 31 32 30 32 30 2f 52 65 67 30 iti01012020/Reg0
0950: 31 30 31 32 30 32 30 2f 52 65 67 30 31 30 31 32 1012020/Reg01012
0960: 30 32 30 5f 57 47 53 38 34 0d 0a 0d 0a 53 45 4c 020_WGS84....SEL
0970: 45 43 54 20 5a 69 70 66 69 6c 65 5f 73 68 70 4e ECT Zipfile_shpN
0980: 20 28 20 27 63 3a 2f 75 73 65 72 73 2f 61 66 75 ( 'c:/users/afu
0990: 72 69 2f 44 6f 77 6e 6c 6f 61 64 73 2f 4c 69 6d ri/Downloads/Lim
09a0: 69 74 69 30 31 30 31 32 30 32 30 2e 7a 69 70 27 iti01012020.zip'
09b0: 20 2c 20 34 20 29 0d 0a 2d 2d 2d 2d 2d 2d 2d 0d , 4 )..-------.
09c0: 0a 4c 69 6d 69 74 69 30 31 30 31 32 30 32 30 2f .Limiti01012020/
09d0: 52 69 70 47 65 6f 30 31 30 31 32 30 32 30 2f 52 RipGeo01012020/R
09e0: 69 70 47 65 6f 30 31 30 31 32 30 32 30 5f 57 47 ipGeo01012020_WG
09f0: 53 38 34 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e S84..</verbatim>
0a00: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 53 51 <ul>..<li>the SQ
0a10: 4c 20 66 75 6e 63 74 69 6f 6e 20 3c 62 3e 5a 69 L function <b>Zi
0a20: 70 66 69 6c 65 5f 53 68 70 4e 28 29 3c 2f 62 3e pfile_ShpN()</b>
0a30: 20 77 69 6c 6c 20 69 6e 73 70 65 63 74 20 61 20 will inspect a
0a40: 5a 69 70 66 69 6c 65 20 74 68 65 6e 20 72 65 74 Zipfile then ret
0a50: 75 72 6e 69 6e 67 20 74 68 65 20 3c 62 3e 3c 69 urning the <b><i
0a60: 3e 62 61 73 65 6e 61 6d 65 3c 2f 69 3e 3c 2f 62 >basename</i></b
0a70: 3e 20 6f 66 20 74 68 65 20 3c 62 3e 4e 74 68 3c > of the <b>Nth<
0a80: 2f 62 3e 20 53 68 61 70 65 66 69 6c 65 20 69 74 /b> Shapefile it
0a90: 20 63 6f 6e 74 61 69 6e 73 2e 3c 2f 6c 69 3e 0d contains.</li>.
0aa0: 0a 3c 6c 69 3e 69 74 20 72 65 71 75 69 72 65 73 .<li>it requires
0ab0: 20 74 77 6f 20 61 72 67 75 6d 65 6e 73 74 3a 0d two argumenst:.
0ac0: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 61 .<ul>..<li>the a
0ad0: 62 73 6f 6c 75 74 65 20 6f 72 20 72 65 6c 61 74 bsolute or relat
0ae0: 69 76 65 20 70 61 74 68 20 6c 65 61 64 69 6e 67 ive path leading
0af0: 20 74 6f 20 74 68 65 20 5a 69 70 66 69 6c 65 2e to the Zipfile.
0b00: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 72 </li>..<li>the r
0b10: 65 6c 61 74 69 76 65 20 69 6e 64 65 78 20 28 3c elative index (<
0b20: 62 3e 31 20 62 61 73 65 64 3c 2f 62 3e 29 20 6f b>1 based</b>) o
0b30: 66 20 74 68 65 20 53 68 61 70 65 66 69 6c 65 20 f the Shapefile
0b40: 77 69 74 68 69 6e 20 74 68 65 20 5a 69 70 66 69 within the Zipfi
0b50: 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c le.</li>..</ul><
0b60: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 4e 6f 74 /li>..<li><b>Not
0b70: 65 3c 2f 62 3e 3a 20 3c 62 3e 4e 55 4c 4c 3c 2f e</b>: <b>NULL</
0b80: 62 3e 20 77 69 6c 6c 20 62 65 20 72 65 74 75 72 b> will be retur
0b90: 6e 65 64 20 69 66 20 74 68 65 20 5a 69 70 66 69 ned if the Zipfi
0ba0: 6c 65 20 64 6f 65 73 20 6e 6f 74 20 65 78 69 73 le does not exis
0bb0: 74 20 6f 66 20 69 66 20 69 74 27 73 20 69 6e 76 t of if it's inv
0bc0: 61 6c 69 64 20 6f 72 20 69 66 20 74 68 65 20 69 alid or if the i
0bd0: 6e 64 65 78 20 76 61 6c 75 65 20 69 73 20 6f 75 ndex value is ou
0be0: 74 73 69 64 65 20 74 68 65 20 65 78 70 65 63 74 tside the expect
0bf0: 65 64 20 72 61 6e 67 65 2e 3c 2f 6c 69 3e 0d 0a ed range.</li>..
0c00: 3c 2f 75 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d </ul>..<verbatim
0c10: 3e 0d 0a 53 45 4c 45 43 54 20 50 52 4f 4a 5f 47 >..SELECT PROJ_G
0c20: 75 65 73 73 53 72 69 64 46 72 6f 6d 5a 69 70 53 uessSridFromZipS
0c30: 48 50 20 28 20 27 63 3a 2f 75 73 65 72 73 2f 61 HP ( 'c:/users/a
0c40: 66 75 72 69 2f 44 6f 77 6e 6c 6f 61 64 73 2f 4c furi/Downloads/L
0c50: 69 6d 69 74 69 30 31 30 31 32 30 32 30 2e 7a 69 imiti01012020.zi
0c60: 70 27 20 2c 20 27 4c 69 6d 69 74 69 30 31 30 31 p' , 'Limiti0101
0c70: 32 30 32 30 2f 43 6f 6d 30 31 30 31 32 30 32 30 2020/Com01012020
0c80: 2f 43 6f 6d 30 31 30 31 32 30 32 30 5f 57 47 53 /Com01012020_WGS
0c90: 38 34 27 20 29 0d 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 84' )..---------
0ca0: 2d 2d 2d 0d 0a 33 32 36 33 32 0d 0a 3c 2f 76 65 ---..32632..</ve
0cb0: 72 62 61 74 69 6d 3e 0d 0a 3c 6c 69 3e 74 68 65 rbatim>..<li>the
0cc0: 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 3c 62 SQL function <b
0cd0: 3e 50 52 4f 4a 5f 47 75 65 73 73 53 72 69 64 46 >PROJ_GuessSridF
0ce0: 72 6f 6d 5a 69 70 53 48 50 28 29 3c 2f 62 3e 20 romZipSHP()</b>
0cf0: 77 69 6c 6c 20 69 6e 73 70 65 63 74 20 61 20 5a will inspect a Z
0d00: 69 70 66 69 6c 65 20 74 68 65 6e 20 72 65 74 75 ipfile then retu
0d10: 72 6e 69 6e 67 20 74 68 65 20 3c 62 3e 53 52 49 rning the <b>SRI
0d20: 44 3c 2f 62 3e 20 76 61 6c 75 65 20 64 65 63 6c D</b> value decl
0d30: 61 72 65 64 20 62 79 20 74 68 65 20 3c 62 3e 2e ared by the <b>.
0d40: 50 52 4a 3c 2f 62 3e 20 6d 65 6d 62 65 72 20 20 PRJ</b> member
0d50: 6f 66 20 74 68 65 20 53 68 61 70 65 66 69 6c 65 of the Shapefile
0d60: 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e 74 6f 20 contained into
0d70: 74 68 65 20 5a 69 70 66 69 6c 65 73 20 61 73 20 the Zipfiles as
0d80: 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 69 74 identified by it
0d90: 73 20 3c 62 3e 3c 69 3e 62 61 73 65 6e 61 6d 65 s <b><i>basename
0da0: 3c 2f 69 3e 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a </i></b>.</li>..
0db0: 3c 6c 69 3e 69 74 20 72 65 71 75 69 72 65 73 20 <li>it requires
0dc0: 74 77 6f 20 61 72 67 75 6d 65 6e 73 74 3a 0d 0a two argumenst:..
0dd0: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 61 62 <ul>..<li>the ab
0de0: 73 6f 6c 75 74 65 20 6f 72 20 72 65 6c 61 74 69 solute or relati
0df0: 76 65 20 70 61 74 68 20 6c 65 61 64 69 6e 67 20 ve path leading
0e00: 74 6f 20 74 68 65 20 5a 69 70 66 69 6c 65 2e 3c to the Zipfile.<
0e10: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c 62 /li>..<li>the <b
0e20: 3e 3c 69 3e 62 61 73 65 6e 61 6d 65 3c 2f 69 3e ><i>basename</i>
0e30: 3c 2f 62 3e 20 6f 66 20 74 68 65 20 53 68 61 70 </b> of the Shap
0e40: 65 66 69 6c 65 20 77 69 74 68 69 6e 20 74 68 65 efile within the
0e50: 20 5a 69 70 66 69 6c 65 20 28 77 69 74 68 6f 75 Zipfile (withou
0e60: 74 20 61 64 64 69 6e 67 20 61 6e 79 20 3c 62 3e t adding any <b>
0e70: 2e 73 68 70 3c 2f 62 3e 2c 20 3c 62 3e 2e 73 68 .shp</b>, <b>.sh
0e80: 78 3c 2f 62 3e 20 6f 72 20 3c 62 3e 2e 64 62 66 x</b> or <b>.dbf
0e90: 3c 2f 62 3e 20 73 75 66 66 69 78 29 2e 3c 2f 6c </b> suffix).</l
0ea0: 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a i>..</ul></li>..
0eb0: 3c 6c 69 3e 3c 62 3e 4e 6f 74 65 3c 2f 62 3e 3a <li><b>Note</b>:
0ec0: 20 3c 62 3e 2d 31 3c 2f 62 3e 20 77 69 6c 6c 20 <b>-1</b> will
0ed0: 62 65 20 72 65 74 75 72 6e 65 64 20 69 66 20 74 be returned if t
0ee0: 68 65 20 53 68 61 70 65 66 69 6c 65 20 68 61 73 he Shapefile has
0ef0: 20 6e 6f 20 3c 62 3e 2e 50 52 4a 3c 2f 62 3e 20 no <b>.PRJ</b>
0f00: 6d 65 6d 62 65 72 2c 20 6f 66 20 69 66 20 69 74 member, of if it
0f10: 20 63 6f 6e 74 61 69 6e 73 20 61 6e 20 69 6e 76 contains an inv
0f20: 61 6c 69 64 20 57 4b 54 20 64 65 66 69 6e 69 74 alid WKT definit
0f30: 69 6f 6e 2e 3c 2f 6c 69 3e 0d 0a 3c 75 6c 3e 0d ion.</li>..<ul>.
0f40: 0a 3c 2f 6c 69 3e 3c 62 3e 4e 55 4c 4c 3c 2f 62 .</li><b>NULL</b
0f50: 3e 20 77 69 6c 6c 20 62 65 20 72 65 74 75 72 6e > will be return
0f60: 65 64 20 6f 6e 20 69 6e 76 61 6c 69 64 20 61 72 ed on invalid ar
0f70: 67 75 6d 65 6e 74 73 20 6f 72 20 69 66 20 74 68 guments or if th
0f80: 65 20 53 68 61 70 65 66 69 6c 65 20 64 6f 65 73 e Shapefile does
0f90: 20 6e 6f 74 20 65 78 69 73 74 2e 3c 2f 6c 69 3e not exist.</li>
0fa0: 0d 0a 3c 2f 6c 69 3e 3c 2f 75 6c 3e 0d 0a 3c 2f ..</li></ul>..</
0fb0: 75 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d ul>..<verbatim>.
0fc0: 0a 53 45 4c 45 43 54 20 49 6d 70 6f 72 74 5a 69 .SELECT ImportZi
0fd0: 70 53 48 50 20 28 20 27 63 3a 2f 75 73 65 72 73 pSHP ( 'c:/users
0fe0: 2f 61 66 75 72 69 2f 44 6f 77 6e 6c 6f 61 64 73 /afuri/Downloads
0ff0: 2f 4c 69 6d 69 74 69 30 31 30 31 32 30 32 30 2e /Limiti01012020.
1000: 7a 69 70 27 20 2c 20 0d 0a 20 20 20 20 20 20 20 zip' , ..
1010: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 '
1020: 4c 69 6d 69 74 69 30 31 30 31 32 30 32 30 2f 43 Limiti01012020/C
1030: 6f 6d 30 31 30 31 32 30 32 30 2f 43 6f 6d 30 31 om01012020/Com01
1040: 30 31 32 30 32 30 5f 57 47 53 38 34 27 20 2c 20 012020_WGS84' ,
1050: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..
1060: 20 20 20 20 20 20 20 20 27 63 6f 6d 75 6e 69 27 'comuni'
1070: 2c 20 27 55 54 46 2d 38 27 20 29 20 0d 0a 2d 2d , 'UTF-8' ) ..--
1080: 2d 2d 2d 2d 2d 2d 2d 0d 0a 37 39 30 34 0d 0a 3c -------..7904..<
1090: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 20 /verbatim>..The
10a0: 3c 62 3e 49 6d 70 6f 72 74 5a 69 70 53 48 50 28 <b>ImportZipSHP(
10b0: 29 3c 2f 62 3e 20 63 6c 6f 73 65 6c 79 20 6d 69 )</b> closely mi
10c0: 6d 69 63 73 20 3c 62 3e 49 6d 70 6f 72 74 53 48 mics <b>ImportSH
10d0: 50 28 29 3c 2f 62 3e 2c 20 65 78 63 65 70 74 20 P()</b>, except
10e0: 69 6e 20 74 68 61 74 20 69 74 20 72 65 71 75 69 in that it requi
10f0: 72 65 73 20 6f 6e 65 20 6d 6f 72 65 20 61 72 67 res one more arg
1100: 75 6d 65 6e 74 20 73 70 65 63 69 66 79 69 6e 67 ument specifying
1110: 20 74 68 65 20 70 61 74 68 6e 61 6d 65 20 6f 66 the pathname of
1120: 20 74 68 65 20 5a 69 70 66 69 6c 65 20 63 6f 6e the Zipfile con
1130: 74 61 69 6e 69 6e 67 20 74 68 65 20 53 68 61 70 taining the Shap
1140: 65 66 69 6c 65 20 74 6f 20 62 65 20 69 6d 70 6f efile to be impo
1150: 72 74 65 64 2e 3c 62 72 3e 0d 0a 4f 6e 20 73 75 rted.<br>..On su
1160: 63 63 65 73 73 20 69 74 20 77 69 6c 6c 20 72 65 ccess it will re
1170: 74 75 72 6e 20 74 68 65 20 6e 75 6d 62 65 72 20 turn the number
1180: 6f 66 20 66 65 61 74 75 72 65 73 20 69 6e 73 65 of features inse
1190: 72 74 65 64 20 69 6e 74 6f 20 74 68 65 20 53 70 rted into the Sp
11a0: 61 74 69 61 6c 20 54 61 62 6c 65 20 74 68 61 74 atial Table that
11b0: 20 68 61 73 20 6a 75 73 74 20 62 65 65 6e 20 63 has just been c
11c0: 72 65 61 74 65 64 3b 20 6f 6e 20 66 61 69 6c 75 reated; on failu
11d0: 72 65 20 69 74 20 77 69 6c 6c 20 6a 75 73 74 20 re it will just
11e0: 72 65 74 75 72 6e 20 3c 62 3e 4e 55 4c 4c 3c 2f return <b>NULL</
11f0: 62 3e 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 49 6e 20 b>.<br><br>..In
1200: 69 74 73 20 73 69 6d 70 6c 65 73 74 20 66 6f 72 its simplest for
1210: 6d 20 69 74 20 72 65 71 75 69 72 65 73 20 6a 75 m it requires ju
1220: 73 74 20 66 6f 75 72 20 61 72 67 75 6d 65 6e 74 st four argument
1230: 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 s:..<ul>..<li>th
1240: 65 20 61 62 73 6f 6c 75 74 65 20 6f 72 20 72 65 e absolute or re
1250: 6c 61 74 69 76 65 20 70 61 74 68 20 6c 65 61 64 lative path lead
1260: 69 6e 67 20 74 6f 20 74 68 65 20 5a 69 70 66 69 ing to the Zipfi
1270: 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 le.</li>..<li>th
1280: 65 20 3c 62 3e 3c 69 3e 62 61 73 65 6e 61 6d 65 e <b><i>basename
1290: 3c 2f 69 3e 3c 2f 62 3e 20 6f 66 20 74 68 65 20 </i></b> of the
12a0: 53 68 61 70 65 66 69 6c 65 20 77 69 74 68 69 6e Shapefile within
12b0: 20 74 68 65 20 5a 69 70 66 69 6c 65 20 28 77 69 the Zipfile (wi
12c0: 74 68 6f 75 74 20 61 64 64 69 6e 67 20 61 6e 79 thout adding any
12d0: 20 3c 62 3e 2e 73 68 70 3c 2f 62 3e 2c 20 3c 62 <b>.shp</b>, <b
12e0: 3e 2e 73 68 78 3c 2f 62 3e 20 6f 72 20 3c 62 3e >.shx</b> or <b>
12f0: 2e 64 62 66 3c 2f 62 3e 20 73 75 66 66 69 78 29 .dbf</b> suffix)
1300: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 .</li>..<li>the
1310: 6e 61 6d 65 20 6f 66 20 74 68 65 20 53 70 61 74 name of the Spat
1320: 69 61 6c 20 54 61 62 6c 65 20 74 6f 20 62 65 20 ial Table to be
1330: 63 72 65 61 74 65 64 20 61 6e 64 20 74 68 65 6e created and then
1340: 20 70 6f 70 75 6c 61 74 65 64 20 62 79 20 69 6d populated by im
1350: 70 6f 72 74 69 6e 67 20 74 68 65 20 77 68 6f 6c porting the whol
1360: 65 20 53 68 61 70 65 66 69 6c 65 2e 3c 2f 6c 69 e Shapefile.</li
1370: 3e 0d 0a 3c 6c 69 3e 74 68 65 20 6e 61 6d 65 20 >..<li>the name
1380: 6f 66 20 74 68 65 20 63 68 61 72 73 65 74 20 65 of the charset e
1390: 6e 63 6f 64 69 6e 67 20 61 64 6f 70 74 65 64 20 ncoding adopted
13a0: 62 79 20 74 68 65 20 3c 62 3e 2e 64 62 66 3c 2f by the <b>.dbf</
13b0: 62 3e 20 6d 65 6d 62 65 72 20 6f 66 20 74 68 65 b> member of the
13c0: 20 53 68 61 70 65 66 69 6c 65 2e 3c 2f 6c 69 3e Shapefile.</li>
13d0: 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 76 65 72 62 61 74 ..</ul>..<verbat
13e0: 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 49 6d 70 6f im>..SELECT Impo
13f0: 72 74 5a 69 70 53 48 50 20 28 20 27 63 3a 2f 75 rtZipSHP ( 'c:/u
1400: 73 65 72 73 2f 61 66 75 72 69 2f 44 6f 77 6e 6c sers/afuri/Downl
1410: 6f 61 64 73 2f 4c 69 6d 69 74 69 30 31 30 31 32 oads/Limiti01012
1420: 30 32 30 2e 7a 69 70 27 20 2c 20 0d 0a 20 20 20 020.zip' , ..
1430: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1440: 20 20 20 27 4c 69 6d 69 74 69 30 31 30 31 32 30 'Limiti010120
1450: 32 30 2f 52 65 67 30 31 30 31 32 30 32 30 2f 52 20/Reg01012020/R
1460: 65 67 30 31 30 31 32 30 32 30 5f 57 47 53 38 34 eg01012020_WGS84
1470: 27 20 2c 20 0d 0a 20 20 20 20 20 20 20 20 20 20 ' , ..
1480: 20 20 20 20 20 20 20 20 20 20 20 20 27 72 65 67 'reg
1490: 69 6f 6e 69 27 2c 20 27 55 54 46 2d 38 27 20 2c ioni', 'UTF-8' ,
14a0: 20 33 32 36 33 32 20 2c 20 27 74 68 65 5f 67 65 32632 , 'the_ge
14b0: 6f 6d 27 20 2c 20 27 63 6f 64 5f 72 65 67 27 20 om' , 'cod_reg'
14c0: 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ,..
14d0: 20 20 20 20 20 20 20 20 20 27 4d 55 4c 54 49 50 'MULTIP
14e0: 4f 4c 59 47 4f 4e 27 20 2c 20 30 20 2c 20 30 20 OLYGON' , 0 , 0
14f0: 2c 20 31 20 2c 20 30 20 2c 20 27 4c 4f 57 45 52 , 1 , 0 , 'LOWER
1500: 27 20 2c 20 31 20 2c 20 30 20 29 20 0d 0a 2d 2d ' , 1 , 0 ) ..--
1510: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 32 30 0d -----------..20.
1520: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 49 6e .</verbatim>..In
1530: 20 69 74 73 20 63 6f 6d 70 6c 65 74 65 20 66 6f its complete fo
1540: 72 6d 20 3c 62 3e 49 6d 70 6f 72 74 5a 69 70 53 rm <b>ImportZipS
1550: 48 50 28 29 3c 2f 62 3e 20 73 75 70 70 6f 72 74 HP()</b> support
1560: 73 20 74 68 65 73 65 20 66 75 72 74 68 65 72 20 s these further
1570: 6f 70 74 69 6f 6e 61 6c 20 61 72 67 75 6d 65 6e optional argumen
1580: 74 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 61 ts:..<ul>..<li>a
1590: 6e 20 65 78 70 70 6c 63 69 74 6c 79 20 73 74 61 n expplcitly sta
15a0: 74 65 64 20 53 52 49 44 3c 2f 6c 69 3e 0d 0a 3c ted SRID</li>..<
15b0: 6c 69 3e 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 li>the name of t
15c0: 68 65 20 47 65 6f 6d 65 74 72 79 20 43 6f 6c 75 he Geometry Colu
15d0: 6d 6e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 mn</li>..<li>the
15e0: 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 53 68 61 name of the Sha
15f0: 70 65 66 69 6c 65 73 20 63 6f 6c 75 6d 6e 20 74 pefiles column t
1600: 6f 20 62 65 20 61 73 73 75 6d 65 64 20 61 73 20 o be assumed as
1610: 74 68 65 20 50 72 69 6d 61 72 79 20 4b 65 79 3c the Primary Key<
1620: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6e 20 65 78 70 /li>..<li>an exp
1630: 6c 69 63 69 74 6c 79 20 73 65 74 20 47 65 6f 6d licitly set Geom
1640: 65 74 72 79 20 54 79 70 65 3c 2f 6c 69 3e 0d 0a etry Type</li>..
1650: 3c 6c 69 3e 61 20 3c 69 3e 62 6f 6f 6c 65 61 6e <li>a <i>boolean
1660: 3c 2f 69 3e 20 66 6c 61 67 20 72 65 71 75 65 73 </i> flag reques
1670: 74 69 6e 67 20 74 6f 20 63 61 73 74 20 61 6c 6c ting to cast all
1680: 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 74 6f 20 coordinates to
1690: 58 59 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 20 3c XY</li>..<li>a <
16a0: 69 3e 62 6f 6f 6c 65 61 6e 3c 2f 69 3e 20 66 6c i>boolean</i> fl
16b0: 61 67 20 72 65 71 75 65 73 74 69 6e 67 20 66 6f ag requesting fo
16c0: 72 20 43 6f 6d 70 72 65 73 73 65 64 20 47 65 6f r Compressed Geo
16d0: 6d 65 74 72 69 65 73 3c 2f 6c 69 3e 0d 0a 3c 6c metries</li>..<l
16e0: 69 3e 61 20 3c 69 3e 62 6f 6f 6c 65 61 6e 3c 2f i>a <i>boolean</
16f0: 69 3e 20 66 6c 61 67 20 72 65 71 75 65 73 74 69 i> flag requesti
1700: 6e 67 20 66 6f 72 20 63 72 65 61 74 69 6e 67 20 ng for creating
1710: 61 20 53 70 61 74 69 61 6c 20 49 6e 64 65 78 20 a Spatial Index
1720: 73 75 70 70 6f 72 74 69 6e 67 20 74 68 65 20 47 supporting the G
1730: 65 6f 6d 65 74 72 79 20 43 6f 6c 75 6d 6e 3c 2f eometry Column</
1740: 6c 69 3e 0d 0a 3c 6c 69 3e 61 20 3c 69 3e 62 6f li>..<li>a <i>bo
1750: 6f 6c 65 61 6e 3c 2f 69 3e 20 66 6c 61 67 20 72 olean</i> flag r
1760: 65 71 75 65 73 74 69 6e 67 20 66 6f 72 20 69 6d equesting for im
1770: 70 6f 72 74 69 6e 67 20 61 6c 6c 20 64 61 74 65 porting all date
1780: 20 76 61 6c 75 65 73 20 61 73 20 70 6c 61 69 6e values as plain
1790: 20 74 65 78 74 20 28 69 73 74 65 61 64 20 6f 66 text (istead of
17a0: 20 61 73 20 4a 75 6c 69 61 6e 20 44 61 74 65 73 as Julian Dates
17b0: 29 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 20 74 65 )</li>..<li>a te
17c0: 78 74 20 73 74 72 69 6e 67 20 73 75 63 68 20 61 xt string such a
17d0: 73 20 3c 62 3e 4c 4f 57 45 52 3c 2f 62 3e 2c 20 s <b>LOWER</b>,
17e0: 3c 62 3e 55 50 50 45 52 3c 2f 62 3e 20 6f 72 20 <b>UPPER</b> or
17f0: 3c 62 3e 53 41 4d 45 3c 2f 62 3e 20 73 70 65 63 <b>SAME</b> spec
1800: 69 66 79 69 6e 67 20 69 66 20 61 6c 6c 20 63 6f ifying if all co
1810: 6c 75 6d 6e 20 6e 61 6d 65 73 20 73 68 6f 75 6c lumn names shoul
1820: 64 20 62 65 20 72 65 73 70 74 65 63 74 69 76 65 d be resptective
1830: 6c 79 20 4c 6f 77 65 72 63 61 73 65 20 6f 72 20 ly Lowercase or
1840: 55 70 70 65 72 63 61 73 65 20 6f 72 20 61 73 20 Uppercase or as
1850: 69 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 20 is.</li>..<li>a
1860: 3c 69 3e 62 6f 6f 6c 65 61 6e 3c 2f 69 3e 20 66 <i>boolean</i> f
1870: 6c 61 67 20 66 6f 72 20 69 6d 6d 65 64 69 74 65 lag for immedite
1880: 6c 79 20 75 70 64 61 74 69 6e 67 20 74 61 62 6c ly updating tabl
1890: 65 27 73 20 53 74 61 74 69 73 74 69 63 73 3c 2f e's Statistics</
18a0: 6c 69 3e 0d 0a 3c 6c 69 3e 61 20 3c 69 3e 62 6f li>..<li>a <i>bo
18b0: 6f 6c 65 61 6e 3c 2f 69 3e 20 66 6c 61 67 20 61 olean</i> flag a
18c0: 63 74 69 76 61 74 69 6e 67 20 76 65 72 62 6f 73 ctivating verbos
18d0: 65 20 6d 6f 64 65 3c 2f 6c 69 3e 20 20 0d 0a 3c e mode</li> ..<
18e0: 2f 75 6c 3e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a /ul>..<br><br>..
18f0: 3c 68 72 3e 0d 0a 3c 68 33 3e 41 63 63 65 73 73 <hr>..<h3>Access
1900: 69 6e 67 20 61 20 5a 69 70 70 65 64 20 44 42 46 ing a Zipped DBF
1910: 3c 2f 68 33 3e 0d 0a 41 6c 6c 20 74 68 65 73 65 </h3>..All these
1920: 20 6e 65 77 20 53 51 4c 20 66 75 6e 63 74 69 6f new SQL functio
1930: 6e 73 20 61 72 65 20 6e 6f 77 20 73 75 70 70 6f ns are now suppo
1940: 72 74 65 64 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 rted:..<ul>..<li
1950: 3e 3c 62 3e 49 6d 70 6f 72 74 5a 69 70 44 42 46 ><b>ImportZipDBF
1960: 28 29 3c 2f 62 3e 3a 20 74 68 65 20 6d 61 69 6e ()</b>: the main
1970: 20 66 75 6e 63 74 69 6f 6e 20 61 6c 6c 6f 77 69 function allowi
1980: 6e 67 20 74 6f 20 69 6d 70 6f 72 74 20 61 20 77 ng to import a w
1990: 68 6f 6c 65 20 44 42 46 20 66 69 6c 65 20 69 6e hole DBF file in
19a0: 74 6f 20 61 20 6e 65 77 20 54 61 62 6c 65 20 69 to a new Table i
19b0: 6e 74 6f 20 74 68 65 20 63 75 72 72 65 6e 74 6c nto the currentl
19c0: 79 20 63 6f 6e 6e 65 63 74 65 64 20 44 61 74 61 y connected Data
19d0: 62 61 73 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e base.</li>..<li>
19e0: 3c 62 3e 5a 69 70 66 69 6c 65 5f 4e 75 6d 44 42 <b>Zipfile_NumDB
19f0: 46 28 29 3c 2f 62 3e 3a 20 61 20 68 65 6c 70 65 F()</b>: a helpe
1a00: 72 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 r function retur
1a10: 6e 69 6e 67 20 74 68 65 20 74 6f 74 61 6c 20 63 ning the total c
1a20: 6f 75 6e 74 20 6f 66 20 44 42 46 20 66 69 6c 65 ount of DBF file
1a30: 73 20 63 6f 6e 74 61 69 6e 65 64 20 77 69 74 68 s contained with
1a40: 69 6e 20 61 20 67 69 76 65 6e 20 5a 69 70 66 69 in a given Zipfi
1a50: 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 le.</li>..<li><b
1a60: 3e 5a 69 70 66 69 6c 65 5f 44 62 66 4e 28 29 3c >Zipfile_DbfN()<
1a70: 2f 62 3e 3a 20 61 20 68 65 6c 70 65 72 20 66 75 /b>: a helper fu
1a80: 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 nction returning
1a90: 20 74 68 65 20 3c 62 3e 3c 69 3e 66 69 6c 65 6e the <b><i>filen
1aa0: 61 6d 65 3c 2f 69 3e 3c 2f 62 3e 20 66 6f 72 20 ame</i></b> for
1ab0: 74 68 65 20 3c 62 3e 4e 74 68 3c 2f 62 3e 20 44 the <b>Nth</b> D
1ac0: 42 46 20 66 69 6c 65 20 63 6f 6e 74 61 69 6e 65 BF file containe
1ad0: 64 20 77 69 74 68 69 6e 20 61 20 67 69 76 65 6e d within a given
1ae0: 20 5a 69 70 66 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a Zipfile.</li>..
1af0: 3c 2f 75 6c 3e 0d 0a 0d 0a 3c 62 72 3e 3c 68 72 </ul>....<br><hr
1b00: 3e 3c 62 72 3e 0d 0a 42 61 63 6b 20 74 6f 20 3c ><br>..Back to <
1b10: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f a href="https://
1b20: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f www.gaia-gis.it/
1b30: 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 fossil/libspatia
1b40: 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 35 lite/wiki?name=5
1b50: 2e 30 2e 30 2d 64 6f 63 22 3e 6d 61 69 6e 20 53 .0.0-doc">main S
1b60: 70 61 74 69 61 4c 69 74 65 20 70 61 67 65 3c 2f patiaLite page</
1b70: 61 3e 0a 5a 20 34 38 34 62 34 36 30 61 39 65 62 a>.Z 484b460a9eb
1b80: 65 37 65 33 63 39 34 63 61 63 33 61 38 66 65 66 e7e3c94cac3a8fef
1b90: 39 38 39 33 33 0a 98933.