Returns the x coordinate of a point geometry object.
Syntax
float ST_X(geometry aPoint)Parameters
| Parameter | Description |
|---|---|
aPoint | The point object from which to extract the x coordinate. |
Usage notes
aPointmust be a point object.If
aPointis unavailable or invalid,ST_Xreturns NULL.ST_Xpreserves z coordinates when applied to 3D point objects.
Examples
Extract the x coordinate from a 4D point:
SELECT ST_X('POINT(0 1 2 3)'::geometry);Output:
st_x
------
0
(1 row)该文章对您有帮助吗?