<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;}
@font-face
{font-family:"DejaVu Sans Mono";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
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;
mso-ligatures:none;}
@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">I can’t help you with building GDAL but I can show where to learn the difference between --formats and --format:
<a href="https://gdal.org/en/latest/programs/raster_common_options.html#raster-common-options">
https://gdal.org/en/latest/programs/raster_common_options.html#raster-common-options</a><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> Hernán De Angelis <variablestarlight@gmail.com>
<br>
<b>Lähetetty:</b> maanantai 11. marraskuuta 2024 14.04<br>
<b>Vastaanottaja:</b> Rahkonen Jukka <jukka.rahkonen@maanmittauslaitos.fi>; gdal-dev@lists.osgeo.org<br>
<b>Aihe:</b> Re: [gdal-dev] GDAL, HDF4 and MODIS L1B data<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"DejaVu Sans Mono",serif">Thank you for your response, Jukka.</span><br>
<br>
<span style="font-size:10.0pt;font-family:"DejaVu Sans Mono",serif">That is interesting. I set cmake to build hdf4, cmake sees it and it does not throw errors during the build. In fact, I see:</span><br>
<br>
<span style="font-size:10.0pt;font-family:"DejaVu Sans Mono",serif">[ 38%] Built target gdal_HDF4</span><br>
<br>
<span style="font-size:10.0pt;font-family:"DejaVu Sans Mono",serif">but the command you gave gives not HDF4</span><br>
<br>
<span lang="EN-US" style="font-family:"DejaVu Sans Mono",serif;mso-fareast-language:EN-US">gdalinfo --format hdf4</span><br>
<br>
<span lang="EN-US" style="font-family:"DejaVu Sans Mono",serif;mso-fareast-language:EN-US">(should be "formats" instead?)</span><br>
<span lang="EN-US" style="font-family:"DejaVu Sans Mono",serif;mso-fareast-language:EN-US">gdalinfo --formats hdf4<br>
<br>
this retrieves a long list, but no HDF5:<br>
<br>
gdalinfo --formats | grep hdf<br>
HDF5 -raster,multidimensional raster- (rovs): Hierarchical Data Format Release 5 (*.h5, *.hdf5)<br>
<br>
on the other hand </span><br>
<span style="font-size:10.0pt;font-family:"DejaVu Sans Mono",serif">gdal-config --formats<br>
<br>
gives:<br>
<br>
gdal-config --formats<br>
MEM vrt HDF4 MEM<br>
<br>
So it should be there?<br>
<br>
This is confusing. Will keep looking.<br>
<br>
Thank you for your time, Jukka!<br>
<br>
Hernán<br>
<br>
</span><o:p></o:p></p>
<div>
<p class="MsoNormal">Den 2024-11-11 kl. 12:45, skrev Rahkonen Jukka:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Have you checked with gdalinfo if you have managed to build the HDF4 driver?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">gdalinfo --format hdf4</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Your test file opens for me with GDAL from OSGeo4W.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></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 <a href="mailto:gdal-dev-bounces@lists.osgeo.org">
<gdal-dev-bounces@lists.osgeo.org></a> <b>Puolesta </b>Hernán De Angelis via gdal-dev<br>
<b>Lähetetty:</b> maanantai 11. marraskuuta 2024 13.37<br>
<b>Vastaanottaja:</b> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<b>Aihe:</b> [gdal-dev] GDAL, HDF4 and MODIS L1B data<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"DejaVu Sans Mono",serif">I recently compiled a minimal GDAL (3.10) with HDF4 support (using HDF 4.3.0) for processing MODIS L1B data. However, the resulting command line tools cannot understand
the format. Perhaps I am doing something wrong, or missing something important, or both.<br>
<br>
Do I understand correctly that MODIS L1B in HDF-EOS format should be readable by GDAL compiled with HDF4 support without additional libraries?<br>
<br>
Thanks for any hint.<br>
<br>
Hernán<br>
<br>
<br>
<br>
Workflow:<br>
<br>
Build HDF4 (4.3.0)<br>
<br>
./configure --prefix=/home/hernan/project --disable-netcdf --disable-fortran --enable-shared --disable-static<br>
make<br>
make install<br>
<br>
<br>
Build GDAL (3.10) with HDF4 support<br>
ccmake , make, ... etc<br>
<br>
/home/hernan/project/bin/gdal-config --formats<br>
MEM vrt HDF4 MEM<br>
<br>
<br>
<br>
Test<br>
<br>
/home/hernan/project/bin/gdalinfo MOD02QKM.A2024307.1325.061.2024308012941.hdf<br>
ERROR 4: `MOD02QKM.A2024307.1325.061.2024308012941.hdf' not recognized as being in a supported file format.<br>
gdalinfo failed - unable to open 'MOD02QKM.A2024307.1325.061.2024308012941.hdf'.<br>
<br>
<br>
<br>
Testdata if someone wants to try (warning: 150 Mb!):<br>
<a href="https://www.geonatura.se/lastkaj/index.php/s/TCS35pjANsEtSyV">https://www.geonatura.se/lastkaj/index.php/s/TCS35pjANsEtSyV</a></span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>