要么我遗漏了什么——我在文档中看不到它——或者它不是 Shapely 的内置:我如何确定 LineString 是否复杂,即自相交?
请您参考如下方法:
它的基类 class shapely.geometry.base.BaseGeometry 有一个选项 is_simple,表示
True if the geometry is simple, meaning that any self-intersections are only at boundary points, else False
http://toblerity.org/shapely/shapely.geometry.html#shapely.geometry.base.BaseGeometry
line = LineString([(0, 0), (1, 1)])
line.is_simple
