Interface HPRtreeX.DistanceToItem<T>

Type Parameters:
T - item type stored in the tree
Enclosing class:
HPRtreeX<T>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface HPRtreeX.DistanceToItem<T>
Functional interface used to compute the distance between a query coordinate and an item stored in the tree.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    distance(org.locationtech.jts.geom.Coordinate q, T item)
    Computes the scalar distance from the query point q to the supplied item.
  • Method Details

    • distance

      double distance(org.locationtech.jts.geom.Coordinate q, T item)
      Computes the scalar distance from the query point q to the supplied item.

      Implementations should return a non-negative value. The tree uses these distances for ranking candidates during nearest-neighbor search; for best performance the function should be inexpensive to compute.

      Parameters:
      q - the query coordinate
      item - the item whose distance to q should be computed
      Returns:
      the distance from q to item (must be >= 0)