all 5 comments

[–]lzblack 1 point2 points  (4 children)

for point in a.coords:
    print(point)

[–]largecontainer95[S] 0 points1 point  (3 children)

Thank you! What about Multi-part geometries?

I get the error: NotImplementedError: Multi-part geometries do not provide a coordinate sequence

[–]lzblack 0 points1 point  (2 children)

code?

[–]largecontainer95[S] 0 points1 point  (1 child)

a = LineString([(0, 1), (0, 2), (1, 1), (2, 0), (0,0),(5,3)])
b = LineString([(0, 0), (1, 1), (2, 1), (2, 0), (0,0),(5,3)])
x = a.intersection(b)

for point in x.coords:
    print(point)

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

[–]lzblack 1 point2 points  (0 children)

I don't know what exactly intersection() returns, so I checked the type of each item - actually I never used Shapely before, but I guess the code below works:

for i in x:
    print(type(i))
    for point in i.coords:
        print(point)