public class GeoCoord
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
GeoCoord(double latitude,
double longitude)
Constructor - sets the latitude and longitude.
|
GeoCoord(double latitude,
double longitude,
double altitude)
Constructor - sets the latitude, longitude, and altitude.
|
GeoCoord(java.lang.String latLonStr)
Constructor, accepting DDMMSS-formatted String with the two coordinates
separated by a space or slash.
|
GeoCoord(java.lang.String latString,
java.lang.String lonString)
Constructor, with two DDMMSS-formatted strings.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Determine if a particular object is equal to this GeoCoord.
|
double |
getAltitude()
Gets the altitude, in meters
|
double |
getAzimuth(GeoCoord targetPoint)
Returns the azimuth, measured from true north, to the targetPoint.
|
GeoCoord |
getBearingPoint(double distance,
double azimuth)
returns a new GeoCoord at the specified distance and azimuth from this
GeoCoord.
|
GeoCoord |
getBearingPointRadians(double dist,
double azi)
returns a new GeoCoord at the specified distance and azimuth from this
GeoCoord.
|
double |
getDistance(GeoCoord targetPoint)
Returns the distance from this coordinate to the targetPoint.
|
double |
getDistanceRadians(GeoCoord targetPoint)
Returns the distance from this coordinate to the targetPoint.
|
double |
getLatitude()
Returns the latitude (in degrees)
|
double |
getLatRadians()
Returns the latitude in radians
|
java.lang.String |
getLatString()
Returns the Latitude of this coordinate in DDMMSS format, with either N
or S appended.
|
double |
getLongitude()
Returns the longitude (in degrees)
|
double |
getLonRadians()
Returns the longitude in degrees
|
java.lang.String |
getLonString()
Returns the Longitude of this coordinate in DDDMMSS format, with either
E or W appended.
|
int |
hashCode()
Returns a hash code value for the object.
|
void |
setAltitude(double altitude)
Set the altitude of this GeoCoord.
|
void |
setAltitude(Measure altitude)
Set the altitude of this GeoCoord using a linear measurement
|
java.lang.String |
toString()
Return a string representation of this coordiante.
|
public GeoCoord(double latitude, double longitude)
latitude
- the latitude of the coordinatelongitude
- the longitude of the coordinatepublic GeoCoord(double latitude, double longitude, double altitude)
latitude
- the latitude of the coordinatelongitude
- the longitude of the coordinatealtitude
- the altitude of the coordinatepublic GeoCoord(java.lang.String latLonStr)
123456N 1352457W
is a valid coordinate, as is
12.4567,-135.7897
.latLonStr
- a latitude/longitude string, in either DDMMSS format or
in decimal degreespublic GeoCoord(java.lang.String latString, java.lang.String lonString)
latString
- a string representing the latitudelonString
- a string representing the longitudepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to comparepublic double getAltitude()
public double getAzimuth(GeoCoord targetPoint)
targetPoint
- the coordinate to find the azimuth topublic GeoCoord getBearingPoint(double distance, double azimuth)
distance
- the distance, in meters, to the target pointazimuth
- the azimuth to the target point, in degreespublic GeoCoord getBearingPointRadians(double dist, double azi)
dist
- the distance, in radians, to the target pointazi
- the azimuth to the target point, in radianspublic double getDistance(GeoCoord targetPoint)
targetPoint
- the coordinate to find the distance topublic double getDistanceRadians(GeoCoord targetPoint)
targetPoint
- the coordinate to find the distance topublic double getLatitude()
public double getLatRadians()
public java.lang.String getLatString()
public double getLongitude()
public double getLonRadians()
public java.lang.String getLonString()
public int hashCode()
hashCode
in class java.lang.Object
public void setAltitude(double altitude)
altitude
- the altitude, in meterspublic void setAltitude(Measure altitude)
altitude
- the altitude in any unitpublic java.lang.String toString()
toString
in class java.lang.Object