Well-known text (WKT) format
The OpenGIS Consortium Simple Features for SQL
specification
defines the well-known text format to exchange geometry data in ASCII format. This
format is also referenced by the ISO SQL/MM Part: 3 Spatial
standard.
The well-known text format 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 formats.
Geometry type |
WKT format |
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 |