converts GRIB2 files to JSON
Switch branches/tags
Nothing to show
Clone or download
Latest commit cfbe557 Nov 23, 2017
Failed to load latest commit information.
src increase max heap Sep 16, 2014
.gitattributes initial commit Oct 24, 2013
.gitignore initial commit Oct 24, 2013 documentation and license Oct 25, 2013 update readme Oct 25, 2013
pom.xml Fix Unidata repository Nov 17, 2017


A command line utility that decodes GRIB2 files as JSON.

This utility uses the netCDF-Java GRIB decoder, part of the THREDDS project by University Corporation for Atmospheric Research/Unidata.


git clone <this project>
mvn package

This creates a .tar.gz in the target directory. Unzip and untar the package in a location of choice.


The grib2json launch script is located in the bin directory and requires the JAVA_HOME environment variable to be defined.

> grib2json --help
Usage: grib2json [options] FILE
	[--compact -c] : enable compact Json formatting
	[--data -d] : print GRIB record data
	[--filter.category --fc value] : select records with this numeric category
	[--filter.parameter --fp value] : select records with this numeric parameter
	[--filter.surface --fs value] : select records with this numeric surface type
	[--filter.value --fv value] : select records with this numeric surface value
	[--help -h] : display this help
	[--names -n] : print names of numeric codes
	[--output -o value] : write output to the specified file (default is stdout)
	[--verbose -v] : enable logging to stdout

For example, the following command outputs to stdout the records for parameter 2 (U-component_of_wind), with surface type 103 (Specified height level above ground), and surface value 10.0 meters from the GRIB2 file gfs.t18z.pgrbf00.2p5deg.grib2. Notice the optional inclusion of human-readable xyzName keys and the data array:

> grib2json --names --data --fp 2 --fs 103 --fv 10.0 gfs.t18z.pgrbf00.2p5deg.grib2

            "disciplineName":"Meteorological products",
            "centerName":"US National Weather Service - NCEP(WMC)",
            "surface1TypeName":"Specified height level above ground",