[gdal-dev] Projection issue with a netcdf file

Christopher Barker Chris.Barker at noaa.gov
Tue Jan 12 13:26:06 EST 2010

Kyle Shannon wrote:
> ncdump -h reports the same correct standard parallels (25) whereas 
> Coordinate System reports 0 for both standard parallels.  It appears the 
> projection is a Lambert Conformal Conic with 2 standard parallels, but 
> they are the same effectively making it a lcc with 1 standard parallel.

It looks like GDAL doesn't understand those parameters:

from: http://www.gdal.org/frmt_netcdf.html:

There is no universal way of storing georeferencing in netCDF files. The 
driver first tries to follow the CF-1 Convention from UNIDATA looking 
for the Metadata named "grid_mapping". If "grid_mapping" is not present, 
the driver will try to find an lat/lon grid array to set geotransform 
array. The NetCDF driver verifies that the Lat/Lon array is equally space.

If those 2 methods fail, NetCDF driver will try to read the following 
metadata directly and set up georefenrencing.

     * spatial_ref (Well Known Text)

So to get the spatial reference right, the netcdf file needs a proper 
spatial_ref parameter in WKT format. What does ncdump tell you it has? 
If it's not right, you can either get whoever is running your server to 
fix it, or you can fix it yourself by processing the nc file with something:
   ncdump-> filter -> ncgen
   NCO utilitites
   python (or perl, or ???) scripts.

good luck!


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the gdal-dev mailing list