org.apache.lucene.geo3d

## Class GeoPath

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

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

      public class GeoPath
      extends GeoBaseDistanceShape

  GeoShape representing a path across the surface of the globe, with a specified half-width. Path is described by a series of points. Distances are measured from the starting point along the path, and then at right angles to the path.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GeoPath.PathSegment` This is the pre-calculated data for a path segment.
    `static class` | `GeoPath.SegmentEndpoint` This is precalculated data for segment endpoint.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected double` | `cosAngle` Cosine of cutoff angle
    `protected double` | `cutoffAngle` The cutoff angle (width)
    `protected GeoPoint[]` | `edgePoints` A point on the edge
    `protected List<GeoPath.SegmentEndpoint>` | `endPoints` A list of SegmentEndpoints
    `protected boolean` | `isDone` Set to true if path has been completely constructed
    `protected List<GeoPoint>` | `points` The original list of path points
    `protected List<GeoPath.PathSegment>` | `segments` A list of PathSegments
    `protected double` | `sinAngle` Sine of cutoff angle

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

      `planetModel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoPath(PlanetModel planetModel, double maxCutoffAngle)` Piece-wise constructor.
    `GeoPath(PlanetModel planetModel, double maxCutoffAngle, GeoPoint[] pathPoints)` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPoint(double lat, double lon)` Add a point to the path.
    `protected double` | `distance(DistanceStyle distanceStyle, double x, double y, double z)` Called by a `computeDistance` method if X/Y/Z is not within this shape.
    `void` | `done()` Complete the path.
    `boolean` | `equals(Object o)`
    `void` | `getBounds(Bounds bounds)` Compute bounds for the shape.
    `GeoPoint[]` | `getEdgePoints()` Return a sample point that is on the outside edge/boundary of the shape.
    `int` | `hashCode()`
    `boolean` | `intersects(Plane plane, GeoPoint[] notablePoints, Membership... bounds)` Assess whether a plane, within the provided bounds, intersects with the shape.
    `boolean` | `isWithin(double x, double y, double z)` Check if a point is within this shape.
    `protected double` | `outsideDistance(DistanceStyle distanceStyle, double x, double y, double z)` Called by a `computeOutsideDistance` method if X/Y/Z is not within this shape.
    `String` | `toString()`

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

      `computeDistance, computeDistance, isWithin`

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

      `computeOutsideDistance, computeOutsideDistance`

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

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

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

      `computeOutsideDistance, computeOutsideDistance`

- - ### Field Detail

    - #### cutoffAngle

          protected final double cutoffAngle

      The cutoff angle (width)

    - #### sinAngle

          protected final double sinAngle

      Sine of cutoff angle

    - #### cosAngle

          protected final double cosAngle

      Cosine of cutoff angle

    - #### points

          protected final List<GeoPoint> points

      The original list of path points

    - #### endPoints

          protected List<GeoPath.SegmentEndpoint> endPoints

      A list of SegmentEndpoints

    - #### segments

          protected List<GeoPath.PathSegment> segments

      A list of PathSegments

    - #### edgePoints

          protected GeoPoint[] edgePoints

      A point on the edge

    - #### isDone

          protected boolean isDone

      Set to true if path has been completely constructed

  - ### Constructor Detail

    - #### GeoPath

          public GeoPath(PlanetModel planetModel,
                 double maxCutoffAngle,
                 GeoPoint[] pathPoints)

      Constructor.
      Parameters:
        `planetModel` - is the planet model.
        `maxCutoffAngle` - is the width of the path, measured as an angle.
        `pathPoints` - are the points in the path.

    - #### GeoPath

          public GeoPath(PlanetModel planetModel,
                 double maxCutoffAngle)

      Piece-wise constructor. Use in conjunction with addPoint() and done().
      Parameters:
        `planetModel` - is the planet model.
        `maxCutoffAngle` - is the width of the path, measured as an angle.

  - ### Method Detail

    - #### addPoint

          public void addPoint(double lat,
                      double lon)

      Add a point to the path.
      Parameters:
        `lat` - is the latitude of the point.
        `lon` - is the longitude of the point.

    - #### done

          public void done()

      Complete the path.

    - #### distance

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

      Description copied from class: `GeoBaseDistanceShape`
      Called by a `computeDistance` method if X/Y/Z is not within this shape.
      Specified by:
        `distance` in class `GeoBaseDistanceShape`

    - #### outsideDistance

          protected double outsideDistance(DistanceStyle distanceStyle,
                               double x,
                               double y,
                               double z)

      Description copied from class: `GeoBaseMembershipShape`
      Called by a `computeOutsideDistance` method if X/Y/Z is not within this shape.
      Specified by:
        `outsideDistance` in class `GeoBaseMembershipShape`

    - #### isWithin

          public boolean isWithin(double x,
                         double y,
                         double z)

      Description copied from interface: `Membership`
      Check if a point is within this shape.
      Parameters:
        `x` - is x coordinate of point to check.
        `y` - is y coordinate of point to check.
        `z` - is z coordinate of point to check.
      Returns:
        true if the point is within this shape

    - #### getEdgePoints

          public GeoPoint[] getEdgePoints()

      Description copied from interface: `GeoShape`
      Return a sample point that is on the outside edge/boundary of the shape.
      Returns:
        samples of all edge points from distinct edge sections. Typically one point is returned, but zero or two are also possible.

    - #### intersects

          public boolean intersects(Plane plane,
                           GeoPoint[] notablePoints,
                           Membership... bounds)

      Description copied from interface: `GeoShape`
      Assess whether a plane, within the provided bounds, intersects with the shape. Note well that this method is allowed to return "true" if there are internal edges of a composite shape which intersect the plane. Doing this can cause getRelationship() for most GeoBBox shapes to return OVERLAPS rather than the more correct CONTAINS, but that cannot be helped for some complex shapes that are built out of overlapping parts.
      Parameters:
        `plane` - is the plane to assess for intersection with the shape's edges or bounding curves.
        `notablePoints` - represents the intersections of the plane with the supplied bounds. These are used to disambiguate when two planes are identical and it needs to be determined whether any points exist that fulfill all the bounds.
        `bounds` - are a set of bounds that define an area that an intersection must be within in order to qualify (provided by a GeoArea).
      Returns:
        true if there's such an intersection, false if not.

    - #### getBounds

          public void getBounds(Bounds bounds)

      Description copied from interface: `GeoShape`
      Compute bounds for the shape.
      Specified by:
        `getBounds` in interface `GeoShape`
      Overrides:
        `getBounds` in class `GeoBaseShape`
      Parameters:
        `bounds` - is the input bounds object. The input object will be modified.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `BasePlanetObject`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `BasePlanetObject`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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