Name

ST_IsEmpty — Tests if a geometry is empty.

Synopsis

boolean ST_IsEmpty(geometry geomA);

Description

Returns true if this Geometry is an empty geometry. If true, then this Geometry represents an empty geometry collection, polygon, point etc.

[Note]

SQL-MM вызначае вынік ST_IsEmpty(NULL) як 0, у PostGIS вяртаецца NULL.

This method implements the OGC Simple Features Implementation Specification for SQL 1.1. s2.1.1.1

This method implements the SQL/MM specification. SQL-MM 3: 5.1.7

This method supports Circular Strings and Curves.

Змены: 2.0.0 - раней дапускаўся ST_GeomFromText('GEOMETRYCOLLECTION(EMPTY)'). Цяпер гэта забаронена для лепшай адпаведнасці SQL/MM.

Examples

Code
SELECT ST_IsEmpty('GEOMETRYCOLLECTION EMPTY'::geometry);
Output
t
Code
SELECT ST_IsEmpty('POLYGON EMPTY'::geometry);
Output
t
Code
SELECT ST_IsEmpty('POLYGON((1 2,3 4,5 6,1 2))'::geometry);
Output
f
Figure
Geometry figure for visual-st-isempty-03
Code
SELECT ST_IsEmpty('POLYGON((1 2,3 4,5 6,1 2))'::geometry) = false;
Output
t
(1 row)
Figure
Geometry figure for visual-st-isempty-04
Code
SELECT ST_IsEmpty('CIRCULARSTRING EMPTY'::geometry);
Output
t