1. CF standard: add a dummy variable crs and add all grid mapping related meta-data as attributes.
  2. The ADAGUC WMS/WCS software requires some additional attributes that contain the same information as the CF grid_mapping attributes: proj4_params and epsg_code. In the Dutch National Model and Data Centre NMDC.eu ADAGUC is used as a central component, so for NMDC these additional attributes are highly recommended.
    netcdf test_map {
    variables:
            double var(n);
                    var:proj4_params = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" ;
                    var:EPSG_code = "EPSG:4326";
    }
    

Examples

D-Flow FM map file on local xy-grid (e.g., Amersfoort / RD New).

  • Currently lacks lon/lat for x/y-grids.
  • The RD projection (oblique stereographic) is not recognized in CF-1.4 (and many others), in PROJ.4 'sterea' is used: http://www.spatialreference.org/ref/epsg/28992/
  • More details are here: unstructured grid format.
    netcdf test_map {
    // Only relevant parts for crs are shown!
    dimensions:
            nNetCell = 665 ;
            time = UNLIMITED ; // (1 currently)
    variables:
            double time(time) ;
                    time:units = "seconds since 2010-01-01 00:00:00" ;
            double NetCell_xc(nNetCell) ;
                    NetCell_xc:units = "m" ;
                    NetCell_xc:standard_name = "projection_x_coordinate" ;
                    NetCell_xc:long_name = "Net cell circumcenter x" ;
                    NetCell_xc:bounds = "NetCellContour_x" ;
            double NetCell_yc(nNetCell) ;
                    NetCell_yc:units = "m" ;
                    NetCell_yc:standard_name = "projection_y_coordinate" ;
                    NetCell_yc:long_name = "Net cell circumcenter y" ;
                    NetCell_yc:bounds = "NetCellContour_y" ;
            double s1(time, nNetCell) ;
                    s1:cell_methods = "area: mean" ;
                    s1:coordinates = "NetCell_xc Netcell_yc" ;
                    s1:grid_mapping = "crs" ;
            int crs ;
                    crs:grid_mapping_name = "oblique_stereographic" ;
                    crs:projection_name = "Amersfoort / RD New" ;
                    crs:semi_major_axis = 6377397.f ;
                    crs:inverse_flattening = 299.1528f ;
                    crs:latitude_of_projection_origin = 52.15616f ;
                    crs:longitude_of_central_meridian = 5.387639f ;
                    crs:scale_factor_at_projection_origin = 0.9999079f ;
                    crs:false_easting = 155000 ;
                    crs:false_northing = 463000 ;
                    crs:proj4_params = "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.4174,50.3319,465.5542,-0.398957388243134,0.343987817378283,-1.87740163998045,4.0725 +no_defs" // ADAGUC extension
                    crs:EPSG_code = "EPSG:28992" // ADAGUC extension
    
    // note that the default proj4 (epsg) string for the Dutch RD system (EPSG:28992 & EPSG:7415) is wrong, it contains an erroneous ellipse reference, hence the full ellipse values need to be supplied.
    
    //...
    crs = 28992 ;
    

D-Flow FM map file on lon/lat-grid (e.g., WGS 1984)

  • More details are here: unstructured grid format.
    netcdf test_map {
    // Only relevant parts for crs are shown!
    dimensions:
            nNetCell = 184324 ;
            time = UNLIMITED ; // (1 currently)
    variables:
            double time(time) ;
                    time:units = "seconds since 2010-01-01 00:00:00" ;
            double NetCell_xc(nNetCell) ;
                    NetCell_xc:units = "degrees_east" ;
                    NetCell_xc:standard_name = "longitude" ;
                    NetCell_xc:long_name = "Net cell circumcenter x" ;
                    NetCell_xc:bounds = "NetCellContour_x" ;
            double NetCell_yc(nNetCell) ;
                    NetCell_yc:units = "degrees_north" ;
                    NetCell_yc:standard_name = "latitude" ;
                    NetCell_yc:long_name = "Net cell circumcenter y" ;
                    NetCell_yc:bounds = "NetCellContour_y" ;
            double s1(time, nNetCell) ;
                    s1:cell_methods = "area: mean" ;
                    s1:coordinates = "NetCell_xc Netcell_yc" ;
                    s1:grid_mapping = "crs" ;
            int crs ;
                    crs:grid_mapping_name = "latitude_longitude" ;
                    crs:longitude_of_prime_meridian = 0.f ;
                    crs:semi_major_axis = 6378137.f ;
                    crs:inverse_flattening = 298.2572f ;
                    NetCell_xc:proj4_params = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"  // ADAGUC extension
                    NetCell_xc:EPSG_code = "EPSG:4326";  // ADAGUC extension
    //...
    crs = 4326 ;