Graph
Well-Known Text

🧾Well-Known Text

NEW

Also known as: WKT

A text markup language for representing geometric objects such as points, lines, and polygons.

DESCRIPTION

Well-Known Text (WKT) encodes vector geometries as human-readable strings, e.g., POINT, LINESTRING, and POLYGON with coordinates. It is defined by OGC’s Simple Features specification and widely supported by spatial databases and libraries. WKT also exists for coordinate reference systems (WKT for CRS). It enables exchange, logging, and debugging of geometries across systems. WKT complements binary forms like WKB for efficient storage.

ALTERNATIVE DEFINITIONS

Wikipedia

Well-known text representation of geometry (WKT) is a text markup language for representing vector geometry objects on a map.

Concise description emphasizing text representation of vector geometry.

Source

OGC

The Simple Feature Access standard defines a common storage model and access pattern for geographic feature geometry, including the WKT and WKB encodings.

Places WKT within the broader Simple Features standard for geometry.

Source

PostGIS

PostGIS supports the OGC WKT and WKB representations of geometries as text and binary formats for input and output.

Highlights practical database support for WKT and WKB I/O.

Source

Well-Known Binary OGC Simple Features Coordinate Reference System EPSG PostGIS Shapely GeoPandas Geometry Spatial SQL

COMPETING TERMS

GeoJSON

KNOWLEDGE AREAS

Semantic & Knowledge Modeling Data Integration & Interoperability Data Services Data Architecture Data Storage & Operations

TARGET AUDIENCE

Data Engineer Software Developer Data Scientist Data Architect Solution Architect

EXTERNAL SOURCES

  • Wikipedia - Well-known text representation of geometry
  • OGC - WKT defined in Simple Features
  • PostGIS - Function to output WKT
  • Shapely - Python WKT support

TOP QUESTIONS

What is Well-Known Text (WKT)?

WKT is a human-readable text format for encoding geometric objects, standardized by OGC’s Simple Features specification.

Category: Definition

How does WKT compare to GeoJSON?

WKT is compact and readable for geometries; GeoJSON also encodes properties and is often preferred in web contexts.

Category: Comparison

What geometries does WKT support?

It supports POINT, LINESTRING, POLYGON, MULTI* types, and geometry collections.

Category: Concepts

Does WKT include CRS information?

Basic WKT geometry does not; WKT for CRS is a related standard to describe coordinate reference systems.

Category: Standards

Where is WKT commonly used?

In spatial databases like PostGIS, and in logs or APIs for exchanging geometries between systems.

Category: Applications

Is WKT case sensitive?

Keywords are typically case-insensitive, but consistent casing improves readability and tooling compatibility.

Category: Technique

How do I convert between WKT and WKB?

Use database functions (e.g., ST_AsText, ST_AsBinary) or library utilities in GDAL, Shapely, or GeoPandas.

Category: How-to

What are common pitfalls with WKT?

Mismatched ring orientation or invalid polygons cause errors. Validate geometries before storage.

Category: Mistakes

Can WKT represent 3D or measured coordinates?

Yes, variants include Z and M dimensions, indicated in the WKT type name (e.g., LINESTRING ZM).

Category: Advanced