PostGIS

ST_IsEmpty

Prev

8.4. Geometry Accessors

Next

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 defines the result of ST_IsEmpty(NULL) to be 0, while PostGIS returns NULL.

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

check This method supports Circular Strings and Curves

Warning

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

Examples

SELECT ST_IsEmpty(ST_GeomFromText('GEOMETRYCOLLECTION EMPTY'));
 st_isempty
------------
 t
(1 row)

 SELECT ST_IsEmpty(ST_GeomFromText('POLYGON EMPTY'));
 st_isempty
------------
 t
(1 row)

SELECT ST_IsEmpty(ST_GeomFromText('POLYGON((1 2, 3 4, 5 6, 1 2))'));

 st_isempty
------------
 f
(1 row)

 SELECT ST_IsEmpty(ST_GeomFromText('POLYGON((1 2, 3 4, 5 6, 1 2))')) = false;
 ?column?
----------
 t
(1 row)

 SELECT ST_IsEmpty(ST_GeomFromText('CIRCULARSTRING EMPTY'));
  st_isempty
------------
 t
(1 row)

Prev

Up

Next

ST_IsCollection

Home

ST_IsPolygonCCW