<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p>For posterity: just to note that the below fix turned out to be
      incorrect<br>
    </p>
    <p>See <a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/issues/3605">https://github.com/OSGeo/gdal/issues/3605</a> for more details
      and the appropriate fix</p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 19/03/2021 à 18:22, Even Rouault a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:cdf12223-567c-80b4-7686-459d1ed1bc85@spatialys.com">
      <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"
          moz-do-not-send="true">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"
          moz-do-not-send="true">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">
        <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>
            <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>Eric Younkin<br>
                                      Physical Scientist<br>
                                    </span></div>
                                  <div dir="ltr"><span>NOAA OCS, </span><span>Hydrographic
                                      Systems and Technology Branch</span></div>
                                  <div dir="ltr"><span>1315 East-West
                                      Highway</span></div>
                                  <div dir="ltr"><span>N/CS11, Room 6604<br>
                                      Silver Spring, MD 20910</span></div>
                                  <div><span>Office: </span><span>240-847-8208</span></div>
                                  <div dir="ltr"><span> Cell:
                                      828-331-8197<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" moz-do-not-send="true">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" moz-do-not-send="true">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" moz-do-not-send="true">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
      <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>