Returns the y coordinate of a point geometry as a float.
Syntax
float ST_Y(geometry aPoint)Parameters
| Parameter | Description |
|---|---|
aPoint | The point geometry to query. |
Usage notes
aPointmust be a point geometry.Returns NULL if the input is unavailable or invalid.
Supports 3D geometries and preserves z coordinates.
Examples
Return the y coordinate of a 2D point:
SELECT ST_Y('POINT(0 1)'::geometry);Output:
st_y
------
1
(1 row)Return the y coordinate of a 3D point (z coordinate is preserved, not returned):
SELECT ST_Y('POINT(0 1 2 3)'::geometry);Output:
st_y
------
1
(1 row)该文章对您有帮助吗?