ST_Y Signature DOUBLE ST_Y(GEOMETRY geom); Description Returns the y-value of the first coordinate of geom. Implements the OpenGIS Simple Features Implementation Specification for SQL version 1.2.1. Examples SELECT ST_Y('MULTIPOINT((4 4), (1 1), (1 0), (0 3)))'); -- Answer: 4.0 SELECT ST_Y( ST_GeometryN('MULTIPOINT((4 4), (1 1), (1 0), (0 3)))', 2)); -- Answer: 1.0 SELECT ST_Y('LINESTRING(2 1, 1 3, 5 2)'); -- Answer: 1.0 SELECT ST_Y(ST_PointN('LINESTRING(2 1, 1 3, 5 2)', 3)); -- Answer: 2.0 SELECT ST_Y('POLYGON((5 0, 7 0, 7 1, 5 1, 5 0))'); -- Answer: 0.0 SELECT ST_Y( ST_PointN( ST_ExteriorRing('POLYGON((5 0, 7 0, 7 1, 5 1, 5 0))'), 3)); -- Answer: 1.0 SELECT ST_Y('MULTIPOLYGON(((0 2, 3 2, 3 6, 0 6, 0 2)), ((5 0, 7 0, 7 1, 5 1, 5 0)))'); -- Answer: 2.0 SELECT ST_Y('GEOMETRYCOLLECTION( MULTIPOINT((4 4), (1 1), (1 0), (0 3)), LINESTRING(2 1, 1 3, 5 2), POLYGON((1 2, 4 2, 4 6, 1 6, 1 2)))'); -- Answer: 4.0 See also ST_X, ST_Z ST_GeometryN, ST_PointN, ST_ExteriorRing Source code Back Next