Skip to main content
Returns the minimum width of a geometry, defined as the minimum distance between two parallel lines that enclose the geometry. This is the length of the shortest side of the rectangle returned by ST_MinimumWidthRectangle. For degenerate geometries like points and lines, the minimum width is 0. ST_MinimumWidth

Signatures

ST_MinimumWidth(geom: Geometry)

Parameters

geom
Geometry
required
The input geometry.

Return type

A numeric value.

Example

For a right triangle (3-4-5), the minimum width is the altitude to the hypotenuse (~2.57), which is narrower than the shortest side (3):
SELECT ST_MinimumWidth(ST_GeomFromWKT('POLYGON ((0 0, 5 0, 0 3, 0 0))'))
2.5724786474424154