Well-known text

Well-known text (WKT) is a text markup language for representing vector geometry objects on a map, spatial reference systems of spatial objects and transformations between spatial reference systems. A binary equivalent, known as well-known binary (WKB) is used to transfer and store the same information on databases, such as PostGIS. The formats are regulated by the Open Geospatial Consortium (OGC) and described in their Simple Feature Access and Coordinate Transformation Service specifications.

Geometric objects
Geometric objects that can be represented with WKT are: points, lines, polygons, TINs and polyhedrons. Multi geometries are available to represent more than one geometry of the same dimension in a single object, and geometries of different dimensions can be stored in a geometry collection.

Coordinates for geometries may be 2D (x, y), 3D (x, y, z), 4D (x, y, z, m) with a m value that is part of a linear reference system or 2D with a m value (x, y, m). Three dimensional geometries are designated by a Z after the geometry type and geometries with a linear reference system have a M after the geometry type. Empty geometries which contain no coordinates can be specified by using the symbol EMPTY after the type name.

WKT geometries are used throughout OGC specifications and are present in applications that implement these specifications. For example, PostGIS contains functions that can convert geometries to and from a WKT representation, making them human readable.

The following are some example geometric WKT strings.

Spatial reference systems
A WKT string for a spatial reference system describes the geodetic datum, geoid, coordinate system, and map projection of the spatial objects.

Well-known text is used extensively throughout many GIS programs. ESRI uses WKT in the shapefile *.prj file.

The following is an example of a spatial reference system WKT string.

Transformations
A WKT format is defined to describe the transformation methods and parameters used to convert coordinates between two different spatial reference systems.

Below are two examples of WKT transformation descriptions.

RDBMS Engines that provide support

 * PostgreSQL with PostGIS Module 1.3
 * Oracle 9i, 10g, 11g
 * MySQL since 4.1
 * Informix 9,10,11 with Spatial datablade module
 * MS SQL Server 2008
 * SpatiaLite