<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I found from documentation following about subdataset:</p>
    <h3>Subdatasets<a class="headerlink"
        href="https://gdal.org/drivers/raster/gtiff.html#subdatasets"
        title="Permalink to this heading"></a></h3>
    <p>Multi-page TIFF files are exposed as subdatasets. On opening, a
      subdataset name is GTIFF_DIR:{index}:filename.tif, where {index}
      starts
      at 1.</p>
    <p>I am using following code :</p>
    <p>  GDALDataset* subdataset =
static_cast<GDALDataset*>(GDALOpen("F:\\3D-data\\GeoTIFFs\\[1]:44744.tif",
      GA_ReadOnly));<br>
          if (subdataset == NULL) {<br>
              std::cout << "Failed to open subdataset!" <<
      std::endl;<br>
              return 1;<br>
          }<br>
    </p>
    <p>But geting following :</p>
    <p>subdataset = NULL</p>
    <p>From documentation I didn't find more</p>
    <p>In what I am wrong</p>
    <p>Regards</p>
    <p>Raivo<br>
    </p>
    <p><br>
    </p>
    <p></p>
    <div class="moz-cite-prefix">On 08.03.23 01:01, Brad Hards wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:12164630.O9o76ZdvQC@audax">
      <pre class="moz-quote-pre" wrap="">On Wednesday, 8 March 2023 6:53:17 AM AEDT Raivo Rebane wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">I studied and asked from <a class="moz-txt-link-freetext" href="https://chat.openai.com/chat">https://chat.openai.com/chat</a> how to read
multiband raster image, but I did'nt find anywhere how to rread from
tiff file next frame or ortofo bands

Please ask me if it's possible
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
It is possible. See <a class="moz-txt-link-freetext" href="https://gdal.org/drivers/raster/gtiff.html#subdatasets">https://gdal.org/drivers/raster/gtiff.html#subdatasets</a> for 
how the multiple images are identified.

Use gdalinfo on your file to see the specific characteristics.

See <a class="moz-txt-link-freetext" href="https://gdal.org/tutorials/raster_api_tut.html">https://gdal.org/tutorials/raster_api_tut.html</a> for use of the Raster API 
abstraction.

So you just need to pass the correct name to the open call.


Brad



_______________________________________________
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>
  </body>
</html>