I'm converting a KML file to a polygon stored on my database thanks to RGeo
I need the centroid: @area.centroid
and I would like to find the approximative radius on my shape.
I don't know if it's possible. My database field is a geometry
. That means I can store polygons AND multi-polygons. The type of my area is RGeo::Geos::CAPIMultiPolygonImpl
Finally I think I need the check if the area is a simple polygon or a multiple. If it's a simple one, I would like to find the radius. Else nothing.
Thank you for your help !
I finally did like below:
exterior_ring
function) and the centroidBy the way I don't know why I had to take the minimum. It was to adapt my scale. I don't really understand how the centroid of a polygon (which could have really strange shape) can be found.
Anyway, it's working thanks to the 3 steps written previously.