<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Eric,</p>
    <p>I believe you're right. I've just fixed the issue by changing the
      template resource XML file used by the GDAL driver in</p>
    <p><a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/commit/1d2e7bc8fcde059de853335fee390479d457be06">https://github.com/OSGeo/gdal/commit/1d2e7bc8fcde059de853335fee390479d457be06</a></p>
    <p>So you can easily workaround the issue by updating this file in
      your existing installation.</p>
    <p>For a next time, better file an issue at
      <a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/issues">https://github.com/OSGeo/gdal/issues</a> however. This will minimize
      the risk that your report is lost because nobody was able to
      address it at the very moment where they read it.</p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 19/03/2021 à 17:51, Eric Younkin -
      NOAA Federal via gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFe6qKhPXdgRvZYGLaXXY3sG4zHqPGZHMnPWM4YSaBrhwNBpTg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hello,
        <div><br>
        </div>
        <div>Using conda installed GDAL 3.2.1</div>
        <div><br>
        </div>
        <div>I think I've stumbled on a bug with the BAG driver.  It
          seems as though when you use Create() to make a BAG, it writes
          the dimensionSize xml attribute in the wrong order.  It sets
          the column dimension size to the row dimensionSize xml
          attribute, and row to column.  I found this on examining the
          xml manually, see blob below.</div>
        <div><br>
        </div>
        <div><gmd:axisDimensionProperties><br>
                  <gmd:MD_Dimension><br>
                    <gmd:dimensionName><br>
                      <gmd:MD_DimensionNameTypeCode codeList="<a
href="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_DimensionNameTypeCode"
            moz-do-not-send="true">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_DimensionNameTypeCode</a>"
codeListValue="row">row</gmd:MD_DimensionNameTypeCode><br>
                    </gmd:dimensionName><br>
          <b>          <gmd:dimensionSize><br>
                        <gco:Integer>546</gco:Integer><br>
                      </gmd:dimensionSize></b><br>
                    <gmd:resolution><br>
                      <gco:Measure uom="m">2.0</gco:Measure><br>
                    </gmd:resolution><br>
                  </gmd:MD_Dimension><br>
                </gmd:axisDimensionProperties></div>
        <div><br>
        </div>
        <div>This bug does not affect viewing the BAG in QGIS, as it
          seems like QGIS just computes the size using the actual
          array.  I found that GDAL created BAGs would not load in
          Caris, a software for viewing bathymetric data.  I believe
          that is because Caris is using the dimensionSize xml instead
          of calculating size from the data.  If I swap row/col
          dimensionSize, the BAG then works in Caris.</div>
        <div><br>
        </div>
        <div>Seems like a relatively simple fix (assuming I am right
          about this), please let me know if I need to submit it
          somewhere else.</div>
        <div><br>
        </div>
        <div>Thanks,<br>
          Eric<br clear="all">
          <div><br>
          </div>
          -- <br>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr"><span><font
                                      color="#0000ff">Eric Younkin<br>
                                      Physical Scientist<br>
                                    </font></span></div>
                                <div dir="ltr"><span><font
                                      color="#0000ff">NOAA OCS, </font></span><span
style="color:rgb(0,0,255);font-size:12.8px">Hydrographic Systems and
                                    Technology Branch</span></div>
                                <div dir="ltr"><span><font
                                      color="#0000ff">1315 East-West
                                      Highway</font></span></div>
                                <div dir="ltr"><span><font
                                      color="#0000ff">N/CS11, Room 6604<br>
                                      Silver Spring, MD 20910</font></span></div>
                                <div><span><font color="#0000ff">Office: </font></span><span style="font-family:arial,sans,sans-serif;font-size:13px;white-space:pre-wrap"><font color="#0000ff">240-847-8208</font></span></div>
                                <div dir="ltr"><span><font
                                      color="#0000ff">
                                      Cell: 828-331-8197</font><br>
                                  </span></div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></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>