org.apache.lucene.spatial3d.geom

## Interface GeoDistance

- All Superinterfaces:
    Membership
  All Known Subinterfaces:
    GeoCircle, GeoDistanceShape, GeoPath, GeoPointShape
  All Known Implementing Classes:
    GeoBaseDistanceShape

      public interface GeoDistance
      extends Membership

  An implementer of this interface is capable of computing the described "distance" values, which are meant to provide both actual distance values, as well as distance estimates that can be computed more cheaply.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default double` | `computeDeltaDistance(DistanceStyle distanceStyle, double x, double y, double z)` Compute the shape's delta distance given a point.
    `default double` | `computeDeltaDistance(DistanceStyle distanceStyle, GeoPoint point)` Compute the shape's delta distance given a point.
    `double` | `computeDistance(DistanceStyle distanceStyle, double x, double y, double z)` Compute this shape's internal "distance" to the GeoPoint.
    `default double` | `computeDistance(DistanceStyle distanceStyle, GeoPoint point)` Compute this shape's internal "distance" to the GeoPoint.

    - ### Methods inherited from interface org.apache.lucene.spatial3d.geom.Membership

      `isWithin, isWithin`

- - ### Method Detail

    - #### computeDistance

          default double computeDistance(DistanceStyle distanceStyle,
                                         GeoPoint point)

      Compute this shape's internal "distance" to the GeoPoint. Implementations should clarify how this is computed when it's non-obvious. A return value of Double.POSITIVE_INFINITY should be returned for points outside of the shape.
      Parameters:
        `distanceStyle` - is the distance style.
        `point` - is the point to compute the distance to.
      Returns:
        the distance.

    - #### computeDistance

          double computeDistance(DistanceStyle distanceStyle,
                                 double x,
                                 double y,
                                 double z)

      Compute this shape's internal "distance" to the GeoPoint. Implementations should clarify how this is computed when it's non-obvious. A return value of Double.POSITIVE_INFINITY should be returned for points outside of the shape.
      Parameters:
        `distanceStyle` - is the distance style.
        `x` - is the point's unit x coordinate (using U.S. convention).
        `y` - is the point's unit y coordinate (using U.S. convention).
        `z` - is the point's unit z coordinate (using U.S. convention).
      Returns:
        the distance.

    - #### computeDeltaDistance

          default double computeDeltaDistance(DistanceStyle distanceStyle,
                                              GeoPoint point)

      Compute the shape's delta distance given a point. This is defined as the distance that someone traveling the "length" of the shape would have to go out of their way to include the point. For some shapes, e.g. paths, this makes perfect sense. For other shapes, e.g. circles, the "length" of the shape is zero, and the delta is computed as the distance from the center to the point and back. A return value of Double.POSITIVE_INFINITY should be returned for points outside of the shape.
      Parameters:
        `distanceStyle` - is the distance style.
        `point` - is the point to compute the distance to.
      Returns:
        the distance.

    - #### computeDeltaDistance

          default double computeDeltaDistance(DistanceStyle distanceStyle,
                                              double x,
                                              double y,
                                              double z)

      Compute the shape's delta distance given a point. This is defined as the distance that someone traveling the "length" of the shape would have to go out of their way to include the point. For some shapes, e.g. paths, this makes perfect sense. For other shapes, e.g. circles, the "length" of the shape is zero, and the delta is computed as the distance from the center to the point and back. A return value of Double.POSITIVE_INFINITY should be returned for points outside of the shape.
      Parameters:
        `distanceStyle` - is the distance style.
        `x` - is the point's unit x coordinate (using U.S. convention).
        `y` - is the point's unit y coordinate (using U.S. convention).
        `z` - is the point's unit z coordinate (using U.S. convention).
      Returns:
        the distance.

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.