<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=iso-8859-1">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.Shkpostityyli19
{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="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">More information, probably it does not fail but it is extremely slow. After 15 minutes I am now at this stage<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">gdal_translate -of HDF4Image 3band.tif out.h4 --debug on<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: GDALOpen(3band.tif, this=00000215A20D36A0) succeeds as GTiff.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Input file size is 12000, 12000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: QuietDelete(out.h4) invoking Delete()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: GDALOpen(out.h4, this=00000215A20BF880) succeeds as HDF4.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDALPamDataset: In destructor with dirty metadata.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: GDALClose(out.h4, this=00000215A20BF880)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GTiff: ScanDirectories()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: GDALDefaultOverviews::OverviewScan()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: Using default GDALDriver::CreateCopy implementation.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">0GDAL: GDALDriver::Create(HDF4Image,out.h4,12000,12000,3,Byte,0000000000000000)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: GDAL_CACHEMAX = 1632 MB<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: GDALDatasetCopyWholeRaster(): 12000*83 swaths, bInterleave=1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">...10...20...30...40...50...60...70...80...90...100 - done.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: Flushing dirty blocks: 0...10...20...30...40...50...60...70...80...90...100 - done.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDAL: Flushing dirty blocks: 0...10...20...30.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="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><span style="mso-fareast-language:FI">Lähettäjä:</span></b><span style="mso-fareast-language:FI"> Rahkonen Jukka (MML)
<br>
<b>Lähetetty:</b> perjantai 18. helmikuuta 2022 14.09<br>
<b>Vastaanottaja:</b> 'gdal-dev@lists.osgeo.org' <gdal-dev@lists.osgeo.org><br>
<b>Aihe:</b> Gdal_translate into HDF4 fails<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">There is a question about HDF4 in <a href="https://gis.stackexchange.com/questions/424204/convert-geotiff-to-hdf-using-gdal">
https://gis.stackexchange.com/questions/424204/convert-geotiff-to-hdf-using-gdal</a>.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I tried the same with GDAL 3.4.0. With a single band image conversion from GeoTIFF into HDF4Image succeeds but with a 3 band image not. I am not sure if it is even supposed to work and the driver test in
<a href="https://github.com/OSGeo/gdal/blob/master/autotest/gcore/hdf4_write.py">
https://github.com/OSGeo/gdal/blob/master/autotest/gcore/hdf4_write.py</a> is rather simplistic.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">So, should “gdal_translate -of HDF4Image 3band.tif out3band.h4” work?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>