class MultiPoint(points)
The MultiPoint constructor takes a sequence of (x, y[, z ])
point tuples.
复合点构造函数接收一系列(x, y[, z ])点元祖。
A MultiPoint has zero area and zero length.
MultiPoint的面积和长度都是零。
>>> from shapely.geometry import MultiPoint
>>> points = MultiPoint([(0.0, 0.0), (1.0, 1.0)])
>>> points.area
0.0
>>> points.length
0.0
Its x-y bounding box is a (minx, miny, maxx, maxy)
tuple.
其边界是一个元组(minx, miny, maxx, maxy)。
>>> points.bounds
(0.0, 0.0, 1.0, 1.0)
Members of a multi-point collection are accessed via the geoms
property or via the iterator protocol using in
or list()
.
其成员可以通过geoms属性或通过in、list()的迭代器协议来访问。
>>> import pprint
>>> pprint.pprint(list(points.geoms))
[<shapely.geometry.point.Point object at 0x...>,
<shapely.geometry.point.Point object at 0x...>]
>>> pprint.pprint(list(points))
[<shapely.geometry.point.Point object at 0x...>,
<shapely.geometry.point.Point object at 0x...>]
The constructor also accepts another MultiPoint instance or an unordered sequence of Point instances, thereby making copies.
其构造函数也接受另一个MultiPoint实例或一个无序的Point实例序列,从而得到一个副本。
>>> MultiPoint([Point(0, 0), Point(1, 1)])
<shapely.geometry.multipoint.MultiPoint object at 0x...>