ST_Y()
All functions > GEOSPATIAL > ST_Y()
Returns the Y coordinate of a point (or latitude for geography).
Signatures
Y coordinate
Returns: Y coordinate (or latitude)
ST_Y(point: T) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
point | T | Yes | A Point geometry or geography |
With:
T: Custom types: GEOM_POINT | GEOG_POINT
Signature notes:
- Input must be a Point; other sub kinds return NULL
- On GEOGRAPHY, returns the latitude in degrees (second argument to ST_GEOGPOINT)
- GEOG_POINT uses X = longitude, Y = latitude; swapping coordinates when building points is a frequent source of incorrect ST_Y (and ST_X) values
- Returns NULL if the input is NULL
Examples
FeatureQL
SELECT
f1 := ST_Y(ST_GEOMPOINT(3.0, 4.0)), -- Y of a geometry point
f2 := ST_Y(ST_GEOGPOINT(-122.4194, 37.7749)) -- Latitude of a geography point
;Result
| f1 VARCHAR | f2 VARCHAR |
|---|---|
| 4.0 | 37.7749 |
On this page