<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font size="4">Hi Richard,<br>
         Your "wild guess" is exactly right.  I tested it.  I copied
      file "GardenA.qml" into the same folder where "GardenA.zip" is
      located.  Then told QGIS to add vector layer "GardenA.zip".   It
      added layer "GardenA" using the correct color and labels.  A
      similar test added layer "GardenAtrees.zip" with the correct svg
      symbol. <br>
         You've solved the mystery.  THANK YOU.<br>
         I'm not happy with the resulting layer name ("GardenA -
      GardenA.shp" instead of just "GardenA") so I'll have to change all
      the layer names.  But I can write a Python script to do that.)<br>
          I've never used </font><font size="4">geopackages.  Something
      new for me to learn.<br>
                 Cheers,<br>
                     Steve<br>
      <br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 5/30/2022 3:44 AM, Richard
      Duivenvoorde wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:4104b139-8031-47a5-45a4-250063310d10@duif.net">Hi
      Stephen,
      <br>
      <br>
      Wild guessing here (not tested).
      <br>
      <br>
      I think: GDAL is responsible for loading the data from shape OR
      zipped shape
      <br>
      QGIS is responsible for loading of a corresponding qml file.
      <br>
      <br>
      Normally, when QGIS (using GDAL) loads foo.shp, it will check if
      there is a foo.sld or foo.qml NEXT to it, and if so, uses it to
      STYLE the data.
      <br>
      <br>
      Now if you zipped foo.shp+files into foo.zip...
      <br>
      Maybe QGIS is clever enough to ALSO look INTO the zip (and if not,
      this would be a nice Feature Request...)
      <br>
      But else: try to put foo.qml next to the foo.zip
      <br>
      <br>
      But if you zipped the files into bar.zip...
      <br>
      Then I would try to put a 'bar.qml' next to it (and hoping that
      QGIS decides that it has the same 'base name'.
      <br>
      <br>
      If all that fails: I would create a Feature Request for it (or
      start using Geopackages ...)
      <br>
      <br>
      Note that using geopackages, you also have 1 file, and you can
      save style INTO the geopackage (and even put more layers+styles
      into it etc etc).
      <br>
      <br>
      Regards,
      <br>
      <br>
      Richard Duivenvoorde
      <br>
      <br>
      <br>
      <br>
      On 5/29/22 19:02, Stephen Sacks via Qgis-user wrote:
      <br>
      <blockquote type="cite">Hi Phil,
        <br>
            Thanks for your reply.   This morning I updated my QGIS from
        version 3.16.3 to version 3.22.7 .  With complete optimism, I
        reloaded several layers from zipped shapefiles, but alas the
        problem remains:  polygons appear in random colors and without
        labels and point layers have dots instead of the svg icons they
        have when I load the same layers from the un-zipped six
        shapefile files.  When I examine the zip files with Windows File
        Explorer, I see the .qml files are there and uncorrupted.
        <br>
            I'm using a five-year-old plain vanilla Dell desktop running
        64-bit Windows 10.
        <br>
            I did the zipping with Thunderbird's Archive.  Then,
        separately, zipped one layer with Windows File Explorer zipper.
        Same result.
        <br>
            Am I doing something wrong?  Shall I try updating to  QGIS
        3.24 ?  Is it "stable"?  What does it mean that version 3.22 is
        "stable"?
        <br>
        <br>
            Steve
        <br>
        <br>
        <br>
        On 5/29/2022 12:03 AM, Phil Wyatt wrote:
        <br>
        <blockquote type="cite">
          <br>
          Hi Stephen,
          <br>
          <br>
          You might let us know your operating system and which version
          of QGIS you are using because it works as you desire in the
          latest development (3.24.3)  and Long Term Release versions
          (3.22.7). It may just be a matter of updating QGIS.
          <br>
          <br>
          Cheers - Phil
          <br>
          <br>
          *From:*Qgis-user <a class="moz-txt-link-rfc2396E" href="mailto:qgis-user-bounces@lists.osgeo.org"><qgis-user-bounces@lists.osgeo.org></a> *On
          Behalf Of *Stephen Sacks via Qgis-user
          <br>
          *Sent:* Sunday, 29 May 2022 5:29 AM
          <br>
          *To:* qgis forum <a class="moz-txt-link-rfc2396E" href="mailto:qgis-user@lists.osgeo.org"><qgis-user@lists.osgeo.org></a>
          <br>
          *Subject:* [Qgis-user] adding a layer from a zipped file
          <br>
          <br>
          <br>
          When I write a layer as a shape file, it appears on my C:
          drive as six files, all with the same name but different
          extensions.  Then I zip those six into a single file
          (xxx.zip).  When I reload that layer from the zip file (Layer
          > AddLayer > VectorLayer > File > Dataset >
          xxx.zip), QGIS is almost smart enough to restore the layer
          correctly.  The polygon features are in the right place and
          their attribute table is correct. *My problem* is that it
          ignores one of the six files, the "style" file (xxx .qml)
          which  specifies color, labeling, and symbol).  Do I  have to
          unzip before restoring layer xxx ?  I know I could open the
          layer's properties and use  Style > Load Style from  file
          xxx.qml .  But when I'm restoring several layers that's a lot
          of key strokes (and may require that I unzip).  It seems to me
          that this shouldn't be necessary.  [I encounter the same
          problem with point layers and polygon layers.]
          <br>
          <br>
        </blockquote>
        <br>
        <br>
        _______________________________________________
        <br>
        Qgis-user mailing list
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
        <br>
        List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
        <br>
        Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>