在R中读取hdf4文件

时间:2017-06-01 10:31:53

标签: r gis hdf

我有一些hdf4文件,我想在R中阅读。

我遇到了使用gdalUtils包的this回答。 但是下面的代码给了我一个警告,它不起作用。

gdalinfo(file.path)
NULL
Warning messages:
1: In gdal_setInstallation(ignore.full_scan = ignore.full_scan, verbose = verbose) :
 No GDAL installation found. Please install 'gdal' before continuing:
- www.gdal.org (no HDF4 support!)
- www.trac.osgeo.org/osgeo4w/ (with HDF4 support RECOMMENDED)
- www.fwtools.maptools.org (with HDF4 support)

2: In gdal_setInstallation(ignore.full_scan = ignore.full_scan, verbose = verbose) :
  If you think GDAL is installed, please run:
gdal_setInstallation(ignore.full_scan=FALSE)

这个建议也没有用     gdal_setInstallation(ignore.full_scan=FALSE)

您知道在R中读取HDF4文件的任何其他包或方法吗?

1 个答案:

答案 0 :(得分:0)

对于Mac用户:我遇到了同样的问题。我按照说明here

其中包括从here下载最新的GDAL框架。

然后运行命令:

echo 'export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH' >> ~/.bash_profile
source ~/.bash_profile