org.apache.lucene.geo3d

## Class GeoBaseDistanceShape

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

- All Implemented Interfaces:
    GeoDistance, GeoDistanceShape, GeoMembershipShape, GeoOutsideDistance, GeoShape, Membership
  Direct Known Subclasses:
    GeoBaseCircle, GeoPath

      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.geo3d.BasePlanetObject

      `planetModel`

  - ### Constructor Summary

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

  - ### Method Summary

    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.
    `boolean` | `isWithin(Vector point)` Check if a point is within this shape.

    - ### Methods inherited from class org.apache.lucene.geo3d.GeoBaseMembershipShape

      `computeOutsideDistance, computeOutsideDistance, outsideDistance`

    - ### Methods inherited from class org.apache.lucene.geo3d.GeoBaseShape

      `getBounds`

    - ### Methods inherited from class org.apache.lucene.geo3d.BasePlanetObject

      `equals, hashCode`

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

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

    - ### Methods inherited from interface org.apache.lucene.geo3d.GeoShape

      `getBounds, getEdgePoints, intersects`

    - ### Methods inherited from interface org.apache.lucene.geo3d.GeoOutsideDistance

      `computeOutsideDistance, computeOutsideDistance`

    - ### Methods inherited from interface org.apache.lucene.geo3d.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.MAX_VALUE 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.MAX_VALUE 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.

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