Class LatLong


  • public class LatLong
    extends Object
    A geographical location consisting of a latitude and a longitude.
    • Constructor Detail

      • LatLong

        protected LatLong​(double latitude,
                          double longitude)
    • Method Detail

      • of

        public static LatLong of​(double latitude,
                                 double longitude)
        Create a new geographical point with given latitude and longitude.

        Note: this does not do any input validation. Valid values should be between -90 and +90 inclusive for latitude and between -180 and +180 inclusive for longitude.

        Parameters:
        latitude - the latitude
        longitude - the longitude
        Returns:
        the new point
      • latitude

        public double latitude()
        The north-south position of a point on earth.
        Returns:
        the latitude
      • longitude

        public double longitude()
        The east-west position of a point on earth.
        Returns:
        the longitude
      • toISO6709

        public String toISO6709()
        Format to String using ISO 6709. The output is in in 5 decimals. The decimal degree precision is 1.1132m at the equator
        Returns:
        notation according to ISO 6709
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object