Introduction
Well-Known Text (WKT) is a text markup language for vector geometry, defined by the
Open Geospatial Consortium, and a related form describes coordinate reference systems.
The .wkt extension is commonly used, although the OGC and ISO
specifications do not define it. Esri stores the spatial reference of a shapefile as
WKT in its .prj file.
Structure
A geometry is a type name followed by coordinates in brackets, such as
Point (10 10) or LineString (10 10, 20 20, 30 40). A
Z, M or ZM after the name marks a third
coordinate, a measure, or both.
The same standard defines Well-Known Binary (WKB), a stream of bytes for the same geometries. A one-byte tag gives the byte order (0 big-endian, 1 little-endian) and a 32-bit integer gives the geometry type, such as 1 for a point, 2 for a line string and 3 for a polygon; coordinates are 64-bit IEEE 754 numbers.
Not described
This page is a first outline.
Known, not yet covered
- Reference: the full grammar, the coordinate reference system form and its versions, the layout of each binary geometry type and the extended variants some databases add.
- Viewer: the site has no viewer for this format.
Links
Software
- PostGIS – converts geometries to and from WKT
- QGIS – listed by FileInfo as showing the geometry in a .wkt file
Reference
- OGC 06-103r4, Simple feature access, part 1 – the standard, with the text and binary representations
- Library of Congress: WKT – format description
- Well-known text representation of geometry – Wikipedia’s summary
- FileInfo: .wkt – extension entry