I have thousands of shapefiles in .zip archives to work with. How can I use ogr2ogr and other GDAL/OGR tools to work with these data without having to extract the archives first?
From gdal cheatsheet and Reading a GDAL dataset in a .gz file or a .zip archive I know that I can use the visizip
driver, but for formats that consist of multiple files per data layer like shapefile you need to explicitly name the file inside the archive:
ogrinfo /vsizip/archive.zip/105A_wetland_a.shp
How might I efficiently work with archives, that could contain multiple shapefiles per zip, without having to know the and pass the name of each layer ahead of time? e.g.
ogrinfo /vsizip/archive.zip
Example archive file: bndt_105a_shp_en.zip from Geogratis.
Best Answer
Your command is basically OK but the error message looks worse than it actually is. The important message is
You can open files from zip but you can't update them. If you read the zip as read-only you can get rid of the error messages.
It is possible to convert all the layers into any format that supports multiple layers with a one-line command. As an example a conversion into GeoPackage:
Adding more data to existing layers and adding new layers into existing GeoPackage should go this way: