ST_IsEmpty — Tests if a geometry is empty.
boolean ST_IsEmpty(geometry geomA);
Returns true if this Geometry is an empty geometry. If true, then this Geometry represents an empty geometry collection, polygon, point etc.
|
|
|
SQL-MM defines the result of ST_IsEmpty(NULL) to be 0, while PostGIS returns 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.
Changed: 2.0.0 In prior versions of PostGIS ST_GeomFromText('GEOMETRYCOLLECTION(EMPTY)') was allowed. This is now illegal in PostGIS 2.0.0 to better conform with SQL/MM standards
SELECT ST_IsEmpty('GEOMETRYCOLLECTION EMPTY'::geometry);
t
SELECT ST_IsEmpty('POLYGON EMPTY'::geometry);
t
SELECT ST_IsEmpty('POLYGON((1 2,3 4,5 6,1 2))'::geometry);
f
SELECT ST_IsEmpty('POLYGON((1 2,3 4,5 6,1 2))'::geometry) = false;
t (1 row)
SELECT ST_IsEmpty('CIRCULARSTRING EMPTY'::geometry);
t