<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Abel,</p>
    <p><br>
    </p>
    <p>there is a subtelty:</p>
    <p>a) If bands may have invalid pixels at different locations on
      different bands, and that those bands have a different nodata
      value, then using GDALRasterBand::SetNoDataValue() is the way to
      go.</p>
    <p>b) If a given pixel is invalid only if its value on all bands
      matches the nodata value on each band, then NODATA_VALUES should
      be set instead<br>
    </p>
    <p><br>
    </p>
    <p>Example with 2 bands:</p>
    <p>- Band 1, NoData=1,  pixel_1=1, pixel_2=1<br>
    </p>
    <p>- Band 2, NoData=2,  pixel_1=2, pixel_2=0</p>
    <p><br>
    </p>
    <p>In interpretation a), then pixel_1 and pixel_2 are invalid for
      Band 1, and pixel_1 is invalid for Band 2</p>
    <p>In interpretation b), then only pixel_1 is invalid (for both
      bands)<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Le 21/05/2025 à 08:46, Abel Pau via
      gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:PAXPR07MB777503F110D43E498D33AC66FA9EA@PAXPR07MB7775.eurprd07.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div class="elementToProof"
style="margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        Hello,</div>
      <div class="elementToProof"
style="margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        I am implementing a driver that allows different NODATA values
        for each band in a dataset.</div>
      <div class="elementToProof"
style="margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        >From what I understand in the documentation, I should use
        the <code>NODATA_VALUES</code> metadata item to document these
        values. However, I don't see a clear way to indicate that a
        specific band has
        <b>no NODATA</b> value within the tuple.</div>
      <div class="elementToProof"
style="margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        On the other hand, the documentation also suggests that <code>NODATA_VALUES</code> is
        <b>not widely honoured</b>, which is not very encouraging.</div>
      <div class="elementToProof"
style="margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">
        <span style="color: rgb(0, 0, 0);">Therefore, would you consider
          it good practice to separate bands with different NODATA
          values into separate
        </span><span style="color: rgb(200, 38, 19);"><b>sub</b></span><span
          style="color: rgb(0, 0, 0);">datasets instead?</span></div>
      <div class="elementToProof"
style="margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        Thank you very much for the clarification.</div>
      <div class="elementToProof"
style="margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div id="Signature">
        <table
style="width: 500px; box-sizing: border-box; border-collapse: collapse; border-spacing: 0px;"
          cellspacing="0" cellpadding="0">
          <tbody>
            <tr>
              <td style="color: rgb(0, 134, 85); width: 310px;">
                <div style="font-family: Arial; font-size: 14px;"><span
                    style="color: rgb(0, 134, 85);"><b><a
href="https://www.creaf.cat/en/about-us/our-people/abel-pau-garcia"
                        target="_blank" id="profile_link"
                        class="OWAAutoLink"
                        style="color: rgb(0, 134, 85);"
                        moz-do-not-send="true">Abel Pau Garcia</a></b><a
href="https://www.creaf.cat/en/about-us/our-people/abel-pau-garcia"
                      target="_blank" id="profile_link"
                      class="OWAAutoLink"
                      style="color: rgb(0, 134, 85);"
                      moz-do-not-send="true">
                    </a></span></div>
              </td>
              <td rowspan="2" style="vertical-align: top; width: 190px;"
                align="right">
                <div
style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
                  <a href="https://www.creaf.cat/"
                    id="OWA4a7c9f16-ec4f-5320-4bf3-e8ccb18e01ce"
                    class="OWAAutoLink"
                    style="display: block; width: 180px; height: 43px;"
                    moz-do-not-send="true"><img
                      style="width: 180px; height: 43px;"
src="https://www.creaf.cat/sites/default/files/2024-10/logo-creaf-small.jpg"
                      moz-do-not-send="true" width="180" height="43">
                  </a></div>
              </td>
            </tr>
            <tr>
              <td style="padding-bottom: 5px; color: rgb(188, 88, 2);">
                <div style="font-family: Arial; font-size: 13px;"><span
                    style="color: rgb(188, 88, 2);"><b><a
href="https://www.creaf.cat/en/about-us/our-people/abel-pau-garcia"
                        target="_blank" id="carrec_link"
                        class="OWAAutoLink"
style="color: rgb(188, 88, 2); text-decoration: none;"
                        moz-do-not-send="true">MiraMon Technical Lead </a></b></span></div>
              </td>
            </tr>
            <tr>
              <td
style="padding-top: 2px; padding-bottom: 2px; color: rgb(68, 91, 78);">
                <div style="font-family: Arial; font-size: 13px;"><span
                    style="color: rgb(68, 91, 78);"><b><a
                        href="mailto:a.pau@creaf.cat" id="correu_link"
                        class="OWAAutoLink moz-txt-link-freetext"
                        style="color: rgb(68, 91, 78);"
                        moz-do-not-send="true">a.pau@creaf.cat</a></b><a
                      href="mailto:a.pau@creaf.cat" id="correu_link"
                      class="OWAAutoLink"
                      style="color: rgb(68, 91, 78);"
                      moz-do-not-send="true">
                    </a></span></div>
              </td>
              <td rowspan="4" style="vertical-align: top; width: 105px;"
                align="right">
                <div
style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
                  <img id="logo_opcional"
                    style="width: 105px; height: 50px;"
src="https://www.creaf.cat/sites/default/files/cap_0.png"
                    moz-do-not-send="true" width="105" height="50">
                </div>
              </td>
            </tr>
            <tr>
              <td
style="padding-top: 2px; padding-bottom: 2px; color: rgb(68, 91, 78);">
                <div style="font-family: Arial; font-size: 13px;"><span
                    style="color: rgb(68, 91, 78);"><b><a
href="https://teams.microsoft.com/l/chat/0/0?users=a.pau@creaf.cat"
                        id="teams_link" class="OWAAutoLink"
                        style="color: rgb(68, 91, 78);"
                        moz-do-not-send="true">Let's chat on Teams!</a></b><a
href="https://teams.microsoft.com/l/chat/0/0?users=a.pau@creaf.cat"
                      id="teams_link" class="OWAAutoLink"
                      style="color: rgb(68, 91, 78);"
                      moz-do-not-send="true">
                    </a></span></div>
              </td>
            </tr>
            <tr>
              <td
style="padding-top: 2px; padding-bottom: 2px; color: red;">
                <div style="font-family: Arial; font-size: 13px;"><span
                    style="color: rgb(68, 91, 78);"><b><a href="#"
                        id="OWA7d8566cd-3930-a662-4f8d-442844165ec9"
                        class="OWAAutoLink"
style="color: rgb(68, 91, 78); text-decoration: none;"
                        moz-do-not-send="true">Tel. +34
                      </a></b></span></div>
              </td>
            </tr>
            <tr>
              <td
style="padding-top: 2px; padding-bottom: 2px; color: rgb(68, 91, 78);"><br>
              </td>
            </tr>
            <tr>
              <td colspan="2"
style="padding-top: 2px; padding-bottom: 2px; color: rgb(188, 88, 2);">
                <div style="font-family: Arial; font-size: 13px;"><a
                    href="https://twitter.com/CREAF_ecologia"
                    target="_blank"
                    id="OWA5aed5506-cace-f46f-f509-0f476bedd558"
                    class="OWAAutoLink" style="text-decoration: none;"
                    moz-do-not-send="true"><img
                      style="width: 30px; height: 30px;"
src="https://www.creaf.cat/sites/default/files/2024-10/x_30.png"
                      moz-do-not-send="true" width="30" height="30">
                  </a><a href="https://www.linkedin.com/company/creaf/"
                    target="_blank"
                    id="OWA3c9f8bda-e7a9-1158-1a5d-3f92f7ed86ca"
                    class="OWAAutoLink" style="text-decoration: none;"
                    moz-do-not-send="true"><img
                      style="width: 30px; height: 30px;"
src="https://www.creaf.cat/sites/default/files/2024-10/linkedin_30.png"
                      moz-do-not-send="true" width="30" height="30">
                  </a><a href="https://www.youtube.com/c/creafecologia"
                    target="_blank"
                    id="OWAeec9d058-cbc9-a8c7-caf8-6c29c3e0f8cc"
                    class="OWAAutoLink" style="text-decoration: none;"
                    moz-do-not-send="true"><img
                      style="width: 30px; height: 30px;"
src="https://www.creaf.cat/sites/default/files/2024-10/youtube_30.png"
                      moz-do-not-send="true" width="30" height="30">
                  </a><a
                    href="https://www.instagram.com/CREAF_ecologia/"
                    target="_blank"
                    id="OWA9f57f6fb-9dbc-9e7a-a4a2-1bcf2cbbc3e9"
                    class="OWAAutoLink" style="text-decoration: none;"
                    moz-do-not-send="true"><img
                      style="width: 30px; height: 30px;"
src="https://www.creaf.cat/sites/default/files/2024-10/instagram_30.png"
                      moz-do-not-send="true" width="30" height="30">
                  </a><br>
                  <span style="color: rgb(188, 88, 2);"><b><a
                        href="http://www.creaf.cat" target="_blank"
                        id="OWA21fdf311-0a98-a3b7-08c8-0d3b8473f976"
                        class="OWAAutoLink"
style="color: rgb(188, 88, 2); text-decoration: none;"
                        moz-do-not-send="true">www.creaf.cat</a></b><a
                      href="http://www.creaf.cat" target="_blank"
                      id="OWA4489747b-0c7d-e6a3-1b9c-41e07b848cd9"
                      class="OWAAutoLink"
style="color: rgb(188, 88, 2); text-decoration: none;"
                      moz-do-not-send="true">
                    </a></span><b> | </b><span
                    style="color: rgb(188, 88, 2);"><b><a
href="https://www.creaf.cat/en/news-and-agenda/news" target="_blank"
                        id="OWA1d3b2932-888a-aceb-abf0-56a50963e134"
                        class="OWAAutoLink"
style="color: rgb(188, 88, 2); text-decoration: none;"
                        moz-do-not-send="true">Latest news</a></b><a
href="https://www.creaf.cat/en/news-and-agenda/news" target="_blank"
                      id="OWA41653ae5-d03d-4399-486c-89112a38aaad"
                      class="OWAAutoLink"
style="color: rgb(188, 88, 2); text-decoration: none;"
                      moz-do-not-send="true">
                    </a></span></div>
              </td>
            </tr>
            <tr>
              <td style="color: rgb(27, 36, 31);">
                <div style="font-family: Arial; font-size: 13px;"><span
                    style="color: rgb(27, 36, 31);"><a
                      href="https://www.openstreetmap.org/way/123379060"
                      target="_blank"
                      id="OWA3f1c9a7a-2d56-342e-2e7a-a3abba5664ac"
                      class="OWAAutoLink"
style="color: rgb(27, 36, 31); text-decoration: none;"
                      moz-do-not-send="true">CREAF. Campus UAB. Edifici
                      C. 08193 Bellaterra (Barcelona) </a></span><br>
                  <br>
                  <span style="color: rgb(188, 88, 2);"><b><a
                        href="https://www.creaf.cat/privacy-policy"
                        target="_blank"
                        id="OWA543cc44f-06ce-7556-a169-1af30af12b06"
                        class="OWAAutoLink"
style="color: rgb(188, 88, 2); text-decoration: none;"
                        moz-do-not-send="true">Privacy policy</a></b><a
                      href="https://www.creaf.cat/privacy-policy"
                      target="_blank"
                      id="OWAcf8799d3-879d-e972-a29a-b7a4328f4e83"
                      class="OWAAutoLink"
style="color: rgb(188, 88, 2); text-decoration: none;"
                      moz-do-not-send="true">
                    </a></span></div>
              </td>
              <td rowspan="2"
                style="vertical-align: bottom; width: 70px;"
                align="right">
                <div
style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
                  <img
style="width: 70px; height: 50px; margin-top: -50px;"
src="https://www.creaf.cat/sites/default/files/2024-10/corner_right_0.png"
                    moz-do-not-send="true" width="70" height="50">
                </div>
              </td>
            </tr>
            <tr>
              <td style="color: rgb(153, 153, 153);">
                <div style="font-family: Arial; font-size: 11px;"><span
                    style="color: rgb(153, 153, 153);"><a href="#"
                      target="_blank"
                      id="OWAc220387e-6d7a-ad84-6861-1e0a0fb75a37"
                      class="OWAAutoLink"
style="color: rgb(153, 153, 153); text-decoration: none;"
                      moz-do-not-send="true">Before printing this
                      electronic message, think about the environment. </a></span></div>
              </td>
            </tr>
          </tbody>
        </table>
        <div
style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
          <br>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>