ArcGIS Server Banner

ST_Z

ST_Z

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback

Definition

ST_Z can take an ST_Point as an input parameter and return its z (elevation)-coordinate.

Syntax

Oracle

sde.st_z (g1 sde.st_point)

PostgreSQL

st_z (g1 st_point)

Return type

Number (Oracle), integer (PostgreSQL)

Example

The z_test table is created with two columns: the id column, which uniquely identifies the row, and the geometry point column. The INSERT statement inserts a row into the z_test table.

Oracle

CREATE TABLE z_test (id integer unique, geometry sde.st_point);

INSERT INTO z_test (id, geometry) VALUES (
1,
sde.st_point (2, 3, 32, 5, 0)
);

PostgreSQL

CREATE TABLE z_test (id integer unique, geometry st_point);

INSERT INTO z_test (id, geometry) VALUES (
1,
st_point (2, 3, 32, 5, 0)
);

The SELECT statement lists the id column and the double-precision z-coordinate of the point inserted with the previous statement.

Oracle

SELECT id, sde.st_z (geometry) Z_COORD
FROM z_test; 

        ID      Z_COORD

         1        32

PostgreSQL

SELECT id, st_z (geometry) AS Z_COORD
FROM z_test; 

        id      z_coord

         1        32

See Also

  • An overview of SQL functions used with ST_Geometry types