[GRASS-dev] import hdf files with r.import?

Hi devs,

Would that be possible to have a simpler way to import hdf (modis especially) files into GRASS, without the need of reprojecting and translating into .tif the desired subdatasets first?

I’m using pymodis to download, reproject and convert into tif, and just then r.in.gdal… The thing is that for this particular case r.import is just the same as r.in.gdal, and IIUC, r.modis still uses MRT

There’s another problem, though… We all know MODIS hdf tiles are in SIN proj but they do not have it defined, as you can see with:

{{{
gdalinfo /home/veroandreo/gisdata/MOD44W/MOD44W.A2000055.h13v12.005.2009212173504.hdf
Driver: HDF4/Hierarchical Data Format Release 4
Files: /home/veroandreo/gisdata/MOD44W/MOD44W.A2000055.h13v12.005.2009212173504.hdf
Size is 512, 512
Coordinate System is `’
Metadata:
ASSOCIATEDINSTRUMENTSHORTNAME=MODIS
ASSOCIATEDPLATFORMSHORTNAME=Terra
ASSOCIATEDSENSORSHORTNAME=MODIS

GRINGPOINTLATITUDE=-40.000000, -29.855157, -29.884849, -40.035199
GRINGPOINTLONGITUDE=-65.270364, -57.692450, -45.983544, -52.017065

Subdatasets:
SUBDATASET_1_NAME=HDF4_EOS:EOS_GRID:“/home/veroandreo/gisdata/MOD44W/MOD44W.A2000055.h13v12.005.2009212173504.hdf”:MOD44W_250m_GRID:water_mask
SUBDATASET_1_DESC=[4800x4800] water_mask MOD44W_250m_GRID (8-bit unsigned integer)
SUBDATASET_2_NAME=HDF4_EOS:EOS_GRID:“/home/veroandreo/gisdata/MOD44W/MOD44W.A2000055.h13v12.005.2009212173504.hdf”:MOD44W_250m_GRID:water_mask_QA
SUBDATASET_2_DESC=[4800x4800] water_mask_QA MOD44W_250m_GRID (8-bit unsigned integer)
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 512.0)
Upper Right ( 512.0, 0.0)
Lower Right ( 512.0, 512.0)
Center ( 256.0, 256.0)
}}}

It would be nice to have, in grass, the functionality to select the desired layers of an hdf and then get them reprojected and imported in one step as r.import does :slight_smile: (this is something more general than the MODIS issue, I know)

Sorry for bothersome! :stuck_out_tongue:

Cheers,
Vero

On 19 October 2015 at 17:06, Veronica Andreo <veroandreo@gmail.com> wrote:

Hi devs,

hi,

Would that be possible to have a simpler way to import hdf (modis
especially) files into GRASS, without the need of reprojecting and
translating into .tif the desired subdatasets first?

I'm using pymodis to download, reproject and convert into tif, and just then
r.in.gdal... The thing is that for this particular case r.import is just the
same as r.in.gdal, and IIUC, r.modis still uses MRT

I'm working in these days to update r.modis for pymodis gdal support.
I hope to release something working in two days.

Cheers,
Vero

--
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org

On 19 October 2015 at 17:29, Luca Delucchi <lucadeluge@gmail.com> wrote:

I'm working in these days to update r.modis for pymodis gdal support.
I hope to release something working in two days.

r.modis.import has been updated, more tests are needed

After lunch I will update the manuals for both r.modis scripts

--
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org