Module org.apache.lucene.spatial3d
Package org.apache.lucene.spatial3d.geom
Class GeoStandardPath.BaseSegmentEndpoint
java.lang.Object
org.apache.lucene.spatial3d.geom.BasePlanetObject
org.apache.lucene.spatial3d.geom.GeoBaseBounds
org.apache.lucene.spatial3d.geom.GeoStandardPath.BaseSegmentEndpoint
- All Implemented Interfaces:
Bounded,GeoBounds,GeoStandardPath.PathComponent,GeoStandardPath.SegmentEndpoint,Membership,PlanetObject,SerializableObject
- Direct Known Subclasses:
GeoStandardPath.CircleSegmentEndpoint,GeoStandardPath.CutoffDualCircleSegmentEndpoint
- Enclosing class:
GeoStandardPath
private static class GeoStandardPath.BaseSegmentEndpoint
extends GeoBaseBounds
implements GeoStandardPath.SegmentEndpoint
Base implementation of SegmentEndpoint
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Membership[]Null membershipprotected final GeoPointThe center point of the endpointprotected final GeoStandardPath.PathComponentThe previous path elementFields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
planetModel -
Constructor Summary
ConstructorsConstructorDescriptionBaseSegmentEndpoint(PlanetModel planetModel, GeoStandardPath.PathComponent previous, GeoPoint point) -
Method Summary
Modifier and TypeMethodDescriptiondoubledistance(DistanceStyle distanceStyle, double x, double y, double z) Compute distance measure starting from beginning of the path and including perpendicular dog-leg to a point within the corridor.booleandoublefullPathDistance(DistanceStyle distanceStyle) Compute the total distance this path component adds to the path.voidCompute bounds for the shape.doublegetStartingDistance(DistanceStyle distanceStyle) Retrieve the starting distance along the path for this path element.inthashCode()booleanintersects(GeoShape geoShape) Determine if this endpoint intersects a GeoShape.booleanintersects(Plane p, XYZBounds planeBounds, GeoPoint[] notablePoints, Membership[] bounds) Determine if this endpoint intersects a specified plane.booleanisWithin(double x, double y, double z) Check if point is within this endpoint.booleanCheck if point is within this endpoint.booleanisWithinSection(double x, double y, double z) Check if point is within this section (within cutoff planes).booleanisWithinSection(Vector point) Check if point is within this section (within cutoff planes).nearestDistance(DistanceStyle distanceStyle, double x, double y, double z) Get the nearest distance for a point.doublenearestPathDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute nearest path distance (distance from start of segment to point adjacent the one specitied, if reachable by this segment).doubleoutsideDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute external distance.doublepathCenterDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute path center distance (distance from the point to center of the path, if reachable by this segment).doublepathDeltaDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute delta path distance.doublepathDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute path distance.toString()Methods inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
getPlanetModel, writeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.spatial3d.geom.PlanetObject
getPlanetModelMethods inherited from interface org.apache.lucene.spatial3d.geom.SerializableObject
write
-
Field Details
-
previous
The previous path element -
point
The center point of the endpoint -
NO_MEMBERSHIP
Null membership
-
-
Constructor Details
-
BaseSegmentEndpoint
public BaseSegmentEndpoint(PlanetModel planetModel, GeoStandardPath.PathComponent previous, GeoPoint point)
-
-
Method Details
-
isWithin
Description copied from interface:GeoStandardPath.PathComponentCheck if point is within this endpoint.- Specified by:
isWithinin interfaceGeoStandardPath.PathComponent- Specified by:
isWithinin interfaceMembership- Parameters:
point- is the point.- Returns:
- true of within.
-
isWithin
public boolean isWithin(double x, double y, double z) Description copied from interface:GeoStandardPath.PathComponentCheck if point is within this endpoint.- Specified by:
isWithinin interfaceGeoStandardPath.PathComponent- Specified by:
isWithinin interfaceMembership- Parameters:
x- is the point x.y- is the point y.z- is the point z.- Returns:
- true of within.
-
isWithinSection
public boolean isWithinSection(double x, double y, double z) Description copied from interface:GeoStandardPath.PathComponentCheck if point is within this section (within cutoff planes).- Specified by:
isWithinSectionin interfaceGeoStandardPath.PathComponent
-
isWithinSection
Description copied from interface:GeoStandardPath.PathComponentCheck if point is within this section (within cutoff planes).- Specified by:
isWithinSectionin interfaceGeoStandardPath.PathComponent
-
getStartingDistance
Description copied from interface:GeoStandardPath.PathComponentRetrieve the starting distance along the path for this path element.- Specified by:
getStartingDistancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance style- Returns:
- the starting path distance in aggregation form
-
distance
Description copied from interface:GeoStandardPath.PathComponentCompute distance measure starting from beginning of the path and including perpendicular dog-leg to a point within the corridor.- Specified by:
distancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance stylex- is the x coordinate of the point we want to get the distance toy- is the y coordinate of the point we want to get the distance toz- is the z coordinate of the point we want to get the distance to- Returns:
- the distance from start of path
-
nearestDistance
public GeoStandardPath.DistancePair nearestDistance(DistanceStyle distanceStyle, double x, double y, double z) Description copied from interface:GeoStandardPath.PathComponentGet the nearest distance for a point. This is the old "legacy" computation: We find the segment endpoint or path segment with the closest pathCenterDistance(), and keep track of the one where that's at a minimum. We then compute nearestPathDistance() if it's a segment and add that to fullPathDistance() computed along the entire path up to that point.So what we are minimizing is not what we are returning here. That is why this is tricky to modularize; we need to return two values: the best pathCenterDistance, and the corresponding nearestPathDistance + startingDistance.
- Specified by:
nearestDistancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance stylex- is the x coordinate of the point we want to get the distance toy- is the y coordinate of the point we want to get the distance toz- is the z coordinate of the point we want to get the distance to- Returns:
- the DistancePair containing both distances described above
-
fullPathDistance
Description copied from interface:GeoStandardPath.PathComponentCompute the total distance this path component adds to the path.- Specified by:
fullPathDistancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance style.- Returns:
- the full path distance.
-
pathDeltaDistance
Description copied from interface:GeoStandardPath.PathComponentCompute delta path distance.- Specified by:
pathDeltaDistancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance style.x- is the point x.y- is the point y.z- is the point z.- Returns:
- the distance metric, in aggregation form.
-
pathDistance
Description copied from interface:GeoStandardPath.PathComponentCompute path distance.- Specified by:
pathDistancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance style.x- is the point x.y- is the point y.z- is the point z.- Returns:
- the distance
-
nearestPathDistance
Description copied from interface:GeoStandardPath.PathComponentCompute nearest path distance (distance from start of segment to point adjacent the one specitied, if reachable by this segment).- Specified by:
nearestPathDistancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance style.x- is the point x.y- is the point y.z- is the point z.- Returns:
- the distance metric, in aggregation form.
-
pathCenterDistance
Description copied from interface:GeoStandardPath.PathComponentCompute path center distance (distance from the point to center of the path, if reachable by this segment).- Specified by:
pathCenterDistancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance style.x- is the point x.y- is the point y.z- is the point z.- Returns:
- the distance metric, or POSITIVE_INFINITY if the point is not within the bounds of the path segment.
-
outsideDistance
Description copied from interface:GeoStandardPath.PathComponentCompute external distance.- Specified by:
outsideDistancein interfaceGeoStandardPath.PathComponent- Parameters:
distanceStyle- is the distance style.x- is the point x.y- is the point y.z- is the point z.- Returns:
- the distance metric.
-
intersects
public boolean intersects(Plane p, XYZBounds planeBounds, GeoPoint[] notablePoints, Membership[] bounds) Description copied from interface:GeoStandardPath.PathComponentDetermine if this endpoint intersects a specified plane.- Specified by:
intersectsin interfaceGeoStandardPath.PathComponent- Parameters:
p- is the plane.planeBounds- are the XYZBounds of the plane we're looking for an intersection with.notablePoints- are the points associated with the plane.bounds- are any bounds which the intersection must lie within.- Returns:
- true if there is a matching intersection.
-
intersects
Description copied from interface:GeoStandardPath.PathComponentDetermine if this endpoint intersects a GeoShape.- Specified by:
intersectsin interfaceGeoStandardPath.PathComponent- Parameters:
geoShape- is the GeoShape.- Returns:
- true if there is shape intersect this endpoint.
-
getBounds
Description copied from interface:BoundedCompute bounds for the shape.- Specified by:
getBoundsin interfaceBounded- Specified by:
getBoundsin interfaceGeoStandardPath.PathComponent- Overrides:
getBoundsin classGeoBaseBounds- Parameters:
bounds- is the input bounds object. The input object will be modified.
-
equals
- Overrides:
equalsin classBasePlanetObject
-
hashCode
public int hashCode()- Overrides:
hashCodein classBasePlanetObject
-
toString
-