The MultiLineString constructor takes a sequence of line-like sequences or objects.
MultiLineString构造函数接收线性元祖序列或对象。
(Source code, png, hires.png, pdf)
A MultiLineString has zero area and non-zero length.
MultiLineString的面积为零,长度不为零。
>>> from shapely import MultiLineString
>>> coords = [((0, 0), (1, 1)), ((-1, 0), (1, 0))]
>>> lines = MultiLineString(coords)
>>> lines.area
0.0
>>> lines.length
3.414213562373095
Its x-y bounding box is a (minx, miny, maxx, maxy)
tuple.
其边界是一个元组(minx, miny, maxx, maxy)。
>>> lines.bounds
(-1.0, 0.0, 1.0, 1.0)
Its members are instances of LineString and are accessed via the geoms
property.
其成员可以通过geoms属性来访问。
>>> len(lines.geoms)
2
>>> print(list(lines.geoms))
[<LINESTRING (0 0, 1 1)>, <LINESTRING (-1 0, 1 0)>]
The constructor also accepts another instance of MultiLineString or an unordered sequence of LineString instances, thereby making copies.
构造函数也接受另一个MultiLineString的实例或LineString实例的无序序列,从而得到一个副本。
>>> MultiLineString(lines)
<MULTILINESTRING ((0 0, 1 1), (-1 0, 1 0))>
>>> MultiLineString(lines.geoms)
<MULTILINESTRING ((0 0, 1 1), (-1 0, 1 0))>