ST_IsEmpty rileva un oggetto di geometria e restituisce 1 (TRUE) se è vuoto; altrimenti, restituisce 0 (FALSE).
Sintassi
db2gse.ST_IsEmpty(g db2gse.ST_Geometry)
Tipo di ritorno
Integer
Esempi
La seguente istruzione CREATE TABLE crea la tabella EMPTY_TEST che contiene due colonne. La colonna GEOTYPE memorizza il tipo di dati della classe secondaria memorizzata nella colonna G1.
CREATE TABLE EMPTY_TEST (geotype varchar(20), g1 db2gse.ST_Geometry)
Le seguenti istruzioni INSERT inseriscono due record per le classe secondarie di geometria il punto, la stringa lineare e il poligono. Un record è vuoto e l'altro non è vuoto.
INSERT INTO EMPTY_TEST VALUES('Point', db2gse.ST_PointFromText('point (10.02 20.01)', db2gse.coordref()..srid(0))) INSERT INTO EMPTY_TEST VALUES('Point', db2gse.ST_PointFromText('point empty', db2gse.coordref()..srid(0))) INSERT INTO EMPTY_TEST VALUES('Linestring', db2gse.ST_LineFromText('linestring (10.02 20.01, 10.32 23.98, 11.92 25.64)', db2gse.coordref()..srid(0))) INSERT INTO EMPTY_TEST VALUES('Linestring', db2gse.ST_LineFromText('linestring empty', db2gse.coordref()..srid(0))) INSERT INTO EMPTY_TEST VALUES('Polygon', db2gse.ST_PolyFromText('polygon ((10.02 20.01,11.92 35.64, 25.02 34.15,19.15 33.94,10.02 20.01))', db2gse.coordref()..srid(0))) INSERT INTO EMPTY_TEST VALUES('Polygon', db2gse.ST_PolyFromText('polygon empty', db2gse.coordref()..srid(0)))
La seguente istruzione SELECT e la serie di risultati corrispondente mostrano il tipo di geometria dalla colonna GEOTYPE e i risultati della funzione ST_IsEmpty.
SELECT geotype, db2gse.ST_IsEmpty(g1) "It is empty" FROM EMPTY_TEST GEOTYPE It is empty -------------------- ----------- ST_Point 0 ST_Point 1 ST_Linestring 0 ST_Linestring 1 ST_Polygon 0 ST_Polygon 1 6 record(s) selected.