我正在尝试使用 Shapely parallel_offset
,但似乎没有找到它。我已包含示例中找到的导入,但它无法识别 parallel_offset
。
from matplotlib import pyplot
from shapely.geometry import LineString
from descartes import PolygonPatch
line=LineString([(0,0),(0,1),(1,1),(2,0)])
offset = line.parallel_offset(1,'left',join_style=2)
我得到:
$ python parallel_offset.py
Traceback (most recent call last):
File "parallel_offset.py", line 6, in <module>
offset = line.parallel_offset(1,'left',join_style=2)
AttributeError: 'LineString' object has no attribute 'parallel_offset'
我做错了什么?
最佳答案
此功能有两个需要满足的要求:
- 身材匀称 >= 1.2.8
- GEOS >= 3.2.0
关于python - 未找到 Shapely parallel_offset,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15161821/