[R-sig-Geo] Read HDF files

janverbesselt janverbesselt at gmail.com
Fri Sep 2 15:50:09 CEST 2011


Please have a look at the example I provided, it should work for your HDF4 files. The MODIS data I am dealing with comes in HDF4 format. I did not need to build a specific GDAL version that supports HDF4 format.
I am using GDAL available via http://www.kyngchaos.com/software/frameworks for Mac OSx, and the latest version of rgdal for R2.13.1. In which environment are your working?
Best,
Jan


On 02/09/2011, at 3:36 PM, Arnaud Mosnier [via R-sig-geo] wrote:

> Hi Paul, 
> 
> Thanks for your answer ... in fact I googled for that before asking this R 
> list. 
> Oceancolor HDF files are in HDF4 format and provided as two HDF4 format, in 
> SIM (Standard Mapped Image) or BIN (binned). 
> I first tried to use the BIN format without success. I use the gdal version 
> provided with FWtools and gdal_info correctly identify the file as a HDF4 
> format, but it refuses to convert it to a geotiff. 
> I finally succeeded using the SIM format. 
> 
> But, now I am interested in doing that directly into R. 
> The version of gdal called by the library rgdal do not include support for 
> HDF4 format. 
> So my question is now ... can someone give me a step by step instruction 
> that I can use to build a GDAL version including the support for HDF4 format 
> (as it is the case in the version compiled with FWtools) ? 
> 
> Thanks, 
> 
> Arnaud 
> 
> 2011/9/2 Paul Hiemstra <[hidden email]> 
> 
> >  On 09/01/2011 05:20 PM, Arnaud Mosnier wrote: 
> > > Hi Geo UseRs, 
> > > 
> > > I am searching a way to read and manage HDF files in R (like files 
> > provided 
> > > by the ocean color web site, http://oceancolor.gsfc.nasa.gov/). 
> > > 
> > > Thanks 
> > > 
> > > Arnaud 
> > > 
> > >       [[alternative HTML version deleted]] 
> > > 
> > > _______________________________________________ 
> > > R-sig-Geo mailing list 
> > > [hidden email] 
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> > The answer can be found by googling for "R read hdf". That leads to the 
> > HDF5 package or building GDAL with HDF support. Alternatively, find a 
> > (command)-line tool which can translate HDF5 to geotiff or netCDF (e.g. 
> > gdal_translate or ) and then use readGDAL or the ncdf package. 
> > 
> > Paul 
> > 
> > -- 
> > Paul Hiemstra, Ph.D. 
> > Global Climate Division 
> > Royal Netherlands Meteorological Institute (KNMI) 
> > Wilhelminalaan 10 | 3732 GK | De Bilt | Kamer B 3.39 
> > P.O. Box 201 | 3730 AE | De Bilt 
> > tel: +31 30 2206 494 
> > 
> > http://intamap.geo.uu.nl/~paul
> > http://nl.linkedin.com/pub/paul-hiemstra/20/30b/770
> > 
> >
> 
>         [[alternative HTML version deleted]] 
> 
> _______________________________________________ 
> R-sig-Geo mailing list 
> [hidden email] 
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://r-sig-geo.2731867.n2.nabble.com/Read-HDF-files-tp6750856p6753885.html
> To unsubscribe from Read HDF files, click here.



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Read-HDF-files-tp6750856p6753935.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list