Thanks for the link Even!<br>There was everything I needed to know in line 338 - "Loop over bands".<br><div>I was missing this: Description = banda.GetDescription().</div><div><br></div><div>Thanks,</div><div>Eloi<br>
<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Jun 8, 2010 at 9:41 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><a href="http://trac.osgeo.org/gdal/browser/trunk/gdal/swig/python/samples/gdalinfo.py" target="_blank">http://trac.osgeo.org/gdal/browser/trunk/gdal/swig/python/samples/gdalinfo.py</a><br>
<br>
Would need just a few minor changes to work against GDAL 1.7 python bindings<br>
<br>
Le Tuesday 08 June 2010 19:51:50 Eloi Ribeiro, vous avez écrit :<br>
<div><div></div><div class="h5">> Hi,<br>
><br>
> I don't manage to get all the info from a GRIB file with a python script as<br>
> it's possible with gdalinfo output.<br>
><br>
> gdalinfo output example from a GRIB band:<br>
><br>
> *Band 1 Block=720x1 Type=Float64, ColorInterp=Undefined*<br>
> * Description = 2[m] HTGL="Specified height level above ground"*<br>
> * Metadata:*<br>
> * GRIB_UNIT=[K]*<br>
> * GRIB_COMMENT=Minimum Temperature [K]*<br>
> * GRIB_ELEMENT=TMIN*<br>
> * GRIB_SHORT_NAME=2-HTGL*<br>
> * GRIB_REF_TIME= 283996800 sec UTC*<br>
> * GRIB_VALID_TIME= 284000400 sec UTC*<br>
> * GRIB_FORECAST_SECONDS=0 sec*<br>
><br>
> Till now I manage to get all Metadata tags but not all the info from the<br>
> tow first lines.<br>
> I am using the following code:<br>
><br>
> *from osgeo import gdal*<br>
> *<br>
> *<br>
> *dataset = gdal.Open(filename, gdal.GA_ReadOnly)*<br>
> *if dataset is None:*<br>
> * print 'Nao foi possivel abrir a imagem!'*<br>
> *for nBandas in range(1, dataset.RasterCount + 1):*<br>
> * banda = dataset.GetRasterBand(nBandas)*<br>
> * BlockSize = banda.GetBlockSize()*<br>
> * DataType = gdal.GetDataTypeName(banda.DataType)*<br>
> * Metadata = banda.GetMetadata()*<br>
> * for chave, valor in Metadata.iteritems():*<br>
> * print chave, '=', valor.strip()*<br>
><br>
> I would appreciate some help.<br>
> Thanks in advance.<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Eloi Ribeiro<br>GIS Analyst<br>39,45º -4,40º<br><a href="http://eloiribeiro.wordpress.com">http://eloiribeiro.wordpress.com</a><br>
</div>