ST_X

更新时间:
复制 MD 格式

Returns the X coordinate of a point geometry.

Syntax

float ST_X(geometry aPoint);

Parameters

ParameterDescription
aPointThe point geometry to query.

Usage notes

  • The input must be a point geometry.

  • If the geometry is unavailable or invalid, ST_X returns NULL.

  • ST_X supports 3D geometries and preserves Z coordinates.

Examples

SELECT ST_X('POINT(0 1 2 3)'::geometry);
 st_x
------
    0
(1 row)