[gdal-dev] Grib Support?

Zachary Flamig zac at weatherwary.com
Tue Feb 25 10:13:59 PST 2020


Hi,

We noticed that somewhere along the line to GDAL 3 something changed with respect to grib support and it now doesn’t correctly parse some projections.

For example, this file:
https://nomads.ncep.noaa.gov/pub/data/nccf/com/blend/prod/blend.20200224/17/grib2/blend.t17z.master.f001.co.grib2 <https://nomads.ncep.noaa.gov/pub/data/nccf/com/blend/prod/blend.20200224/17/grib2/blend.t17z.master.f001.co.grib2>

The grib specifies a lower bound latitude which isn’t being properly converted to the upper bound latitude that gdal wants.

I traced this back to here: https://github.com/OSGeo/gdal/blob/master/gdal/frmts/grib/gribdataset.cpp#L2127 <https://github.com/OSGeo/gdal/blob/master/gdal/frmts/grib/gribdataset.cpp#L2127> where scan in this file is set to 80 not 64 so the if statement isn’t true. This is fixable if we do proper flag checks i.e. (if ((meta->gds.scan & GRIB2BIT_2) == GRIB2BIT_2)) but this line hasn’t changed from GDAL 2.

I did see this comment https://github.com/OSGeo/gdal/blob/master/gdal/frmts/grib/degrib/degrib/metaparse.cpp#L1259 <https://github.com/OSGeo/gdal/blob/master/gdal/frmts/grib/degrib/degrib/metaparse.cpp#L1259>
which makes me think something changed with the underlying grib2 libraries?

Any thoughts on the best way forward?

Zac
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200225/2748ed2e/attachment-0001.html>


More information about the gdal-dev mailing list