努力用HDF4支持编译Gdal
我无法在mac osx el capitan版本10.11.6上使用bash编译具有hdf4支持的gdal.我从 osgeo网站中介绍的自制gdal方法开始.不幸的是,gdal默认不支持hdf4. hdf格式页面包含对hdf4数据结构的详尽描述,但无法帮助获得对盖达尔我已经安装了在此处讨论的szip,zlib和jpeg库. ,并回顾了/u/dschneiderch 这里 . github线程将我带到了最终的
I am unable to compile gdal with hdf4 support using bash on a mac osx el capitan version 10.11.6. I began with the homebrew approach to building gdal described on the osgeo website. Unfortunately, hdf4 is not by default supported by gdal. The hdf format page includes a great description of the hdf4 data structure but fails to help getting support for gdal. I've installed the szip, zlib, and jpeg libraries discussed here, and reviewed the struggles described by /u/dschneiderch here. The github thread lead me to a final link, which is the basis for my current post.
使用自制软件,我已经安装了hdf4(brew install homebrew/versions/hdf4
返回不推荐使用versions
的警告,而自制软件将改为使用science
).我一直在努力解决这个问题,而且肯定是homebrew/science/hdf4-4.2.11_2 already installed
.因此,我使用brew link -overwrite-hdf4
链接了hdf4,然后返回一条警告,提示它已被链接.
Using homebrew, I have installed hdf4 (brew install homebrew/versions/hdf4
returns a warning that versions
was deprecated and homebrew will use science
instead). I've been fighting with this gdal problem for a while, and sure enough, homebrew/science/hdf4-4.2.11_2 already installed
. So, I linked hdf4 using brew link -overwrite-hdf4
, and a warning comes back that it's already been linked.
I used brew remove gdal
to start fresh with the install, then followed Shaun's approach in the sig-geo listserv to complete the gdal installation. Thus, my total workflow was:
brew tap homebrew/versions
brew install hdf4
brew link --overwrite hdf4
brew install gdal --complete --enable-unsupported --with-hdf4
不幸的是,即使链接了覆盖后,我仍然收到警告:Warning: gdal: this formula has no --with-hdf4 option so it will be ignored!
.但是,安装仍在继续,并且自制软件能够构建gdal.
Unfortunately, even after linking the overwrite, I get a warning: Warning: gdal: this formula has no --with-hdf4 option so it will be ignored!
. The installation continues, though, and homebrew is able to build gdal.
选中gdalinfo --formats
,hdf4仍未包括在列表中.还有其他尝试的技巧吗?
Checking gdalinfo --formats
, hdf4 is still not included in the list. Any tips for what else to try?
I've made some progress using this source, in that gdalinfo --formats' now includes HDF4 as a supported product. However, using pyModis to download data, I still pull a GDAL installation has no support for HDF4, please update GDAL` error.
但是,重要的是,在安装Macport之后,以下代码可以很好地在支持HDF4的Mac上安装GDAL:
Importantly, though, after installing Macport the following code works well for installing GDAL on Mac with HDF4 support:
sudo port install gdal +hdf4 +hdf5 +netcdf