Class WayPoint

java.lang.Object
io.jenetics.jpx.WayPoint
All Implemented Interfaces:
Point, Serializable

public final class WayPoint extends Object implements Point, Serializable
A WayPoint represents a way-point, point of interest, or named feature on a map.

Creating a WayPoint:

final WayPoint point = WayPoint.builder() .lat(48.2081743).lon(16.3738189).ele(160) .build();
Since:
1.0
Version:
3.0
See Also:
  • Method Details

    • getLatitude

      Description copied from interface: Point
      The latitude of the point, WGS84 datum.
      Specified by:
      getLatitude in interface Point
      Returns:
      the latitude of the point
    • getLongitude

      Description copied from interface: Point
      The longitude of the point, WGS84 datum.
      Specified by:
      getLongitude in interface Point
      Returns:
      the longitude of the point
    • getElevation

      Description copied from interface: Point
      The elevation (in meters) of the point.
      Specified by:
      getElevation in interface Point
      Returns:
      the elevation (in meters) of the point
    • getSpeed

      public Optional<Speed> getSpeed()
      The current GPS speed.
      Returns:
      the current GPS speed
    • getTime

      Description copied from interface: Point
      Creation/modification timestamp for the point.
      Specified by:
      getTime in interface Point
      Returns:
      creation/modification timestamp for the point
    • getMagneticVariation

      The magnetic variation at the point.
      Returns:
      the magnetic variation at the point
    • getGeoidHeight

      The height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message.
      Returns:
      the height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid
    • getName

      public Optional<String> getName()
      The GPS name of the way-point. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS.
      Returns:
      the GPS name of the way-point
    • getComment

      The GPS way-point comment.
      Returns:
      the GPS way-point comment
    • getDescription

      Return a text description of the element. Holds additional information about the element intended for the user, not the GPS.
      Returns:
      a text description of the element
    • getSource

      Return the source of data. Included to give user some idea of reliability and accuracy of data. "Garmin eTrex", "USGS quad Boston North", e.g.
      Returns:
      the source of the data
    • getLinks

      public List<Link> getLinks()
      Return the links to additional information about the way-point.
      Returns:
      the links to additional information about the way-point
    • getSymbol

      Return the text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out.
      Returns:
      the text of GPS symbol name
    • getType

      public Optional<String> getType()
      Return the type (classification) of the way-point.
      Returns:
      the type (classification) of the way-point
    • getFix

      public Optional<Fix> getFix()
      Return the type of GPX fix.
      Returns:
      the type of GPX fix
    • getSat

      public Optional<UInt> getSat()
      Return the number of satellites used to calculate the GPX fix.
      Returns:
      the number of satellites used to calculate the GPX fix
    • getHdop

      public Optional<Double> getHdop()
      Return the horizontal dilution of precision.
      Returns:
      the horizontal dilution of precision
    • getVdop

      public Optional<Double> getVdop()
      Return the vertical dilution of precision.
      Returns:
      the vertical dilution of precision
    • getPdop

      public Optional<Double> getPdop()
      Return the position dilution of precision.
      Returns:
      the position dilution of precision
    • getAgeOfGPSData

      Return the number of seconds since last DGPS update.
      Returns:
      number of seconds since last DGPS update
    • getDGPSID

      Return the ID of DGPS station used in differential correction.
      Returns:
      the ID of DGPS station used in differential correction
    • getCourse

      Return the instantaneous course at the point. This property is only available when you read GPX files version 1.0. In version 1.1 this field is always Optional.empty().
      Returns:
      the instantaneous course at the point
      Since:
      1.3
    • getExtensions

      Return the (cloned) extensions document. The root element of the returned document has the name extensions.
      <extensions> ... </extensions>
      Returns:
      the extensions document
      Throws:
      DOMException - if the document could not be cloned, because of an erroneous XML configuration
      Since:
      1.5
    • toBuilder

      Convert the immutable way-point object into a mutable builder initialized with the current way-point values.
      Returns:
      a new way-point builder initialized with the values of this way-point
      Since:
      1.1
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static WayPoint.Builder builder()
      Return a new WayPoint builder.
      Returns:
      a new WayPoint builder
    • of

      public static WayPoint of(Latitude latitude, Longitude longitude, Length elevation, Speed speed, Instant time, Degrees magneticVariation, Length geoidHeight, String name, String comment, String description, String source, List<Link> links, String symbol, String type, Fix fix, UInt sat, Double hdop, Double vdop, Double pdop, Duration ageOfGPSData, DGPSStation dgpsID, Degrees course, Document extensions)
      Create a new way-point with the given parameter.
      Parameters:
      latitude - the latitude of the point, WGS84 datum (mandatory)
      longitude - the longitude of the point, WGS84 datum (mandatory)
      elevation - the elevation (in meters) of the point (optional)
      speed - the current GPS speed (optional)
      time - creation/modification timestamp for element. Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs. (optional)
      magneticVariation - the magnetic variation at the point (optional)
      geoidHeight - height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message. (optional)
      name - the GPS name of the way-point. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS. (optional)
      comment - GPS way-point comment. Sent to GPS as comment (optional)
      description - a text description of the element. Holds additional information about the element intended for the user, not the GPS. (optional)
      source - source of data. Included to give user some idea of reliability and accuracy of data. "Garmin eTrex", "USGS quad Boston North", e.g. (optional)
      links - links to additional information about the way-point. May be empty, but not null.
      symbol - text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out. (optional)
      type - type (classification) of the way-point (optional)
      fix - type of GPX fix (optional)
      sat - number of satellites used to calculate the GPX fix (optional)
      hdop - horizontal dilution of precision (optional)
      vdop - vertical dilution of precision (optional)
      pdop - position dilution of precision. (optional)
      ageOfGPSData - number of seconds since last DGPS update (optional)
      dgpsID - ID of DGPS station used in differential correction (optional)
      course - the Instantaneous course at the point
      extensions - the extensions document
      Returns:
      a new WayPoint
      Throws:
      NullPointerException - if the latitude or longitude is null
      Since:
      1.5
    • of

      public static WayPoint of(Latitude latitude, Longitude longitude)
      Create a new WayPoint with the given latitude and longitude value.
      Parameters:
      latitude - the latitude of the point
      longitude - the longitude of the point
      Returns:
      a new WayPoint
      Throws:
      NullPointerException - if one of the given arguments is null
    • of

      public static WayPoint of(double latitudeDegree, double longitudeDegree)
      Create a new WayPoint with the given latitude and longitude value.
      Parameters:
      latitudeDegree - the latitude of the point
      longitudeDegree - the longitude of the point
      Returns:
      a new WayPoint
      Throws:
      IllegalArgumentException - if the given latitude or longitude is not in the valid range.
    • of

      public static WayPoint of(Latitude latitude, Longitude longitude, Instant time)
      Create a new WayPoint with the given parameters.
      Parameters:
      latitude - the latitude of the point
      longitude - the longitude of the point
      time - the timestamp of the way-point
      Returns:
      a new WayPoint
      Throws:
      NullPointerException - if one of the given arguments is null
    • of

      public static WayPoint of(double latitudeDegree, double longitudeDegree, long timeEpochMilli)
      Create a new WayPoint with the given parameters.
      Parameters:
      latitudeDegree - the latitude of the point
      longitudeDegree - the longitude of the point
      timeEpochMilli - the timestamp of the way-point
      Returns:
      a new WayPoint
      Throws:
      IllegalArgumentException - if one of the given arguments is invalid
    • of

      public static WayPoint of(Latitude latitude, Longitude longitude, Length elevation, Instant time)
      Create a new WayPoint with the given parameters.
      Parameters:
      latitude - the latitude of the point
      longitude - the longitude of the point
      elevation - the elevation of the point
      time - the timestamp of the way-point
      Returns:
      a new WayPoint
      Throws:
      NullPointerException - if one of the given arguments is null
    • of

      public static WayPoint of(double latitudeDegree, double longitudeDegree, double elevationMeter, long timeEpochMilli)
      Create a new WayPoint with the given parameters.
      Parameters:
      latitudeDegree - the latitude of the point
      longitudeDegree - the longitude of the point
      elevationMeter - the elevation of the point
      timeEpochMilli - the timestamp of the way-point
      Returns:
      a new WayPoint
      Throws:
      IllegalArgumentException - if one of the given arguments is invalid
    • of

      public static WayPoint of(Latitude latitude, Longitude longitude, Length elevation, Speed speed, Instant time, Degrees magneticVariation, Length geoidHeight, String name, String comment, String description, String source, List<Link> links, String symbol, String type, Fix fix, UInt sat, Double hdop, Double vdop, Double pdop, Duration ageOfGPSData, DGPSStation dgpsID, Degrees course)
      Create a new way-point with the given parameter.
      Parameters:
      latitude - the latitude of the point, WGS84 datum (mandatory)
      longitude - the longitude of the point, WGS84 datum (mandatory)
      elevation - the elevation (in meters) of the point (optional)
      speed - the current GPS speed (optional)
      time - creation/modification timestamp for element. Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs. (optional)
      magneticVariation - the magnetic variation at the point (optional)
      geoidHeight - height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message. (optional)
      name - the GPS name of the way-point. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS. (optional)
      comment - GPS way-point comment. Sent to GPS as comment (optional)
      description - a text description of the element. Holds additional information about the element intended for the user, not the GPS. (optional)
      source - source of data. Included to give user some idea of reliability and accuracy of data. "Garmin eTrex", "USGS quad Boston North", e.g. (optional)
      links - links to additional information about the way-point. May be empty, but not null.
      symbol - text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out. (optional)
      type - type (classification) of the way-point (optional)
      fix - type of GPX fix (optional)
      sat - number of satellites used to calculate the GPX fix (optional)
      hdop - horizontal dilution of precision (optional)
      vdop - vertical dilution of precision (optional)
      pdop - position dilution of precision. (optional)
      ageOfGPSData - number of seconds since last DGPS update (optional)
      dgpsID - ID of DGPS station used in differential correction (optional)
      course - the Instantaneous course at the point
      Returns:
      a new WayPoint
      Throws:
      NullPointerException - if the latitude or longitude is null
      Since:
      1.3
    • of

      public static WayPoint of(Point point)
      Return a (new) WayPoint from the given input point. If the given point is already a WayPoint instance, the input is casted to a WayPoint and returned.
      Parameters:
      point - the input point to create the WayPoint from
      Returns:
      a newly created WayPoint instance, or the input point if it is already a WayPoint instance
      Throws:
      NullPointerException - if the given point is null
      Since:
      1.4