<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Mike,</p>
    <p>there are a number of situations where you can get a Dataset not
      linked to a driver. Code expecting a Dataset as input should be
      robust to it having a null driver.</p>
    <p>In your situation, given that small_world.tif is a multiband
      dataset, but AsMDArray().AsClassicDataset() returning a single
      band one, having GetDriver() report the GTiff driver would not
      match the expectation that if Dataset.GetDriver() returns a non
      null pointer ,then Dataset.GetDescription() can be passed to
      GDALOpen() and returns a dataset that is identical to it.<br>
    </p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 22/07/2025 à 05:04, Michael Sumner
      via gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAcGz99U-ahb4oMUX2Cp0PYPVSRG_6drr8G_Tfstu0d1y7Fo2Q@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi, this is new to me -  casting from MDIM results in a
          dataset with a null driver: </div>
        <div><br>
        </div>
        <div>ds = gdal.Open("../gdrivers/data/small_world.tif")</div>
        <div>ds.GetRasterBand(1).AsMDArray().AsClassicDataset(0,1).GetDriver()<br>
        </div>
        <div><br>
        </div>
        <div>(stupid question:   )</div>
        <div>It makes sense to me for GTiff which has no MDIM
          capability, but how then does the work get done?  </div>
        <div><br>
        </div>
        <div>I noticed by going from truly MDIM netcdf to
          AsClassicDataset() - I'd expected that the NetCDF driver was
          still involved. </div>
        <div><br>
        </div>
        <div>Does this mean we just have to test for null driver and
          report <none> in that case generally? </div>
        <div><br>
        </div>
        <div>Thanks, Mike</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <span class="gmail_signature_prefix">-- </span><br>
        <div dir="ltr" class="gmail_signature"
          data-smartmail="gmail_signature">
          <div dir="ltr">
            <div dir="ltr" style="color:rgb(34,34,34)">
              <div dir="ltr">Michael Sumner</div>
              <div dir="ltr">Ordinary Member,  Streets People Love
                Hobart Association<br>
                Research Software Engineer<br>
                Australian Antarctic Division<br>
                Hobart, Australia</div>
              <div dir="ltr">0438489030<br>
                e-mail: <a href="mailto:mdsumner@gmail.com"
                  style="color:rgb(17,85,204)" target="_blank"
                  moz-do-not-send="true" class="moz-txt-link-freetext">mdsumner@gmail.com</a></div>
            </div>
          </div>
        </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>