[QGIS-Developer] [Qgis-user] HDF Bug [Was: Raster formats in Qgis 3.4]

Alex M tech_dev at wildintellect.com
Wed Nov 28 10:48:05 PST 2018


Workaround, assuming you know which subdataset you want to load (by
using gdalinfo on the commandline). Put the full path in to the dataset.

In a terminal or osgeo4w shell
$ gdalinfo MOD09A1.A2016313.h21v09.006.2016322094441.hdf | grep SUBDATA

copy the line for the layer you want to load
SUBDATASET_1_NAME=HDF4_EOS:EOS_GRID:"MOD09A1.A2016313.h21v09.006.2016322094441.hdf":MOD_Grid_500m_Surface_Reflectance:sur_refl_b01

Append the full path to the file, example here is /home/user/, like
C:/user/username on Windows.

HDF4_EOS:EOS_GRID:"/home/user/MOD09A1.A2016313.h21v09.006.2016322094441.hdf":MOD_Grid_500m_Surface_Reflectance:sur_refl_b01

Paste this into the load Raster dialog in QGIS 3.4.1

Not ideal but highlights that the driver is fine, it's just the
detection and selection of subdata layers that's not working.

Thanks,
Alex

On 11/28/18 10:30, Alex M wrote:
> On Qgis-user an issue was reported with loading HDF5 files in QGIS 3.4
> no Windows 10.
> 
> I was able to confirm that HDF5 files fail in QGIS 3.4.1, on Linux also.
> Not just the user's file but file I also have. In both cases the files
> work fine in QGIS 2.18.
> 
> This appears to be a regression related to subdatasets (sublayers). No
> dialog comes up asking the user which subdataset to load, and hence the
> load fails with a Provider is not Valid message.
> 
> Only bug info I can find was an old patch that solved this 7 years ago:
> https://issues.qgis.org/issues/5041
> 
> Here's a MODIS image in HDF5 for people to test with.
> https://drive.google.com/open?id=1hQEi3cRdVRlxih06nbo0gygAvJE08ft7
> 
> A secondary, minor issue, the Browser doesn't see the file if it has an
> extension beyond .hdf, in this the case .h5 was what the user supplied.
> 
> Thanks,
> Alex
> 
> On 11/27/18 10:26, Alex M wrote:
>> Yes, please share with the group.
>>
>> Thanks,
>> Alex
>>
>> On 11/27/18 10:20, Anabel Lamaro wrote:
>>>  Thank you very much for your answer. I use Windows 10 and I have just
>>> installed version 3.14 Madeira of the Qgis software. I enclose the error
>>> message in a screenshot. I'll see if I can send you a link to the image.
>>> Thank you very much Anabel
>>>
>>> El mar., 27 nov. 2018 a las 14:33, Alex M (<tech_dev at wildintellect.com>)
>>> escribió:
>>>
>>>> Anabel,
>>>>
>>>> QGIS 3 supports all the same formats, however the loading dialog did
>>>> change.
>>>> https://www.gdal.org/formats_list.html
>>>>
>>>> Sometimes there can also be a slight variation in which drivers are
>>>> included in the gdal install, though that usually only applies to
>>>> proprietary formats like MrSID and ECW.
>>>>
>>>> What operating system are you using, which version of QGIS 3.4.?, and
>>>> can you send a link with an example file others can test with?
>>>>
>>>> Do you get an error message? Please explain more about how it's not
>>>> working.
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>> On 11/27/18 09:17, Anabel Lamaro wrote:
>>>>> Good afternoon: I need to open some radar satellite images (Cosmo Skymed)
>>>>> that are in .h5 format (of the hdf type). With the previous version 2.18
>>>> it
>>>>> could open without inconvenience. I need help on this. Is there any
>>>> add-on
>>>>> to open this type of raster format? Thank you in advance! Anabel
>>>>>
>>>>> <
>>>> http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
>>>>>
>>>>> Libre
>>>>> de virus. www.avg.com
>>>>> <
>>>> http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
>>>>>
>>>>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Qgis-user mailing list
>>>>> Qgis-user at lists.osgeo.org
>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>
>>>>
>>>>
>>>
>>
> 
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 



More information about the QGIS-Developer mailing list