I'm attempting to calculate the radii required to cover a set of polygons in a shapefile; for example, given any number of neighborhood polygon boundaries, I'd like to calculate the smallest circle radius required to cover each.

Is there a way to calculate a minimum bounding circle in QGIS, given a polygon? Otherwise, is there a way to do so in python?

Edit: I'm using QGIS 2.18 on MacOS.

  • Do you have access to QGIS 3.0 (2.99)? - Minimum bounding geometry tool. – Kazuhito Feb 13 '18 at 22:23
  • @Kazuhito I'm running QGIS 2.18 on MacOS. Do you know if it's possible to install 2.99? I've always used KyngChaos' ports, and the latest seems to be 2.18. – scrollex Feb 13 '18 at 22:27

Sorry, only thing I can think of, with QGIS 2.18, is geometry generator.

Assuming you have convex hull polygons for each set of polygons;


This takes maximum distance from centroid (*) of each convex hull to create a circle.

(*) I used point_on_surface in lieu of centroid.

If you want it permanent (I mean, not only for display), please run the same expression in the Field Calculator using the Update existing field on <geometry> column.

| improve this answer | |

QGIS 3.0 (or 2.99) can calculate this directly, using either the "Minimum enclosing circles" (for a circle for each individual feature) or the "Minimum Bounding Geometry" algorithm with "geometry type" as "minimum enclosing circle" (for the entire layer at once)

| improve this answer | |

If you have access to PostGIS you have a function called ST_MinimumBoundingCircle. With SQL you can fit it to run on a single feature, several features controlled by an attribute, or on all the features of the entire layer.


Four demo polygons:

enter image description here

  row_number() OVER() AS id,
  ST_MinimumBoundingCircle(geom) As geom

Gives one circle for each polygon:

enter image description here


  row_number() OVER() AS id,
  ST_MinimumBoundingCircle(ST_Collect(geom)) As geom

Gives a circle based on the type attribute:

enter image description here

The line:

row_number() OVER() AS id

Is for QGIS to have an unique integer column for rendering the layer.

Demo made with DB Manager plugin for QGIS.

| improve this answer | |

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.