Search code examples
pythonpolygonshapely

How to count a radius of a polygon


I have a Polygon (shapely) and the centroid of this Polygon (with longitude and latitude). Is there any way to count radius of the Polygon?


Solution

  • There are two cases:

    • You have a regular polygon, meaning all sides are equally long and the angles between sides is constant throughout the polygon. In this case you draw the smallest circle that touches all corner points of the polygon. The radius of this circle is said to also be the radius of your polygon.
    • For an irregular polygon it is a bit harder to get a grasp on the radius. Similar to the case above you could take the radius of the smallest circle in which the polygon fits.