diff --git a/server/map/__pycache__/get_relation.cpython-311.pyc b/server/map/__pycache__/get_relation.cpython-311.pyc index 5c05e2e26388e10266f5a9b6247b53d327a24bbb..9f6bc3bbed6c8498228339e917a9df921d086870 100644 Binary files a/server/map/__pycache__/get_relation.cpython-311.pyc and b/server/map/__pycache__/get_relation.cpython-311.pyc differ diff --git a/server/map/get_relation.py b/server/map/get_relation.py index 8e240247487953ab3246b8039e1e014a9d77fb5c..d636963657d3fdf0b2a92cef87e0b6060ca8fe7d 100644 --- a/server/map/get_relation.py +++ b/server/map/get_relation.py @@ -106,15 +106,12 @@ def cut_polygon_in_two(polygon: Polygon, divisor: float, horizontal: bool): if len(split_shape) < 3: print("Not enough coordinates to create valid polygons: Split shape") split_shape = None - else: - split_shape.append(split_shape[0]) # NB: may not be necessary? # Check if the remaining_shape has enough coordinates to create a polygon if len(remaining_shape) < 3: print("Not enough coordinates to create valid polygons: Remaining shape") remaining_shape = None - else: - remaining_shape.append(remaining_shape[0]) + # Return split polygons as Shapely Polygon objects return Polygon(split_shape), Polygon(remaining_shape)