I have a group of Polygon
objects and need to iterate through each of their edges in a repeatable way. My preferred method is anti-clockwise from the closest point to the lower left corner of the bounding box.
I can ensure the polygon points are anti-clockwise by:
polygon = shapely.geometry.polygon.orient(polygon)
I can find my desired starting point using:
polygon = shapely.geometry.Polygon(...)
lower_left = shapely.geometry.Point(bbox[:2])
nearest_pt = min(self.polygon.exterior.coords,
key=lambda x: shapely.geometry.Point(x).distance(lower_left))
My question is how can I make the LinearRing
of the Polygon
object start from that corner?