来自于百科跟维基百科
WKT - 概念
WKT(Well-known text)是一种文本标记语言,用于表示矢量几何对象、空间参照系统及空间参照系统之间的转换。它的二进制表示方式,亦即WKB(well-known binary)则胜于在传输和在数据库中存储相同的信息。该格式由开放地理空间联盟(OGC)制定。
WKT - 几何对象
WKT可以表示的几何对象包括:点,线,多边形,TIN(不规则三角网)及多面体。可以通过几何集合的方式来表示不同维度的几何对象。几何物体的坐标可以是2D(x,y),3D(x,y,z),4D(x,y,z,m),加上一个属于线性参照系统的m值。
以下为几何WKT字串样例:
Geometry primitives (2D)
Type |
Examples |
Point |
POINT (30 10) |
![](http://img.e-com-net.com/image/info8/148513b7af744f9b9a02049daf40293c.png) |
LineString |
LINESTRING (30 10, 10 30, 40 40) |
![](http://img.e-com-net.com/image/info8/a38d8c10fe534827975f41fcb2b99425.png) |
Polygon |
POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10)) |
![](http://img.e-com-net.com/image/info8/6e0e020a68d742459184ab9d3f9ef968.png) |
POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10), (20 30, 35 35, 30 20, 20 30)) |
![](http://img.e-com-net.com/image/info8/984ff8bb85cc4363960739e59e90efb5.png) |
Multipart geometries (2D)
Type |
Examples |
MultiPoint |
MULTIPOINT ((10 40), (40 30), (20 20), (30 10)) |
![](http://img.e-com-net.com/image/info8/55c5c6de1a5d441394130b7b7820354a.png) |
MULTIPOINT (10 40, 40 30, 20 20, 30 10) |
MultiLineString |
MULTILINESTRING ((10 10, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10)) |
![](http://img.e-com-net.com/image/info8/a9230c39e5ac43b58a336de9f553a7ed.png) |
MultiPolygon |
MULTIPOLYGON (((30 20, 10 40, 45 40, 30 20)), ((15 5, 40 10, 10 20, 5 10, 15 5))) |
![](http://img.e-com-net.com/image/info8/c29cc68bffef42a19ce1ef68f6408e58.png) |
MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), ((20 35, 45 20, 30 5, 10 10, 10 30, 20 35), (30 20, 20 25, 20 15, 30 20))) |
![](http://img.e-com-net.com/image/info8/ce14c1fa6cf443f49239700dad29bb60.png) |
WKT - 空间参照系统
一个表示空间参照系统的WKT字串描述了空间物体的测地基准、大地水准面、坐标系统及地图投影。 WKT在许多GIS程序中被广泛采用。ESRI亦在其shape文件格式(*.prj)中使用WKT。以下是空间参照系统的WKT表示样例:
COMPD_CS["OSGB36 / British National Grid + ODN",
PROJCS["OSGB 1936 / British National Grid",
GEOGCS["OSGB 1936",
DATUM["OSGB_1936",
spheroid["Airy 1830",6377563.396,299.3249646,AUTHORITY["EPSG","7001"]],
TOWGS84[375,-111,431,0,0,0,0],
AUTHORITY["EPSG","6277"]],
PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
UNIT["DMSH",0.0174532925199433,AUTHORITY["EPSG","9108"]],
AXIS["Lat",NORTH],
AXIS["Long",EAST],
AUTHORITY["EPSG","4277"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",49],
PARAMETER["central_meridian",-2],
PARAMETER["scale_factor",0.999601272],
PARAMETER["false_easting",400000],
PARAMETER["false_northing",-100000],
UNIT["metre",1,AUTHORITY["EPSG","9001"]],
AXIS["E",EAST],
AXIS["N",NORTH],
AUTHORITY["EPSG","27700"]],
VERT_CS["Newlyn",
VERT_DATUM["Ordnance Datum Newlyn",2005,AUTHORITY["EPSG","5101"]],
UNIT["metre",1,AUTHORITY["EPSG","9001"]],
AXIS["Up",UP],
AUTHORITY["EPSG","5701"]],
AUTHORITY["EPSG","7405"]]