<div dir="ltr">Thanks - so is there a way to list the content of the zip file or do I use some other tool for that?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 6, 2022 at 10:50 AM Daniel Evans <<a href="mailto:daniel.fred.evans@gmail.com">daniel.fred.evans@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Sharon,</div><div><br></div><div>I think all you need to do is define the path to open as:</div><div><br></div><div>
<pre style="margin-top:0px;margin-bottom:0px">'/vsizip//parks-and-recreation-feature-map-d.zip/parks-and-recreation-feature-map/parks-and-recreation-feature-map.shp'<br><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif">i.e. defining the filepath as:<br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif">/vsizip/<path to the zip>/<path inside the zip><br><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif">When the zip contains only a single (shape)file at the top level - the case where you've got it working - GDAL automatically determines the file to open.<br><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif">Docs at: <a href="https://gdal.org/user/virtual_file_systems.html#vsizip-zip-archives" target="_blank">https://gdal.org/user/virtual_file_systems.html#vsizip-zip-archives</a><br><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif">Cheers,<br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif">Daniel<br></span></pre>

</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 6 Sept 2022 at 15:30, Sharon Eldor <<a href="mailto:seldor@kinetica.com" target="_blank">seldor@kinetica.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div>Trying to read shapefiles from a zip archive, I am running:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(255,128,128)">GDALDataset</span>::Open('/vsizip//parks-and-recreation-feature-map-d.zip'<span style="font-family:Arial,Helvetica,sans-serif">,</span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(190,192,194)"> </span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(255,106,173)">GDAL_OF_VECTOR</span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(190,192,194)"> </span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(214,187,154)">|</span><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(190,192,194)">                                  </span><span style="color:rgb(255,106,173)">GDAL_OF_READONLY</span><span style="color:rgb(190,192,194)"> </span><span style="color:rgb(214,187,154)">|</span><span style="color:rgb(190,192,194)"> </span><span style="color:rgb(255,106,173)">GDAL_OF_VERBOSE_ERROR</span><span style="color:rgb(190,192,194)"> </span><span style="color:rgb(214,187,154)">|</span><span style="color:rgb(190,192,194)"> </span><span style="color:rgb(255,106,173)">GDAL_OF_SHARED</span>,</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(190,192,194)">                                  </span>NULL,<span style="color:rgb(190,192,194)"> </span>NULL,<span style="color:rgb(190,192,194)"> </span>NULL<span style="color:rgb(190,192,194)"> </span>)</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">When there is a directory in the zip, I get an error:</pre><pre style="margin-top:0px;margin-bottom:0px">Error: `/vsizip//parks-and-recreation-feature-map-d.zip' not recognized as a supported file format.</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">When the files are not under a directory in the zip (same files), the zip file is read with no error.</pre><pre style="margin-top:0px;margin-bottom:0px">Attaching 2 files for example.</pre><pre style="margin-top:0px;margin-bottom:0px">Is there a way to directly read the files from the archive with the directory?</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Thanks,</pre><pre style="margin-top:0px;margin-bottom:0px">Sharon</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre></div></div>

<br>
<p style="margin:0in;font-family:Calibri,sans-serif"><i><span style="font-family:"Times New Roman",serif;background:none 0% 0% repeat scroll white"><font size="2" color="#808080">The contents of this email message and any attachments are the property of Kinetica DB, Inc. and may contain confidential or privileged information intended solely for the addressee(s). Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender by reply e-mail, then delete all copies of the communication and any attachments.</font></span></i><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></p>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>
</blockquote></div>

<br>
<p style="margin:0in;font-family:Calibri,sans-serif"><i><span style="font-family:"Times New Roman",serif;background:white"><font size="2" color="#808080">The contents of this email message and any attachments are the property of Kinetica DB, Inc. and may contain confidential or privileged information intended solely for the addressee(s). Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender by reply e-mail, then delete all copies of the communication and any attachments.</font></span></i><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></p>