This topic describes the ST_MinimumClearance function. This function returns the minimum clearance of a geometry object.
Syntax
float ST_MinimumClearance(geometry g);
Parameters
Parameter | Description |
---|---|
g | The geometry object that you want to specify. |
Description
- The minimum clearance of a geometry is the smallest distance by which a vertex of the geometry can be moved to produce an invalid geometry. The minimum clearance of a geometry can be considered as a quantitative measure of the robustness of the geometry. A larger minimum clearance indicates a higher robustness.
- If a geometry has a minimum clearance of e, the following conclusions can be made:
- The distance between any two different vertices of the geometry is greater than e.
- The distance between any vertex of the geometry and a line that is not an end point is greater than or equal to e.
- If a geometry does not have a minimum clearance, this function returns Infinity. For example, this function returns Infinity for a single point or for a MultiPoint whose points are identical.
Examples
Query the minimum clearance of a geometry object by using the default parameter settings.
SELECT ST_MinimumClearance('POLYGON((0 0, 1 0,1 1e-4, 0 0))');
st_minimumclearance
---------------------
9.99999995e-05
(1 row)