<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Sebastian and others,</p>
    <p>I think the github has it wrong here  According to the
      documentation, the band count option is for <u>reading</u> the
      file and not creating the file.  What I don't get is the fact that
      the data is being changed significantly (but not as much as when
      the "rendered image" option is selected (as expected) so that's
      not the problem here).   I tried QUALITY = 100 for writing to see
      if some compression was going on but it's the same problem.  Looks
      like some scaling issues.  The 1 to 4 band is not a problem (as
      this is the standard read option) but the value changes are.<br>
    </p>
    <p>gdal_translate -of GPKG -co "QUALITY = 100"
      C:/Users/Nicolas/Desktop/Land_cover_Corine2018.tif
      C:/Users/Nicolas/Desktop/TEST.gpkg</p>
    <p>Nicolas<br>
    </p>
    <div class="moz-cite-prefix">On 2020-12-01 12:17 p.m., Sebastian
      Gutwein wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAED_52pFuAzSH3UtyR6S4M_dKBJ60pU2Jx1+P0Be2EOEOkGv7g@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">This looks like the same issue you are having. <a
          href="http://github.com/qgis/QGIS/issues/38227"
          moz-do-not-send="true">github.com/qgis/QGIS/issues/38227</a>
        <div>According to the documentation linked in the issue you need
          to set the band count to 1 otherwise it defaults to 4. </div>
        <div><a href="http://gdal.org/drivers/raster/gpkg.html"
            moz-do-not-send="true">gdal.org/drivers/raster/gpkg.html</a><br>
        </div>
        <div>I have not tried this to see if it works. </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, Dec 1, 2020 at 11:52
          AM Nicolas Cadieux <<a
            href="mailto:njacadieux.gitlab@gmail.com"
            moz-do-not-send="true">njacadieux.gitlab@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>
            <p>Hi,<br>
            </p>
            <p>Looking at it now.  I see what you see.  I will try a few
              things.</p>
            <p>Nicolas<br>
            </p>
            <div>On 2020-12-01 11:42 a.m., Alberto Vavassori wrote:<br>
            </div>
            <blockquote type="cite">
              <div>
                <p class="MsoNormal"><span style="font-size:12pt">Hi
                    Nicolas,</span></p>
                <p class="MsoNormal"><span style="font-size:12pt"
                    lang="EN-US">thank you for the answer. I send the
                    raster that I am interested in.</span></p>
                <p class="MsoNormal"><span style="font-size:12pt"
                    lang="EN-US">Alberto</span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <div>
                  <div
style="border-right:none;border-bottom:none;border-left:none;border-top:1pt
                    solid rgb(225,225,225);padding:3pt 0cm 0cm">
                    <p class="MsoNormal"><b><span>Da:</span></b><span>
                        Nicolas Cadieux <a
                          href="mailto:njacadieux.gitlab@gmail.com"
                          target="_blank" moz-do-not-send="true"><njacadieux.gitlab@gmail.com></a>
                        <br>
                        <b>Inviato:</b> martedì 1 dicembre 2020 17:40<br>
                        <b>A:</b> Alberto Vavassori <a
                          href="mailto:alberto.vavassori@polimi.it"
                          target="_blank" moz-do-not-send="true"><alberto.vavassori@polimi.it></a><br>
                        <b>Cc:</b> <a
                          href="mailto:qgis-user@lists.osgeo.org"
                          target="_blank" moz-do-not-send="true">qgis-user@lists.osgeo.org</a><br>
                        <b>Oggetto:</b> Re: [Qgis-user] Importing a
                        raster into a Geopackage</span></p>
                  </div>
                </div>
                <p class="MsoNormal"> </p>
                <p>Hi,<span></span></p>
                <p>Send a sample data set if you can't figure it out.</p>
                <p>Nicolas</p>
                <div>
                  <p class="MsoNormal">On 2020-12-01 10:35 a.m., Nicolas
                    Cadieux wrote:</p>
                </div>
                <blockquote style="margin-top:5pt;margin-bottom:5pt">
                  <p class="MsoNormal">Hi, </p>
                  <div>
                    <p class="MsoNormal">Perhaps this can help: <a
                        href="https://gdal.orgdrivers/raster/gpkg.html"
                        target="_blank" moz-do-not-send="true">https://gdal.orgdrivers/raster/gpkg.html</a></p>
                  </div>
                  <div>
                    <p class="MsoNormal"> </p>
                  </div>
                  <div>
                    <p
style="margin-right:0cm;margin-bottom:18pt;margin-left:0cm;line-height:18pt;box-sizing:border-box">
                      <span
                        style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(64,64,64)">“Various
                        kind of input datasets can be converted to
                        GeoPackage raster :</span></p>
                    <p
style="margin-right:0cm;margin-bottom:0cm;margin-left:54pt;line-height:18pt;box-sizing:border-box">
                      <span
                        style="font-size:10pt;font-family:Symbol;color:rgb(64,64,64)"><span>·<span
                            style="font:7pt "Times New Roman"">       
                          </span></span></span><span
                        style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(64,64,64)">Single
                        band grey level</span></p>
                    <p
style="margin-right:0cm;margin-bottom:0cm;margin-left:54pt;line-height:18pt;box-sizing:border-box">
                      <span
                        style="font-size:10pt;font-family:Symbol;color:rgb(64,64,64)"><span>·<span
                            style="font:7pt "Times New Roman"">       
                          </span></span></span><span
                        style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(64,64,64)">Single
                        band with R,G,B or R,G,B,A color table</span></p>
                    <p
style="margin-right:0cm;margin-bottom:0cm;margin-left:54pt;line-height:18pt;box-sizing:border-box">
                      <span
                        style="font-size:10pt;font-family:Symbol;color:rgb(64,64,64)"><span>·<span
                            style="font:7pt "Times New Roman"">       
                          </span></span></span><span
                        style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(64,64,64)">Two
                        bands: first band with grey level, second band
                        with alpha channel</span></p>
                    <p
style="margin-right:0cm;margin-bottom:0cm;margin-left:54pt;line-height:18pt;box-sizing:border-box">
                      <span
                        style="font-size:10pt;font-family:Symbol;color:rgb(64,64,64)"><span>·<span
                            style="font:7pt "Times New Roman"">       
                          </span></span></span><span
                        style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(64,64,64)">Three
                        bands: Red, Green, Blue</span></p>
                    <p
style="margin-right:0cm;margin-bottom:0cm;margin-left:54pt;line-height:18pt;box-sizing:border-box">
                      <span
                        style="font-size:10pt;font-family:Symbol;color:rgb(64,64,64)"><span>·<span
                            style="font:7pt "Times New Roman"">       
                          </span></span></span><span
                        style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(64,64,64)">Four
                        band: Red, Green, Blue, Alpha</span></p>
                    <p
style="margin-right:0cm;margin-bottom:18pt;margin-left:0cm;line-height:18pt;box-sizing:border-box">
                      <span
                        style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(64,64,64)">GeoPackage
                        rasters only support Byte data type.”</span></p>
                    <p
style="margin-right:0cm;margin-bottom:18pt;margin-left:0cm;line-height:18pt;box-sizing:border-box">
                      <span
                        style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(64,64,64)">My
                        guess is that if the original raster does not
                        correspond to one of the categories above, it
                        will be converted to the closest format. </span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"> </p>
                    <div>
                      <p class="MsoNormal">Nicolas Cadieux </p>
                      <div>
                        <p class="MsoNormal"><a
                            href="https://gitlab.com/njacadieux"
                            target="_blank" moz-do-not-send="true">https://gitlab.com/njacadieux</a></p>
                      </div>
                    </div>
                    <div>
                      <p class="MsoNormal"><br>
                        <br>
                      </p>
                      <blockquote
                        style="margin-top:5pt;margin-bottom:5pt">
                        <p class="MsoNormal" style="margin-bottom:12pt">Le
                          1 déc. 2020 à 09:58, Alberto Vavassori <a
                            href="mailto:alberto.vavassori@polimi.it"
                            target="_blank" moz-do-not-send="true"><alberto.vavassori@polimi.it></a>
                          a écrit :</p>
                      </blockquote>
                    </div>
                    <blockquote style="margin-top:5pt;margin-bottom:5pt">
                      <div>
                        <p class="MsoNormal"> <span></span></p>
                        <p class="MsoNormal"><span
                            style="font-size:12pt" lang="EN-US">Hello
                            everybody. I have an issue regarding the
                            Geopackage format. I have tried to import a
                            singleband raster file (it represents the
                            land cover, thus every pixel has a single
                            integer value corresponding to the land
                            cover class), but this operation seems to
                            modify the raster characteristics: the
                            raster becomes a 4-bands raster and the
                            pixels values change accordingly (basically,
                            the original raster is saved in the
                            Geopackage as an RGB image). It seems to be
                            a bug of QGIS. I have also tried to use GDAL
                            translate through the processing toolbox of
                            QGIS to convert the TIFF file to a
                            Geopackage file, but the result is the same.</span></p>
                        <p class="MsoNormal"><span
                            style="font-size:12pt" lang="EN-US">Has
                            anybody faced this problem? May anybody
                            suggest a way to work this problem out?</span></p>
                        <p class="MsoNormal"><span
                            style="font-size:12pt" lang="EN-US">Thank
                            you.</span></p>
                        <p class="MsoNormal"><span
                            style="font-size:12pt" lang="EN-US">Alberto</span></p>
                        <p class="MsoNormal"><span>_______________________________________________<br>
                            Qgis-user mailing list<br>
                            <a href="mailto:Qgis-user@lists.osgeo.org"
                              target="_blank" moz-do-not-send="true">Qgis-user@lists.osgeo.org</a><br>
                            List info: <a
                              href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
                              target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
                            Unsubscribe: <a
                              href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
                              target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span></p>
                      </div>
                    </blockquote>
                  </div>
                </blockquote>
                <pre>-- </pre>
                <pre>Nicolas Cadieux</pre>
                <pre><a href="https://gitlab.com/njacadieux" target="_blank" moz-do-not-send="true">https://gitlab.com/njacadieux</a></pre>
              </div>
            </blockquote>
            <pre cols="72">-- 
Nicolas Cadieux
<a href="https://gitlab.com/njacadieux" target="_blank" moz-do-not-send="true">https://gitlab.com/njacadieux</a></pre>
          </div>
          _______________________________________________<br>
          Qgis-user mailing list<br>
          <a href="mailto:Qgis-user@lists.osgeo.org" target="_blank"
            moz-do-not-send="true">Qgis-user@lists.osgeo.org</a><br>
          List info: <a
            href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
          Unsubscribe: <a
            href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
        </blockquote>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Nicolas Cadieux
<a class="moz-txt-link-freetext" href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a></pre>
  </body>
</html>