This recommendation expands on the Include Datum Attributes for Data in Grid Structures.
Recommendation:

We recommend that Earth Science dataset granules be produced with complete georeferencing information for all their geospatial coordinates. This georeference information should be encoded in an interoperable way based on the CF convention and the following specific guidelines:

  • Granules are required to contain the most applicable type of geospatial coordinates for the expected application of their data. The decision whether to provide any additional type of geospatial coordinates is left to the data producer.

  • The georeference information should be given as both CF grid mapping variable attributes and OGC Well-Known Text (WKT), whenever possible. In all other cases the georeference information should be given in either of the two formats that supports it.
  • The preference when processing georeference information should be given to the WKT content if available.

Following the above directions will support the widest range of software tools and at the same time control the file size by avoiding storage of redundant geospatial coordinate data.

Recommendation Details: With the increase in the variety of software tools analyzing or visualizing Earth Science datasets the need to accurately and unambiguously put their data into the proper geospatial context has become an essential aspect of data interoperability. Correctly encoding geospatial coordinates in granules is only the prerequisite as those coordinates must also be associated with appropriate coordinate reference systems (CRS). We assume the former and provide here instructions how to achieve the latter with the CF convention.

Georeference information is supplied via grid mapping variables. Such variables do not hold any data and serve only to group attributes that describe a specific CRS. An attribute grid_mapping_name must always be present containing the string identifier of a supported CRS or map projection listed in Appendix F of the CF convention. The particular CRS or map projection determines all other attributes that need to be attached to the grid mapping variable.

The example below illustrates the concept for the latitude and longitude CRS on the WGS-84 geoid.

dimensions:
  lat = 180 ;
  lon = 360 ;

variables:
  double lat(lat) ;
    lat:standard_name = "latitude" ; 
    lat:units = "degrees_north" ;

  double lon(lon) ; 
    lon:standard_name = "longitude" ; 
    lon:units = "degrees_east" ;

  float eo_data(lat, lon) ;
    eo_data:long_name = "Earth observation data" ; 
    eo_data:grid_mapping = "crs" ;

  int crs ;
    crs:grid_mapping_name = "latitude_longitude" ; 
    crs:longitude_of_prime_meridian = 0.0 ; 
    crs:semi_major_axis = 6378137.0 ; 
    crs:inverse_flattening = 298.257223563 ;

The crs variable is the grid mapping variable. The name and datatype of this variable are arbitrary and, for simplicity, it should always be a scalar (rank is zero). The grid_mapping_name attribute of the crs variable has the value of latitude_longitude which is the CF identifier for the generic latitude-longitude CRS on a geoid datum. The other attributes — longitude_of_prime_meridian, semi_major_axis, and inverse_flattening — serve to define the actual geoid parameters.

Starting from Version 1.7, the CF convention also permits georeferencing information as a string in the OGC WKT format. The grid mapping variable crs from the last example is now:

int crs ;
  crs:grid_mapping_name = "latitude_longitude" ; 
  crs:longitude_of_prime_meridian = 0.0 ; 
  crs:semi_major_axis = 6378137.0 ; 
  crs:inverse_flattening = 298.257223563 ; 
  crs:crs_wkt = "GEODCRS[\"WGS 84\",
                 DATUM[\"World Geodetic System 1984\", 
                       ELLIPSOID[\"WGS 84\", 6378137, 298.257223563,
                                 LENGTHUNIT[\"metre\",1.0]]], 
                 CS[ellipsoidal,2],
                 AXIS[\"latitude\",north,ORDER[1]], 
                 AXIS[\"longitude\",east,ORDER[2]], 
                 ANGLEUNIT[\"degree\",0.01745329252], 
                 ID[\"EPSG\",4326]]" ;

The WKT description of the WGS-84 datum is stored in the new attribute: crs_wkt. Despite allowing the WKT format, the CF convention still requires that georeference information be primarily described via a number of attributes. Although the WKT format provides a more extensive georeference definition, an issue with including the WKT description is that there is no general translation between WKT parameters and CF grid mapping variable attributes.

The example below demonstrates georeferencing information for a map projection:

dimensions:
  y = 500 ;
  x = 500 ;
  time = 50 ;

variables:
  int crs ;
    crs:grid_mapping_name = "lambert_conformal_conic" ; 
    crs:longitude_of_prime_meridian = 0.0 ; 
    crs:semi_major_axis = 6378137.0 ; 
    crs:inverse_flattening = 298.257223563 ; 
    crs:standard_parallel = 25.0 ; 
    crs:longitude_of_central_meridian = -100.0 ; 
    crs:latitude_of_projection_origin = 25.0 ; 
    crs:false_northing = 1500000.0 ;
    crs:false_easting = 5000000.0 ;

  double y(y);
    y:units = "km" ;
    y:standard_name = "projection_y_coordinate" ;

  double x(x);
  x:units = "km" ;
  x:standard_name = "projection_x_coordinate" ;

  int time(time) ;
    time:units = "hours since 2001-06-23T22:00:00Z" ;

  float eos_data(time, y, x) ; 
    eos_data:grid_mapping = "crs" ; 
    eos_data:long_name = "Earth observation data" ;

The grid mapping variable is crs and the map projection’s definition is provided by its attributes: standard_parallel, longitude_of_central_meridian,
and latitude_of_projection_origin. The x and y are the map projection coordinates, designated by their standard_name attribute values: projection_x_coordinate and projection_y_coordinate, respectively.

The above example is not strictly compliant with the CF convention because CF requires providing the latitude and longitude coordinates in addition to the projected coordinates x and y. Latitude and longitude coordinates are omitted from the example because they are not required to geospatially describe the data on the map projection and including them would make the file much larger.