Name

ST_Force3D — 强制几何图形进入XYZ模式。这是ST_Force3DZ的别名。

Synopsis

geometry ST_Force3D(geometry geomA, float Zvalue = 0.0);

描述

强制几何图形进入XYZ模式。这是ST_Force3DZ的别名。如果几何图形没有Z分量,则一个 Z值 已附加Z坐标。

增强:引入了对多面体曲面的2.0.0支持。

更改:2.1.0。直到2.0.x版本,这被称为ST_Force_3D。

更改:3.1.0。添加了对提供非零Z值的支持。

This function supports Polyhedral surfaces.

This method supports Circular Strings and Curves

This function supports 3d and will not drop the z-index.

示例

--Nothing happens to an already 3D geometry
                SELECT ST_AsEWKT(ST_Force3D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)')));
                                   st_asewkt
-----------------------------------------------
 CIRCULARSTRING(1 1 2,2 3 2,4 5 2,6 7 2,5 6 2)


SELECT  ST_AsEWKT(ST_Force3D('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))'));

                                                 st_asewkt
--------------------------------------------------------------
 POLYGON((0 0 0,0 5 0,5 0 0,0 0 0),(1 1 0,3 1 0,1 3 0,1 1 0))
                

另请参阅

ST_AsEWKT, ST_Force2D, ST_Force3DM, ST_Force3DZ