Package org.apache.lucene.spatial3d.geom

# Class GeoBaseMembershipShape

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

All Implemented Interfaces:
  `Bounded`, `GeoBounds`, `GeoMembershipShape`, `GeoOutsideDistance`, `GeoShape`, `Membership`, `PlanetObject`, `SerializableObject`

Direct Known Subclasses:
  `GeoBaseDistanceShape`, `GeoDegenerateVerticalLine`

public abstract class GeoBaseMembershipShape extends GeoBaseShape implements GeoMembershipShape
Membership shapes have capabilities of both geohashing and membership determination. This is a useful baseclass for them.

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
  Description
  `GeoBaseMembershipShape(PlanetModel planetModel)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `computeOutsideDistance(DistanceStyle distanceStyle, double x, double y, double z)`
  Compute this shape's distance to the GeoPoint.
  `double`
  `computeOutsideDistance(DistanceStyle distanceStyle, GeoPoint point)`
  Compute this shape's distance to the GeoPoint.
  `boolean`
  `isWithin(Vector point)`
  Check if a point is within this shape.
  `protected abstract double`
  `outsideDistance(DistanceStyle distanceStyle, double x, double y, double z)`
  Called by a `computeOutsideDistance` method if X/Y/Z is not within this shape.

  ### Methods inherited from class org.apache.lucene.spatial3d.geom.GeoBaseBounds

  `getBounds`

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

  `equals, getPlanetModel, hashCode, write`

  ### 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.Bounded

  `getBounds`

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

  `getEdgePoints, intersects`

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

  `isWithin`

  ### Methods inherited from interface org.apache.lucene.spatial3d.geom.PlanetObject

  `getPlanetModel`

  ### Methods inherited from interface org.apache.lucene.spatial3d.geom.SerializableObject

  `write`

- ## Constructor Details

  - ### GeoBaseMembershipShape

    public GeoBaseMembershipShape(PlanetModel planetModel)
    Constructor.
    Parameters:
      `planetModel` - is the planet model to use.

- ## Method Details

  - ### 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`
    Parameters:
      `point` - is the point to check.
    Returns:
      true if the point is within this shape

  - ### computeOutsideDistance

    public double computeOutsideDistance(DistanceStyle distanceStyle, GeoPoint point)
    Description copied from interface: `GeoOutsideDistance`
    Compute this shape's distance to the GeoPoint. A return value of 0.0 should be returned for points inside of the shape.
    Specified by:
      `computeOutsideDistance` in interface `GeoOutsideDistance`
    Parameters:
      `distanceStyle` - is the distance style.
      `point` - is the point to compute the distance to.
    Returns:
      the distance.

  - ### computeOutsideDistance

    public double computeOutsideDistance(DistanceStyle distanceStyle, double x, double y, double z)
    Description copied from interface: `GeoOutsideDistance`
    Compute this shape's distance to the GeoPoint. A return value of 0.0 should be returned for points inside of the shape.
    Specified by:
      `computeOutsideDistance` in interface `GeoOutsideDistance`
    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.

  - ### outsideDistance

    protected abstract double outsideDistance(DistanceStyle distanceStyle, double x, double y, double z)
    Called by a `computeOutsideDistance` method if X/Y/Z is not within this shape.