Question: I'm trying to divide a polygon grid into multiple smaller polygons basis their intersection with a `MultiLineString` using Shapely. Following code works good for `LineString` but not for intersecting `MultiLineString`.

```
from shapely.geometry import Polygon, LineString, MultiLineString
from shapely.ops import linemerge, unary_union, polygonize

poly = Polygon([(0,0), (4,0), (4,4), (0,4)])
lines = [LineString([(0,1), (1,1), (2,1), (5,1)]), LineString([(1,1), (2,1), (3,3), (5,3)])]

multi_line = MultiLineString(lines)
merged = linemerge([poly.boundary, multi_line])
# borders = unary_union(merged)
# polygons = polygonize(borders)

```

While performing `linemerge` operation, it throws an error - 

`NotImplementedError: Multi-part geometries do not provide a coordinate sequence`

One possible reason could be that I can't do `merged_line.coords` for intersecting lines like I do for normal linestring. But still I am not able to solve it.

Any thoughts on solving or any other alternative to divide a `Polygon` basis intersection with `MultiLineString`?

Answer: 
You may not need to use this `MultiLineString` variable for what you aim at. This works:

```
from shapely.geometry import Polygon, LineString
from shapely.ops import linemerge, unary_union, polygonize

poly = Polygon([(0,0), (4,0), (4,4), (0,4)])
lines = [LineString([(0,1), (1,1), (2,1), (5,1)]), LineString([(1,1), (2,1), (3,3), (5,3)])]

lines.append(poly.boundary)
lines = unary_union(lines)
lines = linemerge(lines)
polygons = polygonize(lines)

```
I might misinterpret your question, but if you want to treat each line in the list of lines separately you can replace

```
merged = linemerge([poly.boundary, multi_line])

```

with

```
merged = linemerge([poly.boundary, *lines])

```

and it should work.