Well-known text
Encyclopedia
Well-known text is a text markup language
for representing vector
geometry
objects on a map
, spatial reference systems
of spatial objects and transformations between spatial reference systems. A binary
equivalent, known as well-known binary (WKB) is used to transfer and store the same information on databases, such as PostGIS
. The formats are regulated by the Open Geospatial Consortium
(OGC) and described in their Simple Feature Access and Coordinate Transformation Service specifications.
and polyhedron
s. Multi geometries are available to represent more than one geometry of the same dimension
in a single object, and geometries of different dimension
s can be stored in a geometry collection.
Coordinates for geometries may be 2D (x, y), 3D
(x, y, z), 4D (x, y, z, m) with an m value that is part of a linear referencing system or 2D with an m value (x, y, m). Three-dimensional geometries are designated by a "Z" after the geometry type and geometries with a linear referencing system have an "M" after the geometry type. Empty geometries which contain no coordinates can be specified by using the symbol
WKT geometries are used throughout OGC specifications and are present in applications that implement these specifications. For example, PostGIS
contains functions that can convert geometries to and from a WKT representation, making them human readable.
The following are some other examples of geometric WKT strings:
Below are two examples of WKT transformation descriptions.
Markup language
A markup language is a modern system for annotating a text in a way that is syntactically distinguishable from that text. The idea and terminology evolved from the "marking up" of manuscripts, i.e. the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts...
for representing vector
Vector graphics
Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon, which are all based on mathematical expressions, to represent images in computer graphics...
geometry
Geometry
Geometry arose as the field of knowledge dealing with spatial relationships. Geometry was one of the two fields of pre-modern mathematics, the other being the study of numbers ....
objects on a map
Map
A map is a visual representation of an area—a symbolic depiction highlighting relationships between elements of that space such as objects, regions, and themes....
, spatial reference systems
Map projection
A map projection is any method of representing the surface of a sphere or other three-dimensional body on a plane. Map projections are necessary for creating maps. All map projections distort the surface in some fashion...
of spatial objects and transformations between spatial reference systems. A binary
Binary file
A binary file is a computer file which may contain any type of data, encoded in binary form for computer storage and processing purposes; for example, computer document files containing formatted text...
equivalent, known as well-known binary (WKB) is used to transfer and store the same information on databases, such as PostGIS
PostGIS
PostGIS is an open source software program that adds support for geographic objects to the PostgreSQL object-relational database. PostGIS follows the Simple Features for SQL specification from the Open Geospatial Consortium .-Features:...
. The formats are regulated by the Open Geospatial Consortium
Open Geospatial Consortium
The Open Geospatial Consortium , an international voluntary consensus standards organization, originated in 1994. In the OGC, more than 400 commercial, governmental, nonprofit and research organizations worldwide collaborate in a consensus process encouraging development and implementation of open...
(OGC) and described in their Simple Feature Access and Coordinate Transformation Service specifications.
Geometric objects
Geometric objects that can be represented with WKT are: points, lines, polygons, TINsTriangulated irregular network
A triangulated irregular network is a digital data structure used in a geographic information system for the representation of a surface...
and polyhedron
Polyhedron
In elementary geometry a polyhedron is a geometric solid in three dimensions with flat faces and straight edges...
s. Multi geometries are available to represent more than one geometry of the same dimension
Dimension
In physics and mathematics, the dimension of a space or object is informally defined as the minimum number of coordinates needed to specify any point within it. Thus a line has a dimension of one because only one coordinate is needed to specify a point on it...
in a single object, and geometries of different dimension
Dimension
In physics and mathematics, the dimension of a space or object is informally defined as the minimum number of coordinates needed to specify any point within it. Thus a line has a dimension of one because only one coordinate is needed to specify a point on it...
s can be stored in a geometry collection.
Coordinates for geometries may be 2D (x, y), 3D
Three-dimensional space
Three-dimensional space is a geometric 3-parameters model of the physical universe in which we live. These three dimensions are commonly called length, width, and depth , although any three directions can be chosen, provided that they do not lie in the same plane.In physics and mathematics, a...
(x, y, z), 4D (x, y, z, m) with an m value that is part of a linear referencing system or 2D with an m value (x, y, m). Three-dimensional geometries are designated by a "Z" after the geometry type and geometries with a linear referencing system have an "M" after the geometry type. Empty geometries which contain no coordinates can be specified by using the symbol
EMPTY
after the type name.WKT geometries are used throughout OGC specifications and are present in applications that implement these specifications. For example, PostGIS
PostGIS
PostGIS is an open source software program that adds support for geographic objects to the PostgreSQL object-relational database. PostGIS follows the Simple Features for SQL specification from the Open Geospatial Consortium .-Features:...
contains functions that can convert geometries to and from a WKT representation, making them human readable.
Type | Examples | |
---|---|---|
Point Point (geometry) In geometry, topology and related branches of mathematics a spatial point is a primitive notion upon which other concepts may be defined. In geometry, points are zero-dimensional; i.e., they do not have volume, area, length, or any other higher-dimensional analogue. In branches of mathematics... |
POINT (30 10) |
|
LineString Line segment In geometry, a line segment is a part of a line that is bounded by two end points, and contains every point on the line between its end points. Examples of line segments include the sides of a triangle or square. More generally, when the end points are both vertices of a polygon, the line segment... |
LINESTRING (30 10, 10 30, 40 40) |
|
Polygon Polygon In geometry a polygon is a flat shape consisting of straight lines that are joined to form a closed chain orcircuit.A polygon is traditionally a plane figure that is bounded by a closed path, composed of a finite sequence of straight line segments... |
POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10)) |
|
POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10), |
Type | Examples | |
---|---|---|
MultiPoint Point (geometry) In geometry, topology and related branches of mathematics a spatial point is a primitive notion upon which other concepts may be defined. In geometry, points are zero-dimensional; i.e., they do not have volume, area, length, or any other higher-dimensional analogue. In branches of mathematics... |
MULTIPOINT ((10 40), (40 30), (20 20), (30 10)) |
|
MULTIPOINT (10 40, 40 30, 20 20, 30 10) |
||
MultiLineString Line segment In geometry, a line segment is a part of a line that is bounded by two end points, and contains every point on the line between its end points. Examples of line segments include the sides of a triangle or square. More generally, when the end points are both vertices of a polygon, the line segment... |
MULTILINESTRING ((10 10, 20 20, 10 40), |
|
MultiPolygon Polygon In geometry a polygon is a flat shape consisting of straight lines that are joined to form a closed chain orcircuit.A polygon is traditionally a plane figure that is bounded by a closed path, composed of a finite sequence of straight line segments... |
MULTIPOLYGON (((30 20, 10 40, 45 40, 30 20)), |
|
MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), |
The following are some other examples of geometric WKT strings:
Type | 2D | Z | M | ZM |
---|---|---|---|---|
Geometry | 0000 |
1000 |
2000 |
3000 |
Point | 0001 |
1001 |
2001 |
3001 |
LineString | 0002 |
1002 |
2002 |
3002 |
Polygon | 0003 |
1003 |
2003 |
3003 |
Triangle | 0017 |
1017 |
2017 |
3017 |
MultiPoint | 0004 |
1004 |
2004 |
3004 |
MultiLineString | 0005 |
1005 |
2005 |
3005 |
MultiPolygon | 0006 |
1006 |
2006 |
3006 |
GeometryCollection | 0007 |
1007 |
2007 |
3007 |
CircularString | 0008 |
1008 |
2008 |
3008 |
CompoundCurve | 0009 |
1009 |
2009 |
3009 |
CurvePolygon | 0010 |
1010 |
2010 |
3010 |
MultiCurve | 0011 |
1011 |
2011 |
3011 |
MultiSurface | 0012 |
1012 |
2012 |
3012 |
Curve | 0013 |
1013 |
2013 |
3013 |
Surface | 0014 |
1014 |
2014 |
3014 |
PolyhedralSurface | 0015 |
1015 |
2015 |
3015 |
TIN | 0016 |
1016 |
2016 |
3016 |
Transformations
A WKT format is defined to describe the transformation methods and parameters used to convert coordinates between two different spatial reference systems.Below are two examples of WKT transformation descriptions.
RDBMS Engines that provide support
- PostgresqlPostgreSQLPostgreSQL, often simply Postgres, is an object-relational database management system available for many platforms including Linux, FreeBSD, Solaris, MS Windows and Mac OS X. It is released under the PostgreSQL License, which is an MIT-style license, and is thus free and open source software...
with PostGISPostGISPostGIS is an open source software program that adds support for geographic objects to the PostgreSQL object-relational database. PostGIS follows the Simple Features for SQL specification from the Open Geospatial Consortium .-Features:...
Module 1.3 - Oracle SpatialOracle SpatialOracle Spatial forms a separately-licensed option component of the Oracle Database. Oracle Spatial aids users in managing geographic and location-data in a native type within an Oracle database, potentially supporting a wide range of applications — from automated mapping/facilities-management and...
9i, 10g, 11g - MySQLMySQLMySQL officially, but also commonly "My Sequel") is a relational database management system that runs as a server providing multi-user access to a number of databases. It is named after developer Michael Widenius' daughter, My...
since 4.1 - InformixInformixIBM Informix is a family of relational database management system developed by IBM. It is positioned as IBM's flagship data server for online transaction processing as well as integrated solutions...
9,10,11 with Spatial datablade module - Microsoft SQL ServerMicrosoft SQL ServerMicrosoft SQL Server is a relational database server, developed by Microsoft: It is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network...
2008 - SpatiaLiteSpatialiteSpatiaLite is a spatial extension to SQLite, providing vector geodatabase functionality. It is similar to PostGIS, Oracle Spatial, and SQL Server with spatial extensions, although SQLite/SpatiaLite aren't based on client-server architecture: they adopt a simpler personal architecture. i.e...
- TeradataTeradataTeradata Corporation is a vendor specializing in data warehousing and analytic applications. Its products are commonly used by companies to manage data warehouses for analytics and business intelligence purposes. Teradata was formerly a division of NCR Corporation, with the spinoff from NCR on...
6.1, 6.2, 12, 13 (native in 13 through add-in in previous versions) - Ingres GeoSpatial
- altibaseAltibaseAltibase helps its customers maximize their data investments by providing real-time data performance solutions. In today’s competitive business environment, Altibase enables companies to drastically improve the speed of data access and analysis across the enterprise....
5.x
APIs that provide support
- JTS Topology SuiteJTS Topology SuiteThe JTS Topology Suite is an open source Java software library that provides an object model for Euclidean planar linear geometry together with a set of fundamental geometric functions. JTS is primarily intended to be used as a core component of vector-based geomatics software such as...
(Java) - OpenLayersOpenLayersOpenLayers is an open source JavaScript library for displaying map data in web browsers. It provides an API for building rich web-based geographic applications similar to Google Maps and Bing Maps...
(JavaScript) - OpenScales (ActionScript)
- GDALGDALGDAL is a library for reading and writing raster geospatial data formats, and is released under the permissive X/MIT style free software license by the Open Source Geospatial Foundation. As a library, it presents a single abstract data model to the calling application for all supported formats...
(C/C++ with bindings to Java, Python, and others) - Shapely (Python): See Shapely Documentation and Shapely in PyPI
Variations
- EWKT and EWKB – Extended Well-Known Text/Binary – A PostGISPostGISPostGIS is an open source software program that adds support for geographic objects to the PostgreSQL object-relational database. PostGIS follows the Simple Features for SQL specification from the Open Geospatial Consortium .-Features:...
-specific format that includes the spatial reference system identifier (SRID). For example:SRID=4326;POINT(-44.3 60.1)
to locate a longitude/latitude coordinate using the WGS 84World Geodetic SystemThe World Geodetic System is a standard for use in cartography, geodesy, and navigation. It comprises a standard coordinate frame for the Earth, a standard spheroidal reference surface for raw altitude data, and a gravitational equipotential surface that defines the nominal sea level.The latest...
reference coordinate system. - AGF Text – AutodeskAutodeskAutodesk, Inc. is an American multinational corporation that focuses on 3D design software for use in the architecture, engineering, construction, manufacturing, media and entertainment industries. The company was founded in 1982 by John Walker, a coauthor of the first versions of the company's...
Geometry Format – An extension to OGCOpen Geospatial ConsortiumThe Open Geospatial Consortium , an international voluntary consensus standards organization, originated in 1994. In the OGC, more than 400 commercial, governmental, nonprofit and research organizations worldwide collaborate in a consensus process encouraging development and implementation of open...
's Standard (at the time), to include curved elements; most notably used in MapGuide.