I'm using QGIS. I have a layer that contains ellipse-like polygons as in the image. I need to convert them to ellipses. They come from a different data sources. These are all actually regular shapes that originate from ellipses. Therefore, I think, somehow, an ellipse containing all vertices can be formed. But an approximate ellipse also works for me.

enter image description here

I use Smooth tool using different parameter values. But it doesn't give expected ellipses (brown polygons in the next image). And they are not bounding ellipses. If all ellipses had the same size, the Smooth + Buffer tools combination or "outer (positive) then inner(negative) buffer" could be work.

enter image description here

How can I convert them to proper (bounding) ellipses?

  • 1
    Do you want an ellipse that goes through the vertex points of the polygons? In which case five vertex locations are sufficient to create a unique ellipse through them using planar geometry. See "Conic through 5 points" here: geogebra.org/classic
    – Spacedman
    May 2 at 17:48
  • @Spacedman An approximate result works for me. All shapes are actually well shaped like a simplified ellipse which has 16-20-24... vertices. Therefore, somehow an ellipse containing every vertices can be formed. May 2 at 18:01
  • @CyrilMikhalchenko This is a good approach. Thank you. However, I think of using Python as a future work. May 3 at 11:39
  • @CyrilMikhalchenko there may be a function for a regular shape, I hope. I will check later. May 3 at 11:43
  • +10, that's a good question and a new geo-tool could come out of it... May 5 at 18:35
  1. Create Oriented minimum bounding box

  2. From these, create elipses with values from the attribute table calculated in the first step: make_ellipse(centroid ($geometry), "height"/2, "width"/2 ,"angle")

Screenshot: here with segements=200 for a smooth ellipse (blue): enter image description here


You could try something like:


45 is the number of segments, change that to whatever smoothness you wish.

Or alternatively if the main_angle() does not match your needs, try something like:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.