Class Geoid

java.lang.Object
io.jenetics.jpx.geom.Geoid

public final class Geoid extends Object
Implementation of geodetic functions.
Since:
1.0
Version:
1.0
See Also:
  • Field Details

  • Method Details

    • ellipsoid

      public Ellipsoid ellipsoid()
      Return the ellipsoid the Geom object is using.
      Returns:
      the ellipsoid the Geom object is using
    • distance

      public Length distance(Point start, Point end)
      Calculate the distance between points on an ellipsoidal earth model. This method will throw an ArithmeticException if the algorithm doesn't converge while calculating the distance, which is the case for a point and its (near) antidote.
      Parameters:
      start - the start point
      end - the end point
      Returns:
      the distance between start and end in meters
      Throws:
      NullPointerException - if one of the points is null
      ArithmeticException - if the algorithm used for calculating the distance between start and end didn't converge, which is the case for a point and its (near) antidote.
      See Also:
    • toPathLength

      Return a collector which calculates the length of the (open) path which is defined by the Point stream.
      final Length length = gpx.tracks() .flatMap(Track::segments) .flatMap(TrackSegment::points) .collect(Geoid.WGSC_84.toPathLength());
      The returned Collector doesn't work for parallel stream. Using it for a parallel point stream will throw an UnsupportedOperationException at runtime.
      Returns:
      a new path length collector
      See Also:
    • toTourLength

      Return a collector which calculates the length of the (closed) tour which is defined by the Point stream. The tour length additionally adds the distance of the last point back to the first point.
      final Length length = gpx.tracks() .flatMap(Track::segments) .flatMap(TrackSegment::points) .collect(Geoid.WGSC_84.toTourLength());
      The returned Collector doesn't work for parallel stream. Using it for a parallel point stream will throw an UnsupportedOperationException at runtime.
      Returns:
      a new path length collector
      See Also:
    • of

      public static Geoid of(Ellipsoid ellipsoid)
      Create a new Geoid object with the given ellipsoid.
      Parameters:
      ellipsoid - the ellipsoid used by the geoid
      Returns:
      a new Geoid object with the given ellipsoid
      Throws:
      NullPointerException - if the given ellipsoid is null