Coordinate systems syntax
The well-known text (WKT) representation of spatial reference systems provides a standard textual representation for coordinate system information.
The definitions of the well-known text representation are defined by the OpenGIS Consortium "Simple Features for SQL" specification and the ISO "SQL/MM Part 3: Spatial" standard.
A coordinate system is a geographic (latitude-longitude) coordinate system, or a projected (X,Y) coordinate system. A coordinate system is composed of several objects. Each object has a keyword (for example, DATUM or UNIT) that is followed by a comma-delimited list of the parameters that define the object. The list is enclosed in brackets. Some objects are composed of other objects, so the result is a nested structure.
Syntax
Parameters
The type of coordinate system is identified by the first keyword used in the WKT string. This section describes the parameters for each type of coordinate system.
- PROJCS
- A geometry's coordinate system is identified by the PROJCS keyword
if the coordinate values are projected.
All projected coordinate systems are based on a geographic coordinate system. The PROJCS keyword is followed by all of the components that define the projected coordinate system. Several objects follow the projected coordinate system name: the geographic coordinate system, the map projection, one or more parameters for the projection, and the linear unit of measure that is applicable to the projected coordinate system.
- PROJECTION "projection_name"
- Specifies the name of the projection algorithm that is to be used
for the conversion from the underlying geographic coordinate system
to the projected coordinate system. The algorithm for reverse projections
is also implied.
For more information about supported projection algorithms, see Supported map projections.
- PARAMETER "parameter_name", parameter_value
- Defines a single parameter for the projected coordinate system.
The parameter is identified by its name and a value.
The semantics and units of measure for the parameter and its value are dependent on the parameter itself. For example, a projected coordinate system might require the specification for the longitude of the central meridian and additional offsets and scale factors for the projected coordinate values.
- UNIT "unit_name", conversion_factor
- Defines the linear unit for the projected coordinate system. For
example, the unit in which the distance between two coordinate values
is measured. The base unit is METER, and the conversion_factor specifies
how many meters represent a single unit in the projected coordinate
system.
For more information about supported units of measure, see Supported linear units.
- GEOGCS
- A geometry's coordinate system is identified by the GEOGCS keyword
if the coordinate values are geographic coordinates.
The name of the geographic coordinate system and several objects are needed to define a geographic coordinate system object: the datum, the prime meridian, and the angular unit of measure that is applicable to the geographic coordinate system.
- DATUM "datum_name", spheroid
- The datum, based on a spheroid, defines the shape and position
of the spheroid that is used to approximate the Earth's surface.
The datum_name uniquely identifies the datum. For more information about datums, see Geographic coordinate system.
- SPHEROID "spheroid_name", semi_major_axis, inverse_flattening
- Defines the shape that is used to approximate the Earth's surface.
The semi_major_axis variable specifies the radius
of the spheroid at its equator. This value is measured in meters and
must be greater than 0 (zero). The minor axis is calculated based
on the major axis and the inverse_flattening. The
inverse flattening variable if gives the proportion
of the semi-minor axis minor to the semi-major
axis major and is calculated using the following
formula:
if = major / ( major - minor )
An inverse flattening value of 0 (zero) is a special case, which implies that the semi-minor axis is equal to the semi-major axis, and therefore, the spheroid is actually a sphere.
- PRIMEM "primem_name", longitude
- Defines the prime meridian, which means the meridian that has
a longitude of 0 (zero) assigned to it in the geographic coordinate
system. All longitude values are measured relative to that meridian.
For example, all points on the prime meridian have a longitude of
0 (zero).
The longitude of the prime meridian is specified relative to the Greenwich meridian and measured in degrees. Greenwich is often chosen as the prime meridian; however, this is not mandatory. A positive value for longitude places the prime meridian to the east of Greenwich, and a negative value for longitude places the prime meridian to the west of Greenwich.
For more information about supported prime meridians, see Supported prime meridians.
- UNIT "angular_unit_name", conversion_factor
- Defines the angular unit for the geographic coordinate system.
For example, the unit in which the distance between latitude values
or longitude values is measured. The base unit is RADIAN, and the conversion_factor specifies
how many radians represent a single unit in the geographic coordinate
system. The conversion factor must be greater than 0 (zero).
For more information about supported angular units of measure, see Supported angular units.
Examples
The following WKT representation, known as GCS_North_American_1983, shows a geographic coordinate system that uses the spheroid GRS_1980 and the datum D_North_American_1983. The spheroid has a semi-major axis of 6378.137 kilometers and a semi-minor axis of 6356.752 kilometers. That results in an inverse flattening of 298.257222101. The primary meridian is placed at Greenwich (longitude 0), and the units are measured in degrees.
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980", 6378137, 298.257222101]],
PRIMEM["Greenwich", 0],
UNIT["Degree", 0.0174532925199433]]In the following example, UTM zone 10N is a projected coordinate system that is based on the above geographic coordinate system, which used datum NAD83. The Transverse Mercator projection algorithm is used to calculate the projected coordinates from the geographic (latitude-longitude) coordinates for each geometry. The resulting projected coordinate systems are shifted by 50 kilometers to the east, as the parameter named "False_Easting" indicates. Other parameters for the projected coordinate system define the central meridian and a scale factor, for example. All units are measured in meters in the projected coordinate system.
PROJCS["NAD_1983_UTM_Zone_10N",
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980", 6378137, 298.257222101]],
PRIMEM["Greenwich", 0],
UNIT["Degree", 0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["False_Easting", 500000.0],
PARAMETER["False_Northing", 0.0],
PARAMETER["Central_Meridian", -123.0],
PARAMETER["Scale_Factor", 0.9996],
PARAMETER["Latitude_of_Origin", 0.0],
UNIT["Meter", 1.0]]
