Converts a geometry object to 3D (XYZ) format.
Syntax
geometry ST_Force3D(geometry geomA);Parameters
| Parameter | Description |
|---|---|
geomA | The geometry object to convert. |
Description
ST_Force3Dis an alias forST_Force_3DZ.If the input has no z coordinates, all z values are set to
0.Supports circular strings, curves, polyhedral surfaces, and 3D objects.
Examples
Convert a 2D point to 3D. The z coordinate is set to 0 because the input has no z value.
SELECT ST_AsEWKT(ST_Force3D(ST_GeomFromEWKT('POINT(1 2)')));Output:
st_asewkt
--------------
POINT(1 2 0)
(1 row)该文章对您有帮助吗?