Interface ILatLon

All Known Subinterfaces:
INode
All Known Implementing Classes:
AudioMarker, ButtonMarker, CachedLatLon, ImageMarker, LatLon, Marker, Node, NodeData, PlayHeadMarker, TileZXY, VectorNode, WayPoint, WebMarker

public interface ILatLon
This interface represents a coordinate in LatLon space.

It provides methods to get the coordinates. The coordinates may be unknown. In this case, both lat() and lon() need to return a NaN value and isLatLonKnown() needs to return false.

Whether the coordinates are immutable or not is implementation specific.

Since:
12161
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Minimum difference in location to not be represented as the same position.
  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    Returns bearing from this point to another.
    default double
    distanceSq(double lon, double lat)
    Returns the square of euclidean distance from this Coordinate to a specified coordinate.
    default double
    Returns the euclidean distance from this ILatLon to a specified ILatLon.
    default boolean
    Determines if the other point has almost the same lat/lon values.
    default boolean
    equalsEpsilon(ILatLon other, double precision)
    Determines if the other point has almost the same lat/lon values.
    default EastNorth
    Replies the projected east/north coordinates.
    default double
    Computes the distance between this lat/lon and another point on the earth.
    default ILatLon
    interpolate(ILatLon ll2, double proportion)
    Does a linear interpolation between two ILatLon instances.
    default boolean
    Determines if this object has valid coordinates.
    double
    lat()
    Returns the latitude, i.e., the north-south position in degrees.
    double
    lon()
    Returns the longitude, i.e., the east-west position in degrees.
  • Field Details

  • Method Details

    • lon

      double lon()
      Returns the longitude, i.e., the east-west position in degrees.
      Returns:
      the longitude or NaN if isLatLonKnown() returns false
    • lat

      double lat()
      Returns the latitude, i.e., the north-south position in degrees.
      Returns:
      the latitude or NaN if isLatLonKnown() returns false
    • isLatLonKnown

      default boolean isLatLonKnown()
      Determines if this object has valid coordinates.
      Returns:
      true if this object has valid coordinates
    • getEastNorth

      default EastNorth getEastNorth(Projecting projecting)
      Replies the projected east/north coordinates.

      The result of the last conversion may be cached. Null is returned in case this object is invalid.

      Parameters:
      projecting - The projection to use.
      Returns:
      The projected east/north coordinates
      Since:
      10827
    • equalsEpsilon

      default boolean equalsEpsilon(ILatLon other)
      Determines if the other point has almost the same lat/lon values.
      Parameters:
      other - other lat/lon
      Returns:
      true if the other point has almost the same lat/lon values, only differing by no more than 1 / MAX_SERVER_PRECISION.
      Since:
      18464
    • equalsEpsilon

      default boolean equalsEpsilon(ILatLon other, double precision)
      Determines if the other point has almost the same lat/lon values.
      Parameters:
      other - other lat/lon
      precision - The precision to use
      Returns:
      true if the other point has almost the same lat/lon values, only differing by no more than 1 / precision.
      Since:
      18464
    • greatCircleDistance

      default double greatCircleDistance(ILatLon other)
      Computes the distance between this lat/lon and another point on the earth. Uses Haversine formula.
      Parameters:
      other - the other point.
      Returns:
      distance in metres.
      Since:
      18494
    • bearing

      default double bearing(ILatLon other)
      Returns bearing from this point to another. Angle starts from north and increases clockwise, PI/2 means east. Please note that reverse bearing (from other point to this point) should NOT be calculated from return value of this method, because great circle path between the two points have different bearings at each position. To get bearing from another point to this point call other.bearing(this)
      Parameters:
      other - the "destination" position
      Returns:
      heading in radians in the range 0 <= hd < 2*PI
      Since:
      18494
    • interpolate

      default ILatLon interpolate(ILatLon ll2, double proportion)
      Does a linear interpolation between two ILatLon instances.
      Parameters:
      ll2 - The other ILatLon instance.
      proportion - The proportion the other instance influences the result.
      Returns:
      The new ILatLon position.
      Since:
      18589
    • distanceSq

      default double distanceSq(double lon, double lat)
      Returns the square of euclidean distance from this Coordinate to a specified coordinate.
      Parameters:
      lon - the X coordinate of the specified point to be measured against this Coordinate
      lat - the Y coordinate of the specified point to be measured against this Coordinate
      Returns:
      the square of the euclidean distance from this Coordinate to a specified coordinate
      Since:
      18589
    • distanceSq

      default double distanceSq(ILatLon other)
      Returns the euclidean distance from this ILatLon to a specified ILatLon.
      Parameters:
      other - the specified coordinate to be measured against this ILatLon
      Returns:
      the euclidean distance from this ILatLon to a specified ILatLon
      Since:
      18589