ST_IsSimple takes a geometry object and returns 1 (TRUE) if the object is simple; otherwise, it returns 0 (FALSE).
Syntax
db2gse.ST_IsSimple(g db2gse.ST_Geometry)
Return type
Integer
Examples
The following CREATE TABLE statement creates the ISSIMPLE_TEST table, which has two columns. The PID column, which is a smallint, contains the unique identifier for each row. The G1 geometry column stores the simple and non-simple geometry samples.
CREATE TABLE ISSIMPLE_TEST (pid smallint, g1 db2gse.ST_Geometry)
The following INSERT statements insert two records into the ISSIMPLE_TEST table. The first is simple because it is a linestring that does not intersect its interior. The second is non-simple because it does intersect its interior.
INSERT INTO ISSIMPLE_TEST VALUES (1, db2gse.ST_LineFromText('linestring (10 10, 20 20, 30 30)', db2gse.coordref()..srid(0))) INSERT INTO ISSIMPLE_TEST VALUES (2, db2gse.ST_LineFromText('linestring (10 10,20 20,20 30,10 30,10 20,20 10)', db2gse.coordref()..srid(0)))
The following SELECT statement and the corresponding result set shows the results of the ST_IsSimple function. The first record returns a 1 because the linestring is simple, while the second record returns a 0 because the linestring is not simple.
SELECT ST_IsSimple(g1) FROM ISSIMPLE_TEST g1 -------------- 1 0