Well-known text (WKT) representation
The OpenGIS Consortium Simple Features for SQL
specification
defines the well-known text representation to exchange geometry data in ASCII format. This
representation is also referenced by the ISO SQL/MM Part: 3 Spatial
standard.
See Spatial functions that convert geometries to and from data exchange formats
for
information on functions which accept and produce WKT data.
The well-known text representation of a geometry is defined as follows:
Parameters
If the geometry is empty, then the keyword EMPTY is to be specified instead of the coordinate list. The EMPTY keyword must not be embedded within the coordinate list
The following table provides some examples of possible text representations.
Geometry type |
WKT representation |
Comment |
---|---|---|
point |
POINT EMPTY |
empty point |
point |
POINT ( 10.05 10.28 ) |
point |
point |
POINT Z( 10.05 10.28 2.51 ) |
point with Z coordinate |
point |
POINT M( 10.05 10.28 4.72 ) |
point with M coordinate |
point |
POINT ZM( 10.05 10.28 2.51 4.72 ) |
point with Z coordinate and M coordinate |
linestring |
LINESTRING EMPTY |
empty linestring |
polygon |
POLYGON (( 10 10, 10 20, 20 20, 20 15, 10 10)) |
polygon |
multipoint |
MULTIPOINT Z(10 10 2, 20 20 3) |
multipoint with Z coordinates |
multilinestring |
MULTILINESTRING M(( 310 30 1, 40 30 20, 50 20 10 )( 10 10 0, 20 20 1)) |
multilinestring with M coordinates |
multipolygon |
MULTIPOLYGON ZM((( 1 1 1 1, 1 2 3 4, 2 2 5 6, 2 1 7 8, 1 1 1 1 ))) |
multipolygon with Z coordinates and M coordinates |