Skip to content
Prev 8339 / 29559 Next

reading HDF 4 files into R

On Thu, 27 May 2010, Burton Shank wrote:

            
On a platform with GDAL built with the HDF4 driver, rgdal would cover 
this, with some requirements with regard to the organisation of the data. 
If the driver is not available, you could batch-convert to one of the 
drivers that are available for rgdal for that platform. Since you do not 
state your platform, I assume it is Windows. There, using for example an 
OSGEO4W build of GDAL will probably include HDF4, but the Windows 32/64 
bit builds of GDAL shipped with binary rgdal do not. So from R you would 
use system() to call gdal_translate to get from HDF4 to say GTiff. On a 
platform where you build your own GDAL, then install rgdal from source, 
you should have the driver there for you:

http://www.gdal.org/frmt_hdf4.html

Hope this helps,

Roger