将conda HDF4链接到conda GDAL(Anaconda Python) [英] Link conda HDF4 to conda GDAL (Anaconda Python)

查看:170
本文介绍了将conda HDF4链接到conda GDAL(Anaconda Python)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过 Anaconda 发行版安装了python.它适用于大多数常规事物.但是,我需要能够打开MODIS HDF4-EOS文件.我尝试过

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)"

但是我明白了

错误4:"MOD021KM.A2014005.0910.006.2014005194151.hdf"未被识别为受支持的文件格式.

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

<输入"NoneType">

< type 'NoneType' >

嘿...似乎可行.

有人知道如何使用GDAL使用python 2.7的Anaconda发行版打开HDF4文件吗? 非常感谢您的帮助.

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.

谢谢大家.

推荐答案

虽然您的问题与此问题不同

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

binstar的GDAL版本使用HDF4支持构建,并将自动安装conda HDF4软件包.最好先删除已安装的现有GDAL和HDF4程序包,然后再获取新的程序包.

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.

这篇关于将conda HDF4链接到conda GDAL(Anaconda Python)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆