Enum Class ReferencingFormat.Convention

All Implemented Interfaces:
Serializable, Comparable<ReferencingFormat.Convention>, Constable
Enclosing class:
ReferencingFormat

public static enum ReferencingFormat.Convention extends Enum<ReferencingFormat.Convention>
Controls some aspects in formatting referencing objects as Well Known Text (WKT), JSON or PROJ strings. The WKT format has two major versions (WKT 1 and WKT 2), with WKT 2 defined by ISO 19162. Those WKT versions have different compatibility characteristics: The WKT and WKT_SIMPLIFIED fields are aliases to the most recent WKT versions supported by current implementation.

Note about WKT in GeoPackage

The GeoPackage standard defines two columns for specifying Coordinate Reference System in Well Known Text format: the "definition" column shall contain a WKT 1 string as defined by OGC 01-009 while the "definition_12_063" column contains a WKT 2 string as defined by OGC 12-063. Since PROJ does not support OGC 01-009, we recommend to always provided a value in the "definition_12_063" column formatted by WKT2_2015.
Since:
1.0
  • Enum Constant Details

    • WKT2_2019

      public static final ReferencingFormat.Convention WKT2_2019
      Full Well Known Text version 2 string, conforming to ISO 19162:2019 / OGC 18-010. The output contains all possible nodes and new keyword names. Non-normative list of differences:
      • WKT2_2019 uses GEOGCRS / BASEGEOGCRS keywords for GeographicCRS.
      See Also:
    • WKT2_2015

      public static final ReferencingFormat.Convention WKT2_2015
      Full Well Known Text version 2 string, conforming to ISO 19162:2015(E) / OGC 12-063r5. The output contains all possible nodes and new keyword names.
      See Also:
    • WKT2_2019_SIMPLIFIED

      public static final ReferencingFormat.Convention WKT2_2019_SIMPLIFIED
      Well Known Text version 2 (2019) in a more compact form. Same as WKT2_2019 with the following exceptions:
      • UNIT keyword used.
      • ID node only on top element.
      • No ORDER element in AXIS element.
      • PRIMEM node omitted if it is Greenwich.
      • ELLIPSOID.UNIT node omitted if the unit of measure is metre.
      • PARAMETER.UNIT / PRIMEM.UNIT omitted if same as AXIS.
      • AXIS.UNIT omitted and replaced by a common GEODCRS.UNIT if they are all the same on all axis.
      See Also:
    • WKT2_2015_SIMPLIFIED

      public static final ReferencingFormat.Convention WKT2_2015_SIMPLIFIED
      Well Known Text version 2 (2015) in a more compact form. Same as WKT2_2015 with the same differences than the ones documented in WKT2_2019_SIMPLIFIED.
    • WKT1_GDAL

      public static final ReferencingFormat.Convention WKT1_GDAL
      Well Known Text version 1 as traditionally written by GDAL. A notable departure from WKT1_GDAL with respect to OGC 01-009 is that in WKT1_GDAL, the unit of the PRIMEM value is always degrees.
    • WKT1_ESRI

      public static final ReferencingFormat.Convention WKT1_ESRI
      Well Known Text version 1 as traditionally written by ESRI software in Shapefiles. This format has the same departures than WKT1_GDAL with respect to OGC 01-009, plus some more differences in map projection parameter names. The AXIS and AUTHORITY elements are omitted in this format.
    • PROJ_5

      public static final ReferencingFormat.Convention PROJ_5
      Implementation-specific string format for CRS and coordinate operations. The PROJ format is very compact but can not express all aspects of referencing objects. The format output depends on the type of object to format:
      • For a CoordinateReferenceSystem, formats the same as PROJ_4. It should be noted that the export of a CRS as a PROJ string may cause loss of many important aspects of a CRS definition. Consequently it is discouraged to use it for interoperability in newer projects. The choice of a WKT representation will be a better option.
      • For CoordinateOperation, returns a PROJ pipeline.
    • PROJ_4

      public static final ReferencingFormat.Convention PROJ_4
      Implementation-specific string format for PROJ 4 compatibility. This format was extensively used in PROJ 4, but since PROJ 6 the WKT format is preferred for better interoperability and for more complete object descriptions. The PROJ 4 convention formats a string compatible with the OGRSpatialReference::exportToProj4() of GDAL ≥ 2.3. It is only compatible with a few CRS objects. The PROJ string will also contain a +type=crs parameter to disambiguate the nature of the string from a coordinate operation.
      • For a GeographicCRS, returns a proj=longlat string, with ellipsoid / datum / prime meridian information, ignoring axis order and unit information.
      • For a geocentric GeodeticCRS, returns the transformation from geographic coordinates into geocentric coordinates.
      • For a ProjectedCRS, returns the projection method, ignoring axis order.
      • For a BoundCRS, returns the PROJ string of its source/base CRS, amended with towgs84 / nadgrids parameter when the deriving conversion can be expressed in that way.
    • JSON

      public static final ReferencingFormat.Convention JSON
      JSON format (non-standard). This format is PROJ-specific for now, but the structure of the JSON objects follow closely the model described by ISO 19111.
  • Field Details

    • WKT

      public static final ReferencingFormat.Convention WKT
      The most recent version of WKT supported by current implementation. This is currently set as an alias to WKT2_2019. This alias may be changed in a future version if a new revision of WKT 2 specification is published.
    • WKT_SIMPLIFIED

      public static final ReferencingFormat.Convention WKT_SIMPLIFIED
      The most recent version of "simplified" WKT supported by current implementation. This is currently set as an alias to WKT2_2019_SIMPLIFIED. This alias may be changed in a future version if a new revision of WKT 2 specification is published.
  • Method Details

    • values

      public static ReferencingFormat.Convention[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ReferencingFormat.Convention valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null