PostGISGeometry Processing

ST_MaximumInscribedCircle

What is ST_MaximumInscribedCircle?

ST_MaximumInscribedCircle is a PostGIS function that computes the largest circle that fits entirely inside a polygon. It returns a composite record containing the circle's centre point, the nearest point on the polygon boundary, and the radius.

SQL
ST_MaximumInscribedCircle(geometry geom) → record (center geometry, nearest geometry, radius double precision)

The centre of the inscribed circle is the "pole of inaccessibility" — the point inside the polygon farthest from any boundary.

When would you use ST_MaximumInscribedCircle?

Use ST_MaximumInscribedCircle for label placement (the centre is the visually most "inside" location), for finding the widest point of an irregular shape, or for deriving a representative radius for a region. It is the right answer to "where is the most central point inside this polygon?" when the centroid falls outside or near the boundary.

SQL
1SELECT name, (circle).center AS label_point, (circle).radius
2FROM (
3  SELECT name, ST_MaximumInscribedCircle(geom) AS circle
4  FROM lakes
5) t;

FAQs

How is this different from ST_PointOnSurface?

ST_PointOnSurface returns any point guaranteed to lie inside the polygon, computed cheaply. ST_MaximumInscribedCircle returns the point that is maximally inside — the one farthest from every boundary. Use it when you need the visual centre for labelling a concave or branching shape where ST_PointOnSurface might pick a suboptimal location.

What units is the radius in?

The radius is in the units of the input geometry's SRID. For projected CRSs that is typically metres; for EPSG:4326 it is degrees. Cast to geography is not supported here — reproject to a metric CRS first if you need metre-accurate radii.

How precise is the result?

The algorithm is iterative and has an internal tolerance — it converges quickly on reasonable polygons. For extreme inputs (very thin slivers, polygons with near-collinear vertices) the result can be slightly off; simplify or densify the polygon first if precision matters.

Does ST_MaximumInscribedCircle work on MultiPolygons?

Yes. The function evaluates each component polygon and returns the circle for the component that admits the largest inscribed circle — not the union. For per-part circles, iterate with ST_Dump first.