If have two points, from which I want to create a straight LineString
object:
from shapely.geometry import Point, LineString
A = Point(0,0)
B = Point(1,1)
The Shapely manual for LineString
states:
A sequence of
Point
instances is not a valid constructor parameter. ALineString
is described by points, but is not composed of Point instances.
So if I have two points A
and B
, is there a shorter/better/easier way of creating a line AB
than my current "best" guess...
AB = LineString(tuple(A.coords) + tuple(B.coords))
... which looks rather complicated. Is there an easier way?
With Shapely 1.3.2, the above statement from the manual is no longer correct. So from now on,
AB = LineString([A, B])
works!