I'm having trouble in importing MODIS .hdf data in GRASS GIS. When I use r.in.gdal
it returns me this error:
ERROR: No raster bands found in </Volumes/Maxtor/TESI_satellite_imagery/IMMAGINI_DI_PARTENZA/serie_storica_estate_dic2015-feb2020/modis/MOD02QKM.A2019044.1415.061.2019045012150.hdf>.
I've tried to uninstall and reinstall gdal on my computer (S.O. MacOS Catalina), and rebuild all the bindings with python, but I didn't manage to solve the issue. I used Homebrew and followed its instructions to do it. I've also tried to use conda previously, but it has issues while "solving the environment" and cannot complete the procedure. What am I doing wrong?
I've also tried the i.modis.import
, but I get this error
ERROR: pymodis library is not installed.
I can't understand where this comes from, since if I run pip install pymodis
or pip3 install pymodis
on the terminal it says:
Requirement already satisfied: pymodis in ./opt/anaconda3/lib/python3.8/site-packages (2.0.9) Requirement already satisfied: future in ./opt/anaconda3/lib/python3.8/site-packages (from pymodis) (0.18.2) Requirement already satisfied: requests in ./opt/anaconda3/lib/python3.8/site-packages (from pymodis) (2.24.0) Requirement already satisfied: GDAL in ./opt/anaconda3/lib/python3.8/site-packages (from pymodis) (3.1.3) Requirement already satisfied: numpy in ./opt/anaconda3/lib/python3.8/site-packages (from pymodis) (1.18.5) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./opt/anaconda3/lib/python3.8/site-packages (from requests->pymodis) (1.25.9) Requirement already satisfied: certifi>=2017.4.17 in ./opt/anaconda3/lib/python3.8/site-packages (from requests->pymodis) (2020.6.20) Requirement already satisfied: idna<3,>=2.5 in ./opt/anaconda3/lib/python3.8/site-packages (from requests->pymodis) (2.10) Requirement already satisfied: chardet<4,>=3.0.2 in ./opt/anaconda3/lib/python3.8/site-packages (from requests->pymodis) (3.0.4)
How can I solve this problem?
gdal_translate -of gtiff HDF4_EOS:EOS_SWATH:"MOD02QKM.A2019044.1415.061.2019045012150.hdf":MODIS_SWATH_Type_L1B:EV_250_RefSB hdf.tif
. Notice the usage with a subdataset. Use gdalinfo for showing the names of the subdatasets.gdalinfo MOD02QKM.A2019044.1415.061.2019045012150.hdf
does not list subdatasets for you?