Link conda HDF4 to conda GDAL (Anaconda Python)

纵然是瞬间 提交于 2019-12-22 10:27:09

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/25333418/link-conda-hdf4-to-conda-gdal-anaconda-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!