def lines_touch(one, other, buf=10e-5):
"""Predict the connection of two lines
"""
a = MultiPoint([one.coords[0], one.coords[-1]]).buffer(buf)
b = MultiPoint([other.coords[0], other.coords[-1]]).buffer(buf)
return one.intersects(b) or other.intersects(a)
评论列表
文章目录