User's Guide and Reference

Is3d

Is3d takes a geometry object and returns 1 (TRUE) if the object has 3D coordinates; otherwise, it returns 0 (FALSE).

Syntax

db2gse.Is3d(g db2gse.ST_Geometry)

Return type

Integer

Examples

The following CREATE TABLE statement creates the THREED_TEST table, which has two columns: the GID column of type integer and the G1 geometry column.

CREATE TABLE THREED_TEST (gid smallint, g1 db2gse.ST_Geometry)

The INSERT statements insert two points into the THREED_TEST table. The first point does not contain Z coordinates, while the second does.

INSERT INTO THREED_TEST
VALUES(1, db2gse.ST_PointFromText('point (10 10)', db2gse.coordref()..srid(0)))
 
INSERT INTO THREED_TEST
VALUES (2, db2gse.ST_PointFromText('point z (10.92 10.12 5)', 
db2gse.coordref()..srid(0)))

The following SELECT statement lists the contents of the GID column with the results of the Is3d function. The function returns a 0 for the first row, which does not have Z coordinates, and a 1 for the second row, which does have Z coordinates.

SELECT gid, db2gse.Is3d (g1) "Is it 3d?" FROM THREED_TEST

The following result set is returned.

gid      Is it 3d?
------   ----------
     1            0
     2            1


[ Top of Page | Previous Page | Next Page ]