Sustainability of Digital Formats: Planning for Library of Congress Collections |
|
Introduction | Sustainability Factors | Content Categories | Format Descriptions | Contact |
Full name | Well-known Text |
---|---|
Description |
The well-known text (WKT) representation of coordinate systems is a text markup language standard for representing vector geometry objects, spatial reference systems of spatial objects and transformations between spatial reference systems (SRS). WKT is defined by the Open Geospatial Consortium (OGC) and the standard is published jointly by the International Organization for Standardization (ISO). The equivalent standards documents are OGC 18-010r7 and ISO 19162:2019. Note that this site uses the hyphen and lower case for the title well-known text because this is documented in OGC 18-010r7, although other resources may use other variations. WKT offers a compact human-readable representation of geometric objects, such as lines, polygons, triangulated irregular network (TINs), polyhedrons, and/or enclosed areas on a map, but also can be used for succinctly describing the critical elements of coordinate reference system (CRS) definitions. Uses of WKT WKT can describe spatial or coordinate reference systems, a framework used to precisely measure location on the surface of the Earth as coordinates but also geocentric, projected, vertical, temporal, and non-georeferenced engineering coordinates (for example, a coordinate reference system attached to a boat). The Well Known Text and Well Known Binary (WKT and WKB) paper from TerraExplorer states that "a standard textual representation for spatial reference system information. A spatial reference system, also referred to as a coordinate system, is a projected (X, Y), geographic (latitude-longitude), or geocentric (X, Y, Z) coordinate system with each object has a keyword in uppercase (for example, DATUM or UNIT) followed by the comma-delimited defining parameters of the object in brackets." As defined in Coordinate systems syntax from IBM, a data set's coordinate system is identified by the PROJCS keyword if the data are in projected coordinates, by GEOGCS if in geographic coordinates, or by GEOCCS if in geocentric coordinates (a geocentric coordinate system has its origin at the center of the Earth). The WKT standard describes how to combine the coordinate reference systems. A WKT format is defined to describe the operation methods and parameters used to convert or transform coordinates between two different coordinate reference systems Structure of WKT Structurally, the WKT string is a representation of the definition of a CRS or coordinate operation. A string describes one CRS or coordinate operation object. Each object is represented by a token comprised of a keyword followed by a set of attributes of the object. The set enclosed by delimiters. Some objects are composed of other objects so the result may be a nested structure. Nesting may continue to any depth. OGC 18-010r7 includes an example of the nested structure in section 6.1: KEYWORD1[attribute1,KEYWORD2[attribute2,attribute3]]. "Keywords are case-insensitive. Where human readability of the string is important, as in this document, keywords are normally in upper case. The delimiters are normally left angle bracket and right angle bracket. Implementations are free to substitute parentheses for brackets. Attributes may be from an enumeration, may be numbers or may be text. Text is enclosed in double quotes. Two forms of text are defined, one restricted to the Latin1 character set and the other permitting any Unicode character set. Attributes are separated by a comma. A WKT string contains no white space outside of double quotes. However padding with white space to improve human readability is permitted; the examples of WKT that are included in this document have spaces and line feeds inserted to improve clarity. Any padding is stripped out or ignored by parsers." WKT can also be used to express individual geometry objects within a spatial reference system. For example, LINESTRING(12 20,30 44) demonstrates the code line for how WKT is used to define a LineString between the points at coordinates (12,20) and (30,44). The WKT description is made up of three components: geometry type, coordinate type, and coordinate list. The geometry type include points, lines/linestrings, polygons, multipoints, multilinestrings, multipolygons and geometrycollection. As explained in Well Known Text and Well Known Binary (WKT and WKB) from TerraExplorer, "the coordinate type specifies whether or not the geometry has Z coordinates and/or a linear referencing system. If the geometry has neither, this argument is left blank. If the geometry has Z coordinates, the coordinate type is set to Z, if the geometry has a linear referencing system, it is set to M, and if it has both, then to ZM. The coordinate list defines the double-precision vertices of the geometry. Coordinate lists are separated by commas and enclosed by parentheses. If a geometry has multiple components, parentheses must enclose each component part (e.g. MultiPoint ((10 10), (20 20))) If the geometry is empty, the keyword EMPTY follows the geometry type." Defined in the OGC 18-010r7 Version: 2.0.6, the WKT representation of coordinate reference systems and coordinate operations use the extended version of Backus-Naur form (BNF) notation that is defined in ISO/IEC 9075-1:2016, 6.2. The BNF provides the mechanism for generating a WKT string. The production rules in ISO/IEC 9075-1:2016, 6.2 apply. WKT geometry data is represented in ASCII character encoding. Although it is largely out of practice now, the National Center for Ecological Analysis and Synthesis (NCEAS) (link via Internet Archive) noted in 2013 that "it is the least desirable representation to write down by hand or copy and paste because of it is verbose compared to other text representations of spatial reference systems." While widely used (see Adoption for more details), WKT has some disadvantages as described Expert SQL Server 2008 Development (p. 79): "As with any text-based representation, it is not possible to precisely state the value of certain floating-point coordinate values obtained from binary methods. The inevitable rounding errors introduced when attempting to do so will lead to a loss of precision." Since software must parse the text in a WKT representation to create the relevant spatial object, creating objects from WKT can be slower than when using other methods. Comments welcome. |
Production phase | Middle State. WKT is used to represent vector geometry objects on a map, spatial reference system, and transformations between spatial reference systems. |
Relationship to other formats | |
Equivalent to | WKB, Well-known Binary. Used to transfer and store the same information in a more compact form convenient for computer processing but that is not human-readable. |
Used by | LAS_1_4, LAS (LASer) File Format, Version 1.4 |
Used by | ESRI_world, ESRI World File |
Used by | GeoPackage_family, GeoPackage Encoding Standard (OGC) Format Family |
Used by | PDF_1_7_geospatial, PDF, Version 1.7, ExtensionLevel 3, Geospatial Encoding (Adobe) |
LC experience or existing holdings | The Library of Congress has a small number of WKT files in its collections. |
---|---|
LC preference | See the Recommended Formats Statement for the Library of Congress format preferences for Geographic Information System (GIS) - Vector images. |
Disclosure |
An open standard developed by the Open Geospatial Consortium (OGC), an international voluntary consensus standards organization whose members maintain the Geography Markup Language standard. The updated "Geographic information: Well-known text representation of coordinate reference systems" standard, was adopted by the Open Geospatial Consortium in 2015. This standard is published conjointly by the International Organization for Standardization as ISO 19162:2015. A newer revision called WKT-CRS 2 was published in 2018, with the ISO version being ISO 19162:2019. |
---|---|
Documentation |
ISO 19162:2019 Geographic information — Well-known text representation of coordinate reference systems is available for purchase. The earlier version, ISO 19162:2015, was withdrawn with the publication of the 2019 version. The equivalent standard from OGC, OGC 18-010r7, is freely available online. As of 2019, the current Standard provides an updated version of WKT representation of coordinate reference systems that follows the provisions of ISO 19162:2019. WKT representation of geometry was originally defined by the Open Geospatial Consortium (OGC), described in their Simple Feature Access. The current standard definition is in the ISO-IEC 13249-3:2016. |
Adoption |
Originally defined and approved by the Open Geospatial Consortium (OGC) and later adopted as an ISO standard, WKT is the industry-standard format for expressing spatial information and individual geometry objects within a spatial reference system. The WKT standard is supported by most major GIS applications and widely used with spatially enabled DBMS, due to its compactness and standardization. These include ESRI which uses WKT in the shapefile Name.prj file. WKT is supported by most triple stores (or RDF stores) as well as supported by Web Libraries, including for example, Wicket which translates WKT into into GeoJSON. WKT geometries are used throughout OGC specifications and are present in applications that implement these specifications. WKT is used in some form in the following software packages: Oracle Spatial Database (see also ESRI FAQ: What is Oracle Spatial geodetic data?), Cadcorp, OGR/GDAL, FME, MapGuide, and PostGIS. |
Licensing and patents | No known license or patent concerns for generation and use of the format. Comments welcome. |
Transparency |
WKT is ASCII text-based and hence readable with a basic text viewer or editor. It uses human-readable tags and a simple structure that makes a WKT document understandable. All WKT strings are realized as a sequence of characters or a character string. A WKT string shall use one encoding throughout the entire string. UTF-8 shall be used if no encoding is specified in the carrier. The characters used in a WKT string shall be wholly contained within the domain of a specific character set. This character set shall exist as a subset of the repertoire of the Universal Character Set specified by ISO/IEC 10646. |
Self-documentation | WKT is based on text using UNICODE and uses a standardized structure defined in the OGC 18-010r7. The documentation provides notation, descriptions for how geometric objects are represented, encoding, and formatting. |
External dependencies | None beyond availability of supporting software. |
Technical protection considerations | None. |
GIS images and datasets | |
---|---|
Normal functionality |
WKT format is an industry-standard format for expressing spatial information defined by the OGC. It can describe geographic coordinate reference systems, as well as describe the operation methods and parameters used to convert or transform coordinates between two different coordinate reference systems. |
Support for GIS metadata | WKT has very limited support for metadata as recommended by ISO 19115 or FGDC. Within the sys.spatial reference systems table, SQL Server stores the relevant details of each spatial reference using the WKT format. The WKT description of the spatial reference is stored as a text string in the well-known text column. The first line of WKT spatial reference is a keyword for what sort of coordinate system is used. Immediately following the declaration of the type of coordinate system is the name of this spatial reference. The values following the DATUM keyword provide the parameters of the datum. The first parameter gives us the name of the datum used, followed by the parameters of the reference ellipsoid. |
Support for grids | Not designed to support grid-based analysis. |
Beyond normal functionality | None. |
Tag | Value | Note |
---|---|---|
Filename extension | wkt |
The 'wkt' file extension is not defined in the OGC or ISO specification documents but is commonly used. See DataTypes.net: WKT file format description. Comments welcome. |
Internet Media Type | text/plain |
The generic mediatype for text based content as per WC3's Spatial Data on the Web Best Practices. |
Pronom PUID | See note. | No PRONOM entry as of August 2022 |
Wikidata Title ID | Q61714670 |
See https://www.wikidata.org/wiki/Q61714670. |
General | |
---|---|
History |
WKT was initially defined by the Open Geospatial Consortium (OGC) in 1999, extended in 2001, and was defined by the International Organization of Standardization (ISO) in 2004, ISO 19125-1:2004, sometimes referred to as “WKT 1”. Evolution of the Coordinate Reference System conceptual model required revisions to this format and in 2015 the updated “Well-known text representation of coordinate reference systems” standard, referred to as “WKT 2” was adopted by the Open Geospatial Consortium, and published conjointly by the ISO as ISO 19162:2015. OGC 18-010r7 Geographical information – Well-known text representation of coordinate reference systems Standard was submitted in 2018 and published in 2019. This Standard defines the structure and content of well-known text strings describing coordinate reference systems (CRSs) and coordinate operations between coordinate reference systems. This Standard provides an updated version of the WKT representation of coordinate reference systems following provisions of ISO 19111:2019, extending the WKT in OGC document 12-063r5 (ISO 19162) which was based on ISO 1911:2007 and ISO 1911-2:2009. There is some backward compatibility between WKT 2 and WKT 1, though some caveats exist. Software capable of reading coordinate reference systems in WKT 2 format can also read many (but not all) equivalent systems in WKT 1 format. Another caveat is that some units of measurement were unspecified in the oldest WKT 1 specification, which has led to different interpretations by different software. Those units of measurement have been clarified in the 2001 update and the WKT 2 specification is consistent with that clarification. But not all software has followed the 2001 clarification. ESRI participated in writing the WKT 2 specification, adding a few variations on the OGC’s WKT 1 specification, making it stricter and containing fewer ambiguities. As a result, some databases differentiate between "OGC WKT" and "ESRI WKT" representations. The problem is largely resolved in WKT 2, as it is better defined. |
|