Name

ST_MaxDistance — Returns the 2-dimensional largest distance between two geometries in projected units.

Synopsis

float ST_MaxDistance(geometry g1, geometry g2);

Description

Some useful description here.

[Note]

Returns the 2-dimensional maximum distance between two linestrings 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

Examples

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)

See Also

ST_Distance, ST_LongestLine