【问题标题】:Reading hdf4 files in R在 R 中读取 hdf4 文件
【发布时间】:2018-05-08 08:39:24
【问题描述】:

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

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

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 文件的任何其他包或方法吗?

【问题讨论】:

  • 您为什么不尝试执行您的警告? No GDAL installation found 表示需要先安装gdal。在 Windows 上,在 R 中安装库 rgdal 就足够了。

标签: r gis hdf


【解决方案1】:

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

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

然后运行命令:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-04
    • 2016-06-25
    • 2012-04-14
    • 2015-05-11
    相关资源
    最近更新 更多