ST_Force2D — 强制几何图形进入“2维模式”。
geometry ST_Force2D(
geometry geomA)
;
将几何体强制为“2维模式”,以便所有输出表示将只有X和Y坐标。这对于FORCE OGC兼容的输出非常有用(因为OGC仅指定2-D几何图形)。
增强:引入了对多面体曲面的2.0.0支持。
更改:2.1.0。直到2.0.x版本,这被称为ST_Force_2D。
This method supports Circular Strings and Curves
This function supports Polyhedral surfaces.
This function supports 3d and will not drop the z-index.
SELECT ST_AsEWKT(ST_Force2D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); st_asewkt ------------------------------------- CIRCULARSTRING(1 1,2 3,4 5,6 7,5 6) SELECT ST_AsEWKT(ST_Force2D('POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 3 2,1 1 2))')); st_asewkt ---------------------------------------------- POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))