<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
h3
{mso-style-priority:9;
mso-style-link:"Otsikko 3 Char";
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:13.5pt;
font-family:"Calibri",sans-serif;
font-weight:bold;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML-esimuotoiltu Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.Otsikko3Char
{mso-style-name:"Otsikko 3 Char";
mso-style-priority:9;
mso-style-link:"Otsikko 3";
font-family:"Calibri Light",sans-serif;
color:#1F3763;}
span.HTML-esimuotoiltuChar
{mso-style-name:"HTML-esimuotoiltu Char";
mso-style-priority:99;
mso-style-link:HTML-esimuotoiltu;
font-family:Consolas;}
span.Shkpostityyli22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Do you know that your source file is a multipage TIFF? Could you share a small test file? There is python test for reading a multipage TIFF at
<a href="https://github.com/OSGeo/gdal/blob/master/autotest/gcore/tiff_read.py#L582">
https://github.com/OSGeo/gdal/blob/master/autotest/gcore/tiff_read.py#L582</a>, please have a look.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> gdal-dev <gdal-dev-bounces@lists.osgeo.org>
<b>Puolesta </b>Raivo Rebane<br>
<b>Lähetetty:</b> keskiviikko 8. maaliskuuta 2023 14.55<br>
<b>Vastaanottaja:</b> GDAL <gdal-dev@lists.osgeo.org><br>
<b>Aihe:</b> [gdal-dev] How proceed with GDAL GeoTIFF files with multiply subdataset<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi<o:p></o:p></p>
<p>I found from documentation following about subdataset:<o:p></o:p></p>
<div>
<h3>Subdatasets<a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgdal.org%2Fdrivers%2Fraster%2Fgtiff.html%23subdatasets&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C2c9de6f7bf72448ceb7008db1fd457ee%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638138769088912458%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=G%2Fls8czdoflmK70QnDVjJK%2B8U271BLdVxtp%2FKRoKLZM%3D&reserved=0" title="Permalink to this heading"><span style="font-family:Symbol">Á</span></a><o:p></o:p></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.<o:p></o:p></p>
<p>I am using following code :<o:p></o:p></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>
}<o:p></o:p></p>
<p>But geting following :<o:p></o:p></p>
<p>subdataset = NULL<o:p></o:p></p>
<p>From documentation I didn't find more<o:p></o:p></p>
<p>In what I am wrong<o:p></o:p></p>
<p>Regards<o:p></o:p></p>
<p>Raivo<o:p></o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 08.03.23 01:01, Brad Hards wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>On Wednesday, 8 March 2023 6:53:17 AM AEDT Raivo Rebane wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>I studied and asked from <a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fchat.openai.com%2Fchat&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C2c9de6f7bf72448ceb7008db1fd457ee%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638138769088912458%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BK7Ib0GPmnDTNx4PXyxJ1DvTYZiVUpm69btKTghav0o%3D&reserved=0">https://chat.openai.com/chat</a> how to read<o:p></o:p></pre>
<pre>multiband raster image, but I did'nt find anywhere how to rread from<o:p></o:p></pre>
<pre>tiff file next frame or ortofo bands<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Please ask me if it's possible<o:p></o:p></pre>
</blockquote>
<pre>It is possible. See <a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgdal.org%2Fdrivers%2Fraster%2Fgtiff.html%23subdatasets&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C2c9de6f7bf72448ceb7008db1fd457ee%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638138769088912458%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=G%2Fls8czdoflmK70QnDVjJK%2B8U271BLdVxtp%2FKRoKLZM%3D&reserved=0">https://gdal.org/drivers/raster/gtiff.html#subdatasets</a> for <o:p></o:p></pre>
<pre>how the multiple images are identified.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Use gdalinfo on your file to see the specific characteristics.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>See <a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgdal.org%2Ftutorials%2Fraster_api_tut.html&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C2c9de6f7bf72448ceb7008db1fd457ee%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638138769088912458%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VISqRXj3atPZ6s0d2NWbIfywT6%2BcwQYI9VvCzV2kBPo%3D&reserved=0">https://gdal.org/tutorials/raster_api_tut.html</a> for use of the Raster API <o:p></o:p></pre>
<pre>abstraction.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>So you just need to pass the correct name to the open call.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Brad<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>gdal-dev mailing list<o:p></o:p></pre>
<pre><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><o:p></o:p></pre>
<pre><a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C2c9de6f7bf72448ceb7008db1fd457ee%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638138769088912458%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=nK2Uwqq6XlbEuHOmT1wktRZstvg5scKU6dy44WLhZ7I%3D&reserved=0">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></pre>
</blockquote>
</div>
</div>
</body>
</html>