WKT for EPSG:4326 with LON 0 to +360 instead of -180 to +180

You can simply build a vrt file around your source grib with

gdal_translate -of VRT -a_ullr -130.0173001 55.0019441 -59.9870389 19.9746766 ECMWF_2017052412.grib2 ECMWF180.vrt

which is just 47kB large. The extent is calculated by hand. Similar to How to reproject raster from 0 360 to -180 180 with cutting 180 meridian you might as well run

gdal_translate -of VRT -b 1 ECMWF_2017052412.grib2 temp.vrt
gdalwarp -overwrite -t_srs WGS84 temp.vrt ECMWF180.tif  --config CENTER_LONG 0
gdalinfo ECMWF180.tif

to extract it from the first band. The grib file has 41 bands with a fairly high compression; converting all to tif uses over 1GB and 2 min calculation.

You might add -a_srs EPSG:4326 to the simple solution if you don't mind the difference between the source sphere and WGS84 ellipsoid. The simple solution will work unless you hit the 0 or 180° meridians, while the second will work always.


You might want to give wgrib2 a try. From this file of wgrib2 tips & tricks is the following:

(42) I want to convert a grid to -180 to 180 grid.

Assuming that you have IPOLATES installed and IPOLATES supports the grid, then you can do:

wgrib2 In.grb -new_grid_winds earth -new_grid latlon 180:361:1 -90:181:1 out.grb

If you don't want an 1x1 degree grid, you would have to change the grid definition.

In my experience, "assuming that you have IPOLATES installed" is equivalent to "assuming that you compiled wgrib2 yourself," but perhaps there are binaries with IPOLATES out there somewhere.


I just ran into this with similar GRIB data... both MRMS radar data and AirNow air quality data are projected in 0-360° longitude, I'm assuming to save space by using unsigned integers.

Using the "+pm" parameter of PROJ fixed this:

+proj=longlat +ellps=WGS84 +pm=-360 +datum=WGS84 +no_defs

For a MapServer layer, this worked out to:

PROJECTION
###    "init=epsg:4326"
       "+proj=longlat +ellps=WGS84 +pm=-360 +datum=WGS84 +no_defs"
END

I've not used GeoServer, but this might work for the WKT description:

GEOGCS["4326 plus 360",
    DATUM["unknown",
        SPHEROID["Sphere",6371229,0]],
    PRIMEM["Custom",-360],
    UNIT["degree",0.0174532925199433]]

The reason for the "-360" is that the coordinates listed in the original question (as well as my own) have an Upper Left of ~230°, when that should actually be translated/rotated to -130°. i.e.: (230-360) = -130°.