<div>Hi,</div><div><br></div><div>I don&#39;t manage to get all the info from a GRIB file with a python script as it&#39;s possible with gdalinfo output.</div><div><br></div><div>gdalinfo output example from a GRIB band:</div>
<div><br></div><div><i>Band 1 Block=720x1 Type=Float64, ColorInterp=Undefined</i></div><div><i>  Description = 2[m] HTGL=&quot;Specified height level above ground&quot;</i></div><div><i>  Metadata:</i></div><div><i>    GRIB_UNIT=[K]</i></div>
<div><i>    GRIB_COMMENT=Minimum Temperature [K]</i></div><div><i>    GRIB_ELEMENT=TMIN</i></div><div><i>    GRIB_SHORT_NAME=2-HTGL</i></div><div><i>    GRIB_REF_TIME=   283996800 sec UTC</i></div><div><i>    GRIB_VALID_TIME=   284000400 sec UTC</i></div>
<div><i>    GRIB_FORECAST_SECONDS=0 sec</i></div><div><br></div><div>Till now I manage to get all Metadata tags but not all the info from the tow first lines.</div><div>I am using the following code:</div><div><br></div><div>
<i>from osgeo import gdal</i></div><div><i><br></i></div><div><i>dataset = gdal.Open(filename, gdal.GA_ReadOnly)</i></div><div><i>if dataset is None:</i></div><div><i>    print &#39;Nao foi possivel abrir a imagem!&#39;</i></div>
<div><i>for nBandas in range(1, dataset.RasterCount + 1):</i></div><div><i>    banda = dataset.GetRasterBand(nBandas)</i></div><div><i>    BlockSize = banda.GetBlockSize()</i></div><div><i>    DataType  = gdal.GetDataTypeName(banda.DataType)</i></div>
<div><i>    Metadata = banda.GetMetadata()</i></div><div><i>    for chave, valor in Metadata.iteritems():</i></div><div><i>        print chave, &#39;=&#39;, valor.strip()</i></div><div><br></div><div>I would appreciate some help.</div>
<div>Thanks in advance.</div><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>