ST_Force4D

更新时间:
复制 MD 格式

Converts any geometry to a 4D geometry (XYZM). If the input geometry is missing a Z or M coordinate, the missing value defaults to 0.

Syntax

geometry ST_Force4D(geometry geomA);

Parameters

ParameterDescription
geomAThe input geometry.

Description

  • If the input geometry has no Z or M coordinate, the missing coordinate is set to 0.

  • This function supports 3D objects and does not delete z coordinates.

  • Supports circular strings and curves.

Examples

3D geometry: Z is preserved, M coordinate is added

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