WKT (Well-Known Text) Spatial Geometry & Coordinate Format Guide

Standard WKT Syntax Examples

  • POINT (139.6917 35.6895) — Single coordinate pair (X Y). Note space separator between X and Y.
  • LINESTRING (30 10, 10 30, 40 40) — Sequence of connected vertices separated by commas.
  • POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10)) — Closed ring (first and last vertex must match).
  • SRID=4326;POINT(139.6917 35.6895) — EWKT (Extended WKT) explicitly defining Spatial Reference ID.

1. What is WKT (Well-Known Text)?

Well-Known Text (WKT) is an OGC standard text markup language for representing vector geometry objects on spatial databases (PostGIS, Oracle Spatial, MySQL, MS SQL Server) and GIS pipelines.

2. WKT vs WKB (Binary)

While WKT is human-readable, database indices store WKB (Well-Known Binary) for computational efficiency. You can transform between WKT and WKB in SQL using ST_AsText() and ST_GeomFromText().