0

I have some hdf4 files which I want to read in R.

I came across this answer to use gdalUtils package. But the following code gives me a warning and it doesn't work.

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)

This suggestion also didn't work gdal_setInstallation(ignore.full_scan=FALSE)

Do you know of any other package or way to read HDF4 files in R?

Shekhar Sahu
  • 504
  • 1
  • 6
  • 19
  • 2
    Why don't you try to do what suggests your warning? `No GDAL installation found` means that you need to install `gdal` first. On windows, installing library `rgdal` in R should be enough. – Sébastien Rochette Jun 02 '17 at 08:50

1 Answers1

0

For Mac users: I had the same issue. I followed the instructions here.

Which consisted of downloading the most recent GDAL framework from here.

and then running the command:

echo 'export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH' >> ~/.bash_profile
source ~/.bash_profile
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
daszil
  • 3
  • 3