[gdal-dev] GRIB file error: Ran out of file reading SECT0

Hannah Augustin hannah.augustin at gmail.com
Sat Dec 3 06:24:39 PST 2016


Hello all,
For the first time I am working with GRIB files and have stumbled across a
problem having GDAL open files. The data source is the Copernicus
Atmosphere Monitoring Service (CAMS <https://atmosphere.copernicus.eu/>).
QGIS, ArcGIS and GRIB viewers have no problem opening the file for view,
yet GDAL returns this error using multiple functions, including gdalinfo:

Warning: Inside GRIB2Inventory, Message # 26
ERROR: Ran out of file reading SECT0
There were 72 trailing bytes in the file.

Depending on the file, the reported trailing bytes varies. I should also
mention that no spatial reference system is defined, though my assumption
is that it is WGS 84, based on the data. If I just wanted to view the data,
I would  use any of the aforementioned software to do so, but I would like
to archive selected GRIB datasets in a postGIS database if possible.

Does anyone know the source of this error message? Has anyone found a work
around? I would attach a sample GRIB file, but am not sure as to the
protocol for attachments on this listserv.

kind regards,
Hannah Augustin

More info about the dataset including error message and first band (out of
25) of GRIB file:
PS C:\temp> gdalinfo .\z_cams_c_ecmf_20161203000000_prod_an_pl_000_ch4.grib
Warning: Inside GRIB2Inventory, Message # 26
ERROR: Ran out of file reading SECT0
There were 72 trailing bytes in the file.
Driver: GRIB/GRIdded Binary (.grb)
Files: .\z_cams_c_ecmf_20161203000000_prod_an_pl_000_ch4.grb
Size is 900, 451
Coordinate System is:
GEOGCS["Coordinate System imported from GRIB file",
    DATUM["unknown",
        SPHEROID["Sphere",6367470,0]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (-0.200000000000000,90.200000000000003)
Pixel Size = (0.400000000000000,-0.400000000000000)
Corner Coordinates:
Upper Left  (  -0.2000000,  90.2000000) (  0d12' 0.00"W, 90d12' 0.00"N)
Lower Left  (  -0.2000000, -90.2000000) (  0d12' 0.00"W, 90d12' 0.00"S)
Upper Right (     359.800,      90.200) (359d48' 0.00"E, 90d12' 0.00"N)
Lower Right (     359.800,     -90.200) (359d48' 0.00"E, 90d12' 0.00"S)
Center      ( 179.8000000,   0.0000000) (179d48' 0.00"E,  0d 0' 0.01"N)
Band 1 Block=900x1 Type=Float64, ColorInterp=Undefined
  Description = 1[hPa] ISBL (Isobaric surface)
  Metadata:
    GRIB_COMMENT=Potential vorticity [m^2K/kg/s]
    GRIB_ELEMENT=PVORT
    GRIB_FORECAST_SECONDS=0 sec
    GRIB_REF_TIME=  1480723200 sec UTC
    GRIB_SHORT_NAME=1-ISBL
    GRIB_UNIT=[m^2K/kg/s]
    GRIB_VALID_TIME=  1480723200 sec UTC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161203/a3c7955f/attachment.html>


More information about the gdal-dev mailing list