Download IBM Informix Spatial Data User's Guide

Transcript
The SE_Z() function
The SE_Z() function returns the Z coordinate of a point.
Syntax
SE_Z(p1 ST_Point)
Return type
DOUBLE PRECISION
Example
The z_test table is created with two columns: gid, which uniquely identifies the
row, and the pt1 point column:
CREATE TABLE z_test (gid integer,
pt1 ST_Point);
The following INSERT statements insert two rows. One is a point without a Z
coordinate or a measure. The other has both a Z coordinate and a measure:
INSERT INTO z_test VALUES(
1,
ST_PointFromText(’point (10.02 20.01)’, 1000)
);
INSERT INTO z_test VALUES(
2,
ST_PointFromText(’point zm (10.02 20.01 5.0 7.0)’, 1000)
);
The query retrieves the values in the gid column and the DOUBLE PRECISION Z
coordinate of the points. The first row is NULL because the point does not have a
Z coordinate:
SELECT gid, SE_Z(pt1) z_coord
FROM z_test;
gid
z_coord
1
2 5.000000000000
The ST_Zmax() and ST_Zmin() functions
The ST_Zmax() and ST_Zmin() functions return the maximum and minimum Z
coordinates of a geometry.
Syntax
ST_Zmax(ST_Geometry)
ST_Zmin(ST_Geometry)
Return type
DOUBLE PRECISION
Chapter 8. Spatial functions
8-115