[gdal-dev] gdalbuildvrt, gdal_translate, and MODIS HDF files

Even Rouault even.rouault at mines-paris.org
Sat Apr 30 17:09:29 EDT 2011


Le samedi 30 avril 2011 23:01:18, Jonathan Greenberg a écrit :
> Even:
> 
> Thanks: how would I "wildcard" this into a gdalbuildvrt?  The files all
> follow the pattern MCD15A2.A2002185.h14v10.005*

On Linux, you could try :

for i in MCD15A2.A2002185.h14v10.005*; do echo HDF4_EOS:EOS_GRID:
\"$i\":MOD_Grid_MOD15A2:Lai_1km; done | xargs gdalbuildvrt mosaic.vrt

On Windows, I'm not sure how you would do that.

> 
> --j
> 
> On Sat, Apr 30, 2011 at 11:26 AM, Even Rouault
> <even.rouault at mines-paris.org
> 
> > wrote:
> > 
> > Le samedi 30 avril 2011 17:34:28, Jonathan Greenberg a écrit :
> > > GDALers:
> > > 
> > > I have recently come across the mosaicking magic that is 1) build a vrt
> > > usin gdalbuildvrt and then 2) gdal_translate the vrt to whatever format
> > > I want -- I'm noticing this is a crazy-fast way to do mosaicking
> > > compared
> > 
> > to
> > 
> > > some other techniques.  My current issue is that I have a set of MODIS
> > > HDF4 files, and I'd like (if possible) to repeat this process, using a
> > > specific layer in the HDF to be mosaicked.  What is the trick to doing
> > > this?  As far as I know, all the tiles have the same subdataset name. 
> > > I suppose I can gdal_translate each tile first, then build the vrt,
> > > then re-export the vrt, but I wanted to know if there was a faster way
> > > to do this (e.g. skipping the initial gdal_translate)?
> > > 
> > > Here's the gdalinfo dump of one of the tiles.  I'm interested in
> > 
> > mosaicking
> > 
> > > the
> > 
> > HDF4_EOS:EOS_GRID:"MCD15A2.A2002185.h14v10.005.2007172042412.hdf":MOD_Gri
> > d
> > 
> > > _MOD15A2:Lai_1km subdataset layer:
> > You should be able to use directly the subdataset name as an input
> > dataset name for gdalbuildvrt. No need for it to be a "real" filename.


More information about the gdal-dev mailing list