[Qgis-user] Import and reference HDF4 data

Andre Joost andre+joost at nurfuerspam.de
Mon Aug 11 09:22:11 PDT 2014


Am 11.08.2014 15:27, schrieb SCHULZ Wolfgang:
> Hello, I want to import the following data (hdf format) into QGIS:
> http://ghrc.nsstc.nasa.gov/hydro/search.pl?method=quick&keyword=HRFC&context=Any+field
>
>  Any idea how to georeference it? I can import it. The interesting
> layer of the hdf4 file is the first layer. The layer should contain
> data -180 to +180 longitude and -90 to +90 latitude in 0.5 degree
> resolution. How can I tell to QGIS the limits of the data layer for a
> hdf4 file?
>


If you query the subdatasets of the HDF file with
gdalinfo LISOTD_HRFC_V2.3.2013.hdf
gdalinfo HDF4_SDS:UNKOWN:"LISOTD_HRFC_V2.3.2013.hdf":0
gdalinfo HDF4_SDS:UNKOWN:"LISOTD_HRFC_V2.3.2013.hdf":1
gdalinfo HDF4_SDS:UNKOWN:"LISOTD_HRFC_V2.3.2013.hdf":2

you learn that SDS 1 contains the longitudes from -180 to +180, and SDS 
2 the latitudes from -90 to +90. Unfortunately, the GDAL driver is not 
able to use these coordinate infos.

I got around it by extracting the SDS 0 and applying the corner 
coordinates with GDAL:

gdal_translate -a_srs EPSG:4326 -a_ullr -180 -90 180 90 -of "Gtiff" 
HDF4_SDS:UNKOWN:"LISOTD_HRFC_V2.3.2013.hdf":0 test.tif

HTH,
André Joost




More information about the Qgis-user mailing list