Class ProHausdorffDistance

java.lang.Object
com.github.micycle1.geoblitz.ProHausdorffDistance

public final class ProHausdorffDistance extends Object
ProHD: Projection-based Hausdorff Distance approximation for JTS Geometry.

Intuition: the Hausdorff distance is typically determined by a small set of "extreme" points. ProHD finds candidate extreme points by projecting each geometry's sampled points onto a few informative directions (the centroid-to-centroid axis and principal-component axis/axes), keeping only the top/bottom alpha tails along each projection. It then computes the Hausdorff distance on the union of these selected points, yielding a fast underestimate of the Hausdorff distance of the sampled point sets.

Reference: Jiuzhou Fu, Luanzheng Guo, Nathan R. Tallent, Dongfang Zhao, ProHD: Projection-Based Hausdorff Distance Approximation, arXiv:2511.18207.

  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    distance(org.locationtech.jts.geom.Geometry a, org.locationtech.jts.geom.Geometry b, double alpha, double maxSegmentLength)
    Approximates the (undirected) Hausdorff distance using ProHD: keep only points that are extreme under a few projection directions (centroid axis + PCA axis), then compute Hausdorff on those reduced point sets.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • distance

      public static double distance(org.locationtech.jts.geom.Geometry a, org.locationtech.jts.geom.Geometry b, double alpha, double maxSegmentLength)
      Approximates the (undirected) Hausdorff distance using ProHD: keep only points that are extreme under a few projection directions (centroid axis + PCA axis), then compute Hausdorff on those reduced point sets.
      Parameters:
      a - non-empty geometry A
      b - non-empty geometry B
      alpha - tail fraction kept per projection direction, in (0, 0.5]. For each direction and each set of n sampled points, we keep k = max(1, floor(alpha * n)) points with the smallest projections AND k points with the largest projections (≈ 2 * alpha * n per direction, before unions across directions). Typical values: 0.01–0.1.
      maxSegmentLength - if > 0, densifies geometry segments so consecutive sample points are at most this far apart (in geometry units). If <= 0, uses only the geometry's existing vertices.
      Returns:
      the approximate Hausdorff distance