Interface GeoDistance

    • 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.