OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.79k stars 2.51k forks source link

GDAL doesn't open grib2 files from DWD server #1018

Open guiguitcho opened 5 years ago

guiguitcho commented 5 years ago

Expected behavior and actual behavior.

Gdal crashes when trying to open grib2 produced by DWD for the Icon global model, for instance: https://opendata.dwd.de/weather/icon/global/grib/00/t_2m/ It gives the following error message: getgridtemplate: GDT Template 3.101 not defined. ERROR 4: ICON_iko_single_level_elements_world_T_2M_2018101600_011.grib2 is a grib file, but no raster dataset was successfully identified. gdalinfo failed - unable to open 'ICON_iko_single_level_elements_world_T_2M_2018101600_011.grib2'.

File is read as expected by grib_tools api (grib_ls or grib_dump)

Steps to reproduce the problem.

gdalinfo ICON_iko_single_level_elements_world_T_2M_2018101600_011.grib2

Operating system

Ubuntu 18.04 and docker image geographica/gdal2:latest

GDAL version and provenance

2.2.3 for Ubuntu 18.04 and 2.3.2 for the docker image

jratike80 commented 5 years ago

I tried to test some file from that directory but 7zip complained about data errors and it could not extract grib2 file from any of the todays bz2 archives (17-Oct-2018).

guiguitcho commented 5 years ago

I have no problem in extracting the archive using file-roller (Ubuntu 18.04 - gnome). Maybe 7zip does not manage bz2 compression ? here is a direct link to a unzipped grib2 file: https://mega.nz/#!10UhlYZT!GIh1S_OWQrY5BbQHie8AGDPKLrkIbwat7lsXKXPUh2Q

jratike80 commented 5 years ago

My GDAL 2.4.0dev (gisinternals build) gives me the same error: ERROR 4: ICON_iko_single_level_elements_world_T_2M_2018101700_011.grib2 is a grib file, but no raster dataset was successfully identified.

gogglesguy commented 5 years ago

This looks like a General Unstructured Grid. There is no usual Nx/Ny resolution for these grids. Does GDAL even support those type of grids? http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp3-101.shtml

https://github.com/OSGeo/gdal/blob/48e64636d25ecb2b76fdbe1985a19ce78bc50bcc/gdal/frmts/grib/degrib/degrib/metaparse.cpp#L1015-L1021

hfs commented 5 years ago

DWD’s ICON model is based on spherical triangles.

See https://www.dwd.de/EN/research/weatherforecasting/num_modelling/01_num_weather_prediction_modells/icon_description.html?nn=484268

It can’t be converted into a regular square raster without interpolation.

brry commented 2 years ago

This may be helpful: Guide for converting the original ICON triangular grid into a regular lat/lon grid: https://www.dwd.de/DE/leistungen/opendata/help/modelle/Opendata_cdo_EN.pdf