- Build instances of various shapes (e.g., using
ST_MakePolygonon a Linestring). - Convert existing shapes to a text representation for ease of reading.
POINT(...)LINESTRING(...)POLYGON((...))
MULTIPOLYGON(...)MultiPolygon(...)
LINESTRING(-88.243385 40.116421, -87.906471 43.038902, -95.992775 36.153980)
Shapes expressed in WKT can have an SRID prepended to the shape and followed by a semicolon, in the form SRID=123;TAG(...). The format is known as Extended Well Known Text (EWKT); it is the same as WKT, with an SRID representation prepended to the data structure.
For example, below is a polygon representing a geometry that uses SRID 4326, which is used to represent latitude and longitude coordinates on the Earth as defined in the WGS84 standard:
SRID=4326;POLYGON((-87.906471 43.038902, -95.992775 36.153980, -75.704722 36.076944, -87.906471 43.038902))
For more detailed information about the Well Known Text format, see the OGC specification for
WKT.
CockroachDB only supports 2-dimensional geometries.
See also
- Spatial Data Overview
- Spatial indexes
- Spatial and GIS Glossary of Terms
- Geographic information — Well-known text representation of coordinate reference systems
- OpenGIS Implementation Specification for Geographic information - Simple feature access - Part 1: Common architecture
- Well known binary
- GeoJSON
- SRID 4326 - longitude and latitude
- Introducing Distributed Spatial Data in CockroachDB (blog post)

