4

I've downloaded a NOAA NARR grib file that I want to extract the wind component as well as the geographic location. I'm able to extract the wind component from the grib but I can't seem to find any indication that there's a specific latitude/longitude value for each data point. Ultimately I want to extract the data and load it into a relational database with time,location,wind_data. The grib file I'm using can be found here.

http://nomads.ncdc.noaa.gov/data/narr/201410/20141001/narr-a_221_20141001_0000_000.grb

1

You can translate the first (or any other) band of the grib raster to XYZ format using:

gdal_translate -b 1 -of "XYZ" narr-a.gsb narr-a.xyz

This gives you the coordinates in the lcc projection used.

Then you can load this file as delimited text into QGIS, using field_1 as X and field_2 as Y coordinate, and the following custom CRS (derived from what gdalinfo reports on the grb):

+proj=lcc +lat_1=50 +lat_2=50 +lat_0=50 +lon_0=-107 +x_0=0 +y_0=0 +a=6371200 +b=6371200 +units=m +no_defs

This point layer can easily be reprojected to WGS84, and the WGS84 coordinates added to the attribute table.

Alternatively to QGIS, the reprojection should also be possible using pure GDAL.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.