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
ParameterTypeRequiredDescription
pointTYesA 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

Availability

StatusBackends
Not availableclickhouse, mysql

Examples

FeatureQL
RETURN
    -- Y of a geometry point
    f1 := ST_Y(ST_GEOMPOINT(3.0, 4.0))
;
Result
f1 DECIMAL
4.0