skip some problem with polygon cutting i guess

This commit is contained in:
Laura Klünder 2024-12-20 19:15:37 +01:00
parent ead3a60d08
commit f25af9588d

View file

@ -263,6 +263,9 @@ def cut_polygon_with_line(polygon: Union[Polygon, MultiPolygon, Sequence[Polygon
ring = ring[0] if len(ring) == 1 else LinearRing(ring[1].coords[:-1] + ring[0].coords[0:])
ring = cut_line_with_point(ring, last.point)
if len(ring) == 1:
continue
point_forwards = ring[1].coords[1]
point_backwards = ring[0].coords[-2]
angle_forwards = math.atan2(point_forwards[0] - last.point.x, point_forwards[1] - last.point.y)