1.要素的空间对象的文本表示(WKT)的示例如下:
-
POINT(0 0)
LINESTRING(0 0,1 1,1 2)
POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))
MULTIPOINT((0 0),(1 2))
MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4))
MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))
GEOMETRYCOLLECTION(POINT(2 3),LINESTRING(2 3,3 4))
2.可使用以下接口在这些格式之间进行转换:
select ST_AsBinary(geom) from truemap_station_new ;
select ST_AsText(geom) from truemap_station_new ;
select ST_GeomFromWKB(ST_AsBinary(geom),4326) from truemap_station_new ;
select ST_GeometryFromText(ST_AsText(geom),4326) from truemap_station_new ;
3.要素的扩展空间对象的文本表示(EWKT)的示例如下。
-
POINT(0 0 0)-XYZ
SRID = 32632; POINT(0 0)-带有SRID的XY
POINTM(0 0 0)-XYM
POINT(0 0 0 0)-XYZM
SRID = 4326; MULTIPOINTM(0 0 0,1 2 1)-具有SRID的XYM
MULTILINESTRING(((0 0 0,1 1 0,1 2 1),(2 3 1,3 2 1,5 4 1))
POLYGON((0 0 0,4 0 0,4 4 0,0 4 0,0 0 0),(1 1 0,2 1 0,2 2 0,1 2 0,1 1 0))
MULTIPOLYGON((((0 0 0,4 0 0,4 4 0,0 4 0,0 0 0),(1 1 0,2 1 0,2 2 0,1 2 0,1 1 0)),(( -1 -1 0,-1 -2 0,-2 -2 0,-2 -1 0,-1 -1 0))))
GEOMETRYCOLLECTIONM(POINTM(2 3 9),LINESTRINGM(2 3 4,3 4 5))
MULTICURVE((0 0,5 5),CICCULARSTRING(4 0,4 4,8 4))
POLYHEDRALSURFACE((((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),(((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)), (((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0))),(((1 1 0,1 1 1,1 0 1,1 0 0,1 1 0)),(( 0 1 0,0 1 1,1 1 1,1 1 0,0 1 0)))(((0 0 1,1 0 1,1 1 1,0 1 1,0 0 1)))
TRIANGLE ((0 0,0 9,9 0,0 0))
TIN((((0 0 0,0 0 1,0 1 0,0 0 0)),(((0 0 0,0 1 0,1 1 0,0 0 0)))
可使用以下接口在这些格式之间进行转换:
select ST_AsEWKB(geom) from truemap_station_new ;
select ST_AsEWKT(geom) from truemap_station_new ;
select ST_AsHEXEWKB(geom) from truemap_station_new ;
select ST_GeomFromEWKB(ST_AsEWKB(geom)) from truemap_station_new ;
select ST_GeomFromEWKT(ST_AsEWKT(geom)) from truemap_station_new ;
4一些简单的弯曲几何的示例如下所示:
CIRCULARSTRING(0 0, 1 1, 1 0)
CIRCULARSTRING(0 0, 4 0, 4 4, 0 4, 0 0)
COMPOUNDCURVE(CIRCULARSTRING(0 0, 1 1, 1 0),(1 0, 0 1))
CURVEPOLYGON(CIRCULARSTRING(0 0, 4 0, 4 4, 0 4, 0 0),(1 1, 3 3, 3 1, 1 1))
MULTICURVE((0 0, 5 5),CIRCULARSTRING(4 0, 4 4, 8 4))
MULTISURFACE(CURVEPOLYGON(CIRCULARSTRING(0 0, 4 0, 4 4, 0 4, 0 0),(1 1, 3 3, 3 1, 1 1)),((10 10, 14 12, 11 10, 10 10),(11 11, 11.5 11, 11 11.5, 11 11)))