D 2020-05-08T09:16:14.826 L ZippedSHP P d1f953cf63330714941fe06556b55e00996f8cd1 U sandro W 4576 Back to main SpatiaLite page

Reading SHP and DBF files directly from within a Zipfile

Starting since version 5.0.0 SpatiaLite has the capability to directly read any Shapefile (or DBF file) contained within a compressed Zipfile.
Several closely related SQL functions have been introduced as well.

Accessing a Zipped SHP

All these new SQL functions are now supported:
We'll now start a quick tutorial about using all these new SQL functions. Note: the tutorial is based on the dataset you can download from here SELECT Zipfile_NumSHP ( 'c:/users/afuri/Downloads/Limiti01012020.zip' ) ------------ 4 SELECT Zipfile_shpN ( 'c:/users/afuri/Downloads/Limiti01012020.zip' , 1 ) ------ Limiti01012020/Com01012020/Com01012020_WGS84 SELECT Zipfile_shpN ( 'c:/users/afuri/Downloads/Limiti01012020.zip' , 2 ) ------ Limiti01012020/ProvCM01012020/ProvCM01012020_WGS84 SELECT Zipfile_shpN ( 'c:/users/afuri/Downloads/Limiti01012020.zip' , 3 ) ------ Limiti01012020/Reg01012020/Reg01012020_WGS84 SELECT Zipfile_shpN ( 'c:/users/afuri/Downloads/Limiti01012020.zip' , 4 ) ------- Limiti01012020/RipGeo01012020/RipGeo01012020_WGS84 SELECT PROJ_GuessSridFromZipSHP ( 'c:/users/afuri/Downloads/Limiti01012020.zip' , 'Limiti01012020/Com01012020/Com01012020_WGS84' ) ------------ 32632
  • the SQL function PROJ_GuessSridFromZipSHP() will inspect a Zipfile then returning the SRID value declared by the .PRJ member of the Shapefile contained into the Zipfiles as identified by its basename.
  • it requires two argumenst:
  • Note: -1 will be returned if the Shapefile has no .PRJ member, of if it contains an invalid WKT definition.



  • Accessing a Zipped DBF

    All these new SQL functions are now supported:


    Back to main SpatiaLite page Z 51021521a3f2e42a91b5654e0e3f56d3