MultiLineStrings
================

Initialization
--------------

  >>> from shapely.geometry import LineString, MultiLineString

From coordinate tuples

  >>> geom = MultiLineString( (((1.0, 2.0), (3.0, 4.0)),) )
  >>> geom # doctest: +ELLIPSIS
  <shapely.geometry.multilinestring.MultiLineString object at ...>
  >>> len(geom.geoms)
  1
  >>> geom.wkt
  'MULTILINESTRING ((1.0000000000000000 2.0000000000000000, 3.0000000000000000 4.0000000000000000))'

Construct from a numpy array

  >>> from numpy import array
  >>> geom = MultiLineString( [array(((0.0, 0.0), (1.0, 2.0)))] )
  >>> geom # doctest: +ELLIPSIS
  <shapely.geometry.multilinestring.MultiLineString object at ...>
  >>> len(geom.geoms)
  1
  >>> geom.wkt
  'MULTILINESTRING ((0.0000000000000000 0.0000000000000000, 1.0000000000000000 2.0000000000000000))'

From lines

  >>> a = LineString(((1.0, 2.0), (3.0, 4.0)))
  >>> ml = MultiLineString([a])
  >>> len(ml.geoms)
  1
  >>> print ml.wkt
  MULTILINESTRING ((1.0000000000000000 2.0000000000000000, 3.0000000000000000 4.0000000000000000))

From another multi-line

  >>> ml2 = MultiLineString(ml)
  >>> len(ml2.geoms)
  1
  >>> print ml2.wkt
  MULTILINESTRING ((1.0000000000000000 2.0000000000000000, 3.0000000000000000 4.0000000000000000))


Sub-geometry Access
-------------------

  >>> geom.geoms[0] # doctest: +ELLIPSIS
  <shapely.geometry.linestring.LineString object at ...>
  >>> geom.geoms[0].wkt
  'LINESTRING (0.0000000000000000 0.0000000000000000, 1.0000000000000000 2.0000000000000000)'
  >>> geom.geoms[1]
  Traceback (most recent call last):
  ...
  IndexError: index out of range

Geo interface
-------------

  >>> geom.__geo_interface__
  {'type': 'MultiLineString', 'coordinates': (((0.0, 0.0), (1.0, 2.0)),)}

Adapter
-------

  >>> from shapely.geometry import asMultiLineString

  Adapt a sequence of Numpy arrays to a multilinestring

  >>> a = [ array(((1.0, 2.0), (3.0, 4.0))) ]
  >>> geoma = asMultiLineString(a)
  >>> geoma.context
  [array([[ 1.,  2.],
         [ 3.,  4.]])]

  >>> geoma.wkt
  'MULTILINESTRING ((1.0000000000000000 2.0000000000000000, 3.0000000000000000 4.0000000000000000))'

