Skip to main content
Returns the minimum-width rotated rectangle enclosing a geometry. Unlike ST_OrientedEnvelope, which minimizes the area of the enclosing rectangle, this function minimizes the width (shortest side). The result may differ from ST_OrientedEnvelope for geometries where the minimum-area and minimum-width orientations diverge (see example below). Degenerate inputs may result in a Point or LineString being returned. ST_MinimumWidthRectangle

Signatures

Parameters

geom
Geometry
required
The input geometry.

Return type

The resulting geometry.

Examples

For a right triangle, ST_MinimumWidthRectangle tilts the rectangle along the hypotenuse to minimize the width, while ST_OrientedEnvelope keeps it axis-aligned to minimize area:
Compare with ST_OrientedEnvelope on the same input: