ST_Y
Determines the y-coordinate for a GEOMETRY point or the latitude value for a GEOGRAPHY point.
Determines the y-coordinate for a GEOMETRY point or the latitude value for a GEOGRAPHY point.
Behavior type
ImmutableSyntax
ST_Y( g )
Arguments
g- Point of type GEOMETRY or GEOGRAPHY
Returns
FLOAT
Supported data types
| Data Type | GEOMETRY | GEOGRAPHY (Perfect Sphere) | GEOGRAPHY (WGS84) |
|---|---|---|---|
| Point | Yes | Yes | Yes |
| Multipoint | No | No | No |
| Linestring | No | No | No |
| Multilinestring | No | No | No |
| Polygon | No | No | No |
| Multipolygon | No | No | No |
| GeometryCollection | No | No | No |
Examples
The following examples show how to use ST_Y.
Returns the y-coordinate:
=> SELECT ST_Y(ST_GeomFromText('POINT(3 5.25)'));
ST_Y
------
5.25
(1 row)
Returns the latitude value:
=> SELECT ST_Y(ST_GeographyFromText('POINT(35.44 51.04)'));
ST_Y
-------
51.04
(1 row)