ST_MaxDistance
Name
ST_MaxDistance — Returns the 2D largest distance between two geometries in projected units.
Synopsis
float
ST_MaxDistance
(
geometry
g1
, geometry
g2
)
;
Description
Availability: 1.5.0
Examples
Basic furthest distance the point is to any part of the line
postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry); st_maxdistance ----------------- 2 (1 row) postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 2, 2 2 )'::geometry); st_maxdistance ------------------ 2.82842712474619 (1 row)