ST_IsEmpty
Tests whether a geometry is empty (contains no points).
Syntax
ST_IsEmpty(geometry)
Parameters
| Parameter | Type | Description |
|---|---|---|
| geometry | Geometry | Input geometry to test |
Returns
| Type | Description |
|---|---|
| Boolean | True if geometry is empty, false otherwise |
Examples
Empty Geometry
SELECT ST_IsEmpty(ST_GeomFromText('POINT EMPTY'));
-- Returns: true
Non-Empty Point
SELECT ST_IsEmpty(ST_Point(0, 0));
-- Returns: false
Empty GeometryCollection
SELECT ST_IsEmpty(ST_GeomFromText('GEOMETRYCOLLECTION EMPTY'));
-- Returns: true
Filter Non-Empty Geometries
SELECT * FROM features
WHERE NOT ST_IsEmpty(geom);
Notes
- Empty geometries are valid but contain no coordinates
- Result of some operations may be empty (e.g., intersection of non-overlapping polygons)
- Empty geometries have zero area and length
See Also
- ST_IsValid - Test geometry validity
- ST_NumPoints - Count points in geometry