找不到Shapely parallel_offset

2024-05-29 11:24:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用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)

我得到:

^{pr2}$

我做错什么了?在


Tags: fromimport示例parallelmatplotliblineleftoffset
2条回答

此功能有两个需要满足的要求:

  • 形状(>;=1.2.8
  • 地理位置=3.2.0

我已经复制了'你的代码行'如下,这也是工作。在

from shapely.geometry import LineString
line=LineString([(0,0),(0,1),(1,1),(2,0)])
offset = line.parallel_offset(1,'left',join_style=2)

I got the result as in the figure。在

原因可能是安装错误,请用更新版本重新安装。在

相关问题 更多 >

    热门问题