Package org.teamapps.media.image
Class GeoTag
java.lang.Object
org.teamapps.media.image.GeoTag
public final class GeoTag
extends java.lang.Object
Represents a four dimensional point where/when an photo was taken.
-
Constructor Summary
Constructors Constructor Description GeoTag()Default constructor with no parameters. -
Method Summary
Modifier and Type Method Description static doubledegreesToDecimal(double degs, double mins, double secs)Converts degrees-minutes-seconds into a single value in decimal degrees.doublegetAltitude()longgetDateInMillis()doublegetLatitude()java.lang.StringgetLatitudeReference()doublegetLongitude()java.lang.StringgetLongitudeReference()java.lang.StringgetTimestamp()intgetTimestampAsEpochSeconds()voidsetAltitude(double altitude)Sets the altitude value.voidsetDate(java.lang.String date)Sets the date from a String value.voidsetLatitude(double latitude)Sets the latitude value.voidsetLatitudeReference(java.lang.String latitudeRef)Sets the hemisphere or reference for the latitude.voidsetLongitude(double longitude)Sets the longitude value.voidsetLongitudeReference(java.lang.String longitudeRef)Sets the hemisphere or reference for the longitude.voidsetTime(double hour, double min, double sec)Sets the time for this GeoInfo Object.java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
GeoTag
public GeoTag()Default constructor with no parameters. Information is added through the set methods.
-
-
Method Details
-
getLatitude
public double getLatitude()- Returns:
- the latitude in decimal degrees.
-
getAltitude
public double getAltitude()- Returns:
- the Altitude of this location, in meters above sea level.
-
getDateInMillis
public long getDateInMillis()- Returns:
- the date as UTC milliseconds from the epoch.
-
getLongitude
public double getLongitude()- Returns:
- the longitude in decimal degrees.
-
getLatitudeReference
public java.lang.String getLatitudeReference()- Returns:
- If the Latitude is (N)orth or (S)outh.
-
getLongitudeReference
public java.lang.String getLongitudeReference()- Returns:
- If the Longitude is (E)ast or (W)est.
-
getTimestamp
public java.lang.String getTimestamp()- Returns:
- the timestamp as a string in the format yyyy-MM-dd'T'hh:mm:ssZ
-
getTimestampAsEpochSeconds
public int getTimestampAsEpochSeconds() -
degreesToDecimal
public static double degreesToDecimal(double degs, double mins, double secs)Converts degrees-minutes-seconds into a single value in decimal degrees.- Parameters:
degs-mins-secs-- Returns:
- Decimal degrees value from the degrees, minutes and seconds vals.
-
setAltitude
public void setAltitude(double altitude)Sets the altitude value.- Parameters:
altitude- In meters above sea level.
-
setDate
public void setDate(java.lang.String date)Sets the date from a String value.- Parameters:
date- Must be in year:mm:dd format.
-
setLatitude
public void setLatitude(double latitude)Sets the latitude value.- Parameters:
latitude- double value between -90 and 90.
-
setLatitudeReference
public void setLatitudeReference(java.lang.String latitudeRef)Sets the hemisphere or reference for the latitude.- Parameters:
latitudeRef- String value either "N" or "S".
-
setLongitude
public void setLongitude(double longitude)Sets the longitude value.- Parameters:
longitude- double value between -180 and 180.
-
setLongitudeReference
public void setLongitudeReference(java.lang.String longitudeRef)Sets the hemisphere or reference for the longitude.- Parameters:
longitudeRef- String value either "E" or "W".
-
setTime
public void setTime(double hour, double min, double sec)Sets the time for this GeoInfo Object.- Parameters:
hour- The hour in 24 hour format.min- The minute.sec- The second.
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this GeoInfo object.
-