[Qgis-user] Re: [gdal-dev] Problems with gdal and hdf files

Etienne Tourigny etourigny.dev at gmail.com
Wed May 2 06:07:30 PDT 2012


On Wed, May 2, 2012 at 9:54 AM, Even Rouault
<even.rouault at mines-paris.org> wrote:
>
>> but there is no way to actually select 1 or more specific subdatasets
>
> It is possible to select one subdataset. You must use the name reported in the
> lines that contain SUBDATASET_XXX_NAME. For example :
>
> gdal_translate HDF4_EOS:EOS_GRID:"lndsr.L5169054_05420101216.hdf":Grid:band1
> out.tif
>
>>
>> The most important
>> QGIS complains:
>> Cannot get GDAL raster band:
>
> I think support for selecting subdatasets has been added in QGIS 1.8 (I haven't
> tested myself, just a vague feeling of having seen a commit message about that)

This is now possible for rasters with subdatasets - Jurgen applied my
patches for this. If a file has only 1 subdataset it will now open it,
and if it has many subdatasets it will present a dialog to choose the
layer(s).  Also, if you use the file browser, you are able to view the
subdatasets directly.

>
>>
>> R (raster) complains
>> > r <- brick("lndsr.L5169054_05420101216.hdf")
>> Error in .rasterObjectFromFile(x, objecttype = "RasterBrick", ...) :
>>   Cannot create a RasterLayer object from this file.
>> In addition: Warning message:
>> In .rasterFromGDAL(x, band = band, objecttype, ...) :
>>   GeoTransform values not available; georeferencing will not be correct
>> >
>
> You can likely directly provide the subdataset name instead of the dataset name.
> Not sure if R exposes a way of getting the subdataset names from the dataset.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the Qgis-user mailing list