Module org.apache.lucene.spatial3d
Package org.apache.lucene.spatial3d.geom
Class GeoBaseDistanceShape
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
org.apache.lucene.spatial3d.geom.GeoBaseAreaShape
org.apache.lucene.spatial3d.geom.GeoBaseDistanceShape
- All Implemented Interfaces:
Bounded,GeoArea,GeoAreaShape,GeoBounds,GeoDistance,GeoDistanceShape,GeoMembershipShape,GeoOutsideDistance,GeoShape,Membership,PlanetObject,SerializableObject
- Direct Known Subclasses:
GeoBaseCircle,GeoBasePath
Distance shapes have capabilities of both geohashing and distance computation (which also
includes point membership determination).
-
Field Summary
Fields inherited from class org.apache.lucene.spatial3d.geom.GeoBaseAreaShape
ALL_INSIDE, NONE_INSIDE, SOME_INSIDEFields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
planetModel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecomputeDeltaDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute the shape's delta distance given a point.doublecomputeDeltaDistance(DistanceStyle distanceStyle, GeoPoint point) Compute the shape's delta distance given a point.doublecomputeDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute this shape's internal "distance" to the GeoPoint.doublecomputeDistance(DistanceStyle distanceStyle, GeoPoint point) Compute this shape's internal "distance" to the GeoPoint.protected doubledeltaDistance(DistanceStyle distanceStyle, double x, double y, double z) Called by acomputeDeltaDistancemethod if X/Y/Z is within this shape.protected abstract doubledistance(DistanceStyle distanceStyle, double x, double y, double z) Called by acomputeDistancemethod if X/Y/Z is within this shape.protected abstract voiddistanceBounds(Bounds bounds, DistanceStyle distanceStyle, double distanceValue) Called by agetDistanceBoundsmethod if distanceValue is not Double.POSITIVE_INFINITY.voidgetDistanceBounds(Bounds bounds, DistanceStyle distanceStyle, double distanceValue) Compute a bound based on a provided distance measure.booleanCheck if a point is within this shape.Methods inherited from class org.apache.lucene.spatial3d.geom.GeoBaseAreaShape
getRelationship, isGeoAreaShapeInsideShape, isShapeInsideGeoAreaShapeMethods inherited from class org.apache.lucene.spatial3d.geom.GeoBaseMembershipShape
computeOutsideDistance, computeOutsideDistance, outsideDistanceMethods inherited from class org.apache.lucene.spatial3d.geom.GeoBaseBounds
getBoundsMethods inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
equals, getPlanetModel, hashCode, writeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.spatial3d.geom.GeoArea
getRelationshipMethods inherited from interface org.apache.lucene.spatial3d.geom.GeoAreaShape
intersectsMethods inherited from interface org.apache.lucene.spatial3d.geom.GeoOutsideDistance
computeOutsideDistance, computeOutsideDistanceMethods inherited from interface org.apache.lucene.spatial3d.geom.GeoShape
getEdgePoints, intersectsMethods inherited from interface org.apache.lucene.spatial3d.geom.Membership
isWithinMethods inherited from interface org.apache.lucene.spatial3d.geom.PlanetObject
getPlanetModelMethods inherited from interface org.apache.lucene.spatial3d.geom.SerializableObject
write
-
Constructor Details
-
GeoBaseDistanceShape
Constructor.- Parameters:
planetModel- is the planet model to use.
-
-
Method Details
-
isWithin
Description copied from interface:MembershipCheck if a point is within this shape.- Specified by:
isWithinin interfaceMembership- Overrides:
isWithinin classGeoBaseMembershipShape- Parameters:
point- is the point to check.- Returns:
- true if the point is within this shape
-
computeDistance
Description copied from interface:GeoDistanceCompute 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:
computeDistancein interfaceGeoDistance- Parameters:
distanceStyle- is the distance style.point- is the point to compute the distance to.- Returns:
- the distance.
-
computeDistance
Description copied from interface:GeoDistanceCompute 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:
computeDistancein interfaceGeoDistance- 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.
-
distance
Called by acomputeDistancemethod if X/Y/Z is within this shape. -
computeDeltaDistance
Description copied from interface:GeoDistanceCompute 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.- Specified by:
computeDeltaDistancein interfaceGeoDistance- Parameters:
distanceStyle- is the distance style.point- is the point to compute the distance to.- Returns:
- the distance.
-
computeDeltaDistance
Description copied from interface:GeoDistanceCompute 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.- Specified by:
computeDeltaDistancein interfaceGeoDistance- 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.
-
deltaDistance
Called by acomputeDeltaDistancemethod if X/Y/Z is within this shape. -
getDistanceBounds
Description copied from interface:GeoDistanceShapeCompute 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:
getDistanceBoundsin interfaceGeoDistanceShape- 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 agetDistanceBoundsmethod if distanceValue is not Double.POSITIVE_INFINITY.
-