Interface ILatLon

    • Field Summary

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

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default double bearing​(ILatLon other)
      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 distanceSq​(ILatLon other)
      Returns the euclidean distance from this ILatLon to a specified ILatLon.
      default boolean equalsEpsilon​(ILatLon other)
      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 getEastNorth​(Projecting projecting)
      Replies the projected east/north coordinates.
      default double greatCircleDistance​(ILatLon other)
      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 isLatLonKnown()
      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.
    • Method Detail

      • 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 (extracted from LatLon)
      • 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 (extracted from LatLon)
      • 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 (extracted from LatLon)
      • 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 (extracted from LatLon, added in 9796)
      • 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