Skip to content

ST_MaxDistance

Returns the maximum distance between any pair of points in two geometries.

Usage

double ST_MaxDistance(geomA: geometry, geomB: geometry)

Arguments

  • geomA (geometry): Input geometry
  • geomB (geometry): Input geometry

Examples

SELECT ST_MaxDistance(
    ST_GeogFromText('POLYGON ((10 10, 11 10, 10 11, 10 10))'),
    ST_GeogFromText('POLYGON ((0 0, 1 0, 0 1, 0 0))')
) AS val;
┌────────────────────┐
│         val        │
│       float64      │
╞════════════════════╡
│ 1648412.0099053395 │
└────────────────────┘