Returns the vertex-only (discrete) Hausdorff distance between the given 2 geometries. Both geometries are treated purely as sets of vertices: for every vertex of one geometry the distance to the nearest vertex of the other geometry is computed, and the function returns the largest such distance found in either direction.
This differs from ST_HausdorffDistance, which measures each vertex against the other geometry’s segments and can optionally densify those segments. Because segment interiors are ignored here, ST_HausdorffDistanceVertices is never smaller than ST_HausdorffDistance for the same pair of geometries, and it takes no densityFraction parameter.
If either geometry is empty, null is returned.
Even though the function accepts 3D geometry, the z ordinate is ignored and the computed distance is equivalent to the geometries not having the z ordinate.
Signatures
Parameters
Return type
Examples
The vertices of the second line sit 1 and 2 units above the first line, but their nearest vertex is an endpoint of that line, so the result is sqrt(29) rather than the segment-based sqrt(26):