gdalinfo pronts wrong corner coordinates for grib2 converted to longlat with CDO
Added by Alexander Trufanov 4 months ago
Hi,
I'm using grib2 predictions from https://opendata.dwd.de/weather/nwp/icon/grib/
and have to convert them to longlat according to this doc: https://www.dwd.de/DE/leistungen/opendata/help/modelle/Opendata_cdo_EN.pdf
with cdo command: cdo -O -f grb2 remap,target_grid_world_0125.txt,weights_icogl2world_0125.nc original.grib2 1.grib2
weights are from https://opendata.dwd.de/weather/lib/cdo/ICON_GLOBAL2WORLD_0125_EASY.tar.bz2
cdo ver is 2.2.1+
I actually tested 2.2.1 (may be 2.2.2 too) and 2.4.3.
The result file is attached.
In all cases the result file had been processed correctly on my old system. It has
gdalinfo --version
GDAL 2.4.0, released 2018/12/1
It reports:
Upper Left (-180.0625000, 90.0625000) (180d 3'45.00"W, 90d 3'45.00"N)
Lower Left (-180.0625000, -90.0625000) (180d 3'45.00"W, 90d 3'45.00"S)
Upper Right ( 179.8125000, 90.0625000) (179d48'45.00"E, 90d 3'45.00"N)
Lower Right ( 179.8125000, -90.0625000) (179d48'45.00"E, 90d 3'45.00"S)
Center ( -0.1250000, 0.0000000) ( 0d 7'30.00"W, 0d 0' 0.01"N)
(command: gdalinfo 1.grib2)
And it won't work on a modern systems. I tried 2 with gdalinfo versions:
GDAL 3.8.4, released 2024/02/08
GDAL 3.6.2, released 2023/01/02
Both gdalinfo output is:
Upper Left ( 179.9375000, 90.0625000) (179d56'15.00"E, 90d 3'45.00"N)
Lower Left ( 179.9375000, -90.0625000) (179d56'15.00"E, 90d 3'45.00"S)
Upper Right ( 539.812, 90.062) (Invalid angle, 90d 3'45.00"N)
Lower Right ( 539.812, -90.062) (Invalid angle, 90d 3'45.00"S)
I suspect it's bcs of gdal, libproj or bcs cdo produces grib2 which isn't fully complient with grib2 standard.
Could you please elaborate and take a look into this issue?
P.S. same issue is reported to gdal: https://github.com/OSGeo/gdal/issues/10655
1.grib2.zip (4.25 MB) 1.grib2.zip |
Replies (1)
RE: gdalinfo pronts wrong corner coordinates for grib2 converted to longlat with CDO - Added by Uwe Schulzweida 4 months ago
Hi Alexander,
This must be an interpretation problem with the new GDAL versions!
CDO passes the first longitude value of -180 directly to ecCodes. The positive value 180 is then stored with ecCodes. CDO has no influence on this.
Cheers,
Uwe