2

Situation:

I have some .grib2 files that I downloaded from a (supposed to be) reliable source. When I do

$ gdalsrsinfo file.grib2

I get:

PROJ.4 : +proj=lcc +lat_0=38.5 +lon_0=262.5 +lat_1=38.5 +lat_2=38.5 +x_0=0 +y_0=0 +R=6371229 +units=m +no_defs

OGC WKT2:2018 :
PROJCRS["unnamed",
  BASEGEOGCRS["Coordinate System imported from GRIB file",
    DATUM["unnamed",
        ELLIPSOID["Sphere",6371229,0,
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433,
            ID["EPSG",9122]]]],
  CONVERSION["unnamed",
    METHOD["Lambert Conic Conformal (2SP)",
        ID["EPSG",9802]],
    PARAMETER["Latitude of false origin",38.5,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8821]],
    PARAMETER["Longitude of false origin",262.5,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8822]],
    PARAMETER["Latitude of 1st standard parallel",38.5,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8823]],
    PARAMETER["Latitude of 2nd standard parallel",38.5,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8824]],
    PARAMETER["Easting at false origin",0,
        LENGTHUNIT["Metre",1],
        ID["EPSG",8826]],
    PARAMETER["Northing at false origin",0,
        LENGTHUNIT["Metre",1],
        ID["EPSG",8827]]],
  CS[Cartesian,2],
    AXIS["easting",east,
        ORDER[1],
        LENGTHUNIT["Metre",1]],
    AXIS["northing",north,
        ORDER[2],
        LENGTHUNIT["Metre",1]]]

So, from my understanding, the file is provided in a custom CRS, which is defined in two formats (PROJ.4 and in OGC WKT2) as part of the metadata of this file. (is that correct?)

Expectation:

According to the CF MetaData page, OGC WKT2 is used by GDAL and PROJ.4 is part of the OSGeo family.

So, as I have my QGIS 3.10 installed with OSGeo4W (Windows 10), I was expecting that, when I load this grib2 file into a QGIS, the layer would be loaded with a custom projection (but well projected) following the OGC WKT2 / PROJ.4 specifications.

Result:

QGIS says that this file has no CRS set and the layer is presented totally distorted.

Questions:

1-) Can I reproject this file to some other CRS (as ESPG:4326)?

2-) Do I need to install Proj4 or OGC WKT libraries separately on my OSGeo4W ?

  • 1
    In Settings menu, Options, Crs tab, you will find the behavior of QGIS when a layer with an unknown CRS is loaded. Avoid assigning a CRS by default. Try to set the custom CRS to the layer. – Gabriel De Luca Dec 14 '19 at 1:21
  • Thank you, Gabriel. This information is pretty helpful! Indeed, creating by hand a new custom CRS and copying + pasting the Proj.4 returned by gdalsrsinfo made the job! But it still makes me think: why QGIS doesn't do it automatically, as all the information needed is already contained in the own grib2 file? – André Della Libera Zanchetta Dec 14 '19 at 1:37
  • 1
    André, you are welcome. I don't know. Use OSGeo4W Advanced Installer to install qgis-ltr too, maintain both qgis and qgis-ltr packages updated. Since last updates of proj library, gdal and qgis are updating to implement the changes. OSGeo4W will solve dependencies so you don't need to install other packages by hand. My little experience with GRIB files was through XyGrib app, downloadig GFS models, but XyGrib automatically reprojects the grid. Then I have extracted messages with tkdegrib as points shapefies. GDAL has its own GRIB driver, but I don't know how fine is it working. – Gabriel De Luca Dec 14 '19 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.