Hi Kimberly,
  You may want to try using GDAL to convert the file to a different format 
before opening it into QGIS. You can try it from the command line, or from 
within QGIS using Raster: Conversion: Translate (Convert Format).  Note that 
the QGIS tool lists the GDAL command that it uses, so if you start there you at 
least can use the GUI to get the file names, etc. right, before moving to the 
command line to tinker.  It may not work as GDAL is likely what QGIS is using 
to open the file, but maybe Q is set up with GDAL switches that won't open the 
file correctly.   To check if GDAL can at least read your file you may want to 
start from the command line using Terminal (after you type in gdalinfo you 
should be able to drag and drop your file into the Terminal, and it will fill 
in the file path): 
gdalinfo path/to/your_file.hdf
If it complains that: "-bash: gdalinfo: command not found"  you will have to 
track down where your gdal binaries are installed. One place to look is inside 
of QGIS.app: so in Finder go to Applications and right click on QGIS.app and 
Show Package Contents, then navigate through the folders: /Contents/MacOS/bin, 
you can drag and drop the gdalinfo or any of the other binaries into terminal, 
to get the path and then write your command after that:
 /Applications/QGIS3.12.app/Contents/MacOS/bin/gdalinfo path/to/your_file.hdf
 /Applications/QGIS3.12.app/Contents/MacOS/bin/gdal_translate [paste command 
here]

If you get tired of doing all that you can do a web search for how to make an 
alias in your .bash_profile.
See this GIS Stack Exchange answer, about using GDAL to convert a single band 
at a time from hdf to 
tif:https://gis.stackexchange.com/questions/220281/how-to-use-gdal-to-convert-hdf-multi-band-file-to-a-single-geotiff-file#220291

-Thayer


================================================
Message: 1
Date: Fri, 1 May 2020 20:38:39 -0500
From: KIMBERLY CRISTINA NAVARRO VELEZ
    <kimberly.nava...@correounivalle.edu.co>
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] Error at opening .hdf MODIS layer in QGIS 3.12
Message-ID:
    <a4327fee-7c2c-4bf9-881d-80df63cc2...@correounivalle.edu.co>
Content-Type: text/plain; charset="utf-8"

Hello,

I am new using QGIS. I´ve been trying to open a raster layer downloaded from 
USGS Earth explorer. The file have an .hdf extension. It open in other 
computers in different QGIS versions, but it does not in my computer, neither 
in two of my friends computers.

I am using QGIS 3.12, But I also tried QGIS 3.10.

I need to be able to open the file so I can extract some data from it.

I tried using the Python console, following some advices from youtube and 
GitHub, but it did not work.
I also try to open the layer by using the function Clip Raster from Mask Layer. 
It also, did not work.

Every time I tried a red flag happened and this phrase appears: Invalid Layer: 
Raster Layer Provider is not valid (provider: gdal, 
URI:users/download/MYD11A2.A2012.12313.123.hdf) (I am adding a screenshot)

I have a MacBook Pro 2017, my IOS version is Mojave 10.14.6

I installed the program from your webpage, MacOs version.

I would really appreciate your help…. I have look everywhere and Can’t find a 
solution.

Thanks, Kimberly.

  
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to