This topic describes the ST_Force3DZ function. This function forcefully converts a geometry object into a 3D object.

Syntax

geometry  ST_Force3DZ(geometry  geomA);

Parameters

Parameter Description
geomA The geometry object that you want to specify.

Description

  • If the geometry object does not contain z coordinates, the values of z coordinates of the output are specified as 0.
  • This function supports circular strings, curves, polyhedral surfaces, and 3D objects.

Examples

SELECT ST_AsEWKT(ST_Force3DZ(ST_GeomFromEWKT('POINT(1 2)')));
  st_asewkt
--------------
 POINT(1 2 0)
(1 row)