[R-sig-Geo] reading .hdf files
jgrn at illinois.edu
Tue Mar 25 18:09:22 CET 2014
We wrote a package initially inspired by this issue -- gdalUtils,
which are wrappers for the GDAL/OGR utilities. There are even some
hdf helper functions we included (e.g. ?get_subdatasets). Note that
if you are on a Windows or Mac box, it is important you install the
correct version of GDAL first.
Currently, you'll need to extract out the subdataset you want via
?gdal_translate -- there is an example using an HDF4 file in the help.
I would recommend grabbing the R-forge version, since I have a few
fixes in there that aren't on the latest CRAN:
On Tue, Mar 25, 2014 at 11:54 AM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
> HDF is a richer file format, and can do more than just store rasters. It
> can contain multiple objects of different dimension.
> There's a few ad-hoc standards for regular raster data in HDF though, where
> objects in the HDF specify the coordinates on the axes - which might be
> lat, lon, time, height in a 4-D data set and then the 4d hypercube of data
> See the Binary Data Formats section here:
> for some packages that can read HDF, but you might have to dig into the
> metadata to work out how to get the NDVI raster for 01/2012 from your HDF
> file. Without a sample, we're guessing...
> On Tue, Mar 25, 2014 at 4:37 PM, dododave <dododave at gmail.com> wrote:
>> Hi all,
>> I am trying to load an hdf raster file consisting of NDVI values so that I
>> can calculate the mean values within a polygon. I have been able to do this
>> with GEOtiff files, but not with .hdf, which is strange because GIS
>> can readily load them.
>> I have looked into rgdal package, but that doesn't seem to have an hdf
>> Thanks for any help,
>> View this message in context:
>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
> [[alternative HTML version deleted]]
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
Jonathan A. Greenberg, PhD
Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
Department of Geography and Geographic Information Science
University of Illinois at Urbana-Champaign
259 Computing Applications Building, MC-150
605 East Springfield Avenue
Champaign, IL 61820-6371
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
More information about the R-sig-Geo