org.apache.lucene.spatial3d.geom

## Class GeoBaseDistanceShape

- java.lang.Object
- - org.apache.lucene.spatial3d.geom.BasePlanetObject
  - - org.apache.lucene.spatial3d.geom.GeoBaseShape
    - - org.apache.lucene.spatial3d.geom.GeoBaseMembershipShape
      - - org.apache.lucene.spatial3d.geom.GeoBaseDistanceShape

- All Implemented Interfaces:
    GeoDistance, GeoDistanceShape, GeoMembershipShape, GeoOutsideDistance, GeoShape, Membership

      public abstract class GeoBaseDistanceShape
      extends GeoBaseMembershipShape
      implements GeoDistanceShape

  Distance shapes have capabilities of both geohashing and distance computation (which also includes point membership determination).
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject

      `planetModel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoBaseDistanceShape(PlanetModel planetModel)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `computeDistance(DistanceStyle distanceStyle, double x, double y, double z)` Compute this shape's internal "distance" to the GeoPoint.
    `double` | `computeDistance(DistanceStyle distanceStyle, GeoPoint point)` Compute this shape's internal "distance" to the GeoPoint.
    `protected abstract double` | `distance(DistanceStyle distanceStyle, double x, double y, double z)` Called by a `computeDistance` method if X/Y/Z is not within this shape.
    `protected abstract void` | `distanceBounds(Bounds bounds, DistanceStyle distanceStyle, double distanceValue)` Called by a `getDistanceBounds` method if distanceValue is not Double.POSITIVE_INFINITY.
    `void` | `getDistanceBounds(Bounds bounds, DistanceStyle distanceStyle, double distanceValue)` Compute a bound based on a provided distance measure.
    `boolean` | `isWithin(Vector point)` Check if a point is within this shape.

    - ### Methods inherited from class org.apache.lucene.spatial3d.geom.GeoBaseMembershipShape

      `computeOutsideDistance, computeOutsideDistance, outsideDistance`

    - ### Methods inherited from class org.apache.lucene.spatial3d.geom.GeoBaseShape

      `getBounds`

    - ### Methods inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject

      `equals, getPlanetModel, hashCode`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

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

      `getBounds, getEdgePoints, intersects`

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

      `computeOutsideDistance, computeOutsideDistance`

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

      `isWithin`

- - ### Constructor Detail

    - #### GeoBaseDistanceShape

          public GeoBaseDistanceShape(PlanetModel planetModel)

      Constructor.
      Parameters:
        `planetModel` - is the planet model to use.

  - ### Method Detail

    - #### isWithin

          public boolean isWithin(Vector point)

      Description copied from interface: `Membership`
      Check if a point is within this shape.
      Specified by:
        `isWithin` in interface `Membership`
      Overrides:
        `isWithin` in class `GeoBaseMembershipShape`
      Parameters:
        `point` - is the point to check.
      Returns:
        true if the point is within this shape

    - #### computeDistance

          public double computeDistance(DistanceStyle distanceStyle,
                                        GeoPoint point)

      Description copied from interface: `GeoDistance`
      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.
      Specified by:
        `computeDistance` in interface `GeoDistance`
      Parameters:
        `distanceStyle` - is the distance style.
        `point` - is the point to compute the distance to.
      Returns:
        the distance.

    - #### computeDistance

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

      Description copied from interface: `GeoDistance`
      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.
      Specified by:
        `computeDistance` in interface `GeoDistance`
        `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.

    - #### distance

          protected abstract double distance(DistanceStyle distanceStyle,
                                             double x,
                                             double y,
                                             double z)

      Called by a `computeDistance` method if X/Y/Z is not within this shape.

    - #### getDistanceBounds

          public void getDistanceBounds(Bounds bounds,
                                        DistanceStyle distanceStyle,
                                        double distanceValue)

      Description copied from interface: `GeoDistanceShape`
      Compute a bound based on a provided distance measure. This method takes an input distance and distance metric and provides bounds on the shape if reduced to match that distance. The method is allowed to return bounds that are larger than the distance would indicate, but never smaller.
      Specified by:
        `getDistanceBounds` in interface `GeoDistanceShape`
      Parameters:
        `bounds` - is the bounds object to update.
        `distanceStyle` - describes the type of distance metric provided.
        `distanceValue` - is the distance metric to use. It is presumed that the distance metric was produced with the same distance style as is provided to this method.

    - #### distanceBounds

          protected abstract void distanceBounds(Bounds bounds,
                                                 DistanceStyle distanceStyle,
                                                 double distanceValue)

      Called by a `getDistanceBounds` method if distanceValue is not Double.POSITIVE_INFINITY.

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