ST_Force3D

更新时间:
复制 MD 格式

Forces a geometry into 3D by adding Z coordinates.

Syntax

geometry ST_Force3D(geometry geomA);

Parameters

ParameterDescription
geomAThe geometry object to convert.

Description

  • ST_Force3D is an alias for ST_Force_3DZ.

  • If the input geometry does not have Z coordinates, the Z coordinates of the output are set to 0.

  • Supports circular strings, curves, polyhedral surfaces, and 3D geometries.

Examples

SELECT ST_AsEWKT(ST_Force3D(ST_GeomFromEWKT('POINT(1 2)')));

Output:

  st_asewkt
--------------
 POINT(1 2 0)
(1 row)