== CF-1.6 <--> WKT/PROJ.4 translation == === Coordinate system keywords (starting with CF-1.7) === ||'''CF'''||'''OGC WKT'''||'''PROJ.4'''||'''Note'''|| || || || || || ||projected_coordinate_system_name||PROJCS||N/A|| || ||geographic_coordinate_system_name||GEOGCS||N/A|| || ||horizontal_datum_name||GEOGCS|DATUM||+datum|| || ||reference_ellipsoid_name||GEOGCS|DATUM|SPHEROID||+ellps|| || ||towgs84||GEOGCS|DATUM|TOWGS84||+towgs84|| || ||prime_meridian_name||GEOGCS|PRIMEM||+pm|| || == Mapping from CF Grid Mapping Attributes to CRS WKT Elements == Adapted from https://cf-pcmdi.llnl.gov/trac/wiki/Cf2CrsWkt || '''CF Grid Mapping Attribute''' || '''Corresponding WKT Syntax (1)''' || || `earth_radius` || `SPHEROID["", , 0.0, ...]` || || `false_easting` || `PARAMETER["False easting", ]` || || `false_northing` || `PARAMETER["False northing", ]` || || `grid_mapping_name` || no known equivalent || || `grid_north_pole_latitude` || no known equivalent || || `grid_north_pole_longitude` || no known equivalent || || `inverse_flattening` || `SPHEROID["", , , ...]` || || `latitude_of_projection_origin` || `PARAMETER["Latitude of natural origin", ]` || || `longitude_of_central_meridian` || `PARAMETER["Longitude of natural origin", ]` || || `longitude_of_prime_meridian` || `PRIMEM["", , ...]` || || `longitude_of_projection_origin` || `PARAMETER["Longitude of natural origin", ]` || || `north_pole_grid_longitude` || no known equivalent || || `perspective_point_height` || `PARAMETER["Viewpoint height", ]` || || `scale_factor_at_central_meridian` || `PARAMETER["Scale factor at natural origin", ]` || || `scale_factor_at_projection_origin` || `PARAMETER["Scale factor at natural origin", ]` || || `semi_major_axis` || `SPHEROID["", , , ...]` || || `semi_minor_axis` || no direct equivalent, the `SPHEROID` element is used to define ellipsoid geometry || || `standard_parallel` (one parallel) || `PARAMETER["Latitude of standard parallel", ]` || || `standard_parallel` (two parallels) || `PARAMETER["Latitude of 1st standard parallel", ], PARAMETER["Latitude of 2nd standard parallel", ]` || || || || || `straight_vertical_longitude_from_pole` || `PARAMETER["Longitude of origin", ]` || || `projected_coordinate_system_name` || `PROJCS["", ...]` || || `geographic_coordinate_system_name` || `GEOGCS["", ...]` || || `horizontal_datum_name` || `GEOGCS["", DATUM["", ...] ]` || || `reference_ellipsoid_name` || `GEOGCS["", DATUM["", SPHEROID["", ...] ] ]` || || `towgs84` || `GEOGCS["", DATUM["", TOWGS84[<7 params>] ]` || || `prime_meridian_name` || `GEOGCS["",PRIMEM["",]` || === Common projection parameter names === ||'''CF'''||'''OGC WKT'''||'''PROJ.4'''||'''EPSG name'''||'''Note'''|| || || || || || || ||false_easting||false_easting||+x_0||False easting / Easting at false origin||(2)|| ||false_northing||false_northing||+y_0||False northing / Northing at false origin||(2)|| ||scale_factor_at_projection_origin||scale_factor||+k_0||Scale factor at natural origin||(1)|| ||scale_factor_at_central_meridian||scale_factor||+k_0||Scale factor at natural origin||(1)|| ||standard_parallel![1]||standard_parallel_1||+lat_1||Latitude of 1st standard parallel|| || ||standard_parallel![2]||standard_parallel_2||+lat_2||Latitude of 2nd standard parallel|| || ||longitude_of_central_meridian||longitude_of_center / central_meridian||+lon_0||(1)||(1)|| ||longitude_of_projection_origin||longitude_of_center / central_meridian||+lon_0||(1)||(1)|| ||latitude_of_projection_origin||latitude_of_origin / latitude_of_center||+lat_0||(1)||(1)|| ||straight_vertical_longitude_from_pole||central_meridian||+lon_0||(1)||(1)|| === Specific projection parameter names === ||'''Projection'''||'''Name'''||'''CF'''||'''OGC WKT'''||'''PROJ.4'''||'''EPSG name'''||'''EPSG code'''||'''GeoTIFF ID'''||'''Note'''|| || || || || || || || || || || ||'''AEA'''||Albers Equal Area||albers_conical_equal_area||Albers_Conic_Equal_Area||+proj=aea||Albers Equal Area||9822||CT_AlbersEqualArea|| || || || ||standard_parallel![1]||standard_parallel_1||+lat_1||Latitude of 1st standard parallel||8823||!StdParallel1|| || || || ||standard_parallel![2]||standard_parallel_2||+lat_2||Latitude of 2nd standard parallel||8824||!StdParallel2|| || || || ||longitude_of_central_meridian||longitude_of_center||+lon_0||Longitude of false origin||8822||!NatOriginLong|| || || || ||latitude_of_projection_origin||latitude_of_center||+lat_0||Latitude of false origin||8821||!NatOriginLat|| || ||||||false_easting||false_easting||+x_0||Easting at false origin||8826||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||Northing at false origin||8827||!FalseNorthing|||| || || || || || || || || || || ||'''AE'''||Azimuthal equidistant||azimuthal_equidistant||Azimuthal_Equidistant||+proj=aeqd||N/A||||CT_AzimuthalEquidistant ||EPSG:9832 is 'Modified Azimuthal Equidistant'|| || || ||longitude_of_projection_origin||longitude_of_center||+lon_0|||| ||!ProjCenterLong|| || || || ||latitude_of_projection_origin||latitude_of_center||+lat_0|||| ||!ProjCenterLat|| || ||||||false_easting||false_easting||+x_0||||||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||||||!FalseNorthing|||| || || || || || || || || || || ||'''LAEA'''||Lambert azimuthal equal area||lambert_azimuthal_equal_area||Lambert_Azimuthal_Equal_Area||+proj=laea||Lambert Azimuthal Equal Area||9820||CT_LambertAzimEqualArea || || || || ||longitude_of_projection_origin||longitude_of_center||+lon_0||Longitude of natural origin||8802||!ProjCenterLong|| || || || ||latitude_of_projection_origin||latitude_of_center||+lat_0||Latitude of natural origin||8801||!ProjCenterLat|| || ||||||false_easting||false_easting||+x_0||False easting||8806||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||False northing||8807||!FalseNorthing|||| || || || || || || || || || || ||'''LCC-1SP'''||Lambert conformal||lambert_conformal_conic||Lambert_Conformal_Conic_1SP||+proj=lcc||Lambert Conic Conformal (1SP)||9801||CT_LambertConfConic_1SP||(3) [http://www.remotesensing.org/geotiff/proj_list/lambert_conic_conformal_1sp.html link]|| || || ||standard_parallel||latitude_of_origin||+lat_1||Latitude of natural origin||8801||!NatOriginLat||standard_parallel=latitude_of_projection_origin|| || || ||longitude_of_central_meridian||central_meridian||+lon_0||Longitude of natural origin||8802||!NatOriginLong|| || || || ||latitude_of_projection_origin||latitude_of_origin||+lat_0||Latitude of natural origin||8801||!NatOriginLat|| || || || ||N/A||scale_factor||+k_0||Scale factor at natural origin||8805||!ScaleAtNatOrigin||(3) always 1|| ||||||false_easting||false_easting||+x_0||False easting||8806||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||False northing||8807||!FalseNorthing|||| || || || || || || || || || || ||'''LCC-2SP'''||Lambert conformal||lambert_conformal_conic||Lambert_Conformal_Conic_2SP||+proj=lcc||Lambert Conic Conformal (2SP)||9802||CT_LambertConfConic_2SP ||(3) [http://www.remotesensing.org/geotiff/proj_list/lambert_conic_conformal_2sp.html link]|| || || ||standard_parallel![1]||standard_parallel_1||+lat_1||Latitude of 1st standard parallel||8823||!StdParallel1|| || || || ||standard_parallel![2]||standard_parallel_2||+lat_2||Latitude of 2nd standard parallel||8824||!StdParallel2|| || || || ||longitude_of_central_meridian||central_meridian||+lon_0||Longitude of false origin||8822||!FalseOriginLong|| || || || ||latitude_of_projection_origin||latitude_of_origin||+lat_0||Latitude of false origin||8821||!FalseOriginLat|| || ||||||false_easting||false_easting||+x_0||Easting at false origin||8826||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||Northing at false origin||8827||!FalseNorthing|||| || || || || || || || || || || ||'''CEA'''||Lambert cylindrical equal area||lambert_cylindrical_equal_area||Cylindrical_Equal_Area||+proj=cea||N/A||||CT_CylindricalEqualArea ||(3) CF says EPSG 9834/9835 ?|| || || ||longitude_of_central_meridian||central_meridian||+lon_0|||| ||!NatOriginLong|| || || || ||standard_parallel![1]||standard_parallel_1||+lat_ts||||||!StdParallel1||default to 0|| ||||||false_easting||false_easting||+x_0||||||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||||||!FalseNorthing|||| || || || || || || || || || || ||'''M-1SP'''||Mercator (1SP)||mercator||Mercator_1SP||+proj=merc||Mercator (variant A)||9804||Mercator_1SP||(3)|| || || ||longitude_of_projection_origin||central_meridian||+lon_0||Longitude of natural origin||8801||!NatOriginLong|| || || || ||scale_factor_at_projection_origin||scale_factor||+k_0||Scale factor at natural origin||8805||!ScaleAtNatOrigin|| || ||||||false_easting||false_easting||+x_0||False easting||8806||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||False northing||8807||!FalseNorthing|||| || || || || || || || || || || ||'''M-2SP'''||Mercator (2SP)||mercator||Mercator_2SP||+proj=merc||Mercator (variant B)||9805||N/A||(3)|| || || ||longitude_of_projection_origin||central_meridian||+lon_0||Longitude of natural origin||8801|||| || || || ||standard_parallel![1]||standard_parallel_1||+lat_ts||Latitude of 1st standard parallel||8823|||| || ||||||false_easting||false_easting||+x_0||False easting||8806||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||False northing||8807||!FalseNorthing|||| || || || || || || || || || || ||'''Ortho'''||Orthographic||orthographic||Orthographic||+proj=ortho||Orthographic||9840||CT_Orthographic|| || || || ||longitude_of_projection_origin||central_meridian||+lon_0||Longitude of natural origin||8802||!ProjCenterLong|| || || || ||latitude_of_projection_origin||latitude_of_origin||+lat_0||Latitude of natural origin||8801||!ProjCenterLat|| || ||||||false_easting||false_easting||+x_0||False easting||8806||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||False northing||8807||!FalseNorthing|||| || || || || || || || || || || ||'''PS-A'''||Polar stereographic||polar_stereographic||Polar_Stereographic||+proj=stere||Polar Stereographic (variant A)||9810||CT_PolarStereographic ||(3) || || || ||straight_vertical_longitude_from_pole ||central_meridian||+lon_0||Longitude of natural origin||8802||!StraightVertPoleLong|||| ||||||latitude_of_projection_origin||N/A||+lat_0||Latitude of natural origin||8801||!NatOriginLat||+90/-90|| || || ||scale_factor_at_projection_origin||scale_factor||+k_0||Scale factor at natural origin||8805||!ScaleAtNatOrigin|| || ||||||false_easting||false_easting||+x_0||False easting||8806||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||False northing||8807||!FalseNorthing|||| || || || || || || || || || || ||'''PS-B'''||Polar stereographic||polar_stereographic||Polar_Stereographic||+proj=stere||Polar Stereographic (variant B)||9829||N/A||(3)|| || || ||straight_vertical_longitude_from_pole ||central_meridian||+lon_0||Longitude of natural origin||8802|||||| ||||||latitude_of_projection_origin||N/A||+lat_0||Longitude of origin||8801||||+90/-90|| ||||||standard_parallel||latitude_of_origin||+lat_ts||Latitude of standard parallel||8832|||||| ||||||false_easting||false_easting||+x_0||False easting||8806||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||False northing||8807||!FalseNorthing|||| || || || || || || || || || || ||'''St'''||Stereographic||stereographic||Stereographic||+proj=stere||N/A||||CT_Stereographic||EPSG 9809 is “Oblique Stereographic” or “Double Stereographic”|| || || ||longitude_of_projection_origin||central_meridian||+lon_0|||| ||!ProjCenterLong|| || || || ||latitude_of_projection_origin||latitude_of_origin||+lat_0|||| ||!ProjCenterLat|| || || || ||scale_factor_at_projection_origin||scale_factor||+k_0|||| ||!ScaleAtNatOrigin|| || ||||||false_easting||false_easting||+x_0||||||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||||||!FalseNorthing|||| || || || || || || || || || || ||'''TM'''||Transverse Mercator||transverse_mercator||Transverse_Mercator||+proj=tmerc||Transverse Mercator||9807||CT_TransverseMercator||(3)|| || || ||scale_factor_at_central_meridian||scale_factor||+k_0||Scale factor at natural origin||8805||!ScaleAtNatOrigin|| || || || ||longitude_of_central_meridian||central_meridian||+lon_0||Longitude of natural origin||8802||!NatOriginLong|| || || || ||latitude_of_projection_origin||latitude_of_origin||+lat_0||Latitude of natural origin||8801||!NatOriginLat|| || ||||||false_easting||false_easting||+x_0||False easting||8806||!FalseEasting|||| ||||||false_northing||false_northing||+y_0||False northing||8807||!FalseNorthing|||| '''Notes:''' (1) Multiple CF/WKT translations, see projection-specific translations. (2) Parameter used in every projection. (3) See projection-specific notes. === Projection-specific notes === EPSG codes below correspond to "EPSG dataset coordinate operation method" codes. ==== Lambert conformal 1SP / 2SP ==== The 1SP variant corresponds to EPSG code 9801 - Lambert Conic Conformal (1SP), with CF latitude_of_projection_origin=standard_parallel and WKT scale_factor=1. A scale factor less than 1 means that there are 2 standard parallels (see http://www.remotesensing.org/geotiff/proj_list/lambert_conic_conformal_1sp.html), but it cannot be translated to the CF 1SP variant, therefore the 2SP variant should be used instead. The 2SP variant corresponds to EPSG code 9802 - Lambert Conic Conformal (2SP). ==== Lambert cylindrical equal area ==== The scale_factor_at_projection_origin variant is not recommended as it does not translate to and from WKT/PROJ.4. Snyder formulas 10-2b and 10-2 can be used to relate scale_factor_at_projection_origin, standard_parallel1 and latitude_of_projection_origin but the latter is not part of this projection's parameters. It has been proposed to deprecate or remove this variant from the CF spec (see CF trac ticket #75). ==== Mercator 1SP / 2SP ==== The scale_factor_at_projection_origin variant corresponds to EPSG code 9804 - Mercator (1SP) or Mercator (variant A), and the standard_parallel variant corresponds to EPSG code 9805 - Mercator (2SP) or Mercator (variant B). ==== Polar stereographic ==== The standard_parallel variant corresponds to EPSG code 9829 - Polar Stereographic (Variant B), while the scale_factor_at_projection_origin variant corresponds to EPSG code 9810 - Polar Stereographic (Variant A). As WKT/PROJ.4 require the standard parallel, [Snyder] formula 21-7 can be used to compute it from scale_factor_at_projection_origin if that variant is used. ==== Transverse Mercator ==== Transverse Mercator can be translated to PROJ.4 using either +proj=tmerc (Transverse Mercator) or +proj=utm (Universal Transverse Mercator) by computing zone number from longitude_of_central_meridian. For example, a TM projection with longitude_of_central_meridian=-117 would have the corresponding PROJ.4 string: '+proj=utm +zone=11 +datum=NAD27 +units=m +no_defs ' == Status of NetCDF CF-1.5 projection handling capability in work-in-progress NetCDF driver upgrade == This page was created to list/track progress as a supplement to work in October 2011 on wiki:NetCDF_Improvements, specifically wiki:NetCDF_exportUpdateChanges. The list of supported CF-1.5 projections is shown at http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.5/apf.html . The table below shows tested ability to export projections from a GDAL raster - originally in GeoTIFF - to NetCDF CF-1.5 in each supported projection. The shorthand projection names listed below correspond to their names in the source files and hopefully are fairly self-explanatory - they've been listed in the same order as that shown on the CF-1.5 appendix page. '''Note''': the current import capability has been tested to be the inverse of the export capability. We would appreciate any help in obtaining valid test files for each of these projections. If and when we are able to test capability to import NetCDF CF-1.5 variants that don't have a direct OGC WKT equivalent, we should add a supplementary table. ||'''Projection'''||'''Name'''||'''CF Export'''||'''CF Import'''||'''NetCDF Java'''||'''Updated'''||'''Note'''|| ||AEA||Albers Equal Area||Yes||Yes||Yes||18/10/11||Tested regular 2SP version - see AEA note below.|| ||AE||Azimuthal equidistant||Yes||Yes||No||18/10/11||See (1) below|| ||LAEA||Lambert azimuthal equal area||Yes||Yes||Yes||18/10/11|||| ||LCC1SP||Lambert conformal||?||Yes*||?||18/10/11||See note below.|| ||LCC2SP||Lambert conformal||Yes||Yes||Yes||18/10/11|||| ||CEA||Lambert Cylindrical Equal Area||Yes||Partial||No||18/10/11||Tested regular OGC WKT with std_parallel version (CF-1 has alternative scale_factor_at_projection_origin version, see notes below). See (1) below re NetCDF-Java loading.|| ||M-1SP||Mercator||Yes||Yes||No||18/10/11||See (1) below|| ||M-2SP||Mercator||Yes||Yes||Yes*||18/10/11||Parameters appear correct, loads in NetCDF Java and IDV, but appears translated slightly (a few arc-minutes) from expected position|| ||Ortho||Orthographic||Yes||Yes||Yes||18/10/11|||| ||PS||Polar stereographic||Yes*||Yes||No*||21/12/11||Believe we can translate parameters correctly, but see comments below. Translated file opens in NetCDF-Java IDV, but doesn't display as correctly georeferenced. || ||Rot Pole||Rotated pole||No||No||No||18/10/11||See projection comments below|| ||St||Stereographic||Yes||Yes||Yes||18/10/11|||| ||TM||Transverse Mercator||Yes||Yes||Yes||18/10/11|||| '''General notes''': (1) For projections that won't load correctly as referenced grids in NetCDF Java, we've contacted the developers to ask for clarification/testing support. In most cases, the CF-1 attributes seem appropriate. * Update 20/10/2011: One of the NetCDF lead developers has acknowledged NetCDF Java hasn't handled these projections previously, and is going to upgrade: see http://www.unidata.ucar.edu/mailing_lists/archives/netcdf-java/2011/msg00159.html '''Issues with CF-1 implementation of specific projections''': * AEA : The OGC WKT version has 2 Std parallels - whereas the CF-1.5 version says it can have either 1 or 2 std parallels. How should the CF 1SP version be converted to OGC WKT, and vice-versa? * Currently the driver, on import and finding an AEA with only 1 std parallel, will set the 2nd std parallel in the WKT as identical to the first. * LCC : The OGC WKT 'Lambert_Conformal_Conic_2SP' maps clearly to LCC in CF-1 with 2 std parallels. The CF-1 spec claims that a 1SP version can be used, but it doesn't include a 'scale_factor' as does the OGC WKT 'Lambert_Conformal_Conic_1SP'. * For import: Given discussion and example on #3324, and also support from NARCCAP project: it seems the CF-1 LCC 1SP projection is a 'degenerate' LCC-2SP with both SP's at the same location. Thus seems we can read with both 'std_parallel' (1 value) and 'latitude_of_projection_origin' mapping to latitude_of_origin (WKT) and setting scale_factor=1? This is the code's current behaviour (though perhaps could do more error-checking). * For export: given the LCC-1SP can specifically include a scale_factor to control the projection (see http://www.remotesensing.org/geotiff/proj_list/lambert_conic_conformal_1sp.html), it seems this can't be directly exported to NetCDF without throwing away the scale factor. * Perhaps the reasonable thing for now is to export the scale_factor to NetCDF, so it can at least be read back in. Otherwise, we'd have to try to translate the LCC-1SP to a LCC-2SP on the fly. * CEA : The CF-1 conventions claim this can be encoded with a 'scale_factor_at_projection_origin' alternative to standard parallel - how would this conversion be done from/to OGC WKT (which requires central_meridian and standard_parallel_1)? * PS : This projection's parameters in CF-1 are significantly different from http://www.remotesensing.org/geotiff/proj_list/polar_stereographic.html. In particular the CF-1 equivalent for 'latitude of natural origin' seems to be 'standard_parallel'. CF-1 defines either standard_parallel or scale_factor_at_projection_origin, which is incompatible with OGC WKT (and OGR) that requires both. Snyder's eq. 22-7 allows to relate standard_parallel and scale_factor_at_projection_origin, given that the standard_parallel is defined as the latitude where scale_factor=1. Implementation as of Dec. 21: * WKT scale_factor maps to CF scale_factor_at_projection_origin * WKT central_meridian maps to CF straight_vertical_longitude_from_pole * WKT latitude_of_origin maps to WKT standard_parallel * WKT to CF: if WKT latitude_of_origin is positive then CF latitude_of_projection_origin is +90, else it is -90 (North vs. South Pole), scale factor is not exported * CF to WKT: is standard_parallel is not defined, compute it from scale_factor using Snyder 22-7 * Rot pole : Not able yet to test: as seems GDAL needs support of advanced proj4 strings that can handle rotated coord systems (see bug #4285).