简体   繁体   中英

Link conda HDF4 to conda GDAL (Anaconda Python)

I have python installed through the Anaconda distribution. It works for most regular things. I need to be able to open a MODIS HDF4-EOS file, however. I have tried

conda install -c https://conda.binstar.org/mutirri hdf4

conda install gdal

python -c "from osgeo import gdal; ds=gdal.Open("MOD021KM.A2014005.0910.006.2014005194151.hdf"); print type(ds)"

But I get

ERROR 4: `MOD021KM.A2014005.0910.006.2014005194151.hdf' not recognised as a supported file format.

< type 'NoneType' >

hey... It seemed viable.

Does anyone know how to open an HDF4 file using Anaconda distribution of python 2.7 using GDAL? I would greatly appreciate your help in doing so.

Thank you all.

While your question is not the same as this one https://gis.stackexchange.com/questions/110662/install-gdal-in-centos-without-root you should be able to use the method given in the accepted answer:

conda update conda
conda update anaconda
conda install -c https://conda.binstar.org/jgomezdans gdal=1.11.0

This version of GDAL from binstar is build with HDF4 support and will automatically install the conda HDF4 package. Best remove the existing GDAL and HDF4 packages you have already installed prior to getting the new ones.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM