An “empty” feature is one with a point set that coincides with the empty set; not None
, but like set([])
. Empty features can be created by calling the various constructors with no arguments. Almost no operations are supported by empty features.
空要素是指其点集为空集,不是None,而是像set([])。空要素可以通过调用各种没有参数的构造函数来创建。空要素几乎不支持任何操作。
>>> line = LineString()
>>> line.is_empty
True
>>> line.length
0.0
>>> line.bounds
()
>>> line.coords
[]
The coordinates of a empty feature can be set, after which the geometry is no longer empty.
可以对空要素变量赋值,之后几何要素就不再是空了。
>>> line.coords = [(0, 0), (1, 1)]
>>> line.is_empty
False
>>> line.length
1.4142135623730951
>>> line.bounds
(0.0, 0.0, 1.0, 1.0)