Artifact [d1f953cf63]
Not logged in

Artifact d1f953cf63330714941fe06556b55e00996f8cd1:

Wiki page [ZippedSHP] by sandro 2020-05-07 15:52:09.
D 2020-05-07T15:52:09.359
L ZippedSHP
P 92e307619c5f458be88dc0a7db871be81a09e62d
U sandro
W 1912
Back to <a href="https://www.gaia-gis.it/fossil/libspatialite/wiki?name=5.0.0-doc">main SpatiaLite page</a>
<h2>Reading SHP and DBF files directly from within a Zipfile</h2>
Starting since version <b>5.0.0</b> SpatiaLite has the capability to directly read any <b>Shapefile</b> (or <b>DBF</b> file) contained within a compressed <b>Zipfile</b>.<br>
Several closely related SQL functions have been introduced as well.
<h3>Accessing a Zipped SHP</h3>
All these new SQL functions are now supported:
<ul>
<li><b>ImportZipSHP()</b>: the main function allowing to import a whole Shapefile into a new Spatial Table into the currently connected Database.</li>
<li><b>PROJ_GuessSridFromZipSHP()</b>: a helper fuction for attempting to guess the SRID for a given zipped SHP.</li>
<li><b>Zipfile_NumSHP()</b>: a helper function returning the total count of Shapefiles contained within a given Zipfile.</li>
<li><b>Zipfile_ShpN()</b>: a helper function returning the <b><i>basename</i></b> for the <b>Nth</b> Shapefile contained within a given Zipfile.</li>
</ul>
<br>
We'll now start a quick tutorial about using all these new SQL functions.
<verbatim>
SELECT Zipfile_NumSHP ( 'c:/users/afuri/Downloads/Limiti01012020.zip' )
------------
4
</verbatim>
<br><br>
<hr>
<h3>Accessing a Zipped DBF</h3>
All these new SQL functions are now supported:
<ul>
<li><b>ImportZipDBF()</b>: the main function allowing to import a whole DBF file into a new Table into the currently connected Database.</li>
<li><b>Zipfile_NumDBF()</b>: a helper function returning the total count of DBF files contained within a given Zipfile.</li>
<li><b>Zipfile_DbfN()</b>: a helper function returning the <b><i>filename</i></b> for the <b>Nth</b> DBF file contained within a given Zipfile.</li>
</ul>

<br><hr><br>
Back to <a href="https://www.gaia-gis.it/fossil/libspatialite/wiki?name=5.0.0-doc">main SpatiaLite page</a>
Z bdc2f9f62d987e1a29d5b1b1eb09b684