Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7104 closed defect (fixed)

GDAL not able to open certain grib files

Reported by: rduivenvoorde Owned by: warmerdam
Priority: normal Milestone: 2.3.0
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

I received some grb files

http://duif.net/grb1.zip

which by Panoply are shown as valid grib1 files:

File type: GRIB1 Collection
 
netcdf file:/home/richard/z/17/rivm/20170821_grib2/harm36_v1_rivm_puff_2017082100_048_GB.grb {
  dimensions:
    lon = 300;
    lat = 300;
    time = 1;
    height_above_ground = 2;
    height_above_ground1 = 1;
    height_above_ground2 = 1;
    hybrid = 15;
    height_above_ground3 = 1;
  variables:
    int LatLon_Projection;
      :grid_mapping_name = "latitude_longitude";
      :earth_radius = 6367470.0; // double
      :_CoordinateTransformType = "Projection";
      :_CoordinateAxisTypes = "GeoX GeoY";

...


    float lat(lat=300);
      :units = "degrees_north";
      :_CoordinateAxisType = "Lat";

    float lon(lon=300);
      :units = "degrees_east";
      :_CoordinateAxisType = "Lon";

...

  // global attributes:
  :Originating_or_generating_Center = "De Bilt";
  :Originating_or_generating_Subcenter = "0";
  :GRIB_table_version = "0,1";
  :file_format = "GRIB-1";
  :Conventions = "CF-1.6";
  :history = "Read using CDM IOSP GribCollection v3";
  :featureType = "GRID";
  :_CoordSysBuilder = "ucar.nc2.dataset.conv.CF1Convention";

File type: GRIB1 Collection
 
netcdf file:/home/richard/z/17/rivm/20170821_grib2/RIVM_HIRLAM_H11_2017082106_000_GB.grb {

  group: RotatedLatLon_550X726-56p24N-3p993W {
    dimensions:
      x = 726;
      y = 550;
      time = 1;
      hybrid = 14;
    variables:
      int RotatedLatLon_Projection;
        :grid_mapping_name = "rotated_latlon_grib";
        :grid_south_pole_latitude = -30.000001907348633; // double
        :grid_south_pole_longitude = -15.000000953674316; // double
        :grid_south_pole_angle = 0.0; // double
        :_CoordinateTransformType = "Projection";
        :_CoordinateAxisTypes = "GeoX GeoY";

...

      float x(x=726);
        :standard_name = "projection_x_coordinate";
        :units = "km";
        :_CoordinateAxisType = "GeoX";

      float y(y=550);
        :standard_name = "projection_y_coordinate";
        :units = "km";
        :_CoordinateAxisType = "GeoY";

...

      float hybrid(hybrid=14);
        :units = "";
        :long_name = "Hybrid level";
        :positive = "down";
        :Grib_level_type = 109; // int
        :_CoordinateAxisType = "GeoZ";
        :_CoordinateZisPositive = "down";

    // group attributes:
    :long_name = "RotatedLatLon_550X726 (Center 56.19N 4.008W)";
  }
  // global attributes:
  :Originating_or_generating_Center = "De Bilt";
  :Originating_or_generating_Subcenter = "0";
  :GRIB_table_version = "0,1";
  :file_format = "GRIB-1";
  :Conventions = "CF-1.6";
  :history = "Read using CDM IOSP GribCollection v3";
  :featureType = "GRID";
  :_CoordSysBuilder = "ucar.nc2.dataset.conv.CF1Convention";

But gdal does not see any rasters in them:

$ gdalinfo harm36_v1_rivm_puff_2017082100_048_GB.grb
ERROR 4: harm36_v1_rivm_puff_2017082100_048_GB.grb is a grib file, but no raster dataset was successfully identified.
gdalinfo failed - unable to open 'harm36_v1_rivm_puff_2017082100_048_GB.grb'.
$ gdalinfo RIVM_HIRLAM_H11_2017082106_000_GB.grb
ERROR 4: RIVM_HIRLAM_H11_2017082106_000_GB.grb is a grib file, but no raster dataset was successfully identified.
gdalinfo failed - unable to open 'RIVM_HIRLAM_H11_2017082106_000_GB.grb'.

As earliers datasets, this could be a dataformat problem, or something else.

Thanks

Attachments (1)

ticket_7104_do_not_merge_this.patch (1.4 KB ) - added by Even Rouault 6 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Even Rouault, 6 years ago

I have had a early look and a preliminary patch attached, but I suspect the georeferencing in the RIVM_HIRLAM_H11_2017082106_000_GB.grb case is incomplete (not taking into account the rotated pole)

What is this Panoply software you mention ?

Reference for Grib1 Section2 format : https://rda.ucar.edu/docs/formats/grib/prev-vers/sect2.txt

by Even Rouault, 6 years ago

comment:2 by rduivenvoorde, 6 years ago

Panoply is: https://www.giss.nasa.gov/tools/panoply/download/

It can open or at least read almost every netcdf/grib file I throw at it...

As said, I'm not sure about the quality/format of these files, so IF they are not correct, we should not hack them correct...

comment:3 by Even Rouault, 6 years ago

I believe there are correct. It is just that the version of degrib we use doesn't support them out of the box

comment:4 by Even Rouault, 6 years ago

In 40769:

/vsisparse/: make Read() detect end of file (needed for test of refs #7104)

comment:5 by Even Rouault, 6 years ago

Resolution: fixed
Status: newclosed

In 40770:

GRIB: add support for GRIB1 products with non-zero NV (number of vertical coordinate parameters) field in GDS (NV is just ignored); add support for Rotated pole LatLon projections; error out on GRIB1 quasi-rectangular latlon grids with varying number of points per row (fixes #7104)

comment:6 by Even Rouault, 6 years ago

In 40771:

GTiff: when writing SRS, do not drop EXTENSION PROJ4 node if the projection is unknown (related to refs #7104)

comment:7 by Even Rouault, 6 years ago

Milestone: 2.3.0

comment:8 by Even Rouault, 6 years ago

In 40773:

Commit files that should have gone with r40770 (refs #7104)

comment:9 by Even Rouault, 6 years ago

In 40776:

GRIB: add +b parameter in rotated pole proj.4 string (refs #7104)

Note: See TracTickets for help on using tickets.