Opened 12 years ago

Last modified 9 years ago

#2637 closed defect

grib driver: grid vs cell-center convention wrong? — at Version 8

Reported by: hamish Owned by: warmerdam
Priority: normal Milestone: 1.9.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: grib
Cc: Kyle Shannon, bfraser, Daniel Morissette, mprecise, Even Rouault

Description (last modified by hamish)


I'd previously sent this to ticket #2550 but as it seems to be mostly unrelated to the problem described there I think it deserves its own one.

I am seeing a shift in GRIB data.

AFAICT it is simply shifted half a cell to the SE from where it should be. I assumed this was due to the usual grid vs. cell-center convention mistake, but that's just a round up the usual suspects guess.

attaching screenshot.

a list of commands to recreate my image is here:

GRIB data in the screenshot downloaded from I can't guarantee the integrity of globalmarinenet's data (I have no idea about it other than the link); so it would be good to verify that this is happening with other datasets (ie something directly from the WMO) and in the spec. In the PDF which speaks of triangulation method it talks about data being at the vertices, fwtw.

thanks, Hamish

ps- Is there an internal tag in the format for no-data? In the above data it is represented by "9999", which is easy to set with gdal_translate -a_nodata, but in other GRIB data I have it is what I guess is the max for Float64, which is a number 4-6 lines long; too much to type by hand.

Change History (11)

Changed 12 years ago by hamish

Attachment: grib_half_cell_shift.png added

grib cells shifted 1/2 to SE

comment:1 Changed 12 years ago by hamish

I'd note that the cell size for these files are typically 1-1.25 degrees, so the data is offset > 50km.


comment:2 Changed 11 years ago by Kyle Shannon

Cc: Kyle Shannon added

comment:3 Changed 11 years ago by tbouffon

Resolution: worksforme
Status: newclosed

Hi, I haven't had time to check 1.6.2, but since the bug is not marked as closed, the attached patch seems to shift the area back. I only tested it for one day, so use with care !

Changed 11 years ago by tbouffon

Attachment: gdal_grib_node.patch added

comment:4 Changed 11 years ago by tbouffon

Resolution: worksforme
Status: closedreopened

Sorry I didn't mean to close the bug, just wanted to says my patch works for me. By the way, The bug is still in 1.6.2, and the patch still works fine

Changed 10 years ago by hamish

updated patch vs. latest svn trunk for grid registration error

comment:5 Changed 10 years ago by hamish

recut patch compatible with the latest svn trunk added.

apparent confirmation of the grid-registration error diagnosis:


comment:6 Changed 10 years ago by hamish

sample data in #3629 (a duplicate)

comment:7 in reply to:  6 Changed 10 years ago by rhijmans

Description: modified (diff)

Replying to hamish:

sample data in #3629 (a duplicate)

comment:8 Changed 10 years ago by hamish

Description: modified (diff)

It would be really nice if this error gets fixed. It has been open for a long time.

hey you edited the wrong box! :)

(easy to do, I filed a bug upstream at trac HQ about a year ago to make it fold away into a little [-] expanding [+] box. maybe just open that for the submitter or sysops to have access to change?)

description restored..

Note: See TracTickets for help on using tickets.