ST_MaxDistance — Returns the 2D largest distance between two geometries in projected units.
float ST_MaxDistance(
geometry g1, geometry g2)
;
Returns the 2-dimensional maximum distance between two geometries in projected units. If g1 and g2 is the same geometry the function will return the distance between the two vertices most far from each other in that geometry. |
Availability: 1.5.0
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)