Returns the X coordinate of a point geometry.
Syntax
float ST_X(geometry aPoint);Parameters
| Parameter | Description |
|---|---|
| aPoint | The 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)