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

Syntax

geometry  ST_Force3DM(geometry  geomA);

Parameters

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

Description

  • If the input geometry object does not contain m coordinates, the values of m coordinates of the output geometry object are specified as 0.
  • If the input geometry object contains z coordinates, z coordinates are removed from the output geometry object.
  • This function supports circular strings and curves.

Examples

  • Obtain a 3D object by using the default parameter settings.
    SELECT ST_AsEWKT(ST_Force3DM(ST_GeomFromEWKT('POINT(1 2)')));
       st_asewkt
    ---------------
     POINTM(1 2 0)
    (1 row)
                    
  • Execute the following statement to obtain a 3D object for which the z coordinates are removed from the input geometry object:
    SELECT ST_AsEWKT(ST_Force3DM(ST_GeomFromEWKT('POINT(1 2 3)')));
       st_asewkt
    ---------------
     POINTM(1 2 0)
    (1 row)