Quick Insight
Well-Known Text, or WKT, is a text-based format for representing geographic geometry using coordinates. It can describe shapes such as points, lines, and polygons in a standardized format that different GIS software, databases, and mapping applications can read and interpret.
For example, a simple point can be represented as:
POINT (-73.9857 40.7484)
The coordinates define the location of the point, while the word POINT tells the software what type of geometry it represents.
Why WKT Matters
- It’s human-readable: WKT uses plain text, so you can open it and inspect the coordinates and geometry without specialized software.
- It’s widely supported: GIS software, spatial databases, mapping tools, and APIs commonly support WKT, making it useful for moving geometry between different systems.
- It represents different geometry types: WKT can describe everything from a single point to complex polygons and collections of multiple shapes.
- It’s useful for exchanging geometry: Developers and GIS professionals often use WKT when storing, querying, or transferring geographic geometry between systems.
- It has practical limits: WKT is easy to read, but text can take more space than binary representations. For large datasets or complex geometries, more compact formats such as Well-Known Binary (WKB) may be more efficient.
Types of Shapes WKT Can Represent
- Point: A single coordinate location, such as the location of a business.
- LineString: A connected sequence of coordinates that can represent a road, river, or route.
- Polygon: A closed shape defined by a boundary of coordinates, such as a building footprint or property boundary.
- MultiPoint: A collection of multiple point locations represented as one geometry.
- MultiLineString: A collection of multiple lines.
- MultiPolygon: A collection of multiple polygons, useful for representing areas made up of separate geographic shapes.
WKT and Coordinate Systems
WKT describes the geometry, but the coordinates also need a defined coordinate reference system (CRS) to indicate how those numbers relate to locations on Earth.
A common CRS is EPSG:4326, which uses latitude and longitude coordinates based on the WGS 84 reference system. However, WKT does not always use EPSG:4326. The coordinate system depends on the data and how it is being used.
Some WKT representations include the coordinate reference system information directly, while others store it separately as metadata.
Frequently Asked Questions
1. What does WKT stand for?
WKT stands for Well-Known Text. It is a standardized text format used to represent geographic geometry, including points, lines, and polygons.
2. What's the difference between WKT and a shapefile?
WKT is a text representation of geometry. A shapefile is a geospatial data format made up of multiple files that can store geographic shapes along with associated attributes.
WKT can be converted to and from formats such as Shapefile and GeoJSON using GIS software or other geospatial tools.
3. Can WKT be converted to other formats?
Yes. WKT can be converted to common geospatial formats such as Shapefile, GeoJSON, and WKB, depending on the software or tool being used.
4. Is WKT human-readable?
Yes. WKT is designed as a text representation of geographic geometry, which makes its coordinates and geometry types relatively easy for people to inspect.
5. What coordinate system does WKT typically use?
WKT itself does not require one specific coordinate system. The CRS depends on the dataset. EPSG:4326, which uses latitude and longitude with the WGS 84 reference system, is one commonly used option.