Was this helpful?
IsEmpty
ISEMPTY(g Geometry)
Alias: ST_ISEMPTY
Returns 1 if g contains no points; returns 0 otherwise. Returns ‑1 if there is an error.
Result type: integer
Examples:
g is the intersection of two polygons that have no shared points:
SELECT ISEMPTY(INTERSECTION(POLYFROMTEXT('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))'), POLYFROMTEXT('POLYGON((8 8, 10 8, 10 10, 8 10, 8 8))')));
-------------
col1
-------------
1
-------------
g is an empty geometry collection:
SELECT ISEMPTY(GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION EMPTY'));
-------------
col1
-------------
1
-------------
g is a linestring:
SELECT ISEMPTY(LINEFROMTEXT('LINESTRING(0 0, 10 10)'));
-------------
col1
-------------
0
-------------
Last modified date: 04/03/2024