<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<font size="2" face="DejaVu Sans Mono">Even,<br>
<br>
Thank you for your response. I also suspect there is some mixing
going on. I will have a deeper look at that.<br>
<br>
Thank you for your time.<br>
<br>
Hernán<br>
<br>
<br>
<br>
<br>
BTW the output of the command you suggest is very much like yours:<br>
<br>
> grep HDF4 CMakeCache.txt | grep -v INTERNAL | grep -v
ADVANCED<br>
//Set ON to build Hierarchical Data Format Release 4 (HDF4) format<br>
GDAL_ENABLE_DRIVER_HDF4:BOOL=ON<br>
//Set ON to build GDAL HDF4 driver as plugin<br>
GDAL_ENABLE_DRIVER_HDF4_PLUGIN:BOOL=OFF<br>
//Set ON to use HDF4<br>
GDAL_USE_HDF4:BOOL=ON<br>
HDF4_INCLUDE_DIR:PATH=/home/hernan/project/include<br>
HDF4_LIBRARY:UNINITIALIZED=/home/hernan/</font><font size="2"
face="DejaVu Sans Mono">project</font><font size="2"
face="DejaVu Sans Mono">/lib64/libmfhdf.a<br>
HDF4_df_LIBRARY_DEBUG:FILEPATH=HDF4_df_LIBRARY_DEBUG-NOTFOUND<br>
HDF4_df_LIBRARY_RELEASE:FILEPATH=/home/hernan/</font><font
size="2" face="DejaVu Sans Mono">project</font><font size="2"
face="DejaVu Sans Mono">/lib64/libdf.so<br>
HDF4_mfhdf_LIBRARY_DEBUG:FILEPATH=HDF4_mfhdf_LIBRARY_DEBUG-NOTFOUND<br>
HDF4_mfhdf_LIBRARY_RELEASE:FILEPATH=/home/hernan/</font><font
size="2" face="DejaVu Sans Mono">project</font><font size="2"
face="DejaVu Sans Mono">/lib64/libmfhdf.so<br>
HDF4_szip_LIBRARY_DEBUG:FILEPATH=HDF4_szip_LIBRARY_DEBUG-NOTFOUND<br>
HDF4_szip_LIBRARY_RELEASE:FILEPATH=HDF4_szip_LIBRARY_RELEASE-NOTFOUND<br>
HDF4_xdr_LIBRARY_DEBUG:FILEPATH=HDF4_xdr_LIBRARY_DEBUG-NOTFOUND<br>
HDF4_xdr_LIBRARY_RELEASE:FILEPATH=HDF4_xdr_LIBRARY_RELEASE-NOTFOUND<br>
//Details about finding HDF4<br>
//MODIFIED property for variable: GDAL_ENABLE_DRIVER_HDF4<br>
//MODIFIED property for variable: GDAL_ENABLE_DRIVER_HDF4_PLUGIN<br>
//Old value of option GDAL_ENABLE_DRIVER_HDF4_PLUGIN<br>
//Test HDF4_HAS_MAXOPENFILES<br>
</font><br>
<br>
<div class="moz-cite-prefix">Den 2024-11-11 kl. 13:29, skrev Even
Rouault:<br>
</div>
<blockquote type="cite"
cite="mid:dfbaf11c-37a8-4fb2-844a-47b446ad6e2d@spatialys.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>Hernan,</p>
<p>this works for me both with HDF4 4.2.14 as available on my
system, and also against 4.3.0 built from source with the exact
configure command line your provided</p>
<p>Can you show the result of "grep HDF4 CMakeCache.txt | grep -v
INTERNAL | grep -v ADVANCED" in your GDAL build directory?</p>
<p>For me, looks like that:</p>
<p>//Set ON to build Hierarchical Data Format Release 4 (HDF4)
format<br>
GDAL_ENABLE_DRIVER_HDF4:BOOL=ON<br>
//Set ON to build GDAL HDF4 driver as plugin<br>
GDAL_ENABLE_DRIVER_HDF4_PLUGIN:BOOL=ON<br>
//Set ON to use HDF4<br>
GDAL_USE_HDF4:BOOL=ON<br>
HDF4_INCLUDE_DIR:PATH=/home/even/install-hdf4-4.3.0/include<br>
HDF4_df_LIBRARY_DEBUG:FILEPATH=HDF4_df_LIBRARY_DEBUG-NOTFOUND<br>
HDF4_df_LIBRARY_RELEASE:FILEPATH=/home/even/install-hdf4-4.3.0/lib/libdf.so<br>
HDF4_mfhdf_LIBRARY_DEBUG:FILEPATH=HDF4_mfhdf_LIBRARY_DEBUG-NOTFOUND<br>
HDF4_mfhdf_LIBRARY_RELEASE:FILEPATH=/home/even/install-hdf4-4.3.0/lib/libmfhdf.so<br>
HDF4_szip_LIBRARY_DEBUG:FILEPATH=HDF4_szip_LIBRARY_DEBUG-NOTFOUND<br>
HDF4_szip_LIBRARY_RELEASE:FILEPATH=HDF4_szip_LIBRARY_RELEASE-NOTFOUND<br>
HDF4_xdr_LIBRARY_DEBUG:FILEPATH=HDF4_xdr_LIBRARY_DEBUG-NOTFOUND<br>
HDF4_xdr_LIBRARY_RELEASE:FILEPATH=HDF4_xdr_LIBRARY_RELEASE-NOTFOUND<br>
//Details about finding HDF4<br>
//Old value of option GDAL_ENABLE_DRIVER_HDF4_PLUGIN<br>
//Test HDF4_HAS_MAXOPENFILES</p>
<p>But I strongly suspect you're running a version of GDAL which
is not the one you have built. You may have to adjust your PATH
and LD_LIBRARY_PATH. Check with "which gdalinfo" and then "ldd
/path/to/gdalinfo" that you are running the binaries you've
built.<br>
</p>
<p>"gdalinfo --formats" return the list of drivers, and "gdalinfo
--format driver_name" return detailed info on the given driver</p>
<p>Even<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Le 11/11/2024 à 13:04, Hernán De
Angelis via gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:1dc90d79-858b-486f-a518-cf8b34041959@gmail.com">
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<font size="2" face="DejaVu Sans Mono">Thank you for your
response, Jukka.</font><br>
<br>
<font size="2" face="DejaVu Sans Mono">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:</font><br>
<br>
<font size="2" face="DejaVu Sans Mono">[ 38%] Built target
gdal_HDF4</font><br>
<br>
<font size="2" face="DejaVu Sans Mono">but the command you gave
gives not HDF4</font><br>
<br>
<font face="DejaVu Sans Mono"><span
style="mso-fareast-language:EN-US" lang="EN-US">gdalinfo
--format hdf4</span></font><br>
<font face="DejaVu Sans Mono"><span
style="mso-fareast-language:EN-US" lang="EN-US"></span></font><br>
<font face="DejaVu Sans Mono"><span
style="mso-fareast-language:EN-US" lang="EN-US">(should be
"formats" instead?)</span></font><br>
<font face="DejaVu Sans Mono"><span
style="mso-fareast-language:EN-US" lang="EN-US"></span></font><font
face="DejaVu Sans Mono"><span
style="mso-fareast-language:EN-US" lang="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></font><br>
<font face="DejaVu Sans Mono"><font size="2">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>
</font></font><br>
<br>
<div class="moz-cite-prefix">Den 2024-11-11 kl. 12:45, skrev
Rahkonen Jukka:<br>
</div>
<blockquote type="cite"
cite="mid:DB9PR09MB68870E3F27686052DDC76AB3FD582@DB9PR09MB6887.eurprd09.prod.outlook.com">
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<style>@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;}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.Shkpostityyli18
{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;}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]-->
<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
style="mso-fareast-language:EN-US" lang="EN-US">Have you
checked with gdalinfo if you have managed to build the
HDF4 driver?<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="mso-fareast-language:EN-US" lang="EN-US">gdalinfo
--format hdf4<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="mso-fareast-language:EN-US" lang="EN-US">Your
test file opens for me with GDAL from OSGeo4W.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="mso-fareast-language:EN-US" lang="EN-US">-Jukka
Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="mso-fareast-language:EN-US" 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>Lähettäjä:</b> gdal-dev <a
class="moz-txt-link-rfc2396E"
href="mailto:gdal-dev-bounces@lists.osgeo.org"
moz-do-not-send="true"><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
class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:gdal-dev@lists.osgeo.org"
moz-do-not-send="true">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"
moz-do-not-send="true" class="moz-txt-link-freetext">https://www.geonatura.se/lastkaj/index.php/s/TCS35pjANsEtSyV</a></span><o:p></o:p></p>
</div>
</blockquote>
<br>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:gdal-dev@lists.osgeo.org" moz-do-not-send="true">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext"
href="https://lists.osgeo.org/mailman/listinfo/gdal-dev"
moz-do-not-send="true">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"
moz-do-not-send="true">http://www.spatialys.com</a>
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.</pre>
</blockquote>
<br>
</body>
</html>