[gdal-dev] NetCDF generated by GDAL not compliant with CF-1.0 for
geographical grids
Reinoud Bokhorst
bokhorst at argoss.nl
Fri Dec 21 06:21:43 EST 2007
Hi,
I have a WCS that reads and writes NetCDF using GDAL. The source NetCDF has a regular lat/lon geographical grid (no projection). The NetCDF that is generated following a WCS request (parameters: BBOX=0.0,55.0,5.0,60.0&SRS=epsg:4326&RESX=0.5&RESY=0.5) has the following header (ncdump -c):
netcdf my_netcdf {
dimensions:
x = 10 ;
y = 10 ;
variables:
char GDAL_Geographics ;
GDAL_Geographics:Northernmost_Northing = 55. ;
GDAL_Geographics:Southernmost_Northing = 60. ;
GDAL_Geographics:Easternmost_Easting = 5. ;
GDAL_Geographics:Westernmost_Easting = 0. ;
GDAL_Geographics:spatial_ref = "GEOGCS[\"WGS
84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS
84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]"
;
GDAL_Geographics:GeoTransform = "0 0.5 -0 55 0 0.5 " ;
GDAL_Geographics:grid_mapping_name = "Geographics
Coordinate System" ;
GDAL_Geographics:long_name = "Grid_latitude" ;
float Band1(y, x) ;
Band1:_FillValue = 0.f ;
Band1:grid_mapping = "GDAL_Geographics" ;
Band1:long_name = "GDAL Band Number 1" ;
// global attributes:
:Conventions = "CF-1.0" ;
data:
}
However, it seems that the grid_mapping_name "Geographics Coordinate System" is not a valid grid_mapping_name in the CF-1.0 convention (only 8 are mentioned in the convention). In CF-1.0 a geographic grid should be represented like this:
netcdf my_netcdf_cf1.0 {
dimensions:
y = 10 ;
x = 10 ;
variables:
float y(y) ;
y:standard_name = "latitude" ;
y:units = "degrees_north" ;
float x(x) ;
x:standard_name = "longitude" ;
x:units = "degrees_east" ;
float Band1(y, x) ;
Band1:_FillValue = 0.f ;
Band1:long_name = "GDAL Band Number 1" ;
// global attributes:
:Conventions = "CF-1.0" ;
data:
y = 55, 55.5, 56, 56.5, 57, 57.5, 58, 58.5, 59, 59.5 ;
x = 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5 ;
}
Where only the 'units' attribute is required to indicate lat / lon. I am not sure if in this case the y and x arrays should start at 55.0N and 5.0E respectively or at 55.25N and 5.25E.
Reinoud Bokhorst
More information about the gdal-dev
mailing list