[Gdal-dev] matching metadata for different file formats

Matt Fearon matt at guero.sr.unh.edu
Thu Jun 28 15:48:07 EDT 2007


Dear GDAL users:

I am converting grib files to netcdf as a 1st step using ncar command 
language. netcdf is an easier format for me in the long run for data 
storage. After this 1st step, I would like to reprojected my data from 
polar stereographic to geographic. The datum of the polar stereographic 
is unique in that data are mapped to a sphere with radii 6371200 km. 
Here is my trouble:

If I skip the 1st step and simply reproject the grib data to geographic 
using gdalwarp everything works perfectly. However, if try to reproject 
the data after the 1st step, I am unsuccessful. I am also performing 
some simple calculations on the data before going from grib to netcdf, 
but I am not changing the coordinate system, projection, datum 
etc...Some of the metadata is lost going from grib to netcdf, and 
therefore, I apply gdal_translate to the netcdf file adding the lost 
metadata back in and converting the format to geotiff. However, after 
these steps, I still notice some slight differences in the metadata 
between the original grib and the geotiff. I am struggling to make the 
metadata consistent for 3 parameters (GEOGCS, DATUM, and SPHEROID), 
please see metadata comparison at the base of this email from gdalinfo.

Any suggestions on how I can make these 3 parameters consistent between 
files would be much appreciated. Perhaps some combination of options 
using gdal_translate? Although, I have tried many combinations 
unsuccessfully, and therefore, the data do not map correctly. gdalinfo 
may be excluding some information as well. However, everything is 
consistent with the metadata except these 3 parameters. My original data 
are hourly NEXRAD precipitation, mosaicked over the CONUS at 4km, in 
grib format, polar stereographic projection assuming the Earth as a 
sphere with radii of 6371200 km, downloaded from NCEP. I am converting 
hourly to daily and storing in netcdf for various projects.

thanks in advance for the help,
Matt


Driver: GRIB/GRIdded Binary (.grb)
Files: gag4.19980201.01
Size is 1160, 880
Coordinate System is:
PROJCS["unnamed",
  GEOGCS["Coordinate System imported from GRIB file",
      DATUM["unknown",
          SPHEROID["Sphere",6371200,0]],

Driver: GTiff/GeoTIFF
Files: 19980201.tif
Size is 1160, 880
Coordinate System is:
PROJCS["unnamed",
  GEOGCS["unnamed ellipse",
      DATUM["unknown",
          SPHEROID["unnamed",6371200,0]],



More information about the Gdal-dev mailing list