ST_IsEmpty — 测试几何图形是否为空。
boolean
ST_IsEmpty
(
geometry
geomA
)
;
如果此几何图形为空几何图形,则返回True。如果为真,则此几何图形表示空的几何图形集合、多边形、点等。
![]() |
|
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
![]() |
|
已更改:在以前版本的PostGIS ST_GeomFromText(‘GEOMETRYCOLLECTION(Empty)’)中允许2.0.0。现在,为了更好地符合SQL/MM标准,这在PostGIS 2.0.0中是非法的 |
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)