ArcGIS Server Banner

ST_Y

ST_Y

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback
Note: This topic was updated for 9.3.1.

Definition

ST_Y can take an ST_Point as an input parameter and return its y-coordinate.

Syntax

Oracle

sde.st_y (p1 sde.st_point)

PostgreSQL

st_y (p1 st_point)

Return type

Double precision

Example

The y_test table is created with two columns: the gid column, which uniquely identifies the row, and the pt1 point column.

Oracle

CREATE TABLE y_test (gid integer unique, pt1 sde.st_point);

PostgreSQL

CREATE TABLE y_test (gid integer unique, pt1 st_point);

The INSERT statements insert two rows. One is a point without a z-coordinate or measure. The other has both a z-coordinate and measure.

Oracle

INSERT INTO y_test VALUES (
1,
sde.st_pointfromtext ('point (10.02 20.01)', 0)
);

INSERT INTO y_test VALUES (
2,
sde.st_pointfromtext ('point zm(10.02 20.01 5.0 7.0)', 0)
);

PostgreSQL

INSERT INTO y_test VALUES (
1,
st_point ('point (10.02 20.01)', 0)
);

INSERT INTO y_test VALUES (
2,
st_point ('point zm(10.02 20.01 5.0 7.0)', 0)
);

The query lists the gid column and the double-precision y-coordinate of the points.

Oracle

SELECT gid, sde.st_y (pt1) "The Y coordinate"
FROM y_test;

       GID     The Y coordinate

         1          20.01
         2          20.01

PostgreSQL

SELECT gid, st_y (pt1) AS "The Y coordinate"
FROM y_test;

       gid    The Y coordinate

         1          20.01
         2          20.01

See Also

  • An overview of SQL functions used with ST_Geometry types