[R-sig-Geo] How to open and work with an .hdf map

Vikram Ranga babuawara at gmail.com
Fri Jul 6 13:59:23 CEST 2012


Hello Marc,
I have used HEG tool to convert *.hdf files to *.geotiff. I found it 
very easy here is the link
http://hdfeos.org/software/heg.php/
though, you can also use FWTools. Here is the example how to do that in 
FWTool which is link of earlier conversation on the same topic.
http://r-sig-geo.2731867.n2.nabble.com/Antw-Antw-Re-HDF-format-td7236416.html#a7237481, 
see the last conversation in the list.

HTH,
Cheers,

Vikram.
On 7/6/2012 12:39 PM, Matthew Landis wrote:
> Marc,
>
> It's been a long time since I worked with HDF, so someone out there 
> will likely have better suggestions.  But I think you will want to get 
> that out of HDF format as fast as possible.  Try using hdp 
> (http://www.hdfgroup.org/hdp.html) to dump the file to a binary or 
> ascii file and then you should be able to read that in to R using 
> readBin or read.delim or such.
>
> There are also hdf viewers at the HDFGroup site that should help you 
> to see what the file looks like, figure out the grid, etc.
>
> M
>
> On 7/6/2012 5:32 AM, Marc Marí Dell'Olmo wrote:
>> Hello,
>>
>> I'm trying to open and work with a map I have downloaded from
>> http://glovis.usgs.gov/, obtained from MODIS Terra satellite. This web
>> only allows to download maps in .hdf format. I do not have ArcView, a 
>> GIS
>> programme which opens these maps without any problem. I have been 
>> trying to
>> do it using "R", however, I have not succeeded... First, I converted 
>> the map
>> - which is in version 4 - to version 5 (with h4h5tools
>> http://www.hdfgroup.org/h4toh5). I have tried to open it with satinGet
>> (library satin) but I have obtained this error message:
>> Error en queryname(nom.hdf5, what = "date") :
>>   objeto 'date.str' no encontrado
>>
>> Finally I managed to open the file using the function hdf5load (library
>> hdf5). With this function I have obtained two objects "HDF4_DIMGROUP" ,
>> "MOD44B_250m_GRID" but I don't know how can I represent spatially the 
>> data.
>> I think I have a grid with the values of the variables but I don't 
>> know the
>> reference of the coordinates (UTM long lat), the distance between the 
>> points
>> of the grid, etc... In general, I don't know how to work with the
>> information...
>>
>> I'm using Windows.
>>
>> Here is the link of the original map, in case it helps.
>>
>> http://dl.dropbox.com/u/22891835/MOD13Q1NDVI_2012Maig.hdf
>>
>> Thanks in advance for the help!
>>
>> Marc
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list