概念
WKT(Well-known text)是一種文本標記語言,用於表示矢量幾何對象、空間參照系統及空間參照系統之間的轉換。它的二進制表示方式,亦即WKB(well-known binary)則勝於在傳輸和在資料庫中存儲相同的信息。該格式由開放地理空間聯盟(OGC)制定。幾何對象
WKT可以表示的幾何對象包括:點,線,多邊形,TIN(不規則三角網)及多面體。可以通過幾何集合的方式來表示不同維度的幾何對象。幾何物體的坐標可以是2D(x,y),3D(x,y,z),4D(x,y,z,m),加上一個屬於線性參照系統的m值。
以下為幾何WKT字串樣例:
POINT(610)LINESTRING(34,1050,2025)POLYGON((11,51,55,15,11),(22,23,33,32,22))MULTIPOINT(3.55.6,4.810.5)MULTILINESTRING((34,1050,2025),(-5-8,-10-8,-15-4))MULTIPOLYGON(((11,51,55,15,11),(22,23,33,32,22)),((63,92,94,63)))GEOMETRYCOLLECTION(POINT(46),LINESTRING(46,710))POINTZM(11560)POINTM(1180)POINTEMPTYMULTIPOLYGONEMPTY空間參照系統
一個表示空間參照系統的WKT字串描述了空間物體的測地基準、大地水準面、坐標系統及地圖投影。 WKT在許多GIS程式中被廣泛採用。ESRI亦在其shape檔案格式(*.prj)中使用WKT。 以下是空間參照系統的WKT表示樣例:COMPD_CS["OSGB36/BritishNationalGrid+ODN",PROJCS["OSGB1936/BritishNationalGrid",
GEOGCS["OSGB1936",
DATUM["OSGB_1936",
spheroid["Airy1830",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["OrdnanceDatumNewlyn",2005,AUTHORITY["EPSG","5101"]],
UNIT["metre",1,AUTHORITY["EPSG","9001"]],
AXIS["Up",UP],
AUTHORITY["EPSG","5701"]],
AUTHORITY["EPSG","7405"]]