- All Implemented Interfaces:
Serializable
,Comparable<ReferencingFormat.Convention>
,Constable
- Enclosing class:
ReferencingFormat
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:
- All WKT 2 flavors in this enumeration are consistent between them.
- The legacy WKT 1 format defined in OGC 99-049 — Simple Feature Implementation (1999) had various interpretations with some incompatibilities between them (e.g. regarding units of measurement). A CRS formatted with one WKT 1 flavor is not guaranteed to be read correctly with a different WKT 1 flavor.
- The WKT 1 format defined in OGC 01-009 — Coordinate Transformation Service (2001) fixed many OGC 99-049 ambiguities but is not supported by PROJ.
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
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionJSON format (non-standard).Implementation-specific string format for PROJ 4 compatibility.Implementation-specific string format for CRS and coordinate operations.Well Known Text version 1 as traditionally written by ESRI software in Shapefiles.Well Known Text version 1 as traditionally written by GDAL.Full Well Known Text version 2 string, conforming to ISO 19162:2015(E) / OGC 12-063r5.Well Known Text version 2 (2015) in a more compact form.Full Well Known Text version 2 string, conforming to ISO 19162:2019 / OGC 18-010.Well Known Text version 2 (2019) in a more compact form. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ReferencingFormat.Convention
The most recent version of WKT supported by current implementation.static final ReferencingFormat.Convention
The most recent version of "simplified" WKT supported by current implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReferencingFormat.Convention
Returns the enum constant of this class with the specified name.static ReferencingFormat.Convention[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
usesGEOGCRS
/BASEGEOGCRS
keywords forGeographicCRS
.
-
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. -
WKT2_2019_SIMPLIFIED
Well Known Text version 2 (2019) in a more compact form. Same asWKT2_2019
with the following exceptions:UNIT
keyword used.ID
node only on top element.- No
ORDER
element inAXIS
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 asAXIS
.AXIS.UNIT
omitted and replaced by a commonGEODCRS.UNIT
if they are all the same on all axis.
- See Also:
-
WKT2_2015_SIMPLIFIED
Well Known Text version 2 (2015) in a more compact form. Same asWKT2_2015
with the same differences than the ones documented inWKT2_2019_SIMPLIFIED
. -
WKT1_GDAL
Well Known Text version 1 as traditionally written by GDAL. A notable departure fromWKT1_GDAL
with respect to OGC 01-009 is that inWKT1_GDAL
, the unit of thePRIMEM
value is always degrees. -
WKT1_ESRI
Well Known Text version 1 as traditionally written by ESRI software in Shapefiles. This format has the same departures thanWKT1_GDAL
with respect to OGC 01-009, plus some more differences in map projection parameter names. TheAXIS
andAUTHORITY
elements are omitted in this format. -
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 asPROJ_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.
- For a
-
PROJ_4
Implementation-specific string format for PROJ 4 compatibility. This format was extensively used in PROJ 4, but since PROJ 6 theWKT
format is preferred for better interoperability and for more complete object descriptions. The PROJ 4 convention formats a string compatible with theOGRSpatialReference::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 aproj=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 withtowgs84
/nadgrids
parameter when the deriving conversion can be expressed in that way.
- For a
-
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
The most recent version of WKT supported by current implementation. This is currently set as an alias toWKT2_2019
. This alias may be changed in a future version if a new revision of WKT 2 specification is published. -
WKT_SIMPLIFIED
The most recent version of "simplified" WKT supported by current implementation. This is currently set as an alias toWKT2_2019_SIMPLIFIED
. This alias may be changed in a future version if a new revision of WKT 2 specification is published.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-