ST_Y
Determine the y coordinate of a point geometry, or set the y coordinate of a point geometry to a particular value.
Syntax
ST_Y(pgeo);
ST_Y(pgeo, y);
- pgeo
- The input point geometry.
Type: VARCHAR(ANY)
- y
- The value to which the y coordinate of the input point geometry is to be set.
Type: DOUBLE
Returns
The value that is returned depends on whether an y value is specified:
- If an y value is not specified, a value of type DOUBLE that indicates the y coordinate of the input point geometry.
- If an y value is specified, a value of type VARCHAR(100) that contains the input point geometry with the newly set y coordinate.
Examples
SELECT inza..ST_Y(inza..ST_Point(0.0, 1.0));
ST_Y
------
1
(1 row)
SELECT inza..ST_AsText(inza..ST_Y(inza..ST_Point(0.0, 1.0), 5));
ST_ASTEXT
-----------
POINT (0 5)
(1 row)
SELECT inza..ST_AsText(inza..ST_Y(inza..ST_Point(0.0, 1.0, 2.0), 5));
ST_ASTEXT
-----------
POINT Z (0 5 2)
(1 row)
SELECT inza..ST_AsText(inza..ST_Y(inza..ST_Point(0.0, 1.0, 2.0, 3.0), 5));
ST_ASTEXT
-----------
POINT ZM (0 5 2 3)
(1 row)