赞
踩
1.引入shapely
from shapely.geometry import Point, Polygon, LineString
import matplotlib.pyplot as plt
2.线的缓冲区
# 定义线段
line = LineString([(0.1, 0.1), (2, 3)])
# 生成缓冲区
buffer = line.buffer(0.5)
3.显示:
x1,y1=line.xy
x2,y2=buffer.boundary.xy
plt.figure()
plt.plot(y1,x1)
plt.plot(x2,y2)
plt.show()
4.显示结果
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。