Name

ST_X — 返回点的X坐标。

Synopsis

float ST_X(geometry a_point);

描述

返回点的X坐标,如果不可用,则返回值为空。输入必须是一个点。

[Note]

要获取几何坐标的最小和最大X值,请使用以下函数 ST_XMinST_XMax

This method implements the SQL/MM specification. SQL-MM 3:6.1.3

This function supports 3d and will not drop the z-index.

示例

SELECT ST_X(ST_GeomFromEWKT('POINT(1 2 3 4)'));
 st_x
------
        1
(1 row)

SELECT ST_Y(ST_Centroid(ST_GeomFromEWKT('LINESTRING(1 2 3 4, 1 1 1 1)')));
 st_y
------
  1.5
(1 row)

                

另请参阅

ST_Centroid, ST_GeomFromEWKT, ST_M, ST_XMax, ST_XMin, ST_Y, ST_Z