Class MetadataExtractor.GeoLocation

  • Enclosing class:
    MetadataExtractor

    public final class MetadataExtractor.GeoLocation
    extends java.lang.Object
    Represents a latitude and longitude pair, giving a position on earth in spherical coordinates.

    Values of latitude and longitude are given in degrees.

    This type is immutable.

    • Field Detail

      • _latitude

        private double _latitude
      • _longitude

        private double _longitude
    • Constructor Detail

      • GeoLocation

        public GeoLocation()
      • GeoLocation

        public GeoLocation​(double latitude,
                           double longitude)
        Instantiates a new instance of MetadataExtractor.GeoLocation.
        Parameters:
        latitude - the latitude, in degrees
        longitude - the longitude, in degrees
    • Method Detail

      • getLatitude

        public double getLatitude()
        Returns:
        the latitudinal angle of this location, in degrees.
      • getLongitude

        public double getLongitude()
        Returns:
        the longitudinal angle of this location, in degrees.
      • isZero

        public boolean isZero()
        Returns:
        true, if both latitude and longitude are equal to zero
      • decimalToDegreesMinutesSecondsString

        public java.lang.String decimalToDegreesMinutesSecondsString​(double decimal)
        Converts a decimal degree angle into its corresponding DMS (degrees-minutes-seconds) representation as a string, of format: -1° 23' 4.56"
      • decimalToDegreesMinutesSeconds

        public double[] decimalToDegreesMinutesSeconds​(double decimal)
        Converts a decimal degree angle into its corresponding DMS (degrees-minutes-seconds) component values, as a double array.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this location, of format: 1.23, 4.56
      • toDMSString

        public java.lang.String toDMSString()
        Returns:
        a string representation of this location, of format: -1° 23' 4.56", 54° 32' 1.92"